@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.
@@ -0,0 +1,2 @@
1
+ var e,t,n={851:(e,t,n)=>{var r=n(681);Object.defineProperty(t,"reduxBatch",{enumerable:!0,get:function(){return r.reduxBatch}})},681:(e,t)=>{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,P=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=d.Symbol,D=A.propertyIsEnumerable,b=E.splice,O=R?R.isConcatSpreadable:void 0,v=Math.max,x=G(d,"Map"),w=G(Object,"create");function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function F(e){var t=-1,n=e?e.length:0;for(this.__data__=new U;++t<n;)this.add(e[t])}function j(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function V(e,t,n,r){var s,a=-1,o=p,i=!0,c=e.length,l=[],u=t.length;if(!c)return l;n&&(t=function(e,t){for(var n=-1,r=e?e.length:0,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}(t,(s=n,function(e){return s(e)}))),r?(o=h,i=!1):t.length>=200&&(o=m,i=!1,t=new F(t));e:for(;++a<c;){var d=e[a],g=n?n(d):d;if(d=r||0!==d?d:0,i&&g==g){for(var f=u;f--;)if(t[f]===g)continue e;l.push(d)}else o(t,g,r)||l.push(d)}return l}function k(e,t,n,r,s){var a=-1,o=e.length;for(n||(n=W),s||(s=[]);++a<o;){var i=e[a];t>0&&n(i)?t>1?k(i,t-1,n,r,s):g(s,i):r||(s[s.length]=i)}return s}function $(e){if(!Q(e)||(t=e,C&&C in t))return!1;var t,n=J(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?P:c;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return $(n)?n:void 0}function W(e){return Y(e)||function(e){return X(e)&&T.call(e,"callee")&&(!D.call(e,"callee")||N.call(e)==a)}(e)||!!(O&&e&&e[O])}M.prototype.clear=function(){this.__data__=w?w(null):{}},M.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},M.prototype.get=function(e){var t=this.__data__;if(w){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},M.prototype.has=function(e){var t=this.__data__;return w?void 0!==t[e]:T.call(t,e)},M.prototype.set=function(e,t){return this.__data__[e]=w&&void 0===t?r:t,this},L.prototype.clear=function(){this.__data__=[]},L.prototype.delete=function(e){var t=this.__data__,n=j(t,e);return!(n<0)&&(n==t.length-1?t.pop():b.call(t,n,1),!0)},L.prototype.get=function(e){var t=this.__data__,n=j(t,e);return n<0?void 0:t[n][1]},L.prototype.has=function(e){return j(this.__data__,e)>-1},L.prototype.set=function(e,t){var n=this.__data__,r=j(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},U.prototype.clear=function(){this.__data__={hash:new M,map:new(x||L),string:new M}},U.prototype.delete=function(e){return B(this,e).delete(e)},U.prototype.get=function(e){return B(this,e).get(e)},U.prototype.has=function(e){return B(this,e).has(e)},U.prototype.set=function(e,t){return B(this,e).set(e,t),this},F.prototype.add=F.prototype.push=function(e){return this.__data__.set(e,r),this},F.prototype.has=function(e){return this.__data__.has(e)};var H,q,z=(H=function(e,t){return X(e)?V(e,k(t,1,X,!0)):[]},q=v(void 0===q?H.length-1:q,0),function(){for(var e=arguments,t=-1,n=v(e.length-q,0),r=Array(n);++t<n;)r[t]=e[q+t];t=-1;for(var s=Array(q+1);++t<q;)s[t]=e[t];return s[q]=r,function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(H,this,s)});var Y=Array.isArray;function K(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}(e.length)&&!J(e)}function X(e){return function(e){return!!e&&"object"==typeof e}(e)&&K(e)}function J(e){var t=Q(e)?N.call(e):"";return t==o||t==i}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=z},188:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")();var y,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,P=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=m.Symbol,D=E.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,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:"",P=C.toString,R=S.hasOwnProperty,D=S.toString,b=RegExp("^"+P.call(R).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&&R.call(e,t)}function B(e){if(!Q(e)||(t=e,N&&N in t))return!1;var t,n=X(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?b:f;return n.test(function(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function G(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function W(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return B(n)?n:void 0}function H(e,t,n){var r;t=function(e,t){if(K(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||ee(e))return!0;return d.test(e)||!u.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:K(r=t)?r:q(r);for(var s,i=-1,c=t.length;++i<c;){var l=z(t[i]);if(!(s=null!=e&&n(e,l)))break;e=e[l]}return s||!!(c=e?e.length:0)&&J(c)&&function(e,t){return t=null==t?a:t,!!t&&("number"==typeof e||m.test(e))&&e>-1&&e%1==0&&e<t}(l,c)&&(K(e)||function(e){return function(e){return Z(e)&&function(e){return null!=e&&J(e.length)&&!X(e)}(e)}(e)&&R.call(e,"callee")&&(!v.call(e,"callee")||D.call(e)==o)}(e))}F.prototype.clear=function(){this.__data__=M?M(null):{}},F.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},F.prototype.get=function(e){var t=this.__data__;if(M){var n=t[e];return n===r?void 0:n}return R.call(t,e)?t[e]:void 0},F.prototype.has=function(e){var t=this.__data__;return M?void 0!==t[e]:R.call(t,e)},F.prototype.set=function(e,t){return this.__data__[e]=M&&void 0===t?r:t,this},j.prototype.clear=function(){this.__data__=[]},j.prototype.delete=function(e){var t=this.__data__,n=k(t,e);return!(n<0)&&(n==t.length-1?t.pop():x.call(t,n,1),!0)},j.prototype.get=function(e){var t=this.__data__,n=k(t,e);return n<0?void 0:t[n][1]},j.prototype.has=function(e){return k(this.__data__,e)>-1},j.prototype.set=function(e,t){var n=this.__data__,r=k(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},V.prototype.clear=function(){this.__data__={hash:new F,map:new(w||j),string:new F}},V.prototype.delete=function(e){return G(this,e).delete(e)},V.prototype.get=function(e){return G(this,e).get(e)},V.prototype.has=function(e){return G(this,e).has(e)},V.prototype.set=function(e,t){return G(this,e).set(e,t),this};var q=Y((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ee(e))return U?U.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return p.test(e)&&n.push(""),e.replace(h,(function(e,t,r,s){n.push(r?s.replace(g,"$1"):t||e)})),n}));function z(e){if("string"==typeof e||ee(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function Y(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(Y.Cache||V),n}Y.Cache=V;var K=Array.isArray;function X(e){var t=Q(e)?D.call(e):"";return t==i||t==c}function J(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Z(e){return!!e&&"object"==typeof e}function ee(e){return"symbol"==typeof e||Z(e)&&D.call(e)==l}e.exports=function(e,t){return null!=e&&H(e,t,$)}},529:(e,t,n)=>{e=n.nmd(e);var r=9007199254740991,s="[object Arguments]",a="[object Function]",o="[object GeneratorFunction]",i="[object Map]",c="[object Promise]",l="[object Set]",u="[object WeakMap]",d="[object DataView]",p=/^\[object .+?Constructor\]$/,h="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,g="object"==typeof self&&self&&self.Object===Object&&self,f=h||g||Function("return this")(),m=t&&!t.nodeType&&t,y=m&&e&&!e.nodeType&&e,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:"",P=C.toString,R=S.hasOwnProperty,D=S.toString,b=RegExp("^"+P.call(R).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 P.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function K(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&J(e)}(e)&&R.call(e,"callee")&&(!v.call(e,"callee")||D.call(e)==s)}(M&&z(new M(new ArrayBuffer(1)))!=d||L&&z(new L)!=i||U&&z(U.resolve())!=c||F&&z(new F)!=l||j&&z(new j)!=u)&&(z=function(e){var t=D.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?Y(n):void 0;if(r)switch(r){case k:return d;case $:return i;case B:return c;case G:return l;case W:return u}return t});var X=Array.isArray;function J(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Z(e)}var Q=x||function(){return!1};function Z(e){var t=ee(e)?D.call(e):"";return t==a||t==o}function ee(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){if(J(e)&&(X(e)||"string"==typeof e||"function"==typeof e.splice||Q(e)||K(e)))return!e.length;var t=z(e);if(t==i||t==l)return!e.size;if(V||function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||S)}(e))return!w(e).length;for(var n in e)if(R.call(e,n))return!1;return!0}},216:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",s=1,a=2,o=9007199254740991,i="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",p="[object Error]",h="[object Function]",g="[object GeneratorFunction]",f="[object Map]",m="[object Number]",y="[object Null]",E="[object Object]",I="[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[E]=v[_]=v[C]=v[S]=v[P]=!1;var x="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,w="object"==typeof self&&self&&self.Object===Object&&self,M=x||w||Function("return this")(),L=t&&!t.nodeType&&t,U=L&&e&&!e.nodeType&&e,F=U&&U.exports===L,j=F&&x.process,V=function(){try{return j&&j.binding&&j.binding("util")}catch(e){}}(),k=V&&V.isTypedArray;function $(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function B(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function G(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var W,H,q,z=Array.prototype,Y=Function.prototype,K=Object.prototype,X=M["__core-js_shared__"],J=Y.toString,Q=K.hasOwnProperty,Z=(W=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",ee=K.toString,te=RegExp("^"+J.call(Q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=F?M.Buffer:void 0,re=M.Symbol,se=M.Uint8Array,ae=K.propertyIsEnumerable,oe=z.splice,ie=re?re.toStringTag:void 0,ce=Object.getOwnPropertySymbols,le=ne?ne.isBuffer:void 0,ue=(H=Object.keys,q=Object,function(e){return H(q(e))}),de=Ve(M,"DataView"),pe=Ve(M,"Map"),he=Ve(M,"Promise"),ge=Ve(M,"Set"),fe=Ve(M,"WeakMap"),me=Ve(Object,"create"),ye=Ge(de),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 Pe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Re(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Pe;++t<n;)this.add(e[t])}function De(e){var t=this.__data__=new Ne(e);this.size=t.size}function be(e,t){var n=qe(e),r=!n&&He(e),s=!n&&!r&&ze(e),a=!n&&!r&&!s&&Qe(e),o=n||r||s||a,i=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!Q.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Be(l,c))||i.push(l);return i}function Oe(e,t){for(var n=e.length;n--;)if(We(e[n][0],t))return n;return-1}function ve(e){return null==e?void 0===e?N:y:ie&&ie in Object(e)?function(e){var t=Q.call(e,ie),n=e[ie];try{e[ie]=void 0;var r=!0}catch(e){}var s=ee.call(e);r&&(t?e[ie]=n:delete e[ie]);return s}(e):function(e){return ee.call(e)}(e)}function xe(e){return Je(e)&&ve(e)==i}function we(e,t,n,r,o){return e===t||(null==e||null==t||!Je(e)&&!Je(t)?e!=e&&t!=t:function(e,t,n,r,o,l){var h=qe(e),g=qe(t),y=h?c:$e(e),I=g?c:$e(t),A=(y=y==i?E:y)==E,N=(I=I==i?E:I)==E,P=y==I;if(P&&ze(e)){if(!ze(t))return!1;h=!0,A=!1}if(P&&!A)return l||(l=new De),h||Qe(e)?Ue(e,t,n,r,o,l):function(e,t,n,r,o,i,c){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case R:return!(e.byteLength!=t.byteLength||!i(new se(e),new se(t)));case u:case d:case m:return We(+e,+t);case p:return e.name==t.name&&e.message==t.message;case _:case S:return e==t+"";case f:var l=B;case C:var h=r&s;if(l||(l=G),e.size!=t.size&&!h)return!1;var g=c.get(e);if(g)return g==t;r|=a,c.set(e,t);var y=Ue(l(e),l(t),r,o,i,c);return c.delete(e),y;case T:if(Se)return Se.call(e)==Se.call(t)}return!1}(e,t,y,n,r,o,l);if(!(n&s)){var b=A&&Q.call(e,"__wrapped__"),O=N&&Q.call(t,"__wrapped__");if(b||O){var v=b?e.value():e,x=O?t.value():t;return l||(l=new De),o(v,x,n,r,l)}}if(!P)return!1;return l||(l=new De),function(e,t,n,r,a,o){var i=n&s,c=Fe(e),l=c.length,u=Fe(t),d=u.length;if(l!=d&&!i)return!1;var p=l;for(;p--;){var h=c[p];if(!(i?h in t:Q.call(t,h)))return!1}var g=o.get(e);if(g&&o.get(t))return g==t;var f=!0;o.set(e,t),o.set(t,e);var m=i;for(;++p<l;){var y=e[h=c[p]],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 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())!=I||ge&&$e(new ge)!=C||fe&&$e(new fe)!=P)&&($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 P}return t});var He=xe(function(){return arguments}())?xe:function(e){return Je(e)&&Q.call(e,"callee")&&!ae.call(e,"callee")},qe=Array.isArray;var ze=le||function(){return!1};function Ye(e){if(!Xe(e))return!1;var t=ve(e);return t==h||t==g||t==l||t==A}function Ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Je(e){return null!=e&&"object"==typeof e}var Qe=k?function(e){return function(t){return e(t)}}(k):function(e){return Je(e)&&Ke(e.length)&&!!v[ve(e)]};function Ze(e){return null!=(t=e)&&Ke(t.length)&&!Ye(t)?be(e):Le(e);var t}e.exports=function(e,t){return we(e,t)}},692:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",o="[object AsyncFunction]",i="[object Function]",c="[object GeneratorFunction]",l="[object Null]",u="[object Object]",d="[object Proxy]",p="[object Undefined]",h=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,f={};f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f[a]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object Boolean]"]=f["[object DataView]"]=f["[object Date]"]=f["[object Error]"]=f[i]=f["[object Map]"]=f["[object Number]"]=f[u]=f["[object RegExp]"]=f["[object Set]"]=f["[object String]"]=f["[object WeakMap]"]=!1;var m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,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,P,R,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=(P=Object.getPrototypeOf,R=Object,function(e){return P(R(e))}),G=Object.create,W=O.propertyIsEnumerable,H=D.splice,q=V?V.toStringTag:void 0,z=function(){try{var e=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=Pe(e),r=!n&&Ne(e),s=!n&&!r&&De(e),a=!n&&!r&&!s&&we(e),o=n||r||s||a,i=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=i.length;for(var l in e)!t&&!w.call(e,l)||o&&("length"==l||s&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ae(l,c))||i.push(l);return i}function ae(e,t,n){(void 0!==n&&!Te(e[t],n)||void 0===n&&!(t in e))&&ce(e,t,n)}function oe(e,t,n){var r=e[t];w.call(e,t)&&Te(r,n)&&(void 0!==n||t in e)||ce(e,t,n)}function ie(e,t){for(var n=e.length;n--;)if(Te(e[n][0],t))return n;return-1}function ce(e,t,n){"__proto__"==t&&z?z(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}ee.prototype.clear=function(){this.__data__=Q?Q(null):{},this.size=0},ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ee.prototype.get=function(e){var t=this.__data__;if(Q){var n=t[e];return n===r?void 0:n}return w.call(t,e)?t[e]:void 0},ee.prototype.has=function(e){var t=this.__data__;return Q?void 0!==t[e]:w.call(t,e)},ee.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Q&&void 0===t?r:t,this},te.prototype.clear=function(){this.__data__=[],this.size=0},te.prototype.delete=function(e){var t=this.__data__,n=ie(t,e);return!(n<0)&&(n==t.length-1?t.pop():H.call(t,n,1),--this.size,!0)},te.prototype.get=function(e){var t=this.__data__,n=ie(t,e);return n<0?void 0:t[n][1]},te.prototype.has=function(e){return ie(this.__data__,e)>-1},te.prototype.set=function(e,t){var n=this.__data__,r=ie(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ne.prototype.clear=function(){this.size=0,this.__data__={hash:new ee,map:new(J||te),string:new ee}},ne.prototype.delete=function(e){var t=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=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?(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")},Pe=Array.isArray;function Re(e){return null!=e&&Oe(e.length)&&!be(e)}var De=Y||function(){return!1};function be(e){if(!ve(e))return!1;var t=de(e);return t==i||t==c||t==o||t==d}function Oe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function ve(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var we=T?function(e){return function(t){return e(t)}}(T):function(e){return xe(e)&&Oe(e.length)&&!!f[de(e)]};function Me(e){return Re(e)?se(e,!0):ge(e)}var Le,Ue=(Le=function(e,t,n,r){fe(e,t,n,r)},me((function(e,t){var n=-1,r=t.length,s=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(s=Le.length>3&&"function"==typeof s?(r--,s):void 0,a&&function(e,t,n){if(!ve(n))return!1;var r=typeof t;return!!("number"==r?Re(n)&&Ae(t,n.length):"string"==r&&t in n)&&Te(n[t],e)}(t[0],t[1],a)&&(s=r<3?void 0:s,r=1),e=Object(e);++n<r;){var o=t[n];o&&Le(e,o,n,s)}return e})));function Fe(e){return e}e.exports=Ue},835:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a=9007199254740991,o="[object Function]",i="[object GeneratorFunction]",c="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,d=/^\./,p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,g=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,y="object"==typeof self&&self&&self.Object===Object&&self,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,P=C.hasOwnProperty,R=C.toString,D=RegExp("^"+N.call(P).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];P.call(e,t)&&Y(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function V(e,t){for(var n=e.length;n--;)if(Y(e[n][0],t))return n;return-1}function k(e){if(!X(e)||(t=e,T&&T in t))return!1;var t,n=function(e){var t=X(e)?R.call(e):"";return t==o||t==i}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?D:g;return n.test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function $(e,t,n,r){if(!X(e))return e;t=function(e,t){if(K(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||J(e))return!0;return u.test(e)||!l.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:function(e){return K(e)?e:H(e)}(t);for(var s=-1,a=t.length,o=a-1,i=e;null!=i&&++s<a;){var c=q(t[s]),d=n;if(s!=o){var p=i[c];void 0===(d=r?r(p,c,i):void 0)&&(d=X(p)?p:W(t[s+1])?[]:{})}j(i,c,d),i=i[c]}return e}function B(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return k(n)?n:void 0}function W(e,t){return!!(t=null==t?a:t)&&("number"==typeof e||f.test(e))&&e>-1&&e%1==0&&e<t}L.prototype.clear=function(){this.__data__=x?x(null):{}},L.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},L.prototype.get=function(e){var t=this.__data__;if(x){var n=t[e];return n===r?void 0:n}return P.call(t,e)?t[e]:void 0},L.prototype.has=function(e){var t=this.__data__;return x?void 0!==t[e]:P.call(t,e)},L.prototype.set=function(e,t){return this.__data__[e]=x&&void 0===t?r:t,this},U.prototype.clear=function(){this.__data__=[]},U.prototype.delete=function(e){var t=this.__data__,n=V(t,e);return!(n<0)&&(n==t.length-1?t.pop():O.call(t,n,1),!0)},U.prototype.get=function(e){var t=this.__data__,n=V(t,e);return n<0?void 0:t[n][1]},U.prototype.has=function(e){return V(this.__data__,e)>-1},U.prototype.set=function(e,t){var n=this.__data__,r=V(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},F.prototype.clear=function(){this.__data__={hash:new L,map:new(v||U),string:new L}},F.prototype.delete=function(e){return B(this,e).delete(e)},F.prototype.get=function(e){return B(this,e).get(e)},F.prototype.has=function(e){return B(this,e).has(e)},F.prototype.set=function(e,t){return B(this,e).set(e,t),this};var H=z((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(J(e))return M?M.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return d.test(e)&&n.push(""),e.replace(p,(function(e,t,r,s){n.push(r?s.replace(h,"$1"):t||e)})),n}));function q(e){if("string"==typeof e||J(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function z(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(z.Cache||F),n}function Y(e,t){return e===t||e!=e&&t!=t}z.Cache=F;var K=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function J(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&R.call(e)==c}e.exports=function(e,t,n){return null==e?e:$(e,t,n)}},521:(e,t,n)=>{var r="__lodash_hash_undefined__",s=1/0,a="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,u=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,m=g||f||Function("return this")();var y,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,P=RegExp("^"+S.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=m.Symbol,D=E.splice,b=$(m,"Map"),O=$(Object,"create"),v=R?R.prototype:void 0,x=v?v.toString:void 0;function w(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function U(e,t){for(var n,r,s=e.length;s--;)if((n=e[s][0])===(r=t)||n!=n&&r!=r)return s;return-1}function F(e){if(!z(e)||(t=e,C&&C in t))return!1;var t,n=function(e){var t=z(e)?N.call(e):"";return t==a||t==o}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?P:h;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function j(e,t){e=function(e,t){return 1==t.length?e:function(e,t){for(var n=0,r=(t=B(t,e)?[t]:V(t)).length;null!=e&&n<r;)e=e[W(t[n++])];return n&&n==r?e:void 0}(e,function(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(n=n>s?s:n)<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(s);++r<s;)a[r]=e[r+t];return a}(t,0,-1))}(e,t=B(t,e)?[t]:V(t));var n,r,s=W((r=(n=t)?n.length:0)?n[r-1]:void 0);return!(null!=e&&T.call(e,s))||delete e[s]}function V(e){return q(e)?e:G(e)}function k(e,t){var n,r,s=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?s["string"==typeof t?"string":"hash"]:s.map}function $(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return F(n)?n:void 0}function B(e,t){if(q(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Y(e))||(l.test(e)||!c.test(e)||null!=t&&e in Object(t))}w.prototype.clear=function(){this.__data__=O?O(null):{}},w.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},w.prototype.get=function(e){var t=this.__data__;if(O){var n=t[e];return n===r?void 0:n}return T.call(t,e)?t[e]:void 0},w.prototype.has=function(e){var t=this.__data__;return O?void 0!==t[e]:T.call(t,e)},w.prototype.set=function(e,t){return this.__data__[e]=O&&void 0===t?r:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():D.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return U(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=U(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new w,map:new(b||M),string:new w}},L.prototype.delete=function(e){return k(this,e).delete(e)},L.prototype.get=function(e){return k(this,e).get(e)},L.prototype.has=function(e){return k(this,e).has(e)},L.prototype.set=function(e,t){return k(this,e).set(e,t),this};var G=H((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return x?x.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}(t);var n=[];return u.test(e)&&n.push(""),e.replace(d,(function(e,t,r,s){n.push(r?s.replace(p,"$1"):t||e)})),n}));function W(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}function H(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o),o};return n.cache=new(H.Cache||L),n}H.Cache=L;var q=Array.isArray;function z(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&N.call(e)==i}e.exports=function(e,t){return null==e||j(e,t)}},953:e=>{class t{constructor(e,t,n,r,s){this.converter=c(),this.width=e,this.poly=t,this.xor_in=n,this.reflected_xor_in=l(n,e),this.xor_out=r,this.reflect=s,this.msb_mask=1<<this.width-1,this.mask=this.msb_mask-1<<1|1,this.crc_shift=this.width<8?8-this.width:0,this.shifted_xor_in=this.xor_in<<this.crc_shift;let a=this.gen_table();this.table=a,8!==this.width||this.xor_in||this.xor_out||this.reflect||(this.calculate=function(e){e=this.converter.validate_buffer(e);let t=0;for(let n=0;n<e.length;n++)t=a[t^e[n]];return t})}calculate(e){let t;e=this.converter.validate_buffer(e);let{table:n,width:r,crc_shift:s,mask:a}=this;if(this.reflect){t=this.reflected_xor_in;for(let r=0;r<e.length;r++){t=(n[255&(t^e[r])]^t>>>8)&a}}else{t=this.shifted_xor_in;for(let o=0;o<e.length;o++)t=n[255&(t>>r-8+s^e[o])]<<s^t<<8-s&a<<s;t>>=s}return t^=this.xor_out,t>>>0}calculate_no_table(e){e=this.converter.validate_buffer(e);let t=this.xor_in;for(let n=0;n<e.length;n++){let r=e[n];this.reflect&&(r=l(r,8));for(let e=0;e<8;e++){let n=t&this.msb_mask;r&128>>e&&(n^=this.msb_mask),t<<=1,n&&(t^=this.poly)}t&=this.mask}return this.reflect&&(t=l(t,this.width)),t^=this.xor_out,t>>>0}gen_table(){let e=[];for(let t=0;t<256;t++){let n=t;this.reflect&&(n=l(n,8)),n<<=this.width-8+this.crc_shift;for(let e=0;e<8;e++)0!=(n&this.msb_mask<<this.crc_shift)?(n<<=1,n^=this.poly<<this.crc_shift):n<<=1;this.reflect&&(n=l(n>>this.crc_shift,this.width)<<this.crc_shift),n=n>>this.crc_shift&this.mask,e[t]=n>>>0}return new Int32Array(e)}print_table(){let e=this.table,t=Math.ceil(this.width/4),n=t<4?4:3,r=e.length>>n,s=1<<n,a="";for(let o=0;o<r;o++){let r="";for(let a=0;a<s;a++){let s=e[o<<n|a];s="000000000"+s.toString(16),s=s.substr(s.length-t),r+="0x"+s+", "}a+=" "+r+"\n"}return a="[\n"+a.slice(0,-3)+"\n]",a}}const n="undefined"!=typeof Buffer,r="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,s=void 0!==typeof BigInt&&BigInt(256);class a{validate_buffer(e){switch(typeof e){case"number":{if(!Number.isSafeInteger(e)||e<0)throw Error(`number data must be a nonnegative safe integer, not ${e}`);if(this.fromUInt32&&e<=4294967295)return this.fromUInt32(e);const t=[];for(;e>0||t.length<4;)t.unshift(e%256),e=Math.floor(e/256);return this.fromByteArray(t)}case"string":return this.fromString(e);case"bigint":{if(e<0)throw Error(`bigint data must be nonnegative, not ${e}`);const t=[];for(;e>0||t.length<4;)t.unshift(Number(e%s)),e/=s;return this.fromByteArray(t)}default:if(n&&Buffer.isBuffer(e))return e;if(r){if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e)}throw new Error(`Unrecognized data type ${typeof e}: ${e}`)}}}class o extends a{fromUInt32(e){const t=Buffer.alloc(4);return t.writeUInt32BE(e),t}fromByteArray=Buffer.from.bind(Buffer);fromString=Buffer.from.bind(Buffer)}class i extends a{fromByteArray=Uint8Array.from.bind(Uint8Array);fromString(e){return new TextEncoder("utf-8").encode(e)}}function c(e=!1){if(r&&(e||!n))return new i;if(n)return new o;throw Error("either need TypedArrays or Buffer")}function l(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|1&e,e>>=1;return n}const u={crc1:new t(1,1,0,0,!1),crc6:new t(6,47,0,0,!1),crc8:new t(8,7,0,0,!1),crc10:new t(10,563,0,0,!1),crc16:new t(16,32773,0,0,!0),crc24:new t(24,8801531,11994318,0,!1),crc32:new t(32,79764919,4294967295,4294967295,!0),crc32c:new t(32,517762881,4294967295,4294967295,!0)};function d(e){}e.exports={CRC:t,crc:function(e,n,r,s,a){let o=new t(e,n,r,s,a);return o.calculate.bind(o)},makeBufferConverter:c,models:u,crc1:d,crc6:d,crc8:d,crc10:d,crc16:d,crc24:d,crc32:d,crc32c:d};for(let t in u){let n=u[t];e.exports[t]=n.calculate.bind(n)}},754:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=754,e.exports=t}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return n[e](a,a.exports,s),a.loaded=!0,a.exports}s.m=n,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"js/"+e+".649b76eb.js",s.miniCssF=e=>{},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),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;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e})(),e={388:0},t=t=>{var n,r,{__webpack_ids__:a,__webpack_modules__:o,__webpack_runtime__:i}=t,c=0;for(n in o)s.o(o,n)&&(s.m[n]=o[n]);for(i&&i(s);c<a.length;c++)r=a[c],s.o(e,r)&&e[r]&&e[r][0](),e[a[c]]=0},s.f.j=(n,r)=>{var a=s.o(e,n)?e[n]:void 0;if(0!==a)if(a)r.push(a[1]);else{var o=import("./"+s.u(n)).then(t,(t=>{throw 0!==e[n]&&(e[n]=void 0),t}));o=Promise.race([o,new Promise((t=>a=e[n]=[t]))]),r.push(a[1]=o)}};var a={};s.d(a,{A:()=>SA});var o={};s.r(o),s.d(o,{buildContextName:()=>X,buildModalContext:()=>ee,buildTransientContextName:()=>J,getContainerIdFromContext:()=>ne,getParentContext:()=>te,getParentContextName:()=>K,getTargetFromContext:()=>Z,getTransientContext:()=>Q});var i={};s.r(i),s.d(i,{getResolvedTargetName:()=>Ct,getRoutingInfo:()=>St,getSemanticURLFromRoutingInfo:()=>Tt});var c={};s.r(c),s.d(c,{evaluate:()=>tn,handleChange:()=>Zt,hasDeclareExpression:()=>Qt,updateDeclareExpressions:()=>en});var l={};s.r(l),s.d(l,{publishExpressions:()=>kr,publishResponse:()=>$r});var u={};s.r(u),s.d(u,{hasBrowserEnv:()=>da,hasStandardBrowserEnv:()=>ha,hasStandardBrowserWebWorkerEnv:()=>ga,navigator:()=>pa,origin:()=>fa});var d={};s.r(d),s.d(d,{doesRestApiExist:()=>ic,getCancelTokenSource:()=>cc,getCaseApi:()=>dc,getHeaderProcessor:()=>sc,invokeCustomRestApi:()=>oc,invokeRestApi:()=>ac,isRequestCanceled:()=>lc,registerInterceptor:()=>uc});var p={};s.r(p),s.d(p,{CONTAINER_NAMES:()=>Ed,CONTAINER_TYPES:()=>yd,addRootContainerItem:()=>Jd,areContainerItemsPresent:()=>Td,clearTransientData:()=>rp,closeContainerItem:()=>Xd,getActiveContainerItemContext:()=>Ld,getActiveContainerItemIDFromRoutingInfo:()=>fp,getActiveContainerItemName:()=>vd,getActiveContext:()=>dp,getChildContainerItems:()=>Ud,getChildContainers:()=>Fd,getChildContainersContexts:()=>jd,getContainerAPI:()=>op,getContainerAccessOrder:()=>Sd,getContainerData:()=>Ad,getContainerItemByKey:()=>Dd,getContainerItemData:()=>_d,getContainerItemName:()=>Pd,getContainerItems:()=>Cd,getContainerLimit:()=>Gd,getContainerParentContext:()=>gp,getContainerType:()=>Od,getContextByTargetAndKey:()=>hp,getDataContextName:()=>Md,getFlowContainer:()=>yp,getLeastRecentlyUsedNonDirtyContainerItemID:()=>Yd,getParentContainerItem:()=>mp,getRootContainerName:()=>up,getSuggestionContexts:()=>Vd,getTargetFromContainerItemID:()=>Kd,getTransientItems:()=>ep,hasContainerItems:()=>Bd,isContainerDirty:()=>zd,isContainerInitialized:()=>bd,isContainerItemActive:()=>xd,isContainerItemContextBeingUsedInOtherContainers:()=>Zd,isContainerItemExists:()=>Nd,isContainerLimitReached:()=>Hd,isContainerMultipleMode:()=>$d,isContainerSingleMode:()=>kd,purgeTransientData:()=>sp,removeContainer:()=>ip,replaceTransientData:()=>np,resetContainersPayload:()=>qd,setContainerLimit:()=>Wd,updateCaseContextEtag:()=>lp,updateParentLastUpdateTime:()=>pp,updateRelatedContextEtag:()=>cp,updateTransientData:()=>tp});var h={};s.r(h),s.d(h,{getAdditionalInfo:()=>fh,getDataPageKeys:()=>ph,getDataPageMetadata:()=>sh,getEmbeddedPropertyMetadata:()=>Jp,getFieldParameters:()=>ch,getFieldsByClassName:()=>ih,getGenAICoach:()=>uh,getInsight:()=>oh,getLookUpDataPage:()=>hh,getLookUpDataPageInfo:()=>gh,getParagraph:()=>lh,getPersonalizationMetadata:()=>ah,getPropertyMetadata:()=>Xp,getResolvedFieldMetadata:()=>mh,getSavableDataPage:()=>dh,isViewExists:()=>nh,mergeStore:()=>Kp,resolveNavigation:()=>rh,resolveView:()=>th,updateNavigationStore:()=>Zp,updateStores:()=>eh,updateViewStore:()=>Qp});var g={};s.r(g),s.d(g,{dispatch:()=>Sh,doesContextExist:()=>jh,getActionType:()=>Oh,getContextValue:()=>Dh,getDataObject:()=>Th,getReferenceTokens:()=>Ah,getSharedDataObject:()=>Nh,getStore:()=>Ch,getValue:()=>Rh,isMergeable:()=>xh,lookupContextValue:()=>bh,mergeDeep:()=>Mh,performReplace:()=>wh,removeItem:()=>vh,replaceValue:()=>Uh,resetStore:()=>Fh,setStore:()=>_h,updateValue:()=>Lh});var f={};s.r(f),s.d(f,{activateContainerItem:()=>gg,addContainerItem:()=>sg,addMessages:()=>fg,addSharedData:()=>Ng,addTransientItem:()=>ag,addWork:()=>eg,clearTransientData:()=>ig,createWork:()=>Yh,error:()=>Tg,finishAssignment:()=>Ag,initContainers:()=>ng,listAction:()=>Rg,loadView:()=>Qh,mergeData:()=>Xh,openAssignment:()=>_g,openWorkByHandle:()=>tg,postProcess:()=>Sg,purgeTransientData:()=>lg,removeAllTransientItems:()=>yg,removeContainerItem:()=>mg,removeSharedData:()=>Pg,removeTransientItem:()=>Eg,replaceContainerItem:()=>Ig,replaceTransientData:()=>cg,resetContainers:()=>rg,resetLoading:()=>pg,setLoading:()=>dg,setSharedProperty:()=>bg,setStateProperty:()=>Og,showCasePreview:()=>Dg,showHarness:()=>Jh,showHistory:()=>Cg,showPage:()=>Zh,upMergeAndRemoveContainerItem:()=>hg,updateContainerItem:()=>ug,updateTransientData:()=>og});var m={};s.r(m),s.d(m,{fetchViewResources:()=>kI,updateViewResources:()=>VI});var y=s(216),E=s.n(y);let I,A,_;const C=e=>{e&&(I=e=e||{"base-server":"http://localhost:1080/prweb/","data-end-point":"api/v1/stream/data","action-end-point":"api/v1/stream/action"},I.BASEURL=e.server,I.ACTIONURL=e["action-end-point"],I.DATAURL=e["data-end-point"],_=e.reAuthUrl)},S=()=>_,T=()=>I.BASEURL,N=e=>fetch(`${I.BASEURL}${I.ACTIONURL}`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),P=e=>{A=e},R=()=>A;var D=s(953),b=s(521),O=s.n(b),v=s(928),x=s.n(v),w=s(188),M=s.n(w),L=s(835),U=s.n(L),F=s(692),j=s.n(F),V=s(529),k=s.n(V);const $=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}},B={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"}},G={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},...B,EMBED:"EMBED",getProperty:e=>$.map(e)},W="pyRemoteCaseDetails";class H{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=>Wh.getProperty(".RemoteSystemID",G.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"===H.getRemoteCase(e)?.RemoteApplicationType;static setAdditionalParameters=()=>{const e=Dp.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 q=H,z={},Y=new Map,K=e=>{let t=G.EMPTY_STRING;return t=e&&e.includes(G.FORWARD_SLASH_STRING)?e.substring(0,e.lastIndexOf("/")):e,t},X=(e,t,n=!1)=>{let r=G.EMPTY_STRING;if(t&&e){let s=`${t}${G.FORWARD_SLASH_STRING}${e}`;const a=Ad(s);if(a||t!==G.APP.APP&&t!==G.APP.ROOT)if(a){if(n&&z[s])return r=`${s}${G.UNDERSCORE_STRING}${z[s]}`,r;z[s]?z[s]+=1:z[s]=1,r=`${s}${G.UNDERSCORE_STRING}${z[s]}`}else r=X(e,K(t));else s=`${t}${G.FORWARD_SLASH_STRING}${G.PRIMARY}`,z[s]?z[s]+=1:z[s]=1,r=`${s}${G.UNDERSCORE_STRING}${z[s]}`}return r},J=(e,t)=>{if(e&&t){const n=(Y[t]?.[e]??0)+1;return Y[t]||(Y[t]={}),Y[t][e]=n,`${t}${G.FORWARD_SLASH_STRING}${e}_${n}`}return""},Q=(e,t)=>{if(e&&t){const n=Y[t]?.[e];return n?`${t}${G.FORWARD_SLASH_STRING}${e}_${n}`:J(e,t)}return""},Z=e=>{let t=G.EMPTY_STRING;return e&&(t=e.substring(e.lastIndexOf("/")+1,e.lastIndexOf("_")).toLowerCase()),t},ee=(e,t)=>{if(null===e)return t;const[,n]=t.split(G.FORWARD_SLASH_STRING);return e+G.FORWARD_SLASH_STRING+n},te=e=>{const t=e.indexOf(G.FORWARD_SLASH_STRING),n=e.lastIndexOf(G.FORWARD_SLASH_STRING);return t===n?e:e.substring(0,n)},ne=e=>{const t=e.split(G.FORWARD_SLASH_STRING);return 2===t.length?e:t[0]+G.FORWARD_SLASH_STRING+t[2]},re="SET_PROPERTY",se="REPLACE_PROPERTY",ae="FIELD_CHANGE",oe="LOAD_VIEW",ie="SHOW_PAGE",ce="SHOW_DATA",le="SHOW_INSIGHT",ue="SHOW_DASHBOARD",de="SET_LOADING",pe="RESET_LOADING",he="SET_SHARED_PROPERTY",ge="CREATE_WORK",fe="OPEN_WORK_BY_HANDLE",me="UPDATE_DOCUMENT",ye="FINISH_ASSIGNMENT",Ee="CANCEL_ASSIGNMENT",Ie="OPEN_ASSIGNMENT",Ae="MERGE_DATA",_e="REMOVE_ITEM",Ce="GET_DATAOBJECT_ACTIONS",Se="SHOW_HISTORY",Te="ERROR",Ne="INIT_CONTAINERS",Pe="RESET_CONTAINERS",Re="ADD_CONTAINER_ITEM",De="REMOVE_CONTAINER_ITEM",be="ADD_TRANSIENT_ITEM",Oe="UPDATE_TRANSIENT_DATA",ve="REMOVE_TRANSIENT_ITEM",xe="REMOVE_ALL_TRANSIENT_ITEMS",we="CLEAR_TRANSIENT_DATA",Me="PURGE_TRANSIENT_DATA",Le="REPLACE_TRANSIENT_DATA",Ue="ACTIVATE_CONTAINER_ITEM",Fe="UPDATE_CONTAINER_ITEM",je="UPMERGE_AND_REMOVE_CONTAINER_ITEM",Ve="REPLACE_CONTAINER_ITEM",ke="ACTIVATE_MODAL_CONTAINER_ITEM",$e="REMOVE_CONTAINER",Be="ADD_SUGGESTION_CONTEXT",Ge="showView",We="showData",He="showInsight",qe="showDashboard",ze="openWorkByHandle",Ye="openAssignment",Ke="createNewWork",Xe="SHOW_CANCEL_ALERT",Je="openLocalAction",Qe="openProcessAction",Ze="caseWideActions",et="openBulkAction",tt="performBulkAction",nt="launchAssignment",rt="ADD_MESSAGES",st="CLEAR_MESSAGES",at="RESET_STORE",ot="FETCH_DATAPAGE",it="ADD_SHARED_DATA",ct="REMOVE_SHARED_DATA",lt="LIST_ACTION",ut="DELETE_CASE_SUMMARY",dt="ALTER_BLOCKING_ACTION_COUNT",pt="CREATE_DATA_OBJECT",ht="DELETE_DATA_OBJECT",gt="VIEW_DATA_OBJECT",ft="UPDATE_DATA_OBJECT",mt="OPEN_DATA_OBJECT_ACTION",yt="SUBMIT_DATA_OBJECT_ACTION",Et="OPEN_EMBEDDED_DATA_MODAL",It="SUBMIT_EMBEDDED_DATA_MODAL",At="FILL_FORM_WITH_AI",_t="openCase",Ct=(e,t)=>{if(!e||!t)return null;let n,r=G.EMPTY_STRING;return t&&(r=`${t}${G.FORWARD_SLASH_STRING}${e}`,n=Ad(r),n||t.includes("/")?n||(r=Ct(e,K(t))):r=`${t}${G.FORWARD_SLASH_STRING}${e}`),r},St=(e,t)=>{const n=Ct(e,t);return n&&Ad(n)?Ad(n):{}},Tt=(e,t)=>Rp.getSemanticURL(Ge,{page:e},t);const Nt=new class{error=e=>{console.error(e)}};class Pt{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=Lt[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=Mt[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}=Lt[this._state];this._subParser=new Pt(this._grammar,e,t)}_endSubExpression(){Lt[this._state].subHandler.call(this,this._subParser.buildAst()),this._subParser=null}setPositionInAST(e){this._position?(this._position.right=e,Pt._setParent(e,this._position)):this._tree=e,this._position=e}}const Rt=Pt,Dt="identifier",bt={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e&&t},Ot={operatorType:"binaryOperator",precedence:1,evaluate:(e,t)=>e||t},vt=(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},xt={">":{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)=>vt(e,t,!0)},"!=":{operatorType:"binaryOperator",precedence:2,evaluate:(e,t)=>vt(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"},"&&":bt,AND:bt,and:bt,"||":Ot,OR:Ot,or:Ot,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)}},wt={BinaryExpression:function(e){const t=[];let n="";return t[0]=this.evaluateAST(e.left),e.left.operationType===Dt&&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?Wh.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)}},Mt={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};Rt._setParent(this._position,r),this._position=n,this.setPositionInAST(r)},identifier:function(e){const t={operationType:Dt,value:e.value};this.setPositionInAST(t)},literal:function(e){this.setPositionInAST({operationType:"literal",value:e.value})},subExpression:function(e){this.setPositionInAST(e)}},Lt={expectOperand:{operatorTypes:{literal:{toState:"expectBinOp"},identifier:{toState:Dt},unaryOperator:{},openParenthesis:{toState:"subExpression"}}},expectBinOp:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},identifier:{operatorTypes:{binaryOperator:{toState:"expectOperand"}}},subExpression:{subHandler:Mt.subExpression,endStates:{closeParenthesis:"expectBinOp"}}},Ut=["binaryOperator","unaryOperator","openParenthesis"],Ft=/^\s*$/,jt=/^[a-zA-Z_.$][(0-9)a-zA-Z0-9_.$]*$/,Vt=/\\\\/,kt=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],$t=["[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]+)"],Bt=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/;class Gt{constructor(e){this._grammar=e}static _isNegative(e){return Ut.some((t=>t===e[e.length-1].tokenType))}static _isWhitespace(e){return!!e.match(Ft)}static _createWordboundary(e){return(e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).match(jt)&&(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(Vt,"\\")}_getSplitRegex(){if(!this._splitRegex){const e=Object.keys(this._grammar).sort(((e,t)=>t.length-e.length)).map((e=>Gt._createWordboundary(e)),this);this._splitRegex=new RegExp(`(${[kt.join("|"),e.join("|"),$t.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=Gt._unquote(e):e.match(Bt)?t.value=parseFloat(e):"true"===e||"false"===e?t.value="true"===e:this._grammar[e]?t.tokenType=this._grammar[e].operatorType:e.match(jt)&&(t.tokenType="identifier"),t}_getTokens(e){const t=[];let n=!1;for(let r=0;r<e.length;r+=1)Gt._isWhitespace(e[r])?t.length&&(t[t.length-1].element+=e[r]):"-"===e[r]&&Gt._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 Wt=Gt;const Ht=class{constructor(e,t){this._grammar={...xt},this._expression=e,this._ast=null,this._context={},this._contextTreeNodeContext=null,this._localDataObject=t}buildAST(){const e=new Wt(this._grammar).tokenize(this._expression),t=new Rt(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 wt[e.operationType].call(this,e,t)}},qt=(e,t)=>{const n=e.replace(/[a-zA-Z0-9_)"'\s]=[a-zA-Z0-9_("'\s]/,(e=>e.replace("=","==")));return new Ht(n,t)},zt=e=>!e||e.buildAST(),Yt=(e,t,n)=>!e||e.evaluate(t,n),Kt=(e,t,n)=>{const r=qt(e,t),s=zt(r);return Yt(s,n)};const Xt=class{static handleExpression(e,t,n,r){const s=this.getContext(e,r);N({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:Wh.getPropertyValue(`${n}.pxObjClass`,null,t)||Wh.getPropertyValue(`${n}.pyClassName`,null,t)}}static updateState(e,t){Object.keys(e).forEach((n=>Sh({type:re,payload:{context:t,reference:n,value:e[n]}})))}},Jt={},Qt=(e,t)=>Jt[t]&&Object.prototype.hasOwnProperty.call(Jt[t],e),Zt=e=>{const{context:t}=e;Qt(e.reference,t)&&Xt.handleExpression(e.reference,e.value,Jt[t][e.reference],t)},en=(e={})=>{kh.copy(e,Jt)},tn=(e,t,n)=>Kt(e,t,n?.pConnect.getPConnect());const nn=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&&Sh({type:de,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]&&Sh({type:pe,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 rn=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:Ae,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:Ae,payload:{context:e,data:{context_data:{deferred_action_queue:s,blocking_action_counter:r,is_deferred_action_in_progress:a}}}}),n.push(t)}}Sh(n)}}executeOrQueueDeferredAction(e){if(!e?.payload?.context)return Promise.reject(new Error("Action Context is Mandatory Field."));const t=Th(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:Ae,payload:{context:e.payload.context,data:{context_data:{deferred_action_queue:s,blocking_action_counter:r,is_deferred_action_in_progress:a}}}}),Sh(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=Th(e);return t&&!0===t.context_data?.is_deferred_action_in_progress?(Sh({type:Ae,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 Th(e)?(Sh({type:dt,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={...Th(e)};return t.context_data={...t.context_data},t&&t.context_data?.blocking_action_counter>0?(Sh({type:dt,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=Th(e);if(t){const n={...t};n.context_data={...n.context_data},n.context_data?.deferred_action_queue&&kh.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),Sh({type:Ae,payload:{context:e,data:{...n}}}),nn.disableLoadingIndicator({context:e})}}};const sn=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 an=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={}){kh.copy(e,this.componentMap)}mergeOverrideMap(e={}){kh.copy(e,this.overrideMap)}getOverrideMap(){return this.overrideMap}getLazyMap(){return this.lazyMap}};const on=new class{constructor(){this.handlers={}}registerHandler(e,t){this.handlers[e]=t}getHandler(e){return this.handlers[e]}};const cn=class{static handleAnnotation(e,t,n){const r=e.indexOf(" "),s=-1===r?e:e.substring(0,r),a=on.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 on.getHandler(n)?r:e}static handleComponentMapping(e,t,n){const r=an.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&&kh.isString(e)){const t=e.startsWith(G.PROPERTY_ANNOTATION)||e.startsWith(G.ATTACHMENT_ANNOTATION)||e.startsWith(G.ASSOCIATED_PROPERTY_ANNOTATION),n=t?e.indexOf(" "):-1;return t?e.substring(n+2):e}return e}static getLeafPropertyName(e){if(kh.isString(e)&&!!e?.startsWith(G.PROPERTY_ANNOTATION)){const t=this.getPropertyName(e),n=t.split(".");return n.length<2?t:n.pop()}return e}static isProperty(e){return kh.isString(e)&&!!e?.startsWith(G.PROPERTY_ANNOTATION)}},ln=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},un=(e,t)=>{if(e&&t){const n=kh.getIn(t,["assignments","0","assigneeInfo"],{}),{ID:r,type:s}=n;return"worklist"===s?.toLowerCase()&&r===e}return!1},dn=e=>{const{activeActionID:t,availableActions:n}=e||{};if(t&&n){const e=n.find((e=>e.ID===t));return Boolean(e)}return!1},pn=(e,t)=>{const n=Wh.getPropertyValue(B.CASE_INFO.ACTIVE_ACTION_ID,t,e),r=Wh.getPropertyValue(B.CASE_INFO.AVAILABLEACTIONS,t,e);let s=!1;if(r&&n){const e=r.find((e=>e.ID===n));e&&(s=e.type.toLowerCase()===B.LOCAL_ACTION_TYPE.CASE_WIDE.toLowerCase())}if(e&&!r){const t=Th(e);s=t?.context_data?.actionType===G.CASE}return s},hn=e=>Dh(null,G.CASE_VIEW_MODE_PROP,e)===G.PERFORM_MODE&&(e.includes(G.WORKAREA)||e.includes(G.MODAL)),gn=e=>{const t=e?.parentCaseInfo?.ID;return Boolean(e&&t)},fn=(e,t,n)=>{let r;const s=e?.find((e=>e.ID===t))?.actions,a=s?.filter((e=>e.ID===G.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},mn=(e,t,n)=>{let r,s,a,o,i,c,l,u,d;const p=Th(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(B.CASE_INFO.ASSIGNMENT_ID),s=t.getValue(B.CASE_INFO.CASE_INFO_ID),a=t.getValue(B.CASE_INFO.ASSIGNMENTS),o=t.getValue(B.CASE_INFO.ACTIVE_ACTION_ID),i=t.getValue(B.CASE_INFO.AVAILABLEACTIONS),c=t.getValue(B.CASE_INFO.CASE_INFO),l=t.getValue(B.CASE_INFO.BUSINESS_ID),u=t.getValue(B.CASE_INFO.CASE_TYPE_ID),d=t.getValue(B.CASE_INFO.CASE_TYPE_NAME)),{assignmentID:r,caseID:s,assignments:a,localActionID:o,caseActions:i,caseInfo:c,businessID:l,caseTypeID:u,caseTypeName:d}};const yn=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&&nn.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),nn.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),nn.disableLoadingIndicator(r.actionPayload,t)):s=null,s}};class En{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 En(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 In=En;const An=class{constructor(e,t,n,r={}){this.type=B.CONTEXT_TREE_NODE_TYPES.WHEN,this.subType=e,this.referenceName=t,this.name=n,this.props=r}},_n=/(([^.]+)\[\d+\])/g,Cn=e=>{if((e?.split(".")??[]).length<3)return[e];const t=e?.match(_n);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]},Sn=(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:Tn,WHEN:Nn,DECLARATIVE_TARGET:Pn,PAGELIST:Rn}=G.CONTEXT_TREE_NODE_TYPES;const Dn=class{constructor(e,t,n={}){this.type=e,this.name=t,this.children=[],this.eventSubscribers=[],this.props=n,this.references=new Map([[Tn,new Map],[Nn,new Map],[Pn,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===Rn){const n=this.references.get(Tn);n.set(e,t),this.references.set(Tn,n)}}}removePageListNodes(e,t){const n=this.children.filter((t=>t.name.startsWith(e))).filter((n=>{const r=Sn(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(Tn),s=this.references.get(Pn);[...r.keys(),...s.keys()].filter((t=>t.startsWith(e))).filter((e=>{const[,,n]=Cn(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 In(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 An(t,n,r,s),i=this.references.get("WHEN");i?.set(a,o)}},{VIEW:bn,FIELD:On,CONTEXT:vn,DECLARATIVE_TARGET:xn,WHEN:wn}=B.CONTEXT_TREE_NODE_TYPES;const Mn=new class{constructor(){this.rootNodes={}}_isContextNodeExist(e){return Object.keys(this.rootNodes).includes(e)}addContextNode(e){if(!this._isContextNodeExist(e)){const t=new Dn(vn,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}`,On,s),a?.removeReference(`${t}${r}`,xn,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===bn?this.removeChildViewNodes(e,t,a.name,r):(s.removeReference(a.name,On,a.props.index),s.removeReference(a.name,xn,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(On),n(xn)}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(On),r(xn)}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(On,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(xn,`${t}${r}`,a):i.addNode(On,`${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,On);s||(s=i.addNode(On,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]=Cn(t);n.startsWith(".")&&(n=n.substring(1)),o&&this.mutatePageList(e,a,o,{...r,rowIndex:i},!0);const c=s?.getReference(`${t}.${n}`,On);c&&c instanceof In&&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}`,On);o&&o instanceof In&&o.triggerEvent(r,s)}getFieldsList(e){const t=this.getContextNode(e);return t?.references.get(On)}getFieldReferenceForProperty(e,t){let n=this.getContextNode(e)?.references?.get(On)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(xn)?.get(t)),n}getFieldReferencePreviousValue(e,t){let n=this.getContextNode(e)?.references?.get(On)?.get(t);return n||(n=this.getContextNode(e)?.references?.get(xn)?.get(t)),n?.value}updateFieldNodeValue(e,t,n){const r=this.getContextNode(e)?.references?.get(On)?.get(t);r instanceof In&&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,On),n=this.getContextReferencesByType(e,xn);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,On)?.get(t)||!!this.getContextReferencesByType(e,xn)?.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(xn)||new Map,r=[];return n.forEach((e=>{const t=e?.props||{},{propertyName:n=""}=t,s=t.pageReference??B.CASE_INFO.CASE_INFO_CONTENT;r.push({pageReference:s,name:n})})),r}getWhens(e){const t=this.getContextNode(e),n=t?.references?.get(wn)||new Map,r=[];return n.forEach((e=>{const t=e.subType,n=e.referenceName,s=e.name,a=e?.props?.pageReference??B.CASE_INFO.CASE_INFO_CONTENT;r.push({name:s,pageReference:a,referenceName:n,type:t})})),r}},Ln={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"},Un=e=>({type:Ln.REFRESH_DATA,payload:e}),Fn={},jn=(e,t,n,r,s)=>{if(!(e&&n&&t))return;const a=s.actionMgrID||yn.getNextActionMgrId(),o={ID:e,actionID:t,context:n,caseWideAction:r,options:{...s,actionMgrID:a}};s.isFillFormWithAI?Sh((e=>({type:At,payload:e}))(o)):Sh(Un(o))},Vn=(e,t,n,r,s)=>{if(!(e&&n&&t))return;r&&(r=kh.convertPageRefToClipboardPageNotation(r));Sh(Un({ID:e,viewID:t,context:n,options:s,caseViewAction:!0,interestPage:r}))},kn=(e,t,n)=>{Fn[t]||(Fn[t]={}),e&&!Fn[t][e]&&(Fn[t][e]={pageReference:n})},$n=(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=Xp(n.propertyName,e.getValue(G.CLASS_ID,n.pageName));return!!s?.isDeclarativeTarget},Bn=e=>{let t=!1;if(e.isWhenExist())t=!0;else{const n=e.getRawMetadata()?.config?.value;if(n){const r=Xp(cn.getLeafPropertyName(n),Wh.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=$n(e,r)),n};t.some(r)}else if("object"==typeof t)for(const r in t)if(t[r].startsWith("@P")&&(n=$n(e,t[r]),n))break;return n})(e,r?.datasource?.parameters)),t||(t=r?.datasource?.tableType===G.DECISION)}}t&&kn(e.getCurrentView(),e.getContextName(),e.getPageReference())},Gn=(e,t,n)=>{const r=pn(e,t),s=Wh.getPropertyValue(B.CASE_INFO.ACTIVE_ACTION_ID,t,e)?Wh.getPropertyValue(B.CASE_INFO.ACTIVE_ACTION_ID,t,e):Wh.getPropertyValue(B.CASE_INFO.ASSIGNMENTACTION_ID,t,e);let a;a=r?Wh.getPropertyValue(B.CASE_INFO.CASE_INFO_ID,t,e):Wh.getPropertyValue(B.CASE_INFO.ASSIGNMENT_ID,t,e)?Wh.getPropertyValue(B.CASE_INFO.ASSIGNMENT_ID,t,e):Wh.getPropertyValue(B.CONTEXT_DATA_ASSIGNMENTID,t,e),jn(a,s,e,r,n)},Wn=e=>{const{context:t,pageReference:n}=e,r=(e=>Fn[e]&&Object.keys(Fn[e]).length>0&&hn(e))(t);if(!r)return;if(Wh.getPropertyValue(G.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,n,t)){const e=Wh.getPropertyValue(B.CASE_INFO.CASE_INFO_ID,n,t),r=Wh.getPropertyValue(G.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,n,t),s=Wh.getPropertyValue(G.CONTEXT_DATA_MODAL_VIEW.INTERESTPAGE,n,t);Vn(e,r,t,s,{})}else Gn(t,n,{})},Hn=(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},qn=e=>{const t=(e=>{const t=[];return Mn.getDeclarativeTargets(e).forEach((({name:e,pageReference:n})=>{const r=n.split(".");r.shift();let s=r.join(".");e&&s&&(s=kh.convertPageRefToClipboardPageNotation(s),t.push({name:e,context:s}))})),t})(e),n=(e=>{const t=[];return Mn.getWhens(e).forEach((({name:e,type:n,pageReference:r})=>{const s=r.split(".");s.shift();let a=s.join(".");e&&a&&(a=kh.convertPageRefToClipboardPageNotation(a),t.push({name:e,context:a,type:n}))})),t})(e);return{fieldsWithDeclarativeTargets:t,whens:n}},zn=(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 Yn=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}},Kn={CONTENT_FIELDS_PATH:[G.CONTEXT_DATA,G.CASE_INFO.CASE_INFO,G.CONTENT],DATA_OBJECT_CONTENT_FIELDS_PATH:[G.CONTEXT_DATA,G.DATA_INFO.DATA_INFO,G.CONTENT],FIELD_MESSAGES_PATH:[G.CONTEXT_DATA,G.CASE_INFO.CASE_INFO,G.CONTENT,G.SUMMARY_OF_MESSAGES,G.PROPERTY_MESSAGES],DATA_OBJECT_FIELD_MESSAGES_PATH:[G.CONTEXT_DATA,G.DATA_INFO.DATA_INFO,G.CONTENT,G.SUMMARY_OF_MESSAGES,G.PROPERTY_MESSAGES],PAGE_MESSAGES_PATH:[G.CONTEXT_DATA,G.SUMMARY_OF_MESSAGES,G.PAGE_MESSAGES],HTTP_MESSAGES_PATH:[G.CONTEXT_DATA,G.SUMMARY_OF_MESSAGES,G.HTTP_MESSAGES],CASE_MESSAGE_PATH:[G.CASEMESSAGES]},Xn=(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===G.PROPERTY&&e||e){a=[G.CONTEXT_DATA,...o.split(".")];for(let e=0;e<s.length-1;e+=1)a.push(s[e]);a.push(G.SUMMARY_OF_MESSAGES,G.PROPERTY_MESSAGES,s[s.length-1])}else n===B.PAGE?a=[...Kn.PAGE_MESSAGES_PATH]:n===G.HTTP?a=[...Kn.HTTP_MESSAGES_PATH]:n===G.CASEMESSAGES?a=[...Kn.CASE_MESSAGE_PATH]:r&&(a=[G.CONTEXT_DATA,...o.split(".")]);return a.filter(Boolean)},Jn=(e,t,n)=>{const r={content:{}},s=`${t}[${n}]`,a=kh.getIn(e?.content,s.split("."));return a&&kh.setIn(r.content,s.split("."),{...a}),r},Qn=(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)}]`]=kh.getIn(e[t],[G.CONTEXT_DATA,...s.split(".")]),kh.deleteIn(e[t],[G.CONTEXT_DATA,...s.split(".")])}));const l=Object.keys(o);l.length>0&&l.forEach((n=>{kh.setIn(e[t],[G.CONTEXT_DATA,...n.split(".")],o[n])}))},Zn=(e,t,n,r,s)=>{const a=kh.deepClone(kh.getIn(e,[`${t}`])),o=kh.getIn(a,[G.CONTEXT_DATA,G.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=kh.getIn(e,[G.CONTEXT_DATA,...n.split(".")],{});return Object.keys(r).filter((e=>e.includes(`${t}[`)))})(a,c,i);if(0===l.length)return;if(Jn(o,c,r).content[`${c}[${r}]`]){const o={},i=`${n}[${r}]`,c=kh.getIn(a,[G.CONTEXT_DATA,...i.split(".")]);o[`${n}[${s}]`]=c,kh.deleteIn(e[t],[G.CONTEXT_DATA,...i.split(".")]),Qn(e,t,l,r,s,n,o)}else Qn(e,t,l,r,s,n)},er=e=>{const{type:t,property:n,category:r,context:s,pageReference:a}=e;let o;n&&(o=n.slice(1));const i=Th(s);let c=[];const l=kh.getIn(i,Xn(o,a,r));return t&&"all"!==t?(l&&Array.isArray(l)&&l.length>0&&(c=l.filter((e=>e.type===t))),t===B.MESSAGES.MESSAGES_TYPE_ERROR&&c.length>0&&n&&Mn.mutateField(s,a,n,{messages:[...c],type:B.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:n}),c):l},tr=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?(Mn.mutateField(s,n,t,{type:st,fieldName:t}),l.property=t,l.pageReference=n):o?(l.pageReference=n,l.isListEntry=o,l.deletingIndex=c):l.category=r,Sh(i?{type:st,payload:{stateObj:e.stateObj,context:s}}:{type:st,payload:l})},nr=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,Sh({type:rt,payload:o})},rr=(e,t,n)=>{for(const r of Object.keys(e)){if(t.push(r),r===G.SUMMARY_OF_MESSAGES)n.push([...t]);else{"object"===typeof e[r]&&rr(e[r],t,n)}t.pop()}return n},sr=(e,t)=>{let n=er({context:G.APP.ROOT,category:"HTTP"});if(Dp.getRenderingMode()===G.EMBED){const e=er({context:G.APP.APP,category:"HTTP"});e&&(n=n?n.concat(e):e)}if(e){const e=er({context:t,category:"HTTP"});n?e&&(n=n.concat(er({context:t,category:"HTTP"}))):n=er({context:t,category:"HTTP"})}return n},ar=e=>{let t=null;t=Fd(e)[0]?vd(Fd(e)[0]):e,t&&tr({context:t,stateObj:Th(t),clearContextMessages:!0})},or={addMessages:nr,getValidationErrorMessages:e=>{const t=Th(e),n=[],r=(e=>{let t=Kn.CONTENT_FIELDS_PATH;return e?.dataInfo?.content&&(t=Kn.DATA_OBJECT_CONTENT_FIELDS_PATH),t})(t),s=kh.getIn(t,[...r])||{};return rr(s,[],[]).forEach((e=>{const t=kh.getIn(s,[...e,G.PROPERTY_MESSAGES]);t&&Object.keys(t).forEach((e=>{t[e].forEach((e=>{e.type===G.MESSAGES.MESSAGES_TYPE_ERROR&&(e.fieldLabel?n.push({label:`${e.fieldLabel}:`,description:vp.getLocaleValue(e.message,"Messages")}):n.push(vp.getLocaleValue(e.message,"Messages")))}))}))})),n},getMessages:er,clearMessages:tr,getRootContainerHttpMessages:sr,clearContextMessagesInActiveWorkArea:ar},ir=or;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:"INSERT",content:{...kh.unflatten(n)}},o=JSON.parse(JSON.stringify(a));delete o.content.classID;return{instruction:{target:kh.buildInstructionPageReference(r,e),content:{...o.content},listIndex:t,instruction:"INSERT"},actionPayload:a,displayPropertyPayload:s}}};const lr=class{static execute(e,t,n,r,s,a,o){const i={instruction:"UPDATE",content:{...kh.unflatten(r)},isDefault:o},c={content:{...i.content},target:kh.buildInstructionPageReference(s,t),listIndex:n,instruction:"UPDATE"};return a||Sh(Rg({...i,listIndex:n-1,context:e,referenceList:`${s}${t}`})),c}};const ur=class{static execute(e,t,n){return{target:kh.buildInstructionPageReference(n,e),listIndex:t,instruction:"DELETE"}}};const dr=class{static getDeleteAllInstruction(e,t){return{instruction:"DELETE ALL",target:kh.buildInstructionPageReference(e,t)}}static execute(e,t,n,r){r||Sh(Rg({instruction:"DESELECT_ALL",context:e,referenceList:`${n}${t}`}))}};const pr=class{static execute(e,t,n,r){return{target:kh.buildInstructionPageReference(r,e),listMoveToIndex:n,listIndex:t,instruction:"MOVE"}}};const hr=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:{...kh.unflatten(n)}};return{instruction:{target:kh.buildInstructionPageReference(r,t),content:{...a.content},instruction:"REPLACE"},actionPayload:a,displayPropertyPayload:s}}};const gr=class{static execute(e,t){return{target:kh.buildInstructionPageReference(t,e),instruction:"DELETE"}}};const fr=class{constructor(e){this.next=null,this.automatic=!1,this.instruction=e,this.previous=null,this.childrenStateMachines=[]}};const mr=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 fr(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=ml(t),a={};let o=!0;n&&(a[ml(n)]=crypto.randomUUID(),o=!1);const i={[s]:kh.getIn(e,s),...a};this.update(i,r+1,o,{isDefault:!0})}))})):r.forEach(((e,t)=>{if(n&&!e[ml(n)]){const e={};e[ml(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=lr.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]=Mh(kh.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=Mh(kh.deepClone(t),kh.unflatten(e),r)}}}delete(e,t){const n=ur.execute(this.target,e,this.pageReference);this.changeList[this.targetPageReference]?.splice(e-1,1),this.insertNode(n),t||Sh(Rg({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={}}=cr.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]=Mh(kh.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},Sh(Rg({...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={}}=hr.execute(this.contextName,this.target,e,this.pageReference);this.insertNode(n),t||(r.content={...r.content,...s},Sh(Rg({...r,context:this.contextName,referenceList:`${this.pageReference}${this.target}`})))}deletePage(e=!0){const t=gr.execute(this.target,this.pageReference);this.insertNode(t),e||Sh(Rg({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=pr.execute(this.target,e,t,this.pageReference);this.insertNode(r),Sh(Rg({listIndex:e-1,listMoveToIndex:t-1,context:this.contextName,referenceList:`${this.pageReference}${this.target}`,instruction:"MOVE"}))}deleteAll(e){const t=dr.getDeleteAllInstruction(this.pageReference,this.target);this.changeList[this.targetPageReference]=[],this.insertNode(t),dr.execute(this.contextName,this.target,this.pageReference,e)}updatePage(e){const t=this.current.instruction.content;this.current.instruction.content=Mh(kh.deepClone(t),e)}},yr={},Er={},Ir={},Ar=(e,t,n)=>{yr[e]||(yr[e]={}),yr[e][t]||(yr[e][t]={content:[]}),Er[e]||(Er[e]=[],Ir[e]=[]),gl.isStateMachineExist(e,n,t)||gl.setStateMachine(e,t,n,new mr(t,n,e))},_r=e=>Yn.formatPageReference(e),Cr=(e,t)=>{const n=Er[e],r=Ir[e],s=ml(t),a=s?.substring(0,s.indexOf("["));r?.indexOf(a)<0&&Ir[e].push(a),n?.indexOf(s)<0&&Er[e].push(s)},Sr=e=>{delete Er[e]},Tr=e=>gl.buildPageInstructionsByContext(e),Nr=e=>gl.buildPageInstructionsByContext(e,!0),Pr=e=>{gl.clearStateMachines(e),delete yr[e]},Rr=(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]})))},Dr=(e,t,n,r,s)=>{const{skipStateUpdate:a=!1}=s||{},o=n.getContextName(),i=n.getReferenceList(),c=r||n.getPageReference(),l=_r(i);Ar(o,l,c),Cr(o,`${i}[${t}]`),Rr(i,c,e,t);const u={instruction:G.LIST_ACTIONS.INSERT,content:{...kh.unflatten(e)}};delete JSON.parse(JSON.stringify(u)).content.classID;gl.getStateMachine(o,c,l).insert(e,t+1,a,{})},br=(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(B.CONTENT)+B.CONTENT.length,r=e.lastIndexOf(`[${t}]`);return e.substring(n,r)})(c,n));const l=_r(i);Ar(o,l,c),Cr(o,`${i}[${n}]`),Rr(i,c,e,n);gl.getStateMachine(o,c,l).update(e,n+1,s,r)},Or=(e,t)=>{const[,n]=e.split("."),r=t?.split(".").pop();return n===r},vr=(e,t,n)=>{const r={};return Object.values(e).forEach((e=>{if(Or(e,n)){const n=kh.getPropertyName(e),s=n.substr(n.indexOf(".")+1).split(".");if(s.length>1){let e=kh.getIn(t,s)??"";if(!e){const n=`!P!${s.join(":")}`;e=kh.getIn(t,n)??""}kh.setIn(r,s,e)}else{const e=kh.getIn(t,s)??"";r[s[s.length-1]]=e}}})),r},xr=(e,t,n,r,s)=>{const a=e.getValue(t)||{};n&&Object.keys(a).length>0&&e.clearErrorMessages({property:r?s:e.getStateProps().value})},wr=(e,t,n)=>new Promise((r=>{const{skipPageInstructions:s=!1}=n,{selectionMode:a,selectionList:o,required:i}=t.getConfigProps(),c=a===G.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=kh.getPropertyName(t),r=n.substr(n.indexOf(".")+1).split(".");e[r.join(".")]=t}))})(E,m,c),c){let n=o;n=_r(n);const r=t.getValue(f)||[];Ar(l,n,u);const a=[];let i=r.length;e.forEach((e=>{const t=vr(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=gl.getStateMachine(l,u,n);e.$selected?r.insert(t,p+1,!0,{}):r.delete(p+1,!0)}a.push({instruction:e.$selected?G.LIST_ACTIONS.SELECT:G.LIST_ACTIONS.DESELECT,listIndex:p,content:{...t,...o}})})),Sh(Rg({instruction:G.LIST_ACTIONS_TYPE.SELECT_DESELECT,context:l,referenceList:`${u}.${d}`,actions:a}))}else{const n=vr(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])}))}xr(t,f,i,c,d),r()})),Mr=e=>{if(!e)return!1;const t=Nr(e);return Array.isArray(t)&&t.length>0};const Lr=(e,t,n={})=>{const{skipStateUpdate:r=!1}=n,s=e.getPageReference(),a=_r(t);Ar(e.getContextName(),t,s);gl.getStateMachine(e.getContextName(),s,a).deleteAll(r)},Ur=e=>({insert:(t,n,r,s)=>Dr(t,n,e,r,s),update:(t,n,r)=>br(t,e,n,r),updateProperty:(t,n,r)=>((e,t,n,r={})=>{const s=n.getPageReference(),{stateMachineTarget:a}=gl.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&&Ar(n.getContextName(),t,e)}gl.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=_r(s);tr({type:B.MESSAGES.MESSAGES_TYPE_ERROR,pageReference:o,context:r,isListEntry:!0,deletingIndex:e}),Ar(r,i,a),Cr(r,`${s}[${e}]`),gl.getStateMachine(r,a,i).delete(e+1);const c=gl.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=_r(s);Ar(r,o,a),Cr(r,`${s}[${t}]`),gl.getStateMachine(r,a,o).move(e+1,t+1)})(t,n,e),setSelectedRows:(t,n={skipPageInstructions:!1})=>wr(t,e,n),getSelectedRows:(t=!1)=>((e,t)=>{const{selectionMode:n,selectionList:r}=t.getConfigProps(),s=[];let a=t.getPageReference();const o=n===G.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 Or(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=_r(i),Ar(r,i,s),gl.getStateMachine(r,s,i).deleteAll(),xr(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===G.LIST_SELECTION_MODE.MULTI&&s?i=s:"Editable"===a&&o&&(i=e.getStateProps().referenceList),i){i=_r(i);const r=gl.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=_r(t);Ar(s,o,a),gl.getStateMachine(s,a,o).initPageInstructions(e,n,r)})(e,t,n,r),deleteAll:(t,n)=>Lr(e,t,n),replacePage:(t,n,r)=>((e,t,n,r)=>{const{skipStateUpdate:s=!0}=r||{},a=e.getPageReference(),o=e.getContextName();Ar(o,t,a),Cr(o,kh.buildInstructionPageReference(a,t)),gl.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();Ar(a,t,s),Cr(a,kh.buildInstructionPageReference(s,t)),gl.getStateMachine(a,s,t).deletePage(r)})(e,t,n)});const Fr=new class{constructor(){this.fieldDefaults={}}updateFieldDefaults(e){e&&(Object.keys(this.fieldDefaults).length?kh.mergeDeep(e,this.fieldDefaults):kh.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 jr{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(B.CASE_INFO.CASE_INFO_CONTENT,"").replace(B.DATA_INFO.DATA_INFO_CONTENT,"");o=(Rh(`.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),jr.messageDispatcher(t,n,s,c,Yn.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=Fr.getDefaultsforType(a?.componentName||"")?.["client-validations"];!1!==c&&e&&this.getValidator(e)&&(o=this.getValidator(e)(r,i),""!==r&&jr.messageDispatcher(t,n,s,o,a?.label));const l=a?.validationType;return c=l&&Fr.getDefaultsforType(l)?.["client-validations"],!1!==c&&l&&this.getValidator(l)&&(o=this.getValidator(l)(r,i),jr.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:B.MESSAGES.MESSAGES_TYPE_ERROR,fieldLabel:s,message:r}),nr({messages:a,property:e,pageReference:t,context:n})}}isValidatorExist(e){return!!e.validatetype}}const Vr=new jr,kr=(e,t)=>{e.DeclareExpressions&&en({[t.context]:e.DeclareExpressions})},$r=(e,t,n=!1)=>{const r=kh.getIn(e,G.RESOURCES);r&&((e=>{e&&eh(e)})(r),kr(r,t)),n||Jg({...e,options:t})},Br="text/javascript";const Gr=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=Dp.getBuiltOnAppNames(),s=this.loadAndFilterPegaComponentsConfig(e,r);let a=Promise.resolve([]);!0!==n.skipLoadCustomerComponents&&(a=this.loadAndCustomerComponentsConfig(t));const o=this.fetchSDKComponent(t),i=[];if(await Promise.all([s,a,o]).then((e=>{const t=this.mergeComponentList(e);i.push(...t)})),n.alternateDesignSystemURL&&1===i.length){const r=await this.getSvcComponentsConfigADS(e,t,n);i[0].alternateDesignSystemConfig=r}return{data:{components:i}}}mergeComponentList=e=>{const[t=[],n=[],r=[]]=e,s=[...t,...n];return this.appStaticUrl?s.map((e=>{const{name:t,type:n,subtype:s}=e,a=r.reduce(((e,r)=>(t===r.name&&n===r.type&&s===r.subtype&&(e=r),e)),{});return Object.keys(a).length>0?{...e,alternateDesignSystemConfig:{...a}}:e})):s};async fetchSDKComponent(e){if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const t=`${this.appStaticUrl}v102/${this.appAlias}/componentslist-ext${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}return Promise.resolve([])}async loadAndFilterPegaComponentsConfig(e,t){return this.loadPegaComponentsConfig().then((()=>{const n=[];return this.componentsConfig&&this.componentsConfig.forEach((r=>{let s=!0;e.forEach((e=>{Array.isArray(r[e.field])?r[e.field].includes(e.value)||(s=!1):r[e.field]!==e.value&&(s=!1)})),s&&this.checkForBuiltOnSupport(t,r.allowedApplications)&&n.push(r)})),n}))}async loadPegaComponentsConfig(){let e=null;if(null===this.componentsConfig){const t=`${this.staticServerURL}components/componentsconfig.json?v=${(new Date).getTime()}`;e=fetch(t,{method:"GET"}).then((e=>e.json())).then((async e=>{this.componentsConfig=e,this.ccV2LibId&&await this.loadLibraryComponentsConfig(this.ccV2LibId).then((e=>{e&&e.length>0&&(this.componentsConfig=(this.componentsConfig||[]).concat(e))})).catch((e=>{console.error(`Exception while appending custom component config from library ${this.ccV2LibId} : ${e}`)}))})).catch()}else e=Promise.resolve();return e}async loadLibraryComponentsConfig(e){let t=null;return t=fetch(`${this.appStaticUrl}v100/componentlib/componentsconfig/${e}?v=${Date.now()}`,{headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>{if(!e.ok)throw console.error("Error while fetching custom component config/library component config"),new Error(e.statusText);return e})).then((e=>e.json())).then((e=>Promise.resolve(e))).catch((t=>(console.error(`Exception while fetching custom component config from library ${e} : ${t}`),{error:t.message}))),t}async loadAndCustomerComponentsConfig(e){let t=null;if(this.appStaticUrl&&this.appStaticUrl.length>8&&this.appStaticUrl!==this.staticServerURL){const n=`${this.appStaticUrl}v103/${this.appAlias}/componentslist${e}`;t=fetch(n,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>e.components)).catch((()=>[]))}else t=Promise.resolve([]);return t}checkForBuiltOnSupport(e,t){if(!e||!t||0===e.length||0===t.length)return!0;const n=e.split(",");return 0===n.length||n.some((function(e){return-1!==t.indexOf(e)}))}async getSvcComponentsConfigCombinedUrl(e,t,n){const r=`${this.staticServerURL}v102/${this.appAlias}/componentslist${t}`,s=await fetch(r,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.json())).then((e=>({data:e})));if(!0===n.skipLoadCustomerComponents&&s?.data?.components?.length>0&&(s.data.components=s.data.components.filter((e=>void 0===e.componentKey))),n.alternateDesignSystemURL&&1===s?.data?.components?.length){const r=await this.getSvcComponentsConfigADS(e,t,n);s.data.components[0].alternateDesignSystemConfig=r}return s}getSvcComponentsConfigADS(e,t,n){const r=`${n.alternateDesignSystemURL}${n.alternateDesignSystemURL?.endsWith("/")?"":"/"}components/${e[0].value}/config-ext.json`;return fetch(r,{method:"GET"}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)})).catch((e=>({error:e.message})))}getSvcImage(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).catch()}getSvcImageUrl(e){const t=`${this.appStaticUrl}v102/${this.appAlias}/image/${e}`;return void 0===this.imageBlobUrlCache[t]&&(this.imageBlobUrlCache[t]=fetch(t,{method:"GET",credentials:"include",headers:{Authorization:`Bearer ${this.b2sJWT}`}}).then((e=>e.blob())).then((e=>window.URL.createObjectURL(e))).catch()),this.imageBlobUrlCache[t]}getSvcLocale(e,t){const n=`${this.appStaticUrl}v102/${this.appAlias}/locales/${e}/${t}`,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:Br})),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:Br})),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=Br,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}=Gg("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()))}},Wr="component-loader",Hr={},qr=async(e,t)=>{const n=Gr.getLoader(),r=t||Gr.staticServerURL;if(!e||window.PCore&&!1===window.PCore.getBehaviorOverride("dynamicLoadComponents"))return Promise.resolve();if(Gr.getLoader(Wr))return Gr.getLoader(Wr)(e,r);const s=[];return e.forEach((e=>{if(Hr[e])return;const t=an.getComponent(e);if(!t){const t=`${Gr.getConstellationServiceUrl()}/v860/${Gr.getAppAlias()}/component/${e}.js`;return void s.push(n(t,Gr.getTypes.SCRIPT))}(t.scripts||[]).forEach((e=>{const t=e.startsWith("http")?e:r+e;s.push(n(t,Gr.getTypes.SCRIPT))}));(t.styles||[]).forEach((e=>{s.push(n(r+e,Gr.getTypes.STYLE))})),Hr[e]=!0})),Promise.all(s)};function zr(e,t){return function(){return e.apply(t,arguments)}}const{toString:Yr}=Object.prototype,{getPrototypeOf:Kr}=Object,{iterator:Xr,toStringTag:Jr}=Symbol,Qr=(Zr=Object.create(null),e=>{const t=Yr.call(e);return Zr[t]||(Zr[t]=t.slice(8,-1).toLowerCase())});var Zr;const es=e=>(e=e.toLowerCase(),t=>Qr(t)===e),ts=e=>t=>typeof t===e,{isArray:ns}=Array,rs=ts("undefined");function ss(e){return null!==e&&!rs(e)&&null!==e.constructor&&!rs(e.constructor)&&is(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const as=es("ArrayBuffer");const os=ts("string"),is=ts("function"),cs=ts("number"),ls=e=>null!==e&&"object"==typeof e,us=e=>{if("object"!==Qr(e))return!1;const t=Kr(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Jr in e||Xr in e)},ds=es("Date"),ps=es("File"),hs=es("Blob"),gs=es("FileList");const fs="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},ms=void 0!==fs.FormData?fs.FormData:void 0,ys=es("URLSearchParams"),[Es,Is,As,_s]=["ReadableStream","Request","Response","Headers"].map(es);function Cs(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),ns(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(ss(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 Ss(e,t){if(ss(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 Ts="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ns=e=>!rs(e)&&e!==Ts;const Ps=(Rs="undefined"!=typeof Uint8Array&&Kr(Uint8Array),e=>Rs&&e instanceof Rs);var Rs;const Ds=es("HTMLFormElement"),bs=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Os=es("RegExp"),vs=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Cs(n,((n,s)=>{let a;!1!==(a=t(n,s,e))&&(r[s]=a||n)})),Object.defineProperties(e,r)};const xs=es("AsyncFunction"),ws=(Ms="function"==typeof setImmediate,Ls=is(Ts.postMessage),Ms?setImmediate:Ls?(Us=`axios@${Math.random()}`,Fs=[],Ts.addEventListener("message",(({source:e,data:t})=>{e===Ts&&t===Us&&Fs.length&&Fs.shift()()}),!1),e=>{Fs.push(e),Ts.postMessage(Us,"*")}):e=>setTimeout(e));var Ms,Ls,Us,Fs;const js="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Ts):"undefined"!=typeof process&&process.nextTick||ws,Vs={isArray:ns,isArrayBuffer:as,isBuffer:ss,isFormData:e=>{if(!e)return!1;if(ms&&e instanceof ms)return!0;const t=Kr(e);if(!t||t===Object.prototype)return!1;if(!is(e.append))return!1;const n=Qr(e);return"formdata"===n||"object"===n&&is(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&as(e.buffer),t},isString:os,isNumber:cs,isBoolean:e=>!0===e||!1===e,isObject:ls,isPlainObject:us,isEmptyObject:e=>{if(!ls(e)||ss(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Es,isRequest:Is,isResponse:As,isHeaders:_s,isUndefined:rs,isDate:ds,isFile:ps,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:hs,isRegExp:Os,isFunction:is,isStream:e=>ls(e)&&is(e.pipe),isURLSearchParams:ys,isTypedArray:Ps,isFileList:gs,forEach:Cs,merge:function e(...t){const{caseless:n,skipUndefined:r}=Ns(this)&&this||{},s={},a=(t,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;const o=n&&Ss(s,a)||a,i=bs(s,o)?s[o]:void 0;us(i)&&us(t)?s[o]=e(i,t):us(t)?s[o]=e({},t):ns(t)?s[o]=t.slice():r&&rs(t)||(s[o]=t)};for(let e=0,n=t.length;e<n;e++)t[e]&&Cs(t[e],a);return s},extend:(e,t,n,{allOwnKeys:r}={})=>(Cs(t,((t,r)=>{n&&is(t)?Object.defineProperty(e,r,{__proto__:null,value:zr(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&&Kr(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Qr,kindOfTest:es,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(ns(e))return e;let t=e.length;if(!cs(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Xr]).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:Ds,hasOwnProperty:bs,hasOwnProp:bs,reduceDescriptors:vs,freezeMethods:e=>{vs(e,((t,n)=>{if(is(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];is(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 ns(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:Ss,global:Ts,isContextDefined:Ns,isSpecCompliantForm:function(e){return!!(e&&is(e.append)&&"FormData"===e[Jr]&&e[Xr])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ls(e)){if(t.indexOf(e)>=0)return;if(ss(e))return e;if(!("toJSON"in e)){t[r]=e;const s=ns(e)?[]:{};return Cs(e,((e,t)=>{const a=n(e,r+1);!rs(a)&&(s[t]=a)})),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:xs,isThenable:e=>e&&(ls(e)||is(e))&&is(e.then)&&is(e.catch),setImmediate:ws,asap:js,isIterable:e=>null!=e&&is(e[Xr])},ks=Vs.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"]),$s=Symbol("internals"),Bs=/[^\x09\x20-\x7E\x80-\xFF]/g;function Gs(e){return e&&String(e).trim().toLowerCase()}function Ws(e){return!1===e||null==e?e:Vs.isArray(e)?e.map(Ws):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(Bs,""))}function Hs(e,t,n,r,s){return Vs.isFunction(r)?r.call(this,t,n):(s&&(t=n),Vs.isString(t)?Vs.isString(r)?-1!==t.indexOf(r):Vs.isRegExp(r)?r.test(t):void 0:void 0)}class qs{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=Gs(t);if(!s)throw new Error("header name must be a non-empty string");const a=Vs.findKey(r,s);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=Ws(e))}const a=(e,t)=>Vs.forEach(e,((e,n)=>s(e,n,t)));if(Vs.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Vs.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]&&ks[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(Vs.isObject(e)&&Vs.isIterable(e)){let n,r,s={};for(const t of e){if(!Vs.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[r=t[0]]=(n=s[r])?Vs.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=Gs(e)){const n=Vs.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(Vs.isFunction(t))return t.call(this,e,n);if(Vs.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Gs(e)){const n=Vs.findKey(this,e);return!(!n||void 0===this[n]||t&&!Hs(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=Gs(e)){const s=Vs.findKey(n,e);!s||t&&!Hs(0,n[s],s,t)||(delete n[s],r=!0)}}return Vs.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&&!Hs(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return Vs.forEach(this,((r,s)=>{const a=Vs.findKey(n,s);if(a)return t[a]=Ws(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]=Ws(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Vs.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Vs.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[$s]=this[$s]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Gs(e);t[r]||(!function(e,t){const n=Vs.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 Vs.isArray(e)?e.forEach(r):r(e),this}}qs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Vs.reduceDescriptors(qs.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Vs.freezeMethods(qs);const zs=qs;function Ys(e,t){const n=new Set(t.map((e=>String(e).toLowerCase()))),r=[],s=e=>{if(null===e||"object"!=typeof e)return e;if(Vs.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof zs&&(e=e.toJSON()),r.push(e),Vs.isArray(e))t=[],e.forEach(((e,n)=>{const r=s(e);Vs.isUndefined(r)||(t[n]=r)}));else{if(!Vs.isPlainObject(e)&&function(e){if(Vs.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Vs.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);Vs.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return s(e)}class Ks extends Error{static from(e,t,n,r,s,a){const o=new Ks(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&&Vs.hasOwnProp(e,"redact")?e.redact:void 0,n=Vs.isArray(t)&&t.length>0?Ys(e,t):Vs.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}}}Ks.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Ks.ERR_BAD_OPTION="ERR_BAD_OPTION",Ks.ECONNABORTED="ECONNABORTED",Ks.ETIMEDOUT="ETIMEDOUT",Ks.ECONNREFUSED="ECONNREFUSED",Ks.ERR_NETWORK="ERR_NETWORK",Ks.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Ks.ERR_DEPRECATED="ERR_DEPRECATED",Ks.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Ks.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Ks.ERR_CANCELED="ERR_CANCELED",Ks.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Ks.ERR_INVALID_URL="ERR_INVALID_URL",Ks.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Xs=Ks;function Js(e){return Vs.isPlainObject(e)||Vs.isArray(e)}function Qs(e){return Vs.endsWith(e,"[]")?e.slice(0,-2):e}function Zs(e,t,n){return e?e.concat(t).map((function(e,t){return e=Qs(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ea=Vs.toFlatObject(Vs,{},null,(function(e){return/^is[A-Z]/.test(e)}));const ta=function(e,t,n){if(!Vs.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Vs.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Vs.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&&Vs.isSpecCompliantForm(t);if(!Vs.isFunction(s))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(Vs.isDate(e))return e.toISOString();if(Vs.isBoolean(e))return e.toString();if(!l&&Vs.isBlob(e))throw new Xs("Blob is not supported. Use a Buffer instead.");return Vs.isArrayBuffer(e)||Vs.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function d(e,n,s){let i=e;if(Vs.isReactNative(t)&&Vs.isReactNativeBlob(e))return t.append(Zs(s,n,a),u(e)),!1;if(e&&!s&&"object"==typeof e)if(Vs.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Vs.isArray(e)&&function(e){return Vs.isArray(e)&&!e.some(Js)}(e)||(Vs.isFileList(e)||Vs.endsWith(n,"[]"))&&(i=Vs.toArray(e)))return n=Qs(n),i.forEach((function(e,r){!Vs.isUndefined(e)&&null!==e&&t.append(!0===o?Zs([n],r,a):null===o?n:n+"[]",u(e))})),!1;return!!Js(e)||(t.append(Zs(s,n,a),u(e)),!1)}const p=[],h=Object.assign(ea,{defaultVisitor:d,convertValue:u,isVisitable:Js});if(!Vs.isObject(e))throw new TypeError("data must be an object");return function e(n,r,a=0){if(!Vs.isUndefined(n)){if(a>c)throw new Xs("Object is too deeply nested ("+a+" levels). Max depth: "+c,Xs.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==p.indexOf(n))throw Error("Circular reference detected in "+r.join("."));p.push(n),Vs.forEach(n,(function(n,o){!0===(!(Vs.isUndefined(n)||null===n)&&s.call(t,n,Vs.isString(o)?o.trim():o,r,h))&&e(n,r?r.concat(o):[o],a+1)})),p.pop()}}(e),t};function na(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function ra(e,t){this._pairs=[],e&&ta(e,this,t)}const sa=ra.prototype;sa.append=function(e,t){this._pairs.push([e,t])},sa.toString=function(e){const t=e?function(t){return e.call(this,t,na)}:na;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const aa=ra;function oa(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ia(e,t,n){if(!t)return e;const r=n&&n.encode||oa,s=Vs.isFunction(n)?{serialize:n}:n,a=s&&s.serialize;let o;if(o=a?a(t,s):Vs.isURLSearchParams(t)?t.toString():new aa(t,s).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const ca=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){Vs.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},la={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ua={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:aa,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},da="undefined"!=typeof window&&"undefined"!=typeof document,pa="object"==typeof navigator&&navigator||void 0,ha=da&&(!pa||["ReactNative","NativeScript","NS"].indexOf(pa.product)<0),ga="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fa=da&&window.location.href||"http://localhost",ma={...u,...ua};const ya=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&&Vs.isArray(r)?r.length:a,i)return Vs.hasOwnProp(r,a)?r[a]=Vs.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o;r[a]&&Vs.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],s)&&Vs.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(Vs.isFormData(e)&&Vs.isFunction(e.entries)){const n={};return Vs.forEachEntry(e,((e,r)=>{t(function(e){return Vs.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},Ea=(e,t)=>null!=e&&Vs.hasOwnProp(e,t)?e[t]:void 0;const Ia={transitional:la,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=Vs.isObject(e);s&&Vs.isHTMLForm(e)&&(e=new FormData(e));if(Vs.isFormData(e))return r?JSON.stringify(ya(e)):e;if(Vs.isArrayBuffer(e)||Vs.isBuffer(e)||Vs.isStream(e)||Vs.isFile(e)||Vs.isBlob(e)||Vs.isReadableStream(e))return e;if(Vs.isArrayBufferView(e))return e.buffer;if(Vs.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){const t=Ea(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ta(e,new ma.classes.URLSearchParams,{visitor:function(e,t,n,r){return ma.isNode&&Vs.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((a=Vs.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Ea(this,"env"),r=n&&n.FormData;return ta(a?{"files[]":e}:e,r&&new r,t)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(Vs.isString(e))try{return(t||JSON.parse)(e),Vs.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Ea(this,"transitional")||Ia.transitional,n=t&&t.forcedJSONParsing,r=Ea(this,"responseType"),s="json"===r;if(Vs.isResponse(e)||Vs.isReadableStream(e))return e;if(e&&Vs.isString(e)&&(n&&!r||s)){const n=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e,Ea(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Xs.from(e,Xs.ERR_BAD_RESPONSE,this,null,Ea(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ma.classes.FormData,Blob:ma.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Vs.forEach(["delete","get","head","post","put","patch","query"],(e=>{Ia.headers[e]={}}));const Aa=Ia;function _a(e,t){const n=this||Aa,r=t||n,s=zs.from(r.headers);let a=r.data;return Vs.forEach(e,(function(e){a=e.call(n,a,s.normalize(),t?t.status:void 0)})),s.normalize(),a}function Ca(e){return!(!e||!e.__CANCEL__)}const Sa=class extends Xs{constructor(e,t,n){super(null==e?"canceled":e,Xs.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ta(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Xs("Request failed with status code "+n.status,n.status>=400&&n.status<500?Xs.ERR_BAD_REQUEST:Xs.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Na=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 Pa=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)]},Ra=(e,t,n=3)=>{let r=0;const s=Na(50,250);return Pa((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)},Da=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ba=e=>(...t)=>Vs.asap((()=>e(...t))),Oa=ma.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ma.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ma.origin),ma.navigator&&/(msie|trident)/i.test(ma.navigator.userAgent)):()=>!0,va=ma.hasStandardBrowserEnv?{write(e,t,n,r,s,a,o){if("undefined"==typeof document)return;const i=[`${e}=${encodeURIComponent(t)}`];Vs.isNumber(n)&&i.push(`expires=${new Date(n).toUTCString()}`),Vs.isString(r)&&i.push(`path=${r}`),Vs.isString(s)&&i.push(`domain=${s}`),!0===a&&i.push("secure"),Vs.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 xa(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 wa=e=>e instanceof zs?{...e}:e;function Ma(e,t){t=t||{};const n=Object.create(null);function r(e,t,n,r){return Vs.isPlainObject(e)&&Vs.isPlainObject(t)?Vs.merge.call({caseless:r},e,t):Vs.isPlainObject(t)?Vs.merge({},t):Vs.isArray(t)?t.slice():t}function s(e,t,n,s){return Vs.isUndefined(t)?Vs.isUndefined(e)?void 0:r(void 0,e,0,s):r(e,t,0,s)}function a(e,t){if(!Vs.isUndefined(t))return r(void 0,t)}function o(e,t){return Vs.isUndefined(t)?Vs.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(n,s,a){return Vs.hasOwnProp(t,a)?r(n,s):Vs.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(wa(e),wa(t),0,!0)};return Vs.forEach(Object.keys({...e,...t}),(function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const a=Vs.hasOwnProp(c,r)?c[r]:s,o=a(Vs.hasOwnProp(e,r)?e[r]:void 0,Vs.hasOwnProp(t,r)?t[r]:void 0,r);Vs.isUndefined(o)&&a!==i||(n[r]=o)})),n}const La=["content-type","content-length"];const Ua=e=>{const t=Ma({},e),n=e=>Vs.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=zs.from(i),t.url=ia(xa(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))))):""))),Vs.isFormData(r)&&(ma.hasStandardBrowserEnv||ma.hasStandardBrowserWebWorkerEnv?i.setContentType(void 0):Vs.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t).forEach((([t,n])=>{La.includes(t.toLowerCase())&&e.set(t,n)})):e.set(t)}(i,r.getHeaders(),n("formDataHeaderPolicy"))),ma.hasStandardBrowserEnv){Vs.isFunction(s)&&(s=s(t));if(!0===s||null==s&&Oa(t.url)){const e=a&&o&&va.read(o);e&&i.set(a,e)}}return t},Fa="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Ua(e);let s=r.data;const a=zs.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=zs.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());Ta((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 Xs("Request aborted",Xs.ECONNABORTED,e,f)),g(),f=null)},f.onerror=function(t){const r=t&&t.message?t.message:"Network Error",s=new Xs(r,Xs.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||la;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Xs(t,s.clarifyTimeoutError?Xs.ETIMEDOUT:Xs.ECONNABORTED,e,f)),g(),f=null},void 0===s&&a.setContentType(null),"setRequestHeader"in f&&Vs.forEach(a.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),Vs.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),d&&"json"!==d&&(f.responseType=r.responseType),h&&([c,u]=Ra(h,!0),f.addEventListener("progress",c)),p&&f.upload&&([i,l]=Ra(p),f.upload.addEventListener("progress",i),f.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(o=t=>{f&&(n(!t||t.type?new Sa(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||ma.protocols.includes(y)?f.send(s||null):n(new Xs("Unsupported protocol "+y+":",Xs.ERR_BAD_REQUEST,e))}))},ja=(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 Xs?t:new Sa(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,s(new Xs(`timeout of ${t}ms exceeded`,Xs.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=()=>Vs.asap(o),i}},Va=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},ka=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()}},$a=(e,t,n,r)=>{const s=async function*(e,t){for await(const n of ka(e))yield*Va(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 Ba="1.16.0",{isFunction:Ga}=Vs,Wa=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ha=e=>{const t=Vs.global??globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Vs.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:a,Response:o}=e,i=s?Ga(s):"function"==typeof fetch,c=Ga(a),l=Ga(o);if(!i)return!1;const u=i&&Ga(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&&Wa((()=>{let e=!1;const t=new a(ma.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&&Wa((()=>Vs.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 Xs(`Response type '${e}' is not supported`,Xs.ERR_NOT_SUPPORT,n)})}));const m=async(e,t)=>{const n=Vs.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Vs.isBlob(e))return e.size;if(Vs.isSpecCompliantForm(e)){const t=new a(ma.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Vs.isArrayBufferView(e)||Vs.isArrayBuffer(e)?e.byteLength:(Vs.isURLSearchParams(e)&&(e+=""),Vs.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}=Ua(e);const T=Vs.isNumber(C)&&C>-1,N=Vs.isNumber(S)&&S>-1;let P=s||fetch;E=E?(E+"").toLowerCase():"text";let R=ja([l,u&&u.toAbortSignal()],d),D=null;const b=R&&R.unsubscribe&&(()=>{R.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 Xs("maxContentLength size of "+C+" exceeded",Xs.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 Xs("Request body larger than maxBodyLength limit",Xs.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(Vs.isFormData(i)&&(e=n.headers.get("content-type"))&&I.setContentType(e),n.body){const[e,t]=Da(O,Ra(ba(y)));i=$a(n.body,65536,e,t)}}Vs.isString(A)||(A=A?"include":"omit");const s=c&&"credentials"in a.prototype;if(Vs.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/"+Ba,!1);const l={..._,signal:R,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?P(D,_):P(t,l));if(T){const t=Vs.toFiniteNumber(u.headers.get("content-length"));if(null!=t&&t>C)throw new Xs("maxContentLength size of "+C+" exceeded",Xs.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=Vs.toFiniteNumber(u.headers.get("content-length")),[r,s]=p&&Da(n,Ra(ba(p),!0))||[];let a=0;const i=t=>{if(T&&(a=t,a>C))throw new Xs("maxContentLength size of "+C+" exceeded",Xs.ERR_BAD_RESPONSE,e,D);r&&r(t)};u=new o($a(u.body,65536,i,(()=>{s&&s(),b&&b()})),t)}E=E||"text";let v=await f[Vs.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 Xs("maxContentLength size of "+C+" exceeded",Xs.ERR_BAD_RESPONSE,e,D)}return!d&&b&&b(),await new Promise(((t,n)=>{Ta(t,n,{data:v,headers:zs.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:D})}))}catch(t){if(b&&b(),R&&R.aborted&&R.reason instanceof Xs){const n=R.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 Xs("Network Error",Xs.ERR_NETWORK,e,D,t&&t.response),{cause:t.cause||t});throw Xs.from(t,t&&t.code,e,D,t&&t.response)}}},qa=new Map,za=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=qa;for(;c--;)o=a[c],i=l.get(o),void 0===i&&l.set(o,i=c?new Map:Ha(t)),l=i;return i},Ya=(za(),{http:null,xhr:Fa,fetch:{get:za}});Vs.forEach(Ya,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const Ka=e=>`- ${e}`,Xa=e=>Vs.isFunction(e)||null===e||!1===e;const Ja={getAdapter:function(e,t){e=Vs.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,!Xa(r)&&(s=Ya[(n=String(r)).toLowerCase()],void 0===s))throw new Xs(`Unknown adapter '${n}'`);if(s&&(Vs.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(Ka).join("\n"):" "+Ka(e[0]):"as no adapter specified";throw new Xs("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return s},adapters:Ya};function Qa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Sa(null,e)}function Za(e){Qa(e),e.headers=zs.from(e.headers),e.data=_a.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ja.getAdapter(e.adapter||Aa.adapter,e)(e).then((function(t){Qa(e),e.response=t;try{t.data=_a.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=zs.from(t.headers),t}),(function(t){if(!Ca(t)&&(Qa(e),t&&t.response)){e.response=t.response;try{t.response.data=_a.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=zs.from(t.response.headers)}return Promise.reject(t)}))}const eo={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{eo[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const to={};eo.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Ba+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,a)=>{if(!1===e)throw new Xs(r(s," has been removed"+(t?" in "+t:"")),Xs.ERR_DEPRECATED);return t&&!to[s]&&(to[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,a)}},eo.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const no={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Xs("options must be an object",Xs.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 Xs("option "+a+" must be "+n,Xs.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Xs("Unknown option "+a,Xs.ERR_BAD_OPTION)}},validators:eo},ro=no.validators;class so{constructor(e){this.defaults=e||{},this.interceptors={request:new ca,response:new ca}}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=Ma(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&no.assertOptions(n,{silentJSONParsing:ro.transitional(ro.boolean),forcedJSONParsing:ro.transitional(ro.boolean),clarifyTimeoutError:ro.transitional(ro.boolean),legacyInterceptorReqResOrdering:ro.transitional(ro.boolean)},!1),null!=r&&(Vs.isFunction(r)?t.paramsSerializer={serialize:r}:no.assertOptions(r,{encode:ro.function,serialize:ro.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),no.assertOptions(t,{baseUrl:ro.spelling("baseURL"),withXsrfToken:ro.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&Vs.merge(s.common,s[t.method]);s&&Vs.forEach(["delete","get","head","post","put","patch","query","common"],(e=>{delete s[e]})),t.headers=zs.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||la;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=[Za.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=Za.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return ia(xa((e=Ma(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Vs.forEach(["delete","get","head","options"],(function(e){so.prototype[e]=function(t,n){return this.request(Ma(n||{},{method:e,url:t,data:(n||{}).data}))}})),Vs.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,s){return this.request(Ma(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}so.prototype[e]=t(),"query"!==e&&(so.prototype[e+"Form"]=t(!0))}));const ao=so;class oo{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,s){n.reason||(n.reason=new Sa(e,r,s),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new oo((function(t){e=t})),cancel:e}}}const io=oo;const co={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(co).forEach((([e,t])=>{co[t]=e}));const lo=co;const uo=function e(t){const n=new ao(t),r=zr(ao.prototype.request,n);return Vs.extend(r,ao.prototype,n,{allOwnKeys:!0}),Vs.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ma(t,n))},r}(Aa);uo.Axios=ao,uo.CanceledError=Sa,uo.CancelToken=io,uo.isCancel=Ca,uo.VERSION=Ba,uo.toFormData=ta,uo.AxiosError=Xs,uo.Cancel=uo.CanceledError,uo.all=function(e){return Promise.all(e)},uo.spread=function(e){return function(t){return e.apply(null,t)}},uo.isAxiosError=function(e){return Vs.isObject(e)&&!0===e.isAxiosError},uo.mergeConfig=Ma,uo.AxiosHeaders=zs,uo.formToJSON=e=>ya(Vs.isHTMLForm(e)?new FormData(e):e),uo.getAdapter=Ja.getAdapter,uo.HttpStatusCode=lo,uo.default=uo;const po=uo;function ho(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 go=ho((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));var fo=function(e,t){return fo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},fo(e,t)};function mo(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}fo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function yo(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 Eo(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 Io(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 Ao(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 _o(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 Co(e){return this instanceof Co?(this.v=e,this):new Co(e)}function So(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 Co?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 To(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Io(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 No=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function Po(e){return"function"==typeof e}function Ro(e){return Po(null==e?void 0:e.then)}var Do=ho((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 bo(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Oo=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=Io(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(Po(c))try{c()}catch(e){s=e instanceof Do?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Io(l),d=u.next();!d.done;d=u.next()){var p=d.value;try{wo(p)}catch(e){s=null!=s?s:[],e instanceof Do?s=_o(_o([],Ao(s)),Ao(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 Do(s)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)wo(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)&&bo(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&bo(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),vo=Oo.EMPTY;function xo(e){return e instanceof Oo||e&&"closed"in e&&Po(e.remove)&&Po(e.add)&&Po(e.unsubscribe)}function wo(e){Po(e)?e():e.unsubscribe()}var Mo={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Lo={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=Lo.delegate;return(null==s?void 0:s.setTimeout)?s.setTimeout.apply(s,_o([e,t],Ao(n))):setTimeout.apply(void 0,_o([e,t],Ao(n)))},clearTimeout:function(e){var t=Lo.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Uo(e){Lo.setTimeout((function(){var t=Mo.onUnhandledError;if(!t)throw e;t(e)}))}function Fo(){}var jo=Vo("C",void 0,void 0);function Vo(e,t,n){return{kind:e,value:t,error:n}}var ko=null;function $o(e){if(Mo.useDeprecatedSynchronousErrorHandling){var t=!ko;if(t&&(ko={errorThrown:!1,error:null}),e(),t){var n=ko,r=n.errorThrown,s=n.error;if(ko=null,r)throw s}}else e()}var Bo=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,xo(t)&&t.add(n)):n.destination=Ko,n}return mo(t,e),t.create=function(e,t,n){return new qo(e,t,n)},t.prototype.next=function(e){this.isStopped?Yo(function(e){return Vo("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Yo(Vo("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Yo(jo,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}(Oo),Go=Function.prototype.bind;function Wo(e,t){return Go.call(e,t)}var Ho=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){zo(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){zo(e)}else zo(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){zo(e)}},e}(),qo=function(e){function t(t,n,r){var s,a,o=e.call(this)||this;Po(t)||!t?s={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&Mo.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},s={next:t.next&&Wo(t.next,a),error:t.error&&Wo(t.error,a),complete:t.complete&&Wo(t.complete,a)}):s=t;return o.destination=new Ho(s),o}return mo(t,e),t}(Bo);function zo(e){var t;Mo.useDeprecatedSynchronousErrorHandling?(t=e,Mo.useDeprecatedSynchronousErrorHandling&&ko&&(ko.errorThrown=!0,ko.error=t)):Uo(e)}function Yo(e,t){var n=Mo.onStoppedNotification;n&&Lo.setTimeout((function(){return n(e,t)}))}var Ko={closed:!0,next:Fo,error:function(e){throw e},complete:Fo},Xo="function"==typeof Symbol&&Symbol.observable||"@@observable";function Jo(e){return e}function Qo(e){return 0===e.length?Jo:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var Zo=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 Bo||function(e){return e&&Po(e.next)&&Po(e.error)&&Po(e.complete)}(r)&&xo(r)?e:new qo(e,t,n);return $o((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=ei(t))((function(t,r){var s=new qo({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[Xo]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Qo(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=ei(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 ei(e){var t;return null!==(t=null!=e?e:Mo.Promise)&&void 0!==t?t:Promise}function ti(e){return Po(e[Xo])}function ni(e){return Symbol.asyncIterator&&Po(null==e?void 0:e[Symbol.asyncIterator])}function ri(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 si="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function ai(e){return Po(null==e?void 0:e[si])}function oi(e){return So(this,arguments,(function(){var t,n,r;return Eo(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,Co(t.read())];case 3:return n=s.sent(),r=n.value,n.done?[4,Co(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Co(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 ii(e){return Po(null==e?void 0:e.getReader)}function ci(e){if(e instanceof Zo)return e;if(null!=e){if(ti(e))return s=e,new Zo((function(e){var t=s[Xo]();if(Po(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(No(e))return r=e,new Zo((function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()}));if(Ro(e))return n=e,new Zo((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Uo)}));if(ni(e))return li(e);if(ai(e))return t=e,new Zo((function(e){var n,r;try{for(var s=Io(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(ii(e))return li(oi(e))}var t,n,r,s;throw ri(e)}function li(e){return new Zo((function(t){(function(e,t){var n,r,s,a;return yo(this,void 0,void 0,(function(){var o,i;return Eo(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=To(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 ui(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 di(e){return function(t){if(function(e){return Po(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 pi(e,t,n,r,s){return new hi(e,t,n,r,s)}var hi=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 mo(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}(Bo);function gi(e,t){return void 0===t&&(t=0),di((function(n,r){n.subscribe(pi(r,(function(n){return ui(r,e,(function(){return r.next(n)}),t)}),(function(){return ui(r,e,(function(){return r.complete()}),t)}),(function(n){return ui(r,e,(function(){return r.error(n)}),t)})))}))}function fi(e,t){return void 0===t&&(t=0),di((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function mi(e,t){if(!e)throw new Error("Iterable cannot be null");return new Zo((function(n){ui(n,t,(function(){var r=e[Symbol.asyncIterator]();ui(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function yi(e,t){if(null!=e){if(ti(e))return function(e,t){return ci(e).pipe(fi(t),gi(t))}(e,t);if(No(e))return function(e,t){return new Zo((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(Ro(e))return function(e,t){return ci(e).pipe(fi(t),gi(t))}(e,t);if(ni(e))return mi(e,t);if(ai(e))return function(e,t){return new Zo((function(n){var r;return ui(n,t,(function(){r=e[si](),ui(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 Po(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(ii(e))return function(e,t){return mi(oi(e),t)}(e,t)}throw ri(e)}function Ei(e,t){return t?yi(e,t):ci(e)}function Ii(e,t,n){var r=Po(e)||t||n?{next:e,error:t,complete:n}:e;return r?di((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var s=!0;e.subscribe(pi(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)})))})):Jo}const Ai=class{constructor(e,t,n,r){this.eventType=e,this.callback=n,this.contextName=r,this.id=t}};const _i=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 Ai(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 Ci=class{static subscribe(e,t,n,r=!1,s="app"){_i.subscribe(e,n,t,s,r)}static subscribeOnce(e,t,n){this.subscribe(e,t,n,!0)}static publish(e,t){_i.publish(e,t)}static unsubscribe(e,t,n="app"){_i.unsubscribe(e,t,n)}static unsubscribeAllWithEventType(e){_i.unsubscribeAllWithEventType(e)}static cleanContextSubscribers(e){_i.clearContext(e)}};class Si{constructor(e,t=!0){this.config=e,t?(this.ssKeyConfig=e,this.reloadConfig()):this.updateConfig(e,!1)}static init(e,t=!0){return new Si(e,t)}updateConfig(e,t=!0){t?window.sessionStorage.setItem(this.ssKeyConfig,JSON.stringify(this.config)):ec(e)}reloadConfig(e=!0){if(e){const e=window.sessionStorage.getItem(this.ssKeyConfig);this.config=e?JSON.parse(e):null}else this.config=tc()}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:Rp.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"),zi(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?Qi({pzCTkn:e?.csrf}):(Zi({tokenInfo:e}),Qi({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 Ti=Si,Ni=async()=>new Promise((async(e,t)=>{const n=nc();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 zi(a,{method:"POST",headers:new Headers(l),credentials:c?"include":"omit",body:u.toString(),withoutDefaultHeaders:!0}),Qi({Authorization:null}),Zi({tokenInfo:null}),e()})),Pi=async e=>{const t={};if("OAuth2.0"===e?.authType){const n=new Ti(e,!1);t.reauthUrl=await n.buildAuthorizeUrl(),t.redirectOrigin=n.getRedirectUriOrigin(),window.addEventListener("message",n.authMessageHandler,!1)}else t.reauthUrl=T()+(S()?`${S()}`:"/?reAuth=true");return t},Ri=(e,t)=>{Pi(t).then((t=>{const n={openReauthMessageModal:!0,reAuthenticationURL:t.reauthUrl,url:e,redirectOrigin:t.redirectOrigin};Ci.publish(B.PUB_SUB_EVENTS.EVENT_REAUTH,n)}))},Di=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};Zi({tokenInfo:{...e.tokenInfo,...r}}),e.secureCookie?Qi({pzCTkn:n?.csrf}):Qi({Authorization:`${n?.token_type} ${n?.access_token}`});const{onTokenRetrieval:s}=e;s&&"function"==typeof s&&s(n)},failure:t=>{if(e.popupReauth)return Ri(t,e);Ci.publish(B.PUB_SUB_EVENTS.EVENT_FULL_REAUTH,e)}}}else t=`${T()}/updateSession`,n={method:"GET",headers:{}},r={failure:Ri};return{url:t,config:n,callback:r,isRefreshTokenPresent:s}},bi=(e,t)=>"OAuth2.0"===t?.authType?e?.includes(t.endPoints.token):e?.includes("updateSession"),Oi=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}},vi=(e,t,n)=>{const{config:r}=e,{url:s,config:a,callback:o,isRefreshTokenPresent:i}=Di(n),c=r.headers&&r.headers.context;r.data&&(r.body=r.data);const l=Yi(r.url,r,c,t);return i?zi(s,a).then((e=>new Promise(((n,s)=>{setTimeout((()=>{t.setUpdateSessionStatus(!1),t.latestUpdateSessionTimeStamp=Date.now(),o?.success?.(e,r),Ci.publish("updateSession",{updateStatus:"success"}),Ci.publish("OnUpdateSession",{}),l.then((e=>{n(e)})).catch((e=>{s(e)}))}),0)})))).catch((e=>e&&e.config&&bi(e.config.url,n)?(o?.failure?.(r.url,n),l):Promise.reject(e))):(o?.failure?.(r.url,n),l)},xi=(e,t,n,r)=>{if(e.config&&bi(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(Ci.unsubscribeAllWithEventType(ji),t.setUpdateSessionStatus(!0),"custom"===n?.authType){Ci.publish(B.PUB_SUB_EVENTS.EVENT_CUSTOM_REAUTH);const{url:n,config:r,context:s}=Oi(e);return Yi(n,r,s,t)}return vi(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}=Oi(e);return zi(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[B.TRACE_ID]?{type:"error",message:e.localizedValue||e.message,correlationID:t[B.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"))),nr({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return Promise.reject(e)};const wi=class{constructor(){this.updateSessionInProgress=!1,this.latestUpdateSessionTimeStamp=Date.now()}getUpdateSessionStatus=()=>this.updateSessionInProgress;setUpdateSessionStatus=e=>{this.updateSessionInProgress=e}};const Mi=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 Li=new class{constructor(){this.xray=!1,this.onXRayCallback=null,this.xrayRuntime=new Mi(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 Ui=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{[G.COREHEADER_APP_DEBUG_ID]:e.debugId,[G.COREHEADER_APP_DEBUG_LEVELS]:Li.getDebugLevels()}}getCoreHeadersFromContext(e){if(["root","app"].includes(e)||!e)return;const t=Wh.getProperty(G.COREHEADERS,"",e);return t?{...t,debugInfo:Li.getPreviewMode()&&{...t.debugInfo,[G.COREHEADER_APP_DEBUG_LEVELS]:Li.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(G.SKIPCOREHEADERS))return void delete e[G.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&&q.injectRemoteCaseHeader(e,t,n),this.processCoreHeaders(e,t,n)}},Fi=Ui;const ji="updateSession",Vi={},ki=new wi,$i=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&&(Ci.unsubscribe(B.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((()=>{Ci.publish(B.PUB_SUB_EVENTS.TIMEOUT_REMINDER,{timeRemaining:this.expiryBuffer}),clearTimeout(t),Ci.subscribe(B.PUB_SUB_EVENTS.RESET_TIMER,this.resetInactiveTimeout,"resetCallback"),this.timeoutWarned=!0}),1e3*(e-this.expiryBuffer));return this.setTimerID(t),t}};let Bi={},Gi={},Wi={},Hi="";const qi=e=>{Bi=e},zi=(e,t,n="root",r={})=>{const{doNotMergeHttpMessagesForStatusCode:s=null,cancelContext:a=n,includeRemoteSystemIdIfPresent:o=!0}=r;Hi=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||Fi.injectCoreAdditionalHeaders(h,t.body,n,{includeRemoteSystemIdIfPresent:o}),a&&Vi[a]>=0?Vi[a]+=1:a&&void 0===Vi[a]&&(Vi[a]=1);let g=l?{...h}:{...Fi.getDefaultHeaders(),...Fi.getRegisteredHeaders(),...h,context:n};if(u.isExternalUrl=(e=>!e?.startsWith(T()||""))(e||""),u.fetchTimeStamp=Date.now(),e&&bi(e,Gi)&&ki.getUpdateSessionStatus()||!ki.getUpdateSessionStatus()||u.isExternalUrl){bi(e,Gi)&&"OAuth2.0"===Gi?.authType&&(g={...h});const{restApi:t}=Rp.doesRestApiExist("Logout")&&Rp.getRestEndPoint("Logout")||{restApi:null};return(!t||e&&!e.endsWith(t))&&$i.setTimerID($i.resetInactiveTimeout($i.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 go)}})}))}(Ei(po({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=Gi,!("OAuth2.0"!==f?.authType||!f.secureCookie)||!("custom"!==f?.authType||!f.customCookies)||void 0)})).pipe(Ii((()=>{const e=Fi.getCoreHeadersFromContext(g.context);e&&(e=>{Ci.publish(G.PUB_SUB_EVENTS.FETCH_SUCCESS,e)})({...e})}))))}var f;return Yi(e,t,n,ki)},Yi=(e,t,n,r)=>new Promise(((s,a)=>{Ci.subscribe(ji,(o=>{r.setUpdateSessionStatus(!o.updateStatus),"success"===o.updateStatus?zi(e,t,n).then((e=>s(e))).catch((e=>a(e))):a(o.updateStatus.error)}),ji)})),Ki=e=>{Vi[e]>0&&(Vi[e]-=1,0===Vi[e]&&delete Vi[e])};po.interceptors.request.use((e=>(Bi.request&&(e=Bi.request(e)),e)),(e=>Promise.reject(e))),po.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"))),nr({messages:t,category:"HTTP",context:n}),Promise.reject(e)}return e.config.headers&&e.config.headers.context&&(e.config.skipClearErrorMessages||(er({type:"error",category:"HTTP",context:e.config.headers.context}).length>0&&tr({type:"error",category:"HTTP",context:e.config.headers.context}),er({type:"error",category:e.config.headers.context===G.APP.APP?"PAGE":"",context:e.config.headers.context}).length>0&&tr({type:"error",category:"PAGE",context:e.config.headers.context})),Ki(e.config.headers.context)),Bi.response&&(e=Bi.response(e)),e}),(e=>(e.config&&e.config.headers&&e.config.headers.context&&Ki(e.config.headers.context),!e.response||!e.response.status||401!==e.response.status||e.config.isExternalUrl||e.config&&bi(e.config.url,Gi)||Ci.subscribe(ji,(e=>{ki.setUpdateSessionStatus(!e.updateStatus)}),ji),xi(e,ki,Gi,e.response&&e.response.status&&e.response.status===Number(Hi)?Hi:null))));const Xi=()=>po.CancelToken.source(),Ji=e=>po.isCancel(e),Qi=e=>{Fi.setDefaultHeaders(e)},Zi=e=>{Gi={...Gi,...e}},ec=e=>{Wi={...Wi,...e}},tc=()=>({...Wi}),nc=()=>({...Gi});const rc=class{static createCase(e,t){const{caseInfo:n,startingFields:r,flowType:s,viewType:a=Gc.PAGE,pageName:o,context:i=G.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 ac("createWork",{body:d,queryPayload:{caseClassName:e,viewType:a,params:{pageName:o}},headers:{...l,...c&&{...Fi.addDebugHeaders(c)}}},i).then((t=>({response:t.data,requestPayload:d,headers:Hc(t.headers,e,l)})))}},sc=()=>({registerHeader:(...e)=>Fi.registerHeader(...e),unRegisterHeader:(...e)=>Fi.unRegisterHeader(...e),getRegisteredHeaders:()=>Fi.getRegisteredHeaders()}),ac=(e,{body:t={},queryPayload:n={},cancelTokenSource:r,headers:s={},responseType:a},o,i)=>{const{restApi:c,reqType:l}=Wg(e,n),u={method:l,headers:s,body:t,...a&&{responseType:a}};return r&&(u.signal=r.token),zi(c,u,o,i??{})},oc=(e,{method:t="GET",body:n={},headers:r={},withoutDefaultHeaders:s=!1},a)=>{e.startsWith("http:")||e.startsWith("https:")||(e=T()+e);return zi(e,{method:t,headers:r,body:n,withoutDefaultHeaders:s},a)},ic=e=>Rp.doesRestApiExist(e),cc=()=>Xi(),lc=e=>Ji(e),uc=e=>{qi(e)},dc=()=>rc;const pc=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?kh.isValidJson(t):void 0;return n||t};removeComponentState=e=>{sessionStorage.removeItem(this.getNormalizedKey(e))};fetchUserSettings=async()=>{if(ic("getUserSettings")){const{restApi:e,reqType:t}=Wg("getUserSettings");zi(e,{method:t,headers:{}}).then((e=>{if(200!==e.status||!e.data)throw new Error("something went wrong while fetching getUserSettings");this.userSettings=e.data})).catch((e=>console.error(e)))}};init=()=>{Dp.getUserSettings()?this.userSettings=Dp.getUserSettings():this.fetchUserSettings()};getUserSettings=e=>{if(!e)throw new Error("path is required parameter");if("string"!=typeof e)throw new TypeError("path must be string");return kh.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(!ic("updateUserSettings"))return Promise.resolve("updateUserSettings route is not available");n=Wg("updateUserSettings");const{restApi:r,reqType:s}=n;return zi(r,{method:s,body:kh.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]};Ci.subscribe(G.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 hc{constructor(e){hc._instance=this,this.context=`${e}/${G.SUGGESTION}`,Ch()?.getState().data?.[this.context]||Sh({type:Be,payload:{context:this.context,data:{}}})}getField(e){return Rh(e,"",this.context)}setField(e,t){Sh({type:re,payload:{reference:e,value:t,context:this.context}})}removeField(e){Sh({type:_e,payload:{reference:e,context:this.context}})}setState(e){Sh(Xh({context:this.context,data:e,isArrayDeepMerge:!0}))}}const gc=hc;const fc=class{static getSharedState(e){const t=e.startsWith(".")?e.substring(1):e,n=Nh();return n?kh.getIn(n,t):null}static setSharedState(e,t){e&&Sh(bg({key:e,value:t}))}static updateState(e,t,n,r={}){const{isArrayDeepMerge:s=!0,pageReference:a,skipDirtyValidation:o=!1}=r;if(!e||!t)return;Sh(Og({context:e,reference:a?`${a}.${t}`:t,value:n,isArrayDeepMerge:s,skipDirtyValidation:o}))}static getSuggestionsContext(e){return new gc(e)}};class mc{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 yc=mc,Ec=e=>{Ci.publish(G.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_SUBMISSION,e)},Ic={CASE_INFO:`${G.DATA}.${G.CASE_INFO.CASE_INFO}`,CASE_CLASS_NAME:`${G.DATA}.${G.CASE_INFO.CASE_TYPE_ID}`,NEXT_ASSIGNMENT_INFO_ID:`${G.DATA}.${G.NEXT_ASSIGNMENT_INFO_ID}`,ASSIGNMENTS:`${G.DATA}.${G.CASE_INFO.ASSIGNMENTS}`,CASE_INFO_ID:`${G.DATA}.${G.CASE_INFO.CASE_INFO_ID}`,CASE_FIRST_FLOW_ACTION_NAME:`${G.DATA}.${G.CASE_INFO.ASSIGNMENTACTION_ID}`,CASE_FIRST_ASSIGNMENT_ID:`${G.DATA}.${G.CASE_INFO.ASSIGNMENT_ID}`},Ac=(e,t)=>{const{vcName:n,containerName:r}=t;return r||n||yc.getTargetViewContainerName(e)},_c=e=>{const t=e.lastIndexOf(G.FORWARD_SLASH_STRING)+1,n=e.lastIndexOf(G.UNDERSCORE_STRING);return e.substring(t,n)},Cc=e=>e===Ed.WORKAREA,Sc=e=>e===Ed.MODAL,Tc=e=>e===Te,Nc=e=>e&&e.find((e=>e.type===Te)),Pc=e=>kh.getIn(e,Ic.CASE_INFO,{}),Rc=e=>e?e.split(" ").pop():void 0,Dc=e=>kh.getIn(e,Ic.CASE_CLASS_NAME,G.EMPTY_STRING),bc=e=>{const t=Pc(e);return ln(t)&&un(Dp.getOperatorIdentifier(),t)},Oc=e=>kh.getIn(e,Ic.CASE_INFO_ID,G.EMPTY_STRING),vc=e=>kh.getIn(e,Ic.CASE_FIRST_ASSIGNMENT_ID,G.EMPTY_STRING),xc=(e,t)=>{const{removeActionPayload:n,target:r}=t;if(n&&n.containerItemID){const{containerItemID:t,context:s}=n;e.push(Sg(mg,{containerItemID:t,context:s||Md(t),target:r}))}},wc=e=>{const t=Ch();if(!e)return!1;const n=K(e),r=Kd(n),s=Kd(e);if(!r||!s)return!1;const a=_d(r,n),o=_d(s,e);if(!a||!o)return!1;const{key:i}=a||{};let{key:c}=o||{};return c||(c=t?.getState().data?.[e]?.caseInfo?.ID),i&&c&&i===c},Mc=(e,t,n={})=>{const{skipFlowNameUpdate:r}=n,s=Oc(t);kh.setIn(e,"key",s);const a=ln(Pc(t));if(!r&&(e=>{const t=kh.getIn(e,Ic.ASSIGNMENTS,[]);return t&&t.length>0})(t)){const n=vc(t),[,r]=n.split("!");(e=>{Ci.publish(G.PUB_SUB_EVENTS.CASE_EVENTS.CURRENT_ASSIGNMENT_UPDATED,e)})({assignmentID:n,isInCreateStage:a}),kh.setIn(e,"flowName",r)}},Lc=(e,t)=>{const{attachmentsExist:n}=t;n&&kh.setIn(e,B.SUMMARY_OF_ATTACHMENTS_LAST_REFRESH_TIME,(new Date).toLocaleString()),kh.setIn(e,B.SUMMARY_OF_ASSIGNMENT_LAST_SUBMIT_TIME,(new Date).toLocaleString())},Uc=(e,t,n)=>{let r=G.PROMISE_VALUE.RESOLVE;return Nc(e)?(r=G.PROMISE_VALUE.REJECT,n?yn.rejectActionByID(t,!0,n):yn.rejectActionByID(t)):yn.resolveActionByID(t),r},Fc=e=>{const t=Dp.getCaseTypeList();return"true"===t.filter((t=>t.pyWorkTypeImplementationClassName===e))?.[0]?.pyIsTraditionalUICase},jc=()=>"true"===Dp?.environmentInfoObject?.pxMashupDetails?.pyLaunchCaseInModal,Vc=(e,t)=>{const n=Dc(e?.response),r=Pc(e?.response),{caseTypeID:s}=r,a=Dp.getFeatureMap();(a?.deferUpdateCaseSummaryView??!Object.hasOwn(a,G.DEFER_UPDATE_CASESUMMARY_VIEW))&&s&&((e,t,n,r)=>{const{containerItemID:s}=t;if(s){const{caseClassName:a,skipAssignmentsUpdate:o}=r,i=K(s),c=Kd(i),l=c&&Ad(c),u=c&&vd(c),d=Z(i),p=n?.data?.caseInfo?.ID;u&&l?.items?.[u]?.key===t?.caseID&&e.push(Sg(Qh,{containerItemID:i,context:i,container:d,containerName:d,caseId:p,viewName:B.CASESUMMARY_VIEW_NAME,updateData:!0,viewLoadingContainer:{context:i},caseClassName:a,...void 0!==o&&{skipAssignmentsUpdate:o}}))}})(t,e?.actionInPayload,e?.response,{caseClassName:n,skipAssignmentsUpdate:!0})},kc=e=>Th(e)?.context_data?.caseViewMode;const $c=class{static isCaseActive(e,t){if(!e||!t)return!1;const n=Ad(t);if(n){const r=vd(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}=Wg("loadView",n);return zi(r,{method:s},t)};static getCaseEditLock=(e,t)=>{const n={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:r,reqType:s}=Wg(Ze,n);return zi(`${r}?viewType=page`,{method:s},t)};static updateCaseEditFieldsData=(e,t,n,r)=>{const s={caseID:e,actionID:"pyUpdateCaseDetails"},{restApi:a}=Wg(Ze,s),o=t[e];return zi(`${a}?viewType=form`,{method:"PATCH",body:{content:{...o}},headers:{"if-match":n}},r)};static getCaseMessages=e=>Th(e)?.caseMessages;static getPropertiesToReplace=e=>(Tl(e)||[]).map((e=>({path:e.fullPath,allowMultiple:e.allowMultiple})));static getUniqueGadgetId=()=>kh.generateUniqueID().substring(0,5);static getRemoteCaseMapping=()=>q.getRemoteCaseMapping();static isTraditionalRemoteCase=e=>q.isTraditionalRemoteCase(e);static getRemoteCaseKey=(e,t)=>{let n=t;try{e&&(n=e.slice(e.indexOf(" ")+1,e.indexOf("!")))}catch{}return n}},{RESOURCE_TYPES:Bc}=B,Gc={PAGE:"page",FORM:"form"},Wc={[Bc.CASE]:[Ke,ze,Ye],[Bc.PAGE]:[Ge,He],[Bc.DATA]:[We],ASSIGNMENT:[nt]},Hc=(e,t,n={})=>{if(!e)return{};const r={etag:e.etag},{RemoteSystemID:s}=n;return e[B.REMOTE_SYSTEM_ID]||e[B.REMOTE_SYSTEM_ID.toLowerCase()]||s?r.RemoteSystemID=e[B.REMOTE_SYSTEM_ID]||e[B.REMOTE_SYSTEM_ID.toLowerCase()]||s:t&&q.isRemoteCase(t)&&(r.RemoteSystemID=q.getRemoteHeader(t)),r},qc=(e,t={})=>{const{onlyChangedData:n=!1,nonEmptyAndChangedData:r=!1,skipUUID:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1}=t;let i={};i=Nl(e,{isTransientContext:a,includeDisabledFields:o}),n&&(delete i?.caseInfo?.content,a&&(i={}));const c=Vl(e,!1);!a&&r&&((e,t)=>{Object.entries(e?.caseInfo?.content).forEach((([n,r])=>{const s=Th(t),a=M()(s,B.CASE_INFO.CASE_INFO_CLASSID),o=Xp(n,a);("True-False"===o?.type&&!r||""===r)&&delete e.caseInfo.content[n]}))})(i,e);const l=j()(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=[...Tr(e)];s&&p.forEach((e=>{delete e.content?.EmbedListUUID__})),u.pageInstructions=p;return(Er[e]||[]).forEach((e=>{if(u?.content){const t=e?.replace(G.CASE_INFO.CASE_INFO_CONTENT,"");kh.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}},zc=(e,t)=>{let n,r,s={};const a=kh.getIn(e,G.UI_RESOURCES),o=kh.getIn(e,"confirmationNote");a?(n=kh.getIn(e,G.UI_RESOURCES_CONTEXT_DATA),r=kh.getIn(e,G.ROOT),s=kh.getIn(e,G.ACTION_BUTTONS)):o&&(r={});const{data:i={},Errors:c,semanticURL:l,key:u,flowName:d}=e,p=kh.getIn(e,"nextAssignmentInfo",null),h=kh.getIn(e,"nextAssignmentInfo.context",""),g=kh.getIn(e,"confirmationLinks",null),{isInCreateStage:f,openCaseViewAfterCreate:m,debugInfo:y}=t;return{data:{...i,key:u,flowName:d,coreHeaders:y&&{debugInfo:{[G.COREHEADER_APP_DEBUG_ID]:y.debugId}},caseInfo:{...i.caseInfo,actionButtons:s,headers:t.headers},[G.CONTEXT_DATA]:f?{...i[G.CONTEXT_DATA],...n,openCaseViewAfterCreate:m,errors:c}:{...i[G.CONTEXT_DATA],...n,errors:c}},semanticURL:l,nextAssignmentInfo:p,assignmentContext:h,confirmationLinks:g,key:u,root:r,...t}},Yc=async(e,t,n,r=!1,s=!1)=>{const a=kh.getIn(e,G.LOCALE_REFERENCES);await vp.loadLocaleResources(a);const o=kh.getIn(e,G.COMPONENTS);if(o)try{await qr(o)}catch(e){console.error(e)}const i={actionConfig:t,...n};r?Jg({...e,options:i,directUrlUpdation:!0}):$r(e,i,s)},Kc=(e="")=>{const t=e.indexOf(" "),n=e.indexOf("!");return e.substring(t+1,n)},Xc=e=>{if(e){const[,t]=e.split("!");return{key:Kc(e),flowName:t}}return{}},Jc=(e,t)=>{const n=[],r=[];return e.forEach((e=>{((e,t,n,r)=>{switch(!0){case Boolean(e[G.ERROR_IN_PAGE_IDENTIFIER]&&e[G.ERROR_FIELD_IN_PAGE]):{const s=`${e[G.ERROR_FIELD_IN_PAGE]}`.replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`)),a=`${s}${e[G.ERROR_IN_PAGE_IDENTIFIER]}`,o=kh.deepClone(e);o[G.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[G.ERROR_IN_PAGE_IDENTIFIER]&&!e[G.ERROR_FIELD_IN_PAGE]):{const s=e[G.ERROR_IN_PAGE_IDENTIFIER].slice(1);t.includes(s)?r.push(e):n.push(e);break}default:n.push(e)}})(e,t,n,r)})),{fieldErrors:r,pageErrors:n}},Qc=e=>{const{payload:t}=e,{err:n,context:r,actionMgrID:s}=t,a=n&&n.response?n.response.data:"",o=Rl(r);return s&&yn.rejectActionByID(s,!0,n),Sg(Tg,"Error action triggered",a,r,o)},Zc=(e,t)=>kd(e)&&Bd(e)?Sg(Ig,t):Sg(sg,t),el=(e,t,n=G.APP.APP,r={})=>{let s=null;const{buildNew:a=!0}=r;return kd(e)?s=Bd(e)?vd(e):X(t,n):$d(e)&&(Bd(e)&&!a?s=Ld(e):Bd(e)&&!a||(s=X(t,n))),s},tl=e=>e&&e.type===Re,nl=e=>{let t=!1;const n=jd(e);for(let e=0;e<n.length;e+=1){const r=n[e];if(r&&Wl(r)){t=!0;break}}return t},rl=(e,t={})=>{let n=!1,r=!1,s={},a=!0,o=!1,i=!1;const{showConfirmDialogForMaxDocumentLimitReached:c=!1,dirtyMessage:l,skipChildDirtyState:u=!1}=t;if(kd(e)){const t=vd(e);if(!t)return{continueExecution:a,removeActionPayload:s};const r=Md(t);Wl(r)&&(n=!0),u||n||(n=nl(t))}else if($d(e)&&Hd(e)){let t=Yd(e);t||(t=vd(e),r=!0),s.containerItemID=t,s.context=Md(t)}if(n){const e=l||Fl;o=window.confirm(vp.getLocaleValue(e,"Messages"))}if(!o&&n&&(s={},a=!1),r){const e=vp.getLocaleValue(jl,"Messages");c?i=window.confirm(e):(window.alert(e),a=!1)}return!i&&r&&(s={},a=!1),{continueExecution:a,removeActionPayload:s}},sl=(e,t)=>{let n=!1;const r=Dp.isCoexistenceAppOfType(G.APP_TYPE.UIKIT),{insKey:s,isParallelCall:a,skipFlowNameCheck:o}=t;if(!s)return{};const[,i]=s.split("!")||"",c=o?s:Kc(s),l=Pd(e,c);let u={},d=!1;if(l&&!r&&((e,t)=>{const n=_d(e,t);return n?.resourceType})(e,l)===t?.type&&(n=!0,u=_d(e,l),!o)){let e=u?.flowName;const t=_c(l),r=Ud(l);if(r.length){const n=Ct(t,r[0]);e=_d(n,r[0])?.flowName}else n=e===i;(e!==i||a)&&(d=!0)}return{activate:n,activateContainerActionPayload:{target:e,isParallelAssignment:d,containerItemID:l,semanticURL:u.semanticURL,insKey:s}}},al=(e,t,n)=>e===Bc.PAGE?((e,t={})=>{let n=!1;const{semanticURL:r}=t,s=Pd(e,r);return s&&(n=!0),{activate:n,activateContainerActionPayload:{target:e,containerItemID:s,semanticURL:r}}})(t,n):e===Bc.ASSIGNMENT?sl(t,{...n,type:e}):e===Bc.CASE?sl(t,{...n,skipFlowNameCheck:!0,type:e}):{},ol=(e=[])=>{Bd(`${G.APP.APP}/${G.PREVIEW}`)&&e.push(Sg(rg,qd({context:B.APP.APP,name:G.PREVIEW})))},il=e=>{let t;for(const n of Object.keys(Wc))if(Wc[n].includes(e)){t=n;break}return t},cl=(e,t)=>{const{data:n={},context:r,caseViewMode:s}=e,a={data:{...n},caseViewMode:s,context:K(r)};kh.deleteIn(a.data,"shared"),kh.setIn(a.data,["context_data","caseViewMode"],s),t.push({type:ut,payload:{context:a.context}}),t.push(Sg(Xh,a))},ll=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=kh.getIn(t,["payload","assignmentContext"]);if("other"===n||"remote"===n){const r=kh.getIn(t,["payload","nextAssignmentInfo","ID"]);if(t?.payload?.isProcessAction){const n={acName:kh.getIn(t,["payload","target"]),caseID:t.payload.data.caseInfo.ID,containerItemID:kh.getIn(t,["payload","context"]),context:kh.getIn(t,["payload","context"])},r={type:Ee,payload:{...n}};e.push(r),e=e.filter((e=>delete e?.payload?.data?.caseMessages)),Sh(e),e=e.filter((e=>e.type!==Ee))}const s=((e,t,n)=>({assignmentID:e,vcName:G.PRIMARY,targetContainerName:kh.getIn(t,["payload","target"]),context:kh.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);kd(s.targetContainerName)||t?.payload?.containerName!==G.WORKAREA||(s.isMultiDoc=!0,e=[]);const a={type:Ie,payload:{...s}};e.push(a),Sh(e)}else Sh(e)}},ul=(e,t)=>j()(e,t,(function(e,t){if(Array.isArray(e))return e.concat(t)})),dl=e=>{let t={},n=gp(e);for(;n;){const e=qc(n);t=ul(e.content,t),n=gp(n)}return t};class pl{static getChanges(e){return{...Vl(e)}}static getSubmitData(e,t){const{isTransientContext:n=!1,includeDisabledFields:r=!1}=t||{},{content:s}=qc(e,{isTransientContext:n,includeDisabledFields:r});return s}static isStateModified(e){return Wl(e)||Mr(e)||!(!e||!$l(e))}static isFormValid(e,t){return Pl(e,t)}static clearChangedProperties(e){return Pr(e),Sr(e),ql(e)}static getEditableFields(e){return Dl(e)}static setCustomValidator(e,t){Vr.register(e,t)}static isPropertyEditable(e,t){return pl.getEditableFields(e).some((e=>e.name===t))}}const hl=pl;const gl=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=Mn.getContextReferences(e)?.get(s),o=a&&Wh.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}})),kh.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=Mn.getFieldReferenceForProperty(e,t);if("Multiselect"===r?.props?.componentName&&n?.current?.instruction?.instruction===G.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&&Ar(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={[ml(i)]:n},l=this.getStateMachine(e,"",a);return null!==o?l?.update(c,Number(o)+1,s.skipStateUpdate??!0,s):l?.updatePage(kh.unflatten(c)),!0}registerForServerChanges(){Eh.registerForListChanges(((e,t,n)=>{setTimeout((()=>{const r="].";if(!t.includes(".classID")&&hl.isPropertyEditable(e,t)&&this.executeStateMachine(e,t,n),!t.includes(".classID")&&t.includes(r)){const s=t.substring(0,t.lastIndexOf("[")),a=hl.getEditableFields(e);if(["multiselect","checkbox"].includes(a.find((e=>e.name===s))?.type)){const a=Mn.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(){Eh.unRegisterForListChanges()}},fl={},ml=e=>e.startsWith(".")?e.substring(1):e,yl=e=>{delete fl[e]},El=(e,t={})=>{const{includeDisabledFields:n=!1}=t,r=Wh.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},Il=(e,t,n,r,s)=>{let a=(Rh(`.attachmentsList.${t?.replace(".","")}`,"context_data",n)||[]).filter((e=>`${r.pageReference}.${e.label}`===s));return a=kh.buildAttachmentsFormData(a),a.length>0&&(e=[...e,...a]),e},Al=(e,t,n,r,s)=>(gl.executeStateMachine(e,r,Wh.getLitePropertyValue(n,t))||s.push(r),s),_l=e=>{const t=e.pageReference?.replace(B.CASE_INFO.CASE_INFO_CONTENT,"")?.replace(B.DATA_INFO.DATA_INFO_CONTENT,"");return"Attachment"===e.componentName&&""!==t},Cl=(e,t,n)=>{const r=t.isInsideList,{ignoreFieldsInsideList:s=!0}=n;return(!r||r&&!s)&&!Array.isArray(Wh.getLitePropertyValue(t,e))&&"Address"!==t.componentName},Sl=(e,t={})=>{let n=[],r=[];const s=[],a=Mn.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=Wh.resolveContextTreeNodeProps(i.props),c=e.propertyName;if(El(i.props,{includeDisabledFields:r})){const r=_l(e);"Attachment"!==e.componentName||r?!r&&Cl(o,e,n)&&(s=Al(t,c,e,o,s)):a=Il(a,c,t,e,o)}}return{attachmentList:a,editableFormFieldsReferenceList:s}})(a,e,t)),fl[e])for(const t in fl[e].fieldOrder)Object.hasOwn(fl[e].fieldOrder,t)&&s.push(t);return{formInputs:n,attachments:r,formPageFields:s}},Tl=e=>{let t=[];const n=Mn.getContextReferences(e);if(n)for(const[e,r]of n){const n=r?.props;if(El(n)&&"Attachment"===n?.componentName){const r="true"===n?.allowMultiple;t=[...t,{type:"File",allowMultiple:r,fullPath:e}]}}return t},Nl=(e,t={})=>{const n={},r=Th(e),{ignoreFieldsInsideList:s=!0,isTransientContext:a=!1,includeDisabledFields:o=!1}=t;if(a||r?.caseInfo?.content){const{formInputs:t,attachments:i,formPageFields:c}=Sl(e,{ignoreFieldsInsideList:s,includeDisabledFields:o});i&&i.length>0&&kh.buildObject("caseInfo.attachments",n,i),((e,t,n)=>{e.forEach((e=>{let r=kh.getIn(t,e);"object"==typeof r&&(r=kh.deepClone(r),delete r?.classID),kh.buildObject(e,n,r)}))})(c,r,n),t&&t.length>0?t.forEach((e=>{kh.buildObject(e,n,kh.getIn(r,e))})):a||kh.buildObject(B.CASE_INFO.CASE_INFO_CONTENT,n,{})}if(!a&&r?.dataInfo?.content){const{formInputs:t}=Sl(e,{ignoreFieldsInsideList:s});t.forEach((e=>{kh.buildObject(e,n,kh.getIn(r,e))}))}return n},Pl=(e,t)=>{const n=Mn.getContextReferences(e);let r=!0;if(!n)return r;for(const[e,s]of n){const n=Wh.resolveContextTreeNodeProps(s.props);if(El(s.props)&&(!t||e.includes(t))){const e=Vr.validate(n.componentName?.toLowerCase(),n.propertyName,Wh.getLitePropertyValue(n,n.propertyName),n);r&&(r=!e.message)}}return r},Rl=(e,t=!1)=>{const n=Mn.getContextReferences(e),r=[];if(n)for(const[e,s]of n){if(!1!==Wh.resolveContextTreeNodeProps(s.props).visibility){const n=8,s=t?e:e.substring(e.indexOf("content")+n);r.push(s)}}return r},Dl=e=>{const t=[],n=Mn.getContextReferences(e);if(n)for(const[e,r]of n){const n=Wh.resolveContextTreeNodeProps(r.props);El(r.props)&&"Attachment"!==n.componentName&&"multirecordlist"!==n.type&&t.push({name:e,label:n.label,type:n.componentName?.toLowerCase()})}return t};const bl=class{static getPropertyName(e){return cn.getPropertyName(e)}static isProperty(e){return cn.isProperty(e)}static getLeafPropertyName(e){return cn.getLeafPropertyName(e)}static isPropertyInternal(e){return e.startsWith("px")||e.startsWith("pz")}};const Ol=class{static isPageInstruction(e){return e&&e.includes("[")&&e.includes("]")}};class vl{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(G.HASH_DELIMITER),o=kh.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 vl.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 vl.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 xl=new vl,{APP:wl}=G;let Ml={},Ll={},Ul={};const Fl="You will lose unsaved changes. Do you want to continue?",jl="You have reached maximum limit of pending changes. Please commit/cancel one or more changes to continue.",Vl=(e=wl.APP,t,n)=>{let r=[],s=[];t||(r=Rl(e,!0)),n||(s=(e=>{const t=Mn.getContextReferences(e),n=[];if(t)for(const[e,r]of t)!0===Wh.resolveContextTreeNodeProps(r.props).readOnly&&n.push(e);return n})(e));const a={};((e,t)=>{const n=Ll[t]||{};Object.keys(n).forEach((t=>{Object.hasOwn(n,t)&&kh.buildObject(t,e,n[t].value)}))})(a,e);const o=Ml[e]||{};return Object.keys(o).forEach((e=>{const n=!t&&r.includes(e)||t;Object.prototype.hasOwnProperty.call(o,e)&&n&&!s.includes(e)&&kh.buildObject(e,a,o[e].value)})),a},kl=e=>{const{context:t}=e,n=e.reference.startsWith(".")?e.reference.substr(1):e.reference;delete Ml[t]?.[n],delete Ll[t]?.[n]},$l=e=>Ul[e],Bl=(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=Rh(t.reference,null,n):(e[a]={initialValue:r||Rh(t.reference,null,n)},e[a].previousValue=e[a].initialValue),e[a].value=t.value,s&&e[a].value===e[a].initialValue&&kl(t)},Gl=e=>{const{payload:t}=e,{context:n}=t,r=t.reference.startsWith(".")?t.reference.substr(1):t.reference;Mn.isFieldExists(n,r)||(Ll[n]=Ll[n]||{},Bl(Ll[n],t)),Ml[n]=Ml[n]||{},Bl(Ml[n],t)},Wl=e=>{const t=Nr(e)||{};return e&&Ml[e]&&Object.keys(Ml[e]).some((t=>Ml[e][t].initialValue!==Ml[e][t].value))||Object.keys(t).length>0},Hl=(e,t)=>{if(!e||!t)return!1;const n=Ml[e]&&Ml[e][t];return!!n&&n.previousValue!==n.value},ql=e=>{e&&Ml[e]?(Ml[e]={},Ll[e]={}):"all"===e&&(Ml={},Ll={},Ul={}),Ul[e]&&(Ul[e]=!1)},zl=(e,t,n=new Set)=>{if(n.has(t))return;n.add(t);[...sn.getDependencies(e,t),...Eh.getResetDependencies(e,t)].forEach((t=>{const r=kh.getPropertyNameFromDependency(t);if("object"==typeof t&&"multiRecord"===t.mode){const t=r.split("."),n=`.${t.pop()}`,s=t.join(".");if(gl.isStateMachineExist(e,s,n)){gl.getStateMachine(e,s,n).deleteAll()}}else Ol.isPageInstruction(r)&&gl.executeStateMachine(e,r,""),Sh({type:re,payload:{reference:r,value:"",context:e,isArrayDeepMerge:!0,isImplicit:!0}});zl(e,r,n)}))},Yl=()=>e=>t=>{const{type:n,payload:r={}}=t||{};if(n===ae&&(Zt(r),(e=>{const{context:t,pageReference:n,value:r,reference:s}=e;Eh.triggerCascade(t,s,r);const a=sn.getDependencies(t,s),o={context:t,datapages:{}};zl(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=Rh(`.${i}`,s,t)?.classID||e.classID,l=Xp(r.split(".").pop(),c),{datasource:u}=l,d={};let p=[];u.parameters.forEach((e=>{e?.value?(d[e.name]=bl.isProperty(e.value)?Rh(`.${kh.getFullPropertyReference([i,kh.getPropertyName(e.value)])}`,s,t):e.value,void 0===d[e.name]||null===d[e.name]||""===d[e.name]?(d[e.name]="",p.push(G.NULL_STRING)):p.push(d[e.name])):(d[e.name]="",p.push(G.NULL_STRING))})),p=u.name.concat(G.UNDERSCORE_STRING,kh.getHashedString(p.join(G.HASH_DELIMITER)));const{name:h}=u,g=sh(h);o.datapages[p]={mode:u.mode,propertyName:r,name:u.name,dataViewParameters:d,refreshStrategy:g?.refreshStrategy}})),a.length&&Sh({type:ot,payload:o})})(r),rn.registerBlockingAction(r.context).catch((()=>{})),setTimeout((()=>{(Hl(r.context,r.reference)||Mr(r.context))&&Wn(r),xl.triggerRefreshForType("PROP_CHANGE",r.reference,r.context),rn.deRegisterBlockingAction(r.context).catch((()=>{}))}),0)),n===lt&&!r?.isDefault){const{context:e,referenceList:t}=r;Wn({context:e,pageReference:t})}if(n===re||n===se){const{reference:e,isImplicit:n,context:s,skipDirtyValidation:a=!1}=r;Mn.updateFieldNodeValue(s,e,r.value),Ol.isPageInstruction(e)||a?a||(Ul[`${s}`]=!0):Gl(t),(r.removePropertyFromChangedList||n)&&kl(r)}if(n===we||n===Me){const{transientItemID:e,data:t}=r;kh.iterateLeafNodes(t,(t=>{kl({context:e,value:"",reference:t.join(".")})}))}if(n&&[Fe,De,Ve,xe].includes(n)){ql(r.context),Eh.purgeResetDependencies(r.context),(e=>{e&&Fn[e]&&delete Fn[e]})(r.context);(r.childContainersContexts||[]).forEach((e=>{ql(e)}));(r.transientItems||[]).forEach((e=>{ql(e)}))}e(t)};const Kl=new class{getCoreheaders(e){const t=`${B.APP.APP}${G.FORWARD_SLASH_STRING}${G.PRIMARY}`,n=vd(t),r=Md(n),s=Wh.getProperty(G.COREHEADERS,"",r);if(s&&e in s)return s[e]}};const Xl=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=Mn.getContextReferences(e)?.get(`${t}${r}`)?.props;return s?Wh.resolveContextTreeNodeProps(s):s})(this.c11nEnv.getContextName(),this.c11nEnv.getPageReference(),t),{message:s}=Vr.validate(this.c11nEnv.getComponentName()?.toLowerCase(),t,e,r);return s?{status:!1,message:s}:{status:!0}}},Jl="OPEN_PROCESS_ACTION",Ql="OPEN_ASSIGNMENT",Zl="DELETE_CASE_IN_CREATE_STAGE",eu="SAVE_AND_CLOSE",tu=e=>({type:eu,payload:e});const nu=class{static getSavableDataPage(e){return dh(e)}static getLookUpDataPage(e){return hh(e)}static getLookUpDataPageInfo(e){return gh(e)}static getDataPageKeys(e){return ph(e)}};const ru=class{constructor(e){this.c11nEnv=e}containerManagerPromise=e=>{const t=yn.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 yn.register(t,s,n,r,e),{actionMgrID:t,promise:s}};initializeContainers(e){const t=Ne,n=this.c11nEnv,r={context:n.getContextName(),name:n.getContainerName(),type:G.CONTAINER_TYPE.SINGLE},{actionMgrID:s,promise:a}=this.containerManagerPromise(t),o={...r,...e,actionMgrID:s};return Sh(ng(o)),a}addContainerItem(e){const t=Re,n=this.c11nEnv,r=n.getMetadata(),{children:s}=r||{};let a;s&&([a]=s);const o=n.getContextName(),i=n.getContainerName(),c=X(i,o,e?.containerType===G.CONTAINER_TYPE.SINGLE),l=Ct(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)),[G.WORKAREA].includes(i)&&delete e.data?.coreHeaders;const{actionMgrID:d,promise:p}=this.containerManagerPromise(t),h={...u,...e,actionMgrID:d};return Sh(sg(h)),p}updateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("updateContainerItem : containerItemID is required in containerInfo object"));const t=Fe,n={context:Md(e.containerItemID),target:Kd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return Sh(ug(a)),s}activateContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("activateContainerItem : containerItemID is required in containerInfo object"));const t=Ue,n={target:Kd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return Sh(gg(a)),s}removeContainerItem(e){if(!e?.containerItemID)return Promise.reject(new Error("removeContainerItem : containerItemID is required in containerInfo object"));const t=De,n={context:Md(e.containerItemID),target:Kd(e.containerItemID)},{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return Sh(mg(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=Pe,n=qd(e),{actionMgrID:r,promise:s}=this.containerManagerPromise(t),a={...n,...e,actionMgrID:r};return Sh(rg(a)),s}addTransientItem(e){const{id:t,data:n}=e,r=this.c11nEnv.getContextName(),s=Q(t,r),a=ep(r);return s&&a.includes(s)||Sh(ag({transientItemID:s,contextName:r,target:Kd(r),data:n})),s}updateTransientData(e){const{transientItemID:t,data:n}=e,r=this.c11nEnv.getContextName();if(t){if(!ep(r).includes(t))return;Sh(og({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(!ep(t).includes(s))return;Sh(Eg({target:n,containerItemID:r,transientItemID:s}))}}createContainerPConnect(e,t,n,r=!1){fd.createContainerPConnect(e,t,n,r)}hasContainerItems(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return Bd(`${e}/${t}`)}isContainerInitialized(){const e=this.c11nEnv.getContextName(),t=this.c11nEnv.getContainerName();return bd(e,t)}};var su=function(e,t){return e===t||"function"==typeof t&&e===t.toString()};function au(){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 su(t.type,e[0])}:function(t){for(var n=0;n<s;n++)if(su(t.type,e[n]))return!0;return!1},di((function(e,t){var s=0;e.subscribe(pi(t,(function(e){return n.call(r,e,s++)&&t.next(e)})))}))}function ou(e,t){return di((function(n,r){var s=null,a=0,o=!1,i=function(){return o&&!s&&r.complete()};n.subscribe(pi(r,(function(n){null==s||s.unsubscribe();var o=0,c=a++;ci(e(n,c)).subscribe(s=pi(r,(function(e){return r.next(t?t(n,e,c,o++):e)}),(function(){s=null,i()})))}),(function(){o=!0,i()})))}))}function iu(e,t){return di((function(n,r){var s=0;n.subscribe(pi(r,(function(n){r.next(e.call(t,n,s++))})))}))}function cu(e,t,n){return void 0===n&&(n=1/0),Po(t)?cu((function(n,r){return iu((function(e,s){return t(n,e,r,s)}))(ci(e(n,r)))}),n):("number"==typeof t&&(n=t),di((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;ci(n(e,u++)).subscribe(pi(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?ui(t,o,(function(){return g(e)})):g(e)};c.length&&l<r;)e();p()}catch(e){t.error(e)}})))};return e.subscribe(pi(t,h,(function(){d=!0,p()}))),function(){null==i||i()}}(t,r,e,n)})))}function lu(e){return e&&Po(e.schedule)}function uu(e){return e[e.length-1]}function du(e){return lu(uu(e))?e.pop():void 0}function pu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ei(e,du(e))}function hu(e){return di((function(t,n){var r,s=null,a=!1;s=t.subscribe(pi(n,void 0,void 0,(function(o){r=ci(e(o,hu(e)(t))),s?(s.unsubscribe(),s=null,r.subscribe(n)):a=!0}))),a&&(s.unsubscribe(),s=null,r.subscribe(n))}))}var gu=new Zo((function(e){return e.complete()}));function fu(e){return e?function(e){return new Zo((function(t){return e.schedule((function(){return t.complete()}))}))}(e):gu}const mu=(e,t,n)=>hu((r=>("ERR_CANCELED"!==r?.code&&console.error(e,r),pu(Tg(e,r,t,null,n))))),yu=(e,t)=>n=>new Zo((r=>{let s={},a=0;return n.pipe(cu((n=>{const r=Date.now();let o;return o=t||E(),o&&o(n,s)&&r-a<e?fu():(s=n,a=r,pu(n))}))).subscribe(r)})),Eu=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:s}=e,a={data_view_ID:t},{restApi:o,reqType:i}=Wg("createDataObject",a),{content:c}=qc(s);return Ei(zi(o,{method:i,headers:r,body:{data:c.content}},s)).pipe(iu((t=>({response:t.data,actionInPayload:e}))),mu("Error occurred during ajax call at createDataObject Epic",n))},Iu=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}=Wg("readDataObject",o);return Ei(zi(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe(iu((t=>({response:t.data,actionInPayload:e}))),mu("Error occurred during ajax call at getDataObjectView Epic",n))},Au=e=>{const{dataPageID:t,context:n,headers:r,containerItemID:s,key:a}=e,o={data_view_ID:t},{restApi:i,reqType:c}=Wg("updateDataObject",o),{content:l}=qc(s);return Ei(zi(i,{method:c,headers:r,body:{data:{...l.content,...a},pageInstructions:l.pageInstructions||[]}},s)).pipe(iu((t=>({response:t.data,actionInPayload:e}))),mu("Error occurred during ajax call at updateDataObject Epic",n))},_u=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}=Wg("openDataObjectAction",o);return Ei(zi(i,{method:c,headers:r,body:{dataViewParameters:a}},n)).pipe(iu((t=>({response:t.data,actionInPayload:e}))),mu("Error occurred during ajax call at getDataObjectView Epic",n))},Cu=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}=Wg("submitDataObjectAction",i),{content:u}=qc(o);return Ei(zi(c,{method:l,headers:r,body:{data:{...u?.content,...a},pageInstructions:u?.pageInstructions||[]}},n)).pipe(iu((t=>({response:t.data,actionInPayload:e}))),mu("Error occurred during ajax call at getDataObjectView Epic",n))};const Su=new class{constructor(){this.components={}}_checkComponent(e,t){return!!this.components[t]?.[e]}start(e,t,n,r,s){const a={viewName:e,pageReference:n,contextName:r,isInProgress:!0,active:!0,caseKey:t};this.components[r]=this.components[r]||{},this.components[r][s]=a}stop(e,t){this._checkComponent(e,t)&&(this.components[t][e].isInProgress=!1)}remove(e,t){this._checkComponent(e,t)&&delete this.components[t][e]}removeContext(e){delete this.components[e]}enableCascade(e){this.components[e]&&Object.values(this.components[e]).forEach((e=>{e.isInProgress&&(e.cascade=!0)}))}activate(e,t){this._checkComponent(e,t)&&(this.components[t][e].active=!0)}deactivate(e,t){this._checkComponent(e,t)&&(this.components[t][e].active=!1)}refreshActiveComponents(e){e&&this.components[e]&&Object.keys(this.components[e]).forEach((t=>{this.refreshComponent(t,e)}))}refreshComponent(e,t){if(!this._checkComponent(e,t))return;const n=this.components[t][e];if(n.active&&n.cascade){const{caseKey:e,viewName:r,pageReference:s}=n;Vn(e,r,t,s,{})}}},Tu="postDataViewMetadata",Nu={getData:(e,t,n,r)=>((e,t,n,r={})=>{const s={dataViewName:e},{skipClearErrorMessages:a,signal:o,doNotMergeMessagesForStatusCode:i}=r,{restApi:c,reqType:l}=Wg("getListData",s);return zi(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}=Wg("getListDataCount",r);return zi(s,{method:a,body:t},n)},getDataViewMetadata:(e,t,n,r)=>{const s=!!n,a=!!r,o=Rp.doesRestApiExist(Tu),i=(s||a)&&o?Tu:"getDataViewMetadata",c={dataViewName:e},{restApi:l,reqType:u}=Wg(i,c);if(o){if(s)return zi(l,{method:u,body:{associationFilter:n}},t);if(a)return zi(l,{method:u,body:{propertyFilter:r}},t)}return zi(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}=Wg("readDataObject",c);return zi(u,{method:d,body:l,...o&&{signal:o},...a&&{skipClearErrorMessages:a}},r,i)},getCaseEditMetadata:(e,t)=>$c.getCaseEditMetadata(e,t),getCaseEditLock:(e,t)=>$c.getCaseEditLock(e,t),updateCaseEditFieldsData:(e,t,n,r)=>$c.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}=Wg("moveListRecords",c);return zi(l,{method:u,body:{content:{sourceID:n,destinationID:r,context:s,listClass:a}}},t)},isTimeElapsed:(e,t,n="")=>{if(t){if(e&&n===G.RELOAD_IF_OLDER_THAN)return new Date(e).setSeconds(t)<Date.now();if(e&&n===G.RELOAD_ONCE_PER_INTERACTION)return!0}return!0},getAppCacheKey:e=>void 0!==Fd("root").find((e=>e.includes("authoring-preview")))?`${G.AUTHORING_PREVIEW_CONTAINER}-${e}`:`${Gr.getAppAlias()}-${e}`,isDistinctResultsOnly:e=>{const t=Dp.getKeyMapping("pyGUID");return!e.some((e=>e.field===t))}};const Pu=class{constructor(e,t,n){this.filter=e,this.messageHandler=t,this.contextName=n}};const Ru=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 wu.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],wu.publishMessage(n)))}getUserState(e){return this.users[e]&&this.users[e].state}clearContext(e){Object.keys(this.users).forEach((t=>{Object.keys(this.users[t].subscribers).forEach((n=>{this.users[t].subscribers[n].contextName===e&&this.unsubscribe(t,n)}))}))}};var Du=s(631),bu=s.n(Du);const Ou=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===bu()(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};wu.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 vu=new class{constructor(){this.subscriptions={}}getOrCreateSubscription(e){if(!this.subscriptions[e]){const t={caseId:e};this.subscriptions[e]=new Ou("CASE",t)}return this.subscriptions[e]}};class xu{static subscribers={};static connectionsCount=0;static webSocket=null;static connectionConfig=null;static inProgressSubscriptions=[];static inProgressMessages=[];static isServiceAlive=null;static serviceAliveHandler=null;static userPresence=new Ru;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=Gr.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=Gr.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&&kh.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 Pu(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=>vu.getOrCreateSubscription(e);static refreshB2STokenReInit=async()=>{const e={body:{B2SToken:Gr.b2sJWT}};PCore.getRestClient().invokeRestApi("refreshB2S",e).then((e=>{const{newB2SToken:t}=e.data;t&&t.length>30?(Gr.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 wu=xu;const Mu=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=Mh(this.records,e,{isArrayDeepMerge:!1})),this.setMaxRecordsCount(this.records.length)}setMaxRecordsCount(e){this.maxRecords=e}getMaxRecordsCount(){return this.maxRecords}};const Lu=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=sh(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??G.NULL_STRING)})),n&&i.push(JSON.stringify(n)),i.join(G.HASH_DELIMITER)&&(a=kh.getHashedString(i.join(G.HASH_DELIMITER)),o=e+G.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}=Wg(G.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 zi(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&&kh.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 Mu;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 Mu);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),Nu.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&&Eh.unRegisterFields(n,r,t,s)}subscribeToCascadeUpdates(e,t,n,r,s){t&&t.length>0&&Eh.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}};wu.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=sh(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 Uu=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 Fu=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 Uu(t,n,s,r,a,o)),this.bufferedDataQueues[e]}},ju=(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,Vu=e=>e.map((e=>e.field)),ku=(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;ju(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=Vu(e.query?.select);Vu(t.query?.select).forEach((t=>{o.includes(t)||(e.query?.select).push({field:t})}))},$u=(e,t)=>((e,t)=>Object.keys(e.filterConditions).length%Object.keys(t.filterConditions).length==0&&!Object.keys(t.filterConditions).some((n=>e.filterConditions[n].lhs.field!==t.filterConditions[n]?.lhs.field)))(e.query?.filter,t.query?.filter)&&(((e,t)=>e.dataViewParameters&&t.dataViewParameters&&Object.keys(t.dataViewParameters).length===Object.keys(e.dataViewParameters).length&&!Object.keys(e.dataViewParameters).some((n=>"string"==typeof t.dataViewParameters?.[n]?e.dataViewParameters?.[n]!==t.dataViewParameters?.[n]:!kh.isEqual(e.dataViewParameters?.[n],t.dataViewParameters?.[n]))))(e,t)||((e,t)=>!e.dataViewParameters&&!t.dataViewParameters)(e,t)),Bu=(e,t)=>{const{data:n}=t,{dataViewCallMap:r,filterDataOnClient:s}=e;Object.keys(r).forEach((e=>{r[e].resolve({data:s(e,n)})}))},Gu=e=>({combiner:ku,comparator:$u,separator:Bu,...e}),Wu=(e,t)=>{try{window.sessionStorage.setItem(e,t)}catch(e){}};class Hu{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(G.HASH_DELIMITER),a=kh.getHashedString(s),o=`${e.dataSource}_${a}`,i=Nu.getAppCacheKey(e.dataSource);if(window.sessionStorage.getItem(i)){const s=JSON.parse(window.sessionStorage.getItem(i));if(t&&Hu.searchResultsCache?.[t]?.[o])n(Hu.searchResultsCache[t][o]);else if("form"!==e.cacheLifeSpan&&Hu.searchResultsCache?.persisted?.[o])n(Hu.searchResultsCache.persisted[o]);else{const a=new Hu(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,Hu.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,Hu.initializeCache(t,e,o,a),n(a)})).catch((e=>{a.isInitialised=!1,r(e)})))}}else if(e.deferDatasource&&sh(e.dataSource)){const r=new Hu(e,t),s=sh(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,Hu.initializeCache(t,e,o,r),n(r)}else{const s=new Hu(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,Hu.initializeCache(t,e,o,s),n(s)})).catch((e=>{s.isInitialised=!1,r(e)}))}}))}static bufferedDataView=new Fu;registerForBufferedCall(e){return this.isQueryable&&(this.initializeBufferCallsForDataPage(Gu(e)),this.bufferInitialized=!0),this}static clearContextedCache(e){delete Hu.searchResultsCache[e]}static initializeCache(e,t,n,r){e&&"form"===t.cacheLifeSpan?.toLowerCase()?(void 0===Hu.searchResultsCache[e]&&(Hu.searchResultsCache[e]={}),Hu.searchResultsCache[e][n]=r):(void 0===Hu.searchResultsCache.persisted&&(Hu.searchResultsCache.persisted={}),Hu.searchResultsCache.persisted[n]=r)}fetchMetaData(e){return Nu.getDataViewMetadata(this.dataSource,e,this.associationFilter,this.propertyFilter)}initializeBufferCallsForDataPage(e){Hu.bufferedDataView.addBufferedDataQueueForDataPage(this.dataSource,(e=>Lu.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 Hu.bufferedDataView.getBufferedDataQueueForDataPage(this.dataSource).queueDataViewCall(t,e)}catch{const n=this.buildSchemaForQueryableDP(e,t);return Lu.getDataAsync(this.dataSource,this.context,n.dataViewParameters,n.paging,n.query)}const n=this.buildSchemaForQueryableDP(e,t);return Lu.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=Lu.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),...Nu.isDistinctResultsOnly(n)&&{distinctResultsOnly:"true"}}:{select:n,...Nu.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 qu=Hu;const zu=class{static cleanCaches(e){Eh.purgeCascadeFields(e),Su.removeContext(e),qu.clearContextedCache(e),Ci.cleanContextSubscribers(e),yl(e),Mn.removeContextTreeNode(e),wu.clearContext(e),xl.deRegisterForRefresh(e)}},Yu="GET_DESCENDANTS";const Ku=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]}},Xu=(e,t)=>{const n={},r=nu.getLookUpDataPage(e),s=nu.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}},Ju=(e,t)=>{const n=nu.getSavableDataPage(e),r=nu.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}},Qu=e=>{Ci.publish(B.PUB_SUB_EVENTS.EVENT_CANCEL,e)},Zu=(e,t,n)=>{const{callbacks:r}=n;return n.callbacks=null,e(t,n).then((e=>{"cancel"===e?r?.cancel?.():r?.submit?.()}))};const ed=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(G.MODAL),s=this.c11nEnv.getValue(B.CASE_INFO.CASE_INFO_ID),a=this.c11nEnv.getValue(B.CASE_INFO.ASSIGNMENT_ID),o=this.c11nEnv.getValue(B.CASE_INFO.ACTIVE_ACTION_ID)?this.c11nEnv.getValue(B.CASE_INFO.ACTIVE_ACTION_ID):this.c11nEnv.getValue(B.CASE_INFO.ASSIGNMENTACTION_ID),i=this.c11nEnv.getContainerName(),c=this.c11nEnv.getValue(B.CASE_INFO.CASE_TYPE_ID),l=t?void 0:Pl(this.c11nEnv.getContextName()),u=this.c11nEnv.getValue("isProcessAction","isProcessAction");return qh.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||"":yn.getNextActionMgrId();const o=new Promise(((e,t)=>{r=e,s=t}));if(!r||!s)throw new Error("resolveFn or rejectFn is not defined.");return yn.register(a,o,r,s,e,t,n),{actionMgrID:a,promise:o}};showDataObjectCreateView(e,t=B.VIEW_NAMES.DATA_OBJECT_CREATE_VIEW){const n=qh.buildActionObject({viewName:t,className:e},this.c11nEnv),r=ie,{promise:s}=this.actionsApiPromise(r,n);return Sh({type:r,payload:{...n,containerName:B.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(!Wl(t)){return new ru(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}const n=Xe,r=qh.buildActionObject({containerItemID:e,context:t},this.c11nEnv),s=t&&t.includes(G.MODAL);Sh({type:n,payload:{...r,isModalAction:s,isDataObject:!0,skipReleaseLockRequest:!0}});const{promise:a}=this.actionsApiPromise(n,r);return a.then((()=>{Qu({})}))}createDataObject(e){if(!e)return Promise.reject(new Error("containerItemID is required parameter"));const{data:t}=Ch()?.getState()||{},n=t[e]?.dataInfo?.content?.classID;if(!n)return Promise.reject(new Error(G.DATA_CLASS_NOT_FOUND));const r=nu.getSavableDataPage(n),s=pt,a=!!e&&e.includes(G.MODAL),o=qh.buildActionObject({containerItemID:e,dataPageID:r},this.c11nEnv),{promise:i}=this.actionsApiPromise(s,o);return Sh({type:"CREATE_DATA_OBJECT",payload:{...o,isModalAction:a,isFormValid:Pl(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=ht,r=nu.getSavableDataPage(e),s=nu.getDataPageKeys(r),a={};if(s)for(const e of s)a[e.keyName]=e.isAlternateKeyStorage?t[e.linkedField]:t[e.keyName];const o=qh.buildActionObject({dataViewName:r,dataViewParameters:a},this.c11nEnv),{promise:i}=this.actionsApiPromise(n,o);return Sh({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=gt,{dataPageID:s,dataViewParameters:a}=Xu(e,t),o=qh.buildActionObject({dataLookUp:s,keyProperties:t,requestPayload:a,viewName:n.viewName||B.VIEW_NAMES.DATA_OBJECT_EDIT_VIEW,containerName:G.MODAL},this.c11nEnv),{promise:i}=this.actionsApiPromise(r,o);return Sh({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}=Ch()?.getState()||{},r=n[e]?.dataInfo?.content?.classID;if(!r)return Promise.reject(new Error(G.DATA_CLASS_NOT_FOUND));const{dataPageID:s,keys:a}=Ju(r,t),o=ft,i=e&&e.includes(G.MODAL),c=qh.buildActionObject({containerItemID:e,dataPageID:s,key:a},this.c11nEnv),{promise:l}=this.actionsApiPromise(o,c);return Sh({type:"UPDATE_DATA_OBJECT",payload:{...c,isModalAction:i,isFormValid:Pl(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=mt,{dataViewParameters:a,dataPageID:o,dataPageKeys:i}=Xu(e,t),c=qh.buildActionObject({actionID:n,actionName:r,dataViewParameters:a,lookupDatapage:o,containerName:G.MODAL,dataViewPayload:i,context:this.c11nEnv.getContextName()},this.c11nEnv),{promise:l}=this.actionsApiPromise(s,c);return Sh({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}=Ch()?.getState()||{},s=r[e]?.dataInfo?.content?.classID;if(!s)return Promise.reject(new Error(G.DATA_CLASS_NOT_FOUND));const a=mp(e),o=Kd(a),i=_d(o,a)||{},{resourceType:c="",key:l=""}=i,u=yt,{dataPageID:d,keys:p}=Ju(s,t),h=qh.buildActionObject({containerItemID:e,actionID:n,resourceType:c,key:l,keys:p,savableDatapage:d,containerName:G.MODAL,context:e},this.c11nEnv);h.context=e;const{promise:g}=this.actionsApiPromise(u,h);return Sh({type:u,payload:{...h,isFormValid:Pl(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=ge;const s=qh.buildActionObject({class:e,flowType:"pyStartCase",containerName:G.PRIMARY,openCaseViewAfterCreate:!0,...t,modalOptions:{isDockable:n}},this.c11nEnv),{promise:a}=this.actionsApiPromise(r,s);if(t.channelName&&(s.headers=s.headers||{},s.headers[G.X_ORIGIN_CHANNEL]=t.channelName),q.isRemoteCase(e)){const{RemoteClassName:t,RemoteSystemID:n,name:a}=q.getRemoteCase(e);if(s.className=e,s.class=t,s.headers=s.headers||{},s.headers.RemoteSystemID=n,q.isTraditionalRemoteCase(e)){const n={className:e,name:a,action:"createWork",remoteClassName:t};r=this.setTraditionalRemoteCaseParams(s,n)}}return Li.getPreviewMode()&&(s.debugInfo={debugId:kh.generateUniqueID()}),Sh({type:r,payload:{...s}}),a}setTraditionalRemoteCaseParams(e,t){return e.className=t.className,e.isTraditionalRemoteCase=q.isTraditionalRemoteCase(t.className),e.remoteClassName=t.remoteClassName,e.action=t.action,e.viewName=W,e.gadgetId=t.gadgetId??$c.getUniqueGadgetId(),e.name=t.name,e.skipSemanticUrl=!0,ie}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=Ce,r=qh.buildActionObject({dataViewID:e,dataViewParameters:t},this.c11nEnv),{promise:s}=this.actionsApiPromise(n,r);return Sh({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=qh.buildActionObject({caseID:e,currentContext:n},this.c11nEnv),{promise:s}=this.actionsApiPromise("GET_DESCENDANTS",r),a=(o={...r,context:n},{type:Yu,payload:o});var o;return Sh(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||G.PRIMARY,containerName:n.targetContainer||G.PRIMARY};let s=fe;const a=qh.buildActionObject(r,this.c11nEnv),{promise:o}=this.actionsApiPromise(s,a);return n.channelName&&(a.headers=a.headers||{},a.headers[G.X_ORIGIN_CHANNEL]=n.channelName),a.className=t,q.isRemoteCase(t)&&(s=this.setRemoteCaseParamsForOpenCase(a,t,n.remoteCaseMeta)??s),Li.getPreviewMode()&&![G.WORKAREA].includes(n.targetContainer)&&(a.debugInfo={debugId:kh.generateUniqueID()}),Sh({type:s,payload:{...n,...a}}),o}setRemoteCaseParamsForOpenCase(e,t,n={}){const{RemoteSystemID:r,RemoteClassName:s,name:a}=q.getRemoteCase(t);if(e.headers=e.headers||{},e.headers.RemoteSystemID=r,e.isRemoteCase=!0,e.remoteCaseClass=t,q.isTraditionalRemoteCase(t)){e.remoteCaseMeta=n;const r={className:t,name:a,action:_t,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=G.PRIMARY,r.isChild=n.isChild);let s=Ql;const a=qh.buildActionObject(r,this.c11nEnv),{promise:o}=this.actionsApiPromise(s,a);if(n.channelName&&(a.headers=a.headers||{},a.headers[G.X_ORIGIN_CHANNEL]=n.channelName),q.isRemoteCase(t)){const{RemoteClassName:e,RemoteSystemID:r,name:o}=q.getRemoteCase(t);if(a.headers=a.headers||{},a.headers.RemoteSystemID=r,q.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"),Li.getPreviewMode()&&![G.WORKAREA].includes(n.containerName)&&(a.debugInfo={debugId:kh.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 Sh({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=Md(e);let r=n;if(n?.includes("/workarea")&&(r=n.substring(0,r?.lastIndexOf("/workarea"))),(e=>{const t=Mn.getContextReferences(e);if(t)for(const[,e]of t)if(Wh.resolveContextTreeNodeProps(e.props).hasSuggestions)return!0;return!1})(n)){const e=[{type:"error",message:vp.getLocaleValue(this.MSG_ACTIVE_SUGGESTION_UNATTENDED,"Messages")}];return nr({messages:e,context:r,category:B.PAGE}),Promise.reject({type:B.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR})}const s=ye,a=t?.isTriggeredFromDifferentContext,{caseID:o,assignments:i,localActionID:c,caseActions:l,caseInfo:u,businessID:d,caseTypeID:p,caseTypeName:h}=mn(e,this.c11nEnv,{isTriggeredFromDifferentContext:a}),g=ln(u);let f,m=!1;if(l){const e=l.find((e=>e.ID===c));m="Case"===e?.type}else f=Th(n);let{assignmentID:y}=mn(e,this.c11nEnv,{isTriggeredFromDifferentContext:a});f?.context_data?.actionType&&(m=f.context_data.actionType===G.CASE,y=y||f.context_data.assignmentID);const E=fn(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(G.MODAL)&&(_.containerName=G.MODAL,_.isModalAction=!0),_.outcome=t.outcomeID,_.jsActionQueryParams=t.jsActionQueryParams,u?.isLocalAction&&(_.viewType=Gc.FORM);const C=qh.buildActionObject(_,this.c11nEnv),{promise:S}=this.actionsApiPromise(s,C);return C.isProcessAction=this.c11nEnv.getValue("isProcessAction","isProcessAction")||Th(n).context_data.isProcessAction,rn.executeOrQueueDeferredAction({type:s,payload:{...C,context:n}}),S}getNextWork(){const e=Ql,t=qh.buildActionObject({containerName:G.PRIMARY,isGetNextWork:!0},this.c11nEnv),{promise:n}=this.actionsApiPromise(e,t);return Sh({type:e,payload:{...t}}),n}openStage(e){if(!e)return Promise.reject(new Error("stageID is required parameter for openStage"));const t=Ql,n=this.c11nEnv.getValue(B.CASE_INFO.CASE_INFO_ID),r=this.c11nEnv.getCaseSummary().headers,s=qh.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 Sh(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(B.CASE_INFO.CASES),r=this.c11nEnv.getValue(B.CASE_INFO.ACTIVE_ACTION_ID),s={containerName:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1};e&&e.includes(G.MODAL)&&(s.containerName=G.MODAL,s.isModalAction=!0);const a=qh.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),i=Md(e);return Sh({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:Pl(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(B.CASE_INFO.CASES),r=this.c11nEnv.getValue(B.CASE_INFO.ACTIVE_ACTION_ID),s={containerName:e.includes(G.MODAL)?G.MODAL:this.c11nEnv.getContainerName(),containerItemID:e,isCaseWideAction:!0,doDeleteCaseSummary:!0,isInCreateStage:!1,isModalAction:e.includes(G.MODAL)},a=qh.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a),i=Md(e);return Sh({type:t,payload:{...a,context:i,cases:n,actionID:r,isFormValid:Pl(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=qh.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return Sh({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 ru(this.c11nEnv).removeContainerItem({containerItemID:e,skipReleaseLockRequest:!0})}approveCase(e){return e?"string"!=typeof e?Promise.reject(new TypeError(this.MSG_CONTAINERITEMID_STRING)):(Sh({type:re,payload:{reference:B.CASE_INFO.APPROVALFLAG,value:G.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)):(Sh({type:re,payload:{reference:B.CASE_INFO.APPROVALFLAG,value:G.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(B.CASE_INFO.DUPLICATECASEINSKEY).split(" "),n={type:re,payload:{reference:B.CASE_INFO.DUPLICATECASEFLAG,value:G.DUPLICATE,context:e}},r={type:re,payload:{reference:B.CASE_INFO.DUPLICATECASEID,value:t,context:e}};return Sh([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:re,payload:{reference:B.CASE_INFO.DUPLICATECASEFLAG,value:G.IGNORE,context:e}},n={type:re,payload:{reference:B.CASE_INFO.DUPLICATECASEID,value:"",context:e}},r={type:re,payload:{reference:B.CASE_INFO.DUPLICATECASEINSKEY,value:"",context:e}};return Sh([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(B.CASE_INFO.CASE_INFO_ID);if(window.pms?.plugins?.c11n?.openLocalAction)return t.caseID=n,Zu(window.pms.plugins.c11n.openLocalAction,e,t);const r=t.assignKey||this.c11nEnv.getValue(B.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=qh.buildActionObject(a,this.c11nEnv),c=this.c11nEnv.getContextName(),{promise:l}=this.actionsApiPromise(o,i),u=Fd(c)[0];let d=!1;const p=q.getRemoteHeaderByContext(c);let h;if(p&&(i.headers={},i.headers.RemoteSystemID=p),!u)return h=c,Sh({type:o,payload:{...i,contextName:c,continueExecution:d}}),l;h=vd(u);const g=Ad(u);if(g?.accessedOrder.forEach((e=>{n===g.items[e].key&&(d=!0,h=g.items[e].context)})),!d||h&&"review"===Ch()?.getState()?.data[h]?.context_data?.caseViewMode)return Sh({type:o,payload:{...i,contextName:c,continueExecution:d}}),l;const f=h,m=f&&f.includes(G.MODAL),y=t.assignKey||this.c11nEnv.getValue(B.CASE_INFO.ASSIGNMENT_ID),E=Th(h),I=E?.caseInfo?.assignments?E.caseInfo.assignments[0]?.actions[0]?.ID:void 0,A=this.c11nEnv.getContainerName(),_=this.c11nEnv.getValue(B.CASE_INFO.CASE_TYPE_ID),C=this.c11nEnv.getValue("isProcessAction","isProcessAction"),S=qh.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=Md(h),N=this.c11nEnv.getCaseSummary(),P=ln(N),R=qh.buildActionObject({caseID:n,containerItemID:h,cancelContext:T},this.c11nEnv);let D={};return m?(R.acTargetName=G.MODAL,R.isInCreateStage=P,R.isModalAction=m,D={...R}):D={...R,acName:Ct(this.c11nEnv.getContainerName(),R.context)},Sh({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(B.CASE_INFO.CASE_INFO_ID)||t.caseID;if(window.pms?.plugins?.c11n?.openProcessAction)return t.caseID=n,Zu(window.pms.plugins.c11n.openProcessAction,e,t);const r=this.c11nEnv.getValue(B.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=Jl,i=qh.buildActionObject(a,this.c11nEnv),{promise:c}=this.actionsApiPromise(o,i);return Sh({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(B.NEXT_ASSIGNMENT_INFO_ID)?this.c11nEnv.getValue(B.NEXT_ASSIGNMENT_INFO_ID):this.c11nEnv.getValue(B.CASE_INFO.ASSIGNMENT_ID),s=ln(this.c11nEnv.getCaseSummary()),a=this.c11nEnv.getValue(B.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(G.MODAL)&&(o.acTargetName=G.MODAL);const i=qh.buildActionObject(o,this.c11nEnv),{promise:c}=this.actionsApiPromise(n,i),l=Md(t);return Sh({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}=B,r=Ee,s=Md(e),a=e&&e.includes(G.MODAL),o=this.c11nEnv.getCaseSummary(),i=ln(o),c=this.c11nEnv.getValue(n.CASE_INFO_ID),l=this.c11nEnv.getValue(n.ASSIGNMENT_ID),u=qh.buildActionObject({caseID:c,containerItemID:e,context:s},this.c11nEnv);let d={};a?(u.acTargetName=G.MODAL,u.isInCreateStage=i,u.isModalAction=a,d={...u}):d={...u,acName:Ct(this.c11nEnv.getContainerName(),u.context)};const{promise:p}=this.actionsApiPromise(r,u);return Sh({type:r,payload:d}),p.then((()=>{t||Qu({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}=B,n=e,r=Xe,s=e&&e.includes(G.MODAL),a=this.c11nEnv.getValue(t.CASE_INFO_ID),o=qh.buildActionObject({caseID:a,containerItemID:e,context:n},this.c11nEnv);if(!Wl(n)){return new ru(this.c11nEnv).removeContainerItem({containerItemID:e}).then((()=>{Qu({caseID:a,context:this.c11nEnv.getContextName()})}))}Sh({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}=B,n=Xe,r=e,s=r&&r.includes(G.MODAL),a=this.c11nEnv.getCaseSummary(),o=ln(a),i=this.c11nEnv.getValue(t.CASE_INFO_ID),c=qh.buildActionObject({caseID:i,containerItemID:e,context:r},this.c11nEnv),l=this.c11nEnv.getValue("isProcessAction","isProcessAction"),u=Dp.isCoexistenceAppOfType(G.APP_TYPE.UIKIT);if(c.isProcessAction=l,o&&(s||u)&&!dn(a)){const t=this.c11nEnv.getValue(G.CASE_INFO.IS_FIRST_ASSIGNMENT),i=Wl(r);if(this.shouldDeleteCaseInCreateStage(i,t,u))return this.deleteCaseInCreateStage(e);Sh({type:n,payload:{...c,isModalAction:s,isChildCase:gn(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=eu,n=this.getSaveActionPayload(e,!0),{promise:r}=this.actionsApiPromise(t,n);return Sh(tu(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=eu,n=this.getSaveActionPayload(e),{promise:r}=this.actionsApiPromise(t,n);return Sh(tu(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=Zl,r=e,s=r&&r.includes(G.MODAL),a=this.c11nEnv.getValue(B.CASE_INFO.CASE_INFO_ID),o=this.c11nEnv.getValue(B.CASE_INFO.CASE_TYPE_ID),i=qh.buildActionObject({caseID:a,caseType:o,containerItemID:e,context:r,ignoreCaseDeletion:t},this.c11nEnv),c=this.c11nEnv.getValue("isProcessAction","isProcessAction"),l=this.c11nEnv.getValue(B.CASE_INFO.PARENTCASEINFO);i.isProcessAction=c,i.parentCaseInfo=l;const u=`${G.APP.APP}/${Ed.PRIMARY}`,d=el(u,Ed.PRIMARY);i.parentContext=d,s&&(i.targetName=G.MODAL,i.containerName=Ed.MODAL,i.isModalAction=s),Sh((e=>({type:Zl,payload:e}))(i));const{promise:p}=this.actionsApiPromise(n,i);return p.then((()=>{Qu({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}=Rp.getRestEndPoint("getRecents")||{};t=`${t}?maxResultsToFetch=${e}`;const n=T()+t;return zi(n,{method:"GET",headers:{}})}updateRecents(e,t,n,r){const{restApi:s}=Rp.getRestEndPoint("updateRecents")||{},a=`${T()}${s}`;return zi(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:{pyLabel:n,pyID:t,classID:e,ID:r}})}logout(){const{restApi:e}=Rp.getRestEndPoint("Logout")||{},t=`${T()}${e}`;return zi(t,{method:"GET",headers:{}}).then((e=>(Object.keys(Mn.rootNodes).forEach((e=>{zu.cleanCaches(e)})),Mn.rootNodes={},sessionStorage.clear(),Fh(),Promise.resolve(e))))}invoke(e,t={}){const n={method:t.method||"GET",body:t.body};return zi(e,n,this.c11nEnv.getContextName())}showCasePreview(e,t={}){this.loadView(e,"pyCasePreview",{container:Ed.PREVIEW,containerName:Ed.PREVIEW,context:B.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:Ed.PREVIEW,containerName:Ed.PREVIEW,context:B.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=qh.buildActionObject({caseId:e,viewName:t,caseClassName:this.c11nEnv.getValue(B.CASE_INFO.CASE_TYPE_ID),RemoteSystemID:q.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=oe,{promise:a}=this.actionsApiPromise(s,r,!1);return Sh({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=qh.buildActionObject({viewName:e,className:t},this.c11nEnv),s=ie,{promise:a}=this.actionsApiPromise(s,r);return Li.getPreviewMode()&&(r.debugInfo={debugId:kh.generateUniqueID()}),Sh({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=qh.buildActionObject({},this.c11nEnv),r=le,{promise:s}=this.actionsApiPromise(r,n);return Sh({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=qh.buildActionObject({},this.c11nEnv),r=ue,{promise:s}=this.actionsApiPromise(r,n);return Sh({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=qh.buildActionObject({pageName:e,dataContext:t,dataContextParameters:n,RemoteSystemID:q.getRemoteHeaderByContext(this.c11nEnv.getContextName())},this.c11nEnv),a=ce;r?.containerName||(r.containerName="HYBRID"===Dp.getRenderingMode()?Ku.getRuntimeParam(G.HYBRID_ROOT_CONTAINERNAME):yc.getTargetViewContainerName(a));const{promise:o}=this.actionsApiPromise(a,s);return Sh({type:a,payload:{...s,...r,skipSemanticUrl:Boolean(r.skipSemanticUrl)}}),o}changeHandler(e,t){qh.changeHandler(e,t)}eventHandler(e,t){qh.eventHandler(e,t)}triggerFieldChange(e,t,n=!1){const r=this.c11nEnv.getContextName(),s=this.c11nEnv.getPageReference(),a=Wh.getContextPath(s,e);n||this.c11nEnv.getValidationApi().validate(t),this.c11nEnv.isInsideList()&&this.c11nEnv.getListActions().updateProperty(e,t);let o=this.c11nEnv.getValue(G.CLASS_ID);const i=e?e.split(".").filter((e=>!!e)):[];i.length>1&&(i.pop(),o=Rh(`.${i.join(".")}.classID`,s,r)),e=kh.trimDotForProperty(e),Sh({type:ae,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=Wh.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),tr({type:B.MESSAGES.MESSAGES_TYPE_ERROR,property:e,pageReference:l,context:c,isListEntry:o}),Sh({type:re,payload:{reference:d,value:t,context:c,isArrayDeepMerge:s,skipDirtyValidation:i,...p&&{isStrictTracking:p},...r&&{removePropertyFromChangedList:r}}})}activateModalContainerItem(e){const t=ke,{context:n}=e,r=n&&n.includes(G.MODAL),s=qh.buildActionObject({...e,containerName:this.c11nEnv.getContainerName(),containerItemID:n},this.c11nEnv);r&&(s.containerName=G.MODAL,s.isModalAction=r),Sh({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(G.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA)&&o&&(((e,t)=>hn(e)&&!pn(e,t))(h,g)||pn(h,g))?Gn(h,n,p):Vn(e,t,h,n,p),s}openEmbeddedDataModal(e,t,n,r,s,a){const o=Et,i=t.getCaseInfo().getKey(),c=`${t.getPageReference().replace(B.CASE_INFO.CASE_INFO_CONTENT,"")}${n}[${r}]`,l={targetProperty:n,index:r,viewID:e,ID:i,actionType:s,interestPage:kh.convertPageRefToClipboardPageNotation(c),heading:a},u=qh.buildActionObject(l,this.c11nEnv),{promise:d}=this.actionsApiPromise(o,u);if(Dp.getFeatureMap().granularUIRefresh){(t.getMetadata().config.children[0].children||[]).forEach((e=>{const n=cn.trimAnnotation(e.config.value),r=Xp(n.startsWith(".")?n.replace(".",""):n,e.config.classID);if(r?.isDeclarativeTarget){const e=t.getPageReference();Mn.addFieldNode(t.getContextName(),e+c,t.viewName,n,"",{isDeclarativeTarget:!0,propertyName:n,pageReference:e+c})}}))}return Sh({type:o,payload:{...u,containerName:B.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=It,n=this.c11nEnv.getPageReference().replace(B.CASE_INFO.CASE_INFO_CONTENT,""),r=Md(e),s={containerItemID:e,containerName:this.c11nEnv.getContainerName(),doDeleteCaseSummary:!0,isInCreateStage:!1,ID:this.c11nEnv.getValue(B.CASE_INFO.CASE_INFO_ID),viewID:this.c11nEnv.getValue(G.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME),isFormValid:Pl(r),interestPage:kh.convertPageRefToClipboardPageNotation(n),parentContext:this.c11nEnv.getValue(G.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),isModalAction:!1,target:this.c11nEnv.getTarget()};e&&e.includes(G.MODAL)&&(s.containerName=G.MODAL,s.isModalAction=!0);const a=qh.buildActionObject(s,this.c11nEnv),{promise:o}=this.actionsApiPromise(t,a);if(Wl(r)){const[e,t,n]=Cn(this.c11nEnv.getPageReference());Mn.mutatePageList(this.c11nEnv.getValue(G.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),e,t,{type:st,rowIndex:n}),Sh({type:st,payload:{pageReference:this.c11nEnv.getPageReference(),context:this.c11nEnv.getValue(G.CONTEXT_DATA_MODAL_VIEW.PARENT_CONTEXT),isListEntry:!0}})}return rn.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=Md(e),n=this.c11nEnv.getPageReference(),{promise:r,actionMgrID:s}=this.actionsApiPromise(At);return Gn(t,n,{actionMgrID:s,isFillFormWithAI:!0,preserveClientChanges:!1}),r}};const td=class{constructor(e){this.c11nEnv=e}async getCaseStages(e,t){const n={caseID:e},{restApi:r,reqType:s}=Wg("getCaseStages",n);return(await zi(r,{method:s},t)).data.stages}getCaseTypeName(){return this.c11nEnv.getValue(G.CASE_INFO.CASE_TYPE_NAME)}getName(){return this.c11nEnv.getValue(G.CASE_INFO.CASE_INFO_NAME)}getClassName(){return this.c11nEnv.getValue(G.CASE_INFO.CASE_TYPE_ID)}getAvailableProcesses(){return this.c11nEnv.getValue(G.CASE_INFO.AVAILABLEPROCESSES)}getKey(){return this.c11nEnv.getValue(G.CASE_INFO.CASE_INFO_ID)}getID(){const e=this.getKey();if(e){const[,t]=e.split(" ");return t||e}}getAssignmentID(){return this.c11nEnv.getValue(G.CASE_INFO.ASSIGNMENT_ID)}getActions(){return this.c11nEnv.getValue(G.CASE_INFO.ACTION_BUTTONS)}getActiveFlowActionID(){return this.c11nEnv.getValue(G.CASE_INFO.ACTIVE_ACTION_ID)||this.c11nEnv.getValue(G.CASE_INFO.ASSIGNMENTACTION_ID)}getParentCaseInfo(){return this.c11nEnv.getValue(G.CASE_INFO.PARENTCASEINFO)}isPerform(){return this.c11nEnv.getValue(`${G.CONTEXT_DATA}${G.CASE_VIEW_MODE_PROP}`)===G.PERFORM_MODE}isReview(){return this.c11nEnv.getValue(`${G.CONTEXT_DATA}${G.CASE_VIEW_MODE_PROP}`)===G.REVIEW_MODE}isAssignmentInCreateStage(){const e=this.c11nEnv.getValue(G.CASE_INFO.CASE_INFO);return ln(e)}isLocalAction(){const e=this.c11nEnv.getValue(G.CASE_INFO.CASE_INFO);return dn(e)}getCurrentAssignmentViewName(){let e=null,t=!1;if(this.c11nEnv.getValue("context_data.caseViewMode")===G.PERFORM_MODE){if(this.isLocalAction())return e;if(this.isAssignmentInCreateStage())t=!0;else{const t=this.c11nEnv.getTarget(),n=this.c11nEnv.getContextName(),r=_d(t,n),{config:s}=t&&n?r&&r.view:this.c11nEnv.getMetadata();e=s?.type===G.VIEW?s?.name:null}(e&&e.startsWith(G.PROPERTY_ANNOTATION)||t)&&(e=this.c11nEnv.getValue(G.CASE_INFO.VIEW_NAME))}return e}getActionRefreshConditions(){const e=this.c11nEnv.getValue(G.CASE_INFO.ACTIVE_ACTION_ID),t=K(this.c11nEnv.getContextName());let n;t&&(n=Th(t));const r=n?.caseInfo?.availableActions,s=Th(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(G.CASE_INFO.ACTION_REFRESH_CONDITIONS)}getBusinessID(){return this.c11nEnv.getValue(G.CASE_INFO.BUSINESS_ID)}getAssignments(){return this.c11nEnv.getValue(G.CASE_INFO.CASE_INFO)?.assignments}getChildAssignments(){return this.c11nEnv.getValue(G.CASE_INFO.CASE_INFO)?.childCases?.[0]?.assignments}isCaseWideLocalAction=()=>{const e=this.c11nEnv.getValue(G.CASE_INFO.ACTIVE_ACTION_ID),t=this.c11nEnv.getValue(G.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(G.CASE_INFO.CASE_INFO_ACTIONS),t=this.c11nEnv.getValue(G.CASE_INFO.ASSIGNMENT_LABEL),n=this.c11nEnv.getValue(G.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(G.CASE_INFO.CASE_INFO_ACTIONS),t=this.c11nEnv.getValue(G.CASE_INFO.ACTIVE_ACTION_ID),n=e.find((e=>e.ID===t));return n?.name||""}getFirstCaseActionName(){const e=this.c11nEnv.getValue(G.CASE_INFO.CASE_INFO_ACTIONS);return e[0]?.name||""}hasAssignments(){const e=this.c11nEnv.getValue(G.CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS),t=this.getChildAssignments();return!!(e||t||this.isCaseWideLocalAction())}hasMessages=()=>!!this.c11nEnv.getValue("caseMessages");hasGetNextWorkLinks(){return!!this.c11nEnv.getValue(G.CASE_INFO.GETNEXTWORK)}},{RESOURCE_TYPES:nd}=B;const rd=class{static openCase(e,t,n,r={}){const s={insKey:e,acTargetName:n,actionMgrID:yn.getNextActionMgrId(),context:t,...r},a=fe;r&&r.channelName&&(s.headers={},s.headers[G.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=yn.actionManagerPromise(a,s.actionMgrID);return Sh({type:a,payload:s}),o}static openAssignment(e,t,n,r={}){const s={assignmentID:e,vcName:n,doDeleteCaseSummary:!0,actionMgrID:yn.getNextActionMgrId(),context:t,...r},a=Ie;r&&r.channelName&&(s.headers={},s.headers[G.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=yn.actionManagerPromise(a,s.actionMgrID);return Sh({type:a,payload:{...s}}),o}static createCase(e,t,n,r={}){const s=ge,a={class:e,acTargetName:n,actionMgrID:yn.getNextActionMgrId(),context:t,...r};r&&r.channelName&&(a.headers={},a.headers[G.X_ORIGIN_CHANNEL]=r.channelName);const{promise:o}=yn.actionManagerPromise(s,a.actionMgrID);return Sh({type:s,payload:{...a}}),o}static getNextWork(e,t,n={}){const r=Ie,s={isGetNextWork:!0,vcName:t,doDeleteCaseSummary:!0,actionMgrID:yn.getNextActionMgrId(),context:e,...n},{promise:a}=yn.actionManagerPromise(r,s.actionMgrID);return Sh({type:r,payload:{...s}}),a}static getOpenedCaseItems(e){const t=[],n=Ad(e);if(n){const{items:r={}}=n,s=Object.keys(r),a=vd(e);s.forEach((n=>{if(r[n]&&(r[n].resourceType===nd.CASE||r[n].resourceType===nd.ASSIGNMENT)){const{key:s="",context:o}=r[n],i=r[n],c=s.substring(s.indexOf(" ")+1),l=Rh(".caseTypeID",G.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}=Wg(ze,n),a={},o=q.getRemoteHeaderFromSourceClass(t??"");return o&&(a.RemoteSystemID=o),zi(r,{method:s,headers:a})};static getCaseBulkActions=async e=>{const{restApi:t,reqType:n}=Wg("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(zi(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}=Wg("getCaseBulkActions",t),s=await zi(n,{method:r});let a=[];return s.data?.availableActions?.length&&(a=s.data.availableActions),a}};const sd=class{constructor(e,t,n){this.meta=e,this.datasource=t,this.index=0,this.options=n,this.datasourceObj=Wh.getPropertyValue(t,n.pageReference,n.context)}hasNext(){return this.index<this.datasourceObj.length}next(){if(!this.hasNext())throw new Error("No Children");const e=Wh.getContextPath(this.datasource,this.index);return this.index+=1,hd({meta:this.meta,options:{...this.options,pageReference:e}})}resetIndex(){this.index=0}};class ad{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,hd({meta:e,index:this.index,options:this.options})}resetIndex(){this.index=0}}const od=(e,t)=>{const n=!!e?.repeat;if(!!e?.["repeat-self"])return new sd(e,e.context||"",t);if(n){const n=bh(`${t.context}.${G.SUMMARY_OF_LISTS}`,e.pageReference,t.context);return new sd(e.children[0],n||e.context,t)}return e?.children?new ad(e.children,t):void 0};class id{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=>bl.isProperty(e))).map((e=>bl.getPropertyName(e)))}}const cd=new id;let ld;Object.freeze(cd);const ud=(e,t,n)=>{e&&(Object.keys(e).forEach((r=>{if("children"!==r){const s=e[r],a=cn.trimAnnotation(s);if("string"!=typeof a&&"string"!=typeof s||!(kh.isValidAnnotation(s)&&kh.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({}),ud(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]||{},ud(a,t[r],e)}}else n&&n.parentKey&&(n.isObjHasValue=!0),t[r]=a}})),n&&!n.isObjHasValue&&delete n.parentStateObj[n.parentKey])},dd=(e,t)=>{e._inheritedProps=e._inheritedProps||[],e.inheritedProps=[...e._inheritedProps,...kh.deepClone(t.inheritedProps)]};class pd{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=kh.deepClone(r.inheritedConfig)),t?.config?.inheritedProps&&dd(this._inheritedConfig,t?.config),ud(this._rawConfig,this._stateProps),this._isState=!kh.isObjectEmpty(this._stateProps),this._rawConfig&&this._rawConfig.config&&(this._isExpressionExist=kh.isExpressionExist(this._rawConfig.config),this._isWhenExist=kh.isWhenExist(this._rawConfig.config),this._isValidatorExist=Vr.isValidatorExist(this._rawConfig.config)),this._isRoot?this._contextName=B.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=cn.handleAnnotation(this.options.pageReference,this)),this._pageReference=Wh.getContextPath(a||this.options.parentPageReference,this._pageReference),this._pageReference||(this._pageReference=""),"reference"===this._type&&(this._rawConfig=t),"reference"===this._type&&kh.isWhenExist({visibility:this.meta?.config?.visibility})&&kn(this.viewName,this._contextName,this._pageReference),"reference"!==this._type&&t&&(this._rawConfig=Wh.resolveReference(t,this)),this._rawConfig){const e=this.getRawConfigProps();e&&(this._localeRuleName=cn.trimAnnotation(e.localeReference)||r.localeReference,this._isExpressionExist=kh.isExpressionExist(e),this._isWhenExist=kh.isWhenExist(e),this._isValidatorExist=Vr.isValidatorExist(e)),this._children=this._rawConfig.children,this._rawConfig?.type?.toLowerCase()===G.VIEW&&this._rawConfig.name&&(this.viewName=cn.handleAnnotation(this._rawConfig.name,this)),this.options.hasForm&&Bn(this)}}isDeclarativeTarget(){let e=!1;if(this.getValue(this._pageReference)||""===this._pageReference){const t=cn.trimAnnotation(this.getPropertyName()),n=this.getFieldMetadata(t);e=n?.isDeclarativeTarget||!1}return e}_getPropertyName(){const e=cn.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?cn.trimAnnotation(this._rawConfig.config.associatedView):"",d=n||c,p={target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:cn.trimAnnotation(t),label:d?.startsWith("@")?cn.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()};Mn.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"))Mn.removeFieldNode(this._contextName,this._pageReference,this.viewName||"",cn.trimAnnotation(this.getPropertyName()),this.index);else{const e=this._rawConfig?.config?.context?`${this._pageReference}${this._rawConfig?.config.context}`:this._pageReference;Mn.removeViewNode(this._contextName,e,this._rawConfig?.config?.name||this._rawConfig?.config?.id||"",this.index)}}addViewNode(){this._rawConfig?.type?.toLowerCase()===G.VIEW&&this._rawConfig.name&&this.viewName&&Mn.addViewNode(this._contextName,this._pageReference,this.viewName,this.parentViewName),"Group"===this._rawConfig?.type&&this._rawConfig?.config?.id&&Mn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.id,this.parentViewName),"Address"===this._rawConfig?.type&&this._rawConfig?.config?.associatedView&&Mn.addViewNode(this._contextName,this._pageReference,cn.trimAnnotation(this._rawConfig.config.associatedView),this.parentViewName),"deferload"===this._rawConfig?.type?.toLowerCase()&&this._rawConfig.config?.name&&Mn.addViewNode(this._contextName,this._pageReference,this._rawConfig.config.name,this.parentViewName)}addWhenNode(){let e="",t="";const n=kh.getWhenNames(this._rawConfig?.config),r=this.getRawConfigProps();if(r?.type&&r?.type?.toLowerCase()===G.VIEW)t=G.CONTEXT_TREE_NODE_TYPES.VIEW,e=this.getCurrentView();else{t=G.CONTEXT_TREE_NODE_TYPES.FIELD;const n=this.getPropertyName();e=cn.isProperty(n)?cn.trimAnnotation(n):""}e&&n.forEach((n=>{Mn.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()!==G.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()),Mn.addPageListNode(this._contextName,this._pageReference,this.viewName??"",cn.trimAnnotation(this.getPropertyName()),{target:this._containerTarget,context:this._contextName,pageReference:this._pageReference,propertyName:cn.trimAnnotation(this.getPropertyName()),label:h?.startsWith("@")?cn.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(cn.trimAnnotation(this.getPropertyName()),this._pageReference)||[];Mn.updatePageListNode(this._contextName,this._pageReference,cn.trimAnnotation(this.getPropertyName()),f.length)}this.isWhenExist()&&this.addWhenNode(),this.removeNode()}setXRayInfo(e){kh.mergeDeep(e,this.xrayInfo)}getXRayInfo(){return this.xrayInfo}getStateProps(){return this._stateProps}setStateProps(e){kh.mergeDeep(e,this._stateProps)}getMetadata(){return this._rawConfig}getCaseInfo(){return this._caseInfo||(this._caseInfo=new td(this)),this._caseInfo}getCaseLocaleReference(){const e=this.getCaseInfo().getClassName();return e?`CASE!${e}`.toUpperCase():null}getListActions(){return Ur(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 Wh.getContextPath(e,t)}getContextName(){return this._contextName}getContainerName(){const{type:e}=this.getMetadata()||{},t=[G.CONTAINERS.ROOT_CONTAINER,G.CONTAINERS.VIEW_CONTAINER,G.CONTAINERS.FLOW_CONTAINER,G.CONTAINERS.MODAL_VIEW_CONTAINER,G.CONTAINERS.PREVIEW_VIEW_CONTAINER,G.CONTAINERS.HYBRID_VIEW_CONTAINER],{acTargetName:n=Ed.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=g?.getStore()?.getState()?.data[`${this.getContextName()}/${G.SUGGESTION}`],n=this.getStateProps()?.value,r=Wh.getContextPath(this.getPageReference(),n),s=t?fc.getSuggestionsContext(this.getContextName()).getField(r):void 0;this._hasSuggestions=!!s,e.hasSuggestions=this._hasSuggestions,this._stateProps.hasSuggestions=this._hasSuggestions}}getConfigProps(e={}){const t={...Fr.getDefaultsforType(this._type),readOnly:this._readOnly,...this._rawConfig&&this._rawConfig.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(t),this.resolveConfigProps(t,e),kh.resolveStringBooleans(e)}getRawConfigProps(){const e={...Fr.getDefaultsforType(this._type),...this._rawConfig?.config,...this._additionalRegisteredProps,...this._inheritedConfig};return this.populateSuggestionProps(e),e}resolveConfigProps(e,t={}){return e&&(Wh.resolveProps(e,t,this),cn.handleComponentMapping(t,{type:this.getComponentName(),config:e},this)),t}registerAdditionalProps(e={}){return Object.assign(this._additionalRegisteredProps,e),ud(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===G.ROOT_CONTAINER&&"portal"!==e.renderingMode;if(t===G.MODAL_VIEW_CONTAINER||t===G.CASE_CREATE_STAGE){const t=vd(`${G.APP.APP}/${this.getContainerName()}`),n=er({context:t,category:B.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||cn.trimAnnotation(this.getRawConfigProps().selectionList):!t&&"Editable"===this.getComponentConfig()?.renderMode&&this.getStateProps().referenceList&&(t=this.getStateProps().referenceList);const n=er({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:B.MESSAGES.MESSAGES_TYPE_ERROR}),r=er({property:t,pageReference:this.getPageReference(),context:this.getContextName(),type:B.MESSAGES.MESSAGES_TYPE_INFO});n&&n[0]&&(e.validatemessage=n.map((e=>vp.getLocaleValue(e.message.replace(/\.$/,""),"Messages"))).join(". ")+(n[n.length-1].message.endsWith(".")?".":""),e.status=G.FIELD_LEVEL_ERROR,this._stateProps.validatemessage=e.validatemessage,this._stateProps.status=e.status),r&&r[0]&&(e.infoMessage=r[0].message,e.status=G.FIELD_LEVEL_WARNING,this._stateProps.infoMessage=e.infoMessage,this._stateProps.status=e.status)}if(t===G.ROOT_CONTAINER){const t=sr(r,vd(`${G.APP.APP}/${this.getContainerName()}`));e.httpMessages=t,this._stateProps.httpMessages=e.httpMessages;const n=fc.getSharedState("isLoggedOut");e.isLoggedOut=n,this._stateProps.isLoggedOut=n;const s=er({context:G.APP.ROOT,category:"PAGE"});e.pageMessages=s,this._stateProps.pageMessages=e.pageMessages}if(t===G.HYBRID_VIEW_CONTAINER){const t=er({context:G.APP.APP,category:G.HTTP});e.httpMessages=t,this._stateProps.httpMessages=t}if(t===G.APP_SHELL&&e.portalDocMode===G.CONTAINER_TYPE.MULTIPLE&&(e.activeCases=rd.getOpenedCaseItems(`${B.APP.APP}/${G.PRIMARY}`),this._stateProps.activeCases=e.activeCases),t===G.APP_SHELL){const t=G.APP.APP,n=vd(`${t}/${this.getContainerName()}`),r=[...er({context:t,category:"PAGE"})||[],...er({context:n,category:"PAGE"})||[]],s=r.length>0?r:void 0;e.pageMessages=s,this._stateProps.pageMessages=e.pageMessages}if(e.value&&t===G.SCALARLIST&&(this._stateProps.value=e.value),t===G.APP_SHELL||t===G.MODAL_VIEW_CONTAINER||t===G.CASE_CREATE_STAGE||n.template===G.CASE_PREVIEW){let t=er({context:G.APP.APP,category:"HTTP"});const n="HYBRID"===Dp.getRenderingMode()?`${this.getContextName()}/${this.getContainerName()}`:`${G.APP.APP}/${this.getContainerName()}`,r=er({context:vd(n),category:"HTTP"});t?r&&(t=t.concat(er({context:vd(n),category:"HTTP"}))):t=er({context:vd(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===G.VIEW_CONTAINER||t===G.FLOW_CONTAINER||t===G.MODAL_VIEW_CONTAINER||t===G.PREVIEW_VIEW_CONTAINER||t===G.ROOT_CONTAINER){if(e.routingInfo=St(this.getContainerName(),this._contextName),t===G.ROOT_CONTAINER&&(e.rootConfig=id.getItemView(e.routingInfo,e.renderingMode),this._stateProps.rootConfig=e.rootConfig),this._stateProps.routingInfo=e.routingInfo,t===G.FLOW_CONTAINER){const t=er({context:this.getContextName(),category:G.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=Fd(n)[0];if(r){const t=vd(r),n=g?.getStore()?.getState()?.data;n&&t&&(e.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime,this._stateProps.lastUpdateTime=n[t]?.caseInfo?.lastUpdateTime);const s=er({context:t,category:B.PAGE}),a=er({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===G.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===G.CASE_VIEW||n.template===G.CASE_PREVIEW||n.template===G.OBJECT_PAGE?(e.caseInfo=this.getCaseSummary(),this._stateProps.caseInfo=e.caseInfo):t===G.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=bl.isPropertyInternal(t),r=e.datasource,s=this.getComponentConfig().isSearchField,{isClassKey:a,isSpecial:o,isDeclarativeTarget:i}=e.fieldMetadata,c=e.listType!==G.ASSOCIATED;return!s&&(i||n||!r&&(a||o)&&c)}getPropertyDetails(e,t,n){return e===G.ASSOCIATED?{propertyValue:t,propertyAnnotation:G.ASSOCIATED_PROPERTY_ANNOTATION}:{propertyValue:n,propertyAnnotation:G.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(G.ATTACHMENT_ANNOTATION))){const t=cn.getPropertyName(s),n=this.getFieldMetadata(t);n&&this.updateConfigData(e,n,t)}}resolvePropertyMetadata(e,t){if(!e)return e;const n=fh(`${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(G.CLASS_ID);return!t&&this._rawConfig&&this._rawConfig.config&&this._rawConfig.config.ruleClass&&(t=this._rawConfig.config.ruleClass),this.resolvePropertyMetadata(Xp(e,t),e)}return this.resolvePropertyMetadata(Xp(t.pop(),this.getValue(`.${t.join(".")}${G.CLASS_ID}`)),e)}getCurrentPageFieldMetadata(e=null){let t=this.getPageReference().split(".");null!==e&&(t=e.split("."));const n=t.pop();return this.resolvePropertyMetadata(Xp(n,this.getValue(`${t.join(".")}${G.CLASS_ID}`)))}getCurrentClassID(){return this._classID??this.getValue(G.CLASS_ID)}getCaseSummary(){const e={...this.getDataObject()[B.CASE_INFO.CASE_INFO]};return e.CaseID=e.CaseID||this.getValue(B.CASE_INFO.CASE_INFO_PZINSKEY),{...e,isCaseWideAction:()=>pn(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()[B.CASE_INFO.CASE_INFO].stages}getStageID(){return this.getDataObject()[B.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 Xl(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?cn.handleAnnotation(this._rawConfig?.config?.visibility,this):"string"!=typeof this.options?.visibility||cn.handleAnnotation(this.options?.visibility,this)}isReadOnly(){return void 0!==this._readOnly&&("true"===this._readOnly||!0===this._readOnly||"string"==typeof this._readOnly&&cn.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 Th(e||this.getContextName())}getImagePath(e){return`${Gr.getConstellationServiceUrl()}/v860/${Gr.getAppAlias()}/image/${e}?org=${Rp.getOrganizationName()}`}skipRequiredValidation(){return this.options.isBulkAction}isBulkAction(){return this.options.isBulkAction}getChildren(){if(this._children&&this._children.length){const e=od(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!==id.allowedComponetsForBulkProcessing[e]&&!0!==id.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 vp.getLocaleValue(e,t,r,a)}isNonEnglishAndAnnotated=(e,t)=>!(!e||!t)&&("en-US"!==e&&t?.startsWith(G.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=Dp.getLocale();if(s){const t=s?.type,n=s?.config?.label??s?.config?.caption;if(this.isNonEnglishAndAnnotated(o,n)){const t=n?.split(`${G.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(".")}${G.CLASS_ID}`),l=i?.definedOnClassID;return o=`${l||c}.${o}`,vp.getLocaleValue(e,o,vp.FIELD_LABELS_BUNDLE_KEY,a)}this.isNonExcludedComponent(t)&&(a=t)}return vp.getLocaleValue(e,t,r,a)}getLocalizedParagraphValue(e){const t=lh(e,this.getCurrentClassID()),n=t?.definedOnClassID;return vp.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?Wh.getPropertyValue(e,this.getPageReference(),`${this._contextName}/${G.SUGGESTION}`):Wh.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)})),dd(this._inheritedConfig,e))}getInheritedProps(){const e={},t={};return this._inheritedConfig.inheritedProps?.forEach((e=>{t[e.prop]=e.value})),Wh.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)),Sh({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(Ol.isPageInstruction(n))return;const r=n?.startsWith(".")?n?.substr(1):n;Ml[t]=Ml[t]||{},Ml[t][r]||(Ml[t][r]={initialValue:Rh(r,null,t)}),Ml[t][r].value=e})({reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName()})}getContextDataValue(e,t){return Dh(t||this.getPageReference(),e,this._contextName)}updateState(e){const t=this._pageReference.indexOf(G.CASE_INFO.CASE_INFO_CONTENT),n=this._pageReference.indexOf(".");let r=G.CASE_INFO.CASE_INFO_CONTENT;0!==t&&(r=n>0?this._pageReference.substring(n):this._pageReference),Sh(Xh({context:this._contextName,data:e,rootPageReference:r}))}replaceState(e,t,n={}){const{skipDirtyValidation:r=!1}=n;Sh({type:"REPLACE_PROPERTY",payload:{reference:`${this.getPageReference()}${e}`,value:t,context:this.getContextName(),skipDirtyValidation:r}})}reportError(e,t,n){Sh(Tg(e,t||{},n))}getComponent(){return ld({getPConnect:()=>this})}createComponent(e,t,n,r){let s=this._pageReference;if(t){const e=bh(`${this.getPageReference()}.${G.SUMMARY_OF_LISTS}`,t,this._contextName);s=Wh.getContextPath(e||t,n)||t}else if(r&&r.pageReference){let e=r.pageReference;e=cn.handleAnnotation(e,this),s=Wh.getContextPath(this._pageReference,e)||""}return ld(hd({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 Wh.resolveReference(this.resolveConfigProps(this.meta),this)}_resolvePageRef(e){return this.getPageReference().includes(e)||e.startsWith(G.CLASS_ANNOTATION)?this.getPageReference():`${this.getPageReference()}${e}`}getReferencedViewPConnect(e=!1){const t={...this.getComponentConfig()};return delete t?.name,delete t?.type,hd({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 ru(this)}getActionsApi(){return this._actionsApi||(this._actionsApi=new ed(this)),this._actionsApi}getActionManager(){return yn}doesContextExist(e){return jh(e??this.getContextName())}getGoogleMapsAPIKey(){return R()}getServerURL(){return T()}getLoadingStatus(e){let t=null;return e?(t=Th(e),t=t?t.context_data:null):t=this.getDataObject().context_data,!!t&&(!!t.isLoading&&t.isLoading)}clearErrorMessages(e){e?.property?tr({type:"error",property:e.property,pageReference:this.getPageReference(),context:this.getContextName()}):e?.context?tr({type:"error",...e}):(tr({type:"error",...e,context:G.APP.APP}),tr({type:"error",...e,context:vd(`${G.APP.APP}/${this.getContainerName()}`)}))}resolveDatasourceReference(e){return bh(`${this.getPageReference()}.${G.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=ml(t);fl[e]?fl[e].fieldOrder[r]=n:fl[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();Lr(r,`${t}.${e}`,{skipStateUpdate:!0});for(let e=0;e<s.length;e+=1)Dr(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=fc.getSuggestionsContext(this.getContextName()),n=this.getStateProps()?.value||e,r=Wh.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=Wh.getContextPath(this.getPageReference(),t);this._hasSuggestions=!1,fc.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 hd(e){const t=new pd(e);return{getPConnect:()=>t}}function gd(e){ld=e}const fd=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 hd({meta:i,options:{context:c,pageReference:u||t,containerName:n,containerItemID:e,parentPageReference:t,hasForm:r||n===Ed.WORKAREA||n===Ed.MODAL||l===G.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=bl.isProperty(s),l=bl.isProperty(r);if(l){const e=bl.getPropertyName(r);i=Rh(`.${e}`,e.startsWith(".")?n:"",a)}if(i||(i=n),c){const e=bl.getPropertyName(s);o=Rh(`.${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=vd(e),a=_d(e,t);a&&({key:r,flowName:s}=a)}t.addContainerItem({semanticURL:"",key:r,flowName:s,caseViewMode:"perform",resourceType:"ASSIGNMENT",data:e.getDataObject(n)})}},md={defaultLimit:16},yd={SINGLE:"single",MULTIPLE:"multiple"},Ed={PRIMARY:"primary",WORKAREA:"workarea",MODAL:"modal",PREVIEW:"preview"},Id=()=>Ch()?.getState()?.containers,Ad=e=>e?Ch()?.getState().containers[e]:(Nt.error("getContainerData: target is the required parameter"),null),_d=(e,t)=>{if(!e||!t)return null;const n=Id(),r=n?.[e];return r&&r.items&&r.items[t]||null},Cd=e=>e?Ch()?.getState().containers[e]?.items:(Nt.error("getContainerItems: target is the required parameter"),null),Sd=e=>e?Ch()?.getState().containers[e]?.accessedOrder||[]:(Nt.error("getContainerAccessOrder: target is the required parameter"),[]),Td=e=>e?Sd(e)?.length>0||!1:(Nt.error("areContainerItemsPresent: target is the required parameter"),!1),Nd=(e,t,n)=>{if(!e||!t)return Nt.error("isContainerItemExists: target and key are required parameters"),!1;const r=Id(),s=r?.[e],a=s&&s.items||null,o=n||((e,t)=>e===t);if(t&&a)for(const e in a)if(o(t,a[e].key))return!0;return!1},Pd=(e,t,n)=>{if(!e||!t)return Nt.error("getContainerItemName: target and key are required parameters"),null;const r=Id(),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},Rd=(e,t)=>{if(e&&t)for(const s of Object.keys(t))if(n=e,r=t[s].key,n?.toLowerCase()===r?.toLowerCase())return t[s];var n,r;return null},Dd=e=>{if(!e)return Nt.error("getContainerItemByKey: key is required parameter"),null;const t=Id()??{};for(const n of Object.keys(t))if(t[n]){const r=t[n].items??null,s=Rd(e,r);if(s)return s}return null},bd=(e,t)=>{if(!e||!t)return Nt.error("isContainerInitialized: context and name are required parameters"),!1;const n=Id();return n&&Object.prototype.hasOwnProperty.call(n,`${e}/${t}`)},Od=(e,t)=>{if(!e||!t)return Nt.error("getContainerType: context and name are required parameters"),null;const n=Id(),r=n?.[`${e}/${t}`];return r&&r.type},vd=e=>{if(!e)return Nt.error("getActiveContainerItemName: target is the required parameter"),null;let t=null;const n=Id();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r;t=s&&s.length>0?s[s.length-1]:null}return t},xd=(e,t,n)=>{if(!e||!t)return Nt.error("isContainerItemActive: target and key are required parameters"),!1;const r=Pd(e,t,n);return!!r&&r===vd(e)},wd=(e,t)=>{let n=null;const r=Id();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},Md=e=>e?wd(e,"context"):(Nt.error("getDataContextName: containerItemName is required parameters"),null),Ld=e=>{if(!e)return Nt.error("getActiveContainerItemContext: target is required parameters"),null;let t=null;const n=Id();if(n&&n[e]){const r=n[e],{accessedOrder:s}=r,a=s&&s.length>0?s[s.length-1]:null;t=Md(a)}return t},Ud=e=>{if(!e)return Nt.error("getChildContainerItems: containerItemName is required parameters"),[];const t=e.endsWith("/")?e:`${e}/`;let n=[],r=!1;const s=Id(),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:[]},Fd=e=>{if(!e)return Nt.error("getChildContainers: containerItemName is required parameters"),[];const t=[],n=Id();for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e&&t.push(r);return t},jd=e=>{if(!e)return Nt.error("getChildContainersContexts: parentContainerItemID is required parameters"),[];const t=[],n=Id();for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&r.startsWith(e)&&r!==e){(Sd(r)||[]).forEach((n=>{Md(n)!==e&&t.push(Md(n))}))}return t},Vd=e=>{const t=[...jd(e),e],n=[],r=Ch()?.getState().data||{};return t.forEach((e=>{Object.prototype.hasOwnProperty.call(r,`${e}/${G.SUGGESTION}`)&&n.push(`${e}/${G.SUGGESTION}`)})),n},kd=e=>e?e&&Ad(e)&&Ad(e).type===yd.SINGLE:(Nt.error("isContainerSingleMode: target is required parameters"),null),$d=e=>e?e&&Ad(e)&&Ad(e).type===yd.MULTIPLE:(Nt.error("isContainerMultipleMode: target is required parameters"),null),Bd=e=>e?Ad(e)&&Ad(e).items&&Object.keys(Ad(e)?.items).length>0||!1:(Nt.error("hasContainerItems: target is required parameters"),!1),Gd=e=>e&&md[e]?md[e]:md.defaultLimit,Wd=(e,t=md.defaultLimit)=>{e?md[e]=t:Nt.error("setContainerLimit: target is required parameter")},Hd=e=>{if(!e)return Nt.error("isContainerLimitReached: target is required parameter"),!1;let t=!1;const n=Ad(e),{items:r={}}=n,s=Object.keys(r),a=Gd(e);return s&&s.length>0&&s.length>=a&&(t=!0),t},qd=e=>{if(!e||!e.name||!e.context)return Nt.error("resetContainersPayload: containerInfo object should contain name and context"),null;const t=e?.name,n=Ad(`${e?.context}/${t}`),r=Array.isArray(n?.accessedOrder)&&n?.accessedOrder.map((e=>n?.items[`${e}`]?.context))||[],s=Fd(`${G.APP.APP}/${G.PREVIEW}`),a=jd(`${G.APP.APP}/${G.PREVIEW}`);return{context:e?.context,name:t,containerItems:[...r,...a],childContainers:s}},zd=e=>{if(!e)return Nt.error("isContainerDirty: containerItemID is the required parameter"),!1;const t=Md(e);return Wl(t)||nl(e)},Yd=e=>{if(!e)return Nt.error("getLeastRecentlyUsedNonDirtyContainerItemID: target is required parameter"),null;let t;const n=Ad(e),{accessedOrder:r=[]}=n;for(let e=0;e<r.length;e+=1){const n=r[e];if(!zd(n)){t=n;break}}return t},Kd=e=>{if(!e)return Nt.error("getTargetFromContainerItemID: containerItemID is the required parameter"),null;const{containers:t}=Ch()?.getState()||{};for(const n in t)if(t[n]?.accessedOrder?.includes(e))return n;const n=e.lastIndexOf(G.UNDERSCORE_STRING);return e.substring(0,n)},Xd=(e,t={})=>{if(!e)return Nt.error("closeContainerItem: containerItemID is the required parameter"),Promise.reject(new Error("closeContainerItem: containerItemID is the required parameter"));const n=Kd(e),r=Md(e),{skipDirtyCheck:s}=t;let a=!0,o=[];if(zd(e)&&!s&&(a=window.confirm(vp.getLocaleValue(Fl,"Messages"))),a){const{accessedOrder:t=[],items:s={},type:a}=Ad(n);o=t.filter((t=>t!==e));const i=o[o.length-1],c=s[i]||{},{semanticURL:l=G.FORWARD_SLASH_STRING,context:u}=c;o.length>0&&l&&l!==G.FORWARD_SLASH_STRING?Jg({directUrlUpdation:!0,semanticURL:l,options:{containerItemID:i,context:u}}):Jg({directUrlUpdation:!0,semanticURL:G.FORWARD_SLASH_STRING,options:{}});Sh(mg({containerItemID:e,context:r,target:n,containerInfo:{newAccessedOrder:o,containerType:a}}))}return Promise.resolve({newAccessedOrder:o,removeItem:a})},Jd=(e,t,n,r)=>{const s="root",a=X(t,s,!0),o=Ct(t,s),i={data:n,context:r?"app":a},c=[sg({root:e,containerItemID:a,context:r?"app":a,target:o,containerName:t})];c.push(Xh(i)),Sh(c)},Qd=(e,t,n)=>{let r=Sd(e);r=r.filter((e=>e!==t));let s=!1;for(let e=0;e<r.length;e+=1){if(Md(r[e])===n){s=!0;break}}return s},Zd=e=>{if(!e)return Nt.error("isContainerItemContextBeingUsedInOtherContainers: containerItemID is the required parameter"),!1;const t=Id(),n=Md(e),r=t?Object.keys(t):[];let s=!1;for(let t=0;t<r.length&&(s=Qd(r[t],e,n),!s);t+=1);return s},ep=e=>{Array.isArray(e)||(e=[e]);const t=Id()||{};return e.map((e=>{const n=Kd(e);return kh.getIn(t,[n,"items",e,"transientItems"])||[]})).flat()},tp=e=>{const{transientItemID:t,data:n,options:r}=e,s=kh.deepClone(Ch()?.getState().data[t]);r?.reset&&kh.iterateLeafNodes(s,(e=>{"classID"!==e[e.length-1]&&kh.setIn(s,e,"")})),Sh(og({transientItemID:t,data:kh.mergeDeep(n,s)}))},np=e=>{const{transientItemID:t,data:n}=e;Sh(cg({transientItemID:t,data:n}))},rp=e=>{const t=kh.deepClone(Ch()?.getState().data[e]);kh.iterateLeafNodes(t,(e=>{"classID"!==e[e.length-1]&&kh.setIn(t,e,"")})),Sh(ig({transientItemID:e,data:t}))},sp=e=>{const t=kh.deepClone(Ch()?.getState().data[e]);kh.iterateLeafNodes(t,(e=>kh.setIn(t,e,""))),Sh(lg({transientItemID:e,data:t}))};class ap{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 op=()=>ap,ip=e=>{const t={containerName:e};t.childContainers=Fd(e),Sh({type:$e,payload:t})},cp=(e,t)=>{const n=Ud(e),{key:r}=_d(Kd(e),e),s=[];n.forEach((e=>{const{key:n}=_d(Kd(e),e);if(n===r){const n={data:{caseInfo:{headers:{etag:t}}},target:Kd(e),context:e};s.push({type:Ae,payload:n})}})),s.length&&Sh(s)},lp=(e,t)=>{const n=[],r={data:{caseInfo:{headers:{etag:t}}},target:Kd(e),context:e};n.push({type:Ae,payload:r}),n.length&&Sh(n)},up=()=>Dp.isPortalLoaded?"app":"root",dp=()=>Kl,pp=(e,t)=>{const n={data:{caseInfo:{lastUpdateTime:t}},target:Kd(e),context:e};Sh({type:Ae,payload:n})},hp=(e,t)=>{const n=Pd(e,t),r=Pd(`${n}/workarea`,t);return Md(r)},gp=e=>e?wd(e,"parentContext"):(Nt.error("getContainerParentContext: containerItemName is required parameters"),null),fp=e=>{const{accessedOrder:t}=e;return t&&t.length>0?t[t.length-1]:""},mp=e=>{if(e&&"string"==typeof e){const t=e.split("/");return t.pop(),t.join("/")}return null},yp=()=>fd,Ep=/{(.*?)}/i,Ip=/{(.*?)}/g,Ap=e=>null!==e.match(Ep),_p=e=>(e&&(e.startsWith("/")&&(e=e.substring(1,e.length)),e.endsWith("/")&&(e=e.substring(0,e.length-1))),e),Cp=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`}},Sp=()=>_p(window.location.pathname),Tp=()=>_p(window.location.pathname+window.location.search),Np=(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 Pp=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=>{Ap(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=()=>_p(`${this.getReqContextName()}/${this.getReqServletNameReal()}`);getReqServletNameReal=()=>`${this.reqServletNameReal}`;getAppDelimeter=()=>`${this.appDelimeter}`;getApplicationName=()=>`${this.appName}`;getApplicationAlias=()=>`${this.appAlias}`;getServletPath=()=>`${this.reqServletPath}`;getOrganizationName=()=>`${this.orgName}`;getReqContextName=()=>_p(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,""),_p(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(q.isRemoteCase(l)){const{RemoteClassGroup:e,RemoteSystemID:t}=q.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(Ap(r)){const e=r.match(Ip);e?.forEach((e=>{const t=this._getDynamicKeyName(e);n[t]&&(s=s.replace(e,n[t]))}))}const a=Xg(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(Rc(t))),o=`${B.APP.APP}${G.FORWARD_SLASH_STRING}${B.PRIMARY}`,i={semanticURL:a,directUrlUpdation:!0,options:{acName:o,context:Ld(o)}};Kg(i);const c=r.substring(r.lastIndexOf("-")+1),l=t.substring(t.lastIndexOf(" ")+1),u=Dp.environmentInfoObject?.pxApplication?.pyLabel;sf(`${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&&(kh.isEmpty(a)||kh.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&&Ap(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(Ip);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],Ap(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)Ap(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(!Ap(n))return e;const r={};if(r[t]=e,void 0!==e.payload){const t=n.match(Ip);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&&Ap(s)){const e=s.match(Ip);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(!Ap(e)&&e!==r[o]&&Cp(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)=>{Np(e,t,"warning"),Np("Error in Generated Routing Table",null,"error"),Np("Back | Forward for this page may NOT work as intended",null,"warning"),Np("Bookmark | Refresh for this page may NOT work as intended",null,"warning")}},Rp=Pp;const Dp=new class{constructor(){this.environmentInfoObject=null,this.isPortalLoaded=!1,this.pageName=null,this.KeyMapping={},this.isAssignmentHeaderHidden=!1,this.coexistenceMeta={appType:"",isCoexistence:!1},this.brandingInfo=null,this.cookieComplianceMethod="none",this.isExtraCallRequiredForDefaultHome="false"}setEnvironmentInfo(e){this.environmentInfoObject=e;const t=this.environmentInfoObject?.features||kh.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 Rp.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(G.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(){Li.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 bp=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 Op{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[Op.#t(t)]=n};getLocaleForRule(e=this.#n()){return this.localeStore[Op.#t(e)]}resetLocaleStore=()=>{this.localeStore={}};#r(e){return e?Op.#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=bp.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?bp.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?kh.getIn(s,n,{}):{};return!a[e]&&r&&(s=this.localeStore[this.#n().toUpperCase()],a=s?kh.getIn(s,`${r}.${n}`,{}):{}),a}#n(){return void 0===Dp.getFeatureMap()?.localizationVersion?this.GENERIC_BUNDLE_KEY:this.GENERIC_BUNDLE_KEY_LP}getParagraphLocaleValue(e,t){const n=`${e}!${G.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!${Dp.getPortalName()}`.toUpperCase()}getCaseLocaleReference(e){return e?`CASE!${e}`.toUpperCase():null}getLocalizationVersion(){return Dp.getFeatureMap().localizationVersion||1}async getLocaleJsons(e){if(!await this.isCurrentLocalePackAvailable())return[];const t=Dp.getUseLocale(),n=[],r=PCore.getLocaleUtils().localeStore;if((e=(e=e.filter((e=>!r[Op.#t(e)]))).map((e=>e.toUpperCase()))).length>0){const r=e.map((e=>({localeRuleKey:e,promise:Gr.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=Dp.getUseLocale(),n=Dp.getBaseLocale();if(Dp&&t&&(t!==n||"en-US"!==n)&&e?.length>0)try{(await this.getLocaleJsons(e)).forEach((e=>{this.setLocaleForRule(e.jsonData,e.localeRuleKey)}))}catch(e){console.warn(e)}}setTimezone(e){this.timezone=e}getTimeZoneInUse(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;return this.timezone||e}matchPatternWithText(e,t){let n=t;const r=[];for(let t=0;t<e.length;){const s=e[t];if(0!==s.length){const e=n.indexOf(s);if(-1===e)return null;if(t>0){const t=n.slice(0,e);r.push(t)}n=n.slice(e+s.length)}t+=1}return n&&r.push(n),r}getLocalizedErrorMessage(e,t){let n="";if(e[t])return e[t];for(const r of Object.keys(e)){const s=r.split(/\{\d+\}/),a=this.matchPatternWithText(s,t);if(a){const t=e[r];if(n=this.replacePlaceHolders(a,t),n)return n}}return n}replacePlaceHolders(e,t){for(let n=0;n<e.length;){if(!t.includes(`{${n+1}}`))return"";t=t.replace(`{${n+1}}`,e[n]),n+=1}return t}async isCurrentLocalePackAvailable(){const e=Dp.getLocale();return this.availableLangPacks?.length||(this.availableLangPacks=Dp.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 Dp.getCaseTypeList().map((e=>`${e.pyWorkTypeImplementationClassName}!CASE!${e.pyWorkTypeName}`.toUpperCase()))}}const vp=new Op;const xp=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)}};on.registerHandler("@L",((e,t)=>t.getLocalizedValue(e))),on.registerHandler("@P",((e,t,n)=>t?t.getValue(e):Wh.getLitePropertyValue(n))),on.registerHandler("@E",((e,t,n)=>{try{const r=qt(e),s=zt(r);return Yt(s,t,n)}catch(e){}return!0})),on.registerHandler("@W",((e,t,n)=>{let r;if(t)r=t.getContextDataValue(`.${G.SUMMARY_OF_WHEN_CONDITIONS}.${e}`);else{const{pageReference:t,context:s}=n??{};r=Dh(t,`.${G.SUMMARY_OF_WHEN_CONDITIONS}.${e}`,s)}return!0===r||"true"===r})),on.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===G.READONLY,l=n?.datasource?.name||"",u=t.getComponentConfig();if(u&&u.deferDatasource&&(u.datasourceMetadata=`@FIELD_META ${e}`,t.setStateProps({datasourceMetadata:u.datasourceMetadata}),i===G.DATA_PAGE))return null;if(i===G.DECISION||i===G.RULE_REFERENCE)return function(e,t){const n=cn.getPropertyName(e?.propertyForDisplayText??""),r=cn.getPropertyName(e?.propertyForValue??""),s=t.getContextDataValue(`.${G.SUMMARY_OF_EXPRESSIONS}.${e?.name}`)||[];return s?.map((e=>({key:e[r]||e[`.${r}`],value:e[n]||e[`.${n}`]})))}(n?.datasource,t);if(i!==G.DATA_PAGE)return n?.datasource?.records;const d=cn.getPropertyName(n?.datasource?.propertyForDisplayText),p=cn.getPropertyName(n?.datasource?.propertyForValue),h=Array.isArray(n?.datasource?.parameters)?n?.datasource?.parameters:[],g=t.getContextName(),f=[];if(h.forEach((e=>{if(cn.isProperty(e?.value)){let t=Rh(`.${kh.getFullPropertyReference([a,cn.getPropertyName(e.value)])}`,o,g);f.push(kh.getFullPropertyReference([o,a,cn.getPropertyName(e?.value)])),null!=t&&""!==t||(t=G.NULL_STRING),r.push(t)}else r.push(e?.value||G.NULL_STRING)})),g){const e=sn.getContextObjectByName(g)||{};f.forEach((t=>{if(t in e){const n=e[t];e[t]=[...new Set([...n,s])]}else e[t]=[s]})),sn.addContextName(g,e)}const m=function(e,t,n,r){let s="",a=n;if(t.join(G.HASH_DELIMITER)&&(s=kh.getHashedString(t.join(G.HASH_DELIMITER)),a=n+G.UNDERSCORE_STRING+s),r){const e=Nh(),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}`]})))})),on.registerHandler("@ROUTING_INFO",((e,t)=>St(t.getContainerName(),t.getContextName()))),on.registerHandler("@ENV",((e,t)=>{switch(e){case G.ENV_INFO_KEYS.APPLICATION_NAME:return Dp.getApplicationName();case G.ENV_INFO_KEYS.ACCESS_GROUP:return Dp.getAccessGroup();case G.ENV_INFO_KEYS.USER_NAME:return Dp.getOperatorName();case G.ENV_INFO_KEYS.USER_ID:return Dp.getOperatorIdentifier();case G.ENV_INFO_KEYS.APPLICATION_DESC:return t.getLocalizedValue(Dp.getApplicationLabel()||"");case G.ENV_INFO_KEYS.USER_IMAGE:return Dp.getOperatorImageInsKey();case G.ENV_INFO_KEYS.LOCALE:return Dp.getUseLocale();case G.ENV_INFO_KEYS.TIMEZONE:return Dp.getTimeZone();case G.ENV_INFO_KEYS.WORK_GROUP:return Dp.getOperatorWorkGroup();default:return e}})),on.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=cn.getPropertyName(e);r[t]=n[t]})):Object.keys(e).forEach((t=>{const s=cn.getPropertyName(e[t]);r[t]=n[s]})),a.push(r)})),a}return[]})),on.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})),on.registerHandler("@USER",((e,t,n={})=>{const r=t?.getValue(e)||Wh.getLitePropertyValue(n,e),s=t?.getReferencedUser(r)||Wh.getReferencedUser(r,n);return{userId:r,userName:s?s.UserName:null}})),on.registerHandler("@ACTIVE_CASES",((e,t)=>rd.getOpenedCaseItems(`${t.getContextName()}/${t.getContainerName()}`))),on.registerHandler("@LR",(e=>e)),on.registerHandler("@CASE",((e,t)=>e===G.ID?t.getCaseInfo().getKey():e)),on.registerHandler("@SHARED",(e=>fc.getSharedState(e))),on.registerHandler("@PARAGRAPH",((e,t)=>{const n=t.getLocalizedParagraphValue(e),r=n?.content?n.content:null,s=n?.category?n.category:null;return r?xp.getParagraphStream(r,t,s):null})),on.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 kh.isEmpty(a)?o=t.getValue(`.${n}`):(o=a,o=kh.getIn(o,n)),o&&r.length>0?(s&&(o=o.filter((e=>Kt(s,e)))),o.map((e=>kh.getIn(e,r)))):null})),on.registerHandler("@ADDRESS",((e,t)=>{const n=t.getValue(e)?.pyCountry;return n?`pyAddressForm_${n}`:"pyAddressForm"})),on.registerHandler("@DATATYPE",((e,t)=>t.getValue(e)));const wp="downloadAttachment",Mp={},Lp=e=>{const t=Xi();return Mp[e]=t,t},Up=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},Fp=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:Up(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)}}},jp={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}=Wg("uploadAttachment",{});return zi(o,{method:i,headers:{"Content-Type":"multipart/form-data"},body:a,onUploadProgress:t,signal:Lp(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(Ji,e):e=>{throw e.isHandled=!1,e}).finally((()=>delete Mp[e.ID]))},linkAttachmentsToCase:(e,t,n,r)=>{const s={};if("File"===n){const[e]=t,{clientFileID:n}=e;delete e.clientFileID,s.signal=Lp(n).token}const{restApi:a,reqType:o}=Wg("linkCaseAttachment",{caseID:e});return zi(a,{...s,body:{attachments:t},method:o},r)},getCaseAttachments:(e,t,n=!1)=>{const{restApi:r,reqType:s}=Wg("getCaseAttachments",{caseID:e,includeThumbnail:n});return zi(r,{method:s},t).then((e=>e.data.attachments))},getAttachmentCategories:(e,t,n)=>{const{restApi:r,reqType:s}=Wg("getAttachmentCategories",{caseID:e,type:t});return zi(r,{method:s},n).then((e=>e.data))},downloadAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=Wg(wp,{attachmentID:e});return zi(r,{method:s,..."binary"===n&&{responseType:"arraybuffer"}},t)},editAttachment:(e,t,n)=>{const{restApi:r,reqType:s}=Wg("editAttachment",{attachmentID:e});return zi(r,{method:s,body:{...t}},n)},deleteAttachment:(e,t)=>{const{restApi:n,reqType:r}=Wg("deleteAttachment",{attachmentID:e});return zi(n,{method:r},t)},downloadDocument:(e,t)=>{const{restApi:n,reqType:r}=Wg("downloadDocument",{documentID:e});return zi(n,{method:r},t)},deleteDocument:(e,t,n)=>{const{restApi:r,reqType:s}=Wg("deleteDocument",{caseID:e,documentID:t});return zi(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=>{Mp[e]&&(Mp[e].cancel(),delete Mp[e])},buildFilePropsFromResponse:Fp,getAttachmentURL:e=>{const{restApi:t}=Wg(wp,{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=>Fp(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(Fp)}else t=[];return{hasUploadedFiles:t.length>0,categoryName:e?.pyCategoryName||t?.[0]?.responseProps?.category||"",attachments:t}}};on.registerHandler("@ATTACHMENT",((e,t,n)=>{let r;return r=t?t.getValue(e):Wh.getLitePropertyValue(n),jp.prepareAttachmentData(r)})),on.registerHandler("@FL",((e,t)=>t.getLocalizedValueForFieldLabel(t.getFieldMetadata(e)?.label))),on.registerHandler("@GENAICOACH",((e,t)=>uh(e,t.getCurrentClassID()))),on.registerHandler("@REFRESH",((e,t)=>{const n=t.getCaseInfo().getKey(),r=t.getContextName(),s=t.getPageReference();xl.registerForRefresh("PROP_CHANGE",t.getActionsApi().refreshCaseView.bind(t.getActionsApi(),n,"",s,{autoDetectRefresh:!0,preserveClientChanges:!1,refreshFor:!0}),`${s}${e}`,`${r}/${s}`,r)}));const Vp={},kp={},$p={},Bp={},Gp={},Wp={},Hp={},qp={},zp={},Yp={},Kp=(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})):kh.copy(e,t)},Xp=(e,t="")=>{if(!e)return null;const n=Bp[e];if(!n)return null;if(!t)return kh.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?kh.deepClone(r):null},Jp=(e,t,n,r=[])=>{if(!t||!e)return null;if(!e.includes(".")){let s;const a=Xp(e,t);return r.length&&(s=r.join(".")),{...a,embeddedType:n,category:s}}const[s,...a]=e.split("."),o=Xp(s,t);return o&&r.push(o.label),Jp(a.join("."),o?.pageClass,o?.type,r)},Qp=e=>{Kp(e,kp)},Zp=e=>{Kp(e,$p)},eh=e=>{if(e.views&&Kp(e.views,kp),e.navigations&&Kp(e.navigations,$p),e.personalizations&&Kp(e.personalizations,Wp),e.insights&&Kp(e.insights,Hp),e.paragraphs&&Kp(e.paragraphs,Vp),e.dataTypes&&Kp(e.dataTypes,qp),e.datapages&&Kp(e.datapages,zp),e.genAICoaches&&Kp(e.genAICoaches,Yp),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=>{Gp[e]=t[e]}))}Kp(e.fields,Bp)},th=e=>kp[e],nh=(e,t)=>{const n=kp[e];return Array.isArray(n)?n.some((e=>e.classID===t)):n?.classID===t},rh=e=>$p[e],sh=e=>e in Gp?Gp[e]:null,ah=e=>e in Wp?Wp[e]:null,oh=e=>e in Hp?Hp[e]:null,ih=e=>{const t={};return Object.keys(Bp).forEach((n=>{const r=Bp[n];let s;Array.isArray(r)?s=r.find((t=>e===t.classID)):e===r.classID&&(s=r),s&&(t[n]=kh.deepClone(s))})),t},ch=(e,t)=>{const n=Xp(e,t)?.datasource?.parameters;return n?kh.deepClone(n):null},lh=(e,t)=>{let n=null;const r=Vp[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?kh.deepClone(n):null},uh=(e,t)=>{let n=null;const r=Yp[e];return r&&(Array.isArray(r)?n=r.find((e=>e.classID===t)):r.classID===t&&(n=r)),n?kh.deepClone(n):null},dh=e=>{if(e in qp){const{savableDataPage:t}=qp[e];return t}return null},ph=e=>{const t=zp[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=qp[n];return a?a.classKeys.map((e=>({keyName:e,isAlternateKeyStorage:r}))):[]},hh=e=>{if(e in qp){const{lookupDataPage:t}=qp[e];return t}return null},gh=e=>{if(Object.prototype.hasOwnProperty.call(qp,e)){const{lookupDataPageInfo:t}=qp[e];return t}return null},fh=(e,t)=>{const n=e.split("."),r=n.pop(),s=new pd({options:{pageReference:`${n.join(".")}`,context:t}}),a=Xp(r,s.getCurrentClassID())?.additionalInformation;if(!a?.includes("@PARAGRAPH"))return a;const o=cn.trimAnnotation(a),i=s.getCurrentClassID(),c=lh(o,i),l=c?.definedOnClassID,u=vp.getParagraphLocaleValue(l||i,o),d=u?.content,p=u?.category;return d?xp.getParagraphStream(d,s,p):c?.content?xp.getParagraphStream(c.content,s,p):null},mh=(e,t)=>{const n=e.split("."),r=n.pop(),s=new pd({options:{pageReference:`${n.join(".")}`,context:t}}),a=Xp(r,s.getCurrentClassID()),o={};return s._classID=s.getCurrentClassID(),s.resolveConfigProps(a,o),o};class yh{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=kh.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=kh.getFullPropertyReference([i,t]),t in o){const e=o[t];kh.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=Rh(n,t,e);a.previousValue="object"==typeof o?null:o}}))}registerListField(e,t,n,r,s){const a=yh._getFieldsForList(e,t,n);a.length>0&&(this.registerFields(e,t,a,r,s),Su.enableCascade(e))}unRegisterListField(e,t,n,r){const s=yh._getFieldsForList(e,t,n);s.length>0&&this.unRegisterFields(e,t,s,r)}static _getFieldsForList(e,t,n){const r=[],s=Xp(n,Rh("classID",t,e));return s&&!Array.isArray(s)&&s.datasource&&s.datasource.parameters&&Object.values(s.datasource.parameters).forEach((e=>{if(cn.isProperty(e)){const t=cn.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=Rh(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=Rh(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=ir.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&&kh.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=Rh(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=Rh(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=G.CASE_INFO.CASE_INFO_CONTENT){const r=[],s=[],a=[],o=kh.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 Eh=new yh;let Ih=null;const Ah=e=>e?.split(/\.(?![^[]+\])|\[|\]/g).filter(Boolean),_h=e=>{Ih=e},Ch=()=>Ih,Sh=e=>{if(!e)return;let t=[],n=[],r=[];Array.isArray(e)||"MERGE_DATA"!==e.type||({changedListProperty:t,leafProperty:n,changedPropertyWithError:r}=Eh.getServerProperties(e.payload.data,e.payload.context,e.payload.rootPageReference)),Ch()?.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);ir.clearMessages({type:"error",property:s,pageReference:r,context:e.payload.context});const a=Mn.getFieldReferenceForProperty(e.payload.context,t);if(a){const e=Wh.resolveContextTreeNodeProps(a.props);Vr.validate(e.componentName?.toLowerCase(),e.propertyName,Wh.getLitePropertyValue(e,e.propertyName),e)}})),Eh.handleServerChanges(e.payload.context,t,n))},Th=e=>Ch()?.getState().data?.[e],Nh=()=>Ch()?.getState().data[G.SHARED],Ph=(e,t,n)=>{if(!(r=e)||r.startsWith('"')||r.startsWith("'"))return(e=>e&&e.trim().substring(1,e.length-1))(e);var r;const s=e?.startsWith(".")?t+e:e,a=Ah(s);return kh.getIn(n,a)},Rh=(e,t,n)=>Ph(e,t,Th(n)),Dh=(e,t,n)=>Ph(t,e?`${G.CONTEXT_DATA}.${e}`:`${G.CONTEXT_DATA}`,Th(n)),bh=(e,t,n)=>((e,t,n)=>{const r=Ah(`${t}.${n}`);return kh.getIn(e,r)})(Th(n),`${G.CONTEXT_DATA}.${e}`,t),Oh=e=>{const{context:t}=e,n=Ch()?.getState().data[t];if(n)return me;const{action:r}=e;return["createWork","showHarness","openAssignment","openWorkByHandle","initRouting"].includes(r)?Re:me},vh=(e,t)=>{const n=Ah(t);return kh.deleteIn(e,n)},xh=e=>!Array.isArray(e)&&"object"==typeof e,wh=(e,t)=>{Array.isArray(t)&&t.length>0&&t.forEach((t=>{t.allowMultiple?t.allowMultiple&&kh.setIn(e,t.path,[]):kh.setIn(e,t.path,{})}))},Mh=(e,t,n={})=>{const{isArrayDeepMerge:r,propertiesToReplace:s=[]}=n;Array.isArray(e)&&!t&&(t=[]),wh(e,s);const a=(e,t)=>{if(xh(e)&&null!==t&&"string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)return j()(e,t,a);if(Array.isArray(e)&&null!==t&&Array.isArray(t)){if(r)return j()(e,t,a);{const n=t.length;if(void 0===r&&n===e.length)return j()(e,t,a)}}return""===t&&e&&"object"==typeof e?e:t};return a(e,t)},Lh=(e,t,n,r={isArrayDeepMerge:!0})=>{const{isArrayDeepMerge:s}=r,a=Ah(t);if("object"==typeof n){const t=Mh(kh.getIn(e,a),n,{isArrayDeepMerge:s});return kh.setIn(e,a,t)}return kh.setIn(e,a,n)},Uh=(e,t,n)=>{const r=Ah(t);return kh.setIn(e,r,n)},Fh=()=>{const e=at,{promise:t,actionMgrID:n}=yn.actionManagerPromise(e);return Sh({type:e,payload:{actionMgrID:n}}),t},jh=e=>{const t=Ch()?.getState();return!!t?.data?.[e]};class Vh{static mergeDeep(e,t){return j()(t,e)}static hasIn(e,t){return x()(e,t)}static getIn(e,t,n){return M()(e,t,n)}static setIn(e,t,n){return U()(e,t,n)}static deleteIn(e,t){return O()(e,t)}static isObjectEmpty(e){return!e||0===Object.entries(e).length}static isEmpty(e){return k()(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=cn.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=cn.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)?[]:{}),Mh(t[r[s]],n,{isArrayDeepMerge:!0})):t[r[s]]=n};static getHashedString(e){return(0,D.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 E()(e,t)}static isContains(e,t){const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(e[n[r]]&&Vh.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)=>{Vh.flatten(e,`${t}[${r}]`,n)})):"object"==typeof e&&null!==e?Object.keys(e).forEach((r=>{const s=t?`${t}.${r}`:r;Vh.flatten(e[r],s,n)})):n[t]=e}static buildInstructionPageReference(e,t){const n=`${e}${t}`.replace(G.CASE_INFO.CASE_INFO_CONTENT,"").replace(G.DATA_INFO.DATA_INFO_CONTENT,"");return Yn.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&&yn.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 kh=Vh,$h=G.SUMMARY_OF_LISTS,Bh=G.SUMMARY_OF_WHEN_CONDITIONS;class Gh{static updateData(e){Object.keys(e).forEach((t=>{Sh(Xh({context:t,data:e[t]}))}))}static updateContextData(e){Object.keys(e).forEach((t=>{Sh(Xh({context:t,data:e[t]}))}))}static resolveWhen(e,t){return!!t.getContextDataValue(`.${Bh}.${e}`)}static resolveFieldValue(e,t){return t.getLocalizedValue(e)}static resolveNavigation(e,t){return rh([this.resolveName(e,t)])}static resolveView(e,t,n=""){const r=th([this.resolveName(e,t)]);let s=[];if(Array.isArray(r)&&r.length>0){if(t&&r.length>1){if(n||(n=t.getValue(G.CLASS_ID)),!n)return;s=r.filter((e=>e[G.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=cn.handleAnnotation(e,t)),e)}static getContextPath(e,t){return("number"==typeof t||t)&&("number"==typeof(t=cn.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(G.CLASS_ANNOTATION)?t.split(G.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 Rh(t,e,n)}static getProperty(e,t,n){let r=this.resolvePropertyReference(t,e,n);if(null==r||0===r.length){const s=bh(`${t}.${$h}`,e,n);s&&(r=this.resolvePropertyReference(t,s,n))}return r}static getPropertyValue(e,t,n){return e=cn.trimAnnotation(e),this.getProperty(e,t,n)}static getReferencedUser(e,t){const n=Gh.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?Gh.getPropertyValue(i,a,`${o}/${G.SUGGESTION}`):Gh.getPropertyValue(i,a,o)}static _handlePropString(e,t,n,r,s){n.startsWith("@")?e[t]=cn.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?(kh.mergeDeep(e,t),this._resolveProps(t,n,void 0),t):t}static resolveContextTreeNodeProps(e){const t={};return e?(kh.mergeDeep(e,t),this._resolveProps(t,void 0,e),kh.resolveStringBooleans(t)):t}static resolveClassID(e,t,n){const r=cn.trimAnnotation(e);let s;for(s=r.startsWith(".")?`${t}${r}`:`${r}`;s;){const e=Rh(G.CLASS_ID,s,n);if(e)return e;s=s.substring(0,s.lastIndexOf("."))}return null}}const Wh=Gh;const Hh=new class{constructor(){this.actionHandlers={}}getHandler(e){return this.actionHandlers[e]}registerHandler(e,t){this.actionHandlers[e]=t}};const qh=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=Hh.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"===Dp.getRuntime()?t.getContextName():n.context,n.pageReference=t.getPageReference(),n.actionMgrID=yn.getNextActionMgrId(),n};static#u=e=>{const t=e.actionHandler,n=e.component,{config:r}=e,s={};Wh.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 Wh.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();tr({type:B.MESSAGES.MESSAGES_TYPE_ERROR,property:n,pageReference:e.getPageReference(),context:r});if(("Browser"===Dp.getRuntime()?t?.nativeEvent instanceof Event||t instanceof Event:!!t?.nativeEvent)||null!==t.value&&void 0===t.prop){let{target:n}=t;null===n&&t&&t.auxiliaryTarget&&(n=t.auxiliaryTarget);const s=void 0===n?t.value:"value"in n?n.value:n.innerText,a=this.getFullRef(e);Sh({type:re,payload:{reference:a,value:s,context:r}}),void 0!==n&&this.isEditable(n)&&!this.isNonKeyInput(n)||Sh({type:ae,payload:{reference:a,pageReference:e.getPageReference(),value:s,context:r,propertyName:e.getComponentConfig().value,classID:e.getValue(G.CLASS_ID)}})}else{const n=e.getPageReference(),s=e.getStateProps();for(const e of Object.keys(t)){const a=s[e],o=t[e];Sh({type:re,payload:{reference:Wh.getContextPath(n,a),value:o,context:r}}),Sh({type:ae,payload:{reference:Wh.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&&tr({type:B.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)&&Sh({type:ae,payload:{reference:a,pageReference:e.getPageReference(),value:r,context:o,propertyName:e.getComponentConfig().value,classID:e.getValue(G.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"}},zh="CREATE_WORK",Yh=e=>({type:zh,payload:e});const Kh=(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])?[]:{}),Kh(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)},Xh=(e,t={})=>{const{serverPrecedenceFields:n=[],propertiesToReplace:r=[]}=t,{context:s,data:a,isArrayDeepMerge:o,preserveClientChanges:i=!1}=e,c=Vl(s,!0),l=Th(s);let u={};if(l&&a){u=JSON.parse(JSON.stringify(l));const e=JSON.parse(JSON.stringify(a)),t=new Set;Kh(c,u,t),((e,t,n)=>{const r=new Set;e.forEach((e=>{e=kh.trimDotForProperty(e);const[s,a,o]=Cn(e);s&&a&&o&&!r.has(`${s}.${a}`)&&((kh.getIn(n,`${s}.${a}`)||[]).forEach(((e,n)=>{n!==+o&&kh.setIn(t,`${s}.${a}[${n}]`,e)})),r.add(`${s}.${a}`))}))})(t,u,e)}!function(e,t){const n=kh.getIn(e,G.REFERENCED_USERS);let r;if(void 0!==n){if(!Array.isArray(n)&&"object"==typeof n)return r=kh.getIn(t,G.REFERENCED_USERS,{}),void kh.setIn(e,G.REFERENCED_USERS,{...r,...n});r=kh.getIn(t,G.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=>{kh.deleteIn(d,`caseInfo.content.${e}`)})),p=Mh(a,d,{isArrayDeepMerge:!o})):((e,t)=>{const n=Ml[e]||{};Object.keys(n).forEach((e=>{kh.hasIn(t,e)&&(n[e].value=kh.getIn(t,e))}));let r=gl.getStateMachinesByContext(e)||{};r={...r,...gl.getUnConnectedStateMachines(e)||{}},Object.keys(r).forEach((n=>{if(kh.hasIn(t,n)){const r=kh.getIn(t,n);r&&Array.isArray(r)&&0===r.length&&gl.setStateMachineEmpty(e,n)}}))})(s,a),{type:Ae,payload:{...e,data:p,...r.length>0?{propertiesToReplace:r}:null}}},Jh=e=>({type:"SHOW_HARNESS",payload:e}),Qh=e=>({type:oe,payload:e}),Zh=e=>({type:ie,payload:e}),eg=e=>({type:"ADD_WORK",payload:e}),tg=e=>({type:fe,payload:e}),ng=e=>({type:Ne,payload:e}),rg=e=>({type:Pe,payload:e}),sg=e=>({type:Re,payload:e}),ag=e=>({type:be,payload:e}),og=e=>({type:Oe,payload:e}),ig=e=>({type:we,payload:e}),cg=e=>({type:Le,payload:e}),lg=e=>({type:Me,payload:e}),ug=e=>{const{containerItemID:t}=e;e.suggestionContexts=Vd(t);const n=e?.data?.caseInfo?.content,r=Object.keys(n||{}).length>0;return e.propertiesToReplace=r?$c.getPropertiesToReplace(t):[],{type:Fe,payload:e}},dg=e=>{const{context:t}=e;return{type:de,payload:{context:t}}},pg=e=>{const{context:t}=e;return{type:pe,payload:{context:t}}},hg=e=>({type:je,payload:e}),gg=e=>({type:Ue,payload:e}),fg=e=>({type:rt,payload:e}),mg=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=Md(n)),e.context=r,e.deleteContext=!Zd(n),e.childContainers=Fd(n),e.childContainersContexts=jd(n),e.transientItems=ep([...e.childContainersContexts,n]),e.suggestionContexts=Vd(n),n===t&&(e.caseID=Rh(G.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Rh(G.CASE_INFO.REMOTESYSTEMID,"",t)),{type:De,payload:e}},yg=e=>{const{containerItemID:t}=e;return e.transientItems=ep([...jd(t),t]),{type:xe,payload:e}},Eg=e=>{const{transientItemID:t}=e;return e.transientItems=[t],{type:ve,payload:e}},Ig=e=>{const{context:t,containerItemID:n}=e;let r=t;return r||(r=Md(n)),e.context=r,e.childContainers=Fd(n),e.childContainersContexts=jd(n),e.transientItems=ep([...e.childContainersContexts,n]),e.suggestionContexts=Vd(n),n===t&&(e.caseID=Rh(G.CASE_INFO.CASE_INFO_ID,"",t),e.RemoteSystemID=Rh(G.CASE_INFO.REMOTESYSTEMID,"",t)),{type:Ve,payload:e}},Ag=e=>({type:ye,payload:e}),_g=e=>({type:Ie,payload:e}),Cg=e=>({type:Se,payload:e}),Sg=(e,...t)=>(qh.resume(),e(...t)),Tg=(e,t,n,r,s)=>({type:Te,payload:{msg:e,err:t,context:n,formFields:r,actionMgrID:s}}),Ng=e=>({type:it,payload:e}),Pg=e=>({type:ct,payload:e}),Rg=e=>({type:lt,payload:e}),Dg=e=>({type:"SHOW_CASE_PREVIEW",payload:e}),bg=e=>({type:he,payload:e}),Og=e=>({type:re,payload:e}),vg=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},xg=(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=Gg(Ye,{assignmentID:a});return{routeEndpoint:o?.restApi,requestType:o?.reqType,payload:{assignmentID:a},options:t,routeKey:nt,urlPath:s}})(e,t):Rp.getEndPointInfo(e),wg="add",Mg="replace",Lg=["portal","noPortal","preview","debug","devtool"];let Ug="",Fg="Home",jg="",Vg=!0;const kg=e=>(Vg=e,Vg),$g=()=>Vg,Bg=(e,t,n)=>Rp.getSemanticURL(e,t,n),Gg=(e,t)=>Rp.getRestEndPoint(e,t),Wg=(e,t)=>{let n=T();const r=Gg(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):{}},Hg=(e,t,n)=>{const{root:r,resources:s}=e,{views:a}=s,{config:o}=r,i=wg;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(Ip);if(l){const e=kh.getIn(t,o.context);c=c.replace(l[0],e.pyID)}return c.startsWith("/")&&(c=c.substring(1,c.length)),{pxURLPath:c,historyAction:i}},qg=(e,t,n)=>{let r,s;r=_p(t)?`${e}/${t}`:e;const a=_p(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()!==Fg.toLowerCase()||c.has("noPortal")||(r=`${e}/${t}`),!Rp.isDefaultPortal()){const e=Rp.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)&&Lg.includes(n)&&e.append(n,r);return e})(s,c),s.toString()&&(r+=`?${s.toString()}`),r},zg=(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&&Ap(t.pxURLPath)?Hg(n,r,t.pxURLPath):t||Hg(n,r),o=Rp.getEndPointInfo(a.pxURLPath),a.pxURLPath=o.urlPath}const c=qg(Ug,Rp.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:Rp.getApplicationName()),n===`${Ug}/${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]}`}})(jg,Rp.getApplicationPath(),c),u=((e,t)=>(void 0!==e&&(e.options=t),{stateObj:e}))(o,{...i,title:l});a.historyAction===wg?((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===Mg&&((e,t,n)=>{try{window.history.replaceState(e,t,n)}catch(e){throw new Error("Error- Unable to Replace Browser History")}})(u,l,c)},Yg=e=>{let t=null;e.directUrlUpdation&&(t={historyAction:wg,pxURLPath:""},t.pxURLPath=e.semanticURL),zg(e,{urlPathObjParam:t,infoParam:null,optionsParam:null},!1)},Kg=e=>{Yg(e)},Xg=e=>{const t={pxURLPath:e};return qg(Ug,Rp.getApplicationPath(),t)},Jg=e=>{const{uiResources:t}=e;$g()&&(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))&&Yg(e)},Qg=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},Zg=(e,t,n)=>{const{caseClassName:r,workID:s}=e.payload,{containerName:a,context:o}=t,{RemoteClassGroup:i,RemoteSystemID:c,name:l}=q.getRemoteCase(r),u={...e,headers:{RemoteSystemID:c},className:r,isTraditionalRemoteCase:!0,action:_t,viewName:W,gadgetId:$c.getUniqueGadgetId(),context:n??o,skipSemanticUrl:!0,insKey:`${i?.toUpperCase()} ${s}`,containerName:a,name:l};Sh(f.showPage(u))},ef=e=>{const t=(e=>e.state?e.state.stateObj:null)(e);t&&(q.isTraditionalRemoteCase(t.payload?.caseClassName)?Zg({...t},t.options):Sh(f.showHistory(Qg(t))))},tf=()=>Rp.getApplicationPath()!==Sp(),nf=e=>{const{acName:t,context:n,defaultViewLabel:r}=e,s=(e=>{const t=Rp.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=>{Fg=e})(s),Rp.setDefaultRoute(s);const a=X(t,n),o=Ct(t,n),i="true"===Dp.getIsExtraCallRequiredForDefaultHome(),c={historyAction:Mg,pxURLPath:""};let l;const u={acName:o,context:a,actionConfig:{context:a}};if(i||!i&&tf()){const t=vg(Tp());l=xg(t,u),c.pxURLPath=l.urlPath,void 0!==l.payload?.pageClass&&(l.payload.pageClass=Ch()?.getState()?.data?.app?.pyPortal?.classID);const n="showHistory",r={routeEndpoint:l.routeEndpoint,requestType:l.requestType,payload:l.payload,options:u,routeKey:l.routeKey};q.isTraditionalRemoteCase(l?.payload?.caseClassName)?Zg(r,e,u.context):Sh(f[n](Qg(r)))}else l=Rp.getEndPointInfo(Fg),c.pxURLPath="";zg(null,{urlPathObjParam:c,infoParam:l,optionsParam:u},!0)},rf=(e,t=!1)=>{var n;Ug=e.domain,!1===t&&$g()&&(n=ef,window.addEventListener("popstate",(e=>n(e))),window.onbeforeunload=()=>null),Rp.init(e,Fg)},sf=e=>{(e=>{window.document.title=e})(e)};function af(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 of=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),cf=()=>Math.random().toString(36).substring(7).split("").join("."),lf={INIT:`@@redux/INIT${cf()}`,REPLACE:`@@redux/REPLACE${cf()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${cf()}`};function uf(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 df(e,t,n){if("function"!=typeof e)throw new Error(af(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(af(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(af(1));return n(df)(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(af(3));return s}function d(e){if("function"!=typeof e)throw new Error(af(4));if(c)throw new Error(af(5));let t=!0;l();const n=i++;return o.set(n,e),function(){if(t){if(c)throw new Error(af(6));t=!1,l(),o.delete(n),a=null}}}function p(e){if(!uf(e))throw new Error(af(7));if(void 0===e.type)throw new Error(af(8));if("string"!=typeof e.type)throw new Error(af(17));if(c)throw new Error(af(9));try{c=!0,s=r(s,e)}finally{c=!1}return(a=o).forEach((e=>{e()})),e}p({type:lf.INIT});return{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(af(10));r=e,p({type:lf.REPLACE})},[of]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(af(11));function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[of](){return this}}}}}function pf(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:lf.INIT}))throw new Error(af(12));if(void 0===n(void 0,{type:lf.PROBE_UNKNOWN_ACTION()}))throw new Error(af(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(af(14))}o[i]=u,a=a||u!==l}return a=a||r.length!==Object.keys(e).length,a?o:e}}function hf(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}var gf=function(e){function t(t,n){return e.call(this)||this}return mo(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(Oo),ff={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=ff.delegate;return(null==s?void 0:s.setInterval)?s.setInterval.apply(s,_o([e,t],Ao(n))):setInterval.apply(void 0,_o([e,t],Ao(n)))},clearInterval:function(e){var t=ff.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},mf=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 mo(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),ff.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&&ff.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,bo(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(gf),yf=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return mo(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}(mf),Ef={now:function(){return(Ef.delegate||Date).now()},delegate:void 0},If=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=Ef.now,e}(),Af=function(e){function t(t,n){void 0===n&&(n=If.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return mo(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}(If),_f=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return mo(t,e),t}(Af))(yf),Cf=ho((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Sf=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 mo(t,e),t.prototype.lift=function(e){var t=new Tf(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Cf},t.prototype.next=function(e){var t=this;$o((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var s=Io(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;$o((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;$o((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?vo:(this.currentObservers=null,a.push(e),new Oo((function(){t.currentObservers=null,bo(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 Zo;return e.source=this,e},t.create=function(e,t){return new Tf(e,t)},t}(Zo),Tf=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return mo(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:vo},t}(Sf),Nf=function(e,t){return Nf=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])},Nf(e,t)};Object.create;Object.create;var Pf=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 Sf,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}Nf(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Zo);var Rf=s(52),Df=Symbol.for("immer-nothing"),bf=Symbol.for("immer-draftable"),Of=Symbol.for("immer-state");function vf(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var xf=Object.getPrototypeOf;function wf(e){return!!e&&!!e[Of]}function Mf(e){return!!e&&(Uf(e)||Array.isArray(e)||!!e[bf]||!!e.constructor?.[bf]||$f(e)||Bf(e))}var Lf=Object.prototype.constructor.toString();function Uf(e){if(!e||"object"!=typeof e)return!1;const t=xf(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)===Lf}function Ff(e,t){0===jf(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function jf(e){const t=e[Of];return t?t.type_:Array.isArray(e)?1:$f(e)?2:Bf(e)?3:0}function Vf(e,t){return 2===jf(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function kf(e,t,n){const r=jf(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function $f(e){return e instanceof Map}function Bf(e){return e instanceof Set}function Gf(e){return e.copy_||e.base_}function Wf(e,t){if($f(e))return new Map(e);if(Bf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Uf(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[Of];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(xf(e),t)}{const t=xf(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Hf(e,t=!1){return zf(e)||wf(e)||!Mf(e)||(jf(e)>1&&(e.set=e.add=e.clear=e.delete=qf),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Hf(t,!0)))),e}function qf(){vf(2)}function zf(e){return Object.isFrozen(e)}var Yf,Kf={};function Xf(e){const t=Kf[e];return t||vf(0),t}function Jf(){return Yf}function Qf(e,t){t&&(Xf("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Zf(e){em(e),e.drafts_.forEach(nm),e.drafts_=null}function em(e){e===Yf&&(Yf=e.parent_)}function tm(e){return Yf={drafts_:[],parent_:Yf,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function nm(e){const t=e[Of];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function rm(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[Of].modified_&&(Zf(t),vf(4)),Mf(e)&&(e=sm(t,e),t.parent_||om(t,e)),t.patches_&&Xf("Patches").generateReplacementPatches_(n[Of].base_,e,t.patches_,t.inversePatches_)):e=sm(t,n,[]),Zf(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Df?e:void 0}function sm(e,t,n){if(zf(t))return t;const r=t[Of];if(!r)return Ff(t,((s,a)=>am(e,r,t,s,a,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return om(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),Ff(s,((s,o)=>am(e,r,t,s,o,n,a))),om(e,t,!1),n&&e.patches_&&Xf("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function am(e,t,n,r,s,a,o){if(wf(s)){const o=sm(e,s,a&&t&&3!==t.type_&&!Vf(t.assigned_,r)?a.concat(r):void 0);if(kf(n,r,o),!wf(o))return;e.canAutoFreeze_=!1}else o&&n.add(s);if(Mf(s)&&!zf(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;sm(e,s),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||om(e,s)}}function om(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Hf(t,n)}var im={get(e,t){if(t===Of)return e;const n=Gf(e);if(!Vf(n,t))return function(e,t,n){const r=um(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_||!Mf(r)?r:r===lm(e.base_,t)?(pm(e),e.copy_[t]=hm(r,e)):r},has:(e,t)=>t in Gf(e),ownKeys:e=>Reflect.ownKeys(Gf(e)),set(e,t,n){const r=um(Gf(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=lm(Gf(e),t),o=r?.[Of];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||Vf(e.base_,t)))return!0;pm(e),dm(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!==lm(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,pm(e),dm(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Gf(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){vf(11)},getPrototypeOf:e=>xf(e.base_),setPrototypeOf(){vf(12)}},cm={};function lm(e,t){const n=e[Of];return(n?Gf(n):e)[t]}function um(e,t){if(!(t in e))return;let n=xf(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=xf(n)}}function dm(e){e.modified_||(e.modified_=!0,e.parent_&&dm(e.parent_))}function pm(e){e.copy_||(e.copy_=Wf(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Ff(im,((e,t)=>{cm[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),cm.deleteProperty=function(e,t){return cm.set.call(this,e,t,void 0)},cm.set=function(e,t,n){return im.set.call(this,e[0],t,n,e[0])};function hm(e,t){const n=$f(e)?Xf("MapSet").proxyMap_(e,t):Bf(e)?Xf("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Jf(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,a=im;n&&(s=[r],a=cm);const{revoke:o,proxy:i}=Proxy.revocable(s,a);return r.draft_=i,r.revoke_=o,i}(e,t);return(t?t.scope_:Jf()).drafts_.push(n),n}function gm(e){if(!Mf(e)||zf(e))return e;const t=e[Of];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Wf(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Wf(e,!0);return Ff(n,((e,t)=>{kf(n,e,gm(t))})),t&&(t.finalized_=!1),n}var fm=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&&vf(6),void 0!==n&&"function"!=typeof n&&vf(7),Mf(e)){const s=tm(this),a=hm(e,void 0);let o=!0;try{r=t(a),o=!1}finally{o?Zf(s):em(s)}return Qf(s,n),rm(r,s)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===Df&&(r=void 0),this.autoFreeze_&&Hf(r,!0),n){const t=[],s=[];Xf("Patches").generateReplacementPatches_(e,r,t,s),n(t,s)}return r}vf(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){Mf(e)||vf(8),wf(e)&&(e=function(e){wf(e)||vf(10);return gm(e)}(e));const t=tm(this),n=hm(e,void 0);return n[Of].isManual_=!0,em(t),n}finishDraft(e,t){const n=e&&e[Of];n&&n.isManual_||vf(9);const{scope_:r}=n;return Qf(r,t),rm(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=Xf("Patches").applyPatches_;return wf(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},mm=fm.produce;fm.produceWithPatches.bind(fm),fm.setAutoFreeze.bind(fm),fm.setUseStrictShallowCopy.bind(fm),fm.applyPatches.bind(fm),fm.createDraft.bind(fm),fm.finishDraft.bind(fm);const ym=(e,t)=>{const{data:{shared:n={}}={},context:r}=t;((e,t)=>{Lu.updateDataPageStore(t),Object.keys(t).forEach((n=>{kh.getIn(e,[G.SHARED,n])?Object.keys(t[n]).forEach((r=>{kh.setIn(e,[G.SHARED,n,r],t[n][r])})):kh.setIn(e,[G.SHARED,n],t[n])}))})(e,n),r&&kh.deleteIn(e,[r,"shared"])},Em=(e,t,n=!1)=>{const{context:r,caseViewMode:s=(n?void 0:G.PERFORM_MODE),containerName:a}=t;a!==Ed.WORKAREA&&s&&kh.setIn(e,[r,"context_data","caseViewMode"],s)},Im=(e,t)=>{const{context:n}=t;kh.setIn(e,[n,"context_data","actionType"],t.actionType),kh.setIn(e,[n,"context_data","assignmentID"],t.assignmentID)},Am=(e,t=[])=>{t.forEach((t=>kh.deleteIn(e,t)))},_m=(e,t=[])=>{t.forEach((t=>kh.deleteIn(e,t)))},Cm=(e,t=[])=>{t.forEach((t=>{kh.deleteIn(e,t)}))},Sm=(e,t,n={})=>{const{deleteAssignmentSpecificResources:r=!0,doDeleteConfirmationDetails:s=!0}=n;kh.deleteIn(e,[t,"nextAssignmentInfo"]),kh.deleteIn(e,[t,G.CASE_INFO.CASE_INFO,"availableActions"]),kh.deleteIn(e,[t,G.CASE_INFO.CASE_INFO,"availableProcesses"]),kh.deleteIn(e,[t,G.CASE_INFO.CASE_INFO,"activeActionID"]),kh.deleteIn(e,[t,G.CASE_INFO.CASE_INFO,"assignments"]),kh.deleteIn(e,[t,G.CASE_INFO.CASE_INFO,"childCases"]),s&&(kh.deleteIn(e,[t,G.CASE_INFO.CASE_INFO,"confirmationLinks"]),kh.deleteIn(e,[t,"caseMessages"])),r&&(kh.deleteIn(e,[t,G.CASE_INFO.CASE_INFO,"actionButtons"]),kh.deleteIn(e,[t,G.CASE_INFO.CASE_INFO,"navigation"]))},Tm=(e,t)=>mm(e||{},(e=>{switch(t.type){case Re:{if(!t.payload.data||e[t.payload.context])return e;t.payload.doDeleteCaseSummary&&Sm(e,t.payload.context);const{target:n}=t.payload;return!n||-1===n.indexOf(G.WORKAREA)&&-1===n.indexOf(G.MODAL)?e[t.payload.containerItemID]=t.payload.data:e[t.payload.context]=t.payload.data,Em(e,t.payload),Im(e,t.payload),ym(e,t.payload),((e,t)=>{const{context:n}=t;kh.deleteIn(e,[n,"context_data","blocking_action_counter"]),kh.deleteIn(e,[n,"context_data","deferred_action_queue"])})(e,t.payload),e}case Fe:{t.payload.doDeleteCaseSummary&&Sm(e,t.payload.context,{deleteAssignmentSpecificResources:t.payload.deleteAssignmentSpecificResources});const{target:n,propertiesToReplace:r=[]}=t.payload;return!n||-1===n.indexOf(G.WORKAREA)&&-1===n.indexOf(G.MODAL)?e[t.payload.containerItemID]=Mh(e[t.payload.containerItemID],t.payload.data,{propertiesToReplace:[...r]}):e[t.payload.context]=Mh(e[t.payload.context],t.payload.data,{propertiesToReplace:[...r]}),(t.payload.actionType||t.payload.assignmentID)&&Im(e,t.payload),Em(e,t.payload),ym(e,t.payload),_m(e,t.payload.suggestionContexts),e}case De:{const{childContainersContexts:n=[]}=t.payload;return((e,t)=>{const{containerItemID:n,context:r,deleteContext:s}=t;s&&kh.deleteIn(e,[r]),kh.deleteIn(e,[n])})(e,t.payload),Cm(e,n),Am(e,t.payload.transientItems),_m(e,t.payload.suggestionContexts),e}case Pe:{const{containerItems:n}=t.payload;return Array.isArray(n)?n.forEach((t=>{kh.deleteIn(e,[t])})):kh.deleteIn(e,[n]),e}case je:{const{context:n,contextToBeRemoved:r,data:s,childContainersContextsToBeRemoved:a}=t.payload;return Sm(e,t.payload.context),Em(e,t.payload),e[n]=Mh(e[n],e[r]),e[n]=Mh(e[n],s),kh.deleteIn(e,[r]),Cm(e,a),ym(e,t.payload),e}case Ve:{const{payload:{context:n,pulseReplace:r=!0,childContainersContexts:s=[]}}=t;let{payload:{data:a}}=t;const o=kh.getIn(e[n],"pulse");let i=kh.getIn(e[n],"OperatorID"),c=kh.getIn(e[n],"pxRequestor");return c&&a.pxRequestor&&(c=kh.mergeDeep(c,a.pxRequestor)),i&&a.OperatorID&&(i=kh.mergeDeep(i,a.OperatorID)),!r&&o&&(a=Lh(a,"pulse",o),a=Lh(a,"OperatorID",i),a=Lh(a,"pxRequestor",c)),kh.setIn(e,n,a),Em(e,t.payload),ym(e,t.payload),Cm(e,s),Am(e,t.payload.transientItems),_m(e,t.payload.suggestionContexts),e}case ut:{const{context:n,doDeleteConfirmationDetails:r=!0}=t.payload;return Sm(e,n,{doDeleteConfirmationDetails:r}),e}case be:{const{transientItemID:n,data:r}=t.payload;return kh.setIn(e,n,r)}case ve:case xe:{const{transientItems:n}=t.payload;return n.forEach((t=>kh.deleteIn(e,t))),e}case Oe:case we:{const{transientItemID:n,data:r}=t.payload;return Mh(kh.getIn(e,n),r),e}case Me:{const{transientItemID:n,data:r}=t.payload;for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&kh.deleteIn(e,[n,t]);return e}case Le:{const{transientItemID:n,data:r}=t.payload;return kh.deleteIn(e,n),kh.setIn(e,n,r)}case he:{const{key:n,value:r}=t.payload;return kh.setIn(e,`${G.SHARED}.${n}`,r),e}case Be:{const{context:n,data:r}=t.payload;return kh.setIn(e,n,r)}default:return e}})),Nm=(e,t)=>mm(e,(e=>{switch(t.type){case Ae:{const{propertiesToReplace:n=[],interestPath:r}=t.payload;if(r){const s=kh.getIn(e[t.payload.context],r),a=kh.getIn(t.payload.data,r),o=Mh(s,a,{isArrayDeepMerge:!0});wh(e[t.payload.context],[...n]),kh.setIn(e[t.payload.context],r,o)}else e[t.payload.context]=Mh(e[t.payload.context],t.payload.data,{isArrayDeepMerge:t.payload.isArrayDeepMerge,propertiesToReplace:[...n]});return Em(e,t.payload,!0),ym(e,t.payload),e}case re:{const{context:n,reference:r,value:s,isArrayDeepMerge:a}=t.payload;return Lh(e[n],r,s,{isArrayDeepMerge:a}),e}case se:{const{context:n,reference:r,value:s}=t.payload;return Uh(e[n],r,s),e}case _e:return vh(e[t.payload.context],t.payload.reference),e;case de:return kh.setIn(e[t.payload.context],"context_data.isLoading",!0),e;case pe:return kh.setIn(e[t.payload.context],"context_data.isLoading",!1),e;case it:{const{data:n}=t.payload;return ym(e,{data:{shared:n}}),e}case ct:{const{dataPagesToBeRemoved:n=[]}=t.payload;return n.forEach((t=>{const{dataPageName:n,dataPageNameWithHash:r}=t;kh.deleteIn(e.shared,[n,r]);const s=kh.getIn(e.shared,[n]);s&&0===Object.keys(s).length&&kh.deleteIn(e.shared,[n])})),e}case dt:{const n=kh.getIn(e[t.payload.context].context_data,"blocking_action_counter",0);return t.payload.isInitiateBlockingAction?kh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n+1):kh.setIn(e[t.payload.context].context_data,"blocking_action_counter",n-1),e}default:return e}})),Pm=/\[(\d+)\]$/gi,Rm=/(\d+)/gi,Dm=/\[.\]$/gi,bm=(e,t,n,r=[G.CONTEXT_DATA,G.CASE_INFO.CASE_INFO,G.CONTENT])=>{const s=kh.getIn(t,r);if(s){const t=rr(s,[],[]);for(const s of t)kh.setIn(e[n],[...r,...s],{})}},Om=(e,t,n,r)=>{const{property:s,pageReference:a,category:o,type:i}=r.payload,c=kh.getIn(e[t],n);if(c&&o===G.CASEMESSAGES)kh.setIn(e[t],Xn(s,a,o),"");else if(c&&c.length>0&&Array.isArray(c)){const r=c.filter((e=>e.type!==i));n&&n.length>0&&kh.setIn(e[t],Xn(s,a,o),r)}},vm=(e,t)=>{const{property:n,pageReference:r,category:s,isListEntry:a,deletingIndex:o,stateObj:i}=t.payload,{context:c}=t.payload;if(i)return bm(e,i,c),e;const l=Xn(n,r,s,a);if(Number.isInteger(o)){kh.deleteIn(e[c],l);const t=l.slice(0,l.length-1);let n=kh.getIn(e[c],t)||{};const r=(u=Object.keys(n),[...u].sort(((e,t)=>{const n=e.match(Pm),r=t.match(Pm);if(!n&&!r)return e.localeCompare(t);if(!n&&r)return-1;if(n?.length&&r?.length){const e=n[0].match(Rm),t=r[0].match(Rm);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(Pm);if(a?.length){const i=parseInt(a[0].match(Rm)[0],10);i>o&&(kh.deleteIn(e[c],t.concat(r[s])),kh.setIn(e[c],t.concat(r[s].replace(Dm,`[${i-1}]`)),n))}}))}else kh.setIn(e[c],l,{});var u;return e};function xm(e,t){const n=kh.getIn(e,t);return void 0!==n?.dataInfo?.content}function wm(e,t){let n=Kn.FIELD_MESSAGES_PATH;return xm(e,t)&&(n=Kn.DATA_OBJECT_FIELD_MESSAGES_PATH),n}const Mm=(e,t,n)=>{n.forEach((n=>{((e,t,n)=>{const r=kh.getIn(n,G.ERROR_FIELD_IN_PAGE).slice(1),s=kh.getIn(n,G.ERROR_IN_PAGE_IDENTIFIER).slice(1);if(s){let a="caseInfo.content";xm(e,t)&&(a="dataInfo.content");let o=r?`${a}.${r}`:a;o=o.replace(/\(/g,"[").replace(/\)/g,"]");const i=Xn(s,o,G.PROPERTY),c=kh.getIn(e[t],`${o}.classID`),l=Xp(s,c),u=PCore.getLocaleUtils(),d=`${l?.definedOnClassID||l?.classID}.${s}`,p={type:B.MESSAGES.MESSAGES_TYPE_ERROR,message:n.localizedValue,...l?.label&&{fieldLabel:u.getLocaleValue(l.label,d,u.FIELD_LABELS_BUNDLE_KEY)}},h=kh.getIn(e[t],i,[]);if(kh.isContains(h,p))return;kh.setIn(e[t],i,[...h,p])}})(e,t,n)}))};function Lm(e,t){const{err:n,formFields:r}=t.payload;let{context:s}=t.payload;const{fieldErrors:a,pageErrors:o}=Jc(n.errorDetails,r),i=wm(e,s);if(kh.setIn(e,[s,...i],{}),kh.setIn(e,[s,...Kn.PAGE_MESSAGES_PATH],[]),a.forEach((t=>{if(t[G.ERROR_FIELD_IN_PAGE]){const n=t[G.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=Xn(r,t,G.PROPERTY);kh.setIn(e,[s,...a],[])}}})),a.length>0&&Mm(e,s,a),o.length>0){const t=(e=>{const t=[];return e.forEach((e=>{t.push({type:B.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue})})),t})(o);e[s]||(s=G.APP.APP),kh.setIn(e,[s,...Kn.PAGE_MESSAGES_PATH],t)}else s.includes&&s.includes(Ed.WORKAREA)&&(s=K(s)),kh.deleteIn(e,[s,...Kn.PAGE_MESSAGES_PATH]);return e}const Um=(e,t)=>mm(e||Wm().data,(e=>{switch(t.type){case Te:return t.payload.err.errorDetails&&("Validation fail"===t.payload.err.errorClassification||(t.payload.err?.displayButtonsOnErrors?.length??0)>0)?Lm(e,t):e;case Fe:{const{context:n}=t.payload,r=[n,...wm(e,n)],s=[n,...Kn.PAGE_MESSAGES_PATH];if(kh.setIn(e,r,{}),kh.setIn(e,s,[]),n&&n.includes(Ed.WORKAREA)){const t=[te(n),...Kn.PAGE_MESSAGES_PATH];kh.setIn(e,t,[])}return e}case st:{const{isListEntry:n}=t.payload;return n?vm(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 bm(e,o,i),e;const l=Xn(n,r,s,a);return s===G.PAGE&&i?.includes(Ed.WORKAREA)&&(c=K(i)),Om(e,c,l,t),Om(e,i,l,t),e})(e,t)}case rt:{const{messages:n,property:r,pageReference:s,context:a,category:o}=t.payload,i=Xn(r,s,o);return n&&n.length>0&&Array.isArray(n)&&i&&i.length>0&&kh.setIn(e[a],Xn(r,s,o),n),e}default:return e}})),Fm=(e,t)=>mm(e,(e=>{if(t.type===lt){const{instruction:n,actions:r,context:s,referenceList:a,listIndex:o,listMoveToIndex:i,content:c={}}=t.payload,l=Ah(a);switch(n){case G.LIST_ACTIONS.INSERT:((e,t,n,r,s)=>{kh.setIn(e[t],[...n,r],s)})(e,s,l,o,c);break;case G.LIST_ACTIONS.UPDATE:((e,t,n,r,s)=>{const a=Mh(kh.getIn(e[t],[...n,r],{}),s);kh.setIn(e[t],[...n,r],a)})(e,s,l,o,c);break;case G.LIST_ACTIONS.DELETE:((e,t,n,r)=>{const s=kh.getIn(e[t],n,[]);s.splice(r,1),kh.setIn(e[t],n,s),Mn.deleteListNode(t,n,s.length)})(e,s,l,o);break;case G.LIST_ACTIONS.MOVE:((e,t,n,r,s)=>{const a=kh.getIn(e[t],[...n,r],{}),o=kh.getIn(e[t],n,[]);o.splice(r,1),o.splice(s,0,a),kh.setIn(e[t],n,o),Zn(e,t,n?.join("."),r,s)})(e,s,l,o,i);break;case G.LIST_ACTIONS_TYPE.SELECT_DESELECT:((e,t,n,r)=>{const s=kh.getIn(e[t],n)||[];r.forEach((e=>{const{instruction:r,content:a,listIndex:o}=e;if(r===G.LIST_ACTIONS.SELECT){s[o]=a;const e=n?.join(".");Cr(t,e)}else delete s[o]})),kh.setIn(e[t],n,s.filter(Boolean))})(e,s,l,r);break;case G.LIST_ACTIONS_TYPE.DESELECT_ALL:((e,t,n)=>{kh.setIn(e[t],n,[])})(e,s,l);break;case G.LIST_ACTIONS.REPLACE:((e,t,n,r)=>{kh.setIn(e[t],n,r)})(e,s,l,c);break;case G.LIST_ACTIONS.DELETE_PAGE:((e,t,n)=>{kh.setIn(e[t],n,{})})(e,s,l)}}return e})),jm=[Nm,Tm,Um,Fm],Vm=(e,t)=>(e||(e=Wm().data),t.type===at?Wm().data:(jm.forEach((n=>{e=n(e,t)})),e)),km=(e,t=[])=>{t.forEach((t=>{kh.deleteIn(e,[t])}))},$m=(e,t)=>{const{type:n,payload:r}=t,s=n===Fe,{target:a,context:o,semanticURL:i="",root:c,containerItemID:l,childContainers:u,flowName:d,resourceType:p="",key:h="",clearView:g=!1}=r;return c?kh.setIn(e,[a,"items",l,"view"],c):g&&kh.deleteIn(e,[a,"items",l,"view"]),o&&kh.setIn(e,[a,"items",l,"context"],o),d&&kh.setIn(e,[a,"items",l,"flowName"],d),(!s||s&&h)&&kh.setIn(e,[a,"items",l,"key"],h.trim()),((e,t,n,r)=>{""===e&&kh.deleteIn(t,[n,"items",r,"key"])})(h,e,a,l),(!s||s&&i)&&kh.setIn(e,[a,"items",l,"semanticURL"],i),(!s||s&&p)&&kh.setIn(e,[a,"items",l,"resourceType"],p),km(e,u),e},Bm=(e,t)=>(e||(e=Wm().containers),t.type===at?Wm().containers:mm(e,(e=>{switch(t.type){case Ne:{const{context:n,name:r,type:s,actionMgrID:a}=t.payload,o=`${n}/${r}`;let i=null;return yn.resolveActionByID(a,null,!1),e[o]?e:(i={type:s,accessedOrder:[],items:{}},kh.setIn(e,[o],i),e)}case $e:{const{containerName:n,childContainers:r=[]}=t.payload;return kh.deleteIn(e,[n]),r.forEach((t=>{kh.deleteIn(e,[t])})),e}case Pe:{const{context:n,name:r,actionMgrID:s,childContainers:a}=t.payload,o=`${n}/${r}`;return yn.resolveActionByID(s,null,!1),kh.setIn(e,[o,"accessedOrder"],[]),kh.setIn(e,[o,"items"],{}),Array.isArray(a)&&a.forEach((t=>{kh.deleteIn(e,[t])})),e}case Re:{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],P=N&&N.type,R=N&&N.accessedOrder||[],D=N&&N.items||{};let b=null;return e[n]&&"single"===P&&R.length>0?$m(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:E,...I&&{actionID:I},..._&&{acTertiary:_},...A&&{isMultiRecordData:A},...C&&{parentContext:C},heading:S}}},yn.resolveActionByID(l,null,!1),e[n]=j()(e[n],b),e)}case Fe:{const{actionMgrID:n,data:r}=t.payload;let s=e;try{s=$m(e,t),yn.resolveActionByID(n,r,!1)}catch{yn.rejectActionByID(n,!1)}return s}case Ve: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],kh.setIn(e,[s,"items",a,"transientItems"],[]),kh.setIn(e,[s,"accessedOrder"],c),o=$m(e,t),yn.resolveActionByID(n,r,!1)}catch{yn.rejectActionByID(n,!1)}return o})(e,t);case Ue:{const{target:n,containerItemID:r,actionMgrID:s}=t.payload;try{const t=kh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));t.push(r),kh.setIn(e,[n,"accessedOrder"],t),yn.resolveActionByID(s,null,!1)}catch{yn.rejectActionByID(s,!1)}return e}case je:case De:{const{target:n,containerItemID:r,actionMgrID:s,childContainers:a}=t.payload;try{const t=kh.getIn(e,[n,"accessedOrder"]).filter((e=>e!==r));kh.setIn(e,[n,"accessedOrder"],t),kh.deleteIn(e,[n,"items",r]),km(e,a),yn.resolveActionByID(s,null,!1)}catch{yn.rejectActionByID(s,!1)}return e}case be:{const{transientItemID:n,target:r,contextName:s}=t.payload,a=kh.getIn(e,[r,"items",s,"transientItems"])??[];return kh.setIn(e,[r,"items",s,"transientItems"],[...a,n])}case xe:{const{target:n,containerItemID:r}=t.payload;return kh.deleteIn(e,[n,"items",r,"transientItems"]),e}case ve:{const{target:n,transientItemID:r,containerItemID:s}=t.payload,a=(kh.getIn(e,[n,"items",s,"transientItems"])??[]).filter((e=>e!==r));return kh.setIn(e,[n,"items",s,"transientItems"],a)}default:return e}})));let Gm={};const Wm=()=>Gm,Hm=e=>((e=>{const t=e.Data||e.data,{uiResources:n={}}=e,r=n[G.CONTEXT_DATA]||e[G.CONTEXT_DATA];Gm={data:{[G.APP.APP]:{...t,[G.CONTEXT_DATA]:r}},containers:{}}})(e),pf({data:Vm,containers:Bm}));function qm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=du(e),r=function(e,t){return"number"==typeof uu(e)?e.pop():t}(e,1/0),s=e;return s.length?1===s.length?ci(s[0]):function(e){return void 0===e&&(e=1/0),cu(Jo,e)}(r)(Ei(s,n)):gu}const zm=(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}},Ym=(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 zm(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[B.ACTIONS.DELETEAVIALACTIONS]&&delete n.data.caseInfo.availableActions,zm(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},Km={},{VIEW:Xm,FIELD:Jm}=G.CONTEXT_TREE_NODE_TYPES,Qm=e=>(e=>Vi[e])(e)>0&&Km[e],Zm=[(e,t)=>e.pipe(au(Ln.REFRESH_DATA,At),iu((e=>e.payload)),cu((e=>{const{context:n,contextData:r,options:s}=e,{propertyName:a="",classID:o=""}=s,i=qc(n,{skipUUID:!1});let c=[],l=[],u=!1;Dp.getFeatureMap().granularUIRefresh?(({fieldsWithDeclarativeTargets:c=[],whens:l=[]}=qn(n)),u=l.some((e=>e.type===Xm))):u=!0;const d=l.filter((e=>e.type===Jm)),p=kh.getPropertyName(a),h=p?p.split("."):[],g=h.pop(),f=h.join("."),m=[];if(f){const e=Xp(f,o);if(e&&"copy"===e.dataRetrievalType){const e=kh.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=dl(n);kh.isEmpty(E)||(y=ul(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=Ln.REFRESH;return r?(l=Wg(Ln.REFRESH_CASE_VIEW,e),d={...d,interestPage:i}):o&&n?l=Wg(Ln.REFRESH_CASE_DATA,e):o&&!n?l=Wg(Ln.REFRESH_ASSIGNMENT_DATA,e):(s.length>0||a.length>0)&&(d={...d,calculations:{fields:s,whens:a}},l=Wg(n?Ln.RECALCULATE_CASE_DATA:Ln.RECALCULATE_ASSIGNMENT_DATA,e),p=Ln.RECALCULATE),{restAPI:l,requestBody:d,requestType:p}})({...e,fieldsWithDeclarativeTargets:c,fieldsWithWhen:d,isViewsWithWhen:u},y);rn.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 Ei(((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),Qm(r)){const t=[];for(let n=0;n<Km[r].length;){const s=Km[r][n],a=zn(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=>{Km[r].splice(e,1)}))}const s=Xi();return e.signal=s.token,e.cancelConfig=s,Km[r]?Km[r].push(e):Km[r]=[e],zi(e.url,e,n,{cancelContext:r}).then((e=>(delete Km[r],e))).catch((e=>{throw e&&"ERR_CANCELED"!==e.code&&delete Km[r],e}))})({reqHeaders:N,context:n,method:S,body:_,url:Hn(e,T)},e)).pipe(iu((t=>({response:{...t.data||{}},actionConfig:e,actionMgrID:e.options.actionMgrID,headers:Hc(t.headers)}))),mu(": Error occurred during fetch call at refreshData Epic : ",e.context,e?.options?.actionMgrID))})),cu((async e=>{if(e&&e.type===Te)return rn.deRegisterBlockingAction(e.payload?.context).catch((()=>{})),Qc(e);const{actionConfig:t,response:n,actionMgrID:r}=e,{context:s,serverPrecedenceFields:a,requestType:o}=t,i=yc.getTargetViewContainerName(Ge),c=Ct(i,s),l={acName:c,context:s},u=Ym(n,{[B.STOPMERGEACTIONS]:!0,[B.ACTIONS.DELETEAVIALACTIONS]:!0});u.directUrlUpdation=!1,o===Ln.REFRESH&&await Yc(u,t,l);const d={target:c,context:s};let p=gl.getStateMachinesByContext(s)||{};const h=zc(u,d);t.interestPage&&(h.interestPath=`caseInfo.content${kh.convertClipboardPageToPageRefNotation(t.interestPage)}`),p={...p,...gl.getUnConnectedStateMachines(s)||{}},Object.keys(p).forEach((e=>{if(kh.hasIn(h.data,e)){const t=kh.getIn(h.data,e),n=Rh(e,void 0,s),r=Mn.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)&&gl.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=$c.getPropertiesToReplace(s),f=Sg(Xh,h,{serverPrecedenceFields:a,propertiesToReplace:g});return gl.registerForServerChanges(),Sh(f),yn.resolveActionByID(r,h),gl.unRegisterForServerChanges(),rn.deRegisterBlockingAction(s).catch((()=>{})),[]})))],ey=Zm,ty=[e=>e.pipe(au(ot),cu((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===G.READONLY&&a?.refreshStrategy){const{timeoutSecs:e="",type:t=""}=a?.refreshStrategy||{},n=Nh()[a.name];if(n&&s in n){const r=n[s],{loadTime:a}=r;if(!Nu.isTimeElapsed(a,e,t))return}}return Nu.getData(a.name,{dataViewParameters:a.dataViewParameters},t).then((e=>{const t=a.mode===G.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(Xh({context:t,data:n})),Object.keys(r).length&&a.push(Ng({data:r,context:t})),Sh(a),[]})))],ny=ty;class ry{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 ry.DISPLAY_DIRTY_POPUP:this.broadcastEventToIframe=e.data.fromInfinity,this.isDirtyDialogActive||(e.data.isFormDirty?(Ci.publish(G.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:!0,hideDelete:!0}),this.isDirtyDialogActive=!0):this.callback?.call(this));break;case ry.LOAD_PREVIEW:this.loadPreview(e);break;case ry.UPDATE_COEXISTENCE_DRILLDOWN_CASE:this.updateCoexistenceDrilldownCase(e);break;case ry.OPEN_ASSIGNMENT_ACTION:this.openAssignment(e);break;case ry.GET_NEXT_WORK_ACTION:this.getNextWork(e);break;case ry.OPEN_WORK_BY_HANDLE:this.openWorkByHandle(e);break;case ry.CLOSE_CONTAINER_ACTION:this.closeContainer(e)}}};loadPreview=e=>{const{pyID:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){hd({}).getPConnect().getActionsApi().showCasePreview(t,{caseClassName:n})}};navigateToDefaultPage=()=>{const e=hd({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===ry.OPEN_WORK_ITEM&&(o=ry.OPEN_WORK_BY_HANDLE),Rp.updateSemanticURLAndDocumentTitle({key:t,caseClassName:n,actionName:o});hd({}).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=`${B.APP.APP}${G.FORWARD_SLASH_STRING}${B.PRIMARY}`;hd({meta:{},options:{context:Ld(e)}}).getPConnect().getActionsApi().getNextWork()}};openWorkByHandle=e=>{const{key:t,caseClassName:n,uniqueId:r}=e.data;if(r===this.getUniqueId()){const e=`${B.APP.APP}${G.FORWARD_SLASH_STRING}${B.PRIMARY}`;hd({meta:{},options:{context:Ld(e)}}).getPConnect().getActionsApi().openWorkByHandle(t,n)}};destroyBroadcastChannel=()=>{this.getBroadCastChannel()?.close(),this.broadcastChannel=null};subscribeEvents=()=>{this.setReverseCoexistenceCaseLoaded(!0),Ci.subscribe(B.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.HANDLE_DISCARD,this.handleDiscard),Ci.subscribe(B.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY,this.postDirtyPopupMessage)};unsubscribeEvents=()=>{Ci.unsubscribeAllWithEventType(B.PUB_SUB_EVENTS.REVERSE_COEXISTENCE_EVENTS.CHECK_IS_FORM_DIRTY),Ci.unsubscribeAllWithEventType(B.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:ry.DIRTY_POPUP_C11N,uniqueId:this.getUniqueId()}),this.setCallBackFunction(e)};handleDiscard=()=>{this.broadcastEventToIframe?(this.broadcastChannel?.postMessage({action:ry.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:ry.OPEN_ASSIGNMENT_MODAL,uniqueId:this.getUniqueId(),key:e}),this.broadcastEventToIframe=!1,this.onCreateCallback=t,this.openAssignmentParams=n}}const sy=new ry,ay="nextAssignmentInfo",oy="nextAssignmentInfo.context",iy=e=>{const{containerName:t,isInCreateStage:n}=e;return n?G.MODAL:t||yc.getTargetViewContainerName(Ke)},cy=e=>{const t=kh.getIn(e,[G.DATA,G.CASE_INFO.CASE_INFO]);return ln(t)&&un(Dp.getOperatorIdentifier(),t)},ly=(e,t)=>{const{class:n,context:r,viewType:s=Gc.PAGE}=e,{removeActionPayload:a}=t;let o=e?.pageName?e?.pageName:Dp.getDefaultCasePage();return e.isTraditionalUICase&&(o="pyDetails"),Ei(rc.createCase(n,{...e,pageName:o,viewType:s,context:r})).pipe(iu((({response:t,headers:n})=>({response:t,actionInPayload:e,headers:n,removeActionPayload:a}))),mu("Error occurred during ajax call at createWork Epic : ",r))},uy=e=>{Ci.publish(G.PUB_SUB_EVENTS.DISPLAY_CASE_CREATED_TOASTER,e)},dy=e=>{Ci.publish(G.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)},py=e=>{let t=0,n=[],r="",s=!1;return e.pipe(au(zh),yu(100),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>{const{context:n}=e,r=iy(e),a=Ct(r,n),{continueExecution:o,removeActionPayload:i}=(e=>kd(e)?{continueExecution:!0,removeActionPayload:{}}:rl(e))(a);return s=Fc(e.class),o?(e.isTraditionalUICase=s,ly(e,{removeActionPayload:i})):(yn.rejectActionByID(t),fu())})),cu((async e=>{if(e&&e.type===Te)return e.payload.context=up(),n.push(Qc(e)),n;const{actionInPayload:a,response:o,headers:i,removeActionPayload:c}=e;let l;l=!(a.renderInline||Dp.getDefaultCasePage()||s)&&cy(o),kh.setIn(o.data,B.CASE_INFO.IS_FIRST_ASSIGNMENT,!0);const u=iy({...a,isInCreateStage:l}),d=Ct(u,a.context),p=el(d,u,a.context);if(!Sc(u)&&kd(d)){const{continueExecution:e}=rl(d);if(!e)return yn.rejectActionByID(t),fu()}if(!(a?.openCaseViewAfterCreate??!0)&&!l){const e=kh.getIn(o.data,B.CASE_INFO.CASE_INFO_CONTENT);r=`${e.pyID} ${vp.getLocaleValue("has been created.","Assignment")}`;const t=vc(o),s=Dc(o);return uy({toastMessage:r}),dy({caseId:`${e.pyID}`,assignmentId:t,caseType:s}),n}const h=Ym(o);let g=Bg("createWork",{caseClassName:Dc(h)});g=g.replace(/{.+?}/,String(Rc(Oc(h)))),h.semanticURL=g,((e,t)=>{const n=cy(e),{skipBrowserSemanticUrlUpdate:r=!1,isTraditionalUICase:s}=t;kh.setIn(e,["directUrlUpdation"],(!n||s)&&!r)})(h,a);const f={acName:d,context:p},m=kc(p);await Yc(h,a,f);const y={target:d,context:p,containerItemID:p,headers:i,semanticURL:g,isInCreateStage:l,isMinimizable:l,caseViewMode:h.confirmationNote?G.REVIEW_MODE:G.PERFORM_MODE,currentCaseViewMode:m,assignmentContext:kh.getIn(h,oy),nextAssignmentInfo:kh.getIn(h,ay),resourceType:B.CASE,openCaseViewAfterCreate:a.openCaseViewAfterCreate,modalOptions:a.modalOptions,debugInfo:a.debugInfo};Mc(y,h);const E=zc(h,y);s&&(E.data.caseInfo.content.coexistenceAction="openAssignment");const I=Zc(d,E);return tl(I)&&xc(n,{removeActionPayload:c,target:d}),n.push(I),ol(n),n})),iu((()=>{const e=jc(),a=ln(kh.getIn(n[0]?.payload,"data.caseInfo"));return s&&e&&a?sy.postCreateCaseMessage(n[0]?.payload?.nextAssignmentInfo?.ID,ll,n):ll(n),Uc(n,t),r="",n=[],n})))},{RESOURCE_TYPES:hy}=B,gy=(e,t=[])=>{const{viewType:n,containerName:r,targetContainerName:s,isChild:a}=e,o=Pc(t);return(e=>{if(e){const{stageID:t,stages:n=[]}=e,r=n.length;for(let e=0;e<r;e+=1)if(n[e].ID===t)return"manual"===n[e].transitionType}return!1})(o)&&e?.stageID===o.stageID?Gc.PAGE:n||(!Cc(r)&&!Cc(s)||a?Gc.PAGE:Gc.FORM)},fy=(e,t,n,r,s)=>{if(xc(e,{removeActionPayload:t,target:n}),((e,t)=>{const n=vd(t);let r=null;return n&&(r=_d(t,n)),r?.key===e&&$d(t)})(r.key,n))r.context=Ld(n),r.containerItemID=r.context,e.push(Sg(Ig,r));else if((s?.isChild||s?.isRemote)&&s?.isMultiDoc){const t=Kd(s.context);r.target=t,r.context=s.context,r.containerItemID=s.context,e.push(Sg(Ig,r))}else{const t=Kd(r.context),n=Pd(t,r.key);n?(r.target=t,r.context=n,r.containerItemID=n,e.push(Sg(Ig,r))):e.push(Sg(sg,r))}},my=(e,t,n,r,s,a,o)=>{kd(t)&&Bd(t)?((e,t,n,r,s)=>{gy(e,t)===Gc.FORM?(n.caseViewMode=r||G.PERFORM_MODE,s.push(Sg(ug,n))):s.push(Sg(Ig,n))})(r,s,e,a,n):fy(n,o,t,e,r)},yy=({restUrl:e,reqType:t,requestHeaders:n,debugInfo:r,context:s,isGetNextWork:a,doNotMergeMessagesForStatusCode:o})=>zi(e,{method:t,headers:{"if-match":n&&n.etag,...n,...r&&{...Fi.addDebugHeaders(r)}}},s,{doNotMergeHttpMessagesForStatusCode:a?o:""}),Ey=(e,t)=>{const n=gy(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?Wg("getNextWork",{viewType:n}):c?Wg("openStage",{caseID:u,stageID:l}):Wg(Ye,{assignmentID:a,viewType:n}),{removeActionPayload:f}=t,m=Dp.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=Hc(t,e.remoteClassName)),t})(e);return Ei(yy({restUrl:y,reqType:g,requestHeaders:I,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"})).pipe(iu((e=>{if(Dp.isCoexistenceAppOfType(G.APP_TYPE.UIKIT)&&!p){return ln(e.data.data.caseInfo)?e:(y=y.replaceAll(E,"pyDetails"),Dp.setDefaultCasePage("pyDetails"),{isReloadWithDifferentViewTypeRequired:!0,restUrl:y})}return e})),cu((e=>e?.isReloadWithDifferentViewTypeRequired?yy({restUrl:y,reqType:g,requestHeaders:I,debugInfo:i,context:s,isGetNextWork:o,doNotMergeMessagesForStatusCode:"404"}):pu(e))),iu((t=>{const{key:s,flowName:o}=Xc(a);return{response:{...t.data,key:s,flowName:o},actionInPayload:e,viewType:n,removeActionPayload:f,headers:Hc({...r,...t.headers})}})),mu("Error occurred during ajax call at openAssignment Epic : ",s))},{RESOURCE_TYPES:Iy}=B,Ay=e=>{const t="Browser"===Dp.getRuntime();let n=0,r=[];const s=[];let a=!1,o=!1;return e.pipe(au(Ql),iu((e=>(({actionMgrID:n}=e.payload),{...e.payload,...t?{insKey:e.payload.assignmentID}:{assignmentID:e.payload.assignmentID}}))),cu((e=>{a=e.isGetNextWork;const{context:t}=e;let r;r=(e?.isChild||e?.isRemote)&&e?.isMultiDoc?Gc.FORM:gy(e),e.viewType=r;const s=Ac(Ye,e),i=Ct(s,t),{activate:c,activateContainerActionPayload:l}=al(Iy.ASSIGNMENT,i,e);if(c&&!e.isParallelCall)return pu({type:Ue,activateContainerActionPayload:l,actionInPayload:e});const u=vd(i);let d;d=l?.isParallelAssignment?{continueExecution:!0,removeActionPayload:{}}:u?rl(i):{continueExecution:!0,removeActionPayload:{}};const{continueExecution:p,removeActionPayload:h}=d;return p?(o=Fc(e.className),e.isTraditionalUICase=o,Ey(e,{removeActionPayload:h})):(yn.rejectActionByID(n),fu())})),cu((async e=>{if(e?.type===Te){if(a){const{payload:t}=e,{err:n}=t,r=n.response.status;s.push({status:Number(r)})}return r.push(Qc(e)),r}const{type:t,actionInPayload:n,response:i,viewType:c,headers:l,removeActionPayload:u,activateContainerActionPayload:d}=e;if("openStage"===i?.redirectInfo?.jsAction){const e=i?.redirectInfo?.stageID,t=Ql,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=Pc(e);let r;r=!Dp.getDefaultCasePage()&&ln(n);const{isChild:s,containerName:a}=t,o=s&&r,i=r&&!t.isActionFromToDoList;return o||i?G.MODAL:a||Ac(Ye,t)})(i,n);o=Fc(i?.data?.caseInfo?.caseTypeID),n.isTraditionalUICase=o,o&&(f=n.containerName);const m=Ct(f,p);if(t===Ue)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=Md(s);await Yc({directUrlUpdation:!l,semanticURL:r},c,{acName:i,target:i,context:u}),e.push(Sg(gg,{containerItemID:s,target:i,isParallelAssignment:a,insKey:o,resourceType:hy.CASE,context:u,doDeleteCaseSummary:c.doDeleteCaseSummary}))})(r,d,{actionInPayload:n,target:m}),ol(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&&(kh.setIn(y,"pyViewName",E),kh.setIn(y,"pyViewContext",I));const A=Ym(i);((e,t)=>{const n=Pc(e),r=Oc(e),s=ln(n),{skipBrowserSemanticUrlUpdate:a=!1,viewType:o,isTraditionalUICase:i}=t,c=o===Gc.PAGE&&(!s||i)&&!a,{caseTypeID:l}=n;if(c){const t=Bg(ze,{caseClassName:l}).replace(/{.+?}/,String(Rc(r)));e.semanticURL=t,e.directUrlUpdation=!0}})(A,n);const _=el(m,f,p),C={acName:m,target:m,context:_};await Yc(A,n,C);const S={target:m,context:_,containerItemID:_,headers:l,parentContext:K(n?.context),isMinimizable:ln(kh.getIn(A,"data.caseInfo")),doDeleteCaseSummary:n.doDeleteCaseSummary,acTertiary:n.acTertiary,resourceType:B.ASSIGNMENT,debugInfo:g};Mc(S,A,{skipFlowNameUpdate:n?.caseViewMode===G.REVIEW_MODE});const T=zc(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),my(T,m,r,n,i,h,u),c===Gc.FORM&&wc(T.containerItemID)&&cl(T,r),ol(r),(e=>{Ci.publish(G.PUB_SUB_EVENTS.CASE_EVENTS.ASSIGNMENT_OPENED,e)})({actionInContext:p,assignmentID:n.assignmentID,caseKey:T.key}),r})),iu((()=>{const e=n,t=jc(),a=ln(kh.getIn(r[0]?.payload,"data.caseInfo"));return o&&t&&a?sy.postCreateCaseMessage(r[0]?.payload?.data?.caseInfo?.assignments?.[0]?.ID,Sh,r):Sh(r),Uc(r,e,s),r[0]?.payload?.isParallelAssignment&&Sh({type:Ql,payload:{...r[0].payload,isParallelCall:!0}}),r=[],r})))},_y=(e,t)=>{const{insKey:n,headers:r,context:s,debugInfo:a,viewType:o}=e,{removeActionPayload:i}=t,c=e?.pageName?e?.pageName:Dp.getDefaultCasePage(),l=Wg(ze,{caseID:n,params:{pageName:c}});let{restApi:u}=l;const{reqType:d}=l;return"none"===o&&(u=`${u?.split("viewType")[0]}viewType=none`),Ei(zi(u,{method:d,headers:{...r,...a&&{...Fi.addDebugHeaders(a)}}},s)).pipe(iu((t=>({response:t.data,actionInPayload:e,headers:Hc({...r,...t.headers}),removeActionPayload:i}))),mu("Error occurred during ajax call at openWorkByHandle Epic : ",s))},Cy="OPEN_WORK_BY_HANDLE",{RESOURCE_TYPES:Sy}=B,Ty=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=Ac(ze,r),h=Ct(p,l);if(a===Ue)await(async(e,t)=>{const{activateContainerActionPayload:{semanticURL:n,containerItemID:r},actionInPayload:s,actionInPayload:{context:a,skipBrowserSemanticUrlUpdate:o,doDeleteCaseSummary:i}}=t,c=Ac(ze,s),l=Ct(c,a),u=Md(r);await Yc({directUrlUpdation:!o,semanticURL:n},s,{acName:l,containerName:c,target:l,context:u}),e.push(Sg(gg,{containerItemID:r,target:l,context:u,doDeleteCaseSummary:i}))})(t,{activateContainerActionPayload:s,actionInPayload:r});else{const s=el(h,p,l,{buildNew:!0}),a=Ym(o),g=((e,t)=>{const{isRemoteCase:n,remoteCaseClass:r}=t,s=Oc(e),a=n?r:Dc(e);let o=Bg(ze,{caseClassName:a},{id:t?.insKey});return o=o?.replace("{workID}",String(Rc(s)))?.replace("{id}",t?.insKey),o})(a,r);a.semanticURL=g,a.directUrlUpdation=!u;const f={acName:h,context:s};await Yc(a,r,f);const m=zc(a,{target:h,context:s,containerItemID:s,semanticURL:g,headers:c,debugInfo:d});m.caseViewMode=G.REVIEW_MODE,m.resourceType=Sy.CASE,n&&(m.data.caseInfo.content.coexistenceAction="openWorkByHandle"),Mc(m,a,{skipFlowNameUpdate:!0}),m.currentCaseViewMode=kc(e?.actionInPayload?.context);const y=Zc(h,m);i.containerItemID&&tl(y)&&t.push(Sg(mg,{containerItemID:i.containerItemID,target:h})),t.push(y)}ol(t);(e=>{Ci.publish(G.PUB_SUB_EVENTS.CASE_EVENTS.CASE_OPENED,e)})({caseKey:r.insKey,actionInContext:l})},Ny=e=>{let t=0,n=[];return e.pipe(au(Cy),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>{const{context:n,isChild:r,viewType:s}=e,a=Ac(ze,e),o=Ct(a,n);let i,c=!0;if("none"!==s){const e=rl(o);c=e.continueExecution,i=e.removeActionPayload}if(!c)return yn.rejectActionByID(t),fu();const{activate:l,activateContainerActionPayload:u}=al(Sy.CASE,o,e);return l&&!r&&"none"!==s?pu({type:Ue,activateContainerActionPayload:u,actionInPayload:e}):_y(e,{removeActionPayload:i})})),cu((async e=>{if(e&&Tc(e.type))return n.push(Qc(e)),n;const t=Th(e?.actionInPayload?.context),r=Fc(e?.actionInPayload.className);if("none"===e?.actionInPayload?.viewType){if("perform"!==t?.context_data?.caseViewMode){const t=Ym(e?.response),s={data:{...t?.data},context:e?.actionInPayload?.context,isArrayDeepMerge:!0};n.push({type:ut,payload:{context:s.context,doDeleteConfirmationDetails:!1}}),r&&s.data.caseInfo?.content&&(s.data.caseInfo.content.coexistenceAction="openWorkByHandle"),n.push(Sg(Xh,s));const a=Kd(e?.actionInPayload?.context),o=_c(e?.actionInPayload?.context),i=Object.freeze({target:a,containerItemID:e?.actionInPayload?.context,context:e?.actionInPayload?.context,containerName:o});if(wc(e?.actionInPayload?.context)){const t=zc(e?.response,{...i});cl({...t,isArrayDeepMerge:!0},n)}}}else await Ty(e,n,r);return n})),iu((()=>(Sh(n),Uc(n,t),n=[],n))))},Py="FINISH_ASSIGNMENT",{RESOURCE_TYPES:Ry}=B,Dy=(e,t)=>{const{containerItemID:n,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}=t,o=Md(n),i=`${o?.includes("root")?G.APP.ROOT:G.APP.APP}/${Ed.MODAL}`;e.push(Sg(mg,{containerItemID:n,context:o,target:i,skipReleaseLockRequest:r,isInCreateStage:s,isProcessAction:a}))},by=e=>Rh(".openCaseViewAfterCreate",G.CONTEXT_DATA,e)??!0,Oy=async(e,{translatedDXAPIResponse:t,actionInPayload:n},r,s)=>{const{caseID:a}=n,o=(i=t,kh.getIn(i,Ic.NEXT_ASSIGNMENT_INFO_ID,G.EMPTY_STRING));var i;const c=Dc(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}),Dy(e,{...n,skipReleaseLockRequest:!0});const y=`${n?.containerItemID.includes("root")?G.APP.ROOT:G.APP.APP}/${Ed.PRIMARY}`,E=el(y,Ed.PRIMARY),I=Fi.getCoreHeadersFromContext(n.context)||!1,A=zc(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[G.COREHEADER_APP_DEBUG_ID]}});if(kd(y)){const t=Th(E),s=Oc({data:t}),[,a]=s?s.split(" "):[],o=`You will lose unsaved changes for ${a}. Do you want to continue?`;if(!by(n.context))return e;{const{continueExecution:t}=rl(y,{dirtyMessage:o});if(!t)return r.directUrlUpdation=!1,yn.rejectActionByID(p),fu();A.currentCaseViewMode=kc(A?.context),e.push(Sg(Ig,A))}}else e.push(Sg(sg,A));return t.directUrlUpdation=h,t.semanticURL=d,await Yc(t,{...A,acName:y},{acName:y,context:E}),e},vy=e=>/^app\/preview_[0-9]*/g.test(e),xy=(e,t)=>{const n=K(e);return!vy(e)&&(n===t||/^app\/primary_[0-9]*/g.test(n))},wy=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=Th(e),r=c?.response?.data?.caseInfo?.assignments??[],s=n?.caseInfo?.assignments??[],a=kc(e)===G.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=kd(Kd(e));let d=!1;const p=Kd(n),h=Ad(p),g=vd(p);g&&h?.items?.[g]?.key===c?.actionInPayload?.caseID&&(d=!0),Dy(s,{...r,skipReleaseLockRequest:!0});const f=_c(e),m={target:Kd(e),containerItemID:e,context:e,containerName:f};t.doDeleteCaseSummary=r.doDeleteCaseSummary;const y=te(n),E=Th(y),I=Th(r.context),A=E?.caseInfo?.ID,_=I?.caseInfo?.ID,C=Th(e)?.caseInfo?.ID;if(u&&A===_||!u&&(""===o||m.containerItemID.includes(G.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(G.WORKAREA)&&t.caseViewMode===G.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(Sg(ug,{...t,key:o,resourceType:"",...m}));else if(a){const a=Kd(e),i=Pd(a,o);if(i)m.target=a,m.context=i,m.containerItemID=i,s.push(Sg(ug,{...t,key:o,resourceType:"",...m}));else{const e=Fd(n)[0];if(r.target=e,r.context=el(e,G.WORKAREA,n),r?.context){r.containerItemID=r.context,s.push(Sg(sg,{...r,...t}));const n=r.containerItemID;s.push(Sg(gg,{parentContainerTarget:e,containerItemID:n}))}}}if(r.target=Kd(e),r.containerName=_c(e),r.context=e,r.containerItemID=e,kh.setIn(t,"acName",m.target),await Yc(i,t),d){const{data:e,caseViewMode:r}=t;n.includes(G.WORKAREA)&&wc(n)&&(n=te(n));const a={data:e,caseViewMode:r,context:n};kh.setIn(a.data,["context_data","caseViewMode"],r),s.push({type:ut,payload:{context:n}}),s.push(Sg(Xh,a))}if(!a&&t.caseViewMode===G.PERFORM_MODE){const t=((e,t)=>{const n=Kd(e);return Pd(n,t)})(e,o),n={data:{caseInfo:{headers:l}},context:t};s.push(Sg(Xh,n)),s.push(Un(((e,t=!1,n=!1)=>{const r=yn.getNextActionMgrId();return{ID:Wh.getPropertyValue(B.CASE_INFO.ASSIGNMENT_ID,"",e),actionID:Wh.getPropertyValue(B.CASE_INFO.ASSIGNMENTACTION_ID,"",e),context:e,caseWideAction:t,contextData:n,options:{actionMgrID:r}}})(t)))}}else{Dy(s,r);let e=!1;const o=Kd(n),i=Ad(o),l=vd(o);if(l&&i?.items?.[l]?.key===c?.actionInPayload?.caseID&&(e=!0),a){const e=Fd(n)[0];r.target=e,r.context=el(e,G.WORKAREA,n),r.containerItemID=r.context,s.push(Sg(sg,{...r,...t}));const a=r.containerItemID;s.push(Sg(gg,{parentContainerTarget:e,containerItemID:a}))}if(e){const{data:e,caseViewMode:r}=t,a={data:e,caseViewMode:r,context:n};kh.setIn(a.data,["context_data","caseViewMode"],r),s.push({type:ut,payload:{context:n}}),s.push(Sg(Xh,a))}}},My=async(e,t,n,r,s,a)=>{((e,t,n)=>{if(t.isProcessAction&&(Dy(n,{...t,skipReleaseLockRequest:!0}),e)){const r=`${t?.containerItemID.includes("root")?G.APP.ROOT:G.APP.APP}/${Ed.PRIMARY}`,s=el(r,Ed.PRIMARY),a={insKey:e.ID,className:e.content.classID,context:s,acTargetName:G.PRIMARY,isChild:!0},o={type:fe,payload:{...a}};n.push(o)}})(e.data.caseInfo.parentCaseInfo,t,s);const o=e?.data?.caseInfo?.parentCaseInfo?.ID;if(o){const n=Kd(t?.context),r=_d(n,t?.context)?.parentContext,s=Kd(r);t?.isProcessAction&&Nd(s,o)&&pp(r,e?.data?.caseInfo?.lastUpdateTime)}n.resourceType=Ry.CASE,n.directUrlUpdation=!0,t.isProcessAction||await Oy(s,{translatedDXAPIResponse:r,actionInPayload:t},n,a)},Ly=async(e,t,n,r,s)=>{e.doDeleteCaseSummary=t.doDeleteCaseSummary,e.caseViewMode===G.REVIEW_MODE&&(e.flowName=" ",e.clearView=!0);const{containerItemID:a}=t,o=$c.getPropertiesToReplace(a);s.push(Sg(ug,{...e,...r,propertiesToReplace:o})),kh.setIn(e,"acName",r.target),await Yc(n,e),((e,t,{data:n,caseViewMode:r})=>{const{containerItemID:s}=t,a=Md(s);if(a&&wc(s)){const t=te(a),o={data:n,caseViewMode:r,context:t};kh.setIn(o.data,["context_data","caseViewMode"],r),e.push({type:ut,payload:{context:t}});const i=$c.getPropertiesToReplace(s);e.push(Sg(Xh,o,{propertiesToReplace:i}))}})(s,t,e)},Uy=async(e,t,n,r,s,a,o,i,c)=>{const{isCaseWideAction:l,isInCreateStage:u,containerItemID:d}=e,p=K(e.context),h=bc(s),g=Dc(s),f=u&&!h&&!l,m=Fd(p)[0],y=m?vd(m):p,E=_c(d),I=Md(d),A=Object.freeze({target:e.target,containerItemID:d,context:I,containerName:E});f&&!vy(e.context)?await My(i,e,t,s,a,c):xy(e.context,y)?await wy(y,t,p,e,a,n,r,s,o):l&&!xy(e.context,y)?(Dy(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=K(r),o=Md(a);e.push(Sg(Qh,{containerItemID:a,context:o,container:Ed.PREVIEW,containerName:Ed.PREVIEW,caseId:s,viewName:B.PREVIEW_VIEW_NAME,caseClassName:t,updateData:!0}))}})(a,e,{caseClassName:g})):await Ly(t,e,s,A,a)},Fy=(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?Gc.PAGE:n||Gc.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}=Wg(p,h),{reqType:f}=Wg(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}=qc(a);e.attachmentsExist=y;const E=u.value.data[a]?.caseInfo?.headers||{},{etag:I}=E,A={"if-match":I,...o};return Ei(zi(g,{method:f,body:m,headers:A},a)).pipe(iu((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Hc({...A,...r})}})),mu("Error occurred during ajax call at finishAssignment Epic : ",a))},{RESOURCE_TYPES:jy}=B,Vy=(e,t)=>{let n=0,r=[],s={},a="",o={},i=!1,c=!1;return e.pipe(au(Py),ou((e=>{const l=Dp.isCoexistenceAppOfType(G.APP_TYPE.UIKIT);if(({actionMgrID:n}=e.payload),a=e.payload.context,tr({context:a,stateObj:Th(a),clearContextMessages:!0}),!Pl(a)){const t={type:B.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return yn.rejectActionByID(n,!0,t),rn.handleDeferredActionCompletion(e.payload.context),pu([])}return pu(e.payload).pipe(cu((e=>{((e,t)=>{const{containerItemID:n,context:r,actionMgrID:s,isInCreateStage:a,isModalAction:o}=t;if(a&&o){const t=_c(n),a=Ct(t,r);e.push(Sg(gg,{containerItemID:n,target:a,actionMgrID:s}))}})(r,e);const n={...e};return Fy(n,{state$:t})})),cu((async e=>{if(e&&e.type===Te){(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=Th(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:Kd(n),context:n};Sh({type:Ae,payload:a})}})(e);const t=Qc(e);return r.push(t),r}qu.clearContextedCache(a);const{headers:t,actionInPayload:u,response:d}=e,{containerItemID:p,context:h=Md(p),isModalAction:g,isInCreateStage:f}=u;i=u.isCaseWideAction,c=u.isProcessAction;const m=Kd(p);u.target=m;const y=_c(p),E=Object.freeze({target:u.target,containerItemID:p,context:h,containerName:y});kh.setIn(d.data,G.CASE_INFO.IS_FIRST_ASSIGNMENT,!1),kh.setIn(d.data,G.CASE_INFO_IS_LOCAL_ACTION,!1),d?.uiResources?.root?.config?.name&&"page"!==u.viewType&&kh.setIn(d.data,G.CASE_INFO.VIEW_NAME,d?.uiResources?.root?.config?.name),(e=>{Ci.publish(G.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,e)})({submitResponse:d});let I=Ym(d,{[B.STOPMERGEACTIONS]:!d.nextAssignmentInfo});const A=Dc(I),_=K(u.context),C=Fd(_)[0]?vd(Fd(_)[0]):_,S=bc(I),T=f&&!S;!g||f||xy(u.context,C)||(I=((e,t)=>(e?.data?.caseInfo&&t?.caseInfo?.content&&(e.data.caseInfo.content=t?.caseInfo?.content),e))(I,Th(p)));const N=zc(I,{headers:t,actionMgrID:n,directUrlUpdation:!1});let P,R;Lc(N.data,u),N.caseClassName=A,N.resourceType=jy.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=Kd(t);return a=$d(o)?Pd(o,n.data?.caseInfo?.ID):vd(o),r&&e&&Dh(null,G.CASE_VIEW_MODE_PROP,a)===G.PERFORM_MODE&&s})(D,C,I,g,b),v=u?.actionID===B.LOCAL_ACTIONS.TRANSFER_ASSIGNMENT;if(I?.data?.nextAssignmentInfo&&!v)N.caseViewMode=G.PERFORM_MODE,P=Oc(I),R=!0;else if(O&&!v)N.caseViewMode=G.PERFORM_MODE,P=Oc(I),N.flowName=" ",N.deleteAssignmentSpecificResources=!1,R=!1;else{N.caseViewMode=G.REVIEW_MODE;const e=kd(Kd(C));P=I?.confirmationNote&&I?.uiResources?.root?.config?.name===G.PY_CONFIRM&&!e?Oc(I):"",R=!1}const x=Oc(I);Mc(N,I,{skipFlowNameUpdate:N?.caseViewMode===G.REVIEW_MODE||O});const w=Bg("createWork",{caseClassName:A}).replace(/{.+?}/,String(Rc(x)));if(I.semanticURL=w,N.semanticURL=w,g?(await Uy(u,N,R,P,I,r,e,d,o),T&&(s=(e=>{if(!by(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?(Dp.setDefaultCasePage("pyDetails"),await(async(e,t,n)=>{const r={assignmentID:e?.data?.caseInfo?.assignments[0]?.ID,className:e?.data?.caseInfo?.content?.classID,containerName:Ed.PRIMARY,targetContainerName:Ed.PRIMARY,viewType:Gc.PAGE,isLastStepInCreateStage:!0,context:n},s={type:Ie,payload:{...r}};t.push(s)})(d,r,K(h))):await Ly(N,u,I,E,r),Vc(e,r),rn.handleDeferredActionCompletion(a).catch((()=>{})),((e,t,n)=>{const{isModalAction:r,isCaseWideAction:s,caseID:a}=t,o=xy(t.context,n),i=e?.data?.caseInfo?.stages||[],c=e?.data?.caseInfo?.stageID;Ec({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:Oc(e),assignmentID:n?null:r,actionID:n?s:null}})(I,u);(e=>{Ci.publish(G.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===Ve));t?.payload&&(n=t.payload.target,r=t.payload.containerItemID)}const s=yg({target:n,containerItemID:r});s.payload.transientItems.length&&e.push(s)})(r,{transientItemID:p,target:m,isModalAction:g}),r})),iu((()=>{const e=r.find((e=>e.type===Te));return e?(rn.handleDeferredActionCompletion(a).catch((()=>{})),(e=>{const t=e?.payload?.err?.errorDetails,n=e?.payload?.context;t?.forEach((e=>{e[G.ERROR_FIELD_IN_PAGE]=e[G.ERROR_FIELD_IN_PAGE].replace(/(\(\d+\))/g,(e=>`[${parseInt(e.substring(1,e.length-1),10)-1}]`));const t=e[G.ERROR_FIELD_IN_PAGE].slice(1),r=e[G.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=Xn(s,a,G.PROPERTY),i={type:B.MESSAGES.MESSAGES_TYPE_ERROR,message:e.localizedValue};Mn.mutateField(n,a,o[o.length-1],{messages:[i],type:B.MESSAGES.MESSAGES_TYPE_ERROR,fieldName:r})}}))})(e),yn.rejectActionByID(n)):yn.resolveActionByID(n,s),o?.caseId&&(e=>{Ci.publish(G.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DONE,e)})(o),ll(r),(i||c)&&(e=>{Ci.publish(G.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION,e)})({updateState:!0}),r=[],s={},o={},r})))})))},ky="CANCEL_ASSIGNMENT",$y=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}=Wg(i,{ID:s,caseID:s,viewType:Gc.PAGE});return Li.getPreviewMode()&&(t[G.SKIPCOREHEADERS]=!0),Ei(zi(c,{method:l,headers:t},a,{includeRemoteSystemIdIfPresent:!!o})).pipe(iu((t=>r?{actionInPayload:e}:{response:t.data,actionInPayload:e,headers:Hc(t.headers)})),mu(": Error occurred during ajax call at release lock request : ",a))},By=(e,t)=>{const{isModalAction:n}=t;return $y({routeKey:"cancelAssignment",isModalAction:n,...e})},Gy=e=>{let t=0,n=[];return e.pipe(au(ky),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>{const{isModalAction:n}=e;e.context||(e.context=Md(e.containerItemID));const{context:r}=e,s=(e=>{const{isModalAction:t,containerItemID:n}=e;return t?Ed.MODAL:_c(n)})(e),a=Ct(s,r),{continueExecution:o}=rl(a);return o?(e.RemoteSystemID=q.getRemoteHeaderByContext(e.context)??void 0,By(e,{isModalAction:n})):(yn.rejectActionByID(t),fu())})),cu((async e=>{if(e&&e.type===Te)return n.push(Qc(e)),n;const{actionInPayload:r,response:s}=e,{containerItemID:a,isModalAction:o,isInCreateStage:i}=r,c=Kd(a),l=Md(a),u={target:o?`${G.APP.APP}/${G.MODAL}`:c,containerItemID:a,caseViewMode:o?G.PERFORM_MODE:G.REVIEW_MODE,context:l,actionMgrID:t,key:Oc(s),skipReleaseLockRequest:!1};return i&&n.push(Sg(ug,u)),!o&&wc(a)&&(async(e,t)=>{const{childContainerItemID:n,caseViewMode:r,referencedUsers:s}=t,a=K(n),o={context:Md(a),data:{referencedUsers:s,context_data:{caseViewMode:r}}};o.data={...t.response.data,...o.data},e.push(Sg(Xh,o))})(n,{childContainerItemID:a,caseViewMode:G.REVIEW_MODE,referencedUsers:s?.data.referencedUsers,response:s}),u.skipReleaseLockRequest=!0,n.push(Sg(mg,u)),n})),iu((()=>(Sh(n),Uc(n,t),n=[],n))))},Wy="NAVIGATE_TO_STEP",Hy=(e,t)=>{const{ID:n,stepID:r,containerItemID:s,context:a=Md(s),isInCreateStage:o}=e,{state$:i}=t,c={ID:n,stepID:r,viewType:o?Gc.PAGE:Gc.FORM},{restApi:l,reqType:u}=Wg("navigateToStep",c),{content:d}=qc(a),p=i.value.data[a].caseInfo.headers;return Ei(zi(`${l}`,{method:u,body:d,headers:{"if-match":p&&p.etag}},a)).pipe(iu((t=>({response:t.data,actionInPayload:e,headers:Hc({...p,...t.headers})}))),mu("Error occurred during ajax call at navigateToStep Epic : ",a))},{RESOURCE_TYPES:qy}=B,zy=(e,t)=>{let n=0,r=[];return e.pipe(au(Wy),ou((e=>(({actionMgrID:n}=e.payload),pu(e.payload).pipe(cu((e=>(ar(e.context),Hy(e,{state$:t})))),cu((async e=>{if(e&&Tc(e.type))return r.push(Qc(e)),r;const{actionInPayload:t,response:n,headers:s}=e,{containerItemID:a,context:o=Md(a),isModalAction:i}=t;qu.clearContextedCache(t.context);const c=Kd(a),l=_c(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&&(kh.setIn(d,"pyViewName",p),kh.setIn(d,"pyViewContext",h));const g=Ym(n),f={acName:c,...u};await Yc(g,t,f);const m=zc(g,{...u,headers:s});n?.nextAssignmentInfo||(m.caseViewMode=G.REVIEW_MODE),Vc(e,r),m.doDeleteCaseSummary=t.doDeleteCaseSummary,m.resourceType=qy.ASSIGNMENT,Mc(m,g),Lc(m.data,t);const y=g.data?.caseInfo?.stages,E=g.data?.caseInfo?.stageID;return Ec({caseID:Oc(g),isModalAction:i,stages:y,stageID:E}),wc(a)&&cl(m,r),r.push(Sg(ug,m)),ol(r),r})),iu((()=>(Sh(r),Uc(r,n),r=[],r))))))))},Yy=e=>{const{caseID:t,context:n}=e,{restApi:r,reqType:s}=Wg("deleteCaseInCreateStage",{ID:t});return Ei(zi(r,{method:s},n)).pipe(iu((t=>({response:t.data,actionInPayload:e,headers:Hc(t.headers)}))),mu(": Error occurred during ajax call at deleteCaseInCreateStage Epic : ",n))},Ky=e=>{Ci.publish(G.PUB_SUB_EVENTS.CASE_EVENTS.CREATE_STAGE_DELETED,e)},Xy=(e,t)=>{let n,r=0,s=[];return e.pipe(au(Zl),iu((e=>(({actionMgrID:r,caseType:n}=e.payload),e.payload))),cu((e=>e.ignoreCaseDeletion?pu({actionInPayload:e}):Yy(e))),cu((async e=>{if(e&&Tc(e.type)){const{payload:t}=e,n=Qc({...e,...t,actionMgrID:r});return s.push(n),s}const{actionInPayload:n}=e,{context:a,isModalAction:o}=n,i=o?Ed.MODAL:Ed.PRIMARY,c=Ct(i,a);if(!o&&c){const e={acName:c,target:c,context:a},r=t.value.containers[c],{semanticURL:s}=(e=>{const{accessedOrder:t,items:n}=e;if(t&&t.length>1){const e=n[t[t.length-2]],{semanticURL:r}=e;if(r)return e}return{semanticURL:""}})(r);await Yc({directUrlUpdation:!0,semanticURL:s},n,e)}if(n.isProcessAction&&n.parentCaseInfo){const e={insKey:n.parentCaseInfo.ID,className:n.parentCaseInfo.content.classID,context:n.parentContext,acTargetName:G.PRIMARY,isChild:!0},t={type:fe,payload:{...e}};s.push(t)}const l={target:c,containerItemID:a,context:a,caseDeleted:!0};return s.push(Sg(mg,l)),s})),iu((()=>(Sh(s),Uc(s,r)===G.PROMISE_VALUE.RESOLVE&&Ky({caseType:n}),s=[],s))))},Jy=(e,t)=>{const{assignmentID:n,actionID:r,context:s}=e,{restApi:a,reqType:o}=Wg("save",{assignmentID:n,actionID:r}),{content:i}=qc(s),c=t.value.data[s]?.caseInfo?.headers;return Ei(zi(a,{method:o,body:i,headers:{"if-match":c&&c.etag}},s)).pipe(iu((t=>({response:t.data,actionInPayload:e,headers:Hc(t.headers)}))),mu(": Error occurred during ajax call at saveAndCloseAssignment Epic at save action : ",s))},Qy=(e,t=!1)=>{const{action:n,state$:r,actionMgrID:s}=e;let a=[];return pu(n.payload).pipe(cu((e=>Jy(e,r))),cu((e=>{if(e&&Tc(e.type))return pu(e);const{containerItemID:t}=e&&e.actionInPayload,r=K(t),s=Kd(r),o=Ad(s),i=Fd(r)[0];let c=i?vd(Fd(r)[0]):r;if(!kd(Kd(c))){const t=Ad(i);t?.accessedOrder.forEach((n=>{e.actionInPayload.caseID===t.items[n].key&&(c=t.items[n].context)}))}const l=vd(s);n.payload.canUpdateAvailableActions&&zm(e.response);if(c&&a.push((t=>Sg(Xh,{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=$c.getPropertiesToReplace(t);a.push(Sg(Xh,n,{propertiesToReplace:s}))}return a.push(Sg(ug,{context:t})),Vc(e,a),e.actionInPayload.RemoteSystemID=q.getRemoteHeaderByContext(e.actionInPayload.context)??void 0,$y(e.actionInPayload)})),cu((async n=>{if(n&&Tc(n.type)){const{payload:t}=n,r=Qc({...n,...t,actionMgrID:s});a.push(r);const o=e.action.payload.modalLoadingContainer;if(o){const e=o.context,{context_data:t}=Th(e)||{};t?.isLoading&&Xd(e)}return a}const{actionInPayload:r}=n,{context:o,containerName:i}=r,c={target:Ct(i,o),containerItemID:o,context:o};return t||a.push(Sg(mg,c)),a})),iu((()=>(Sh(a),Uc(a,s),t||(a=[]),a))))},Zy=(e,t)=>{let n,r=0;return e.pipe(au(eu),ou((e=>{const{saveOnly:s}=e.payload;({actionMgrID:r,caseType:n}=e.payload);return Qy({action:e,state$:t,actionMgrID:r,caseType:n},s)})))},eE=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="expressLocalActionSubmit",Ci.unsubscribe(G.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n)};n=e,r="expressLocalActionSubmit",Ci.subscribe(G.PUB_SUB_EVENTS.EVENT_EXPRESS_LOCALACTION,n,r)}var n,r},{LOCAL_ACTION_TYPE:tE}=G,{RESOURCE_TYPES:nE}=B,rE=(e,t)=>{const{actionID:n,assignmentID:r,caseID:s,context:a,openActionType:o,modalLoadingContainer:i,headers:c}=e,{isProcessAction:l}=t,u=l?Qe:(e=>{const t=e.localActionType.toLowerCase();return t===tE.CASE_WIDE||t===tE.EXPRESS?Ze:Je})(e),d=Gc.FORM,{reqType:p}=Wg(u,{caseID:s,ID:r,actionID:n,viewType:d});let{restApi:h}=Wg(u,{caseID:s,ID:r,actionID:n,viewType:d});e.actionType=u===Ze?G.CASE:G.ASSIGNMENT,h&&!h.includes("viewType=")&&(h=h.includes("?")?`${h}&viewType=${d}`:`${h}?viewType=${d}`);const g=i?.context??a;return Ei(zi(h,{method:p,headers:c},g)).pipe(iu((t=>({response:t.data,actionInPayload:e,headers:Hc(t.headers)}))),mu(`: Error occurred during ajax call at ${o} Epic : `,g))},sE=(e,t)=>{const{isProcessAction:n}=t,r=n?Qe:Je;e.openActionType=r;let s;if("modal"===Ac(r,e)){s=Fd(e.contextName)[0]?Fd(e.contextName):Kd(e.contextName);const n=s?vd(s):e.contextName,r=Md(n),a=Ac(e.openActionType,e),o=Ct(a,e.context),i=ee(e.context,X(a,e.context));if(Sh(sg({target:o,context:i,containerItemID:i,key:e.caseID,caseViewMode:G.PERFORM_MODE,actionName:e.name,showProgress:!0,root:{type:"reference",config:{context:G.CASE_INFO.CASE_INFO_CONTENT,type:"view"}},data:{key:e.caseID,caseInfo:{ID:e.caseID}}})),Sh(dg({context:i})),e.modalLoadingContainer={target:o,context:i},!Fd(e.contextName)[0])return rE(e,t);if(!e.continueExecution)return rE(e,t);if(!Wl(r))return rE(e,t);e.saveActionPayload.modalLoadingContainer=e.modalLoadingContainer,e.saveActionPayload.canUpdateAvailableActions=!e.saveActionPayload.isModalAction;return Ei([tu(e.saveActionPayload)]).pipe(cu((e=>(e=>{let t,n=0;const r=[],s={value:Ch()?.getState()};return pu(e).pipe(au(eu),ou((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n,caseType:t}=e.payload),!a){const e={type:B.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return yn.rejectActionByID(n,!0,e),pu([])}return Qy({action:e,state$:s,actionMgrID:n,caseType:t,actionsOut:r},!0)})))})(e))),cu((n=>{if(1===n.length&&Tc(n[0].type)){const{continueExecution:n}=rl(s);if(!n)return yn.rejectActionByID(e.actionMgrID),gu.pipe(Ii((()=>fu()))).toPromise();if(n)return rE(e,t)}return rE(e,t)})),iu((e=>e)))}return rE(e,t)},aE=async(e,t,{headers:n,actionInPayload:r})=>{const{context:s,actionName:a,openActionType:o,doDeleteCaseSummary:i,modalLoadingContainer:c}=r,l=Ym(e),u=Ac(o,r),d=c?.target??Ct(u,s);let p,h,g=!1;!Bd(d)||$d(d)&&!Nd(d,e.data.caseInfo.ID)?(h=X(u,s),Sc(u)&&(h=ee(s,h)),p=h,g=!0):(p=$d(d)?Pd(d,e.data.caseInfo.ID):vd(d),h=Md(p));const f={acName:d,target:d,containerName:u,context:h};await Yc(l,r,f),(void 0===l?.data?.caseInfo?.content||void 0!==l.data.caseInfo.content&&"object"==typeof l.data.caseInfo.content&&0===Object.keys(l.data.caseInfo.content).length)&&delete l.data?.caseMessages;const m=l.uiResources?.root;let y;y=m?G.PERFORM_MODE:G.REVIEW_MODE;const E=zc(l,{target:d,context:h,containerItemID:p,caseViewMode:y,doDeleteCaseSummary:i,headers:n,actionName:a,isMinimizable:!1,isInCreateStage:Sc(u),resourceType:nE.ASSIGNMENT,isProcessAction:r.isProcessAction,showProgress:r.showProgress,progressMessage:r.progressMessage,assignmentID:r.assignmentID,actionType:r.actionType});m&&Mc(E,l),Sc(u)&&delete E.doDeleteCaseSummary,r.openActionType===et&&(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?sg:ug;if(E.data.context_data.isProcessAction=r.isProcessAction,t.push(Sg(I,E)),g||t.push(Sg(pg,E)),g){const s=Fd(r.contextName),a=Pd(s,e.data.caseInfo.ID);if(a){const e={data:{caseInfo:{headers:n}},context:a};t.push(Sg(Xh,e))}}return p!==vd(d)&&t.push(Sg(gg,{target:d,containerItemID:p})),wc(p)&&!c?.context&&cl(E,t),E.caseViewMode===G.REVIEW_MODE&&t.push(Sg(mg,E)),t},oE="OPEN_LOCAL_ACTION",iE=(e,t)=>sE(e,t),cE=e=>{let t=0,n=[];return e.pipe(au(oE),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>iE(e,{actionMgrID:t}))),cu((async e=>{if(!e)return gu;if(Tc(e.type)){const t=Qc(e);n.push(t);const{context_data:r}=Th(e.payload.context)||{};return r?.isLoading&&n.push(Sg(pg,e.payload)),n}const{actionInPayload:t,headers:r,response:s}=e,{actionID:a}=t;return kh.setIn(s,"data.caseInfo.activeActionID",a),kh.setIn(s.data,G.CASE_INFO_IS_LOCAL_ACTION,!0),t.refreshConditions&&kh.setIn(s.data,G.CASE_INFO_REFRESH_CONDITIONS,t.refreshConditions),await aE(s,n,{headers:r,actionInPayload:t}),eE(t),n})),iu((()=>(Sh(n),Uc(n,t),n=[],n))))},lE=e=>{const{actionID:t,context:n,openActionType:r,caseTypeID:s,bulkContextID:a="",bulkContextType:o=""}=e,i=et,{reqType:c,restApi:l}=Wg(i,{caseTypeID:s,actionID:t,bulkContextID:a,bulkContextType:o});return Ei(zi(l,{method:c},n)).pipe(iu((t=>({response:t.data,actionInPayload:e,headers:Hc(t.headers)}))),mu(`: Error occurred during ajax call at ${r} Epic : `,n))},uE=e=>{const{callbacks:t}=e;if(t?.submit){const e=e=>{var n;t.submit(e),n="bulkActionSubmit",Ci.unsubscribe(G.PUB_SUB_EVENTS.EVENT_BULKACTION,n)};n=e,r="bulkActionSubmit",Ci.subscribe(G.PUB_SUB_EVENTS.EVENT_BULKACTION,n,r)}var n,r},dE="OPEN_BULK_ACTION",pE=e=>{let t=0,n=[];return e.pipe(au(dE),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>((e,t)=>{const{context:n}=e,{actionMgrID:r}=t;e.openActionType=et;const s=Ac(et,e),a=Ct(s,n),{continueExecution:o}=rl(a);return o?lE(e):(yn.rejectActionByID(r),fu())})(e,{actionMgrID:t}))),cu((async e=>{if(e&&Tc(e.type)){const t=Qc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:s}=e,{actionID:a}=t;return kh.setIn(s,"data.caseInfo.activeActionID",a),await aE(s,n,{headers:r,actionInPayload:t}),uE(t),n})),iu((()=>(1===n.length&&Tc(n[0].type)?yn.rejectActionByID(t):yn.resolveActionByID(t),Sh(n),n=[],n))))};var hE=Array.isArray,gE=Object.getPrototypeOf,fE=Object.prototype,mE=Object.keys;function yE(e){if(1===e.length){var t=e[0];if(hE(t))return{args:t,keys:null};if((r=t)&&"object"==typeof r&&gE(r)===fE){var n=mE(t);return{args:n.map((function(e){return t[e]})),keys:n}}}var r;return{args:e,keys:null}}var EE=Array.isArray;function IE(e){return iu((function(t){return function(e,t){return EE(t)?e.apply(void 0,_o([],Ao(t))):e(t)}(e,t)}))}function AE(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(e){return Po(uu(e))?e.pop():void 0}(e),r=yE(e),s=r.args,a=r.keys,o=new Zo((function(e){var t=s.length;if(t)for(var n=new Array(t),r=t,o=t,i=function(t){var i=!1;ci(s[t]).subscribe(pi(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(IE(n)):o}const _E=e=>{const{actionID:t,context:n,cases:r,classID:s}=e,{content:a}=qc(n,{nonEmptyAndChangedData:!0});let o=5;try{const e=fc.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=tt,{reqType:u,restApi:d}=Wg(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(Ei(zi(d,{method:u,body:a},n)).pipe(iu((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Hc({...r})}})),mu("Error occurred during ajax call at submitbulkaction Epic : ",n)));return AE(p)},CE=e=>{Ci.publish(G.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},SE="SUBMIT_BULK_ACTION",TE=e=>{let t,n=0,r=[],s="";return e.pipe(au(SE),ou((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:B.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return yn.rejectActionByID(n,!0,e),pu([])}return pu(e.payload).pipe(cu((e=>(t=e,_E(t)))),cu((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`,CE({submitResponse:e}),t.target="HYBRID"===Dp.getRenderingMode()?Kd(i):`${G.APP.APP}/${Ed.MODAL}`,r.push(Sg(mg,{containerItemID:i,context:c,target:t.target,skipReleaseLockRequest:!0})),a&&r.push(Sg(fg,{messages:[{type:"error",message:1===a?"1 record failed to update":`${a} records failed to update`,errorDetails:o,showHeader:!1}],context:K(c)||c,category:"HTTP",showHeader:!1})),r})),iu((()=>(yn.resolveActionByID(n,s),Sh(r),r=[],r))))})))},NE=e=>{const{actionID:t,context:n,cases:r}=e,{content:s}=qc(n,{nonEmptyAndChangedData:!0});s.cases=r.map((e=>({ID:e})));const a=tt,{reqType:o,restApi:i}=Wg(a,{actionID:t,runningMode:"async"});return Ei(zi(i,{method:o,body:s},n)).pipe(iu((t=>{const{data:n,headers:r}=t;return{response:n,actionInPayload:e,headers:Hc({...r})}})),mu("Error occurred during ajax call at submitbulkaction Epic : ",n))},PE=e=>{Ci.publish(G.PUB_SUB_EVENTS.EVENT_BULKACTION,e)},RE="SUBMIT_BULK_ACTION_ASYNC",DE=e=>{let t,n=0,r=[],s="";return e.pipe(au(RE),ou((e=>{const{isFormValid:a}=e.payload;if(({actionMgrID:n}=e.payload),!a){const e={type:B.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return yn.rejectActionByID(n,!0,e),pu([])}return pu(e.payload).pipe(ou((e=>(t=e,NE(t)))),iu((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",PE({submitResponse:i}),t.target=`${G.APP.APP}/${Ed.MODAL}`,r.push(Sg(mg,{containerItemID:a,context:o,target:t.target,skipReleaseLockRequest:!0})),c&&r.push(Sg(fg,{messages:[{type:"error",message:1===c?"1 record failed to update":`${c} records failed to update`,errorDetails:n,showHeader:!1}],context:K(o)||o,category:"HTTP",showHeader:!1})),r})),iu((()=>(yn.resolveActionByID(n,s),Sh(r),r=[],r))))})))},bE=(e,t)=>sE(e,t),OE=e=>{let t=0,n=[];return e.pipe(au(Jl),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>(ar(e.context),bE(e,{actionMgrID:t,isProcessAction:!0})))),cu((async e=>{if(e&&Tc(e.type)){const t=Qc(e);return n.push(t),n}const{actionInPayload:t,headers:r,response:s}=e;return await aE(s,n,{headers:r,actionInPayload:t}),n})),iu((()=>(ll(n),Uc(n,t),n=[],n))))},vE=e=>{let t=0,n=[];return e.pipe(au(De,Ve),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>{const{containerItemID:t,caseID:n,context:r,caseDeleted:s,skipReleaseLockRequest:a,currentCaseViewMode:o,isProcessAction:i,isInCreateStage:c}=e,l=o===G.PERFORM_MODE,u=n&&l;return i&&c?$y(e):t!==r||s||a||!u?t?.includes(G.MODAL)&&kc(mp(t))===G.REVIEW_MODE?$y(e):pu([]):$y(e)})),cu((e=>(e&&Tc(e.type)&&n.push(Qc(e)),n))),iu((()=>(Sh(n),Uc(n,t),n=[],n))))};var xE=new Af(mf),wE=xE;function ME(e,t,n){void 0===e&&(e=0),void 0===n&&(n=wE);var r=-1;return null!=t&&(lu(t)?n=t:r=t),new Zo((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 LE(e,t){return void 0===e&&(e=0),void 0===t&&(t=xE),e<0&&(e=0),ME(e,e,t)}function UE(e){return di((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(pi(n,(function(t){null==a||a.unsubscribe(),r=!0,s=t,a=pi(n,o,Fo),ci(e(t)).subscribe(a)}),(function(){o(),n.complete()}),void 0,(function(){s=a=null})))}))}const FE=(e,t,n,r,s)=>{if(s!==G.RESOURCE_STATUS.CREATE)return;gl.isStateMachineExist(e,t,n)||gl.setStateMachine(e,n,t,new mr(n,t,e));gl.getStateMachine(e,t,n).insert({},r+1,!0,{isDefault:!0})},jE=e=>{const{context:t}=e;let n={...qc(t).content,contextData:!1};const r=dl(t);kh.isEmpty(r)||(n=ul(r,n));const{restApi:s,reqType:a}=Wg("refreshCaseView",e);return n.interestPage=e.interestPage,Ei(zi(s,{method:a,body:n},t)).pipe(iu((t=>({actionInPayload:e,response:t.data,headers:Hc(t.headers)}))),mu(": Error occurred during ajax call : ",t))},VE=e=>{let t=0,n=[],r="";return e.pipe(au(Et),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>jE(e))),cu((async e=>{if(e&&e.type===Te)return n.push(Qc(e)),{actionsOut:n,actionInPayload:{skipPageInstructions:!0}};const{actionInPayload:t,response:s}=e,a=t.containerName,o=Ct(a,t.context);let i=el(o,a,t.context);i=ee(t.context,i);const c=Ym(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=Th(t.context)?.context_data?.caseInfo,d=`${t.pageReference}${t.targetProperty}`,p=Jn(u,d.replace(G.CASE_INFO.CASE_INFO_CONTENT,"").slice(1),t.index);c.uiResources.context_data.caseInfo={...c.uiResources.context_data.caseInfo,content:kh.mergeDeep(c.uiResources.context_data.caseInfo?.content,p?.content)};const h=Wh.getProperty(".RemoteSystemID",G.CASE_INFO.HEADERS,t.context),g={acName:o,context:i};await Yc(c,t,g);const f={target:o,context:i,containerItemID:i};h&&(f.headers={RemoteSystemID:h});const m=zc(c,f);m.resourceStatus=t.actionType,m.isMultiRecordData=!0,m.parentContext=t.context,m.heading=t.heading,m.clearStateMachine=!1;const y=Zc(o,m);return r=i,n.push(y),ol(n),{actionsOut:n,actionInPayload:t}})),iu((({actionInPayload:e})=>(Nc(n)?yn.rejectActionByID(t):yn.resolveActionByID(t),e.skipPageInstructions||FE(r,e.pageReference,e.targetProperty,e.index,e.actionType),Sh(n),n=[],n))))},kE=e=>{let t,n="",r=[];return e.pipe(au(It),ou((e=>{t=e.payload;const{isFormValid:s}=e.payload;if(({actionMgrID:n}=e.payload),!s){const t={type:B.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return yn.rejectActionByID(n,!0,t),rn.handleDeferredActionCompletion(e.payload.context),pu([])}return pu(e.payload).pipe(cu((e=>(t=e,jE(t)))),cu((async e=>{if(e&&e.type===Te){const t=Qc(e);return r.push(t),r}const{containerItemID:n,context:s}=t;var a,o,i,c;return a=s,o=t.parentContext,i=B.CASE_INFO.CASE_INFO_CONTENT,c=!1,Tr(a).forEach((e=>{const t=kh.convertClipboardPageToPageRefNotation(e.target);gl.isStateMachineExist(o,i,t)||gl.setStateMachine(o,t,i,new mr(t,i,o));const n=gl.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(Sg(mg,{containerItemID:n,context:s,target:t.target,skipReleaseLockRequest:!0})),r})),iu((()=>{if(Nc(r))yn.rejectActionByID(n),rn.handleDeferredActionCompletion(t.context);else{yn.resolveActionByID(n),rn.handleDeferredActionCompletion(t.context);const{pageReference:r}=e.payload;if(Wh.getPropertyValue(G.CONTEXT_DATA_MODAL_VIEW.IS_MULTI_RECORD_DATA,r,t.parentContext)){const e=Wh.getPropertyValue(B.CASE_INFO.CASE_INFO_ID,r,t.parentContext),n=Wh.getPropertyValue(G.CONTEXT_DATA_MODAL_VIEW.VIEW_NAME,r,t.parentContext),s=t.pageReference?.substring(0,t.pageReference?.lastIndexOf(".")),a=s.replace(G.CASE_INFO.CASE_INFO_CONTENT,"");Vn(e,n,t.parentContext,a,{})}else Gn(t.parentContext,G.CASE_INFO.CASE_INFO_CONTENT,{})}return Sh(r),r=[],r})))})))},$E=e=>{const{caseID:t,headers:n,debugInfo:r,context:s}=e,a=Wg("getDescendants",{caseID:t}),{restApi:o}=a,{reqType:i}=a;return Ei(zi(o,{method:i,headers:{...n,...r&&{...Fi.addDebugHeaders(r)}}},s)).pipe(iu((t=>({actionInPayload:e,response:t.data,headers:Hc({...n,...t.headers})}))),mu("Error ocurred during ajax call at getDescendants Epic : ",s))},BE=e=>{let t=0,n=[];return e.pipe(au(Yu),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>$E(e))),cu((async e=>{if(e&&Tc(e.type))return n.push(Qc(e)),n;const{actionInPayload:t,response:r}=e,s={};kh.setIn(s,"caseInfo.childCases",r?.childCases??[]);const a={data:s,context:t?.context};return n.push(Sg(Xh,a)),n})),iu((()=>(Sh(n),Uc(n,t),n=[],n))))},GE=[py,Ay,Ny,cE,pE,TE,DE,OE,Vy,zy,Gy,vE,Zy,Xy,e=>e.pipe(au(Xe),UE((()=>LE(100))),iu((e=>{const{actionMgrID:t,isChildCase:n,isModalAction:r,isProcessAction:s,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i}=e.payload;return yn.resolveActionByID(t),Ci.publish(G.PUB_SUB_EVENTS.EVENT_SHOW_CANCEL_ALERT,{isModalAction:r,hideDelete:!s&&n,isDataObject:a,skipReleaseLockRequest:o,isInCreateStage:i}),[]}))),e=>e.pipe(au(ke),UE((()=>LE(100))),iu((e=>{const{actionMgrID:t,context:n,containerName:r,containerItemID:s}=e.payload,a=Ct(r,n);return yn.resolveActionByID(t),Sh(Sg(gg,{containerItemID:s,target:a,doDeleteCaseSummary:!1})),[]}))),VE,kE,BE],WE=GE;function HE(){return di((function(e,t){e.subscribe(pi(t,Fo))}))}const{RESOURCE_TYPES:qE}=B,zE=[e=>e.pipe(au(oe),iu((e=>e.payload)),cu((e=>{const t={caseID:e.caseId,viewID:e.viewName,caseClassName:e.caseClassName,RemoteSystemID:e.RemoteSystemID};if(e.containerName===Ed.PREVIEW&&e.context&&e.caseId&&!e.updateData){const t=Ct(Ed.PREVIEW,e.context),n=el(t,Ed.PREVIEW,e.context,{buildNew:!0}),r=decodeURI(e.caseId);Sh(sg({...e,context:n,target:t,containerItemID:n,key:r,caseViewMode:G.REVIEW_MODE,root:{type:"reference",config:{context:G.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(q.isRemoteCase(t.caseClassName)){const{RemoteSystemID:e}=q.getRemoteCase(t.caseClassName);n.RemoteSystemID=e}let{restApi:r,reqType:s}=Wg("loadView",t);return e.viewContext===qE.PAGE&&({restApi:r,reqType:s}=Wg(Ge,{page:e.viewName,pageClass:e.pageClass})),Ei(zi(r,{method:s,headers:n},e.context)).pipe(iu((t=>{const n=decodeURI(e.caseId);let r="";return"string"==typeof t.data?t.data?r=JSON.parse(t.data):(console.error("response data is empty!!"),r={}):r=t.data,{response:{...r,key:n},actionConfig:e,headers:Hc(t.headers),rootView:kh.getIn(r,G.ROOT)}})),mu(": Error ocurred during ajax call at loadView Epic : ",e.viewLoadingContainer?.context??e.context))})),cu((async e=>{const t={};if(e?.type===Te){if(t.actionsOut=Qc(e),e?.payload?.context?.includes(Ed.PREVIEW)){const n={...Th(e.payload.context),caseInfo:{progress:!1,error:!0}},r=Ct(Ed.PREVIEW,e.payload.context);t.actionsOut=Sg(ug,{key:n.key,target:r,containerName:Ed.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||yc.getTargetViewContainerName(Ge),a=r?.target??Ct(s,e.context);return{target:a,context:r?.context??(t===Ed.PREVIEW&&n?e.context:el(a,s,e.context,{buildNew:!!t}))}})(n);n.context=c;const l={acName:i,context:c};let u={};u=Ym(r),u.directUrlUpdation=!1,await Yc(u,n,l);const d={...n,target:i,context:c,containerItemID:a||c,headers:s},p=zc(u,d);if(p.resourceType=qE.CASE,o&&!p.updateData){p.caseViewMode=G.REVIEW_MODE;const e=Kd(p?.context);((e,t,n,r,s)=>{e&&s===Ed.PREVIEW?(n.data.caseInfo.progress=!1,delete n.root,r.actionsOut=Sg(ug,{...n,containerName:s})):e?(r.actionsOut=[],r.actionsOut.push(Sg(gg,{target:t,containerItemID:e}))):r.actionsOut=Sg(sg,{...n,containerName:s})})(Pd(e,p.key),e,p,t,o)}else p.preserveClientChanges=!0,t.actionsOut=[],o===Ed.PREVIEW&&t.actionsOut.push({type:ut,payload:{context:c}}),((e,t)=>{if(e.key){const n=Kd(e?.context),r=Pd(n,e.key),s=e?.context;!r&&wc(s)||t?.actionsOut?.push(Sg(Xh,e))}else t?.actionsOut?.push(Sg(Xh,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=>{Ci.publish(G.PUB_SUB_EVENTS.CASE_EVENTS.CASE_PREVIEW,e)})({caseId:n,context:r}),t})),iu((({rootView:e,actionsOut:t,actionMgrID:n=0})=>(yn.resolveActionByID(n,e),t)))),e=>{let t=0,n=[];return e.pipe(au(ie),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>{Ci.publish(B.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED);const{debugInfo:n,context:r,viewName:s,className:a,skipSemanticUrl:o=!1,containerName:i=yc.getTargetViewContainerName(Ge)}=e,c=n&&{...Fi.addDebugHeaders(n)},l=Ct(i,r);let u="",d={},p=!0;if(!o){if(u=Bg(Ge,{page:s,pageClass:a}),l&&u){const{activate:t,activateContainerActionPayload:n}=al(qE.PAGE,l,{semanticURL:u});if(t)return(e=>{e?.containerItemID&&fc.updateState(e.containerItemID,"traditionalGadgetId",$c.getUniqueGadgetId(),{skipDirtyValidation:!0})})(n),pu({type:Ue,activateContainerActionPayload:n,actionConfig:e})}if(vd(l)&&({continueExecution:p,removeActionPayload:d}=rl(l)),!p)return yn.rejectActionByID(t),fu()}const{restApi:h,reqType:g}=Wg(Ge,{page:s,pageClass:a});return Ei(zi(h,{method:g,headers:c},r)).pipe(iu((t=>{let n={};return n="string"==typeof t.data?JSON.parse(t.data):t.data,{response:{...n,key:u,semanticURL:u},actionConfig:e,headers:Hc(t.headers),removeActionPayload:d,skipSemanticUrl:o}})),mu(": Error ocurred during ajax call at showPage Epic : ",e.context))})),cu((async e=>{if(e&&e.type===Te)return n.push(Qc(e)),n;let{type:t}=e;const{actionConfig:r,skipSemanticUrl:s}=e,a=r.containerName||yc.getTargetViewContainerName(ie),o=Ct(a,r.context);Ci.publish(B.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className});const{remoteCasePayload:i,updatedType:c}=((e,t,n,r)=>{let s={},a=e;if(n.isTraditionalRemoteCase){s={...n};const e=Pd(r,s.insKey);e&&(t.activateContainerActionPayload={containerItemID:e},a=Ue)}return{remoteCasePayload:s,updatedType:a}})(t,e,r,o);if(t=c??t,t===Ue){const{activateContainerActionPayload:{semanticURL:t,containerItemID:s}}=e,a={acName:o,context:Md(s)};r.isTraditionalRemoteCase||await Yc({directUrlUpdation:!0,semanticURL:t},r,a,!0),n.push(Sg(gg,{target:o,containerItemID:s}))}else{const t=el(o,a,r.context),{response:c,headers:l={},removeActionPayload:u}=e,d=Ym(c,{isCreateDataObject:r.isCreateDataObject});d.directUrlUpdation=!s;const p={acName:o,context:t},h=kc(t);await Yc(d,r,p);const g={target:o,context:t,containerItemID:t,headers:l,debugInfo:r.debugInfo,currentCaseViewMode:h},f=zc(d,g);f.resourceType=B.PAGE,r.isCreateDataObject&&(f.resourceType=B.RESOURCE_TYPES.DATA,f.resourceStatus=B.RESOURCE_STATUS.CREATE,delete f.data.caseInfo),((e,t,n)=>{e.isTraditionalRemoteCase&&(n.resourceType=B.CASE,n.key=$c.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:Rc($c.getRemoteCaseKey(t.assignmentID,t.insKey))}},n.isTraditionalRemoteCase=!0,n.className=t.className)})(r,i,f),f.data??={},f.data.traditionalGadgetId=$c.getUniqueGadgetId();const m=Zc(o,f);u.containerItemID&&tl(m)&&n.push(Sg(mg,{containerItemID:u.containerItemID,target:o})),n.push(m),ol(n)}return Ci.publish(B.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:o,pageName:e.actionConfig.viewName,pageClass:e.actionConfig.className}),n})),iu((()=>{yn.resolveActionByID(t),Sh(n),n=[]})),HE())}],YE=zE;const KE=(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}=Wg(We,{pageName:r,dataContext:s,dataContextParameters:a}),h={};return h.RemoteSystemID=c,Ei(zi(u,{method:d,headers:h,body:p},n)).pipe(iu((t=>({response:{...t.data,key:o,semanticURL:o},actionConfig:e,headers:Hc(t.headers),removeActionPayload:l,skipSemanticUrl:i}))),mu("Error occurred during ajax call at showData Epic : ",e.context))},{RESOURCE_TYPES:XE}=B,JE=e=>{let t,n=0,r=[];return e.pipe(au(ce),(s=e=>(({actionMgrID:n}=e.payload),pu(e.payload).pipe(cu((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=Ct(u,n);let h="",g={},f=!1;if(!o){h=Bg(We,{pageName:r,dataViewName:s},a);const{activate:n,activateContainerActionPayload:o}=al(XE.PAGE,p,{semanticURL:h});if(n)return pu({type:Ue,activateContainerActionPayload:o,actionConfig:e});if(({continueExecution:f,removeActionPayload:g}=rl(p)),!f)return yn.rejectActionByID(t),fu()}return KE({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))),cu((async e=>{if(e&&e.type===Te)return r.push(Qc(e)),r;const{type:n,actionConfig:s,headers:a,response:o,skipSemanticUrl:i}=e;t=kh.getIn(o,G.ROOT);const{containerName:c,parentAction:l,resourceType:u}=s,d=Ct(c,s.context);let p;const h=kc(s?.context);if(s.isDeferLoaded){p=Ym(o),p.directUrlUpdation=!i;const t={acName:d,context:s.context};await Yc(p,s,t);const n={target:d,headers:a,context:s.context,containerItemID:e.containerItemID},c=zc(p,n);return r=Sg(Xh,c),r}if(n===Ue){const{activateContainerActionPayload:{semanticURL:t,containerItemID:n}}=e,a={acName:d,context:Md(n)};await Yc({directUrlUpdation:!0,semanticURL:t},s,a,!0),r.push(Sg(gg,{target:d,containerItemID:n,resourceType:XE.DATA}))}else if("DATA"===u&&l===yt){const{context:e}=s,t=o?.data,n={context:e,data:t};r.push(Sg(Xh,n))}else{const t=el(d,c,s.context),{removeActionPayload:n}=e;p=Ym(o),p.directUrlUpdation=!i;const l={acName:d,context:t};await Yc(p,s,l);const u=zc(p,{target:d,context:t,containerItemID:t,headers:a,currentCaseViewMode:h});u.resourceType=XE.DATA;const g=Zc(d,u);n.containerItemID&&tl(g)&&r.push(Sg(mg,{containerItemID:n.containerItemID,target:d})),ol(r),r.push(g)}return r})),iu((()=>(yn.resolveActionByID(n,t),Sh(r),r=[],r))))),Po(a)?cu(s,a,1):cu(s,1)));var s,a},QE=e=>{const{dataViewName:t,context:n,dataViewParameters:r}=e,s={data_view_ID:t,dataViewParameters:encodeURIComponent(JSON.stringify(r))},{restApi:a,reqType:o}=Wg("deleteDataObject",s);return Ei(zi(a,{method:o},n)).pipe(iu((t=>({response:t.data,actionInPayload:e}))),mu("Error occurred during ajax call at deleteDataObject Epic",n))},ZE=e=>{let t=0,n=[];return e.pipe(au(ht),yu(100),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>QE(e))),cu((async e=>{if(e&&e.type===Te){const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}return[]})),iu((()=>(1===n.length&&Tc(n[0].type)?yn.rejectActionByID(t):yn.resolveActionByID(t),Sh(n),n=[],n))))},eI=e=>{const{dataViewID:t,dataViewParameters:n,context:r}=e,s={data_view_ID:t},{restApi:a,reqType:o}=Wg("getDataObjectActions",s);return Ei(zi(a,{method:o,body:{dataViewParameters:n}},r)).pipe(iu((e=>({...e.data}))),mu("Error occurred during ajax call at GET data object actions : ",e.context))},tI=e=>{let t=0,n=[];let r={};return e.pipe(au(Ce),yu(100),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>eI(e))),cu((async e=>e&&e.type===Te?(n.push(Qc(e)),n):(r=e,[]))),iu((()=>(1===n.length&&Tc(n[0].type)?yn.rejectActionByID(t):yn.resolveActionByID(t,r),Sh(n),n=[],n))))},nI=[JE,e=>{let t=0,n=[];return e.pipe(au(pt),yu(100),ou((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:B.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return yn.rejectActionByID(t,!0,e),pu([])}return pu(e.payload).pipe(cu((e=>Eu(e))),cu((async e=>{if(e&&e.type===Te){const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?Ed.MODAL:Ed.PRIMARY,i={target:Ct(o,s),containerItemID:s,context:s};return n.push(Sg(mg,i)),n})),iu((()=>(1===n.length&&Tc(n[0].type)?yn.rejectActionByID(t):yn.resolveActionByID(t),Sh(n),n=[],n))))})))},e=>{let t=0,n=[];return e.pipe(au(gt),yu(100),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>Iu(e))),cu((async e=>{if(e&&e.type===Te){const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r,response:s,headers:a={}}=e,{containerName:o}=r,i=Ct(o,r.context),c=el(i,o,r.context),l={acName:i,context:c};await Yc(s,r,l);const u=zc(s,{target:i,context:c,containerItemID:c,headers:a});return u.resourceType=B.RESOURCE_TYPES.DATA,u.resourceStatus=B.RESOURCE_STATUS.UPDATE,u.key=JSON.stringify(r.requestPayload),n.push(Sg(sg,u)),n})),iu((()=>(1===n.length&&Tc(n[0].type)?yn.rejectActionByID(t):yn.resolveActionByID(t),Sh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(au(ft),yu(100),ou((e=>{const{isFormValid:r}=e.payload;if(({actionMgrID:t}=e.payload),!r){const e={type:B.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return yn.rejectActionByID(t,!0,e),pu([])}return pu(e.payload).pipe(cu((e=>Au(e))),cu((async e=>{if(e&&e.type===Te){const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r}=e,{containerItemID:s,isModalAction:a}=r,o=a?Ed.MODAL:Ed.PRIMARY,i={target:Ct(o,s),containerItemID:s,context:s};return n.push(Sg(mg,i)),n})),iu((()=>(1===n.length&&Tc(n[0].type)?yn.rejectActionByID(t):yn.resolveActionByID(t),Sh(n),n=[],n))))})))},ZE,tI,e=>{let t=0,n=[];return e.pipe(au(mt),yu(100),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>_u(e))),cu((async e=>{if(e&&e.type===Te){const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r,response:s,headers:a={}}=e,{containerName:o,actionID:i,context:c,actionName:l}=r,u=Ct(o,r.context);let d=X(o,c);d=ee(c,d);const p={target:u,context:d,containerItemID:d,headers:a,resourceType:B.RESOURCE_TYPES.DATA,resourceStatus:B.RESOURCE_STATUS.OPEN_FLOW_ACTION,key:JSON.stringify(r.dataViewParameters),actionID:i,actionName:l},h={acName:u,context:c};await Yc(s,r,h);const g=zc(s,p);return n.push(Sg(sg,g)),n})),iu((()=>(1===n.length&&Tc(n[0].type)?yn.rejectActionByID(t):yn.resolveActionByID(t),Sh(n),n=[],n))))},e=>{let t=0,n=[];return e.pipe(au(yt),yu(100),ou((e=>{const{isFormValid:r}=e.payload;({actionMgrID:t}=e.payload);const s=e.payload.context;if(!r){const e={type:B.SUBMISSION_FAILURE_TYPE.FORM_VALIDATION_ERROR};return yn.rejectActionByID(t,!0,e),pu([])}return tr({context:s,stateObj:Th(s),clearContextMessages:!0}),pu(e.payload).pipe(cu((e=>Cu(e))),cu((async e=>{if(e&&e.type===Te){const{payload:r}=e,s=Qc({...e,...r,actionMgrID:t});return n.push(s),n}const{actionInPayload:r,response:s,headers:a={}}=e,{containerName:o,containerItemID:i,resourceType:c,key:l}=r,u=Ct(o,r.context),d={acName:u,context:r.context};await Yc(s,r,d);const p={key:l,target:u,resourceType:c,containerItemID:i,headers:a,context:r.context};return n=((e,t,n,r)=>{const{resourceType:s,key:a,containerItemID:o}=r,i=zc(n,t);i.resourceType=s||B.RESOURCE_TYPES.DATA;const c=te(o);e.push(Sg(mg,i));const l=Rh(".dataContext","dataInfo",c),u=Rh(".dataContextParameters","dataInfo",c),d={context:c,skipSemanticUrl:!0,resourceType:s,parentAction:yt,dataContext:l,dataContextParameters:u},p=l&&u&&Bg(We,{pageName:G.PY_DETAILS,dataViewName:l},u)||"";if(o?.includes(G.PREVIEW)){const t={type:ce,payload:{pageName:G.VIEW_NAMES.PY_DATA_PREVIEW,container:G.PREVIEW,containerName:G.PREVIEW,...d}};e.push(t)}else if(s!==G.PAGE&&a===p&&o?.includes(G.PRIMARY)){const t={type:ce,payload:{pageName:G.VIEW_NAMES.PY_DETAILS,containerName:"",...d}};e.push(t)}return e})(n,p,s,{key:l,resourceType:c,containerItemID:i}),n})),iu((()=>(1===n.length&&Tc(n[0].type)?yn.rejectActionByID(t):yn.resolveActionByID(t),Sh(n),n=[],n))))})))}],rI=nI;function sI(e,t){return void 0===t&&(t=xE),di((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(pi(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:aI,DATA:oI}}=B;let iI=[],cI=!1;const lI={},uI=[e=>e.pipe(au(Se),sI(200),iu((e=>e.payload)),cu((e=>{cI=!1,Ci.subscribe(B.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{cI=!0}));const t=Li.getPreviewMode()&&Fi.addDebugHeaders({debugId:kh.generateUniqueID()});lI.dataContext=e.payload.dataViewName,lI.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=T()+a,i=e.options.context;let c;const l={},u=e?.payload?.caseClassName;if(q.isRemoteCase(u)){const{RemoteSystemID:e}=q.getRemoteCase(u);l.RemoteSystemID=e}if("POST"===r){c=e.payload,a.indexOf("viewType=")<0&&(a=`${a}?viewType=page`);let i;switch(il(s)){case aI:i={caseTypeID:c.caseTypeID,processID:c.processID,content:{}};break;case oI:i=lI;break;default:i=c}return Ei(zi(o,{method:r,body:i,headers:{...l,...t}},n)).pipe(iu((t=>({response:{...t.data},payload:e,headers:Hc(t.headers)}))),mu(": Error occurred during ajax call at historyEpic : ",e))}return Ei(zi(o,{method:"GET",headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(iu((n=>({response:n.data,payload:e,headers:{...Hc(n.headers),...t}}))),hu((r=>{if(s===nt){const n={messages:[{type:"error",message:r.response.data.errorDetails[0].localizedValue}],category:"PAGE"};pc.setComponentCache("assignments-launchAssignment-Error",n);const s=vg(Tp()),a=Rp.getEndPointInfo(s.split("/assignments")[0]),o=T()+a.routeEndpoint;return e={...e,routeKey:ze,resetSemanticURL:!0},Ei(zi(o,{method:a.reqType,headers:{...l,...t}},i.substring(0,i.lastIndexOf("/")))).pipe(iu((n=>({response:n.data,headers:{...Hc(n.headers),...t},payload:e}))))}return pu(Tg(": Error occurred during ajax call at historyEpic : ",r,n))})))})),cu((async e=>{if(cI)return iI;if(Ci.subscribe(B.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_STARTED,(()=>{cI=!0})),e&&e.type===Te)return Qc(e);const{headers:t={},response:n,payload:r}=e,s=Ym(n,{[B.STOPMERGEACTIONS]:!n.nextAssignmentInfo}),a=r.options.acName,o=kd(a)&&Bd(a)?vd(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[G.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=Bg(ze,{caseName:e.payload.payload.caseName}),l=l&&l.replace("{workID}",e.payload.payload.workID)||"",d=r?.payload?.caseClassName),(r?.routeKey===nt||r?.resetSemanticURL)&&(e=>{const t=Oc(e);let n=Bg(ze,{caseClassName:Dc(e)},{id:t});n=n?.replace("{workID}",String(Rc(t))).replace("{id}",String(Rc(t))),Jg({semanticURL:n,directUrlUpdation:!0,options:{}})})(s),((e,t)=>{const n=t?.data?.caseInfo;e===nt&&n?.caseTypeID&&n?.content&&Fc(n.caseTypeID)&&(n.content.coexistenceAction=Ye)})(r?.routeKey,s),Ci.publish(B.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_INIT,{pageName:u,pageClass:d});const p=kh.getIn(s,G.LOCALE_REFERENCES);await vp.loadLocaleResources(p);const h=kh.getIn(s,G.COMPONENTS);h&&await qr(h),$r(s,r.options.actionConfig,!0),Ci.publish(B.PUB_SUB_EVENTS.UI_EVENTS.SHOW_PAGE_DONE,{target:a,pageName:u,pageClass:d});let g=zc(s,c);return g=((e,t,n)=>{if(e===Bc.CASE||e===Bc.ASSIGNMENT){if(t?.caseInfo?.assignments&&t?.caseInfo?.assignments.length>0){const{key:e,flowName:r}=Xc(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===Bc.ASSIGNMENT?(n.caseViewMode=G.PERFORM_MODE,n.resourceType=Bc.CASE):n.caseViewMode=G.REVIEW_MODE}else n.resourceType=e,n.semanticURL=t.semanticURL;return n})(il(e.payload.routeKey),{...n.data,semanticURL:l,caseViewMode:G.REVIEW_MODE},g),iI.push(Zc(a,g)),((e,t)=>{let n=pc.getComponentCache("assignments-launchAssignment-Error")||{};n&&"object"==typeof n&&Object.keys(n).length>0&&(n={...n,context:e},t.push(Sg(fg,n)),pc.resetComponentCache("assignments-launchAssignment-Error"))})(o,iI),ol(iI),iI})),iu((()=>(cI||Sh(iI),iI=[],cI=!1,iI))),mu("Error occurred"))],dI=[e=>{let t=0,n=[];return e.pipe(au(le),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>{const{context:t,skipSemanticUrl:n=!1,insightID:r}=e;let s,a="";n||(a=Bg(He,{insightID:"{insightID}"}),a=a.replace("{insightID}",r),s=Rp.getEndPointInfo(a));const{restApi:o,reqType:i}=Wg(He,{...s?.payload||[],insightID:r});return Ei(zi(o,{method:i},t)).pipe(iu((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}})),mu(": Error occurred during ajax call at showPage Epic : ",e.context))})),cu((async e=>{if(e&&e.type===Te)return n.push(Qc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=yc.getTargetViewContainerName(ie),a=Ct(s,t.context),o=el(a,s,t.context),{response:i}=e,c=Ym(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await Yc(c,t,l,u,d);const p=zc(c,{target:a,context:o,containerItemID:o});p.resourceType=B.PAGE;const h=Zc(a,p);return n.push(h),ol(n),n})),iu((()=>{yn.resolveActionByID(t),Sh(n),n=[]})),HE())}],pI=[e=>{let t=0,n=[];return e.pipe(au(ue),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),cu((e=>{const{context:t,skipSemanticUrl:n=!1,dashboardID:r}=e;let s="";n||(s=Bg(qe,{dashboardID:r}),s=s.replace("{dashboardID}",r));const{restApi:a,reqType:o}=Wg(qe,{dashboardID:r});return Ei(zi(a,{method:o},t)).pipe(iu((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}})),mu(": Error occurred during ajax call at showPage Epic : ",e.context))})),cu((async e=>{if(e&&e.type===Te)return n.push(Qc(e)),n;const{actionConfig:t,skipSemanticUrl:r}=e,s=yc.getTargetViewContainerName(ie),a=Ct(s,t.context),o=el(a,s,t.context),{response:i}=e,c=Ym(i);c.directUrlUpdation=!r;const l={acName:a,context:o},u=!r,d=r;await Yc(c,t,l,u,d);const p=zc(c,{target:a,context:o,containerItemID:o});p.resourceType=B.PAGE;const h=Zc(a,p);return n.push(h)})),iu((()=>{yn.resolveActionByID(t),Sh(n),n=[]})),HE())}],hI=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 qm.apply(void 0,e.map((function(e){var n=e.apply(void 0,t);if(!n)throw new TypeError('combineEpics: one of the provided Epics "'+(e.name||"<anonymous>")+"\" does not return a stream. Double check you're not missing a return statement!");return n})))};try{Object.defineProperty(n,"name",{value:"combineEpics("+e.map((function(e){return e.name||"<anonymous>"})).join(", ")+")"})}catch(e){}return n}(...ey,...WE,...YE,...uI,...rI,...ny,...[e=>{let t=0;return e.pipe(au(at),iu((e=>(({actionMgrID:t}=e.payload),e.payload))),iu((()=>{const e=Ch()?.getState(),n=Wm();return E()(e,n)&&t>0?yn.resolveActionByID(t,{}):yn.rejectActionByID(t),[]})),HE())}],...dI,...pI),gI=()=>e=>t=>{const{type:n="",payload:r={}}=t||{},{category:s,context:a,transientItemID:o}=r;"HTTP"!==s&&[Re,Fe,De,Ve,Oe,Le].includes(n)&&(yl(a||o),Mn.removeContextTreeNode(a||o)),e(t)},fI={},mI=e=>{const t=kh.getIn(fI,[G.CONTEXT,e],[]),n=[];t.forEach((t=>{const r=t.substr(0,t.lastIndexOf("_")),s=kh.getIn(fI,[r,t],[]),a=s&&s.length>0&&s.indexOf(e);if(a>-1&&s.splice(a,1),!s||s&&0===s.length){kh.deleteIn(fI,[r,t]);const e=kh.getIn(fI,[r]);e&&0===Object.keys(e).length&&kh.deleteIn(fI,[r]),n.push({dataPageName:r,dataPageNameWithHash:t})}})),kh.deleteIn(fI,[G.CONTEXT,e]);const r=kh.getIn(fI,[G.CONTEXT]);(!r||r&&0===Object.keys(r).length)&&kh.deleteIn(fI,[G.CONTEXT]),n.length>0&&Sh(Pg({dataPagesToBeRemoved:n}))},yI=(e={},t)=>{Object.keys(e).forEach((n=>{const r=kh.getIn(e,[n],{});Object.keys(r).forEach((e=>{((e,t,n)=>{const r=kh.getIn(fI,[G.CONTEXT,n]);if(kh.getIn(fI,[e])){const r=kh.getIn(fI,[e,t],[]);kh.setIn(fI,[e,t],[...new Set([...r,n])])}else kh.setIn(fI,[e,t],[n]);r?kh.setIn(fI,[G.CONTEXT,n],[...new Set([...r,t])]):kh.setIn(fI,[G.CONTEXT,n],[t])})(n,e,t)}))}))},EI=()=>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===Ve||e===De)&&t.forEach((e=>{mI(e)}))})(s,r),s===Re||s===Ae||s===it){const e=s===it?t:t.shared;yI(e,n)}else s===Ve?(mI(n),yI(t.shared,n)):s===De&&mI(n)})),e(t)},II=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}=B;if(r===De){const{resourceType:t,key:n,context:r}=kh.getIn(e.getState(),["containers",s,"items",a])||{},o={resourceType:t,key:n,context:r,containerItemID:a};Ci.publish(u.CONTAINER_EVENTS.CLOSE_CONTAINER_ITEM,o),s===`${B.APP.APP}/${G.PRIMARY}`&&l===G.CONTAINER_TYPE.MULTIPLE&&Ci.publish(u.CONTAINER_EVENTS.CLOSE_MULTI_TYPE_PRIMARY_CONTAINER_ITEM,{key:n,newAccessedOrder:c})}i&&i.length>0&&(r===Ve||r===De)&&i.forEach((e=>{zu.cleanCaches(e)})),r!==Ve&&r!==De||zu.cleanCaches(o),t(n)},AI=()=>e=>t=>{const{payload:{context:n=null,transientItemID:r=null,clearStateMachine:s=!0}={},type:a}=t;n&&(a===Re||a===Fe||a===Ve||a===De)&&s&&(Pr(n),Sr(n)),r&&a===we&&(Pr(r),Sr(r)),e(t)},_I=function(e){void 0===e&&(e={});var t,n=new(0,_f.constructor)(_f.schedulerActionCtor),r=new Sf,s=function(s){t=s;var a=new Sf,o=new Sf,i=a.asObservable().pipe(gi(n)),c=new Pf(o.pipe(gi(n)),t.getState());return r.pipe(iu((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})),cu((function(e){return Ei(e).pipe(fi(n),gi(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}(),CI=e=>{const t=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||hf;if(null!==Ch())Fh();else{const n=df(Hm(e),t(Rf.reduxBatch,function(...e){return t=>(n,r)=>{const s=t(n,r);let a=()=>{throw new Error(af(15))};const o={getState:s.getState,dispatch:(e,...t)=>a(e,...t)},i=e.map((e=>e(o)));return a=hf(...i)(s.dispatch),{...s,dispatch:a}}}(Yl,gI,EI,AI,_I,II),Rf.reduxBatch));_I.run(hI),_h(n)}},SI={publishConstellationLoadedEvent:()=>{Ci.publish(G.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS.CONSTELLATION_LOADED,{})}};const TI=new class{activateContainerItemOnSwitch(e){const t=`${G.APP.APP}/${G.PRIMARY}`,n={target:t,containerItemID:Pd(t,e)};hd({}).getPConnect().getContainerManager().activateContainerItem(n)}removeContainerItemOnClose(e){const t=`${G.APP.APP}/${G.PRIMARY}`,n={target:t,containerItemID:Pd(t,e)};hd({}).getPConnect().getContainerManager().removeContainerItem(n)}showCasePreview(e,t){const n=hd({meta:{type:"PreviewViewContainer",config:{name:G.PREVIEW}},options:{context:G.APP.APP,target:"root/hybrid_preview"}}),r=n.getPConnect().getContainerManager();r.resetContainers({name:G.PRIMARY,context:G.APP.APP}),bd(G.APP.APP,G.PREVIEW)||r.initializeContainers({type:"multiple",name:G.PREVIEW}),n.getPConnect().getActionsApi().showCasePreview(e,{caseClassName:t})}closeCasePreview(){hd({}).getPConnect().getContainerManager().resetContainers({name:G.PREVIEW,context:G.APP.APP})}isFormDirty(e){const t=`${G.APP.APP}/${G.PRIMARY}`,n=hp(t,e);return hl.isStateModified(n)}getEventUtils(){return SI}getBroadcastUtils(){return sy}isTraditionalUICase(e){return Fc(e)}};const NI=class{static openCase(e,t=B.APP.APP,n={}){return n.renderInline=!0,n.pageName?Dp.setDefaultCasePage(n.pageName):(Dp.setDefaultCasePage(G.PY_DETAILS),n.pageName=G.PY_DETAILS),n?.disableAssignmentHeader?Dp.disableAssignmentHeader(n.disableAssignmentHeader):Dp.disableAssignmentHeader(!1),rd.openCase(e,t,G.PRIMARY,n)}static createCase(e,t=B.APP.APP,n={}){return n.renderInline=!0,n.pageName?Dp.setDefaultCasePage(n.pageName):(Dp.setDefaultCasePage(G.PY_DETAILS),n.pageName=G.PY_DETAILS),n?.disableAssignmentHeader?Dp.disableAssignmentHeader(n.disableAssignmentHeader):Dp.disableAssignmentHeader(!1),rd.createCase(e,t,G.PRIMARY,n)}static getNextWork(e=B.APP.APP,t={}){return t.renderInline=!0,t.pageName?Dp.setDefaultCasePage(t.pageName):(Dp.setDefaultCasePage(G.PY_DETAILS),t.pageName=G.PY_DETAILS),t?.disableAssignmentHeader?Dp.disableAssignmentHeader(t.disableAssignmentHeader):Dp.disableAssignmentHeader(!1),rd.getNextWork(e,G.PRIMARY,t)}static openAssignment(e,t=B.APP.APP,n={}){return n.renderInline=!0,n.pageName?Dp.setDefaultCasePage(n.pageName):(Dp.setDefaultCasePage(G.PY_DETAILS),n.pageName=G.PY_DETAILS),n?.disableAssignmentHeader?Dp.disableAssignmentHeader(n.disableAssignmentHeader):Dp.disableAssignmentHeader(!1),rd.openAssignment(e,t,G.PRIMARY,n)}static openPage(e,t,n=B.APP.APP,r={}){const s=ie;r?.defaultCasePage?Dp.setDefaultCasePage(r.defaultCasePage):Dp.setDefaultCasePage(G.PY_DETAILS),r?.disableAssignmentHeader?Dp.disableAssignmentHeader(r.disableAssignmentHeader):Dp.disableAssignmentHeader(!1);const a={viewName:e,className:t,acTargetName:G.PRIMARY,actionMgrID:yn.getNextActionMgrId(),context:n},{promise:o}=yn.actionManagerPromise(s,a.actionMgrID);return Sh({type:s,payload:{...a}}),o}static getCurrentContextAPI(e,t=B.APP.APP){return hd({meta:{config:{}},options:{context:t,pageReference:e,containerName:G.PRIMARY}}).getPConnect()}};const PI=new class{createC11nEnv=e=>hd(e);getContextUtils=()=>o;getRoutingManager=()=>i;getComponentsRegistry=()=>an;getStateManager=()=>g;getActionCreators=()=>f;getStreamObservable=()=>l;getActionProcessor=()=>qh;getActionHandler=()=>Hh;renderApp=(e,t)=>{const n={context:G.APP.APP},r={...kh.getIn(e,G.ROOT),options:n};CI(e),$r(e,n,!0);const s=this.createC11nEnv({meta:r,isRoot:!0});Ci.publish(B.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:s,domContainerID:t})};updateStoreWithUiRoot=async(e,t,n)=>{const r=Ym(e),{data:s,uiResources:a={}}=e,o=kh.getIn(a,G.CONTEXT_DATA);await Yc(r,{},{},!1,!0);const i={...s,[G.CONTEXT_DATA]:o},{root:c}=a;Jd(c,t,i,n)};fetchEndPointResource=(e,t,n)=>{zi(e,{method:"GET"},G.APP.ROOT).then((async e=>{const{data:r,status:s}=e;200===s&&this.updateStoreWithUiRoot(r,t,n)}))};loadComponent=async(e,t,n)=>qr(n).then((()=>{const n=this.createC11nEnv({meta:e,isRoot:!0});Ch()||CI({}),Ci.publish(B.PUB_SUB_EVENTS.EVENT_RENDER_APP,{props:n,domContainerID:t})}));setStaticServerUrl=(e,t,n)=>{Gr.initServer(e,t,n)};loadView=async(e,t,n=[])=>{C();const r=Ym(e),s=kh.getIn(r,G.VIEWS),a=kh.getIn(r,G.NAVIGATIONS),o=kh.getIn(r,G.COMPONENTS)||[];o.push(...n);const i=kh.getIn(r,G.STATIC_SERVER_URL),c=kh.getIn(r,G.APPLICATION_DATA);s&&Qp(s),a&&Zp(a),(e=>{e&&(jg=e.pyLabel)})(c),i&&Gr.initServer(i),await qr(o,i).then((()=>this.renderApp(r,t)))};initAppShell=(e,t,n)=>{rf(e),yc.buildActionTargetMap(t),C(n)};initRoutingTable=(e,t)=>{rf(e,!0),C(t)};setAppAlias=e=>{Gr.setAppAlias(e)};getHomeRestApi=e=>{const{restApi:t}=Gg("home",{portalName:e});return T()+t};getViewRestApi=(e,t)=>{const{restApi:n}=((e,t)=>{let n={restApi:""};try{if(tf()&&!t){const t=Sp(),r=Rp.processUrl(t,!0),s=Rp._getMatchedRouteInRoutingTable(r)||"",a=Rp.getRoutingInfo(),o=Rp.processUrl(t,!1).split("/"),i=o[o.length-1];let{caseID:c}=a&&a.routes[s].payload;c=c.replace("{workID}",i),n=Rp.getRestEndPoint("loadView",{caseID:c,viewID:e})||{}}else n=Rp.getRestEndPoint("showView",{page:e,pageClass:t})||{}}catch(e){}return n})(e,t);return T()+n};loadRootComponent=async(e,t,n=[],r,s,a)=>{const{config:{name:o}={}}=t;Ch()||CI({}),a&&(ip(`${G.APP.ROOT}/${o}`),op().deleteContainerItem(`${G.APP.ROOT}/${o}`)),op().getContainerItems()?.length>1&&!o?.startsWith("hybrid_")&&"authoring-preview"!==o&&Fh(),Sh(Xh({data:{},context:G.APP.ROOT}));const i=this.createC11nEnv({meta:t,options:{context:G.APP.ROOT,pageReference:"",target:`${G.APP.ROOT}/${o}`}}),c=i.getPConnect(),l=c.getContextName(),u=c.getContainerName(),d=c.getContainerManager();vd(`${l}/${u}`)||"noPortal"===t.config?.renderingMode||d.initializeContainers({type:"single"});const p=["RootContainer","Region","ModalViewContainer","PreviewViewContainer","reference",...n];return qr(p).then((()=>{Ci.publish(B.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===T()&&(s=this.getHomeRestApi(t)),this.fetchEndPointResource(s,r)};loadPortalView=(e,t)=>{const n=this.getHomeRestApi(e);this.fetchEndPointResource(n,t,!0)};configureForBrowserBookmark=e=>{nf(e)};checkIfSemanticURL=()=>tf();onPCoreReady=e=>{Ci.subscribe(B.PUB_SUB_EVENTS.EVENT_RENDER_APP,e,"renderAppCallback")};onPCoreCleanup=e=>{Ci.subscribe(B.PUB_SUB_EVENTS.EVENT_UNMOUNT_APP,e,"unmountAppCallback")};setFieldsDefaultConfigs=e=>{Fr.updateFieldDefaults(e)};setGoogleMapsAPIKey=e=>{P(e)};setFetchDefaultHeaders=e=>{Qi(e)};setFetchAuthInfo=e=>{Zi(e)};getCaseApi=()=>rd;getMashupApi=()=>NI;enableAppRouting=e=>{kg(e)};initStore=()=>CI({});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=hd({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 RI=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 DI=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 RI(e.serviceConfig),this.behaviorOverrides=e.behaviorOverrides,this.initBroadcast=!!e.initBroadcast,this.cookieComplianceMethod=e.cookieComplianceMethod??"none",this.isExtraCallRequiredForDefaultHome=e.isExtraCallRequiredForDefaultHome??"false"}},bI=async()=>{const e=Dp.getLocale(),t=Dp.getFeatureMap().localizationVersion||1;let n;if("en-US"!==e)try{let r;2===t?r=[e]:(r=[vp.GENERIC_BUNDLE_KEY,vp.MESSAGE_BUNDLE_KEY,vp.FIELD_LABELS_BUNDLE_KEY,...vp.getCaseTypeLocaleReferences()],n=await vp.isCurrentLocalePackAvailable());const s=r.map((async r=>{2===t?await(async e=>{const t=Dp.getFeatureMap().availableLanguagePacks||[];if(!e||!t.includes(e))return void console.warn(`current locale ${e} is not supported by application.`);const n={locale:e},r=await ac("getLocalizationPack",{queryPayload:n});if((201===r.status||200===r.status)&&r.data){const e=r.data;Object.keys(e).forEach((t=>{vp.setLocaleForRule(e[t],t)}))}})(r):n&&await(async(e,t)=>{const n=await Gr.getSvcLocale(t,`${e}.json`);if(n?.ok&&e){const t=await n.json();vp.setLocaleForRule(t,e)}})(r,e)}));await Promise.allSettled(s)}catch(e){console.warn(e)}},OI="@P .viewConfig";let vI=0;const xI=new class{#f(e,t,n){rf(e),yc.buildActionTargetMap(t),C(n)}init(e){const t=new DI(e),n={...t.environmentInfo,renderingMode:t.renderingMode};kg(t.enableRouting),CI({}),Dp.setTheme(t.theme),Dp.setCookieComplianceMethod(t.cookieComplianceMethod),Dp.setIsExtraCallRequiredForDefaultHome(t.isExtraCallRequiredForDefaultHome),Fr.updateFieldDefaults(t.fieldDefaults),Fi.setDefaultHeaders(t.additionalHeaders),this.#f(t.routingInfo,t.actionModel,{server:t.restServerConfig,reAuthUrl:t.serviceConfig.reAuthUrl}),Gr.setAppAlias(t.serviceConfig.appAliasWithoutServlet||t.serviceConfig.appAlias),P(t.serviceConfig.googleMapKey),Gr.initServer(t.serviceConfig.staticContentServer,t.serviceConfig.appStaticContentServer,t.tokens.C11NB2S),vp.setTimezone(t.timezone),Dp.setEnvironmentInfo(n),Dp.setLocale(t.locale),q.setRemoteCaseMapping(t.remoteCaseMapping),wu.setConnectionConfig({messagingService:t.serviceConfig.messagingService}),pc.init(),t.initBroadcast&&TI.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=hd({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 PI.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"===Dp.environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||(e.renderingMode="EMBED"),g?.cspNonce&&(window.__webpack_nonce__=g.cspNonce),this.init(e)};launchViewByName=(e,t,n,r,s,a,o,i)=>{vI+=1;const c=i||`mashup${vI}`,l={type:"RootContainer",config:{viewConfig:OI,renderingMode:"view",name:c}};PI.loadRootComponent(e,l,s,a,o).then((()=>PI.loadViewByName(t,n,r,c)))};launchView=(e,t,n=[],r,s,a,o)=>{vI+=1;const i="hybrid"===o?`hybrid_${vI}`:o;vI+=1;const c=i||`mashup${vI}`,l={type:"RootContainer",config:{viewConfig:OI,renderingMode:"portal",name:c}};o===G.HYBRID&&Ku.setRuntimeParam(G.HYBRID_ROOT_CONTAINERNAME,c),Ku.setRuntimeParams(r),PI.loadRootComponent(e,l,n,s,a).then((()=>PI.updateStoreWithUiRoot(t,c)))};launchPortal=(e,t,n,r=[])=>{vI+=1;const s=n||`portal${vI}`,a={type:"RootContainer",config:{viewConfig:OI,renderingMode:"portal",skeleton:"LoadingComponent",name:s}};r.push(a.config.skeleton),Dp.isPortalLoaded=!0,PI.loadRootComponent(e,a,r).then((()=>PI.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)}}PI.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 Gr.importCustomComponentMap(r),"true"===a&&"other"!==o&&await this.importDesignSystemComponentMap(n,s,o),t&&t(),!0);return new Promise(((e,t)=>{bI().then((async()=>{const t=PI.getComponentsRegistry();"ReactRoot"in t.getLazyMap()?e(!0):t.getComponent("ReactRoot")?e(await i()):Ci.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")}},wI={createViewRule:(e,t)=>{const{restApi:n,reqType:r}=Wg("createViewRuleByID");return zi(n,{method:r,body:e},t).then((e=>e.data))},getViewRule:(e,t)=>{const{restApi:n,reqType:r}=Wg("getViewRuleByID",{ID:e});return zi(n,{method:r},t).then((e=>e.data))},updateViewRule:(e,t,n)=>{const{restApi:r,reqType:s}=Wg("updateViewRuleByID",{ID:e});return zi(r,{method:s,body:t},n).then((e=>e.data))},deleteViewRule:(e,t)=>{const{restApi:n,reqType:r}=Wg("deleteViewRuleByID",{ID:e});return zi(n,{method:r},t).then((e=>e.data))}},MI={"Content-Type":"application/json"},LI={addCaseFollower:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({users:t.map((e=>({ID:e})))});return ac("addCaseFollower",{body:s,queryPayload:r,headers:MI},n)},deleteCaseFollower:(e,t,n)=>ac("deleteCaseFollower",{queryPayload:{caseID:e,followerID:t}},n),getCaseFollowers:(e,t)=>ac("getCaseFollowers",{queryPayload:{caseID:e}},t).then((e=>e.data.followers))},UI={addRelatedCases:(e,t,n)=>{const r={caseID:e},s=JSON.stringify({cases:t});return ac("addRelatedCases",{body:s,queryPayload:r},n)},removeRelatedCase:(e,t,n)=>ac("removeRelatedCase",{queryPayload:{caseID:e,relatedCaseID:t}},n),getRelatedCases:(e,t)=>ac("getRelatedCases",{queryPayload:{caseID:e}},t).then((e=>e.data.relatedCases))},FI="operatorDetails",jI={getOperatorDetails:(e,t=!1)=>{const{reqType:n}=Wg(FI,{});if("GET"===n){const t={encodedOperatorId:encodeURIComponent(`{"opname":"${e}"}`)};return ac(FI,{queryPayload:t})}return t?ac("operatorDetailsByBusinessID",{body:{dataViewParameters:{BusinessID:e}}}):ac(FI,{body:{dataViewParameters:{ID:e}}})}},VI=async e=>{const t=Ym(e),n=kh.getIn(t,G.COMPONENTS);$r(t,{},!0);const r=kh.getIn(t,G.LOCALE_REFERENCES);await vp.loadLocaleResources(r||[]),await qr(n)},kI=(e,t,n)=>Wh.resolveView(e,t,n),$I={"Content-Type":"application/json"};const BI=new class{constructor(){this.mentionsTagsCancelTokenSource=[],this.mentions=[]}getFeeds=(e,t,n,r,s,a,o)=>{const{getLocaleValue:i}=vp;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=cc();return s.push(d),ac("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 VI({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=>{lc(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 ac("postFeedMessages",{body:a,headers:$I},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 ac("editFeedMessage",{queryPayload:{messageID:e},body:a,headers:$I},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});ac(a,{body:o,queryPayload:{pulseContext:e},headers:$I},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);ac("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)=>ac("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=cc();return this.mentionsTagsCancelTokenSource.push(i),ac("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=>{lc(e)||t.reportError(": Error occurred during ajax call at getMentionSuggestions API : ",e.response.data)}))};getMentionTypes=e=>ac("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=cc();return this.mentionsTagsCancelTokenSource.push(a),ac("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=>{lc(e)||t.reportError(": Error occurred during ajax call at getTagSuggestions API : ",e.response.data)}))}},GI={getTaggedCases:(e,t)=>ac("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)=>ac("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 ac("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)=>ac("deleteCaseTag",{queryPayload:{caseID:e,tagID:t}},n.getContextName()).catch((e=>{n.reportError(": Error occurred during ajax call at removeTag API : ",e.response)})),getTagsLandingPageURL:e=>Lu.getPageDataAsync("D_pxGetTagsLandingPageURL",e.getContextName(),{},{invalidateCache:!0}).catch((t=>{e.reportError(": Error occurred during ajax call getTagsLandingPageURL API : ",t.response)}))},WI=(e,t)=>{cp(t.getContextName(),e.etag),lp(t.getContextName(),e.etag)},HI={getParticipants:(e,t)=>ac("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)=>ac("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)=>ac("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)=>ac("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)=>{ac("createParticipant",{body:a,queryPayload:s,headers:o},r.getContextName()).then((t=>{WI(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)=>{ac("updateParticipant",{body:n,queryPayload:s,headers:a},r.getContextName()).then((t=>{WI(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)=>{ac("deleteParticipant",{queryPayload:r,headers:s},n.getContextName()).then((t=>{WI(t.headers,n),e()})).catch((e=>{n.reportError(": Error occurred during ajax call at deleteParticipant API : ",e.response),t(e.response)}))}))}};function qI(e=[]){return e.reduce(((e,t)=>(e[t.personalizationID]={name:t.name,personalizationState:JSON.parse(t.personalizationState||"{}")},e)),{})}const zI="create",YI="update",KI="delete";function XI(e,t,n,r){const s=ah(t);if(s){switch(e){case zI:case YI:{const{markAsDefault:e,...t}=r;Object.entries(t).length>0&&(s.allPersonalizations[n]=t),e&&(s.defaultPersonalization=n);break}case KI:delete s.allPersonalizations[n],s.defaultPersonalization===n&&(s.defaultPersonalization="");break;default:return null}return s}return null}const JI={},QI=e=>{const t=ah(e);if(t)return Array.isArray(t.allPersonalizations)&&(t.allPersonalizations=qI(t.allPersonalizations)),Promise.resolve(t);const{restApi:n,reqType:r}=Wg("getUIListPersonalizations",{listID:e});return zi(n,{method:r,body:{}}).then((e=>{const{data:t}=e;return{allPersonalizations:qI(t.allPersonalizations),defaultPersonalization:t.defaultPersonalization}}))},ZI=(e,t,n)=>{const{restApi:r,reqType:s}=Wg("createListPersonalization",{listID:e});return XI(zI,e,t,n),zi(r,{method:s,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}}).then((e=>{const n=e.data;return JI[t]=n,e}))},eA=(e,t,n)=>{const r=JI[t]||t;XI(YI,e,t,n);const{restApi:s,reqType:a}=Wg("updateListPersonalization",{listID:e,personalizationID:r})||{};return zi(s,{method:a,body:{...n,personalizationState:JSON.stringify(n.personalizationState)}})},tA=(e,t)=>{const n=JI[t]||t;XI(KI,e,t);const{restApi:r,reqType:s}=Wg("deleteListPersonalization",{listID:e,personalizationID:n});return zi(r,{method:s,body:{}}).then((e=>(JI[t]&&delete JI[t],e)))};const nA=function(e){return e?{createPersonalization:ZI.bind(null,e),updatePersonalization:eA.bind(null,e),deletePersonalization:tA.bind(null,e),fetchPersonalizations:QI.bind(null,e)}:{createPersonalization:()=>Promise.resolve(""),updatePersonalization:()=>Promise.resolve(),deletePersonalization:()=>Promise.resolve(),fetchPersonalizations:()=>Promise.resolve({})}},rA="getDataObjects",sA="getInsightByID",aA=["LocalList","RemoteList","PromptList","DataPage"];let oA=null;const iA={},cA=e=>Nu.getAppCacheKey(`PrimaryFields-${e}`);function lA(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 uA={getDataObjects:function(){const e=Nu.getAppCacheKey(rA);if(window.sessionStorage.getItem(e))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(e)));const{restApi:t,reqType:n}=Wg(rA,{}),r=zi(t,{method:n});return r.then((t=>{window.sessionStorage.setItem(e,JSON.stringify(t))})),r},getDataPageObjects:function(e=!0){if(oA)return oA;const t=Nu.getAppCacheKey("getDataPageObjects");if(e&&window.sessionStorage.getItem(t))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(t)));const{restApi:n,reqType:r}=Wg("getDataPages",{datapageRequestType:"explorable"});return oA=zi(n,{method:r,datapageRequestType:"explorable"}),oA.then((e=>{oA=null,window.sessionStorage.setItem(t,JSON.stringify(e))})),oA},getDataViewMetadata:function(e,t,n){if(!t){const{sourceMetadata:t,sourceFields:n}=function(e){const t=sh(e);if(t&&t.classID){let e=ih(t.classID);const n=new Set(t.primaryFields),r=t.rdFields?.fields?.filter((e=>e.indexOf(".")>0));if(r&&!kh.isEmpty(r)){const n=r.reduce(((e,n)=>{const r=Jp(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&&aA.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:lA(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 qu.init(r).then((({dataSourceMetaData:e})=>Promise.resolve({data:e})))},getDefaultColumns:function(e){const t=Nu.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}=Wg("getListData",{dataViewName:"D_pzGetDefaultColumns"}),s=zi(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=sh(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=Nu.getAppCacheKey(`RDColumns-${e}`);if(window.sessionStorage.getItem(r))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(r)));const s=Nu.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=Nu.getAppCacheKey(`PFColumns-${e}${t}`);if(window.sessionStorage.getItem(n))return Promise.resolve(JSON.parse(window.sessionStorage.getItem(n)));const r=Nu.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=cA(t);window.sessionStorage.getItem(o)||(iA[t]?r.push(iA[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=Nu.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=cA(e);window.sessionStorage.setItem(n,JSON.stringify(t))}))})).finally((()=>{e.forEach((e=>{delete iA[e]}))}));return e.forEach((e=>{iA[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=cA(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}=Wg("getInsightIDs");return zi(e,{method:t})},getInsightByID:function(e){const t=oh(e);if(t)return Promise.resolve({data:{pyInsights:[t]}});const n={insightID:e},{restApi:r,reqType:s}=Wg(sA,n);return zi(r,{method:s})},getInsightsByID:function(e){const t={insightID:e.join(",")},{restApi:n,reqType:r}=Wg(sA,t);return zi(n,{method:r})},createInsight:function(e){const{restApi:t,reqType:n}=Wg("createInsight");return zi(t,{method:n,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})},updateInsight:function(e,t){const n={insightID:e},{restApi:r,reqType:s}=Wg("updateInsight",n),a=t.UpdateDateTime;return zi(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}=Wg("deleteInsight",t);return zi(n,{method:r})},exportToExcel:function(e){const{restApi:t,reqType:n}=Wg("exportToExcel");return zi(t,{method:n,body:JSON.stringify(e)})},exportToCSV:function(e){const{restApi:t,reqType:n}=Wg("exportToCSV");return zi(t,{method:n,body:JSON.stringify(e)})},scheduleInsight:(e,t)=>{const n={insightID:e},{restApi:r,reqType:s}=Wg("scheduleInsight",n);return zi(r,{method:s,body:JSON.stringify(t)})},updateScheduledInsight:(e,t,n)=>{const r={insightID:e,scheduleID:t},{restApi:s,reqType:a}=Wg("updateScheduledInsight",r);return zi(s,{method:a,body:JSON.stringify(n)})},deleteScheduledInsight:(e,t)=>{const n={insightID:e,scheduleID:t},{restApi:r,reqType:s}=Wg("deleteScheduledInsight",n);return zi(r,{method:s})},translateStrings:function(e){const{restApi:t,reqType:n}=Wg("translateStrings");return zi(t,{method:n,body:JSON.stringify(e)})}};const dA=new class{addRoutes=e=>{return t=e,void Rp.addRoutes(t);var t}};const pA=class{static registerModule(e,t,n){n[e]=()=>t}};const hA=class{static getCaseEvent=()=>Object.freeze(B.PUB_SUB_EVENTS.CASE_EVENTS);static getDataEvent=()=>Object.freeze(B.PUB_SUB_EVENTS.DATA_EVENTS);static getTransientEvent=()=>Object.freeze(B.PUB_SUB_EVENTS.EVENT_TRANSIENT_ITEMS);static getBootstrapShellEvent=()=>Object.freeze(B.PUB_SUB_EVENTS.BOOTSTRAP_SHELL_EVENTS);static getBulkProcessEvent=()=>Object.freeze(B.PUB_SUB_EVENTS.EVENT_BULKACTION);static getLocalActionProcessEvent=()=>Object.freeze(B.PUB_SUB_EVENTS.EVENT_LOCALACTION_SUBMISSION)},gA={getResolvedSemanticURL:(e,t,n)=>Rp.getResolvedSemanticURL(e,t,n),getActions:()=>({ACTION_OPENWORKBYHANDLE:ze,ACTION_SHOWDATA:We,ACTION_SHOWVIEW:Ge}),updateSemanticURLAndDocumentTitle:e=>Rp.updateSemanticURLAndDocumentTitle(e)};const fA=new class{constructor(){this.genericFailedMessage="Failed to display content. Contact the application administrator."}getGenericFailedMessage(){return this.genericFailedMessage}setGenericFailedMessage(e){this.genericFailedMessage=e}},mA={setTokens:e=>{Zi({tokenInfo:e}),Qi(e?.csrf&&!e?.access_token?{pzCTkn:e?.csrf}:{Authorization:`${e?.token_type} ${e?.access_token}`}),setTimeout((()=>Ci.publish("updateSession",{updateStatus:"success"})),0)},revokeTokens:async()=>Ni(),getAuthInstance:e=>Ti.init(e),setAuthorizationHeader:e=>{Qi({Authorization:e}),setTimeout((()=>Ci.publish("updateSession",{updateStatus:"success"})),0)}};const yA=new class{getDebouncedSubject(e){return(new Sf).pipe(sI(e))}};Vr.register("email",(e=>{let t=null;return e&&!function(e){const t="[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+",n="\\x5c[\\x00-\\x7f]",r=`(${t}|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|${n})*\\x5d)`,s=`(${t}|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|${n})*\\x22)`;return new RegExp(`^${s}(\\x2e${s})*\\x40${r}(\\x2e${r})*$`).test(e)}(e)&&(t=vp.getLocaleValue("Enter a valid email address","Messages")),t})),Vr.register("integer",(e=>{let t=null;return e&&!/^(-)?\d+$/.test(e)&&(t=vp.getLocaleValue("Invalid number","Messages")),t})),Vr.register("required",(e=>Array.isArray(e)&&0===e.length||null==e||""===e?vp.getLocaleValue("Cannot be blank","Messages"):null)),Vr.register("url",(e=>{let t=null;return e&&!function(e){let t;try{t=new URL(e)}catch{return!1}return"http:"===t.protocol||"https:"===t.protocol||"ftp:"===t.protocol}(e)&&(t=vp.getLocaleValue("Enter a valid url","Messages")),t})),setTimeout((()=>{const e=vp.getLocaleValue("Enter a valid phone number","Messages");s.e(654).then(s.bind(s,654)).then((({parsePhoneNumberFromString:t})=>{Vr.register("phone",(n=>{let r=null;n&&!/^\+?\d+$/.test(n)&&(r=e);const s=n?.startsWith("+");if(n&&s){const s=t(n);s?.isPossible()&&n===s?.number||(r=e)}return r}))}))}),G.PRIORITY.TRIVIAL);const EA=(e,t)=>{switch(t){case"invalid":return vp.getLocaleValue(`Incorrect ${e}`,"Messages");case"incomplete":return vp.getLocaleValue(`Incomplete ${e}`,"Messages");default:return null}};Vr.register("datetime",(e=>EA("DateTime",e))),Vr.register("date",(e=>EA("Date",e))),Vr.register("time",(e=>EA("Time",e))),Vr.register("attachment",((e,t)=>(Rh(`.attachmentsList${t.pageReference?.replace("caseInfo.content","")}${t.property}`,"context_data",t.context)||[]).some((e=>e.props?.error))?vp.getLocaleValue("Error with one or more files"):null));const IA={createConversation:(e,t,n,r=[])=>{for(const e of r)e?.cancel&&"function"==typeof e.cancel&&e.cancel();const s=cc();r.push(s);const a={assistantID:t},o=JSON.stringify({contextID:e});return ac("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 ac("sendMessage",{body:a,queryPayload:s},r)}};const AA=class{caseTypeAccessMap=new Map;constructor(){this.caseTypeAccessMap=Dp.getCaseTypeList().reduce(((e,t)=>(e.set(t.pyWorkTypeImplementationClassName,t.hasCreateAccess??!0),e)),new Map)}hasCreateAccess(e){return this.caseTypeAccessMap.get(e)}static getInstance(){return this.instance||(this.instance=new this),this.instance}};class _A{constructor(){_A.behaviorOverrides={}}static behaviorOverrides={};getPCoreVersion=()=>"24.2.4";onPCoreReady=e=>PI.onPCoreReady(e);onPCoreCleanup=e=>PI.onPCoreCleanup(e);getComponentsRegistry=()=>PI.getComponentsRegistry();checkIfSemanticURL=()=>PI.checkIfSemanticURL();isValidSemanticURL=()=>(()=>{if(tf()){const e=Rp.processUrl(Sp(),!0);return!!Rp._getMatchedRouteInRoutingTable(e)}return!1})();getRoutingUtils=()=>dA;getViewResources=()=>m;configureForBrowserBookmark=e=>PI.configureForBrowserBookmark(e);getStore=()=>Ch();resetStore=()=>Fh();getMessageManager=()=>ir;getCoexistenceManager=()=>TI;getStoreValue=(e,t,n)=>Rh(e,t,n);getContainerUtils=()=>p;getAnnotationUtils=()=>bl;getFieldUtils=()=>Yn;getFieldDefaultUtils=()=>Fr;getAssetLoader=()=>Gr;getAttachmentUtils=()=>jp;getViewRuleApi=()=>wI;getFeedUtils=()=>BI;getTagUtils=()=>GI;getGenAIAssistantUtils=()=>IA;getStakeholderUtils=()=>HI;getUserApi=()=>jI;getCaseFollowerApi=()=>LI;getCaseUtils=()=>$c;getStateUtils=()=>fc;getRelatedCasesApi=()=>UI;getPersonalizationUtils=nA;getDataApi=()=>qu;getDataApiUtils=()=>Nu;getAnalyticsUtils=()=>uA;getLocaleUtils=()=>vp;registerLocaleManager=e=>{const t=this.getLocaleUtils();Object.keys(e).forEach((n=>{t[n]=e[n]}))};setBehaviorOverrides=e=>{_A.behaviorOverrides=e};setBehaviorOverride=(e,t)=>{_A.behaviorOverrides[e]=t};getBehaviorOverrides=()=>_A.behaviorOverrides;getBehaviorOverride=e=>_A.behaviorOverrides[e];getAsynchronousUtils=()=>yA;createPConnect=e=>hd(e);getPubSubUtils=()=>Ci;registerComponentCreator=e=>{gd(e)};getConstants=()=>Object.freeze(B);getEvents=()=>hA;getRestClient=()=>d;getMashupApi=()=>NI;getEnvironmentInfo=()=>Dp;getRuntimeParamsAPI=()=>Ku;getSemanticUrlUtils=()=>gA;getRemoteCaseUtils=()=>q;getNavigationUtils=()=>pc;registerModule=(e,t)=>pA.registerModule(e,t,this);getErrorHandler=()=>fA;getFormUtils=()=>hl;getMessagingServiceManager=()=>wu;getMetadataUtils=()=>h;getDataPageUtils=()=>Lu;getDataTypeUtils=()=>nu;getCascadeManager=()=>Eh;isDeepEqual=(e,t)=>E()(e,t);getAuthUtils=()=>mA;getDebugger=()=>Li;getDeferLoadManager=()=>Su;getExpressionEngine=()=>c;getActionsSequencer=()=>rn;getRefreshManager=()=>xl;getInitialiser=()=>xI;getAllStateMachines=(e,t,n)=>t&&n?gl.getAllStateMachines(e,t,n):gl.getAllStateMachinesByContext(e);getBootstrapUtils=()=>PI;getContextTreeManager=()=>Mn;getAccessPrivilege=()=>AA.getInstance()}const CA=new _A;s.g.PCore=CA;const SA=CA;var TA=a.A;export{TA as default};
2
+ //# sourceMappingURL=constellation-core.1c42f470.js.map