@atomic.io/action-cards-web-sdk-cdn-icons 25.4.2 → 26.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -13
- package/package.json +7 -5
- package/public/LICENSES.txt +42 -17
- package/public/iframe-manager.js +3 -3
- package/public/sdk.d.ts +1 -0
- package/public/sdk.js +3 -3
package/public/sdk.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! For license information please see sdk-cdn-icons.js.LICENSE.txt */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
|
-
* Atomic Web SDK
|
|
4
|
+
* Atomic Web SDK 26.2.0
|
|
5
5
|
* Copyright 2022 Atomic.io Limited.
|
|
6
6
|
* For licenses of open source libraries used by the Atomic SDK, please
|
|
7
|
-
* see https://downloads.atomic.io/web-sdk/release/
|
|
7
|
+
* see https://downloads.atomic.io/web-sdk/release/26.2.0/LICENSES.txt.
|
|
8
8
|
*/
|
|
9
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AtomicSDK=t():e.AtomicSDK=t()}(globalThis,(()=>(()=>{var e={4963:e=>{e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},7722:(e,t,n)=>{var r=n(6314)("unscopables"),i=Array.prototype;null==i[r]&&n(7728)(i,r,{}),e.exports=function(e){i[r][e]=!0}},7007:(e,t,n)=>{var r=n(5286);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},9315:(e,t,n)=>{var r=n(2110),i=n(875),a=n(2337);e.exports=function(e){return function(t,n,o){var s,l=r(t),d=i(l.length),c=a(o,d);if(e&&n!=n){for(;d>c;)if((s=l[c++])!=s)return!0}else for(;d>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}}},2032:e=>{var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},5645:e=>{var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},741:(e,t,n)=>{var r=n(4963);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},1355:e=>{e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},7057:(e,t,n)=>{e.exports=!n(4253)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2457:(e,t,n)=>{var r=n(5286),i=n(3816).document,a=r(i)&&r(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},4430:e=>{e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},2985:(e,t,n)=>{var r=n(3816),i=n(5645),a=n(7728),o=n(3415),s=n(741),l="prototype",d=function(e,t,n){var c,u,h,p,m=e&d.F,g=e&d.G,v=e&d.S,f=e&d.P,b=e&d.B,y=g?r:v?r[t]||(r[t]={}):(r[t]||{})[l],w=g?i:i[t]||(i[t]={}),S=w[l]||(w[l]={});for(c in g&&(n=t),n)h=((u=!m&&y&&void 0!==y[c])?y:n)[c],p=b&&u?s(h,r):f&&"function"==typeof h?s(Function.call,h):h,y&&o(y,c,h,e&d.U),w[c]!=h&&a(w,c,p),f&&S[c]!=h&&(S[c]=h)};r.core=i,d.F=1,d.G=2,d.S=4,d.P=8,d.B=16,d.W=32,d.U=64,d.R=128,e.exports=d},4253:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},18:(e,t,n)=>{e.exports=n(3825)("native-function-to-string",Function.toString)},3816:e=>{var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},9181:e=>{var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},7728:(e,t,n)=>{var r=n(9275),i=n(681);e.exports=n(7057)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},639:(e,t,n)=>{var r=n(3816).document;e.exports=r&&r.documentElement},1734:(e,t,n)=>{e.exports=!n(7057)&&!n(4253)((function(){return 7!=Object.defineProperty(n(2457)("div"),"a",{get:function(){return 7}}).a}))},9797:(e,t,n)=>{var r=n(2032);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},5286:e=>{e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},9988:(e,t,n)=>{"use strict";var r=n(2503),i=n(681),a=n(2943),o={};n(7728)(o,n(6314)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+" Iterator")}},2923:(e,t,n)=>{"use strict";var r=n(4461),i=n(2985),a=n(3415),o=n(7728),s=n(7234),l=n(9988),d=n(2943),c=n(468),u=n(6314)("iterator"),h=!([].keys&&"next"in[].keys()),p="keys",m="values",g=function(){return this};e.exports=function(e,t,n,v,f,b,y){l(n,t,v);var w,S,C,k=function(e){if(!h&&e in T)return T[e];switch(e){case p:case m:return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",I=f==m,O=!1,T=e.prototype,F=T[u]||T["@@iterator"]||f&&T[f],M=F||k(f),j=f?I?k("entries"):M:void 0,A="Array"==t&&T.entries||F;if(A&&(C=c(A.call(new e)))!==Object.prototype&&C.next&&(d(C,x,!0),r||"function"==typeof C[u]||o(C,u,g)),I&&F&&F.name!==m&&(O=!0,M=function(){return F.call(this)}),r&&!y||!h&&!O&&T[u]||o(T,u,M),s[t]=M,s[x]=g,f)if(w={values:I?M:k(m),keys:b?M:k(p),entries:j},y)for(S in w)S in T||a(T,S,w[S]);else i(i.P+i.F*(h||O),t,w);return w}},5436:e=>{e.exports=function(e,t){return{value:t,done:!!e}}},7234:e=>{e.exports={}},4461:e=>{e.exports=!1},2503:(e,t,n)=>{var r=n(7007),i=n(5588),a=n(4430),o=n(9335)("IE_PROTO"),s=function(){},l="prototype",d=function(){var e,t=n(2457)("iframe"),r=a.length;for(t.style.display="none",n(639).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),d=e.F;r--;)delete d[l][a[r]];return d()};e.exports=Object.create||function(e,t){var n;return null!==e?(s[l]=r(e),n=new s,s[l]=null,n[o]=e):n=d(),void 0===t?n:i(n,t)}},9275:(e,t,n)=>{var r=n(7007),i=n(1734),a=n(1689),o=Object.defineProperty;t.f=n(7057)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},5588:(e,t,n)=>{var r=n(9275),i=n(7007),a=n(7184);e.exports=n(7057)?Object.defineProperties:function(e,t){i(e);for(var n,o=a(t),s=o.length,l=0;s>l;)r.f(e,n=o[l++],t[n]);return e}},468:(e,t,n)=>{var r=n(9181),i=n(508),a=n(9335)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},189:(e,t,n)=>{var r=n(9181),i=n(2110),a=n(9315)(!1),o=n(9335)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),l=0,d=[];for(n in s)n!=o&&r(s,n)&&d.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~a(d,n)||d.push(n));return d}},7184:(e,t,n)=>{var r=n(189),i=n(4430);e.exports=Object.keys||function(e){return r(e,i)}},681:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},3415:(e,t,n)=>{var r=n(3816),i=n(7728),a=n(9181),o=n(3953)("src"),s=n(18),l="toString",d=(""+s).split(l);n(5645).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var l="function"==typeof n;l&&(a(n,"name")||i(n,"name",t)),e[t]!==n&&(l&&(a(n,o)||i(n,o,e[t]?""+e[t]:d.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,l,(function(){return"function"==typeof this&&this[o]||s.call(this)}))},2943:(e,t,n)=>{var r=n(9275).f,i=n(9181),a=n(6314)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},9335:(e,t,n)=>{var r=n(3825)("keys"),i=n(3953);e.exports=function(e){return r[e]||(r[e]=i(e))}},3825:(e,t,n)=>{var r=n(5645),i=n(3816),a="__core-js_shared__",o=i[a]||(i[a]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(4461)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},2337:(e,t,n)=>{var r=n(1467),i=Math.max,a=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):a(e,t)}},1467:e=>{var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},2110:(e,t,n)=>{var r=n(9797),i=n(1355);e.exports=function(e){return r(i(e))}},875:(e,t,n)=>{var r=n(1467),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},508:(e,t,n)=>{var r=n(1355);e.exports=function(e){return Object(r(e))}},1689:(e,t,n)=>{var r=n(5286);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},3953:e=>{var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},6314:(e,t,n)=>{var r=n(3825)("wks"),i=n(3953),a=n(3816).Symbol,o="function"==typeof a;(e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)("Symbol."+e))}).store=r},6997:(e,t,n)=>{"use strict";var r=n(7722),i=n(5436),a=n(7234),o=n(2110);e.exports=n(2923)(Array,"Array",(function(e,t){this._t=o(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},1181:(e,t,n)=>{for(var r=n(6997),i=n(7184),a=n(3415),o=n(3816),s=n(7728),l=n(7234),d=n(6314),c=d("iterator"),u=d("toStringTag"),h=l.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},m=i(p),g=0;g<m.length;g++){var v,f=m[g],b=p[f],y=o[f],w=y&&y.prototype;if(w&&(w[c]||s(w,c,h),w[u]||s(w,u,f),l[f]=h,b))for(v in r)w[v]||a(w,v,r[v],!0)}},4630:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(6213),i=n.n(r),a=n(3645),o=n.n(a)()(i());o.push([e.id,"/* Take care to only target specific ID base styles here to avoid style pollution in the host site */\niframe.atomic-sdk-frame.launcher {\n width: 460px;\n position: fixed;\n bottom: 100px;\n right: 0px;\n top: 0px;\n height: 100%;\n max-width: 100%;\n animation: atomic-sdk-launcher-close 0.1s ease forwards;\n}\n\niframe.atomic-sdk-frame.launcher.open {\n animation: atomic-sdk-launcher-open 0.1s ease forwards;\n}\n\n@keyframes atomic-sdk-launcher-open {\n 0% {\n opacity: 0;\n transform: translateY(20px);\n pointer-events: auto;\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n z-index: 2;\n }\n}\n\n@keyframes atomic-sdk-launcher-close {\n 0% {\n opacity: 1;\n transform: translateY(0);\n pointer-events: none;\n }\n 100% {\n opacity: 0;\n transform: translateY(20px);\n z-index: -2;\n }\n}\n\n.atomic-sdk-launcher {\n background-color: blue;\n overflow: hidden;\n height: 60px;\n width: 60px;\n border-radius: 999px;\n box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.1);\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transform: scale(0.1);\n animation: atomic-sdk-launcher 0.2s forwards;\n transition: all 0.1s ease;\n cursor: pointer;\n border: 0;\n}\n\n@keyframes atomic-sdk-launcher {\n from {\n transform: scale(0.1);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n}\n\n.atomic-sdk-launcher-wrapper {\n width: 60px;\n height: 60px;\n display: flex;\n position: fixed;\n bottom: 20px;\n right: 20px;\n}\n\niframe.atomic-sdk-frame.standalone.shrink {\n max-height: 2000px;\n transition: max-height 1s ease-out 2.3s;\n}\n\n#atomic-sdk-toast-container {\n position: fixed;\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n max-width: 500px;\n height: 0px;\n z-index: 2;\n}\n\niframe.atomic-sdk-frame.modal-stream {\n position: fixed;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n left: 0;\n width: 100vw;\n width: 100dvw;\n height: 100vh;\n height: 100dvh;\n border: 0;\n z-index: 100000;\n}\n\niframe.atomic-sdk-frame.modal-stream.closed {\n display: none;\n}\n",""]);const s=o},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,a){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(o[l]=!0)}for(var d=0;d<e.length;d++){var c=[].concat(e[d]);r&&o[c[0]]||(void 0!==a&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=a),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},6213:e=>{"use strict";e.exports=function(e){return e[1]}},3561:e=>{e.exports=function(e){var t=new Date(e.getTime()),n=t.getTimezoneOffset();return t.setSeconds(0,0),6e4*n+t.getTime()%6e4}},4844:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setDate(n.getDate()+i),n}},2680:(e,t,n)=>{var r=n(2951);e.exports=function(e,t){var n=Number(t);return r(e,36e5*n)}},7538:(e,t,n)=>{var r=n(2385),i=n(1138);e.exports=function(e,t){var n=Number(t);return i(e,r(e)+n)}},2951:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e).getTime(),i=Number(t);return new Date(n+i)}},1318:(e,t,n)=>{var r=n(2951);e.exports=function(e,t){var n=Number(t);return r(e,6e4*n)}},9331:(e,t,n)=>{var r=n(1884),i=n(2807);e.exports=function(e,t){var n=r(e),a=Number(t),o=n.getMonth()+a,s=new Date(0);s.setFullYear(n.getFullYear(),o,1),s.setHours(0,0,0,0);var l=i(s);return n.setMonth(o,Math.min(l,n.getDate())),n}},1482:(e,t,n)=>{var r=n(9331);e.exports=function(e,t){var n=Number(t);return r(e,3*n)}},9723:(e,t,n)=>{var r=n(2951);e.exports=function(e,t){var n=Number(t);return r(e,1e3*n)}},5932:(e,t,n)=>{var r=n(4844);e.exports=function(e,t){var n=Number(t);return r(e,7*n)}},6083:(e,t,n)=>{var r=n(9331);e.exports=function(e,t){var n=Number(t);return r(e,12*n)}},6739:(e,t,n)=>{var r=n(1884);e.exports=function(e,t,n,i){var a=r(e).getTime(),o=r(t).getTime(),s=r(n).getTime(),l=r(i).getTime();if(a>o||s>l)throw new Error("The start of the range cannot be after the end of the range");return a<l&&s<o}},7886:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){if(!(t instanceof Array))throw new TypeError(toString.call(t)+" is not an instance of Array");var n,i,a=r(e).getTime();return t.forEach((function(e,t){var o=r(e),s=Math.abs(a-o.getTime());(void 0===n||s<i)&&(n=t,i=s)})),n}},3806:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){if(!(t instanceof Array))throw new TypeError(toString.call(t)+" is not an instance of Array");var n,i,a=r(e).getTime();return t.forEach((function(e){var t=r(e),o=Math.abs(a-t.getTime());(void 0===n||o<i)&&(n=t,i=o)})),n}},3374:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e).getTime(),i=r(t).getTime();return n<i?-1:n>i?1:0}},3558:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e).getTime(),i=r(t).getTime();return n>i?-1:n<i?1:0}},6656:(e,t,n)=>{var r=n(6579);e.exports=function(e,t){var n=r(e),i=r(t),a=n.getTime()-6e4*n.getTimezoneOffset(),o=i.getTime()-6e4*i.getTimezoneOffset();return Math.round((a-o)/864e5)}},6554:(e,t,n)=>{var r=n(1971);e.exports=function(e,t){var n=r(e),i=r(t),a=n.getTime()-6e4*n.getTimezoneOffset(),o=i.getTime()-6e4*i.getTimezoneOffset();return Math.round((a-o)/6048e5)}},7051:(e,t,n)=>{var r=n(2385);e.exports=function(e,t){return r(e)-r(t)}},1924:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return 12*(n.getFullYear()-i.getFullYear())+(n.getMonth()-i.getMonth())}},9729:(e,t,n)=>{var r=n(21),i=n(1884);e.exports=function(e,t){var n=i(e),a=i(t);return 4*(n.getFullYear()-a.getFullYear())+(r(n)-r(a))}},9871:(e,t,n)=>{var r=n(5344);e.exports=function(e,t,n){var i=r(e,n),a=r(t,n),o=i.getTime()-6e4*i.getTimezoneOffset(),s=a.getTime()-6e4*a.getTimezoneOffset();return Math.round((o-s)/6048e5)}},8509:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getFullYear()-i.getFullYear()}},6056:(e,t,n)=>{var r=n(1884),i=n(6656),a=n(3374);e.exports=function(e,t){var n=r(e),o=r(t),s=a(n,o),l=Math.abs(i(n,o));return n.setDate(n.getDate()-s*l),s*(l-(a(n,o)===-s))}},298:(e,t,n)=>{var r=n(8081);e.exports=function(e,t){var n=r(e,t)/36e5;return n>0?Math.floor(n):Math.ceil(n)}},9973:(e,t,n)=>{var r=n(1884),i=n(7051),a=n(3374),o=n(9883);e.exports=function(e,t){var n=r(e),s=r(t),l=a(n,s),d=Math.abs(i(n,s));return n=o(n,l*d),l*(d-(a(n,s)===-l))}},8081:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()-i.getTime()}},604:(e,t,n)=>{var r=n(8081);e.exports=function(e,t){var n=r(e,t)/6e4;return n>0?Math.floor(n):Math.ceil(n)}},1387:(e,t,n)=>{var r=n(1884),i=n(1924),a=n(3374);e.exports=function(e,t){var n=r(e),o=r(t),s=a(n,o),l=Math.abs(i(n,o));return n.setMonth(n.getMonth()-s*l),s*(l-(a(n,o)===-s))}},9403:(e,t,n)=>{var r=n(1387);e.exports=function(e,t){var n=r(e,t)/3;return n>0?Math.floor(n):Math.ceil(n)}},7977:(e,t,n)=>{var r=n(8081);e.exports=function(e,t){var n=r(e,t)/1e3;return n>0?Math.floor(n):Math.ceil(n)}},4496:(e,t,n)=>{var r=n(6056);e.exports=function(e,t){var n=r(e,t)/7;return n>0?Math.floor(n):Math.ceil(n)}},760:(e,t,n)=>{var r=n(1884),i=n(8509),a=n(3374);e.exports=function(e,t){var n=r(e),o=r(t),s=a(n,o),l=Math.abs(i(n,o));return n.setFullYear(n.getFullYear()-s*l),s*(l-(a(n,o)===-s))}},3332:(e,t,n)=>{var r=n(3558),i=n(1884),a=n(7977),o=n(1387),s=n(7479),l=43200;e.exports=function(e,t,n){var d=n||{},c=r(e,t),u=d.locale,h=s.distanceInWords.localize;u&&u.distanceInWords&&u.distanceInWords.localize&&(h=u.distanceInWords.localize);var p,m,g={addSuffix:Boolean(d.addSuffix),comparison:c};c>0?(p=i(e),m=i(t)):(p=i(t),m=i(e));var v,f=a(m,p),b=m.getTimezoneOffset()-p.getTimezoneOffset(),y=Math.round(f/60)-b;if(y<2)return d.includeSeconds?f<5?h("lessThanXSeconds",5,g):f<10?h("lessThanXSeconds",10,g):f<20?h("lessThanXSeconds",20,g):f<40?h("halfAMinute",null,g):h(f<60?"lessThanXMinutes":"xMinutes",1,g):0===y?h("lessThanXMinutes",1,g):h("xMinutes",y,g);if(y<45)return h("xMinutes",y,g);if(y<90)return h("aboutXHours",1,g);if(y<1440)return h("aboutXHours",Math.round(y/60),g);if(y<2520)return h("xDays",1,g);if(y<l)return h("xDays",Math.round(y/1440),g);if(y<86400)return h("aboutXMonths",v=Math.round(y/l),g);if((v=o(m,p))<12)return h("xMonths",Math.round(y/l),g);var w=v%12,S=Math.floor(v/12);return w<3?h("aboutXYears",S,g):w<9?h("overXYears",S,g):h("almostXYears",S+1,g)}},7666:(e,t,n)=>{var r=n(3558),i=n(1884),a=n(7977),o=n(7479),s=525600;e.exports=function(e,t,n){var l=n||{},d=r(e,t),c=l.locale,u=o.distanceInWords.localize;c&&c.distanceInWords&&c.distanceInWords.localize&&(u=c.distanceInWords.localize);var h,p,m,g={addSuffix:Boolean(l.addSuffix),comparison:d};d>0?(h=i(e),p=i(t)):(h=i(t),p=i(e));var v=Math[l.partialMethod?String(l.partialMethod):"floor"],f=a(p,h),b=p.getTimezoneOffset()-h.getTimezoneOffset(),y=v(f/60)-b;if("s"===(m=l.unit?String(l.unit):y<1?"s":y<60?"m":y<1440?"h":y<43200?"d":y<s?"M":"Y"))return u("xSeconds",f,g);if("m"===m)return u("xMinutes",y,g);if("h"===m)return u("xHours",v(y/60),g);if("d"===m)return u("xDays",v(y/1440),g);if("M"===m)return u("xMonths",v(y/43200),g);if("Y"===m)return u("xYears",v(y/s),g);throw new Error("Unknown unit: "+m)}},6272:(e,t,n)=>{var r=n(3332);e.exports=function(e,t){return r(Date.now(),e,t)}},5411:(e,t,n)=>{var r=n(1884);e.exports=function(e,t,n){var i=r(e),a=void 0!==n?n:1,o=r(t).getTime();if(i.getTime()>o)throw new Error("The first date cannot be after the second date");var s=[],l=i;for(l.setHours(0,0,0,0);l.getTime()<=o;)s.push(r(l)),l.setDate(l.getDate()+a);return s}},549:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setHours(23,59,59,999),t}},2653:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setMinutes(59,59,999),t}},6718:(e,t,n)=>{var r=n(1322);e.exports=function(e){return r(e,{weekStartsOn:1})}},5648:(e,t,n)=>{var r=n(2385),i=n(1971);e.exports=function(e){var t=r(e),n=new Date(0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);var a=i(n);return a.setMilliseconds(a.getMilliseconds()-1),a}},9877:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setSeconds(59,999),t}},9356:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}},5661:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getMonth(),i=n-n%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}},6415:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setMilliseconds(999),t}},4404:(e,t,n)=>{var r=n(549);e.exports=function(){return r(new Date)}},7410:e=>{e.exports=function(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=new Date(0);return i.setFullYear(t,n,r+1),i.setHours(23,59,59,999),i}},1322:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=t&&Number(t.weekStartsOn)||0,i=r(e),a=i.getDay(),o=6+(a<n?-7:0)-(a-n);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}},782:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}},4106:e=>{e.exports=function(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=new Date(0);return i.setFullYear(t,n,r-1),i.setHours(23,59,59,999),i}},5616:(e,t,n)=>{var r=n(8612),i=n(6563),a=n(2385),o=n(1884),s=n(623),l=n(7479);var d={M:function(e){return e.getMonth()+1},MM:function(e){return h(e.getMonth()+1,2)},Q:function(e){return Math.ceil((e.getMonth()+1)/3)},D:function(e){return e.getDate()},DD:function(e){return h(e.getDate(),2)},DDD:function(e){return r(e)},DDDD:function(e){return h(r(e),3)},d:function(e){return e.getDay()},E:function(e){return e.getDay()||7},W:function(e){return i(e)},WW:function(e){return h(i(e),2)},YY:function(e){return h(e.getFullYear(),4).substr(2)},YYYY:function(e){return h(e.getFullYear(),4)},GG:function(e){return String(a(e)).substr(2)},GGGG:function(e){return a(e)},H:function(e){return e.getHours()},HH:function(e){return h(e.getHours(),2)},h:function(e){var t=e.getHours();return 0===t?12:t>12?t%12:t},hh:function(e){return h(d.h(e),2)},m:function(e){return e.getMinutes()},mm:function(e){return h(e.getMinutes(),2)},s:function(e){return e.getSeconds()},ss:function(e){return h(e.getSeconds(),2)},S:function(e){return Math.floor(e.getMilliseconds()/100)},SS:function(e){return h(Math.floor(e.getMilliseconds()/10),2)},SSS:function(e){return h(e.getMilliseconds(),3)},Z:function(e){return u(e.getTimezoneOffset(),":")},ZZ:function(e){return u(e.getTimezoneOffset())},X:function(e){return Math.floor(e.getTime()/1e3)},x:function(e){return e.getTime()}};function c(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|]$/g,""):e.replace(/\\/g,"")}function u(e,t){t=t||"";var n=e>0?"-":"+",r=Math.abs(e),i=r%60;return n+h(Math.floor(r/60),2)+t+h(i,2)}function h(e,t){for(var n=Math.abs(e).toString();n.length<t;)n="0"+n;return n}e.exports=function(e,t,n){var r=t?String(t):"YYYY-MM-DDTHH:mm:ss.SSSZ",i=(n||{}).locale,a=l.format.formatters,u=l.format.formattingTokensRegExp;i&&i.format&&i.format.formatters&&(a=i.format.formatters,i.format.formattingTokensRegExp&&(u=i.format.formattingTokensRegExp));var h=o(e);return s(h)?function(e,t,n){var r,i,a=e.match(n),o=a.length;for(r=0;r<o;r++)i=t[a[r]]||d[a[r]],a[r]=i||c(a[r]);return function(e){for(var t="",n=0;n<o;n++)a[n]instanceof Function?t+=a[n](e,d):t+=a[n];return t}}(r,a,u)(h):"Invalid Date"}},5540:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getDate()}},2476:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getDay()}},8612:(e,t,n)=>{var r=n(1884),i=n(9834),a=n(6656);e.exports=function(e){var t=r(e);return a(t,i(t))+1}},2807:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getFullYear(),i=t.getMonth(),a=new Date(0);return a.setFullYear(n,i+1,0),a.setHours(0,0,0,0),a.getDate()}},4789:(e,t,n)=>{var r=n(1164);e.exports=function(e){return r(e)?366:365}},7921:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getHours()}},6373:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e).getDay();return 0===t&&(t=7),t}},6563:(e,t,n)=>{var r=n(1884),i=n(1971),a=n(3892);e.exports=function(e){var t=r(e),n=i(t).getTime()-a(t).getTime();return Math.round(n/6048e5)+1}},7098:(e,t,n)=>{var r=n(3892),i=n(5932);e.exports=function(e){var t=r(e),n=r(i(t,60)).valueOf()-t.valueOf();return Math.round(n/6048e5)}},2385:(e,t,n)=>{var r=n(1884),i=n(1971);e.exports=function(e){var t=r(e),n=t.getFullYear(),a=new Date(0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);var o=i(a),s=new Date(0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);var l=i(s);return t.getTime()>=o.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}},8597:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getMilliseconds()}},3362:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getMinutes()}},3503:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getMonth()}},5541:(e,t,n)=>{var r=n(1884);e.exports=function(e,t,n,i){var a=r(e).getTime(),o=r(t).getTime(),s=r(n).getTime(),l=r(i).getTime();if(a>o||s>l)throw new Error("The start of the range cannot be after the end of the range");if(!(a<l&&s<o))return 0;var d=(l>o?o:l)-(s<a?a:s);return Math.ceil(d/864e5)}},21:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return Math.floor(t.getMonth()/3)+1}},8780:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getSeconds()}},2482:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getTime()}},8194:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getFullYear()}},7292:(e,t,n)=>{e.exports={addDays:n(4844),addHours:n(2680),addISOYears:n(7538),addMilliseconds:n(2951),addMinutes:n(1318),addMonths:n(9331),addQuarters:n(1482),addSeconds:n(9723),addWeeks:n(5932),addYears:n(6083),areRangesOverlapping:n(6739),closestIndexTo:n(7886),closestTo:n(3806),compareAsc:n(3374),compareDesc:n(3558),differenceInCalendarDays:n(6656),differenceInCalendarISOWeeks:n(6554),differenceInCalendarISOYears:n(7051),differenceInCalendarMonths:n(1924),differenceInCalendarQuarters:n(9729),differenceInCalendarWeeks:n(9871),differenceInCalendarYears:n(8509),differenceInDays:n(6056),differenceInHours:n(298),differenceInISOYears:n(9973),differenceInMilliseconds:n(8081),differenceInMinutes:n(604),differenceInMonths:n(1387),differenceInQuarters:n(9403),differenceInSeconds:n(7977),differenceInWeeks:n(4496),differenceInYears:n(760),distanceInWords:n(3332),distanceInWordsStrict:n(7666),distanceInWordsToNow:n(6272),eachDay:n(5411),endOfDay:n(549),endOfHour:n(2653),endOfISOWeek:n(6718),endOfISOYear:n(5648),endOfMinute:n(9877),endOfMonth:n(9356),endOfQuarter:n(5661),endOfSecond:n(6415),endOfToday:n(4404),endOfTomorrow:n(7410),endOfWeek:n(1322),endOfYear:n(782),endOfYesterday:n(4106),format:n(5616),getDate:n(5540),getDay:n(2476),getDayOfYear:n(8612),getDaysInMonth:n(2807),getDaysInYear:n(4789),getHours:n(7921),getISODay:n(6373),getISOWeek:n(6563),getISOWeeksInYear:n(7098),getISOYear:n(2385),getMilliseconds:n(8597),getMinutes:n(3362),getMonth:n(3503),getOverlappingDaysInRanges:n(5541),getQuarter:n(21),getSeconds:n(8780),getTime:n(2482),getYear:n(8194),isAfter:n(2849),isBefore:n(7754),isDate:n(4286),isEqual:n(9601),isFirstDayOfMonth:n(1364),isFriday:n(2350),isFuture:n(9593),isLastDayOfMonth:n(4399),isLeapYear:n(1164),isMonday:n(126),isPast:n(798),isSameDay:n(4801),isSameHour:n(3344),isSameISOWeek:n(8029),isSameISOYear:n(7877),isSameMinute:n(4465),isSameMonth:n(248),isSameQuarter:n(5347),isSameSecond:n(1742),isSameWeek:n(4868),isSameYear:n(2130),isSaturday:n(2687),isSunday:n(2978),isThisHour:n(1587),isThisISOWeek:n(657),isThisISOYear:n(6106),isThisMinute:n(7980),isThisMonth:n(2767),isThisQuarter:n(1687),isThisSecond:n(7391),isThisWeek:n(147),isThisYear:n(576),isThursday:n(7999),isToday:n(5886),isTomorrow:n(7962),isTuesday:n(6330),isValid:n(623),isWednesday:n(5999),isWeekend:n(7455),isWithinRange:n(6254),isYesterday:n(9099),lastDayOfISOWeek:n(1944),lastDayOfISOYear:n(9312),lastDayOfMonth:n(4949),lastDayOfQuarter:n(3146),lastDayOfWeek:n(106),lastDayOfYear:n(2674),max:n(1489),min:n(3185),parse:n(1884),setDate:n(6130),setDay:n(1110),setDayOfYear:n(1418),setHours:n(6574),setISODay:n(8212),setISOWeek:n(570),setISOYear:n(1138),setMilliseconds:n(3934),setMinutes:n(4809),setMonth:n(6059),setQuarter:n(4059),setSeconds:n(1670),setYear:n(3821),startOfDay:n(6579),startOfHour:n(555),startOfISOWeek:n(1971),startOfISOYear:n(3892),startOfMinute:n(5580),startOfMonth:n(5130),startOfQuarter:n(9309),startOfSecond:n(9966),startOfToday:n(9978),startOfTomorrow:n(7743),startOfWeek:n(5344),startOfYear:n(9834),startOfYesterday:n(6441),subDays:n(5627),subHours:n(7413),subISOYears:n(9883),subMilliseconds:n(8502),subMinutes:n(3350),subMonths:n(1141),subQuarters:n(6607),subSeconds:n(9256),subWeeks:n(9862),subYears:n(8524)}},2849:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()>i.getTime()}},7754:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()<i.getTime()}},4286:e=>{e.exports=function(e){return e instanceof Date}},9601:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},1364:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 1===r(e).getDate()}},2350:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 5===r(e).getDay()}},9593:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getTime()>(new Date).getTime()}},4399:(e,t,n)=>{var r=n(1884),i=n(549),a=n(9356);e.exports=function(e){var t=r(e);return i(t).getTime()===a(t).getTime()}},1164:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e).getFullYear();return t%400==0||t%4==0&&t%100!=0}},126:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 1===r(e).getDay()}},798:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getTime()<(new Date).getTime()}},4801:(e,t,n)=>{var r=n(6579);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},3344:(e,t,n)=>{var r=n(555);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},8029:(e,t,n)=>{var r=n(4868);e.exports=function(e,t){return r(e,t,{weekStartsOn:1})}},7877:(e,t,n)=>{var r=n(3892);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},4465:(e,t,n)=>{var r=n(5580);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},248:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()}},5347:(e,t,n)=>{var r=n(9309);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},1742:(e,t,n)=>{var r=n(9966);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},4868:(e,t,n)=>{var r=n(5344);e.exports=function(e,t,n){var i=r(e,n),a=r(t,n);return i.getTime()===a.getTime()}},2130:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getFullYear()===i.getFullYear()}},2687:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 6===r(e).getDay()}},2978:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 0===r(e).getDay()}},1587:(e,t,n)=>{var r=n(3344);e.exports=function(e){return r(new Date,e)}},657:(e,t,n)=>{var r=n(8029);e.exports=function(e){return r(new Date,e)}},6106:(e,t,n)=>{var r=n(7877);e.exports=function(e){return r(new Date,e)}},7980:(e,t,n)=>{var r=n(4465);e.exports=function(e){return r(new Date,e)}},2767:(e,t,n)=>{var r=n(248);e.exports=function(e){return r(new Date,e)}},1687:(e,t,n)=>{var r=n(5347);e.exports=function(e){return r(new Date,e)}},7391:(e,t,n)=>{var r=n(1742);e.exports=function(e){return r(new Date,e)}},147:(e,t,n)=>{var r=n(4868);e.exports=function(e,t){return r(new Date,e,t)}},576:(e,t,n)=>{var r=n(2130);e.exports=function(e){return r(new Date,e)}},7999:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 4===r(e).getDay()}},5886:(e,t,n)=>{var r=n(6579);e.exports=function(e){return r(e).getTime()===r(new Date).getTime()}},7962:(e,t,n)=>{var r=n(6579);e.exports=function(e){var t=new Date;return t.setDate(t.getDate()+1),r(e).getTime()===r(t).getTime()}},6330:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 2===r(e).getDay()}},623:(e,t,n)=>{var r=n(4286);e.exports=function(e){if(r(e))return!isNaN(e);throw new TypeError(toString.call(e)+" is not an instance of Date")}},5999:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 3===r(e).getDay()}},7455:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e).getDay();return 0===t||6===t}},6254:(e,t,n)=>{var r=n(1884);e.exports=function(e,t,n){var i=r(e).getTime(),a=r(t).getTime(),o=r(n).getTime();if(a>o)throw new Error("The start of the range cannot be after the end of the range");return i>=a&&i<=o}},9099:(e,t,n)=>{var r=n(6579);e.exports=function(e){var t=new Date;return t.setDate(t.getDate()-1),r(e).getTime()===r(t).getTime()}},1944:(e,t,n)=>{var r=n(106);e.exports=function(e){return r(e,{weekStartsOn:1})}},9312:(e,t,n)=>{var r=n(2385),i=n(1971);e.exports=function(e){var t=r(e),n=new Date(0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);var a=i(n);return a.setDate(a.getDate()-1),a}},4949:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}},3146:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getMonth(),i=n-n%3+3;return t.setMonth(i,0),t.setHours(0,0,0,0),t}},106:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=t&&Number(t.weekStartsOn)||0,i=r(e),a=i.getDay(),o=6+(a<n?-7:0)-(a-n);return i.setHours(0,0,0,0),i.setDate(i.getDate()+o),i}},2674:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(0,0,0,0),t}},8854:e=>{var t=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];e.exports=function(e){var n=[];for(var r in e)e.hasOwnProperty(r)&&n.push(r);var i=t.concat(n).sort().reverse();return new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+i.join("|")+"|.)","g")}},2894:e=>{e.exports=function(){var e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};return{localize:function(t,n,r){var i;return r=r||{},i="string"==typeof e[t]?e[t]:1===n?e[t].one:e[t].other.replace("{{count}}",n),r.addSuffix?r.comparison>0?"in "+i:i+" ago":i}}}},664:(e,t,n)=>{var r=n(8854);e.exports=function(){var e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["AM","PM"],s=["am","pm"],l=["a.m.","p.m."],d={MMM:function(t){return e[t.getMonth()]},MMMM:function(e){return t[e.getMonth()]},dd:function(e){return n[e.getDay()]},ddd:function(e){return i[e.getDay()]},dddd:function(e){return a[e.getDay()]},A:function(e){return e.getHours()/12>=1?o[1]:o[0]},a:function(e){return e.getHours()/12>=1?s[1]:s[0]},aa:function(e){return e.getHours()/12>=1?l[1]:l[0]}};return["M","D","DDD","d","Q","W"].forEach((function(e){d[e+"o"]=function(t,n){return function(e){var t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"}(n[e](t))}})),{formatters:d,formattingTokensRegExp:r(d)}}},7479:(e,t,n)=>{var r=n(2894),i=n(664);e.exports={distanceInWords:r(),format:i()}},1489:(e,t,n)=>{var r=n(1884);e.exports=function(){var e=Array.prototype.slice.call(arguments).map((function(e){return r(e)})),t=Math.max.apply(null,e);return new Date(t)}},3185:(e,t,n)=>{var r=n(1884);e.exports=function(){var e=Array.prototype.slice.call(arguments).map((function(e){return r(e)})),t=Math.min.apply(null,e);return new Date(t)}},1884:(e,t,n)=>{var r=n(3561),i=n(4286),a=36e5,o=6e4,s=/[T ]/,l=/:/,d=/^(\d{2})$/,c=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],u=/^(\d{4})/,h=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],p=/^-(\d{2})$/,m=/^-?(\d{3})$/,g=/^-?(\d{2})-?(\d{2})$/,v=/^-?W(\d{2})$/,f=/^-?W(\d{2})-?(\d{1})$/,b=/^(\d{2}([.,]\d*)?)$/,y=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,w=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,S=/([Z+-].*)$/,C=/^(Z)$/,k=/^([+-])(\d{2})$/,x=/^([+-])(\d{2}):?(\d{2})$/;function I(e,t,n){t=t||0,n=n||0;var r=new Date(0);r.setUTCFullYear(e,0,4);var i=7*t+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+i),r}e.exports=function(e,t){if(i(e))return new Date(e.getTime());if("string"!=typeof e)return new Date(e);var n=(t||{}).additionalDigits;n=null==n?2:Number(n);var O=function(e){var t,n={},r=e.split(s);l.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1]);if(t){var i=S.exec(t);i?(n.time=t.replace(i[1],""),n.timezone=i[1]):n.time=t}return n}(e),T=function(e,t){var n,r=c[t],i=h[t];if(n=u.exec(e)||i.exec(e)){var a=n[1];return{year:parseInt(a,10),restDateString:e.slice(a.length)}}if(n=d.exec(e)||r.exec(e)){var o=n[1];return{year:100*parseInt(o,10),restDateString:e.slice(o.length)}}return{year:null}}(O.date,n),F=T.year,M=function(e,t){if(null===t)return null;var n,r,i;if(0===e.length)return(r=new Date(0)).setUTCFullYear(t),r;if(n=p.exec(e))return r=new Date(0),i=parseInt(n[1],10)-1,r.setUTCFullYear(t,i),r;if(n=m.exec(e)){r=new Date(0);var a=parseInt(n[1],10);return r.setUTCFullYear(t,0,a),r}if(n=g.exec(e)){r=new Date(0),i=parseInt(n[1],10)-1;var o=parseInt(n[2],10);return r.setUTCFullYear(t,i,o),r}if(n=v.exec(e))return I(t,parseInt(n[1],10)-1);if(n=f.exec(e)){return I(t,parseInt(n[1],10)-1,parseInt(n[2],10)-1)}return null}(T.restDateString,F);if(M){var j,A=M.getTime(),D=0;if(O.time&&(D=function(e){var t,n,r;if(t=b.exec(e))return(n=parseFloat(t[1].replace(",",".")))%24*a;if(t=y.exec(e))return n=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),n%24*a+r*o;if(t=w.exec(e)){n=parseInt(t[1],10),r=parseInt(t[2],10);var i=parseFloat(t[3].replace(",","."));return n%24*a+r*o+1e3*i}return null}(O.time)),O.timezone)j=function(e){var t,n;if(t=C.exec(e))return 0;if(t=k.exec(e))return n=60*parseInt(t[2],10),"+"===t[1]?-n:n;if(t=x.exec(e))return n=60*parseInt(t[2],10)+parseInt(t[3],10),"+"===t[1]?-n:n;return 0}(O.timezone)*o;else{var E=A+D,_=new Date(E);j=r(_);var L=new Date(E);L.setDate(_.getDate()+1);var P=r(L)-r(_);P>0&&(j+=P)}return new Date(A+D+j)}return new Date(e)}},6130:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setDate(i),n}},1110:(e,t,n)=>{var r=n(1884),i=n(4844);e.exports=function(e,t,n){var a=n&&Number(n.weekStartsOn)||0,o=r(e),s=Number(t),l=o.getDay();return i(o,((s%7+7)%7<a?7:0)+s-l)}},1418:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setMonth(0),n.setDate(i),n}},6574:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setHours(i),n}},8212:(e,t,n)=>{var r=n(1884),i=n(4844),a=n(6373);e.exports=function(e,t){var n=r(e),o=Number(t),s=a(n);return i(n,o-s)}},570:(e,t,n)=>{var r=n(1884),i=n(6563);e.exports=function(e,t){var n=r(e),a=Number(t),o=i(n)-a;return n.setDate(n.getDate()-7*o),n}},1138:(e,t,n)=>{var r=n(1884),i=n(3892),a=n(6656);e.exports=function(e,t){var n=r(e),o=Number(t),s=a(n,i(n)),l=new Date(0);return l.setFullYear(o,0,4),l.setHours(0,0,0,0),(n=i(l)).setDate(n.getDate()+s),n}},3934:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setMilliseconds(i),n}},4809:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setMinutes(i),n}},6059:(e,t,n)=>{var r=n(1884),i=n(2807);e.exports=function(e,t){var n=r(e),a=Number(t),o=n.getFullYear(),s=n.getDate(),l=new Date(0);l.setFullYear(o,a,15),l.setHours(0,0,0,0);var d=i(l);return n.setMonth(a,Math.min(s,d)),n}},4059:(e,t,n)=>{var r=n(1884),i=n(6059);e.exports=function(e,t){var n=r(e),a=Number(t)-(Math.floor(n.getMonth()/3)+1);return i(n,n.getMonth()+3*a)}},1670:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setSeconds(i),n}},3821:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setFullYear(i),n}},6579:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setHours(0,0,0,0),t}},555:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setMinutes(0,0,0),t}},1971:(e,t,n)=>{var r=n(5344);e.exports=function(e){return r(e,{weekStartsOn:1})}},3892:(e,t,n)=>{var r=n(2385),i=n(1971);e.exports=function(e){var t=r(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),i(n)}},5580:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setSeconds(0,0),t}},5130:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setDate(1),t.setHours(0,0,0,0),t}},9309:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getMonth(),i=n-n%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}},9966:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setMilliseconds(0),t}},9978:(e,t,n)=>{var r=n(6579);e.exports=function(){return r(new Date)}},7743:e=>{e.exports=function(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=new Date(0);return i.setFullYear(t,n,r+1),i.setHours(0,0,0,0),i}},5344:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=t&&Number(t.weekStartsOn)||0,i=r(e),a=i.getDay(),o=(a<n?7:0)+a-n;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}},9834:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}},6441:e=>{e.exports=function(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=new Date(0);return i.setFullYear(t,n,r-1),i.setHours(0,0,0,0),i}},5627:(e,t,n)=>{var r=n(4844);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},7413:(e,t,n)=>{var r=n(2680);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},9883:(e,t,n)=>{var r=n(7538);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},8502:(e,t,n)=>{var r=n(2951);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},3350:(e,t,n)=>{var r=n(1318);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},1141:(e,t,n)=>{var r=n(9331);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},6607:(e,t,n)=>{var r=n(1482);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},9256:(e,t,n)=>{var r=n(9723);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},9862:(e,t,n)=>{var r=n(5932);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},8524:(e,t,n)=>{var r=n(6083);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},6400:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Component:()=>w,Fragment:()=>y,_unmount:()=>_,cloneElement:()=>R,createContext:()=>$,createElement:()=>v,createRef:()=>b,h:()=>v,hydrate:()=>H,isValidElement:()=>i,options:()=>r,render:()=>P,toChildArray:()=>O});var r,i,a,o,s,l,d,c,u={},h=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function m(e,t){for(var n in t)e[n]=t[n];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n){var r,i=arguments,a={};for(r in t)"key"!==r&&"ref"!==r&&(a[r]=t[r]);if(arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(i[r]);if(null!=n&&(a.children=n),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===a[r]&&(a[r]=e.defaultProps[r]);return f(e,a,t&&t.key,t&&t.ref,null)}function f(e,t,n,i,a){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:a};return null==a&&(o.__v=o),r.vnode&&r.vnode(o),o}function b(){return{}}function y(e){return e.children}function w(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?S(e):null}function C(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return C(e)}}function k(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!o++||l!==r.debounceRendering)&&((l=r.debounceRendering)||s)(x)}function x(){for(var e;o=a.length;)e=a.sort((function(e,t){return e.__v.__b-t.__v.__b})),a=[],e.some((function(e){var t,n,r,i,a,o,s;e.__d&&(o=(a=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=m({},a)).__v=r,i=j(s,a,r,t.__n,void 0!==s.ownerSVGElement,null,n,null==o?S(a):o),A(n,a),i!=o&&C(a)))}))}function I(e,t,n,r,i,a,o,s,l){var d,c,p,m,v,f,b,y=n&&n.__k||h,w=y.length;if(s==u&&(s=null!=a?a[0]:w?S(n,0):null),d=0,t.__k=O(t.__k,(function(n){if(null!=n){if(n.__=t,n.__b=t.__b+1,null===(p=y[d])||p&&n.key==p.key&&n.type===p.type)y[d]=void 0;else for(c=0;c<w;c++){if((p=y[c])&&n.key==p.key&&n.type===p.type){y[c]=void 0;break}p=null}if(m=j(e,n,p=p||u,r,i,a,o,s,l),(c=n.ref)&&p.ref!=c&&(b||(b=[]),p.ref&&b.push(p.ref,null,n),b.push(c,n.__c||m,n)),null!=m){var h;if(null==f&&(f=m),void 0!==n.__d)h=n.__d,n.__d=void 0;else if(a==p||m!=s||null==m.parentNode){e:if(null==s||s.parentNode!==e)e.appendChild(m),h=null;else{for(v=s,c=0;(v=v.nextSibling)&&c<w;c+=2)if(v==m)break e;e.insertBefore(m,s),h=s}"option"==t.type&&(e.value="")}s=void 0!==h?h:m.nextSibling,"function"==typeof t.type&&(t.__d=s)}else s&&p.__e==s&&s.parentNode!=e&&(s=S(p))}return d++,n})),t.__e=f,null!=a&&"function"!=typeof t.type)for(d=a.length;d--;)null!=a[d]&&g(a[d]);for(d=w;d--;)null!=y[d]&&_(y[d],y[d]);if(b)for(d=0;d<b.length;d++)E(b[d],b[++d],b[++d])}function O(e,t,n){if(null==n&&(n=[]),null==e||"boolean"==typeof e)t&&n.push(t(null));else if(Array.isArray(e))for(var r=0;r<e.length;r++)O(e[r],t,n);else n.push(t?t("string"==typeof e||"number"==typeof e?f(null,e,null,null,e):null!=e.__e||null!=e.__c?f(e.type,e.props,e.key,null,e.__v):e):e);return n}function T(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]="number"==typeof n&&!1===p.test(t)?n+"px":null==n?"":n}function F(e,t,n,r,i){var a,o,s,l,d;if(i?"className"===t&&(t="class"):"class"===t&&(t="className"),"style"===t)if(a=e.style,"string"==typeof n)a.cssText=n;else{if("string"==typeof r&&(a.cssText="",r=null),r)for(l in r)n&&l in n||T(a,l,"");if(n)for(d in n)r&&n[d]===r[d]||T(a,d,n[d])}else"o"===t[0]&&"n"===t[1]?(o=t!==(t=t.replace(/Capture$/,"")),s=t.toLowerCase(),t=(s in e?s:t).slice(2),n?(r||e.addEventListener(t,M,o),(e.l||(e.l={}))[t]=n):e.removeEventListener(t,M,o)):"list"!==t&&"tagName"!==t&&"form"!==t&&"type"!==t&&"size"!==t&&!i&&t in e?e[t]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==t&&(t!==(t=t.replace(/^xlink:?/,""))?null==n||!1===n?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):null==n||!1===n&&!/^ar/.test(t)?e.removeAttribute(t):e.setAttribute(t,n))}function M(e){this.l[e.type](r.event?r.event(e):e)}function j(e,t,n,i,a,o,s,l,d){var c,u,h,p,g,v,f,b,S,C,k=t.type;if(void 0!==t.constructor)return null;(c=r.__b)&&c(t);try{e:if("function"==typeof k){if(b=t.props,S=(c=k.contextType)&&i[c.__c],C=c?S?S.props.value:c.__:i,n.__c?f=(u=t.__c=n.__c).__=u.__E:("prototype"in k&&k.prototype.render?t.__c=u=new k(b,C):(t.__c=u=new w(b,C),u.constructor=k,u.render=L),S&&S.sub(u),u.props=b,u.state||(u.state={}),u.context=C,u.__n=i,h=u.__d=!0,u.__h=[]),null==u.__s&&(u.__s=u.state),null!=k.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=m({},u.__s)),m(u.__s,k.getDerivedStateFromProps(b,u.__s))),p=u.props,g=u.state,h)null==k.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==k.getDerivedStateFromProps&&b!==p&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(b,C),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(b,u.__s,C)||t.__v===n.__v&&!u.__){for(u.props=b,u.state=u.__s,t.__v!==n.__v&&(u.__d=!1),u.__v=t,t.__e=n.__e,t.__k=n.__k,u.__h.length&&s.push(u),c=0;c<t.__k.length;c++)t.__k[c]&&(t.__k[c].__=t);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(b,u.__s,C),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(p,g,v)}))}u.context=C,u.props=b,u.state=u.__s,(c=r.__r)&&c(t),u.__d=!1,u.__v=t,u.__P=e,c=u.render(u.props,u.state,u.context),t.__k=null!=c&&c.type==y&&null==c.key?c.props.children:Array.isArray(c)?c:[c],null!=u.getChildContext&&(i=m(m({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(v=u.getSnapshotBeforeUpdate(p,g)),I(e,t,n,i,a,o,s,l,d),u.base=t.__e,u.__h.length&&s.push(u),f&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=D(n.__e,t,n,i,a,o,s,d);(c=r.diffed)&&c(t)}catch(e){t.__v=null,r.__e(e,t,n)}return t.__e}function A(e,t){r.__c&&r.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){r.__e(e,t.__v)}}))}function D(e,t,n,r,i,a,o,s){var l,d,c,p,m,g=n.props,v=t.props;if(i="svg"===t.type||i,null!=a)for(l=0;l<a.length;l++)if(null!=(d=a[l])&&((null===t.type?3===d.nodeType:d.localName===t.type)||e==d)){e=d,a[l]=null;break}if(null==e){if(null===t.type)return document.createTextNode(v);e=i?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type,v.is&&{is:v.is}),a=null,s=!1}if(null===t.type)g!==v&&e.data!=v&&(e.data=v);else{if(null!=a&&(a=h.slice.call(e.childNodes)),c=(g=n.props||u).dangerouslySetInnerHTML,p=v.dangerouslySetInnerHTML,!s){if(g===u)for(g={},m=0;m<e.attributes.length;m++)g[e.attributes[m].name]=e.attributes[m].value;(p||c)&&(p&&c&&p.__html==c.__html||(e.innerHTML=p&&p.__html||""))}(function(e,t,n,r,i){var a;for(a in n)"children"===a||"key"===a||a in t||F(e,a,null,n[a],r);for(a in t)i&&"function"!=typeof t[a]||"children"===a||"key"===a||"value"===a||"checked"===a||n[a]===t[a]||F(e,a,t[a],n[a],r)})(e,v,g,i,s),p?t.__k=[]:(t.__k=t.props.children,I(e,t,n,r,"foreignObject"!==t.type&&i,a,o,u,s)),s||("value"in v&&void 0!==(l=v.value)&&l!==e.value&&F(e,"value",l,g.value,!1),"checked"in v&&void 0!==(l=v.checked)&&l!==e.checked&&F(e,"checked",l,g.checked,!1))}return e}function E(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){r.__e(e,n)}}function _(e,t,n){var i,a,o;if(r.unmount&&r.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||E(i,null,t)),n||"function"==typeof e.type||(n=null!=(a=e.__e)),e.__e=e.__d=void 0,null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){r.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&_(i[o],t,n);null!=a&&g(a)}function L(e,t,n){return this.constructor(e,n)}function P(e,t,n){var i,a,o;r.__&&r.__(e,t),a=(i=n===d)?null:n&&n.__k||t.__k,e=v(y,null,[e]),o=[],j(t,(i?t:n||t).__k=e,a||u,u,void 0!==t.ownerSVGElement,n&&!i?[n]:a?null:h.slice.call(t.childNodes),o,n||u,i),A(o,e)}function H(e,t){P(e,t,d)}function R(e,t){var n,r;for(r in t=m(m({},e.props),t),arguments.length>2&&(t.children=h.slice.call(arguments,2)),n={},t)"key"!==r&&"ref"!==r&&(n[r]=t[r]);return f(e.type,n,t.key||e.key,t.ref||e.ref,null)}function $(e){var t={},n={__c:"__cC"+c++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,i=this;return this.getChildContext||(r=[],this.getChildContext=function(){return t[n.__c]=i,t},this.shouldComponentUpdate=function(e){i.props.value!==e.value&&r.some((function(t){t.context=e.value,k(t)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Consumer.contextType=n,n.Provider.__=n,n}r={__e:function(e,t){for(var n,r;t=t.__;)if((n=t.__c)&&!n.__)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError&&(r=!0,n.setState(n.constructor.getDerivedStateFromError(e))),null!=n.componentDidCatch&&(r=!0,n.componentDidCatch(e)),r)return k(n.__E=n)}catch(t){e=t}throw e}},i=function(e){return null!=e&&void 0===e.constructor},w.prototype.setState=function(e,t){var n;n=this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(n,this.props)),e&&m(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),k(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),k(this))},w.prototype.render=y,a=[],o=0,s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,d=u,c=0},4798:e=>{"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};e.exports=function(e,n){void 0===e&&(e={}),void 0===n&&(n=null);var r=e||{},i=[];function a(){i.forEach((function(e){return e(r)}))}return{middleware:n,setState:function(e){r=t({},r,"function"==typeof e?e(r):e),a()},subscribe:function(e){return i.push(e),function(){i.splice(i.indexOf(e),1)}},getState:function(){return r},reset:function(){r=e,a()}}}},1042:(e,t)=>{"use strict";function n(e,t){if(null!=t){if(t.then)return t.then(e.setState);e.setState(t)}}t.m=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reverse(),function(t,r,i){if(e.length<1)return n(t,r.apply(void 0,[t.getState()].concat(i)));var a=e.map((function(e){return e(t)})).reduce((function(e,t){return t(e,i)}),function(e,t){return function(r){return n(e,r.apply(void 0,[e.getState()].concat(t)))}}(t,i));return a(r)}}},5576:(e,t,n)=>{"use strict";var r=n(6400),i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},i(e,t)};function a(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function s(e,t){for(var n in e)if(e[n]!==t[n])return!1;for(var n in t)if(!(n in e))return!1;return!0}function l(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return"function"==typeof t.middleware?t.middleware(t,e,n):function(e,t){if(null!=t){if(t.then)return t.then(e.setState);e.setState(t)}}(t,e.apply(void 0,[t.getState()].concat(n)))}}var d=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.update=function(){var e=r.getProps(r.props,r.context);s(e,r.state)||r.setState(e)},r.state=r.getProps(t,n),r.actions=r.getActions(),r}return a(t,e),t.prototype.componentWillMount=function(){this.unsubscribe=this.context.store.subscribe(this.update)},t.prototype.componentWillUnmount=function(){this.unsubscribe(this.update)},t.prototype.componentWillReceiveProps=function(e,t){var n=this.getProps(e,t);s(n,this.state)||this.setState(n)},t.prototype.getProps=function(e,t){var n=e.mapToProps,r=t.store&&t.store.getState()||{};return n?n(r,e):r},t.prototype.getActions=function(){return function(e,t,n){e="function"==typeof e?e(t,n):e;var r={};for(var i in e){var a=e[i];r[i]=l(a,t)}return r}(this.props.actions,this.context.store,this.props)},t.prototype.render=function(e,t,n){var r=e.children,i=n.store;return(r&&r[0]||r)(o({store:i},t,this.actions))},t}(r.Component),c=d;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.getChildContext=function(){return{store:this.props.store}},t.prototype.render=function(){return this.props.children&&this.props.children[0]||this.props.children},t}(r.Component);t.zt=u,t.lj=d},7867:(e,t)=>{"use strict";function n(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return"function"==typeof t.middleware?t.middleware(t,e,n):function(e,t){if(null!=t){if(t.then)return t.then(e.setState);e.setState(t)}}(t,e.apply(void 0,[t.getState()].concat(n)))}}var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};t.kv=function(e,t,r){e="function"==typeof e?e(t,r):e;var i={};for(var a in e){var o=e[a];i[a]=n(o,t)}return i},t.Y2=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.reduce((function(e,n){return r({},e,"function"==typeof n?n.apply(void 0,t):n)}),{})}}},5373:(e,t,n)=>{var r=n(4630);r&&r.__esModule&&(r=r.default),e.exports="string"==typeof r?r:r.toString()},5877:(e,t,n)=>{var r=n(3570),i=n(1171),a=i;a.v1=r,a.v4=i,e.exports=a},5327:e=>{for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},5217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},3570:(e,t,n)=>{var r,i,a=n(5217),o=n(5327),s=0,l=0;e.exports=function(e,t,n){var d=t&&n||0,c=t||[],u=(e=e||{}).node||r,h=void 0!==e.clockseq?e.clockseq:i;if(null==u||null==h){var p=a();null==u&&(u=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==h&&(h=i=16383&(p[6]<<8|p[7]))}var m=void 0!==e.msecs?e.msecs:(new Date).getTime(),g=void 0!==e.nsecs?e.nsecs:l+1,v=m-s+(g-l)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||m>s)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=m,l=g,i=h;var f=(1e4*(268435455&(m+=122192928e5))+g)%4294967296;c[d++]=f>>>24&255,c[d++]=f>>>16&255,c[d++]=f>>>8&255,c[d++]=255&f;var b=m/4294967296*1e4&268435455;c[d++]=b>>>8&255,c[d++]=255&b,c[d++]=b>>>24&15|16,c[d++]=b>>>16&255,c[d++]=h>>>8|128,c[d++]=255&h;for(var y=0;y<6;++y)c[d+y]=u[y];return t||o(c)}},1171:(e,t,n)=>{var r=n(5217),i=n(5327);e.exports=function(e,t,n){var a=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||r)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[a+s]=o[s];return t||i(o)}},1295:e=>{"use strict";let t=0;e.exports={incr:()=>++t,decr:()=>--t,curr:()=>t}},6756:e=>{"use strict";e.exports=(e,t,n="")=>{const r=/url\(['"]?#([\w:.-]+)['"]?\)/g,i=/#([\w:.-]+)/g;return t.match(r)&&(t=t.replace(r,(function(t,n){return e[n]?`url(#${e[n]})`:t}))),["href","xlink:href"].includes(n)&&t.match(i)&&(t=t.replace(i,(function(t,n){return e[n]?`#${e[n]}`:t}))),t}},3054:e=>{"use strict";e.exports=(e,t,n)=>{const r=new RegExp("([^\r\n,{}]+)(,(?=[^}]*{)|s*{)","g");return e=e.replace(r,(function(e,r,i){if(r.match(/^\s*(@media|@.*keyframes|to|from|@font-face|1?[0-9]?[0-9])/))return r+i;const a=r.match(/#(\w+)/);return a&&n[a[1]]&&(r=r.replace(a[0],`#${n[a[1]]}`)),(r=r.replace(/^(\s*)/,"$1"+t+" "))+i}))}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={id:r,exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.d(r,{default:()=>nh});n(1181);var e=n(7867),t=n(5877);const i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;let r=new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t});n.dispatchEvent(r)};var a=n(7292);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let s;!function(e){e[e.DISABLED=0]="DISABLED",e[e.TRANSACTIONS=1]="TRANSACTIONS",e[e.PAYLOAD=2]="PAYLOAD",e[e.FULL_DETAIL=3]="FULL_DETAIL"}(s||(s={}));class l{static debug(e){l.logLevel!==s.DISABLED&&(e.level1||e.level2||e.level3)&&console.log(...this.constructLogPayload(e))}static warn(e){l.logLevel!==s.DISABLED&&(e.level1||e.level2||e.level3)&&console.warn(...this.constructLogPayload(e))}static error(e){l.logLevel!==s.DISABLED&&(e.level1||e.level2||e.level3)&&console.error(...this.constructLogPayload(e))}}o(l,"logLevel",s.DISABLED),o(l,"constructLogPayload",(e=>{const t=["AtomicSDK Web -"];return l.logLevel>=s.TRANSACTIONS&&e.level1&&t.push(...e.level1),l.logLevel>=s.PAYLOAD&&e.level2&&t.push(...e.level2),l.logLevel>=s.FULL_DETAIL&&e.level3&&t.push(...e.level3),t}));var d=n(4798),c=n.n(d),u=n(1042);const h={application:{open:!1,windowOrigin:null,streamContainerId:"",containerInstanceId:"",isPreview:!1,cardListRefreshInterval:15e3,runtimeVariableResolutionTimeout:5e3,embedMode:"launcher",customStrings:{},firstLoadStyles:{backgroundColor:"#FFFFFF",textColor:"rgba(0,0,0,0.5)",loadingSpinnerColor:"#000000",buttonTextColor:"#000000"},enabledUiElements:{cardListToast:!0,customToastContainer:!1,cardListHeader:!0},interfaceStyle:"automatic"},cardFeed:{lastModified:"",cardInstances:[],runtimeVariables:{},runtimeVariableAnalyticsEnabled:!1,tutorialSeen:!0,status:{loaded:!1}},navigationStack:{items:[]},cardResponses:{},validationStates:{},theme:{},cardStates:{},messages:{lastMessageId:"0"}};let p;const m=()=>{if(!p)throw new Error("You must initialise the store before accessing it.");return p},g="io.atomic.events.sdkLogout",v="YYYY-MM-DD[T]HH:mm:ssZZ",f=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,b=20,y=20,w=20,S=20,C="io.atomic.events.cardFeedUpdateReceived",k="io.atomic.events.pollingFallbackEnabled",x="io.atomic.events.pollingFallbackDisabled",I="io.atomic.events.socketAuthenticationError",O="io.atomic.events.streamFilterApplied",T="sdkInitialisation",F="displayedCards",M="cardDescription",j="headline",A="text",D="list",E="image",_="video",L="textInput",P="numberInput",H="datePicker",R="dropdown",$="checkbox",N="stepper",V="switch",W="upload",z="form",B="actionButtonGroup",U="submitButton",q="linkButton",Y="dismissButton",K="snoozeButton",Z="voteUpButton",Q="voteDownButton";var G,X,J,ee=n(6400),te=0,ne=[],re=ee.options.__r,ie=ee.options.diffed,ae=ee.options.__c,oe=ee.options.unmount;function se(e,t){ee.options.__h&&ee.options.__h(X,e,te||t),te=0;var n=X.__H||(X.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function le(e){return te=1,de(we,e)}function de(e,t,n){var r=se(G++,2);return r.__c||(r.__c=X,r.__=[n?n(t):we(void 0,t),function(t){var n=e(r.__[0],t);r.__[0]!==n&&(r.__[0]=n,r.__c.setState({}))}]),r.__}function ce(e,t){var n=se(G++,3);!ee.options.__s&&ye(n.__H,t)&&(n.__=e,n.__H=t,X.__H.__h.push(n))}function ue(e,t){var n=se(G++,4);!ee.options.__s&&ye(n.__H,t)&&(n.__=e,n.__H=t,X.__h.push(n))}function he(e){return te=5,me((function(){return{current:e}}),[])}function pe(e,t,n){te=6,ue((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))}function me(e,t){var n=se(G++,7);return ye(n.__H,t)?(n.__H=t,n.__h=e,n.__=e()):n.__}function ge(e){var t=X.context[e.__c],n=se(G++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(X)),t.props.value):e.__}function ve(){ne.some((function(e){if(e.__P)try{e.__H.__h.forEach(fe),e.__H.__h.forEach(be),e.__H.__h=[]}catch(t){return e.__H.__h=[],ee.options.__e(t,e.__v),!0}})),ne=[]}function fe(e){e.t&&e.t()}function be(e){var t=e.__();"function"==typeof t&&(e.t=t)}function ye(e,t){return!e||t.some((function(t,n){return t!==e[n]}))}function we(e,t){return"function"==typeof t?t(e):t}ee.options.__r=function(e){re&&re(e),G=0,(X=e.__c).__H&&(X.__H.__h.forEach(fe),X.__H.__h.forEach(be),X.__H.__h=[])},ee.options.diffed=function(e){ie&&ie(e);var t=e.__c;if(t){var n=t.__H;n&&n.__h.length&&(1!==ne.push(t)&&J===ee.options.requestAnimationFrame||((J=ee.options.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);"undefined"!=typeof window&&(t=requestAnimationFrame(n))})(ve))}},ee.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(fe),e.__h=e.__h.filter((function(e){return!e.__||be(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],ee.options.__e(n,e.__v)}})),ae&&ae(e,t)},ee.options.unmount=function(e){oe&&oe(e);var t=e.__c;if(t){var n=t.__H;if(n)try{n.__.forEach((function(e){return e.t&&e.t()}))}catch(e){ee.options.__e(e,t.__v)}}};var Se=n(5576);const Ce=()=>({handleSubviewLinkPress:(e,t,n)=>ke(e,t,n),finishSubview:e=>xe(e),viewMedia(e,t,n){if(e.application.isPreview)return e;if(!n||!n.url||0===n.url.trim().length)return e;return Te(e,{kind:"media",cardInstanceId:t,item:n})},navigateBack(e){if(e.navigationStack.items.length){const r=e.navigationStack.items[e.navigationStack.items.length-1];let i=e.cardResponses[r.cardInstanceId]?Object.assign({},e.cardResponses[r.cardInstanceId]):void 0,a=e.validationStates[r.cardInstanceId]?Object.assign({},e.validationStates[r.cardInstanceId]):void 0;var t,n;if(r&&"subview"===r.kind)i&&(null===(t=i.subviews)||void 0===t||delete t[r.subviewId]),a&&(null===(n=a.subviews)||void 0===n||delete n[r.subviewId]),e.application.isPreview||window.AtomicUploadService.removeFilesForCardSubview(e.application.containerInstanceId,r.cardInstanceId,r.subviewId);return Object.assign(Object.assign({},Fe(e)),{cardResponses:Object.assign(Object.assign({},e.cardResponses),i?{[r.cardInstanceId]:i}:{}),validationStates:Object.assign(Object.assign({},e.validationStates),a?{[r.cardInstanceId]:a}:{}),messages:Object.assign(Object.assign({},e.messages),{subview:void 0})})}return e},clearSubviewsForCardInstance(e,t){const n=e.navigationStack.items.slice().filter((e=>e.cardInstanceId!==t));return Object.assign(Object.assign({},e),{navigationStack:{items:n}})},requestSnooze(e,t,n,r){if(e.application.isPreview)return e;const i=Object.assign({kind:"snooze",cardInstanceId:t,source:n},r?{cardExpiry:r}:{});return Te(e,i)},requestFeedback(e,t,n){if(e.application.isPreview)return e;const r={kind:"feedback",cardInstanceId:t,sentiment:n.sentiment,textFeedback:n.textFeedback,textFeedbackLabel:n.textFeedbackLabel,source:n.source};return Te(e,r)}}),ke=(e,t,n)=>{const r=e.cardFeed.cardInstances;if(r){const i=r.find((e=>e.instance.id===t)),a=i&&i.subviews[n];if(i&&a){const t={kind:"subview",cardInstance:i,cardInstanceId:i.instance.id,subviewId:n};return Te(e,t)}}return e},xe=e=>{const t=e.cardFeed.cardInstances;return Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{cardInstances:t,status:{loaded:!0}}),navigationStack:{items:[]}})};let Ie;const Oe=()=>(Ie||(Ie=(0,e.kv)((0,e.Y2)(Ce),m())),Ie),Te=(e,t)=>{let n=e.navigationStack.items.slice();for(const[e,r]of n.entries())switch(r.cardInstanceId!==t.cardInstanceId&&(n=[]),r.kind){case"subview":case"snooze":case"feedback":r.kind===t.kind&&n.splice(e,1);break;case"media":r.kind===t.kind&&r.item.url===t.item.url&&n.splice(e,1)}return Object.assign(Object.assign({},e),{navigationStack:{items:[...n,t]}})},Fe=e=>{const t=e.navigationStack.items.slice();return t.pop(),Object.assign(Object.assign({},e),{navigationStack:{items:t}})},Me=e=>e.navigationStack.items.length?e.navigationStack.items[e.navigationStack.items.length-1]:null;function je(e){return void 0!==e&&"subview"===e.kind}function Ae(e){return void 0!==e&&"snooze"===e.kind}function De(e){return void 0!==e&&"feedback"===e.kind}function Ee(e){return void 0!==e&&"media"===e.kind}var _e=n(2807),Le=n.n(_e);const Pe=e=>Object.keys(e).filter((t=>e[t])).join(" "),He=(e,t)=>{const n=((e,t)=>Le()(new Date(t,e-1)))(e,t),r=new Date(t,e-1,1).getDay()||7,i={week1:[],week2:[],week3:[],week4:[],week5:[],week6:[]};for(let a=0;a<n;a++){const n=new Date(t,e-1,a+1),o=Math.ceil((r+a)/7)-1,s=(r-1+a)%7+1;i[`week${Math.ceil((r+a)/7)}`].push({date:n,row:o,col:s,style:{gridRowStart:o,gridColumnStart:s}})}return i},Re=(e,t)=>{let{isMax:n,isMin:r}=t;const i=new Date(e);return n?(0,a.endOfDay)((0,a.addMinutes)(i,i.getTimezoneOffset())):r?(0,a.addMinutes)(i,i.getTimezoneOffset()):i};var $e=n(5616),Ne=n.n($e),Ve=n(623),We=n.n(Ve);const ze={required:"This field is required",minimumDate:e=>`Value must be after ${e}`,maximumDate:e=>`Value must be before ${e}`,regexp:"Value does not meet requirements",minimum:e=>`Value must be at least ${e}`,maximum:e=>`Value must be no more than ${e}`,minimumLength:e=>1===e?"Value must be at least 1 character":`Value must be at least ${e} characters`,maximumLength:e=>1===e?"Value must be no more than 1 character":`Value must be no more than ${e} characters`,minChecked:(e,t)=>1===t?"This option must be checked":1===e?"You must select at least one option":`At least ${e} options must be selected`,maxChecked:e=>1===e?"You cannot select more than one option":`You cannot select more than ${e} options`},Be={required:(e,t)=>{const n=e.errorMessage||ze.required;return e.required&&(null==t||null==t||"string"==typeof t&&0==t.length)?{type:"invalid",errorMessage:n}:{type:"valid"}},minimumDate:(e,t)=>{const n=Re(e.minimumDate,{isMin:!0}),r=e.errorMessage||ze.minimumDate(Ne()(n,"DD MMM YYYY"));if(null==t||null==t)return{type:"invalid",errorMessage:r};const i=new Date(t);return!We()(i)||i<n?{type:"invalid",errorMessage:r}:{type:"valid"}},maximumDate:(e,t)=>{const n=Re(e.maximumDate,{isMax:!0}),r=e.errorMessage||ze.maximumDate(Ne()(n,"DD MMM YYYY"));if(null==t||null==t)return{type:"invalid",errorMessage:r};const i=new Date(t);return!We()(i)||i>n?{type:"invalid",errorMessage:r}:{type:"valid"}},regexp:(e,t)=>{const n=e.errorMessage||ze.regexp;if(null==t||null==t)return{type:"invalid",errorMessage:n};try{if(!new RegExp(e.regexp).test(t))return{type:"invalid",errorMessage:n}}catch(e){}return{type:"valid"}},minimum:(e,t)=>{const n=e.errorMessage||ze.minimum(e.minimum);return null==t||null==t||t<e.minimum?{type:"invalid",errorMessage:n}:{type:"valid"}},maximum:(e,t)=>{const n=e.errorMessage||ze.maximum(e.maximum);return null==t||null==t||t>e.maximum?{type:"invalid",errorMessage:n}:{type:"valid"}},minimumLength:(e,t)=>{const n=e.errorMessage||ze.minimumLength(e.minimumLength);return null==t||null==t||t.length<e.minimumLength?{type:"invalid",errorMessage:n}:{type:"valid"}},maximumLength:(e,t)=>{const n=e.errorMessage||ze.maximumLength(e.maximumLength);return null==t||null==t?{type:"valid"}:t.length>e.maximumLength?{type:"invalid",errorMessage:n}:{type:"valid"}},minChecked:(e,t)=>{const n=e.errorMessage||ze.minChecked(e.minChecked,Object.keys(t).length);return null==t||null==t||Object.values(t).filter((e=>e)).length<e.minChecked?{type:"invalid",errorMessage:n}:{type:"valid"}},maxChecked:(e,t)=>{const n=e.errorMessage||ze.maxChecked(e.maxChecked);return null==t||null==t||Object.values(t).filter((e=>e)).length>e.maxChecked?{type:"invalid",errorMessage:n}:{type:"valid"}},maxSizeBytes:(e,t)=>{const n=Math.round(e.maxSizeBytes/1048576),r=e.errorMessage||`File size must be no more than ${n}MB`;return null==t||null==t?{type:"valid"}:t.size&&t.size>e.maxSizeBytes?{type:"invalid",errorMessage:r}:{type:"valid"}}},Ue=["required","minimumLength","maximumLength","minimum","maximum","minimumDate","maximumDate","minChecked","maxChecked","maxSizeBytes","regexp"],qe=(e,t)=>{if(!t)return{type:"valid"};for(const n in Ue){const r=Ue[n],i=t[r];if(void 0===i)continue;const a=Be[r];if(a){const t=a(i.attributes,e);if("invalid"===t.type)return t}}return{type:"valid"}},Ye=()=>({handleImageLinkPress(e,t,n){const r=e.navigationStack.items.length?"subview":"topview",i=Object.assign(Object.assign({},n.currentSubviewId&&{subviewId:n.currentSubviewId}),n.currentSubviewTitle&&{subviewTitle:n.currentSubviewTitle});return n.layoutId?ke(e,t,n.layoutId):n.payload&&!e.application.isPreview?Ze(e,"payload","image",t,r,n.payload,i):e},handleLinkButtonPress(e,t,n,r,i){const a=e.navigationStack.items.length?"subview":"topview";return r?ke(e,t,r):i&&!e.application.isPreview?Ze(e,"payload","linkButton",t,a,i,n):e},handleSubmitButtonPayload(e,t,n,r){const i=e.navigationStack.items.length?"subview":"topview";return Ze(e,"payload","submitButton",t,i,r,n)},openExternalUrl:(e,t,n,r,i,a,o)=>(null==o?void 0:o.url)&&!e.application.isPreview?Qe(e,i,a,t,n,o,r):e,handleFormChange:(e,t,n,r,i)=>Ke(e,t,{[n]:r},i),createResponseWithDefaults:(e,t,n,r)=>Ke(e,t,n,r),clearCardForm(e,t){var n,r;return Object.assign(Object.assign({},e),{cardResponses:Object.assign(Object.assign({},e.cardResponses),{[t]:Object.assign(Object.assign({},(null===(n=e.cardResponses[t])||void 0===n?void 0:n.responses)?{responses:{}}:{}),(null===(r=e.cardResponses[t])||void 0===r?void 0:r.subviews)?{subviews:{}}:{})})})},validateField(e,t,n,r,i,a){var o,s,l,d;let c=qe(r,i);const u=c&&!a?{[n]:c}:{},h=c&&a?{[n]:c}:{},p=e.validationStates,m=null!==(o=null===(l=p[t])||void 0===l?void 0:l.validations)&&void 0!==o?o:{},g=null!==(s=null===(d=p[t])||void 0===d?void 0:d.subviews)&&void 0!==s?s:{};return Object.assign(Object.assign({},e),{validationStates:Object.assign(Object.assign({},p),{[t]:{validations:Object.assign(Object.assign({},m),u),subviews:Object.assign(Object.assign({},g),h&&a?{[a]:Object.assign(Object.assign({},g[a]),h)}:{})}})})},validateFieldCustomResult(e,t,n,r,i){var a,o,s,l;const d=r&&!i?{[n]:r}:{},c=r&&i?{[n]:r}:{},u=e.validationStates,h=null!==(a=null===(s=u[t])||void 0===s?void 0:s.validations)&&void 0!==a?a:{},p=null!==(o=null===(l=u[t])||void 0===l?void 0:l.subviews)&&void 0!==o?o:{};return Object.assign(Object.assign({},e),{validationStates:Object.assign(Object.assign({},u),{[t]:{validations:Object.assign(Object.assign({},h),d),subviews:Object.assign(Object.assign({},p),c&&i?{[i]:Object.assign(Object.assign({},p[i]),c)}:{})}})})},validateCurrentSubview(e,t){const n=Me(e);if(n&&je(n)){const r=n.subviewId,i=n.cardInstance.subviews[r],a=Ge(e,i.nodes,t,r);let o=e.validationStates;return Object.assign(Object.assign({},e),{validationStates:Object.assign(Object.assign({},o),{[t]:Object.assign(Object.assign({},e.validationStates[t]),{subviews:{[r]:a}})})})}return e},validateCardTopLevel(e,t){const[n]=e.cardFeed.cardInstances.filter((e=>e.instance.id===t));let r={};return n&&(r=Ge(e,n.defaultView.nodes,t)),Object.assign(Object.assign({},e),{validationStates:Object.assign(Object.assign({},e.validationStates),{[t]:Object.assign(Object.assign({},e.validationStates[t]),{validations:r})})})}}),Ke=(e,t,n,r)=>{var i;const a=e.cardResponses[t]||{},o=r?null===(i=a.subviews)||void 0===i?void 0:i[r]:{};return Object.assign(Object.assign({},e),{cardResponses:Object.assign(Object.assign({},e.cardResponses),{[t]:{responses:Object.assign(Object.assign({},a.responses),r?{}:n),subviews:Object.assign(Object.assign({},a.subviews),r?{[r]:Object.assign(Object.assign({},o),n)}:{})}})})},Ze=(e,t,n,r,i,a,o)=>Object.assign(Object.assign({},e),{externalAction:Object.assign({actionId:(new Date).getTime(),linkMethod:t,trigger:n,cardInstanceId:r,cardViewState:i,subviewData:o},a?{payload:{actionPayload:a,cardInstanceId:r,streamContainerId:e.application.streamContainerId}}:{})}),Qe=(e,t,n,r,i,a,o)=>Object.assign(Object.assign({},e),{externalAction:{actionId:(new Date).getTime(),linkMethod:t,trigger:n,urlLink:a,cardInstanceId:r,cardViewState:i,subviewData:o}}),Ge=(e,t,n,r)=>{var i;const a=uc(t),o=r?null===(i=e.cardResponses[n].subviews)||void 0===i?void 0:i[r]:e.cardResponses[n].responses;let s={};for(const e in a){const t=a[e];t.attributes.name&&o&&(s[t.attributes.name]=qe(o[t.attributes.name],t.validations))}return s};let Xe;const Je=()=>(Xe||(Xe=(0,e.kv)((0,e.Y2)(Ye),m())),Xe),et=(e,t,n)=>{var r,i;const a=m().getState().cardResponses,o=null===(r=a[e])||void 0===r||null===(i=r.responses)||void 0===i?void 0:i[t];return null!=o?o:n?null===(s=a[e])||void 0===s||null===(l=s.subviews)||void 0===l||null===(d=l[n])||void 0===d?void 0:d[t]:void 0;var s,l,d},tt="sdk-initialized",nt="card-displayed",rt="user-redirected",it="card-voted-up",at="card-voted-down",ot="runtime-vars-updated",st="stream-displayed",lt="snooze-options-displayed",dt="snooze-options-canceled",ct="card-subview-displayed",ut="card-subview-exited",ht="request-failed",pt="video-played",mt="video-completed",gt="notification-received",vt="user-file-uploads-started",ft="user-file-uploads-completed",bt="user-file-uploads-failed";var yt=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))},wt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function St(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ct="AACUploadFailedError",kt="AACUploadSignedUrlFailedError",xt="AACNoFileToUploadError",It="AACUploadCancelledError",Ot="Couldn't upload file(s)",Tt="Couldn't upload file(s)",Ft="No files to upload",Mt="File upload cancelled";class jt{constructor(){St(this,"_fileStorage",void 0),St(this,"_uploadQueue",void 0),this._fileStorage=new Map,this._uploadQueue=new Map,jt._instance=this}static getInstance(){return jt._instance||(jt._instance=new jt),jt._instance}storeFile(e,t,n,r,i,a,o,s,l){var d,c,u,h;(this._fileStorage.get(i)||this._fileStorage.set(i,new Map),null===(d=this._fileStorage.get(i))||void 0===d?void 0:d.get(r))||(null===(h=this._fileStorage.get(i))||void 0===h||h.set(r,{topLevel:new Map,subviews:{}}));l&&!(null===(c=this._fileStorage.get(i))||void 0===c||null===(u=c.get(r))||void 0===u?void 0:u.subviews[l])&&(this._fileStorage.get(i).get(r).subviews[l]=new Map);const p={file:e,type:t,targetBucketId:n,destinationFilename:a,convertImage:o,size:e.size,uploaded:!1};l?this._fileStorage.get(i).get(r).subviews[l].set(s,p):this._fileStorage.get(i).get(r).topLevel.set(s,p)}getFile(e,t,n,r){var i,a,o,s,l,d;return r?(null===(s=this._fileStorage.get(e))||void 0===s||null===(l=s.get(t))||void 0===l||null===(d=l.subviews[r])||void 0===d?void 0:d.get(n))||null:(null===(i=this._fileStorage.get(e))||void 0===i||null===(a=i.get(t))||void 0===a||null===(o=a.topLevel)||void 0===o?void 0:o.get(n))||null}getAllFilesForCard(e,t){var n;return(null===(n=this._fileStorage.get(e))||void 0===n?void 0:n.get(t))||null}removeFile(e,t,n,r){var i,a,o,s,l,d,c,u;return r?null!==(i=null===(d=this._fileStorage.get(e))||void 0===d||null===(c=d.get(t))||void 0===c||null===(u=c.subviews[r])||void 0===u?void 0:u.delete(n))&&void 0!==i&&i:null!==(a=null===(o=this._fileStorage.get(e))||void 0===o||null===(s=o.get(t))||void 0===s||null===(l=s.topLevel)||void 0===l?void 0:l.delete(n))&&void 0!==a&&a}removeAllFilesForCard(e,t){var n;null===(n=this._fileStorage.get(e))||void 0===n||n.delete(t)}removeFilesForCardSubview(e,t,n){var r,i;null===(r=this._fileStorage.get(e))||void 0===r||(null===(i=r.get(t))||void 0===i||delete i.subviews[n])}removeFilesForContainer(e){this._fileStorage.delete(e)}getIsUploadingStatus(e){var t;const n=null===(t=this._uploadQueue.get(e))||void 0===t?void 0:t.size;return!!n&&n>0}uploadFile(e,t,n,r,i){return yt(this,void 0,void 0,(function*(){return new Promise(((a,o)=>yt(this,void 0,void 0,(function*(){var s;const{file:d,targetBucketId:c,destinationFilename:u}=n,h=null===(s=this._uploadQueue.get(t))||void 0===s?void 0:s.get(e);let p=!1;const m=new Error(Mt);m.name=It,h&&(h.uploadRequests[r]={abort:()=>{p=!0,l.debug({level1:[`File upload for card: ${e} in container instance: ${t} was cancelled`,u]}),o({error:m,fieldname:r,filename:u})}});let g=`get-file-upload-url?filename=${encodeURIComponent(u)}&targetBucketId=${c}&card_instance_id=${e}`;n.convertImage&&(g+="&jpeg_convert=1");const{data:{uploadUrl:v},response:f}=yield zc.get(g,i);if(p)return;if(f.error){l.error({level1:["Failed to get upload URL",f.error]});const e=new Error(Tt);return e.name=kt,o({error:e,fieldname:r,filename:u})}const b=new XMLHttpRequest,y=new Error(Ot);y.name=Ct,b.onload=()=>{b.status>=200&&b.status<300?(l.debug({level1:[`File upload for card: ${e} in container instance: ${t} was successful`,u]}),a(r)):(l.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,u]}),o({error:y,fieldname:r,filename:u}))},b.onerror=()=>{l.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,u]}),o({error:y,fieldname:r,filename:u})},b.onabort=()=>{l.debug({level1:[`File upload for card: ${e} in container instance: ${t} was cancelled`,u]});const n=new Error(Mt);n.name=It,o({error:n,fieldname:r,filename:u})},h&&(h.uploadRequests[r]=b);try{b.open("PUT",v,!0);const e=new FormData;e.append("file",d,u),b.send(e.get("file"))}catch(n){l.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,n]}),o({error:y,fieldname:r,filename:u})}}))))}))}uploadFilesForCard(e,t,n,r,i){return yt(this,void 0,void 0,(function*(){var a,o,s,d,c,u;const h=null==i?void 0:i.subviewData,p=(null==h?void 0:h.subviewId)?null===(a=this._fileStorage.get(t))||void 0===a||null===(o=a.get(e))||void 0===o?void 0:o.subviews[h.subviewId]:null===(s=this._fileStorage.get(t))||void 0===s||null===(d=s.get(e))||void 0===d?void 0:d.topLevel;if(!p){const e=new Error(Ft);return e.name=xt,{success:!1,error:e}}this._uploadQueue.set(t,(new Map).set(e,{cancelSubmitCallback:null==i?void 0:i.cancelSubmitCallback,uploadRequests:[]}));const m=[];for(const[e,t]of p)t.uploaded||m.push(Object.assign(Object.assign({},t),{fieldname:e}));const g=Object.assign({},(null==h?void 0:h.subviewId)?{subviewId:h.subviewId,subviewTitle:h.subviewTitle,subviewLevel:1}:{}),v=Object.assign({},g),f=m.map((r=>{const{fieldname:i}=r,a=wt(r,["fieldname"]);if(v[i]={filename:a.destinationFilename,targetBucketId:a.targetBucketId},"image"===a.type)return this.uploadFile(e,t,a,i,n)})),b={success:!1};return r.sendEvent({cardInstanceId:e,cardViewState:(null==h?void 0:h.subviewId)?"subview":"topview",eventName:vt,properties:v}),yield Promise.allSettled(f).then((n=>{const i=[],a=[],o=Object.assign({},g),s=Object.assign({},g),d=n=>{var r,i,a,o,s;return(null==h?void 0:h.subviewId)?null===(r=this._fileStorage.get(t))||void 0===r||null===(i=r.get(e))||void 0===i||null===(a=i.subviews[h.subviewId])||void 0===a?void 0:a.get(n):null===(o=this._fileStorage.get(t))||void 0===o||null===(s=o.get(e))||void 0===s?void 0:s.topLevel.get(n)};n.forEach((n=>{var r;if("fulfilled"===n.status&&(null===(r=this._fileStorage.get(t))||void 0===r?void 0:r.get(e))){const e=d(n.value);e&&(e.uploaded=!0),o[n.value]={filename:null==e?void 0:e.destinationFilename,targetBucketId:null==e?void 0:e.targetBucketId}}else if("rejected"===n.status){const e=n.reason;if(e.error.name===It)a.push(n.reason);else{i.push(e);const t=d(e.fieldname);s[e.fieldname]={filename:null==t?void 0:t.destinationFilename,targetBucketId:null==t?void 0:t.targetBucketId},b.error=e.error}}})),i.length||a.length||(l.debug({level1:[`All files successfully uploaded for card: ${e} in container instance: ${t}`]}),r.sendEvent({cardInstanceId:e,cardViewState:(null==h?void 0:h.subviewId)?"subview":"topview",eventName:ft,properties:o}),b.success=!0),i.length&&(l.error({level1:[`Failed to upload files for card: ${e} in container instance: ${t}`,...i]}),r.sendEvent({cardInstanceId:e,cardViewState:(null==h?void 0:h.subviewId)?"subview":"topview",eventName:bt,properties:s}),b.failedUploads=i),a.length&&(b.cancelledUploads=a)})),null===(c=this._uploadQueue.get(t))||void 0===c||c.delete(e),(null===(u=this._uploadQueue.get(t))||void 0===u?void 0:u.size)||this._uploadQueue.delete(t),b}))}cancelUploadForCard(e,t){return yt(this,void 0,void 0,(function*(){var n,r,i;const a=null===(n=this._uploadQueue.get(e))||void 0===n?void 0:n.get(t);var o;a&&(Object.values(a.uploadRequests).forEach((e=>{e.abort()})),null===(o=a.cancelSubmitCallback)||void 0===o||o.call(a));null===(r=this._uploadQueue.get(e))||void 0===r||r.delete(t),(null===(i=this._uploadQueue.get(e))||void 0===i?void 0:i.size)||this._uploadQueue.delete(e)}))}cancelUploadsForContainer(e){return yt(this,void 0,void 0,(function*(){const t=this._uploadQueue.get(e);t&&(t.forEach((e=>{var t;Object.values(e.uploadRequests).forEach((e=>{e.abort()})),null===(t=e.cancelSubmitCallback)||void 0===t||t.call(e)})),this._uploadQueue.delete(e))}))}}St(jt,"_instance",void 0);const At=jt.getInstance();var Dt=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const Et=(e,t)=>e?Object.keys(e).reduce(((n,r)=>{const i=e[r];return t.includes(i||"")||(n[r]=e[r]),n}),{}):e,_t=e=>Et(e,["submitted","dismissed","snoozed","submitted-subview","centering"]),Lt=(e,t,n)=>{var r,i;const a=null===(r=e.cardFeed.cardInstances.filter((e=>e.instance.id!==t))[0])||void 0===r||null===(i=r.instance)||void 0===i?void 0:i.id;return Object.assign(Object.assign({},e.cardStates),a&&{[a]:n})},Pt=(e,t,n)=>(e||[]).reduce(((e,r,i)=>(n[r.instance.id]&&void 0===(t||[]).find((e=>e.instance.id===r.instance.id))&&e.splice(i,0,r),e)),[...t]),Ht=function(){let e=Number(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0);return""+ ++e},Rt=(e,t,n)=>{var r;if(!n)return e;switch(n.name){case _c.noInternet:return"No internet connection";case Ct:case xt:case kt:return(null==t||null===(r=t.toastMessages)||void 0===r?void 0:r.fileUploadFailed)||n.message;default:return e}},$t=(e,t)=>{var n;return((null===(n=t.application.enabledUiElements.toastConfig)||void 0===n?void 0:n.toastMessages)||{})[e]},Nt=(e,t)=>{switch(t){case"cardList":return Object.assign(Object.assign({},e.messages),{cardList:void 0});case"subview":return Object.assign(Object.assign({},e.messages),{subview:void 0});default:return{lastMessageId:Ht(e.messages.lastMessageId),cardList:void 0,subview:void 0}}},Vt=()=>({updateAppOpen(e,t){const n="launcher"===e.application.embedMode&&!0===e.application.open&&!1===t;return Object.assign(Object.assign({},e),{application:Object.assign(Object.assign({},e.application),{open:t}),messages:n?Nt(e):e.messages})},startCardFileUpload:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"uploading-files"})}),finishCardFileUpload:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:null})}),submittingCard:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"submitting"})}),submittedCard(e,t,n){const r=$t("submittedCard",e),i=Ht(e.messages.lastMessageId);return Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:n?"submitted-subview":"submitted"}),messages:Object.assign(Object.assign({},e.messages),{cardList:{text:null!=r?r:"Card submitted",messageId:i,cardInstanceId:t,action:"submitted"},lastMessageId:i})})},failedToSubmitCard(e,t,n,r,i,a){const o=Et(e.cardStates,["centering","fixed-position"]),s=Ht(e.messages.lastMessageId),l=e.application.enabledUiElements.toastConfig,d=Object.assign({text:Rt("Couldn't submit",l,i),messageId:s,cardInstanceId:t,action:"submit-failed",responseValues:r},a||{});return Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},o),{[t]:null}),messages:Object.assign(Object.assign({},n?{subview:d}:{cardList:d}),{lastMessageId:s})})},dismissingCard:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"dismissing"})}),dismissedCard(e,t){const n=$t("dismissedCard",e),r=Ht(e.messages.lastMessageId);return Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"dismissed"}),messages:Object.assign(Object.assign({},e.messages),{cardList:{text:null!=n?n:"Card dismissed",messageId:r,cardInstanceId:t,action:"dismissed"},lastMessageId:r})})},failedToDismissCard(e,t,n,r){const i=Et(e.cardStates,["centering","fixed-position"]),a=Ht(e.messages.lastMessageId),o=e.application.enabledUiElements.toastConfig;return Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},i),{[t]:null}),messages:Object.assign(Object.assign({},e.messages),{cardList:{text:Rt("Couldn't dismiss",o,r),messageId:a,cardInstanceId:t,action:"dismiss-failed",source:n},lastMessageId:a})})},snoozingCard:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"snoozing"})}),snoozedCard(e,t,n){const r=$t("snoozedCard",e),i=Ht(e.messages.lastMessageId);let o;return o=(0,a.isToday)(n)?(0,a.format)(n,"h:mm A"):(0,a.format)(n,"D MMM YYYY, h:mm A"),Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"snoozed"}),messages:Object.assign(Object.assign({},e.messages),{cardList:{text:null!=r?r:`Snoozed until ${o}`,messageId:i,cardInstanceId:t,action:"snoozed"},lastMessageId:i})})},failedToSnoozeCard(e,t,n,r,i){const a=Et(e.cardStates,["centering","fixed-position"]),o=Ht(e.messages.lastMessageId),s=e.application.enabledUiElements.toastConfig;return Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},a),{[t]:null}),messages:Object.assign(Object.assign({},e.messages),{cardList:{text:Rt("Couldn't snooze",s,i),messageId:o,cardInstanceId:t,action:"snooze-failed",snoozeDate:n,source:r},lastMessageId:o})})},fixPositionRemainingCard:(e,t)=>Object.assign(Object.assign({},e),{cardStates:e.cardFeed.cardInstances.length<=2?Lt(e,t,"fixed-position"):Et(e.cardStates,["centering","fixed-position"])}),centerRemainingCard(e,t){const n=e.cardFeed.cardInstances,r=n.filter((e=>e.instance.id!==t));return Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{cardInstances:e.cardFeed.cardInstances.length<=2?r:n,status:{loaded:!0},updateId:(new Date).getTime()}),cardStates:e.cardFeed.cardInstances.length<=2?Lt(e,t,"centering"):Et(e.cardStates,["centering","fixed-position"])})},removeCardState:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:null})}),removeCard(e,t){if(e.application.isPreview)return e;const n=e.cardFeed.cardInstances.filter((e=>e.instance.id!==t)),r=Object.assign({},e.cardStates);return delete r[t],Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{cardInstances:n,status:{loaded:!0},updateId:(new Date).getTime()}),cardStates:r})},queueCardFeedDeltaUpdate:(e,t)=>Object.assign(Object.assign({},e),{pendingCardFeedUpdates:[...e.pendingCardFeedUpdates||[],...t]}),clearCardFeedDeltaUpdateQueue:e=>Object.assign(Object.assign({},e),{pendingCardFeedUpdates:[]}),applyCardFeedDeltaUpdate(e,t,n,r){return Dt(this,void 0,void 0,(function*(){let i={cardFeed:{cardInstances:e.cardFeed.cardInstances,runtimeVariables:e.cardFeed.runtimeVariables},cardStates:e.cardStates,navigationStack:e.navigationStack},a=!1,o=[];if(t.forEach((t=>{switch(t.type){case"remove-card":{const{cardInstanceId:n,actionType:r}=t.data;if("limit"!==r&&(a=!0),e.application.isPreview)break;const o=i.cardFeed.cardInstances,s=e.application.isPreview?o:o.filter((e=>e.instance.id!==n));i.cardFeed.cardInstances=s;break}case"update-card":{const{cardInstance:e,actionType:n}=t.data;let r=!1;e.runtimeVariables&&o.push(e);const s=i.cardFeed.cardInstances.map((t=>(t.instance.id===e.instance.id&&(r=!0,t=Object.assign({},e)),t)));r||(a=!0,s.push(e)),"unsnooze"===n&&(i.cardStates[e.instance.id]=null),i.cardFeed.cardInstances=s;break}}})),o.length>0){const t=yield r(o),n=e.cardFeed.runtimeVariables.values;i.cardFeed.runtimeVariables={values:new Map([...n||new Map,...(null==t?void 0:t.values)||new Map]),updateId:(new Date).getTime()}}i.cardFeed.cardInstances=(e=>null==e?void 0:e.sort(((e,t)=>{const{priority:n,lastCardActiveTime:r,receivedAt:i}=e.metadata,{priority:a,lastCardActiveTime:o,receivedAt:s}=t.metadata;let l=0;return l=n-a,0===l&&(l=new Date(o).getTime()-new Date(r).getTime()),0===l&&(l=new Date(s).getTime()-new Date(i).getTime()),l})))(i.cardFeed.cardInstances),n(e.cardFeed.cardInstances.length!==i.cardFeed.cardInstances.length||a),"single-card"===e.application.embedMode&&(i.navigationStack={items:[]});const s=Et(i.cardStates,["centering","fixed-position"]),l=_t(s),d=Pt(e.cardFeed.cardInstances,i.cardFeed.cardInstances,l);return i.cardFeed.cardInstances=d,{cardFeed:Object.assign(Object.assign({},e.cardFeed),{cardInstances:i.cardFeed.cardInstances,runtimeVariables:i.cardFeed.runtimeVariables,tutorialSeen:e.cardFeed.tutorialSeen||d.length>0,updateId:(new Date).getTime(),status:{loaded:!0}}),cardStates:s,navigationStack:i.navigationStack}}))},clearMessage:(e,t)=>Object.assign(Object.assign({},e),{messages:Nt(e,t)}),cardFeedLoading:e=>Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{status:{loaded:!1}})}),cardFeedLoaded(e,t){if(t.error){let n;if(t.error.name===_c.noInternet)n="noInternet";else n="apiError";return l.error({level1:["Error loading card feed"],level2:[n],level3:[t.error]}),Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{status:{loaded:!1,errorState:n}})})}if(!t.cardInstances)return Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{status:Object.assign(Object.assign({},e.cardFeed.status),{loaded:!0})})});const n=Et(e.cardStates,["centering","fixed-position"]),r=_t(n),i=Pt(e.cardFeed.cardInstances,t.cardInstances,r);return Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{lastModified:t.lastModified,cardInstances:i,unfilteredCardInstanceCount:t.unfilteredCardInstanceCount||t.cardInstances.length,runtimeVariables:Object.assign(Object.assign({},t.runtimeVariables),{updateId:(new Date).getTime()}),tutorialSeen:e.cardFeed.tutorialSeen||t.cardInstances.length>0,status:{loaded:!0},updateId:(new Date).getTime(),metadata:t.metadata}),navigationStack:{items:"single-card"===e.application.embedMode?[]:e.navigationStack.items},cardStates:r})},setCardFeedOverlay:(e,t)=>Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{displayingOverlay:t})}),runtimeVariablesResolved:(e,t)=>t.values?Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{runtimeVariables:Object.assign(Object.assign({},e.cardFeed.runtimeVariables),{values:t.values,updateId:(new Date).getTime()})})}):e,runtimeVariableReplacement(e,t){var n,r;const i=null!==(n=null==t?void 0:t.values)&&void 0!==n?n:null===(r=e.cardFeed.runtimeVariables)||void 0===r?void 0:r.values;return e.cardFeed.cardInstances.map((e=>pc(e,(null==i?void 0:i.get(e.instance.id))||new Map([])))),Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{runtimeVariables:null!=t?t:e.cardFeed.runtimeVariables})})},themeLoading:e=>Object.assign(Object.assign({},e),{theme:Object.assign(Object.assign({},e.theme),{status:{loaded:!1}})}),themeLoaded(e,t){if(t.error){let n;if(t.error.name===_c.noInternet)n="noInternet";else n="apiError";return Object.assign(Object.assign({},e),{theme:Object.assign(Object.assign({},e.theme),{status:{loaded:!1,errorState:n}})})}return t.theme?Object.assign(Object.assign({},e),{theme:{themePayload:t.theme,status:{loaded:!0}}}):e},feedbackReceived(e,t){if(e.application.isPreview)return e;const n=$t("feedbackReceived",e),r=Ht(e.messages.lastMessageId);return Object.assign(Object.assign({},e),{messages:Object.assign(Object.assign({},e.messages),{cardList:{text:null!=n?n:"Feedback received",messageId:r,cardInstanceId:t,action:"other"},lastMessageId:r})})},userLoggedOut:e=>Object.assign(Object.assign({},e),{application:Object.assign(Object.assign({},e.application),{open:!1}),cardFeed:Object.assign(Object.assign({},e.cardFeed),{lastModified:"",cardInstances:[],runtimeVariables:{},status:{loaded:!0}}),navigationStack:{items:[]},cardResponses:{},validationStates:{},cardStates:{},messages:{lastMessageId:"0"}})});let Wt;const zt=()=>(Wt||(Wt=(0,e.kv)((0,e.Y2)(Vt),m())),Wt);var Bt=0,Ut=document.head.appendChild(document.createElement("style")).sheet;function qt(e,t){var n="p"+Bt++,r=t+n;return e.forEach((function(e){if(/^@/.test(e)){var t=e.indexOf("{")+1;e=e.slice(0,t)+r+e.slice(t)}else e=r+e;try{Ut.insertRule(e,Ut.cssRules.length)}catch(e){}})),n}function Yt(e,t){return t+"{"+e+"}"}function Kt(e,t){var n=[""];for(var r in t=t||0,e){var i=e[r];i&&(r=r.replace(/[A-Z]/g,"-$&").toLowerCase(),i.sub||Array.isArray(i)?(i=Array.isArray(i)?i:[i]).forEach((function(e){return n[0]+=r+":"+e+";"})):(r=r.replace(/&/g,""),n.push(Yt(Kt(i,!/^@/.test(r)).join(""),r))))}return t||(n[0]=Yt(n[0],"")),n}const Zt=function(e,t){var n={};return(t=t||{}).returnObject?{style:r,css:i}:r;function r(t){return function(n){return function(r,a){var o="function"==typeof n?n(r):n;return delete r.theme,r.class=[i(o),r.class].filter(Boolean).join(" "),e(t,r,r.children||[])}}}function i(e){var t=Kt(e),r=t.join("");return n[r]||(n[r]=qt(t,"."))}}(ee.h),Qt=function(e){return qt([Yt(Kt(e,1).join(""),"")],"@keyframes ")};function Gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xt="rgba(0, 0, 0, 1)",Jt="rgba(255, 255, 255, 1)",en='-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',tn={colors:{},typography:{},shape:{}};class nn{constructor(e,t,n,r){Gt(this,"theme",void 0),Gt(this,"themeName",void 0),Gt(this,"fontFamilies",void 0),Gt(this,"hasSecondaryButtonStyle",!1),Gt(this,"testSecondaryStyles",((e,t,n)=>{const r=e=>{null===e||"object"!=typeof e||Array.isArray(e)?"string"==typeof e&&e.match(/\w+/g)&&(this.hasSecondaryButtonStyle=!0):Object.values(e).length>0&&(this.hasSecondaryButtonStyle=!0)};for(const[l,d]of Object.entries(e)){switch(l){case"actionSecondary":case"buttonSecondary":case"buttonHoverSecondary":case"buttonActiveSecondary":case"actionIconSecondary":case"buttonIconSecondary":case"actionSecondaryTop":case"actionSecondaryRight":case"actionSecondaryBottom":case"actionSecondaryLeft":case"buttonSecondaryTop":case"buttonSecondaryRight":case"buttonSecondaryBottom":case"buttonSecondaryLeft":case"buttonHoverSecondaryTop":case"buttonHoverSecondaryRight":case"buttonHoverSecondaryBottom":case"buttonHoverSecondaryLeft":case"buttonActiveSecondaryTop":case"buttonActiveSecondaryRight":case"buttonActiveSecondaryBottom":case"buttonActiveSecondaryLeft":case"actionSecondaryShadow":case"buttonSecondaryShadow":case"buttonHoverSecondaryShadow":case"buttonActiveSecondaryShadow":case"actionSecondaryXAxis":case"actionSecondaryYAxis":case"buttonSecondaryXAxis":case"buttonHoverSecondaryXAxis":case"buttonActiveSecondaryXAxis":case"buttonSecondaryYAxis":case"buttonHoverSecondaryYAxis":case"buttonActiveSecondaryYAxis":if(t.includes("shadowOffsets")&&!l.includes("XAxis")&&!l.includes("YAxis")){var i,a;const e="true"===(null==n||null===(i=n.shape)||void 0===i||null===(a=i.equalShadowOffsets)||void 0===a?void 0:a[l]);"string"==typeof d&&d.match(/\w+/g)&&e&&(this.hasSecondaryButtonStyle=!0);break}if(t.includes("equalShadowOffsets")||t.includes("equalPaddings"))break;r(d);break;case"actionSecondaryWidth":case"buttonSecondaryWidth":case"buttonHoverSecondaryWidth":case"buttonActiveSecondaryWidth":{var o,s;const e=l.replace("Width",""),t="true"===(null==n||null===(o=n.shape)||void 0===o||null===(s=o.equalPaddings)||void 0===s?void 0:s[e]);"string"==typeof d&&d.match(/\w+/g)&&t&&(this.hasSecondaryButtonStyle=!0);break}}if(!this.hasSecondaryButtonStyle&&null!==d&&"object"==typeof d&&!Array.isArray(d)){const e=t?t+"."+l:l;this.testSecondaryStyles(d,e,n)}}}));let i,a=!1;switch(r){case"automatic":a="dark"===n&&window.matchMedia("not all and (prefers-color-scheme), (prefers-color-scheme)").matches;break;case"light":a=!1;break;case"dark":a=!0}var o;a?i=(null===(o=e.alternate)||void 0===o?void 0:o.dark)||e.theme||{}:i=e.theme||{};this.testSecondaryStyles(i.feed||{},"",i.feed),this.testSecondaryStyles(i.workflow||{},"",i.workflow),this.themeName=t,this.theme=i[t]||tn,this.fontFamilies=i.fontFamilies||[]}getShape(e,t){return an(this.theme.shape,e,(null==t?void 0:t.skipFallback)?null:"")}getCSSShadowProperties(e,t){var n,r;const i=this.getShape(`blur.${e}Shadow`,t),a=this.getShape(`equalShadowOffsets.${e}`,t),o=this.getShape(`shadowOffsets.${e}`,t),s=this.getShape(`shadowOffsets.${e}XAxis`,t),l=this.getShape(`shadowOffsets.${e}YAxis`,t),d=this.getShape(`shadowOffsetType.${e}`,t),c=this.getCSSColor(`shadow.${e}`,{skipFallback:!0}),u="inset"===d?"inset":"",h=null!==(n="true"===a?o:s)&&void 0!==n?n:"0px",p=null!==(r="true"===a?o:l)&&void 0!==r?r:"0px";if(!c||c.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/))return"";return`${u} ${h} ${p} ${i||""} ${c}`.trim()}getNumericalPadding(e){var t,n,r,i;const a=null!==(t=null===(r=this.theme.shape)||void 0===r?void 0:r.padding)&&void 0!==t?t:{},o=null!==(n=null===(i=this.theme.shape)||void 0===i?void 0:i.equalPaddings)&&void 0!==n?n:{},s=an(o,`${e}`,null),l=an(a,`${e}Width`,null),d=an(a,`${e}Top`,null),c=an(a,`${e}Right`,null),u=an(a,`${e}Bottom`,null),h=an(a,`${e}Left`,null),p=on(l);if(!0===s||"true"===s)return{top:p,right:p,bottom:p,left:p};const m=on(d),g=on(c),v=on(u),f=on(h);return void 0!==m||void 0!==g||void 0!==v||void 0!==f?{top:null!=m?m:0,right:null!=g?g:0,bottom:null!=v?v:0,left:null!=f?f:0}:{top:m,right:g,bottom:v,left:f}}getPadding(e){const{top:t,right:n,bottom:r,left:i}=this.getNumericalPadding(e);return void 0!==t||void 0!==n||void 0!==r||void 0!==i?`${t||0}px ${n||0}px ${r||0}px ${i||0}px`:""}getHorizontalRule(e){const t={enabled:!1,insetLeft:void 0,insetRight:void 0,width:void 0,color:void 0};if(!this.theme.horizontalRule)return t;t.enabled=an(this.theme.horizontalRule,`${e}.enabled`,!1),t.insetLeft=an(this.theme.horizontalRule,`${e}.insetLeft`,"0px"),t.insetRight=an(this.theme.horizontalRule,`${e}.insetRight`,"0px"),t.width=an(this.theme.horizontalRule,`${e}.width`,"0px");const n={color:an(this.theme.horizontalRule,`${e}.color`,null),opacity:an(this.theme.horizontalRule,`${e}.opacity`,null)};return t.color=n&&(null==n?void 0:n.color)?rn(n.color,n.opacity):rn("#000000",0),t}getCSSColor(e,t){const n=an(this.theme.colors,e,null);if(n&&(null==n?void 0:n.color)&&!(null==t?void 0:t.skipPrimaryStyle))return rn(n.color,n.opacity);if(null==t?void 0:t.skipFallback)return null;const r=an(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"feed";return{icon:{switchOff:Jt,switchOn:Jt,selectionIndicator:Xt,selectionIndicatorActive:Xt},background:Object.assign(Object.assign({switchOff:"rgba(128, 128, 128, 1)",switchOn:Xt,modalContainer:"rgba(0, 0, 0, 0.5)",dropdownMenu:Jt,dropdownMenuSelectedIcon:Xt},"feed"===e?{card:Jt}:{}),"workflow"===e?{default:Xt}:{}),text:{dropdownMenuItem:Xt}}}(this.themeName),e,null);return r||("workflow"===this.themeName?e.startsWith("background")?Xt:Jt:e.startsWith("background")?"rgba(0, 0, 0, 0)":Xt)}getFontFamilies(){return this.fontFamilies}getTypographyStyle(e){var t;let n=an(this.theme.typography,e,null),r={size:"17px",isDefaultTypography:!0};return null===(t=n)||void 0===t||t.align,n||r}getNumericFontSize(e,t){var n;const r=this.getTypographyStyle(e);return(null==t?void 0:t.skipFallback)&&r.isDefaultTypography?null:r&&r.size?(null===(n=r.scaling)||void 0===n?void 0:n.enabled)?this.getNumericScaledFontSize(r):Number(r.size.replace(/px/g,"")):null}getNumericScaledFontSize(e){const t=Number(window.getComputedStyle(document.documentElement).getPropertyValue("font-size").replace("px","")),n=t?t/16:1,r=e.size?Number(e.size.replace(/px/g,"")):17,i=r*n;if(e.scaling){const t=e.scaling.minimumSize?Number(e.scaling.minimumSize.replace(/px/g,"")):void 0,n=e.scaling.maximumSize?Number(e.scaling.maximumSize.replace(/px/g,"")):void 0;if(void 0===t&&void 0===n)return r;if(t&&i<t)return t;if(n&&i>n)return n}return i}getCSSFontProperties(e,t){var n,r;const i=this.getTypographyStyle(e);if(!i)return{};if((null==t?void 0:t.skipFallback)&&i.isDefaultTypography)return null;const a=i.transform?i.transform:(null==t?void 0:t.skipFontFallbacks)?null:"none",o=i.lineHeight||1,s=(null!==(n=this.getNumericFontSize(e,t))&&void 0!==n?n:17)*o+"px",l=(null===(r=i.scaling)||void 0===r?void 0:r.enabled)?`${this.getNumericScaledFontSize(i)}px`:i.size,d=i.fontFamily?`"${i.fontFamily}", ${en}`:en,c=i.weight||((null==t?void 0:t.skipFontFallbacks)?null:"normal"),u=i.style||((null==t?void 0:t.skipFontFallbacks)?null:"normal"),h=i.align;return Object.assign({textTransform:a,lineHeight:s,fontSize:l,fontFamily:d,fontWeight:c,fontStyle:u,fontSynthesis:"weight style"},h?{textAlign:h}:{})}getElementFocusCSSProperties(){return{outline:"none","&.focus-visible":{boxShadow:`0 0 0 2px ${this.getCSSColor("border.focus")} inset`}}}}const rn=(e,t)=>{const n=e.replace("#",""),r=parseInt(n,16);return`rgba(${[r>>16&255,r>>8&255,255&r].join(",")},${t})`},an=(e,t,n)=>(e=e[(t=Array.isArray(t)?t:t.split("."))[0]])&&t.length>1?an(e,t.slice(1),n):void 0!==e?e:n,on=e=>{if(null==e)return;if("number"==typeof e)return e;const t=parseFloat(e.replace(/px/g,""));return isNaN(t)?void 0:t},sn=(e,t)=>n=>{let{themeMethod:r,primaryAccessor:i,secondaryAccessor:a,fallbackStyle:o,skipThemeHelperFallbacks:s,skipDefaultStyle:l}=n;const d=i?e[r](i,{skipFallback:s}):void 0,c=a?e[r](a,{skipFallback:!0}):void 0;let u="getCSSColor"===r?e.getCSSColor(i||a||"",{skipPrimaryStyle:!0}):e[r]("");return l&&(u=""),"secondary"===t&&c?c:d&&("primary"===t||"secondary"===t&&!e.hasSecondaryButtonStyle)?d:o||u||""},ln=e=>"string"!=typeof e?(l.warn({level3:["Expected a string value for RGBA color, but received:",e]}),!1):null!==e.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/),dn=Qt({from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}),cn=Zt("svg")((()=>({animation:`${dn} 1s infinite linear`}))),un=e=>{let{stopColor:t,size:n}=e;return(0,ee.h)(cn,{width:n,height:n,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,ee.h)("path",{d:"M31 16C31 7.71573 24.2843 1 16 1C7.71573 1 1 7.71573 1 16C1 24.2843 7.71573 31 16 31",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))},hn=()=>(0,ee.h)("style",null,"/*!\n * @license\n * Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com\n * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)\n */\n \n @font-face {\n font-family: 'Font Awesome 5 Free';\n font-style: normal;\n font-weight: 900;\n font-display: block;\n src: url('https://downloads.atomic.io/web-sdk/release/25.4.2/assets/fonts/font-awesome-5-15-4/fa-solid-900.woff');\n }\n "),pn={"500px":"","accessible-icon":"",accusoft:"","acquisitions-incorporated":"",ad:"","address-book":"","address-card":"",adjust:"",adn:"",adversal:"",affiliatetheme:"","air-freshener":"",airbnb:"",algolia:"","align-center":"","align-justify":"","align-left":"","align-right":"",alipay:"",allergies:"",amazon:"","amazon-pay":"",ambulance:"","american-sign-language-interpreting":"",amilia:"",anchor:"",android:"",angellist:"","angle-double-down":"","angle-double-left":"","angle-double-right":"","angle-double-up":"","angle-down":"","angle-left":"","angle-right":"","angle-up":"",angry:"",angrycreative:"",angular:"",ankh:"","app-store":"","app-store-ios":"",apper:"",apple:"","apple-alt":"","apple-pay":"",archive:"",archway:"","arrow-alt-circle-down":"","arrow-alt-circle-left":"","arrow-alt-circle-right":"","arrow-alt-circle-up":"","arrow-circle-down":"","arrow-circle-left":"","arrow-circle-right":"","arrow-circle-up":"","arrow-down":"","arrow-left":"","arrow-right":"","arrow-up":"","arrows-alt":"","arrows-alt-h":"","arrows-alt-v":"",artstation:"","assistive-listening-systems":"",asterisk:"",asymmetrik:"",at:"",atlas:"",atlassian:"",atom:"",audible:"","audio-description":"",autoprefixer:"",avianex:"",aviato:"",award:"",aws:"",baby:"","baby-carriage":"",backspace:"",backward:"",bacon:"",bacteria:"",bacterium:"",bahai:"","balance-scale":"","balance-scale-left":"","balance-scale-right":"",ban:"","band-aid":"",bandcamp:"",barcode:"",bars:"","baseball-ball":"","basketball-ball":"",bath:"","battery-empty":"","battery-full":"","battery-half":"","battery-quarter":"","battery-three-quarters":"","battle-net":"",bed:"",beer:"",behance:"","behance-square":"",bell:"","bell-slash":"","bezier-curve":"",bible:"",bicycle:"",biking:"",bimobject:"",binoculars:"",biohazard:"","birthday-cake":"",bitbucket:"",bitcoin:"",bity:"","black-tie":"",blackberry:"",blender:"","blender-phone":"",blind:"",blog:"",blogger:"","blogger-b":"",bluetooth:"","bluetooth-b":"",bold:"",bolt:"",bomb:"",bone:"",bong:"",book:"","book-dead":"","book-medical":"","book-open":"","book-reader":"",bookmark:"",bootstrap:"","border-all":"","border-none":"","border-style":"","bowling-ball":"",box:"","box-open":"","box-tissue":"",boxes:"",braille:"",brain:"","bread-slice":"",briefcase:"","briefcase-medical":"","broadcast-tower":"",broom:"",brush:"",btc:"",buffer:"",bug:"",building:"",bullhorn:"",bullseye:"",burn:"",buromobelexperte:"",bus:"","bus-alt":"","business-time":"","buy-n-large":"",buysellads:"",calculator:"",calendar:"","calendar-alt":"","calendar-check":"","calendar-day":"","calendar-minus":"","calendar-plus":"","calendar-times":"","calendar-week":"",camera:"","camera-retro":"",campground:"","canadian-maple-leaf":"","candy-cane":"",cannabis:"",capsules:"",car:"","car-alt":"","car-battery":"","car-crash":"","car-side":"",caravan:"","caret-down":"","caret-left":"","caret-right":"","caret-square-down":"","caret-square-left":"","caret-square-right":"","caret-square-up":"","caret-up":"",carrot:"","cart-arrow-down":"","cart-plus":"","cash-register":"",cat:"","cc-amazon-pay":"","cc-amex":"","cc-apple-pay":"","cc-diners-club":"","cc-discover":"","cc-jcb":"","cc-mastercard":"","cc-paypal":"","cc-stripe":"","cc-visa":"",centercode:"",centos:"",certificate:"",chair:"",chalkboard:"","chalkboard-teacher":"","charging-station":"","chart-area":"","chart-bar":"","chart-line":"","chart-pie":"",check:"","check-circle":"","check-double":"","check-square":"",cheese:"",chess:"","chess-bishop":"","chess-board":"","chess-king":"","chess-knight":"","chess-pawn":"","chess-queen":"","chess-rook":"","chevron-circle-down":"","chevron-circle-left":"","chevron-circle-right":"","chevron-circle-up":"","chevron-down":"","chevron-left":"","chevron-right":"","chevron-up":"",child:"",chrome:"",chromecast:"",church:"",circle:"","circle-notch":"",city:"","clinic-medical":"",clipboard:"","clipboard-check":"","clipboard-list":"",clock:"",clone:"","closed-captioning":"",cloud:"","cloud-download-alt":"","cloud-meatball":"","cloud-moon":"","cloud-moon-rain":"","cloud-rain":"","cloud-showers-heavy":"","cloud-sun":"","cloud-sun-rain":"","cloud-upload-alt":"",cloudflare:"",cloudscale:"",cloudsmith:"",cloudversify:"",cocktail:"",code:"","code-branch":"",codepen:"",codiepie:"",coffee:"",cog:"",cogs:"",coins:"",columns:"",comment:"","comment-alt":"","comment-dollar":"","comment-dots":"","comment-medical":"","comment-slash":"",comments:"","comments-dollar":"","compact-disc":"",compass:"",compress:"","compress-alt":"","compress-arrows-alt":"","concierge-bell":"",confluence:"",connectdevelop:"",contao:"",cookie:"","cookie-bite":"",copy:"",copyright:"","cotton-bureau":"",couch:"",cpanel:"","creative-commons":"","creative-commons-by":"","creative-commons-nc":"","creative-commons-nc-eu":"","creative-commons-nc-jp":"","creative-commons-nd":"","creative-commons-pd":"","creative-commons-pd-alt":"","creative-commons-remix":"","creative-commons-sa":"","creative-commons-sampling":"","creative-commons-sampling-plus":"","creative-commons-share":"","creative-commons-zero":"","credit-card":"","critical-role":"",crop:"","crop-alt":"",cross:"",crosshairs:"",crow:"",crown:"",crutch:"",css3:"","css3-alt":"",cube:"",cubes:"",cut:"",cuttlefish:"","d-and-d":"","d-and-d-beyond":"",dailymotion:"",dashcube:"",database:"",deaf:"",deezer:"",delicious:"",democrat:"",deploydog:"",deskpro:"",desktop:"",dev:"",deviantart:"",dharmachakra:"",dhl:"",diagnoses:"",diaspora:"",dice:"","dice-d20":"","dice-d6":"","dice-five":"","dice-four":"","dice-one":"","dice-six":"","dice-three":"","dice-two":"",digg:"","digital-ocean":"","digital-tachograph":"",directions:"",discord:"",discourse:"",disease:"",divide:"",dizzy:"",dna:"",dochub:"",docker:"",dog:"","dollar-sign":"",dolly:"","dolly-flatbed":"",donate:"","door-closed":"","door-open":"","dot-circle":"",dove:"",download:"",draft2digital:"","drafting-compass":"",dragon:"","draw-polygon":"",dribbble:"","dribbble-square":"",dropbox:"",drum:"","drum-steelpan":"","drumstick-bite":"",drupal:"",dumbbell:"",dumpster:"","dumpster-fire":"",dungeon:"",dyalog:"",earlybirds:"",ebay:"",edge:"","edge-legacy":"",edit:"",egg:"",eject:"",elementor:"","ellipsis-h":"","ellipsis-v":"",ello:"",ember:"",empire:"",envelope:"","envelope-open":"","envelope-open-text":"","envelope-square":"",envira:"",equals:"",eraser:"",erlang:"",ethereum:"",ethernet:"",etsy:"","euro-sign":"",evernote:"","exchange-alt":"",exclamation:"","exclamation-circle":"","exclamation-triangle":"",expand:"","expand-alt":"","expand-arrows-alt":"",expeditedssl:"","external-link-alt":"","external-link-square-alt":"",eye:"","eye-dropper":"","eye-slash":"",facebook:"","facebook-f":"","facebook-messenger":"","facebook-square":"",fan:"","fantasy-flight-games":"","fast-backward":"","fast-forward":"",faucet:"",fax:"",feather:"","feather-alt":"",fedex:"",fedora:"",female:"","fighter-jet":"",figma:"",file:"","file-alt":"","file-archive":"","file-audio":"","file-code":"","file-contract":"","file-csv":"","file-download":"","file-excel":"","file-export":"","file-image":"","file-import":"","file-invoice":"","file-invoice-dollar":"","file-medical":"","file-medical-alt":"","file-pdf":"","file-powerpoint":"","file-prescription":"","file-signature":"","file-upload":"","file-video":"","file-word":"",fill:"","fill-drip":"",film:"",filter:"",fingerprint:"",fire:"","fire-alt":"","fire-extinguisher":"",firefox:"","firefox-browser":"","first-aid":"","first-order":"","first-order-alt":"",firstdraft:"",fish:"","fist-raised":"",flag:"","flag-checkered":"","flag-usa":"",flask:"",flickr:"",flipboard:"",flushed:"",fly:"",folder:"","folder-minus":"","folder-open":"","folder-plus":"",font:"","font-awesome":"","font-awesome-alt":"","font-awesome-flag":"","font-awesome-logo-full":"",fonticons:"","fonticons-fi":"","football-ball":"","fort-awesome":"","fort-awesome-alt":"",forumbee:"",forward:"",foursquare:"","free-code-camp":"",freebsd:"",frog:"",frown:"","frown-open":"",fulcrum:"","funnel-dollar":"",futbol:"","galactic-republic":"","galactic-senate":"",gamepad:"","gas-pump":"",gavel:"",gem:"",genderless:"","get-pocket":"",gg:"","gg-circle":"",ghost:"",gift:"",gifts:"",git:"","git-alt":"","git-square":"",github:"","github-alt":"","github-square":"",gitkraken:"",gitlab:"",gitter:"","glass-cheers":"","glass-martini":"","glass-martini-alt":"","glass-whiskey":"",glasses:"",glide:"","glide-g":"",globe:"","globe-africa":"","globe-americas":"","globe-asia":"","globe-europe":"",gofore:"","golf-ball":"",goodreads:"","goodreads-g":"",google:"","google-drive":"","google-pay":"","google-play":"","google-plus":"","google-plus-g":"","google-plus-square":"","google-wallet":"",gopuram:"","graduation-cap":"",gratipay:"",grav:"","greater-than":"","greater-than-equal":"",grimace:"",grin:"","grin-alt":"","grin-beam":"","grin-beam-sweat":"","grin-hearts":"","grin-squint":"","grin-squint-tears":"","grin-stars":"","grin-tears":"","grin-tongue":"","grin-tongue-squint":"","grin-tongue-wink":"","grin-wink":"","grip-horizontal":"","grip-lines":"","grip-lines-vertical":"","grip-vertical":"",gripfire:"",grunt:"",guilded:"",guitar:"",gulp:"","h-square":"","hacker-news":"","hacker-news-square":"",hackerrank:"",hamburger:"",hammer:"",hamsa:"","hand-holding":"","hand-holding-heart":"","hand-holding-medical":"","hand-holding-usd":"","hand-holding-water":"","hand-lizard":"","hand-middle-finger":"","hand-paper":"","hand-peace":"","hand-point-down":"","hand-point-left":"","hand-point-right":"","hand-point-up":"","hand-pointer":"","hand-rock":"","hand-scissors":"","hand-sparkles":"","hand-spock":"",hands:"","hands-helping":"","hands-wash":"",handshake:"","handshake-alt-slash":"","handshake-slash":"",hanukiah:"","hard-hat":"",hashtag:"","hat-cowboy":"","hat-cowboy-side":"","hat-wizard":"",hdd:"","head-side-cough":"","head-side-cough-slash":"","head-side-mask":"","head-side-virus":"",heading:"",headphones:"","headphones-alt":"",headset:"",heart:"","heart-broken":"",heartbeat:"",helicopter:"",highlighter:"",hiking:"",hippo:"",hips:"","hire-a-helper":"",history:"",hive:"","hockey-puck":"","holly-berry":"",home:"",hooli:"",hornbill:"",horse:"","horse-head":"",hospital:"","hospital-alt":"","hospital-symbol":"","hospital-user":"","hot-tub":"",hotdog:"",hotel:"",hotjar:"",hourglass:"","hourglass-end":"","hourglass-half":"","hourglass-start":"","house-damage":"","house-user":"",houzz:"",hryvnia:"",html5:"",hubspot:"","i-cursor":"","ice-cream":"",icicles:"",icons:"","id-badge":"","id-card":"","id-card-alt":"",ideal:"",igloo:"",image:"",images:"",imdb:"",inbox:"",indent:"",industry:"",infinity:"",info:"","info-circle":"",innosoft:"",instagram:"","instagram-square":"",instalod:"",intercom:"","internet-explorer":"",invision:"",ioxhost:"",italic:"","itch-io":"",itunes:"","itunes-note":"",java:"",jedi:"","jedi-order":"",jenkins:"",jira:"",joget:"",joint:"",joomla:"","journal-whills":"",js:"","js-square":"",jsfiddle:"",kaaba:"",kaggle:"",key:"",keybase:"",keyboard:"",keycdn:"",khanda:"",kickstarter:"","kickstarter-k":"",kiss:"","kiss-beam":"","kiss-wink-heart":"","kiwi-bird":"",korvue:"",landmark:"",language:"",laptop:"","laptop-code":"","laptop-house":"","laptop-medical":"",laravel:"",lastfm:"","lastfm-square":"",laugh:"","laugh-beam":"","laugh-squint":"","laugh-wink":"","layer-group":"",leaf:"",leanpub:"",lemon:"",less:"","less-than":"","less-than-equal":"","level-down-alt":"","level-up-alt":"","life-ring":"",lightbulb:"",line:"",link:"",linkedin:"","linkedin-in":"",linode:"",linux:"","lira-sign":"",list:"","list-alt":"","list-ol":"","list-ul":"","location-arrow":"",lock:"","lock-open":"","long-arrow-alt-down":"","long-arrow-alt-left":"","long-arrow-alt-right":"","long-arrow-alt-up":"","low-vision":"","luggage-cart":"",lungs:"","lungs-virus":"",lyft:"",magento:"",magic:"",magnet:"","mail-bulk":"",mailchimp:"",male:"",mandalorian:"",map:"","map-marked":"","map-marked-alt":"","map-marker":"","map-marker-alt":"","map-pin":"","map-signs":"",markdown:"",marker:"",mars:"","mars-double":"","mars-stroke":"","mars-stroke-h":"","mars-stroke-v":"",mask:"",mastodon:"",maxcdn:"",mdb:"",medal:"",medapps:"",medium:"","medium-m":"",medkit:"",medrt:"",meetup:"",megaport:"",meh:"","meh-blank":"","meh-rolling-eyes":"",memory:"",mendeley:"",menorah:"",mercury:"",meteor:"",microblog:"",microchip:"",microphone:"","microphone-alt":"","microphone-alt-slash":"","microphone-slash":"",microscope:"",microsoft:"",minus:"","minus-circle":"","minus-square":"",mitten:"",mix:"",mixcloud:"",mixer:"",mizuni:"",mobile:"","mobile-alt":"",modx:"",monero:"","money-bill":"","money-bill-alt":"","money-bill-wave":"","money-bill-wave-alt":"","money-check":"","money-check-alt":"",monument:"",moon:"","mortar-pestle":"",mosque:"",motorcycle:"",mountain:"",mouse:"","mouse-pointer":"","mug-hot":"",music:"",napster:"",neos:"","network-wired":"",neuter:"",newspaper:"",nimblr:"",node:"","node-js":"","not-equal":"","notes-medical":"",npm:"",ns8:"",nutritionix:"","object-group":"","object-ungroup":"","octopus-deploy":"",odnoklassniki:"","odnoklassniki-square":"","oil-can":"","old-republic":"",om:"",opencart:"",openid:"",opera:"","optin-monster":"",orcid:"",osi:"",otter:"",outdent:"",page4:"",pagelines:"",pager:"","paint-brush":"","paint-roller":"",palette:"",palfed:"",pallet:"","paper-plane":"",paperclip:"","parachute-box":"",paragraph:"",parking:"",passport:"",pastafarianism:"",paste:"",patreon:"",pause:"","pause-circle":"",paw:"",paypal:"",peace:"",pen:"","pen-alt":"","pen-fancy":"","pen-nib":"","pen-square":"","pencil-alt":"","pencil-ruler":"","penny-arcade":"","people-arrows":"","people-carry":"","pepper-hot":"",perbyte:"",percent:"",percentage:"",periscope:"","person-booth":"",phabricator:"","phoenix-framework":"","phoenix-squadron":"",phone:"","phone-alt":"","phone-slash":"","phone-square":"","phone-square-alt":"","phone-volume":"","photo-video":"",php:"","pied-piper":"","pied-piper-alt":"","pied-piper-hat":"","pied-piper-pp":"","pied-piper-square":"","piggy-bank":"",pills:"",pinterest:"","pinterest-p":"","pinterest-square":"","pizza-slice":"","place-of-worship":"",plane:"","plane-arrival":"","plane-departure":"","plane-slash":"",play:"","play-circle":"",playstation:"",plug:"",plus:"","plus-circle":"","plus-square":"",podcast:"",poll:"","poll-h":"",poo:"","poo-storm":"",poop:"",portrait:"","pound-sign":"","power-off":"",pray:"","praying-hands":"",prescription:"","prescription-bottle":"","prescription-bottle-alt":"",print:"",procedures:"","product-hunt":"","project-diagram":"","pump-medical":"","pump-soap":"",pushed:"","puzzle-piece":"",python:"",qq:"",qrcode:"",question:"","question-circle":"",quidditch:"",quinscape:"",quora:"","quote-left":"","quote-right":"",quran:"","r-project":"",radiation:"","radiation-alt":"",rainbow:"",random:"","raspberry-pi":"",ravelry:"",react:"",reacteurope:"",readme:"",rebel:"",receipt:"","record-vinyl":"",recycle:"","red-river":"",reddit:"","reddit-alien":"","reddit-square":"",redhat:"",redo:"","redo-alt":"",registered:"","remove-format":"",renren:"",reply:"","reply-all":"",replyd:"",republican:"",researchgate:"",resolving:"",restroom:"",retweet:"",rev:"",ribbon:"",ring:"",road:"",robot:"",rocket:"",rocketchat:"",rockrms:"",route:"",rss:"","rss-square":"","ruble-sign":"",ruler:"","ruler-combined":"","ruler-horizontal":"","ruler-vertical":"",running:"","rupee-sign":"",rust:"","sad-cry":"","sad-tear":"",safari:"",salesforce:"",sass:"",satellite:"","satellite-dish":"",save:"",schlix:"",school:"",screwdriver:"",scribd:"",scroll:"","sd-card":"",search:"","search-dollar":"","search-location":"","search-minus":"","search-plus":"",searchengin:"",seedling:"",sellcast:"",sellsy:"",server:"",servicestack:"",shapes:"",share:"","share-alt":"","share-alt-square":"","share-square":"","shekel-sign":"","shield-alt":"","shield-virus":"",ship:"","shipping-fast":"",shirtsinbulk:"","shoe-prints":"",shopify:"","shopping-bag":"","shopping-basket":"","shopping-cart":"",shopware:"",shower:"","shuttle-van":"",sign:"","sign-in-alt":"","sign-language":"","sign-out-alt":"",signal:"",signature:"","sim-card":"",simplybuilt:"",sink:"",sistrix:"",sitemap:"",sith:"",skating:"",sketch:"",skiing:"","skiing-nordic":"",skull:"","skull-crossbones":"",skyatlas:"",skype:"",slack:"","slack-hash":"",slash:"",sleigh:"","sliders-h":"",slideshare:"",smile:"","smile-beam":"","smile-wink":"",smog:"",smoking:"","smoking-ban":"",sms:"",snapchat:"","snapchat-ghost":"","snapchat-square":"",snowboarding:"",snowflake:"",snowman:"",snowplow:"",soap:"",socks:"","solar-panel":"",sort:"","sort-alpha-down":"","sort-alpha-down-alt":"","sort-alpha-up":"","sort-alpha-up-alt":"","sort-amount-down":"","sort-amount-down-alt":"","sort-amount-up":"","sort-amount-up-alt":"","sort-down":"","sort-numeric-down":"","sort-numeric-down-alt":"","sort-numeric-up":"","sort-numeric-up-alt":"","sort-up":"",soundcloud:"",sourcetree:"",spa:"","space-shuttle":"",speakap:"","speaker-deck":"","spell-check":"",spider:"",spinner:"",splotch:"",spotify:"","spray-can":"",square:"","square-full":"","square-root-alt":"",squarespace:"","stack-exchange":"","stack-overflow":"",stackpath:"",stamp:"",star:"","star-and-crescent":"","star-half":"","star-half-alt":"","star-of-david":"","star-of-life":"",staylinked:"",steam:"","steam-square":"","steam-symbol":"","step-backward":"","step-forward":"",stethoscope:"","sticker-mule":"","sticky-note":"",stop:"","stop-circle":"",stopwatch:"","stopwatch-20":"",store:"","store-alt":"","store-alt-slash":"","store-slash":"",strava:"",stream:"","street-view":"",strikethrough:"",stripe:"","stripe-s":"",stroopwafel:"",studiovinari:"",stumbleupon:"","stumbleupon-circle":"",subscript:"",subway:"",suitcase:"","suitcase-rolling":"",sun:"",superpowers:"",superscript:"",supple:"",surprise:"",suse:"",swatchbook:"",swift:"",swimmer:"","swimming-pool":"",symfony:"",synagogue:"",sync:"","sync-alt":"",syringe:"",table:"","table-tennis":"",tablet:"","tablet-alt":"",tablets:"","tachometer-alt":"",tag:"",tags:"",tape:"",tasks:"",taxi:"",teamspeak:"",teeth:"","teeth-open":"",telegram:"","telegram-plane":"","temperature-high":"","temperature-low":"","tencent-weibo":"",tenge:"",terminal:"","text-height":"","text-width":"",th:"","th-large":"","th-list":"","the-red-yeti":"","theater-masks":"",themeco:"",themeisle:"",thermometer:"","thermometer-empty":"","thermometer-full":"","thermometer-half":"","thermometer-quarter":"","thermometer-three-quarters":"","think-peaks":"","thumbs-down":"","thumbs-up":"",thumbtack:"","ticket-alt":"",tiktok:"",times:"","times-circle":"",tint:"","tint-slash":"",tired:"","toggle-off":"","toggle-on":"",toilet:"","toilet-paper":"","toilet-paper-slash":"",toolbox:"",tools:"",tooth:"",torah:"","torii-gate":"",tractor:"","trade-federation":"",trademark:"","traffic-light":"",trailer:"",train:"",tram:"",transgender:"","transgender-alt":"",trash:"","trash-alt":"","trash-restore":"","trash-restore-alt":"",tree:"",trello:"",trophy:"",truck:"","truck-loading":"","truck-monster":"","truck-moving":"","truck-pickup":"",tshirt:"",tty:"",tumblr:"","tumblr-square":"",tv:"",twitch:"",twitter:"","twitter-square":"",typo3:"",uber:"",ubuntu:"",uikit:"",umbraco:"",umbrella:"","umbrella-beach":"",uncharted:"",underline:"",undo:"","undo-alt":"",uniregistry:"",unity:"","universal-access":"",university:"",unlink:"",unlock:"","unlock-alt":"",unsplash:"",untappd:"",upload:"",ups:"",usb:"",user:"","user-alt":"","user-alt-slash":"","user-astronaut":"","user-check":"","user-circle":"","user-clock":"","user-cog":"","user-edit":"","user-friends":"","user-graduate":"","user-injured":"","user-lock":"","user-md":"","user-minus":"","user-ninja":"","user-nurse":"","user-plus":"","user-secret":"","user-shield":"","user-slash":"","user-tag":"","user-tie":"","user-times":"",users:"","users-cog":"","users-slash":"",usps:"",ussunnah:"","utensil-spoon":"",utensils:"",vaadin:"","vector-square":"",venus:"","venus-double":"","venus-mars":"",vest:"","vest-patches":"",viacoin:"",viadeo:"","viadeo-square":"",vial:"",vials:"",viber:"",video:"","video-slash":"",vihara:"",vimeo:"","vimeo-square":"","vimeo-v":"",vine:"",virus:"","virus-slash":"",viruses:"",vk:"",vnv:"",voicemail:"","volleyball-ball":"","volume-down":"","volume-mute":"","volume-off":"","volume-up":"","vote-yea":"","vr-cardboard":"",vuejs:"",walking:"",wallet:"",warehouse:"","watchman-monitoring":"",water:"","wave-square":"",waze:"",weebly:"",weibo:"",weight:"","weight-hanging":"",weixin:"",whatsapp:"","whatsapp-square":"",wheelchair:"",whmcs:"",wifi:"","wikipedia-w":"",wind:"","window-close":"","window-maximize":"","window-minimize":"","window-restore":"",windows:"","wine-bottle":"","wine-glass":"","wine-glass-alt":"",wix:"","wizards-of-the-coast":"",wodu:"","wolf-pack-battalion":"","won-sign":"",wordpress:"","wordpress-simple":"",wpbeginner:"",wpexplorer:"",wpforms:"",wpressr:"",wrench:"","x-ray":"",xbox:"",xing:"","xing-square":"","y-combinator":"",yahoo:"",yammer:"",yandex:"","yandex-international":"",yarn:"",yelp:"","yen-sign":"","yin-yang":"",yoast:"",youtube:"","youtube-square":"",zhihu:""},mn=e=>{let{fillColor:t,ariaHidden:n=!1}=e;return(0,ee.h)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":n},(0,ee.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 2H2V13.398L9.66274 8.25944C10.1695 7.91961 10.8316 7.92061 11.3374 8.26198L14 10.0593V2ZM14 14H2.89774L10.2197 9.08999C10.3886 8.97671 10.6093 8.97704 10.7779 9.09083L14 11.2657V14ZM2 1C1.44772 1 1 1.44772 1 2V14C1 14.5523 1.44772 15 2 15H14C14.5523 15 15 14.5523 15 14V2C15 1.44772 14.5523 1 14 1H2ZM6 4C4.89543 4 4 4.89543 4 6C4 7.10457 4.89543 8 6 8C7.10457 8 8 7.10457 8 6C8 4.89543 7.10457 4 6 4ZM5 6C5 5.44771 5.44771 5 6 5C6.55229 5 7 5.44771 7 6C7 6.55229 6.55229 7 6 7C5.44771 7 5 6.55229 5 6Z",fill:t}))},gn=Zt("i")((e=>{let{size:t,styles:n}=e;return Object.assign({fontFamily:"'Font Awesome 5 Free'",fontWeight:"900",fontSize:`${t}px`,width:`${t}px`,textAlign:"center",fontStyle:"normal",fontVariant:"normal",textRendering:"auto","-moz-osx-font-smoothing":"grayscale","-webkit-font-smoothing":"antialiased"},n)})),vn=Zt("div")((e=>{var t;let{color:n,size:r,styles:i}=e;return Object.assign(Object.assign(Object.assign({display:"flex",justifyContent:"center",alignItems:"center"},n?{fill:n}:{}),i),{width:`${r}px`,height:null!==(t=i.lineHeight)&&void 0!==t?t:`${r}px`})})),fn=e=>{let{iconName:t,iconUrl:n,size:r,color:i,fallbackColor:a,styles:o={}}=e;const[s,d]=le(!1),c=he(n);return ce((()=>{n&&n!==c.current&&s&&(c.current=n,d(!1))}),[n,s]),n&&!s?(0,ee.h)(vn,{size:r,styles:o},(0,ee.h)("svg",{"aria-hidden":"true","data-src":n,"data-replacement-color":i,"data-container-size":r,oniconloaderror:()=>{l.error({level1:[`Error loading custom icon: ${n}`]}),d(!0)},style:Object.assign({maxWidth:`${r}px`,maxHeight:`${r}px`},i?{color:i}:{})})):t?(i&&(o.color=i),(0,ee.h)(gn,{styles:o,size:r,"aria-hidden":"true"},pn[t]||"")):(0,ee.h)(vn,{size:r,styles:o},(0,ee.h)(mn,{ariaHidden:!0,fillColor:null!=i?i:a}))},bn=Zt("hr")((e=>{var t,n,r,i,a,o;let{theme:s,ruleStyles:l,isSubview:d,isBetweenButtons:c,translateY:u}=e,h="0px",p="0px",m=0,g=0;if(d){const e=s.getNumericalPadding("stream");m=null!==(t=null==e?void 0:e.left)&&void 0!==t?t:w,g=null!==(n=null==e?void 0:e.right)&&void 0!==n?n:w}else{const e=s.getNumericalPadding("card");m=null!==(r=null==e?void 0:e.left)&&void 0!==r?r:b,g=null!==(i=null==e?void 0:e.right)&&void 0!==i?i:b}if(c){const e=s.getNumericalPadding("buttonGroup");m=null!==(a=null==e?void 0:e.left)&&void 0!==a?a:m,g=null!==(o=null==e?void 0:e.right)&&void 0!==o?o:g}return h=(on(null==l?void 0:l.insetLeft)||0)-m+"px",p=(on(null==l?void 0:l.insetRight)||0)-g+"px",Object.assign({border:"none",borderBottom:`${(null==l?void 0:l.width)||"0px"} solid ${(null==l?void 0:l.color)||"rgba(0,0,0,0)"}`,margin:"0",width:`calc(100% + ${m-(on(null==l?void 0:l.insetLeft)||0)}px + ${g-(on(null==l?void 0:l.insetRight)||0)}px)`,marginLeft:h,marginRight:p},u?{transform:`translateY(${u})`}:{})})),yn=e=>{let{theme:t,ruleStyles:n,isSubview:r,isBetweenButtons:i,class:a,translateY:o}=e;return(0,ee.h)(bn,{"aria-hidden":"true",theme:t,ruleStyles:n,isSubview:r,isBetweenButtons:i,class:a,translateY:o})},wn=e=>{let{theme:t,appearance:n}=e;const r=sn(t,n),i=(e,t)=>t?{[e]:t}:{},a=t.getShape("buttonWidth.global"),o=r({themeMethod:"getCSSFontProperties",primaryAccessor:"button",secondaryAccessor:"buttonSecondary",fallbackStyle:{}});return Object.assign(Object.assign(Object.assign({position:"relative",cursor:"pointer",width:"hugsLabel"===a?"auto":"100%",maxWidth:"100%",padding:r({themeMethod:"getPadding",primaryAccessor:"button",secondaryAccessor:"buttonSecondary",fallbackStyle:"10px 20px"}),backgroundColor:r({themeMethod:"getCSSColor",primaryAccessor:"background.button",secondaryAccessor:"background.buttonSecondary"}),color:r({themeMethod:"getCSSColor",primaryAccessor:"text.button",secondaryAccessor:"text.buttonSecondary"}),textAlign:"center"},o),{borderStyle:"solid",borderColor:r({themeMethod:"getCSSColor",primaryAccessor:"border.button",secondaryAccessor:"border.buttonSecondary",fallbackStyle:"transparent",skipThemeHelperFallbacks:!0}),borderWidth:r({themeMethod:"getShape",primaryAccessor:"border.button",secondaryAccessor:"border.buttonSecondary",fallbackStyle:"0px"}),borderRadius:r({themeMethod:"getShape",primaryAccessor:"borderRadius.button",secondaryAccessor:"borderRadius.buttonSecondary",fallbackStyle:"0px"}),boxShadow:r({themeMethod:"getCSSShadowProperties",primaryAccessor:"button",secondaryAccessor:"buttonSecondary",skipThemeHelperFallbacks:!0,fallbackStyle:"none"}),display:"flex",alignItems:"center",whiteSpace:"pre-wrap",":hover":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i("color",r({themeMethod:"getCSSColor",primaryAccessor:"text.buttonHover",secondaryAccessor:"text.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("backgroundColor",r({themeMethod:"getCSSColor",primaryAccessor:"background.buttonHover",secondaryAccessor:"background.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("padding",r({themeMethod:"getPadding",primaryAccessor:"buttonHover",secondaryAccessor:"buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderColor",r({themeMethod:"getCSSColor",primaryAccessor:"border.buttonHover",secondaryAccessor:"border.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderWidth",r({themeMethod:"getShape",primaryAccessor:"border.buttonHover",secondaryAccessor:"border.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderRadius",r({themeMethod:"getShape",primaryAccessor:"borderRadius.buttonHover",secondaryAccessor:"borderRadius.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("boxShadow",r({themeMethod:"getCSSShadowProperties",primaryAccessor:"buttonHover",secondaryAccessor:"buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),":active":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i("color",r({themeMethod:"getCSSColor",primaryAccessor:"text.buttonActive",secondaryAccessor:"text.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),{backgroundColor:r({themeMethod:"getCSSColor",primaryAccessor:"background.buttonActive",secondaryAccessor:"background.buttonActiveSecondary",fallbackStyle:"rgba(0,0,0,0.1)",skipThemeHelperFallbacks:!0})}),i("borderColor",r({themeMethod:"getCSSColor",primaryAccessor:"border.buttonActive",secondaryAccessor:"border.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderWidth",r({themeMethod:"getShape",primaryAccessor:"border.buttonActive",secondaryAccessor:"border.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderRadius",r({themeMethod:"getShape",primaryAccessor:"borderRadius.buttonActive",secondaryAccessor:"borderRadius.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("padding",r({themeMethod:"getPadding",primaryAccessor:"buttonActive",secondaryAccessor:"buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("boxShadow",r({themeMethod:"getCSSShadowProperties",primaryAccessor:"buttonActive",secondaryAccessor:"buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})))}),t.getElementFocusCSSProperties())},Sn=Zt("button")((e=>Object.assign({},wn(e)))),Cn=Zt("a")((e=>Object.assign(Object.assign({},wn(e)),{textDecoration:"none"}))),kn=Zt("div")((e=>{var t,n;let r,i,{labelAlignment:a,iconAlignment:o,visible:s}=e;return"right"===o?(r="row-reverse",i=null!==(t=null==a?void 0:a.replace("left","flex-end").replace("right","flex-start"))&&void 0!==t?t:"center"):(r="row",i=null!==(n=null==a?void 0:a.replace("left","flex-start").replace("right","flex-end"))&&void 0!==n?n:"center"),{width:"100%",display:"flex",justifyContent:i,alignItems:"center",flexDirection:r,visibility:s?"visible":"hidden"}})),xn=Zt("div")({display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}),In=Zt("span")({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),On=e=>{let{nodeKey:t,localIndex:n,clickHandler:r,text:i,icon:a,iconUrl:o,theme:s,appearance:l,loading:d,type:c,urlLink:u}=e;const h=u?Cn:Sn,p=sn(s,l),m=p({themeMethod:"getCSSFontProperties",primaryAccessor:"button",secondaryAccessor:"buttonSecondary",fallbackStyle:{}}),g=p({themeMethod:"getShape",primaryAccessor:"align.buttonIcon",secondaryAccessor:"align.buttonIconSecondary",fallbackStyle:"left",skipThemeHelperFallbacks:!0}),v=p({themeMethod:"getShape",primaryAccessor:"lineHeight.buttonIcon",secondaryAccessor:"lineHeight.buttonIconSecondary",fallbackStyle:"1",skipThemeHelperFallbacks:!0}),f=p({themeMethod:"getNumericFontSize",primaryAccessor:"button",secondaryAccessor:"buttonSecondary"}),b=Object.assign(Object.assign({},"left"===g?{marginRight:"10px"}:{marginLeft:"10px"}),{lineHeight:f*v+"px",color:p({themeMethod:"getCSSColor",primaryAccessor:"icon.button",secondaryAccessor:"icon.buttonSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),y=p({themeMethod:"getCSSColor",primaryAccessor:"icon.button",secondaryAccessor:"icon.buttonSecondary"}),w=s.getHorizontalRule("buttonGroupBetween"),S=s.getShape("buttonLayout.global"),C=(null==w?void 0:w.enabled)&&"horizontal"!==S&&n&&n>0;return(0,ee.h)(ee.Fragment,null,C&&(0,ee.h)(yn,{class:"horizontal-rule-between",theme:s,ruleStyles:w,isSubview:!0,isBetweenButtons:!0}),(0,ee.h)(h,{key:t,"data-element-key":t,class:"action-button submit-button",onClick:r,theme:s,appearance:l,tabIndex:"0",type:c,href:null==u?void 0:u.url,target:null==u?void 0:u.target},(0,ee.h)(ee.Fragment,null,d&&(0,ee.h)(xn,null,(0,ee.h)(un,{stopColor:s.getCSSColor("text.button"),size:22})),(0,ee.h)(kn,{"data-testid":"button-content-wrapper",labelAlignment:null==m?void 0:m.textAlign,iconAlignment:g,visible:!d},(a||o)&&(0,ee.h)(fn,{iconName:a,iconUrl:o,size:f,color:b.color,fallbackColor:y,styles:Object.assign(Object.assign(Object.assign({},b),!i&&{marginLeft:0,marginRight:0}),{alignSelf:"center",justifySelf:"start"})}),(0,ee.h)(In,null,i)))))},Tn=e=>{let{theme:t,appearance:n}=e;const r=sn(t,n),i=(e,t)=>t?{[e]:t}:{},a=t.getShape("buttonWidth.global"),o=r({themeMethod:"getCSSFontProperties",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:{}});return Object.assign(Object.assign(Object.assign({cursor:"pointer",width:"hugsLabel"===a?"auto":"100%",maxWidth:"100%",padding:r({themeMethod:"getPadding",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:"10px 20px"}),backgroundColor:r({themeMethod:"getCSSColor",primaryAccessor:"background.action",secondaryAccessor:"background.actionSecondary"}),color:r({themeMethod:"getCSSColor",primaryAccessor:"text.action",secondaryAccessor:"text.actionSecondary"}),textAlign:"left"},o),{borderStyle:"solid",borderColor:r({themeMethod:"getCSSColor",primaryAccessor:"border.action",secondaryAccessor:"border.actionSecondary",fallbackStyle:"transparent",skipThemeHelperFallbacks:!0}),borderWidth:r({themeMethod:"getShape",primaryAccessor:"border.action",secondaryAccessor:"border.actionSecondary",fallbackStyle:"0px"}),borderRadius:r({themeMethod:"getShape",primaryAccessor:"borderRadius.action",secondaryAccessor:"borderRadius.actionSecondary",fallbackStyle:"0px"}),boxShadow:r({themeMethod:"getCSSShadowProperties",primaryAccessor:"action",secondaryAccessor:"actionSecondary",skipThemeHelperFallbacks:!0,fallbackStyle:"none"}),display:"flex",alignItems:"center",":hover":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i("color",r({themeMethod:"getCSSColor",primaryAccessor:"text.buttonHover",secondaryAccessor:"text.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),{backgroundColor:r({themeMethod:"getCSSColor",primaryAccessor:"background.buttonHover",secondaryAccessor:"background.buttonHoverSecondary",fallbackStyle:"rgba(0,0,0,0.05)",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),i("padding",r({themeMethod:"getPadding",primaryAccessor:"buttonHover",secondaryAccessor:"buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderColor",r({themeMethod:"getCSSColor",primaryAccessor:"border.buttonHover",secondaryAccessor:"border.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderWidth",r({themeMethod:"getShape",primaryAccessor:"border.buttonHover",secondaryAccessor:"border.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderRadius",r({themeMethod:"getShape",primaryAccessor:"borderRadius.buttonHover",secondaryAccessor:"borderRadius.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("boxShadow",r({themeMethod:"getCSSShadowProperties",primaryAccessor:"buttonHover",secondaryAccessor:"buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),":active":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i("color",r({themeMethod:"getCSSColor",primaryAccessor:"text.buttonActive",secondaryAccessor:"text.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),{backgroundColor:r({themeMethod:"getCSSColor",primaryAccessor:"background.buttonActive",secondaryAccessor:"background.buttonActiveSecondary",fallbackStyle:"rgba(0,0,0,0.1)",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),i("borderColor",r({themeMethod:"getCSSColor",primaryAccessor:"border.buttonActive",secondaryAccessor:"border.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderWidth",r({themeMethod:"getShape",primaryAccessor:"border.buttonActive",secondaryAccessor:"border.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderRadius",r({themeMethod:"getShape",primaryAccessor:"borderRadius.buttonActive",secondaryAccessor:"borderRadius.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("padding",r({themeMethod:"getPadding",primaryAccessor:"buttonActive",secondaryAccessor:"buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("boxShadow",r({themeMethod:"getCSSShadowProperties",primaryAccessor:"buttonActive",secondaryAccessor:"buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})))}),t.getElementFocusCSSProperties())},Fn=Zt("button")((e=>Object.assign({},Tn(e)))),Mn=Zt("a")((e=>Object.assign(Object.assign({},Tn(e)),{textDecoration:"none"}))),jn=Zt("div")((e=>{var t,n;let r,i,{labelAlignment:a,iconAlignment:o}=e;return"right"===o?(r="row-reverse",i=null!==(t=null==a?void 0:a.replace("left","flex-end").replace("right","flex-start"))&&void 0!==t?t:"flex-end"):(r="row",i=null!==(n=null==a?void 0:a.replace("left","flex-start").replace("right","flex-end"))&&void 0!==n?n:"flex-start"),{width:"100%",display:"flex",justifyContent:i,alignItems:"center",flexDirection:r}})),An=Zt("span")((()=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}))),Dn=e=>{let{nodeKey:t,localIndex:n,clickHandler:r,text:i,icon:a,iconUrl:o,theme:s,appearance:l,type:d,urlLink:c}=e;const u=c?Mn:Fn,h=sn(s,l),p=h({themeMethod:"getCSSFontProperties",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:{}}),m=h({themeMethod:"getShape",primaryAccessor:"align.actionIcon",secondaryAccessor:"align.actionIconSecondary",fallbackStyle:"left",skipThemeHelperFallbacks:!0}),g=h({themeMethod:"getShape",primaryAccessor:"lineHeight.actionIcon",secondaryAccessor:"lineHeight.actionIconSecondary",fallbackStyle:"1",skipThemeHelperFallbacks:!0}),v=h({themeMethod:"getNumericFontSize",primaryAccessor:"action",secondaryAccessor:"actionSecondary"}),f=Object.assign(Object.assign({},"left"===m?{marginRight:"10px"}:{marginLeft:"10px"}),{lineHeight:v*g+"px",color:h({themeMethod:"getCSSColor",primaryAccessor:"icon.action",secondaryAccessor:"icon.actionSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),b=h({themeMethod:"getCSSColor",primaryAccessor:"icon.action",secondaryAccessor:"icon.actionSecondary"}),y=s.getHorizontalRule("buttonGroupBetween"),w=s.getShape("buttonLayout.global"),S=(null==y?void 0:y.enabled)&&"horizontal"!==w&&n&&n>0;return(0,ee.h)(ee.Fragment,null,S&&(0,ee.h)(yn,{class:"horizontal-rule-between",theme:s,ruleStyles:y,isSubview:!1,isBetweenButtons:!0}),(0,ee.h)(u,{key:t,"data-element-key":t,class:"action-button",onClick:r,theme:s,appearance:l,tabIndex:"0",type:d,href:null==c?void 0:c.url,target:null==c?void 0:c.target},(0,ee.h)(jn,{labelAlignment:null==p?void 0:p.textAlign,iconAlignment:m},(a||o)&&(0,ee.h)(fn,{iconName:a,iconUrl:o,size:v,color:f.color,fallbackColor:b,styles:Object.assign(Object.assign(Object.assign({},f),!i&&{marginLeft:0,marginRight:0}),{alignSelf:"center",justifySelf:"start"})}),(0,ee.h)(An,null,i))))},En=e=>e.isWorkflow?(0,ee.h)(On,e):(0,ee.h)(Dn,e),_n=e=>{let{fillColor:t,className:n,style:r,ariaHidden:i=!0}=e;return(0,ee.h)("svg",{width:"14",height:"10",viewBox:"0 0 14 10",class:n,style:r,focusable:"false","aria-hidden":i},(0,ee.h)("path",{d:"M13.7071 0.292893C14.0976 0.683417 14.0976 1.31658 13.7071 1.70711L5.70711 9.70711C5.31658 10.0976 4.68342 10.0976 4.29289 9.70711L0.292893 5.70711C-0.0976311 5.31658 -0.0976311 4.68342 0.292893 4.29289C0.683417 3.90237 1.31658 3.90237 1.70711 4.29289L5 7.58579L12.2929 0.292893C12.6834 -0.0976311 13.3166 -0.0976311 13.7071 0.292893Z",fill:t}))},Ln=e=>{let{style:t}=e;return(0,ee.h)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,focusable:"false"},(0,ee.h)("path",{d:"M11 13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13H11ZM13 7C13 6.44772 12.5523 6 12 6C11.4477 6 11 6.44772 11 7H13ZM9 2V1C8.73478 1 8.48043 1.10536 8.29289 1.29289L9 2ZM11 2L11.7071 1.29289C11.5196 1.10536 11.2652 1 11 1V2ZM3 2C2.44772 2 2 2.44772 2 3C2 3.55228 2.44772 4 3 4V2ZM17 4C17.5523 4 18 3.55228 18 3C18 2.44772 17.5523 2 17 2V4ZM5 7C5 6.44772 4.55228 6 4 6C3.44772 6 3 6.44772 3 7H5ZM17 7C17 6.44772 16.5523 6 16 6C15.4477 6 15 6.44772 15 7H17ZM9 7C9 6.44772 8.55228 6 8 6C7.44772 6 7 6.44772 7 7H9ZM7 13C7 13.5523 7.44772 14 8 14C8.55228 14 9 13.5523 9 13H7ZM13 13V7H11V13H13ZM9 3H11V1H9V3ZM15 7V16H17V7H15ZM15 16H5V18H15V16ZM5 16V7H3V16H5ZM3 4H8V2H3V4ZM8.29289 1.29289L7.29289 2.29289L8.70711 3.70711L9.70711 2.70711L8.29289 1.29289ZM8 4H12V2H8V4ZM12 4H17V2H12V4ZM10.2929 2.70711L11.2929 3.70711L12.7071 2.29289L11.7071 1.29289L10.2929 2.70711ZM7 7V13H9V7H7ZM5 16L5 16H3C3 17.1046 3.89543 18 5 18V16ZM15 16L15 16V18C16.1046 18 17 17.1046 17 16H15Z"}))},Pn=e=>{let{style:t}=e;return(0,ee.h)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,focusable:"false"},(0,ee.h)("path",{d:"M10 7C10 6.44772 9.55228 6 9 6C8.44772 6 8 6.44772 8 7H10ZM9 11H8C8 11.5523 8.44772 12 9 12V11ZM13 12C13.5523 12 14 11.5523 14 11C14 10.4477 13.5523 10 13 10V12ZM10 17C6.13401 17 3 13.866 3 10H1C1 14.9706 5.02944 19 10 19V17ZM17 10C17 13.866 13.866 17 10 17V19C14.9706 19 19 14.9706 19 10H17ZM10 3C13.866 3 17 6.13401 17 10H19C19 5.02944 14.9706 1 10 1V3ZM10 1C5.02944 1 1 5.02944 1 10H3C3 6.13401 6.13401 3 10 3V1ZM8 7V11H10V7H8ZM9 12H13V10H9V12Z"}))},Hn=n(3054),Rn=n(6756),$n=n(1295),Nn=[];const Vn={},Wn=(e,t,n)=>{const{enableJs:r,disableUniqueIds:i,disableCssScoping:a,spriteIconId:o,replacementColor:s,containerSize:l}=t,d=!!o,c=(new DOMParser).parseFromString(n,"text/html"),u=d?c.getElementById(o):c.querySelector("svg"),h=(()=>{if(Nn.length)return Nn;for(const e in document.body)e.startsWith("on")&&Nn.push(e);return Nn.push("onbegin","onend","onrepeat"),Nn.push("onfocusin","onfocusout","onbounce","onfinish","onshow"),Nn})(),p=Vn[e.getAttribute("data-id")]||new Set,m=e.getAttribute("data-id")||`svg-loader_${$n.incr()}`,g={};if(i||Array.from(u.querySelectorAll("[id]")).forEach((e=>{const t=e.getAttribute("id"),n=`${t}_${$n.incr()}`;e.setAttribute("id",n),g[t]=n})),Array.from(u.querySelectorAll("*")).concat(u).forEach((t=>{if("script"===t.tagName){if(t.remove(),!r)return;{const n=document.createElement("script");n.appendChild(t.childNodes[0]),e.appendChild(n)}}const n=[];for(let e=0;e<t.attributes.length;e++){const{name:i,value:a}=t.attributes[e],o=Rn(g,a,i);a!==o&&t.setAttribute(i,o),!h.includes(i.toLowerCase())||r?["href","xlink:href","values"].includes(i)&&a.startsWith("javascript")&&!r&&n.push(i):n.push(i)}if(n.forEach((e=>t.removeAttribute(e))),"style"===t.tagName&&!a){let e=Hn(t.innerHTML,`[data-id="${m}"]`,g);e=Rn(g,e),e!==t.innerHTML&&(t.innerHTML=e)}})),e.innerHTML=o?u.outerHTML:u.innerHTML,!d)for(let t=0;t<u.attributes.length;t++){const{name:n,value:r}=u.attributes[t];e.getAttribute(n)&&!p.has(n)||(p.add(n),e.setAttribute(n,r))}Vn[m]=p,e.setAttribute("data-id",m),function(e,t){const n=e.querySelectorAll("*"),r=new Map,i=(e,t,n)=>{r.has(e)?r.get(e)?.set(t,n):r.set(e,(new Map).set(t,n))};n.forEach((e=>{const t=e.getAttribute("style");let n,r,a=e.getAttribute("fill"),o=e.getAttribute("stroke");t&&(n=t.match(/fill\s*:\s*([^;]+)/),r=t.match(/stroke\s*:\s*([^;]+)/));const s={...a?{fill:a}:{},...o?{stroke:o}:{},...n?{fillMatch:n}:{},...r?{strokeMatch:r}:{}};a&&i(a,e,s),o&&i(o,e,s),n&&i(n[1],e,s),r&&i(r[1],e,s)})),1===r.size&&t&&r.forEach(((e,n)=>{"currentcolor"===n.toLowerCase()&&e.forEach(((e,n)=>{if(e.fill&&n.setAttribute("fill",t),e.stroke&&n.setAttribute("stroke",t),e.fillMatch){const r=n.getAttribute("style")?.replace(e.fillMatch[0],`fill: ${t}`)??"";n.setAttribute("style",r)}if(e.strokeMatch){const r=n.getAttribute("style")?.replace(e.strokeMatch[0],`stroke: ${t}`)??"";n.setAttribute("style",r)}}))}))}(e,s),function(e,t){const n=e.getBBox({stroke:!0,fill:!0});(t&&n.width>t||t&&n.height>t)&&e.setAttribute("viewBox",`${n.x} ${n.y} ${n.width} ${n.height}`)}(e,l),function(e){const t=e.getBBox({stroke:!0,fill:!0});e.setAttribute("width",t.width),e.setAttribute("height",t.height)}(e);const v=new CustomEvent("iconload",{bubbles:!0});if(e.dispatchEvent(v),e.getAttribute("oniconload")){e.setAttribute("onauxclick",e.getAttribute("oniconload"));const t=new CustomEvent("auxclick",{bubbles:!1,view:window});e.dispatchEvent(t),e.removeAttribute("onauxclick")}},zn={},Bn={},Un=async e=>{const t=new URL(e.getAttribute("data-src"),globalThis.location),n=t.toString().replace(t.hash,""),r=t.hash.replace("#",""),i="enabled"===e.getAttribute("data-js"),a="disabled"===e.getAttribute("data-unique-ids"),o="disabled"===e.getAttribute("data-css-scoping"),s=e.getAttribute("data-replacement-color"),l=e.getAttribute("data-container-size"),d=Wn.bind(self,e,{enableJs:i,disableUniqueIds:a,disableCssScoping:o,spriteIconId:r,replacementColor:s,containerSize:l});if(Bn[n]){const e=Bn[n];d(e)}else{if(zn[n])return void setTimeout((()=>Un(e)),20);zn[n]=!0,fetch(n).then((e=>{if(!e.ok)throw Error(`Request for '${n}' returned ${e.status} (${e.statusText})`);return e.text()})).then((e=>{const t=e.toLowerCase().trim();if(!(t.startsWith("<svg")||t.startsWith("<?xml")||t.startsWith("<!doctype")))throw Error(`Resource '${n}' returned an invalid SVG file`);Bn[n]=e,d(e)})).catch((t=>{console.error(t);const n=new CustomEvent("iconloaderror",{bubbles:!0,detail:t.toString()});if(e.dispatchEvent(n),e.getAttribute("oniconloaderror")){Function("error",e.getAttribute("oniconloaderror"))(t)}})).finally((()=>{delete zn[n]}))}};let qn;globalThis.IntersectionObserver&&(qn=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(Un(e.target),qn.unobserve(e.target))}))}),{rootMargin:"1200px"}));const Yn=[];function Kn(){Array.from(document.querySelectorAll("svg[data-src]:not([data-id])")).forEach((e=>{-1===Yn.indexOf(e)&&(Yn.push(e),"lazy"===e.getAttribute("data-loading")?qn.observe(e):Un(e))}))}let Zn=!1;if(globalThis.addEventListener){const ah=setInterval((()=>{Kn()}),100);function oh(){clearInterval(ah),Kn(),(()=>{if(Zn)return;Zn=!0,new MutationObserver((e=>{e.some((e=>Array.from(e.addedNodes).some((e=>e.nodeType===Node.ELEMENT_NODE&&(e.getAttribute("data-src")&&!e.getAttribute("data-id")||e.querySelector("svg[data-src]:not([data-id])"))))))&&Kn(),e.forEach((e=>{"attributes"===e.type&&Un(e.target)}))})).observe(document.documentElement,{attributeFilter:["data-src"],attributes:!0,childList:!0,subtree:!0})})()}"interactive"===document.readyState||"complete"===document.readyState?oh():globalThis.addEventListener("DOMContentLoaded",(()=>{oh()}))}function Qn(e,t){for(var n in t)e[n]=t[n];return e}function Gn(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}globalThis.SVGLoader={},globalThis.SVGLoader.updateMemoryCache=async(e,t)=>{Bn[e]=t};var Xn=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).isPureReactComponent=!0,n}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.prototype.shouldComponentUpdate=function(e,t){return Gn(this.props,e)||Gn(this.state,t)},r}(ee.Component);function Jn(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:Gn(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,ee.createElement)(e,Qn({},t))}return r.prototype.isReactComponent=!0,r.displayName="Memo("+(e.displayName||e.name)+")",r.t=!0,r}var er=ee.options.__b;ee.options.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),er&&er(e)};var tr=function(e,t){return e?(0,ee.toChildArray)(e).reduce((function(e,n,r){return e.concat(t(n,r))}),[]):null},nr={map:tr,forEach:tr,count:function(e){return e?(0,ee.toChildArray)(e).length:0},only:function(e){if(1!==(e=(0,ee.toChildArray)(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:ee.toChildArray},rr=ee.options.__e;function ir(e){return e&&((e=Qn({},e)).__c=null,e.__k=e.__k&&e.__k.map(ir)),e}function ar(){this.__u=0,this.o=null,this.__b=null}function or(e){var t=e.__.__c;return t&&t.u&&t.u(e)}function sr(){this.i=null,this.l=null}ee.options.__e=function(e,t,n){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return r.__c(e,t.__c);rr(e,t,n)},(ar.prototype=new ee.Component).__c=function(e,t){var n=this;null==n.o&&(n.o=[]),n.o.push(t);var r=or(n.__v),i=!1,a=function(){i||(i=!0,r?r(o):o())};t.__c=t.componentWillUnmount,t.componentWillUnmount=function(){a(),t.__c&&t.__c()};var o=function(){var e;if(! --n.__u)for(n.__v.__k[0]=n.state.u,n.setState({u:n.__b=null});e=n.o.pop();)e.forceUpdate()};n.__u++||n.setState({u:n.__b=n.__v.__k[0]}),e.then(a,a)},ar.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=ir(this.__b),this.__b=null),[(0,ee.createElement)(ee.Component,null,t.u?null:e.children),t.u&&e.fallback]};var lr=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(sr.prototype=new ee.Component).u=function(e){var t=this,n=or(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),lr(t,e,r)):i()};n?n(a):a()}},sr.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,ee.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},sr.prototype.componentDidUpdate=sr.prototype.componentDidMount=function(){var e=this;e.l.forEach((function(t,n){lr(e,n,t)}))};var dr=function(){function e(){}var t=e.prototype;return t.getChildContext=function(){return this.props.context},t.render=function(e){return e.children},e}();function cr(e){var t=this,n=e.container,r=(0,ee.createElement)(dr,{context:t.context},e.vnode);return t.s&&t.s!==n&&(t.v.parentNode&&t.s.removeChild(t.v),(0,ee._unmount)(t.h),t.p=!1),e.vnode?t.p?(n.__k=t.__k,(0,ee.render)(r,n),t.__k=n.__k):(t.v=document.createTextNode(""),(0,ee.hydrate)("",n),n.appendChild(t.v),t.p=!0,t.s=n,(0,ee.render)(r,n,t.v),t.__k=t.v.__k):t.p&&(t.v.parentNode&&t.s.removeChild(t.v),(0,ee._unmount)(t.h)),t.h=r,t.componentWillUnmount=function(){t.v.parentNode&&t.s.removeChild(t.v),(0,ee._unmount)(t.h)},null}var ur=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;ee.Component.prototype.isReactComponent={};var hr="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;function pr(e,t,n){if(null==t.__k)for(;t.firstChild;)t.removeChild(t.firstChild);return(0,ee.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}var mr=ee.options.event;function gr(e,t){e["UNSAFE_"+t]&&!e[t]&&Object.defineProperty(e,t,{configurable:!1,get:function(){return this["UNSAFE_"+t]},set:function(e){this["UNSAFE_"+t]=e}})}ee.options.event=function(e){mr&&(e=mr(e)),e.persist=function(){};var t=!1,n=!1,r=e.stopPropagation;e.stopPropagation=function(){r.call(e),t=!0};var i=e.preventDefault;return e.preventDefault=function(){i.call(e),n=!0},e.isPropagationStopped=function(){return t},e.isDefaultPrevented=function(){return n},e.nativeEvent=e};var vr={configurable:!0,get:function(){return this.class}},fr=ee.options.vnode;ee.options.vnode=function(e){e.$$typeof=hr;var t=e.type,n=e.props;if(t){if(n.class!=n.className&&(vr.enumerable="className"in n,null!=n.className&&(n.class=n.className),Object.defineProperty(n,"className",vr)),"function"!=typeof t){var r,i,a;for(a in n.defaultValue&&void 0!==n.value&&(n.value||0===n.value||(n.value=n.defaultValue),delete n.defaultValue),Array.isArray(n.value)&&n.multiple&&"select"===t&&((0,ee.toChildArray)(n.children).forEach((function(e){-1!=n.value.indexOf(e.props.value)&&(e.props.selected=!0)})),delete n.value),n)if(r=ur.test(a))break;if(r)for(a in i=e.props={},n)i[ur.test(a)?a.replace(/[A-Z0-9]/,"-$&").toLowerCase():a]=n[a]}!function(t){var n=e.type,r=e.props;if(r&&"string"==typeof n){var i={};for(var a in r)/^on(Ani|Tra|Tou)/.test(a)&&(r[a.toLowerCase()]=r[a],delete r[a]),i[a.toLowerCase()]=a;if(i.ondoubleclick&&(r.ondblclick=r[i.ondoubleclick],delete r[i.ondoubleclick]),i.onbeforeinput&&(r.onbeforeinput=r[i.onbeforeinput],delete r[i.onbeforeinput]),i.onchange&&("textarea"===n||"input"===n.toLowerCase()&&!/^fil|che|ra/i.test(r.type))){var o=i.oninput||"oninput";r[o]||(r[o]=r[i.onchange],delete r[i.onchange])}}}(),"function"==typeof t&&!t.m&&t.prototype&&(gr(t.prototype,"componentWillMount"),gr(t.prototype,"componentWillReceiveProps"),gr(t.prototype,"componentWillUpdate"),t.m=!0)}fr&&fr(e)};function br(e){return!!e&&e.$$typeof===hr}const yr={useState:le,useReducer:de,useEffect:ce,useLayoutEffect:ue,useRef:he,useImperativeHandle:pe,useMemo:me,useCallback:function(e,t){return te=8,me((function(){return e}),t)},useContext:ge,useDebugValue:function(e,t){ee.options.useDebugValue&&ee.options.useDebugValue(t?t(e):e)},version:"16.8.0",Children:nr,render:pr,hydrate:pr,unmountComponentAtNode:function(e){return!!e.__k&&((0,ee.render)(null,e),!0)},createPortal:function(e,t){return(0,ee.createElement)(cr,{vnode:e,container:t})},createElement:ee.createElement,createContext:ee.createContext,createFactory:function(e){return ee.createElement.bind(null,e)},cloneElement:function(e){return br(e)?ee.cloneElement.apply(null,arguments):e},createRef:ee.createRef,Fragment:ee.Fragment,isValidElement:br,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:ee.Component,PureComponent:Xn,memo:Jn,forwardRef:function(e){function t(t){var n=Qn({},t);return delete n.ref,e(n,t.ref)}return t.prototype.isReactComponent=t.t=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},unstable_batchedUpdates:function(e,t){return e(t)},Suspense:ar,SuspenseList:sr,lazy:function(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return(0,ee.createElement)(n,i)}return i.displayName="Lazy",i.t=!0,i}},wr=()=>(0,ee.h)("svg",{width:"3",height:"15",viewBox:"0 0 3 15",xmlns:"http://www.w3.org/2000/svg"},(0,ee.h)("path",{d:"M3 1.5C3 2.32843 2.32843 3 1.5 3C0.671573 3 0 2.32843 0 1.5C0 0.671573 0.671573 0 1.5 0C2.32843 0 3 0.671573 3 1.5Z"}),(0,ee.h)("path",{d:"M3 7.5C3 8.32843 2.32843 9 1.5 9C0.671573 9 0 8.32843 0 7.5C0 6.67157 0.671573 6 1.5 6C2.32843 6 3 6.67157 3 7.5Z"}),(0,ee.h)("path",{d:"M3 13.5C3 14.3284 2.32843 15 1.5 15C0.671573 15 0 14.3284 0 13.5C0 12.6716 0.671573 12 1.5 12C2.32843 12 3 12.6716 3 13.5Z"})),Sr=e=>{let{style:t}=e;return(0,ee.h)("svg",{width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:"false",style:t},(0,ee.h)("path",{d:"M11 8V9C10.5955 9 10.2309 8.75636 10.0761 8.38268C9.92134 8.00901 10.0069 7.57889 10.2929 7.29289L11 8ZM10.5 2.5L11.2071 3.20711L10.5 2.5ZM6 8V18H4V8H6ZM5 17H14.3604V19H5V17ZM15.341 16.1961L16.541 10.1961L18.5021 10.5884L17.3021 16.5883L15.341 16.1961ZM11.2071 3.20711L5.70711 8.70711L4.29289 7.29289L9.79289 1.79289L11.2071 3.20711ZM15.5604 9H11V7H15.5604V9ZM10.2929 7.29289L12.7929 4.79289L14.2071 6.20711L11.7071 8.70711L10.2929 7.29289ZM5 9H3V7H5V9ZM2 10V16H0V10H2ZM3 17H5V19H3V17ZM2 16C2 16.5523 2.44771 17 3 17V19C1.34315 19 0 17.6569 0 16H2ZM3 9C2.44772 9 2 9.44772 2 10H0C0 8.34315 1.34315 7 3 7V9ZM12.7929 4.79289C13.2308 4.35499 13.2308 3.64501 12.7929 3.20711L14.2071 1.79289C15.4261 3.01184 15.4261 4.98815 14.2071 6.20711L12.7929 4.79289ZM9.79289 1.79289C11.0118 0.573941 12.9882 0.573942 14.2071 1.79289L12.7929 3.20711C12.355 2.7692 11.645 2.7692 11.2071 3.20711L9.79289 1.79289ZM14.3604 17C14.8371 17 15.2475 16.6635 15.341 16.1961L17.3021 16.5883C17.0217 17.9906 15.7904 19 14.3604 19V17ZM16.541 10.1961C16.6647 9.57732 16.1914 9 15.5604 9V7C17.4535 7 18.8734 8.73198 18.5021 10.5884L16.541 10.1961Z"}))},Cr=e=>{let{style:t}=e;return(0,ee.h)("svg",{width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t},(0,ee.h)("path",{d:"M8 11V10C8.40446 10 8.7691 10.2436 8.92388 10.6173C9.07866 10.991 8.9931 11.4211 8.70711 11.7071L8 11ZM8.5 16.5L7.79289 15.7929L8.5 16.5ZM13 11L13 1H15L15 11H13ZM14 2H4.63961V0H14V2ZM3.65903 2.80388L2.45903 8.80388L0.497866 8.41165L1.69787 2.41165L3.65903 2.80388ZM7.79289 15.7929L13.2929 10.2929L14.7071 11.7071L9.20711 17.2071L7.79289 15.7929ZM3.43961 10H8V12H3.43961V10ZM8.70711 11.7071L6.20711 14.2071L4.79289 12.7929L7.29289 10.2929L8.70711 11.7071ZM14 10H16L16 12H14L14 10ZM17 9V3H19L19 9H17ZM16 2L14 2V0L16 0V2ZM17 3C17 2.44771 16.5523 2 16 2V0C17.6569 0 19 1.34315 19 3H17ZM16 10C16.5523 10 17 9.55228 17 9H19C19 10.6569 17.6569 12 16 12L16 10ZM6.20711 14.2071C5.7692 14.645 5.7692 15.355 6.20711 15.7929L4.79289 17.2071C3.57394 15.9882 3.57394 14.0118 4.79289 12.7929L6.20711 14.2071ZM9.20711 17.2071C7.98815 18.4261 6.01184 18.4261 4.79289 17.2071L6.20711 15.7929C6.64501 16.2308 7.35499 16.2308 7.79289 15.7929L9.20711 17.2071ZM4.63961 2C4.16293 2 3.75251 2.33646 3.65903 2.80388L1.69787 2.41165C1.97832 1.00938 3.20956 0 4.63961 0V2ZM2.45903 8.80388C2.33527 9.42268 2.80856 10 3.43961 10V12C1.54647 12 0.126591 10.268 0.497866 8.41165L2.45903 8.80388Z"}))},kr=e=>e&&e.current&&e.current.base,xr=30,Ir=10,Or=e=>{var t,n,r,i,a,o,s,l;const d=e.getNumericalPadding("card"),c=e.getNumericalPadding("menuButton"),u=(null!==(t=c.top)&&void 0!==t?t:Ir)+xr+(null!==(n=c.bottom)&&void 0!==n?n:Ir),h=(null!==(r=c.right)&&void 0!==r?r:Ir)+xr+(null!==(i=c.left)&&void 0!==i?i:Ir);return{top:u>(null!==(a=d.top)&&void 0!==a?a:y)?u-(null!==(o=d.top)&&void 0!==o?o:y):0,right:h>(null!==(s=d.right)&&void 0!==s?s:b)?h-(null!==(l=d.right)&&void 0!==l?l:b):0}},Tr=e=>{var t,n,r,i;const{top:a,right:o,bottom:s,left:l}=e.getNumericalPadding("menuButton"),d=e.getNumericalPadding("card");return void 0===a&&void 0===o&&void 0===s&&void 0===l?{top:Ir-(null!==(t=d.top)&&void 0!==t?t:y),right:Ir-(null!==(n=d.right)&&void 0!==n?n:20),bottom:Ir,left:Ir}:{top:(null!=a?a:0)-(null!==(r=d.top)&&void 0!==r?r:y),right:(null!=o?o:0)-(null!==(i=d.right)&&void 0!==i?i:20),bottom:null!=s?s:0,left:null!=l?l:0}},Fr=Zt("button")((e=>{let{open:t,theme:n}=e;const{top:r,right:i}=Tr(n);return Object.assign({cursor:"pointer",position:"absolute",top:`${r}px`,right:`${i}px`,width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"center",border:"0px",borderRadius:"30px",zIndex:As.OVERFLOW_MENU_BUTTON,background:n.getCSSColor(t?"background.optionsActive":"background.options"),"&:hover":{background:n.getCSSColor("background.optionsHover")}," > svg":{fill:n.getCSSColor(t?"icon.optionsActive":"icon.options")},"&:hover > svg":{fill:n.getCSSColor("icon.optionsHover")}},n.getElementFocusCSSProperties())})),Mr=Zt("button")((e=>{let{theme:t}=e;const{top:n,right:r}=Tr(t);return Object.assign({cursor:"pointer",position:"absolute",top:`${n}px`,right:`${r}px`,width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"center",border:"0px",borderRadius:"30px",zIndex:As.OVERFLOW_MENU_BUTTON,background:t.getCSSColor("background.options")," > svg":{stroke:t.getCSSColor("icon.options")},"&:hover":{background:t.getCSSColor("background.optionsHover")},"&:active":{background:t.getCSSColor("background.optionsActive")},"&:hover > svg":{stroke:t.getCSSColor("icon.optionsHover")},"&:active > svg":{stroke:t.getCSSColor("icon.optionsActive")}},t.getElementFocusCSSProperties())})),jr=e=>{let{theme:t,open:n,feedOrientation:r,children:i,cardRef:a,ariaLabelledBy:o}=e;const s=he(null);let l={direction:"down",maxHeight:0,maxWidth:0};if(n){const e=t.getNumericalPadding("card"),n=Tr(t);l=((e,t,n,r,i)=>{var a,o,s,l;if(kr(t)&&kr(n)){const d=t.current.base,c=t.current.base.offsetParent,u=c.offsetParent,h=n.current.base,p=d.clientWidth-((null!==(a=null==r?void 0:r.left)&&void 0!==a?a:b)+(null!==(o=null==i?void 0:i.right)&&void 0!==o?o:0));if("horizontal"===e){const e=c.offsetLeft+h.offsetLeft-u.scrollLeft,t=u.clientWidth-(e>0?e:0),n=200,r=e>=n||t<n;return{direction:r?"left":"right",maxWidth:r?p:t}}const m=h.offsetTop,g=u.scrollHeight-c.offsetTop-(null!==(s=r.top)&&void 0!==s?s:y)-(m+(null!==(l=r.top)&&void 0!==l?l:y)),v=c.offsetTop,f=h.scrollHeight,w=g>=f||v<f;return{direction:w?"down":"up",maxHeight:w?g:v,maxWidth:p}}return{direction:"down",maxHeight:0,maxWidth:0}})(r,a,s,e,n),setTimeout((()=>{if(kr(s)){const e=s.current.base.querySelector('[tabindex="0"]');if(e){e.focus()}}}),0)}return(0,ee.h)(Ar,{maxHeight:`${l.maxHeight}px`,maxWidth:`${l.maxWidth}px`,open:n,theme:t,ref:s,children:i,direction:l.direction,"aria-labelledBy":o})},Ar=Zt("ul")((e=>{var t,n;let{theme:r,open:i,maxHeight:a,maxWidth:o,direction:s}=e;const{top:l,right:d,bottom:c}=Tr(r),u=r.getNumericalPadding("card");let h;switch(s){case"up":h=`translateY(-100%) translateY(-${(null!=l?l:Ir)+(null!==(t=u.top)&&void 0!==t?t:y)+(null!=c?c:Ir)+xr}px)`;break;case"down":case"left":h="translateY(0)";break;case"right":h="translateX(90%)"}return{position:"absolute",top:`${(null!=l?l:Ir)+(null!=c?c:Ir)+xr}px`,right:`${null!=d?d:Ir}px`,width:"300px",flexShrink:"0",background:r.getCSSColor("background.sheet"),display:"flex",flexFlow:"column",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.2)",borderRadius:null!==(n=r.getShape("borderRadius.sheet",{skipFallback:!0}))&&void 0!==n?n:"5px",padding:"10px 0",overflow:"auto",listStyle:"none",margin:"0",zIndex:As.OVERFLOW_MENU,maxHeight:i?`${a}`:"0px",maxWidth:i?`${o}`:"0px",visibility:i?"visible":"hidden",transform:h}})),Dr=Zt("button")((e=>{let{theme:t}=e;return Object.assign(Object.assign(Object.assign({padding:"15px 20px",cursor:"pointer",display:"flex",flexShrink:"0",alignItems:"center",background:"transparent"},t.getCSSFontProperties("sheetItem")),{color:t.getCSSColor("text.sheetItem"),width:"100%",margin:"0 0 0 0"," svg":{fill:t.getCSSColor("icon.sheetItem")},"&:hover":{background:t.getCSSColor("background.sheetItemActive"),color:t.getCSSColor("text.sheetItemActive")},"&:hover svg":{fill:t.getCSSColor("icon.sheetItemActive")},border:"0px"}),t.getElementFocusCSSProperties())})),Er=Zt("span")((()=>({maxWidth:"240px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}))),_r=Zt("li")((e=>{let{theme:t}=e;return{borderTop:`1px solid ${t.getCSSColor("border.sheetItemDivider")}`,height:"1px",margin:"10px 0"}})),Lr=Zt("li")((()=>({flexShrink:"0"}))),Pr=e=>{let{title:t,icon:n,onClick:r,theme:i,className:a}=e;const o={marginRight:"20px",minWidth:"20px"};return(0,ee.h)(Lr,{role:"none"},(0,ee.h)(Dr,{theme:i,tabIndex:"-1",onClick:r,className:a},"bin"===n&&(0,ee.h)(Ln,{style:o}),"clock"===n&&(0,ee.h)(Pn,{style:o}),"thumbs-up"===n&&(0,ee.h)(Sr,{style:o}),"thumbs-down"===n&&(0,ee.h)(Cr,{style:o}),(0,ee.h)(Er,null,t)))},Hr=32,Rr=38,$r=40,Nr=13,Vr=27,Wr=-1,zr=e=>{switch(e){case"ArrowUp":case"Up":return Rr;case"ArrowDown":case"Down":return $r;case"Enter":return Nr;case"Spacebar":case" ":return Hr;case"Escape":return Vr;default:return Wr}},Br="ArrowUp",Ur="ArrowDown",qr="ArrowLeft",Yr="ArrowRight",Kr="Enter",Zr=" ",Qr="Escape",Gr="PageUp",Xr="PageDown",Jr="Tab",ei=Zt("div")((e=>{let{theme:t}=e;return Object.assign({width:"100%",border:"0"},t.getElementFocusCSSProperties())})),ti=(e,t)=>{try{const n=ni(e)[t];return n&&"none"===n.getAttribute("role")&&n.childNodes.length>0?n.childNodes[0]:n}catch(e){return null}},ni=e=>e&&e.current&&e.current.base&&e.current.base.childNodes?[...e.current.base.childNodes].filter((e=>"true"!==e.getAttribute("aria-hidden"))):[],ri=e=>{let{defaultIndex:t,theme:n,children:r}=e;const[i,a]=le(t||0),o=(0,ee.createRef)(),s=he(-1);ce((()=>{s.current=i}));const l=s.current;return ce((()=>{a(t||0)}),[t]),ce((()=>{var e,t,n;-1!==l&&(null===(n=ti(o,l))||void 0===n||n.setAttribute("tabIndex","-1"));null===(e=ti(o,i))||void 0===e||e.setAttribute("tabIndex","0"),null===(t=ti(o,i))||void 0===t||t.focus()}),[i]),(0,ee.h)(ei,{theme:n,className:"supports-keyboard-navigation",ref:o,onKeyDown:e=>{var t;let n=null;switch(zr(e.key)){case $r:n=i+1;break;case Rr:n=i-1;break;case Nr:case Hr:null===(t=ti(o,i))||void 0===t||t.click(),e.stopPropagation(),e.preventDefault()}var r,s;null!==n&&(r=n,s=ni(o).length,n=(r+s)%s,a(n),e.view.event.preventDefault())}},r)},ii=e=>{let{fillColor:t}=e;return(0,ee.h)("svg",{width:"12",height:"12",viewBox:"0 0 12 12"},(0,ee.h)("path",{d:"M1 1L6 6L11 11M1 11L11 1","stroke-width":"2","stroke-linecap":"round",stroke:t}))},ai=Zt("div")((e=>{let{firstChildNodeMargin:t}=e;return Object.assign({position:"relative",height:"100%",display:"flex",flexDirection:"column"},t.right||t.top?{"& > *:nth-child(2)":Object.assign(Object.assign({},null!==t.right?{marginRight:`${t.right}px`}:{}),null!==t.top?{marginTop:`${t.top}px`}:{})}:{})})),oi=Zt("div")((e=>{let{theme:t,embedMode:n,margin:r,minHeight:i,maxWidth:a,feedOrientation:o,cardWidth:s}=e;const l={width:`${s}px`,marginRight:`${r}px`,marginBottom:"0px"};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({backgroundColor:t.getCSSColor("background.card"),marginBottom:`${r}px`,borderRadius:t.getShape("borderRadius.card")||"initial",boxShadow:"single-card"!==n?`0 ${t.getShape("offset.cardShadow")} ${t.getShape("blur.cardShadow")} ${t.getCSSColor("shadow.card")}`:"none",padding:`${t.getPadding("card")||"20px 20px"}`,border:`${t.getShape("border.card")||"0px"} solid ${t.getCSSColor("border.card")}`,position:"relative",minHeight:i?`${i}px`:"0px"},"horizontal"===o?l:{}),"modal-stream"===n?{width:"100%",maxWidth:a?`${a}px`:"initial"}:{}),nl(t,n,o).cardCompletion),nl(t,n,o).dismissal),nl(t,n,o).snooze),{".submitting, .submitted, .submitted-subview":{border:"0"}})})),si=Zt("div")((e=>{let{theme:t,dimensions:n,horizontalFeedCenterAlign:r,leftPosition:i,feedOrientation:a,embedMode:o,cardHorizontalAlignment:s}=e;const l=t.getNumericalPadding("stream"),d=Object.assign({width:n.width,display:"flex",flexShrink:"0",scrollSnapAlign:"center",".fixed-position":{position:"unset",left:`${i?i/2+i:0}px`}},r&&{left:"50%",transform:"translateX(-50%)"}),c={width:"100%",display:"flex",justifyContent:{leading:"flex-start",center:"center",trailing:"flex-end"}[null!=s?s:"center"],alignItems:"center"};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({height:n.height},"horizontal"===a?d:{}),"modal-stream"===o?c:{}),rl(l,o,a).cardCompletion),rl(l,o,a).dismissal),rl(l,o,a).snooze),rl(l,o,a).center)})),li=Zt("div")((()=>({})));var di;!function(e){e.menu="menu",e.dismiss="dismiss",e.hidden="hidden"}(di||(di={}));const ci=Jn((e=>{let{containerInstanceId:t,cardInstanceId:n,children:r,theme:i,embedMode:a,animationState:o,cardFeedOverlayDisplayed:s,onDismiss:l,onSnooze:d,onFeedbackSelected:c,removeCard:u,customStrings:h,margin:p,horizontalFeedCenterAlign:m,accessibilityRole:g,actions:v,votingOptions:f,cardMinimumHeight:b,cardMaximumWidth:y,cardHorizontalAlignment:w,horizontalContainerConfig:S}=e;const[C,k]=le(!1),x=he(C),I=e=>{x.current=e,k(e)},[O,T]=le({height:"auto",width:"auto"}),[F,G]=le(0),X=he(null),J=he(null),te=he(null),ne=`card-overflow-menu-${n}`,re=kc(S);ue((()=>{J.current&&J.current.base&&("submitted"===o||"submitted-subview"===o||"dismissed"===o||"snoozed"===o?(T({height:J.current.base.offsetHeight+("horizontal"!==re?p:0)-1+"px",width:`${J.current.base.offsetWidth+p}px`}),"horizontal"===re&&"center"===(null==S?void 0:S.lastCardAlignment)?(zt().fixPositionRemainingCard(n),G(te.current.base.offsetLeft),setTimeout((()=>{zt().centerRemainingCard(n)}),200),setTimeout((()=>{u()}),sl(o))):setTimeout((()=>{u()}),sl(o))):T({height:"auto",width:"auto"})),te.current&&te.current.base&&(G("fixed-position"===o?te.current.base.offsetLeft:0),"centering"===o&&setTimeout((()=>{zt().removeCardState(n)}),sl(o)))}),[o,J.current,te.current]),ce((()=>{const e=e=>{var t;(null===(t=X.current)||void 0===t?void 0:t.base)&&!X.current.base.contains(e.target)&&I(!1)};document.addEventListener("mousedown",e);const t=e=>{if(x.current&&("Tab"===e.key&&I(!1),"Escape"===e.key&&x.current)){const e=document.getElementById(ne);I(!1),null==e||e.focus()}};return document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}}),[n]);const{dismiss:{overflow:ie},snooze:{overflow:ae},voteUp:{overflow:oe,feedback:se,feedbackLabel:de},voteDown:{overflow:pe,feedback:me,feedbackLabel:ge}}=v,ve={voteUp:!0===(null==f?void 0:f.canVoteUseful)||oe,voteDown:!0===(null==f?void 0:f.canVoteNotUseful)||pe};let fe=di.hidden;ve.voteUp||ve.voteDown||ae?fe=di.menu:ie&&(fe=di.dismiss);const be=(ve.voteUp||ve.voteDown)&&(ie||ae),ye=((e,t,n)=>{var r,i;if(!n||!t||0===t.length)return{top:0,right:0};const a=t=>{var n;if(!t)return{top:0,right:0};const r=Array.isArray(t)?t[0]:t;switch(null==r?void 0:r.type){case E:case _:const t=null==r||null===(n=r.attributes)||void 0===n?void 0:n.format;return"banner"===t?{top:null,right:null}:"text"===t?{top:0,right:Or(e).right}:{top:Or(e).top,right:0};case L:case P:case H:case R:case $:case N:case V:case W:case U:case q:case Y:case K:case Z:case Q:return{top:Or(e).top,right:0};case M:case j:case A:case D:return{top:0,right:Or(e).right};case z:case B:return a(null==r?void 0:r.children);default:return{top:null,right:null}}},o=null===(r=t[0])||void 0===r||null===(i=r.props)||void 0===i?void 0:i.node;return a(o)})(i,r||[],fe!==di.hidden);return(0,ee.h)(si,{theme:i,ref:te,id:n,dimensions:O,feedOrientation:re,embedMode:a,horizontalFeedCenterAlign:m,leftPosition:F,cardHorizontalAlignment:w,class:o,role:g},(0,ee.h)(oi,{theme:i,embedMode:a,class:`card-content ${o||""}`,ref:J,margin:p,minHeight:b,maxWidth:y,feedOrientation:re,cardWidth:null==S?void 0:S.cardWidth,inert:s},(0,ee.h)(ai,{firstChildNodeMargin:ye,class:"card-nodes"},fe===di.menu&&(0,ee.h)(li,{ref:X},(0,ee.h)(Fr,{class:"overflow-action",theme:i,open:C,tabIndex:"0",ariaLabel:"Card overflow menu",id:ne,ariaHasPopup:"true",ariaExpanded:C,onClick:e=>{e.target&&e.target.focus(),I(!C)}},(0,ee.h)(wr,null)),(0,ee.h)(jr,{theme:i,ariaLabelledBy:ne,open:C,feedOrientation:re,cardRef:J},(0,ee.h)(ri,{theme:i},ve.voteUp&&(0,ee.h)(Pr,{onClick:()=>{c({sentiment:"positive",textFeedback:se,textFeedbackLabel:de,source:"overflow-menu"}),I(!1)},theme:i,title:(null==h?void 0:h.votingUsefulTitle)||"This is useful",icon:"thumbs-up",className:"vote-up-action"}),ve.voteDown&&(0,ee.h)(Pr,{onClick:()=>{c({sentiment:"negative",textFeedback:me,textFeedbackLabel:ge,source:"overflow-menu"}),I(!1)},theme:i,title:(null==h?void 0:h.votingNotUsefulTitle)||"This isn't useful",icon:"thumbs-down",className:"vote-down-action"}),be&&(0,ee.h)(_r,{theme:i,className:"card-overflow-divider","aria-hidden":"true"}),ae&&(0,ee.h)(Pr,{onClick:()=>{d(),I(!1)},theme:i,title:(null==h?void 0:h.cardSnoozeTitle)||"Remind me",icon:"clock",className:"snooze-action"}),ie&&(0,ee.h)(Pr,{onClick:()=>{l(),I(!1)},theme:i,title:"Dismiss",icon:"bin",className:"dismiss-action"})))),fe===di.dismiss&&(0,ee.h)(Mr,{ariaLabel:"Dismiss card",theme:i,tabIndex:"0",onClick:l,className:"dismiss-button"},(0,ee.h)(ii,null)),r),(0,ee.h)(Ys,{theme:i,animationState:o})),(0,ee.h)(el,{viewState:"topview",onCancelUpload:()=>{window.AtomicUploadService.cancelUploadForCard(t,n),zt().finishCardFileUpload(n),!window.AtomicUploadService.getIsUploadingStatus(t)&&zt().setCardFeedOverlay(!1)},theme:i,renderOverlay:"uploading-files"===o,cardMaximumWidth:y,cardHorizontalAlignment:w,spaceBetweenCards:p}),(0,ee.h)(Ks,{theme:i,animationState:o}))}),((e,t)=>0==t.isPreview&&e.animationState===t.animationState&&e.cardInstanceId===t.cardInstanceId&&e.runtimeVariables===t.runtimeVariables&&e.theme===t.theme)),ui=Zt("div")((e=>{let{embedMode:t,feedOrientation:n,snapScroll:r,theme:i}=e;const a={position:"relative",display:"flex",flexDirection:"row nowrap",alignItems:"stretch",flexShrink:"0",padding:i.getPadding("stream")||"10px",overflowX:"auto",scrollSnapType:r?"x mandatory":"none"};return Object.assign(Object.assign({},"modal-stream"===t?{height:"100%",width:"100%",padding:"0"}:{}),"horizontal"===n?a:{})})),hi=yr.forwardRef(((e,t)=>{let{cardInstances:n,theme:r,isPreview:i,onDismiss:a,onSnooze:o,onFeedbackSelected:s,removeCard:l,cardStates:d,margin:c,runtimeVariables:u,customStrings:h,votingOptions:p,horizontalContainerConfig:g}=e;const v=m().getState();let f=n;v.application.cardLimit&&(f=f.slice(0,v.application.cardLimit));const b=kc(g);return(0,ee.h)(ui,{embedMode:v.application.embedMode,feedOrientation:b,snapScroll:"free"!==(null==g?void 0:g.scrollMode),class:"card-list",ref:t,theme:r},f.map(((e,t)=>{if(e.defaultView){var m;let y=null==u||null===(m=u.values)||void 0===m?void 0:m.get(e.instance.id);y=y||new Map;const w=1===f.length&&"horizontal"===b&&"center"===(null==g?void 0:g.lastCardAlignment);e.defaultView.nodes=hc(e.defaultView.nodes);let S=0;if(f.length>1&&t!==n.length-1){const e=on(r.getShape("spaceBetweenCards.global",{skipFallback:!0}));S=null!=e?e:c}return(0,ee.h)(ci,{key:e.instance.id,cardInstanceId:e.instance.id,containerInstanceId:v.application.containerInstanceId,theme:r,isPreview:i,embedMode:v.application.embedMode,animationState:d[e.instance.id],cardFeedOverlayDisplayed:v.cardFeed.displayingOverlay,onDismiss:()=>{a(e.instance.id)},onSnooze:()=>{o(e.instance.id,e.metadata.expires)},onFeedbackSelected:t=>{s(t,e.instance.id)},removeCard:()=>{l(e.instance.id)},runtimeVariables:y,customStrings:h,margin:S,horizontalFeedCenterAlign:w,accessibilityRole:"listitem",actions:e.actions,votingOptions:p,cardMinimumHeight:v.cardFeed.cardMinimumHeight,cardMaximumWidth:v.cardFeed.cardMaximumWidth,cardHorizontalAlignment:v.cardFeed.cardHorizontalAlignment,horizontalContainerConfig:g},e.defaultView.nodes.map(((t,n)=>{var i,a,o;const s=null===(i=e.defaultView)||void 0===i?void 0:i.nodes[e.defaultView.nodes.length-1],l="form"===s.type?s:void 0,d=null==l||null===(a=l.children)||void 0===a?void 0:a.find((e=>"actionButtonGroup"===e.type));return(0,ee.h)(ac,{cardInstanceId:e.instance.id,cardMetadata:e.metadata,node:t,cardContext:{nodeCount:(null===(o=e.defaultView)||void 0===o?void 0:o.nodes.length)||0,hasButtonFinalNode:void 0!==l,hasButtons:void 0!==(null==d?void 0:d.children)&&d.children.length>0},index:n,isWorkflow:!1,theme:r,runtimeVariables:y,feedOrientation:b,embedMode:v.application.embedMode})})))}return null})))})),pi=Zt("button")((e=>{let{theme:t}=e;return Object.assign({justifySelf:"end",alignSelf:"center",border:"0px",borderRadius:"999px",width:"40px",height:"40px",display:"flex",flexBasis:"40px",flex:"none",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:"transparent",":hover":{backgroundColor:"rgba(0, 0, 0, 0.05)",transition:"background-color 0.1s ease"},":active":{backgroundColor:"rgba(0, 0, 0, 0.1)"}},t.getElementFocusCSSProperties())})),mi={settings:e=>{let{fillColor:t}=e;return(0,ee.h)("svg",{fill:t,width:"18",height:"14",viewBox:"0 0 18 14"},(0,ee.h)("path",{d:"M17 4C17.5523 4 18 3.55228 18 3C18 2.44772 17.5523 2 17 2V4ZM1 2C0.447715 2 0 2.44772 0 3C0 3.55228 0.447715 4 1 4V2ZM17 12C17.5523 12 18 11.5523 18 11C18 10.4477 17.5523 10 17 10V12ZM1 10C0.447715 10 0 10.4477 0 11C0 11.5523 0.447715 12 1 12V10ZM13 3C13 3.55228 12.5523 4 12 4V6C13.6569 6 15 4.65685 15 3H13ZM12 4C11.4477 4 11 3.55228 11 3H9C9 4.65685 10.3431 6 12 6V4ZM11 3C11 2.44772 11.4477 2 12 2V0C10.3431 0 9 1.34315 9 3H11ZM12 2C12.5523 2 13 2.44772 13 3H15C15 1.34315 13.6569 0 12 0V2ZM14 4H17V2H14V4ZM10 2H1V4H10V2ZM7 11C7 11.5523 6.55228 12 6 12V14C7.65685 14 9 12.6569 9 11H7ZM6 12C5.44772 12 5 11.5523 5 11H3C3 12.6569 4.34315 14 6 14V12ZM5 11C5 10.4477 5.44772 10 6 10V8C4.34315 8 3 9.34315 3 11H5ZM6 10C6.55228 10 7 10.4477 7 11H9C9 9.34315 7.65685 8 6 8V10ZM8 12H17V10H8V12ZM4 10H1V12H4V10Z"}))},arrowLeft:e=>{let{fillColor:t}=e;return(0,ee.h)("svg",{stroke:t,width:"14",height:"12",viewBox:"0 0 14 12"},(0,ee.h)("path",{d:"M6 11L1 6M1 6L6 1M1 6L13 6","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},cross:ii},gi=e=>{let{title:t,iconName:n,onClick:r,theme:i}=e;const a=mi[n];return(0,ee.h)(pi,{onClick:r,tabIndex:"0",ariaLabel:t,theme:i,className:`button-${n}`},(0,ee.h)(a,{fillColor:i.getCSSColor("text.navigationAction")}))},vi=Zt("div")((e=>{let{theme:t,feedOrientation:n,cardBorderRadius:r}=e;return Object.assign({padding:"10px 20px 10px 15px",display:"flex",alignItems:"center",backgroundColor:t.getCSSColor("background.navigation"),zIndex:As.HEADER,boxShadow:`0 ${t.getShape("offset.navigationShadow")} ${t.getShape("blur.navigationShadow")} ${t.getCSSColor("shadow.navigation")}`,borderTopLeftRadius:r||"initial",borderTopRightRadius:r||"initial"},"horizontal"===n?{padding:"10px"}:{})})),fi=Zt("h1")((e=>{let{theme:t,feedOrientation:n,alignment:r="left"}=e;const i={paddingLeft:"0",textAlign:r};return Object.assign(Object.assign(Object.assign({},t.getCSSFontProperties("navigationTitle")),{alignSelf:"center",paddingLeft:"10px",flexGrow:"1",color:t.getCSSColor("text.navigationTitle")}),"horizontal"===n?i:{})})),bi=yr.forwardRef(((e,t)=>{let{theme:n,title:r,actionHandler:i,feedOrientation:a,alignment:o,inert:s,cardBorderRadius:l}=e;return(0,ee.h)(vi,{theme:n,cardBorderRadius:l,feedOrientation:a,ref:t,inert:s},i&&(0,ee.h)(gi,{title:"Back",onClick:i,iconName:"arrowLeft",theme:n}),(0,ee.h)(fi,{theme:n,feedOrientation:a,alignment:o},r))})),yi=e=>{let{theme:t,title:n,actionHandler:r,inert:i}=e;return(0,ee.h)(vi,{theme:t,inert:i},(0,ee.h)(fi,{theme:t},n),r&&(0,ee.h)(gi,{title:"Close",onClick:r,iconName:"cross",theme:t}))},wi=Zt("div")((e=>{let{theme:t,hasRetry:n,feedOrientation:r}=e;const i={maxWidth:"380px",flexGrow:"1"};return Object.assign(Object.assign(Object.assign({},t.getElementFocusCSSProperties()),{margin:"10px",background:t.getCSSColor("background.toast"),padding:"20px",border:"0px",borderRadius:"10px",display:"flex",flexDirection:"row",pointerEvents:"auto",cursor:!n&&"pointer",transform:"translateY(100%) translateY(50px)",transition:"300ms transform ease-in-out 300ms",".visible":{transform:"translateY(0)"}}),"horizontal"===r?i:{})})),Si=Zt("div")((e=>{let{feedOrientation:t}=e;return Object.assign({position:"absolute",bottom:"0",left:"0",right:"0",overflow:"hidden",pointerEvents:"none",zIndex:As.TOAST},"horizontal"===t?{display:"flex",justifyContent:"center"}:{})})),Ci=Zt("p")((e=>{let{theme:t}=e;return Object.assign({flexGrow:"1",margin:"0",userSelect:"none",webkitUserSelect:"none",color:t.getCSSColor("text.toast")},t.getCSSFontProperties("toast"))})),ki=Zt("span")((e=>{let{theme:t,hasRetry:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign({border:"0px"},t.getElementFocusCSSProperties()),{color:t.getCSSColor("text.toastAction")}),t.getCSSFontProperties("toastAction")),{cursor:n&&"pointer",background:"transparent",padding:"0",userSelect:"none",webkitUserSelect:"none",display:"flex",alignItems:"center"})})),xi=(e,t)=>new Promise((n=>{t(setTimeout((()=>{n(void 0)}),e))})),Ii=e=>{var t;let{theme:n,feedOrientation:r,message:i,actionTitle:a,actionHandler:o,onDismiss:s,delay:l=0}=e;const[d,c]=le(!1),[u,h]=le(""),[p,g]=le(null),[v,f]=le(""),b=null==i?void 0:i.messageId,y="Try again"===a,w=(null===(t=m().getState().application.enabledUiElements.toastConfig)||void 0===t?void 0:t.timeout)||2e3;ce((()=>{null!=(null==i?void 0:i.messageId)&&u!=i.messageId&&(h(i.messageId),i.text&&f(i.text),null!=p&&(clearTimeout(p),g(null)),xi(l,g).then((()=>(c(!0),xi(w+600,g)))).then((()=>(c(!1),xi(600,g)))).then((()=>{s&&(s(),f(""))})))}),[b]);const S=()=>{c(!1),o?o():f("")},C=e=>{const t=e.keyCode;13!==t&&32!==t||S()};return(0,ee.h)(Si,{id:"action-cards-sdk-toast-wrapper",class:"floating",feedOrientation:r},void 0!==i&&(0,ee.h)(wi,{id:"toast-body",theme:n,feedOrientation:r,hasRetry:y,onClick:y?void 0:S,onKeyUp:y?void 0:C,tabIndex:d&&!y?0:-1,class:d?"visible":"",role:d?"alert":void 0},(0,ee.h)(Ci,{theme:n,class:"toast-message"},v||""),y&&(0,ee.h)(ki,{theme:n,class:"toast-action",hasRetry:y,onClick:y?S:void 0,onKeyUp:y?C:void 0,tabIndex:d&&y?0:-1},a)))},Oi=e=>{let{fillColor:t}=e;return(0,ee.h)("svg",{width:"79",height:"53",viewBox:"0 0 79 53",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,ee.h)("path",{d:"M20.0172 47.9056C20.0172 49.5625 21.3604 50.9056 23.0172 50.9056H73.0172C74.6741 50.9056 76.0172 49.5625 76.0172 47.9056V17.9056C76.0172 16.2488 74.6741 14.9056 73.0172 14.9056V12.9056C75.7786 12.9056 78.0172 15.1442 78.0172 17.9056V47.9056C78.0172 50.667 75.7786 52.9056 73.0172 52.9056H23.0172C20.2558 52.9056 18.0172 50.667 18.0172 47.9056H20.0172Z",fill:t}),(0,ee.h)("path",{d:"M68.0172 9.90561H59.5V7.90561H68.0172C70.7786 7.90561 73.0172 10.1442 73.0172 12.9056V42.9056C73.0172 45.667 70.7786 47.9056 68.0172 47.9056H18.0172V45.9056H68.0172C69.6741 45.9056 71.0172 44.5625 71.0172 42.9056V12.9056C71.0172 11.2488 69.6741 9.90561 68.0172 9.90561Z",fill:t}),(0,ee.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M54.5117 2.83786L5.27133 11.5203C3.63965 11.808 2.55015 13.3639 2.83786 14.9956L8.0473 44.5399C8.33501 46.1715 9.89098 47.2611 11.5227 46.9733L60.7631 38.2909C62.3947 38.0032 63.4842 36.4472 63.1965 34.8156L57.9871 5.27133C57.6994 3.63965 56.1434 2.55015 54.5117 2.83786ZM4.92404 9.55065C2.20457 10.0302 0.388724 12.6235 0.86824 15.3429L6.07769 44.8872C6.5572 47.6066 9.15049 49.4225 11.87 48.943L61.1104 40.2605C63.8298 39.781 65.6457 37.1877 65.1662 34.4683L59.9567 4.92404C59.4772 2.20457 56.8839 0.388724 54.1644 0.86824L4.92404 9.55065Z",fill:t}),(0,ee.h)("path",{d:"M28.2341 24.1607C27.7817 23.8439 27.1582 23.9539 26.8414 24.4063C26.5246 24.8587 26.6346 25.4822 27.087 25.799L28.2341 24.1607ZM32.2944 28.2245L31.7208 29.0436C32.1732 29.3604 32.7967 29.2505 33.1135 28.7981L32.2944 28.2245ZM39.6028 19.5304C39.9196 19.078 39.8096 18.4545 39.3572 18.1377C38.9048 17.8209 38.2813 17.9309 37.9645 18.3833L39.6028 19.5304ZM27.087 25.799L31.7208 29.0436L32.8679 27.4053L28.2341 24.1607L27.087 25.799ZM33.1135 28.7981L39.6028 19.5304L37.9645 18.3833L31.4752 27.6509L33.1135 28.7981Z",fill:t}))},Ti=e=>{let{fillColor:t}=e;return(0,ee.h)("svg",{width:"42",height:"42",viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,ee.h)("path",{d:"M40 21C40 31.4934 31.4934 40 21 40V42C32.598 42 42 32.598 42 21H40ZM21 40C10.5066 40 2 31.4934 2 21H0C0 32.598 9.40202 42 21 42V40ZM2 21C2 10.5066 10.5066 2 21 2V0C9.40202 0 0 9.40202 0 21H2ZM21 2C31.4934 2 40 10.5066 40 21H42C42 9.40202 32.598 0 21 0V2Z",fill:t}),(0,ee.h)("path",{d:"M16.7071 20.2929C16.3166 19.9024 15.6834 19.9024 15.2929 20.2929C14.9024 20.6834 14.9024 21.3166 15.2929 21.7071L16.7071 20.2929ZM20 25L19.2929 25.7071C19.6834 26.0976 20.3166 26.0976 20.7071 25.7071L20 25ZM28.7071 17.7071C29.0976 17.3166 29.0976 16.6834 28.7071 16.2929C28.3166 15.9024 27.6834 15.9024 27.2929 16.2929L28.7071 17.7071ZM15.2929 21.7071L19.2929 25.7071L20.7071 24.2929L16.7071 20.2929L15.2929 21.7071ZM20.7071 25.7071L28.7071 17.7071L27.2929 16.2929L19.2929 24.2929L20.7071 25.7071Z",fill:t}))},Fi=Zt("div")((()=>({width:"100%",display:"flex",flexFlow:"column wrap",alignItems:"center",justifyContent:"center",minHeight:"250px"}))),Mi=Zt("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({padding:"20px 20px 0 20px",color:t.getCSSColor("text.listEmptyState")},t.getCSSFontProperties("listEmptyState")),{textAlign:"center",width:"100%"})})),ji=e=>{let{hasSeenTutorial:t,tutorialMessage:n,emptyMessage:r,theme:i}=e;return(0,ee.h)(Fi,null,t?(0,ee.h)(ee.Fragment,null,(0,ee.h)(Ti,{fillColor:i.getCSSColor("icon.listEmptyState")}),(0,ee.h)(Mi,{theme:i},r||"All caught up")):(0,ee.h)(ee.Fragment,null,(0,ee.h)(Oi,{fillColor:i.getCSSColor("icon.listEmptyState")}),(0,ee.h)(Mi,{theme:i},n||"Cards will appear here when there’s something to action.")))},Ai=e=>{let{title:t,textColor:n,buttonColor:r,theme:i,onRetry:a,tryAgainTitle:o}=e;return(0,ee.h)(ee.Fragment,null,(0,ee.h)(Ei,{textColor:n,theme:i},t),(0,ee.h)(_i,{textColor:r,theme:i,onClick:a},null!=o?o:"Try again"))},Di=Zt("div")((e=>{let{background:t,embedMode:n}=e;return{display:"flex",width:"100%",height:"launcher"===n?"350px":"100%",minHeight:"250px",alignItems:"center",justifyContent:"center",flexFlow:"column nowrap",background:t,font:`16px ${en}`}})),Ei=Zt("p")((e=>{let{textColor:t,theme:n}=e;return Object.assign(Object.assign({color:(null==n?void 0:n.getCSSColor("text.errorOverlayTitle"))||t},(null==n?void 0:n.getCSSFontProperties("errorOverlayTitle"))||{}),{textAlign:"center"})})),_i=Zt("button")((e=>{let{textColor:t,theme:n}=e;return Object.assign({color:(null==n?void 0:n.getCSSColor("text.errorOverlayAction"))||t,font:`16px ${en}`,background:"transparent",border:"0",outline:"none",fontWeight:"bold",cursor:"pointer"},(null==n?void 0:n.getCSSFontProperties("errorOverlayAction"))||{})})),Li=e=>{let{embedMode:t,state:n,onRetry:r,loadingIconColor:i,textColor:a,buttonColor:o,backgroundColor:s,theme:l,noInternetConnectionMessage:d,dataLoadFailedMessage:c,tryAgainTitle:u}=e;return"single-card"===t||"preview"===t||"modal-subview"===t?null:(0,ee.h)(Di,{background:s,className:"loading-wrapper",embedMode:t},!n&&(0,ee.h)(un,{stopColor:(null==l?void 0:l.getCSSColor("icon.loadingSpinner"))||i||"#000000",size:32}),"apiError"===n&&(0,ee.h)(Ai,{title:null!=c?c:"Couldn't load data",textColor:a,buttonColor:o,theme:l,onRetry:r,tryAgainTitle:u}),"noInternet"===n&&(0,ee.h)(Ai,{title:null!=d?d:"No internet connection",textColor:a,buttonColor:o,theme:l,onRetry:r,tryAgainTitle:u}))};let Pi;!function(e){e.DISMISSED="dismissed",e.DISMISS_FAILED="dismiss-failed",e.SUBMITTED="submitted",e.SUBMIT_FAILED="submit-failed",e.SNOOZED="snoozed",e.SNOOZE_FAILED="snooze-failed",e.VOTED_USEFUL="voted-useful",e.VOTED_NOT_USEFUL="voted-not-useful"}(Pi||(Pi={}));const Hi=(0,ee.createContext)({cardEventDispatcher:{dispatchCardEvent:e=>{}},analyticsDispatcher:{sendEvent:e=>{}},authTokenProvider:{requestToken:()=>Promise.resolve(void 0)},runtimeVariableResolver:void 0});var Ri=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const $i="action-cards-sdk-overflow-container",Ni=Zt("div")((e=>{let{theme:t,rendersBackground:n,embedMode:r}=e;return Object.assign({display:"flex",flexDirection:"column",height:"100%",backgroundColor:n?t.getCSSColor("background.default"):"transparent"},"modal-stream"===r?{width:"100%",height:"auto"}:{})})),Vi=Zt("div")((e=>{let{embedMode:t}=e;return{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",zIndex:As.FEED_OVERLAY,backgroundColor:"rgba(0, 0, 0, 0.4)",borderRadius:"launcher"===t?"20px":"0"}})),Wi=Zt("div")((e=>{let{embedMode:t}=e;return{width:"100%",position:"absolute",top:"0px",left:"0px",zIndex:As.CUSTOM_HEADER,overflow:"hidden",borderRadius:"launcher"===t?"20px 20px 0 0":"0"}})),zi=Zt("div")((e=>{let{scrollPosition:t,scrollbarWidth:n,headerOffset:r}=e;return{width:"100%",marginTop:`${r}px`,paddingRight:`${n}px`,transform:`translateY(-${t}px)`}})),Bi=Zt("div")((e=>{let{embedMode:t,feedOrientation:n,headerPadding:r,theme:i,isEmptyState:a,isLoadingState:o}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({padding:"single-card"===t?i.getPadding("stream")||"0px":i.getPadding("stream")||"10px"},r?{paddingTop:`${r+10}px`}:{}),{overflowX:"hidden",overflowY:"auto",maxHeight:"100%",height:"standalone"===t?"100%":"auto",position:"relative"}),"horizontal"===n?{padding:"0",overflowY:"auto"}:{}),a||o?{padding:"10px"}:{}),"modal-stream"===t?{padding:"0px"}:{})})),Ui=Zt("div")((e=>{let{embedMode:t,feedOrientation:n,horizontalOffset:r}=e;const i={position:"relative",bottom:r&&`${r}px`};return Object.assign({height:"standalone"===t?"100%":"350px",display:"flex",flexFlow:"row wrap",justifyItems:"center",alignItems:"center"},"horizontal"===n?i:{})})),qi={scrollTop:0,lastScrollTimeout:null,lastCardIds:[]},Yi=e=>{const t=e.messages.cardList,n=e.cardFeed.cardInstances,r=e.cardStates,{enabled:i,emptyStyle:a}=e.cardFeed.horizontalContainerConfig||{};return t&&1===n.length&&i&&"shrink"===a?0:t&&["submitted-subview"].includes(r[t.cardInstanceId]||"")?1100:800},Ki=t=>{let{theme:n,onRetry:r}=t;const i=he(null),a=he(null),o=he(null),s=he(null),l=he(null),[d,c]=le(0),[u,h]=le(0),p=ge(Hi),g=p.analyticsDispatcher,v=p.cardEventDispatcher,f=p.authTokenProvider;return ce((()=>(l.current=new IntersectionObserver(((e,t)=>{const n=xc();let r=[];e.forEach((e=>{if(e.isIntersecting){const t=e.target.id;n.add(t),qi.lastCardIds.includes(t)||r.push(t)}})),r.forEach((e=>{const t=m().getState().cardFeed.cardInstances.find((t=>t.instance.id===e)),n=null==t?void 0:t.metadata.payloadMetadata;g.sendEvent(Object.assign({cardInstanceId:e,cardViewState:"topview",eventName:nt},n?{properties:n}:{}))}));const i=JSON.stringify(Array.from(n));sessionStorage.setItem(F,i),qi.lastCardIds=r}),{root:null,rootMargin:"0px",threshold:0}),()=>{var e;null===(e=l.current)||void 0===e||e.disconnect()})),[]),(0,ee.h)(Se.lj,{actions:(0,e.Y2)(Ye,Ce,Vt)},(e=>{var t,p,m,b,y,w,S,C,k,x;const{embedMode:I,enabledUiElements:O,customStrings:T,open:F}=e.application,M="preview"===I,j="single-card"===I,A="single-card"!==I&&"modal-stream"!==I,D=("standalone"===I||"launcher"===I)&&e.cardFeed.displayingOverlay,E=e.cardFeed.horizontalContainerConfig,_=!("modal-stream"===I||j||"standalone"===I&&(null==E?void 0:E.enabled)&&"shrink"===(null==E?void 0:E.emptyStyle)),L=!e.application.isPreview&&!j&&"modal-stream"!==I&&!0===O.cardListToast&&!O.customToastContainer,P=kc(E),H=e.cardFeed.cardInstances.length,R="horizontal"===P&&O.cardListHeader&&"left"===(null==E?void 0:E.headerAlignment)&&(null!==(t=null===(p=a.current)||void 0===p||null===(m=p.base)||void 0===m?void 0:m.scrollHeight)&&void 0!==t?t:0)/2,$=()=>{if(s.current&&s.current.base&&l.current){var e;(null===(e=s.current)||void 0===e?void 0:e.base.childNodes).forEach((e=>{var t;null===(t=l.current)||void 0===t||t.observe(e)}))}};return ce((()=>{F&&$()}),[e.cardFeed.updateId]),ce((()=>{F&&(qi.lastCardIds=[],$(),g.sendEvent({cardViewState:"topview",eventName:st,properties:{displayMode:j?"single":"stream"}}))}),[F]),ce((()=>{var e,t;h(null==a||null===(e=a.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.scrollHeight)}),[a]),ce((()=>{const e=window.frameElement,t=n.getCSSColor("background.default");"standalone"===I&&(null==E?void 0:E.enabled)&&"shrink"===(null==E?void 0:E.emptyStyle)&&(e.style.backgroundColor=t);const r=()=>{"visible"===document.visibilityState&&F&&$()};return window.addEventListener("visibilitychange",r),()=>{window.removeEventListener("visibilitychange",r)}}),[]),ce((()=>{qi.lastCardIds=[];let e=e=>{let t=!1;t||(window.requestAnimationFrame((()=>{var n;const r=e.target;!1!==(null===(n=O.customContainerHeader)||void 0===n?void 0:n.scrollHeader)&&c(r.scrollTop),t=!1})),t=!0),qi.scrollTop=e.target.scrollTop};return i.current&&i.current.base&&(i.current.base.scrollTop=qi.scrollTop,i.current.base.addEventListener("scroll",e)),()=>{i.current&&i.current.base&&(qi.scrollTop=i.current.base.scrollTop,i.current.base.removeEventListener("scroll",e))}}),[]),(0,ee.h)(Ni,{theme:n,id:$i,rendersBackground:A,embedMode:I},D&&(0,ee.h)(Vi,{class:"use-offset",embedMode:I}),A&&O.cardListHeader&&(0,ee.h)(bi,{title:T.cardListTitle||"Cards",theme:n,feedOrientation:P,ref:a,alignment:null==E?void 0:E.headerAlignment}),O.customContainerHeader&&("standalone"===I||"launcher"===I)&&(0,ee.h)(Wi,{embedMode:I},(0,ee.h)(zi,{ref:o,headerOffset:u,scrollbarWidth:(null==i||null===(b=i.current)||void 0===b||null===(y=b.base)||void 0===y?void 0:y.offsetWidth)-(null==i||null===(w=i.current)||void 0===w||null===(S=w.base)||void 0===S?void 0:S.clientWidth),scrollPosition:d,dangerouslySetInnerHTML:{__html:null===(C=document.getElementById("custom-container-header"))||void 0===C?void 0:C.innerHTML}})),(0,ee.h)(Bi,{theme:n,embedMode:I,feedOrientation:P,headerPadding:null==o||null===(k=o.current)||void 0===k||null===(x=k.base)||void 0===x?void 0:x.scrollHeight,isEmptyState:0===H&&_,isLoadingState:!e.cardFeed.status.loaded,ref:i,cardCount:H,id:"action-cards-sdk-card-container",class:"card-container",role:"list"},!e.cardFeed.status.loaded&&"modal-stream"!==I&&(0,ee.h)(Li,{embedMode:I,state:e.cardFeed.status.errorState,backgroundColor:"transparent",theme:n,onRetry:r,noInternetConnectionMessage:T.noInternetConnectionMessage,dataLoadFailedMessage:T.dataLoadFailedMessage,tryAgainTitle:T.tryAgainTitle}),e.cardFeed.status.loaded&&H>0&&(0,ee.h)(hi,{cardInstances:e.cardFeed.cardInstances,theme:n,isPreview:M,onDismiss:t=>Ri(void 0,void 0,void 0,(function*(){dl(e,e,t,v,f,"overflow-menu")})),onSnooze:(t,n)=>{e.requestSnooze(t,"overflow-menu",n)},onFeedbackSelected:(t,n)=>{t.textFeedback||"negative"===t.sentiment?e.requestFeedback(n,t):"positive"===t.sentiment&&hl(n,e,g,v,t.source)},removeCard:t=>{e.removeCard(t)},cardStates:e.cardStates,margin:j?0:10,runtimeVariables:e.cardFeed.runtimeVariables,customStrings:T,votingOptions:e.cardFeed.cardVoting,horizontalContainerConfig:E,ref:s}),e.cardFeed.status.loaded&&0===H&&_&&(0,ee.h)(Ui,{embedMode:I,feedOrientation:P,horizontalOffset:R,class:"empty-state-wrapper"},(0,ee.h)(ji,{theme:n,hasSeenTutorial:e.cardFeed.tutorialSeen,tutorialMessage:T.awaitingFirstCard,emptyMessage:T.allCardsCompleted}))),L&&(0,ee.h)(Ii,{theme:n,feedOrientation:P,message:e.messages.cardList,delay:Yi(e),actionTitle:e.messages.cardList&&["submit-failed","dismiss-failed","snooze-failed"].includes(e.messages.cardList.action)?"Try again":"Dismiss",actionHandler:()=>Ri(void 0,void 0,void 0,(function*(){var t,n,r,i,a,o,s,l,d,c;const u=null===(t=e.messages.cardList)||void 0===t?void 0:t.cardInstanceId,h=null===(n=e.messages.cardList)||void 0===n?void 0:n.action;if(u&&h)switch(h){case"submit-failed":cl(e,e,u,!1,v,g,f,(null===(r=e.messages.cardList)||void 0===r?void 0:r.responseValues)||{},{payload:null===(i=e.messages.cardList)||void 0===i?void 0:i.payload,postSubmissionUrl:null===(a=e.messages.cardList)||void 0===a?void 0:a.postSubmissionUrl,subviewData:null===(o=e.messages.cardList)||void 0===o?void 0:o.subviewData,submitButtonName:null===(s=e.messages.cardList)||void 0===s?void 0:s.submitButtonName});break;case"dismiss-failed":const t=null===(l=e.messages.cardList)||void 0===l?void 0:l.source;t&&dl(e,e,u,v,f,t);break;case"snooze-failed":const n=null===(d=e.messages.cardList)||void 0===d?void 0:d.snoozeDate,h=null===(c=e.messages.cardList)||void 0===c?void 0:c.source;n&&h&&ul(e,e,u,n,v,f,h)}})),onDismiss:()=>{e.clearMessage("cardList")}}))}))},Zi=Zt("div")((e=>{let{yOffset:t}=e;return{position:"absolute",top:`${t}px`,left:"0",right:"0",zIndex:As.BANNER,overflow:"hidden"}})),Qi=Zt("div")((e=>{let{theme:t}=e;return{position:"absolute",top:"0",left:"0",right:"0",background:t.getCSSColor("background.banner"),padding:"12px",transform:"translateY(-100%)",transition:"transform 300ms ease-in-out",".visible":{transform:"translateY(0)",position:"initial"},".animating":{position:"initial"}}})),Gi=Zt("p")((e=>{let{theme:t}=e;return Object.assign(Object.assign({flexGrow:"1",margin:"0",color:t.getCSSColor("text.banner")},t.getCSSFontProperties("banner")),{textAlign:"center",overflow:"hidden"})})),Xi=e=>{let{theme:t,message:n,yOffset:r,onDismiss:i}=e;const[a,o]=le(null),[s,l]=le(null),[d,c]=le(!1);return ce((()=>{null!=n&&null!=n.text?(null!=s&&(clearTimeout(s),l(null)),null!=a&&(clearTimeout(a),o(null)),c(!0),l(setTimeout((()=>{c(!1),l(null),o(setTimeout((()=>{i&&i(),o(null)}),300))}),3300))):c(!1)}),[n]),(0,ee.h)(Zi,{theme:t,yOffset:r},(0,ee.h)(Qi,{theme:t,class:`${d?"visible":""} ${a?"animating":""}`},(0,ee.h)(Gi,{theme:t},n?n.text:"")))},Ji=Zt("div")((e=>{let{workflowTheme:t,feedTheme:n,embedMode:r,cardMaximumWidth:i}=e;return Object.assign({backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:"relative"},"modal-stream"===r?{height:"auto",width:"100%",maxWidth:i?`${i}px`:"initial",borderRadius:n.getShape("borderRadius.card")||"initial",border:`${n.getShape("border.card")||"0px"} solid ${n.getCSSColor("border.card")}`}:{})})),ea=Zt("div")((e=>{let{workflowTheme:t,feedTheme:n,embedMode:r,isPreview:i}=e;return Object.assign({background:t.getCSSColor("background.default"),position:"relative",bottom:i?"auto":"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"visible",padding:t.getPadding("stream")||"0px 20px 20px",boxSizing:"border-box",display:"flex",flex:"1"},"modal-stream"===r?{borderBottomLeftRadius:n.getShape("borderRadius.card")||"initial",borderBottomRightRadius:n.getShape("borderRadius.card")||"initial"}:{})})),ta=Zt("div")({paddingTop:"10px"}),na={scrollTop:0,subviewId:""},ra=t=>{let{workflowTheme:n,feedTheme:r}=t;const i=he(null),a=ge(Hi).analyticsDispatcher;return(0,ee.h)(Se.lj,{actions:(0,e.Y2)(Ce,Vt),mapToProps:e=>{const t=Me(e);return{containerInstanceId:e.application.containerInstanceId,cardStates:e.cardStates,cardMaximumWidth:e.cardFeed.cardMaximumWidth,customStrings:e.application.customStrings,subview:t&&je(t)?t:null,isPreview:e.application.isPreview||!1,embedMode:e.application.embedMode,runtimeVariables:e.cardFeed.runtimeVariables,bannerMessage:e.messages.subview}}},(e=>{if(null===e.subview)return null;const{cardInstance:t,subviewId:o}=e.subview;if(t&&o){const l=t.subviews[o],{id:d}=t.instance,c=e.cardStates[d],u="modal-subview"===e.embedMode?yi:bi;if(l){var s;let h=null===(s=e.runtimeVariables.values)||void 0===s?void 0:s.get(d);return h=h||new Map,ce((()=>{var e;const t=()=>{let e=!1;e||(window.requestAnimationFrame((()=>{var t;const n=null==i||null===(t=i.current)||void 0===t?void 0:t.base;n&&(na.scrollTop=n.scrollTop,na.subviewId=o),e=!1})),e=!0)};return(null==i||null===(e=i.current)||void 0===e?void 0:e.base)&&(i.current.base.scrollTop=na.subviewId===o?na.scrollTop:0,i.current.base.addEventListener("scroll",t)),()=>{var e;(null==i||null===(e=i.current)||void 0===e?void 0:e.base)&&(i.current.base.scrollTop=na.subviewId===o?na.scrollTop:0,i.current.base.removeEventListener("scroll",t))}}),[]),ce((()=>{a.sendEvent({cardInstanceId:d,cardViewState:"subview",eventName:ct,properties:{subviewId:o,subviewTitle:vc(l.title,h),subviewLevel:1}})}),[o]),l.nodes=hc(l.nodes),(0,ee.h)(ee.Fragment,null,(0,ee.h)(Ji,{workflowTheme:n,feedTheme:r,embedMode:e.embedMode,id:$i,cardMaximumWidth:e.cardMaximumWidth},(0,ee.h)(el,{viewState:"subview",onCancelUpload:()=>{window.AtomicUploadService.cancelUploadForCard(e.containerInstanceId,d),zt().finishCardFileUpload(d),!window.AtomicUploadService.getIsUploadingStatus(e.containerInstanceId)&&zt().setCardFeedOverlay(!1)},theme:n,renderOverlay:"uploading-files"===c,cardMaximumWidth:e.cardMaximumWidth}),(0,ee.h)(u,{title:vc(l.title,h),theme:n,cardBorderRadius:r.getShape("borderRadius.card"),actionHandler:()=>{e.navigateBack(),a.sendEvent({cardInstanceId:d,cardViewState:"subview",eventName:ut,properties:{subviewId:o,subviewTitle:vc(l.title,h),subviewLevel:1}})},inert:"uploading-files"===c}),(0,ee.h)(ea,{workflowTheme:n,feedTheme:r,embedMode:e.embedMode,ref:i,isPreview:e.isPreview,class:"use-offset",id:"action-cards-subview-container",inert:"uploading-files"===c,cardMaximumWidth:e.cardMaximumWidth},(0,ee.h)(ta,{class:"offset-child"},l.nodes.map((r=>{var i;const a=l.nodes.find((e=>"form"===e.type)),s=null==a||null===(i=a.children)||void 0===i?void 0:i.find((e=>"actionButtonGroup"===e.type));return(0,ee.h)(ac,{cardInstanceId:d,cardMetadata:t.metadata,node:r,cardContext:{nodeCount:(null==a?void 0:a.children)?a.children.length:0,hasButtonFinalNode:void 0!==s,hasButtons:void 0!==(null==s?void 0:s.children)&&s.children.length>0},isWorkflow:!0,theme:n,runtimeVariables:h,subviewId:o,subviewTitle:vc(l.title,h),embedMode:e.embedMode})}))))),!e.isPreview&&(0,ee.h)(Xi,{theme:n,message:e.bannerMessage,yOffset:60,onDismiss:()=>{e.clearMessage("subview")}}))}}return null}))},ia=e=>{let{fillColor:t,ariaHidden:n=!1}=e;return(0,ee.h)("svg",{width:"19",height:"12",viewBox:"0 0 19 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"A blank video icon","aria-hidden":n},(0,ee.h)("path",{d:"M12 1H2C1.44772 1 1 1.44772 1 2V10C1 10.5523 1.44772 11 2 11H12C12.5523 11 13 10.5523 13 10V2C13 1.44772 12.5523 1 12 1Z",stroke:t,strokeWidth:"2"}),(0,ee.h)("path",{d:"M17.1464 1.85355L13.3536 5.64645C13.1583 5.84171 13.1583 6.15829 13.3536 6.35355L17.1464 10.1464C17.4614 10.4614 18 10.2383 18 9.79289V2.20711C18 1.76165 17.4614 1.53857 17.1464 1.85355Z",stroke:t,strokeWidth:"2"}))};class aa extends ee.Component{constructor(e){super(e),this.state={imageLoaded:!1,imageLoadFailed:!1}}preloadsImage(){return!0}onImageLoad(e){this.setState((t=>Object.assign(Object.assign({},t),{loadedDimensions:{width:e.naturalWidth,height:e.naturalHeight}})))}preloadImage(){if(this.preloadsImage()){const e=new Image;e.src=this.props.src,e.onload=()=>{this.setState({imageLoaded:!0}),this.onImageLoad(e)},e.onerror=()=>{this.setState({imageLoadFailed:!0})}}}getPreviewIcon(e){switch(e){case"image":case"imageWithoutSrc":return mn;case"video":case"videoWithoutSrc":return ia;default:return null}}getElementRole(e){switch(e){case"image":case"video":return"button";case"imageWithoutSrc":case"videoWithoutSrc":return"img"}}componentDidMount(){this.props.src&&this.preloadImage()}componentDidUpdate(e){this.props.src&&this.props.src!==e.src&&this.preloadImage()}handleKeyPress(e){e.charCode===Hr&&this.props.onClickImage&&(this.props.onClickImage(),e.preventDefault())}}const oa=Zt("div")((e=>{let{workflowTheme:t,feedTheme:n,embedMode:r,cardMaximumWidth:i}=e;return Object.assign({backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column"},"modal-stream"===r?{height:"auto",width:"100%",maxWidth:i?`${i}px`:"initial",borderRadius:n.getShape("borderRadius.card")||"initial",border:`${n.getShape("border.card")||"0px"} solid ${n.getCSSColor("border.card")}`}:{})})),sa=Zt("div")({width:"100%",height:"100%",maxWidth:"100%",minHeight:"420px",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),la=Zt("div")((e=>{let{autoSizes:t}=e;return{overflow:"auto",flexGrow:t?"0":"1",height:t?"auto":"100%",display:"flex",flexDirection:"column",width:"100%"}})),da=Zt("div")((e=>{let{imageLoaded:t,theme:n}=e;return{width:"100%",height:"100%",backgroundColor:t?"":n.getCSSColor("background.media"),display:"flex",alignItems:"center",justifyContent:"center",flexGrow:"1"}})),ca=Zt("video")({maxWidth:"100%"}),ua=Zt("img")({maxWidth:"100%",flexShrink:"0"});class ha extends aa{render(){const{theme:e,src:t,label:n,alt:r}=this.props,{imageLoaded:i}=this.state;return(0,ee.h)(ee.Fragment,null,!i&&(0,ee.h)(da,{imageLoaded:i,theme:e},(0,ee.h)(mn,{fillColor:e.getCSSColor("icon.mediaBanner"),ariaHidden:!0})),i&&(0,ee.h)(ua,{src:t,alt:r||n}))}}const pa=e=>{var t,n;let{src:r,alt:i,cardInstanceId:a}=e;const o=he(null),s=ge(Hi).analyticsDispatcher,l="string"==typeof r&&null!==(t=null===(n=r.match(/[^\/]*$/))||void 0===n?void 0:n[0])&&void 0!==t?t:"";return ce((()=>{var e,t,n,i;const d=()=>{s.sendEvent({eventName:pt,cardInstanceId:a,cardViewState:"subview",properties:{media:l,mediaURL:r}})},c=()=>{s.sendEvent({eventName:mt,cardInstanceId:a,cardViewState:"subview",properties:{media:l,mediaURL:r}})};return null===(e=o.current)||void 0===e||null===(t=e.base)||void 0===t||t.addEventListener("play",d),null===(n=o.current)||void 0===n||null===(i=n.base)||void 0===i||i.addEventListener("ended",c),()=>{var e,t,n,r;null===(e=o.current)||void 0===e||null===(t=e.removeEventListener)||void 0===t||t.call(e,"play",d),null===(n=o.current)||void 0===n||null===(r=n.removeEventListener)||void 0===r||r.call(n,"ended",c)}}),[]),(0,ee.h)(ca,{ref:o,src:r,alt:i||"video",autoplay:!0,controls:!0})},ma=e=>{let{workflowTheme:t,feedTheme:n}=e;return(0,ee.h)(Se.lj,{actions:Ce,mapToProps:e=>{const t=Me(e);return{embedMode:e.application.embedMode,cardMaximumWidth:e.cardFeed.cardMaximumWidth,cardInstanceId:null==t?void 0:t.cardInstanceId,currentMediaItem:t&&Ee(t)?t.item:void 0}}},(e=>{const r=e.currentMediaItem;if(!r)return null;const i="modal-subview"===e.embedMode?yi:bi,a="launcher"===e.embedMode;return(0,ee.h)(oa,{workflowTheme:t,feedTheme:n,embedMode:e.embedMode,cardMaximumWidth:e.cardMaximumWidth,id:$i},(0,ee.h)(i,{title:`View ${r.type}`,theme:t,cardBorderRadius:n.getShape("borderRadius.card"),actionHandler:e.navigateBack}),(0,ee.h)(la,{autoSizes:a},(0,ee.h)(sa,null,"image"==r.type&&(0,ee.h)(ha,{mediaType:r.type,src:r.url,label:r.title,alt:r.alt,theme:t,isFirstCardNode:!1,isFinalCardNode:!1}),"video"==r.type&&(0,ee.h)(pa,{src:r.url,alt:r.alt,cardInstanceId:e.cardInstanceId}))))}))};var ga=n(6083),va=n.n(ga),fa=n(9331),ba=n.n(fa),ya=n(5932),wa=n.n(ya),Sa=n(4844),Ca=n.n(Sa),ka=n(4801),xa=n.n(ka),Ia=n(7754),Oa=n.n(Ia),Ta=n(6254),Fa=n.n(Ta),Ma=n(5886),ja=n.n(Ma);const Aa=e=>{let{fillColor:t}=e;return(0,ee.h)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,ee.h)("path",{d:"M1 1L5.96464 5.96464C5.98417 5.98417 5.98417 6.01583 5.96464 6.03536L1 11",stroke:t,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},Da=e=>{let{fillColor:t}=e;return(0,ee.h)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,ee.h)("path",{d:"M6.16235 11L1.16235 6L6.16235 1",stroke:t,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},Ea=Zt("button")((e=>{let{theme:t}=e;return Object.assign({height:"100%",width:"30px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",justifySelf:"center",border:"none",backgroundColor:"transparent"},t.getElementFocusCSSProperties())})),_a=Zt("div")((e=>{var t;let{theme:n}=e;return{"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none",display:"grid",gridTemplate:"auto / 42px 1fr 42px",alignItems:"center",margin:"0 auto",width:"100%",color:null!==(t=n.getCSSColor("text.datePickerCalendarMonthYear",{skipFallback:!0}))&&void 0!==t?t:"black","> h1":{textAlign:"center",textTransform:"none",lineHeight:"30px",margin:"0 0 10px",gridColumn:"2"},"> input":{display:"block",fontSize:"small",fontWeight:"bold",textAlign:"center",lineHeight:"15px",height:"18px",width:"60px",margin:"0 auto",backgroundColor:"transparent",fontFamily:"inherit",border:"1px solid lightgray",paddingLeft:"11px"},"> div:first-of-type":{gridColumn:"1"},"> div:last-of-type":{gridColumn:"3"}}})),La=Zt("span")({fontSize:"15px"}),Pa=Zt("span")({fontSize:"15px",fontWeight:"normal"}),Ha=e=>{var t,n;let{theme:r,month:i,year:a="",onBack:o,onForward:s,locale:l}=e;return(0,ee.h)(_a,{theme:r},(0,ee.h)(Ea,{theme:r,onClick:o,"aria-label":"previous month"},(0,ee.h)(Da,{fillColor:null!==(t=r.getCSSColor("background.datePickerCalendarMonthNavArrows",{skipFallback:!0}))&&void 0!==t?t:"rgba(0,0,0,0.5)"})),(0,ee.h)("h1",{className:"MonthDisplay","aria-live":"assertive"},(0,ee.h)(La,null,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US";return window.months=window.months||[...Array(12)].map(((t,n)=>new Date(2017,n,1).toLocaleDateString(e,{month:"long"}))),window.months}(l)[i-1]+" "),(0,ee.h)(Pa,null,a)),(0,ee.h)(Ea,{theme:r,onClick:s,"aria-label":"next month"},(0,ee.h)(Aa,{fillColor:null!==(n=r.getCSSColor("background.datePickerCalendarMonthNavArrows",{skipFallback:!0}))&&void 0!==n?n:"rgba(0,0,0,0.5)"})))};var Ra=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const $a=Zt("button")((e=>{var t,n,r,i,a,o,s;let{isDisabled:l,isSelected:d,isToday:c,isFocused:u,theme:h}=e,p=null!==(t=h.getCSSColor("text.datePickerCalendarDateItem",{skipFallback:!0}))&&void 0!==t?t:"rgba(0, 0, 0, 1)",m=h.getCSSColor("text.datePickerCalendarHoverDateItem",{skipFallback:!0}),g="transparent",v=null!==(n=h.getCSSColor("background.datePickerCalendarHoverDateItem",{skipFallback:!0}))&&void 0!==n?n:"rgba(0, 0, 0, 0.05)";const f="#1E6EFA";c&&!d?p=null!==(r=h.getCSSColor("text.datePickerCalendarCurrentDate",{skipFallback:!0}))&&void 0!==r?r:f:d?(p=null!==(i=h.getCSSColor("text.datePickerCalendarSelectedDateItem",{skipFallback:!0}))&&void 0!==i?i:"white",g=null!==(a=h.getCSSColor("background.datePickerCalendarSelectedDateItem",{skipFallback:!0}))&&void 0!==a?a:f,v=g):u?g="rgba(0, 0, 0, 0.05)":l&&(p="rgba(0, 0, 0, 0.2)",v="transparent");const b=null!==(o=h.getShape("borderRadius.datePickerCalendarDateItem",{skipFallback:!0}))&&void 0!==o?o:"99px";return{userSelect:"none",display:"flex",justifySelf:"center",alignItems:"center",justifyContent:"center",fontFamily:"inherit",fontSize:"small",lineHeight:"15px",margin:"0",position:"relative",width:"string"==typeof b&&(null===(s=b.match(new RegExp(/([1-9])+/g)))||void 0===s?void 0:s.length)?"40px":"100%",height:"40px",outline:"none",border:"2px solid transparent",cursor:l?"initial":"pointer",backgroundColor:g,borderRadius:b,":hover":Object.assign(Object.assign({},m?{color:m}:{}),{backgroundColor:v}),color:p}})),Na=e=>{let{theme:t,date:n,dateLabel:r,style:i,col:a,onSelect:o,onHover:s,onFocus:l}=e,d=Ra(e,["theme","date","dateLabel","style","col","onSelect","onHover","onFocus"]);const c=he(null);return(0,ee.h)($a,{"data-testid":"calendar-day-button",ref:c,title:r,"aria-label":r,"aria-selected":d.isSelected?"true":"false","aria-disabled":d.isDisabled?"true":"false","aria-colindex":a,role:"gridcell",key:n,style:i,class:`CalendarDay ${Pe(d)}`,isToday:ja()(n),isDisabled:d.isDisabled,isSelected:d.isSelected,isFocused:d.isFocused,theme:t,tabIndex:"-1",onMouseDown:e=>{e.stopPropagation(),d.isDisabled||(c.current&&document.activeElement!==c.current&&c.current.base.focus(),o(n))},onMouseEnter:()=>{d.isDisabled||s(n)},onMouseLeave:()=>{d.isDisabled||s(null)},onFocus:()=>{d.isDisabled||l(n)}},n.getDate())},Va=Zt("div")((e=>{var t;let{theme:n}=e;return{cursor:"default",borderWidth:"1px",backgroundColor:null!==(t=n.getCSSColor("background.datePickerCalendar",{skipFallback:!0}))&&void 0!==t?t:"white",width:"100%",margin:"0",padding:"10px",borderRadius:"5px",boxSizing:"border-box","> div:focus":{outline:"none"},"> .focus-visible":{outline:"none",boxShadow:`0 0 0 2px ${n.getCSSColor("border.focus")} inset`}}})),Wa=Zt("div")({padding:"5px"}),za=Zt("div")({}),Ba=Zt("div")({display:"grid",gridTemplate:"auto / repeat(7, 1fr)"}),Ua=Zt("div")((e=>{var t;let{theme:n}=e;return{userSelect:"none",textAlign:"center",textTransform:"none",color:null!==(t=n.getCSSColor("text.datePickerCalendarDaysSubHeading",{skipFallback:!0}))&&void 0!==t?t:"rgba(0,0,0,0.5)",fontSize:"13px"}})),qa=Zt("div")({display:"grid",gridTemplate:"auto / repeat(7, 1fr)","-ms-grid-rows":"auto","-ms-grid-columns":"(1fr)[7]",marginBottom:"5px"}),Ya=e=>{const{month:t,year:n,isDateHovered:r,isDateFocused:i,isDateSelected:a,isDateInRange:o,isDateEnabled:s,onDateFocused:l,onDateHovered:d,onDateSelected:c,onChangeMonth:u,onChangeYear:h,calendarRef:p,disabled:m,locale:g,theme:v}=e,f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US";return window.days=window.days||[...Array(7)].map(((t,n)=>{const r=n+1;return{dayName:new Date(Date.UTC(2017,0,n+2)).toLocaleDateString(e,{weekday:"long"}),col:r,style:{gridColumnStart:r}}})),window.days}(g),b=He(t,n||0),y=e=>{let{date:t,style:n,col:u}=e;return(0,ee.h)(Na,{key:t,theme:v,date:t,col:u,dateLabel:Ne()(t,"dddd, MMMM D, YYYY"),style:n,isToday:ja()(t),isHovered:r(t),isFocused:i(t),isSelected:a(t),isInRange:o(t),isDisabled:m||!s(t),onSelect:c,onHover:d,onFocus:l})};return(0,ee.h)(Va,{theme:v},(0,ee.h)(Ha,{theme:v,month:t,year:n,onBack:u(-1),onForward:u(1),onChangeYear:h,locale:g,disabled:m}),(0,ee.h)(Wa,{className:"Calendar",role:"grid",ref:p,tabIndex:0,"aria-colcount":7,"aria-rowcount":6,"aria-label":"Calendar picker"},(0,ee.h)(qa,{role:"row"},f.map((e=>{let{dayName:t,style:n,col:r}=e;return(0,ee.h)(Ua,{key:t,theme:v,style:n,role:"columnheader","aria-colindex":r,"aria-label":t},(0,ee.h)("abbr",null,t.slice(0,1)))}))),(0,ee.h)(za,{role:"rowgroup"},(0,ee.h)(Ba,{role:"row","aria-rowIndex":1},b.week1.map(y)),(0,ee.h)(Ba,{role:"row","aria-rowIndex":2},b.week2.map(y)),(0,ee.h)(Ba,{role:"row","aria-rowIndex":3},b.week3.map(y)),(0,ee.h)(Ba,{role:"row","aria-rowIndex":4},b.week4.map(y)),(0,ee.h)(Ba,{role:"row","aria-rowIndex":5},b.week5.map(y)),(0,ee.h)(Ba,{role:"row","aria-rowIndex":6},b.week6.map(y)))))};function Ka(){return Ka=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ka.apply(this,arguments)}const Za="DatePicker",Qa="DateRangePicker";class Ga extends ee.Component{constructor(e){var t,n,r;super(e),r=void 0,(n="calendar")in(t=this)?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r;const i=e.date||new Date,a=i.getMonth()+1,o=i.getFullYear();this.state={month:a,year:o,focused:i,hovered:new Date},this.calendar=(0,ee.createRef)(),this.handleKeyPress=this.handleKeyPress.bind(this),this.onDateHovered=this.onDateHovered.bind(this),this.onDateSelected=this.onDateSelected.bind(this),this.onDateFocused=this.onDateFocused.bind(this),this.isDateHovered=this.isDateHovered.bind(this),this.isDateFocused=this.isDateFocused.bind(this),this.isDateSelected=this.isDateSelected.bind(this),this.isDateInRange=this.isDateInRange.bind(this),this.isDateEnabled=this.isDateEnabled.bind(this),this.onChangeMonth=this.onChangeMonth.bind(this),this.onChangeYear=this.onChangeYear.bind(this)}componentDidMount(){window.addEventListener("keydown",this.handleKeyPress)}componentWillUnmount(){window.removeEventListener("keydown",this.handleKeyPress)}handleKeyPress(e){var t,n;if(!(null===(n=this.calendar)||void 0===n?void 0:n.current.base.contains(document.activeElement)))return;if(e.key===Jr)return void(this.props.onCancel&&this.props.onCancel());e.preventDefault();const{shiftKey:r,key:i}=e,a=i===Kr,o=i===Qr,s=i===Gr,l=i===Xr,d=i===qr,c=i===Br,u=i===Yr,h=i===Ur,p=i===Zr,m=null!==(t=this.props.isDateEnabled)&&void 0!==t?t:function(){return!0};let{focused:g}=this.state;if(a)m(g)&&this.onDateSelected(g);else if(r&&s){const e=va()(g,-1);m(e)&&this.onDateFocused(e)}else if(r&&l){const e=va()(g,1);m(e)&&this.onDateFocused(e)}else if(s){const e=ba()(g,-1);m(e)&&this.onDateFocused(e)}else if(l){const e=ba()(g,1);m(e)&&this.onDateFocused(e)}else if(c){const e=wa()(g,-1);m(e)&&this.onDateFocused(e)}else if(h){const e=wa()(g,1);m(e)&&this.onDateFocused(e)}else if(d){const e=Ca()(g,-1);m(e)&&this.onDateFocused(e)}else if(u){const e=Ca()(g,1);m(e)&&this.onDateFocused(e)}else p?this.onDateSelected(g):o&&this.props.onCancel&&this.props.onCancel()}onChangeYear(e){e.preventDefault(),this.setState({year:parseInt(e.target.value)||void 0})}onChangeMonth(e){let{month:t,year:n=0}=this.state,r=t+e,i=n;return r<1&&(r=12+r,i-=1),r>12&&(r-=12,i+=1),()=>{this.setState({month:r,year:i})}}onDateSelected(e){const{type:t,onDateSelected:n,onStartDateSelected:r,onEndDateSelected:i}=this.props;if(t===Za)n&&n(e);else if(t===Qa){const t=!this.props.startDate,n=this.props.startDate&&this.props.endDate,a=this.props.startDate&&this.props.startDate>e;t||n||a?(r&&r(e),i&&i(null)):i&&i(e)}}onDateHovered(e){const{onDateHovered:t}=this.props;e&&this.state.hovered&&this.state.hovered.getDate()!==e.getDate()&&this.setState({hovered:e},(()=>{t&&t(e)}))}onDateFocused(e){const{onDateFocused:t}=this.props,n=e.getMonth()+1,r=e.getFullYear();this.state.focused&&this.state.focused!==e&&this.setState({focused:e,month:n,year:r},(()=>{t&&t(e)}))}isDateEnabled(e){var t;return(null!==(t=this.props.isDateEnabled)&&void 0!==t?t:function(){return!0})(e)}isDateFocused(e){return xa()(e,this.state.focused)}isDateHovered(e){return xa()(e,this.state.hovered)}isDateSelected(e){return(this.props.type===Za?[this.props.date]:[this.props.startDate,this.props.endDate]).some((t=>!!t&&xa()(t,e)))}isDateInRange(e){if(this.props.type===Za)return!1;const{startDate:t,endDate:n}=this.props,{focused:r,hovered:i}=this.state,a=n||(t&&r&&!xa()(t,r)?r:i);return!(!t||!a||Oa()(a,t))&&Fa()(e,t,a)}componentWillReceiveProps(e){var t;e&&e.open!==this.props.open&&!0===e.open&&((null===(t=this.calendar)||void 0===t?void 0:t.current)&&this.calendar.current.base.focus())}render(){return(0,ee.h)(Ya,{calendarRef:this.calendar,month:this.state.month,year:this.state.year,isDateHovered:this.isDateHovered,isDateFocused:this.isDateFocused,isDateSelected:this.isDateSelected,isDateInRange:this.isDateInRange,isDateEnabled:this.isDateEnabled,onDateSelected:this.onDateSelected,onDateHovered:this.onDateHovered,onDateFocused:this.onDateFocused,onChangeMonth:this.onChangeMonth,onChangeYear:this.onChangeYear,locale:this.props.locale||"en-US",disabled:this.props.disabled||!1,theme:this.props.theme})}}const Xa=e=>(0,ee.h)(Ga,Ka({type:Za},e));function Ja(){return Ja=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ja.apply(this,arguments)}const eo=Zt("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`}})),to=Zt("div")((e=>{let{theme:t,mode:n,cursor:r,hPadding:i}=e;return Object.assign(Object.assign({minHeight:"stacked"===n?"70px":"50px",borderRadius:"4px",border:`1px solid ${t.getCSSColor("border.component")}`},t.getElementFocusCSSProperties()),{backgroundColor:t.getCSSColor("background.component"),display:"flex",justifyContent:"space-between",alignItems:"center",overflow:"hidden",minWidth:"0",padding:`10px ${void 0!==i?i:20}px`,flexGrow:"1",cursor:r||"pointer"})})),no=e=>{let{nodeKey:t,children:n,mode:r,cursor:i,ref:a,theme:o,isFirstCardNode:s,isFinalCardNode:l,onClick:d,tabFocusable:c,innerRef:u,hPadding:h,accessibleAttributes:p}=e;const m=c?e=>{e.charCode===Hr&&d&&(e.preventDefault(),d())}:void 0;return(0,ee.h)(eo,{ref:a,isFirstCardNode:s,isFinalCardNode:l,theme:o},(0,ee.h)(to,Ja({key:t,"data-element-key":t,mode:r,theme:o,cursor:i,class:"component-field-wrapper",onClick:d,onKeyPress:m,tabIndex:c?0:void 0,ref:u,hPadding:h},p),n))},ro=Zt("div")((e=>{let{thumbnailUrl:t,theme:n}=e;return{backgroundColor:n.getCSSColor("background.media"),borderRadius:n.getShape("borderRadius.media")||"initial",width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",marginRight:"10px",backgroundImage:`url('${t}')`,backgroundSize:"cover",backgroundPosition:"center",alignSelf:"start"}})),io=e=>{let{thumbnailUrl:t,theme:n}=e;return(0,ee.h)(ro,{thumbnailUrl:t,theme:n})},ao=Zt("div")((e=>{let{theme:t,mode:n,truncateLabel:r,inputHasValue:i}=e;return Object.assign(Object.assign(Object.assign({},t.getCSSFontProperties("stacked"===n?"pinned":"primary")),{flexGrow:"1",whiteSpace:"pre-wrap",color:"stacked"===n?t.getCSSColor("text.pinned"):t.getCSSColor("text.primary"),paddingBottom:"stacked"===n?"2px":"0px"}),"inline"===n&&r?{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",minWidth:"0",flex:"0 1 auto",flexShrink:i?"2":"1",paddingBottom:"0.1em",marginBottom:"-0.1em"}:{})})),oo=e=>{let{theme:t,children:n,mode:r,name:i,truncateLabel:a,inputHasValue:o}=e;return(0,ee.h)(ao,{theme:t,mode:r,id:i,"aria-hidden":!n,truncateLabel:a,inputHasValue:o},n)},so=e=>{let{fillColor:t,ariaHidden:n,styles:r}=e;return(0,ee.h)("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":n,style:r},(0,ee.h)("path",{d:"M1 1L6 6L11 1",stroke:t,"stroke-opacity":"1","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},lo=Zt("div")((e=>{let{theme:t,requiresTopSpacing:n}=e;const r=t.getShape("padding.elementBottom",{skipFallback:!0}),i=r?Number(r.replace("px","")):10;return Object.assign(Object.assign({color:t.getCSSColor("text.error")},t.getCSSFontProperties("error")),{marginTop:`${n?"":"-"}${.5*Math.floor(i)}px`,marginRight:"0px",marginBottom:`${i}px`,marginLeft:"0px"})})),co=e=>{let{theme:t,isFinalCardNode:n,cardInstanceId:r,subviewId:i,name:a,variableResolver:o}=e;return(0,ee.h)(Se.lj,{mapToProps:e=>{let{validationStates:t}=e;return{validationStates:t}}},(e=>{let{validationStates:s}=e;const l=s[r]||{};let d;var c,u,h;i?d=null===(c=l.subviews)||void 0===c||null===(u=c[i])||void 0===u?void 0:u[a]:d=null===(h=l.validations)||void 0===h?void 0:h[a];return d&&d.errorMessage?(0,ee.h)(lo,{theme:t,requiresTopSpacing:n,role:"alert","data-testid":"validation"},o(d.errorMessage)):null}))},uo=e=>{let{fillColor:t,style:n,ariaHidden:r}=e;return(0,ee.h)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",height:"8",viewBox:"0 0 11 8",width:"11",style:n,"aria-hidden":r},(0,ee.h)("path",{"clip-rule":"evenodd",d:"m10.7071.292893c.3905.390524.3905 1.023687 0 1.414217l-5.99999 6c-.39053.39052-1.02369.39052-1.41422 0l-2.999997-3c-.3905241-.39053-.3905241-1.02369 0-1.41422.390524-.39052 1.023687-.39052 1.414217 0l2.29289 2.2929 5.29289-5.292897c.39053-.3905241 1.02371-.3905241 1.41421 0z",fill:null!=t?t:"#000","fill-rule":"evenodd"}))},ho=Zt("div")((e=>{let{theme:t,mode:n}=e;return Object.assign(Object.assign(Object.assign({},t.getCSSFontProperties("stacked"===n?"pinned":"primary")),{display:"block",cursor:"pointer"}),"inline"===n?{display:"flex",gap:"5px",flex:"1 1 auto",minWidth:"0"}:{})})),po=Zt("div")((()=>({flex:"0 0 auto",alignItems:"center"}))),mo=Zt("div")((()=>({"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none"}))),go=Zt("div")((e=>{var t,n,r,i,a;let{open:o,openPosition:s,height:l,theme:d}=e;return Object.assign(Object.assign({position:"absolute",top:`${s}px`,left:o?"0px":"-999px",width:"100%",backgroundColor:d.getCSSColor("background.dropdownMenu"),boxShadow:`${null!==(t=d.getShape("offset.dropdownMenuShadow",{skipFallback:!0}))&&void 0!==t?t:"2px"} ${null!==(n=d.getShape("offset.dropdownMenuShadow",{skipFallback:!0}))&&void 0!==n?n:"2px"} ${null!==(r=d.getShape("blur.dropdownMenuShadow",{skipFallback:!0}))&&void 0!==r?r:"10px"} ${null!==(i=d.getCSSColor("shadow.dropdownMenu",{skipFallback:!0}))&&void 0!==i?i:"rgba(0,0,0,0.2)"}`,cursor:"pointer",height:`${l}px`,maxHeight:"335px",overflow:"auto",zIndex:As.DROPDOWN,borderRadius:null!==(a=d.getShape("borderRadius.dropdownMenu",{skipFallback:!0}))&&void 0!==a?a:"5px",color:"black"},d.getCSSFontProperties("primary")),{visibility:o?"visible":"hidden"})})),vo=Zt("div")((e=>{var t,n;let{theme:r,disabled:i}=e;return Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"5px",padding:"20px",":hover":{backgroundColor:null!==(t=r.getCSSColor("background.dropdownMenuItem",{skipFallback:!0}))&&void 0!==t?t:"rgba(0,0,0,0.05)"},":active":{backgroundColor:null!==(n=r.getCSSColor("background.dropdownMenuItem",{skipFallback:!0}))&&void 0!==n?n:"rgba(0,0,0,0.1)"},border:"0px",color:i?"rgba(0,0,0,0.3)":r.getCSSColor("text.dropdownMenuItem")},r.getCSSFontProperties("dropdownMenuItem")),r.getElementFocusCSSProperties())})),fo=Zt("div")((e=>{let{theme:t,placeholder:n,mode:r}=e;return Object.assign(Object.assign(Object.assign({},t.getCSSFontProperties("stacked"===r?"primary":"secondary")),{marginRight:"10px",color:"stacked"===r?t.getCSSColor("text.primary"):t.getCSSColor("text.secondary"),paddingTop:"stacked"===r?"2px":"0px"}),"inline"===r?{maxWidth:"100%",minWidth:"0",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",flex:n?"1 1 0":"1 0 auto",textAlign:"right",paddingBottom:"0.1em",marginBottom:"-0.1em"}:{})})),bo=e=>{let{onClick:t,children:n,ref:r,theme:i,disabled:a,isSelected:o}=e;return(0,ee.h)(vo,{onClick:t,ref:r,tabIndex:"-1",theme:i,disabled:a,"aria-disabled":a,"aria-selected":o,role:"option"},n)},yo=e=>{let{children:t,mode:n,theme:r,ariaLabel:i,placeholder:a}=e;return(0,ee.h)(fo,{theme:r,mode:n,class:"dropdown-selected-value",placeholder:a,"aria-label":i},t)},wo=(e,t,n,r)=>{var i,a,o,s,l,d;let c=0,u=0,h=0,p=0,m=null;const g=null===(s=window.frameElement)||void 0===s?void 0:s.parentElement,v=document.querySelector("#action-cards-sdk-card-container"),f=(null==g?void 0:g.scrollHeight)!==(null==g?void 0:g.clientHeight),b=(null==v?void 0:v.scrollHeight)!==(null==v?void 0:v.clientHeight);if("launcher"!==r&&g&&f&&!b)m=g;else if(n){m=document.querySelector("#action-cards-subview-container")}else null!==v&&(m=v);if(null!==window.frameElement){var y,w;const e=t.getBoundingClientRect(),n=null===(y=m)||void 0===y?void 0:y.getBoundingClientRect();c=e.top-(n?null==n?void 0:n.top:0),u=e.bottom-(n?null==n?void 0:n.top:0),h=null!==(i=null===(w=m)||void 0===w?void 0:w.scrollHeight)&&void 0!==i?i:window.innerHeight}else{const e=document.querySelector("#workbench-card-preview");if(e){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();p=e.scrollTop,c=r.top-n.top-p,u=c+t.offsetHeight,h=e.offsetHeight}}e.style.height="auto";const S=c-20+(m?m.scrollTop:0),C=h-u-20,k=S-(null!==(a=null===(l=m)||void 0===l?void 0:l.scrollTop)&&void 0!==a?a:0),x=(null!==(o=null===(d=m)||void 0===d?void 0:d.offsetHeight)&&void 0!==o?o:h)-k-20-t.offsetHeight,I=e.offsetHeight;e.style.height="";const O=t.offsetTop,T={openPosition:O+t.offsetHeight+10,height:I},F={openPosition:O-I-10,height:I};return I<=x?T:I<=k?F:I<=C?T:I<=S?F:{openPosition:O,height:Math.min(I,C+t.offsetHeight)}},So=yr.forwardRef(((e,t)=>{let{nodeKey:n,cardInstanceId:r,subviewId:i,embedMode:a,attributes:{format:o,defaultValue:s,thumbnailSrc:l,label:d,name:c,values:u,placeholder:h},validations:p,theme:m,isFinalCardNode:g,variableResolver:v,onValueChanged:f}=e;const[b,y]=le(!1),[w,S]=le(0),[C,k]=le(0),[x,I]=le(s?v(s.toString()):null),[O,T]=le(-1),F=he(null),M=he(null),j=he(null),A=he(null),D=he(s?v(s.toString()):null),E=u.find((e=>{let{value:t}=e;return x===t}));pe(t,(()=>({getCurrentValue:()=>x,setCurrentValue:e=>I(e)}))),ce((()=>{const e=e=>{F.current&&!F.current.base.contains(e.target)&&(b&&Je().validateField(r,c,x,p),y(!1))},t=e=>{var t,n;(null==j||null===(t=j.current)||void 0===t||null===(n=t.base)||void 0===n?void 0:n.contains(document.activeElement))&&e.key===Qr&&(y(!1),M.current.base.focus())};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}})),ce((()=>{if(f)f(x);else{const e=et(r,c,i);e?(D.current=e.toString(),I(e)):Je().handleFormChange(r,c,x,i)}j.current&&A.current&&(j.current.base.scrollTop=A.current.base.offsetTop)}),[]),ce((()=>{const e=s?v(s.toString()):null;e!==D.current&&(x===D.current&&(f?f(e):Je().handleFormChange(r,c,e,i),I(e)),D.current=s?v(s.toString()):null)}),[s]),ce((()=>{if(b){const e=u.findIndex((e=>x===e.value));T(Math.max(0,e))}else T(-1)}),[b]);const _=`dropdown-label-${c}`;return(0,ee.h)(Se.lj,{actions:Ye,mapToProps:()=>{}},(e=>(0,ee.h)(mo,null,(0,ee.h)(no,{nodeKey:n,ref:F,innerRef:M,mode:o,theme:m,isFinalCardNode:g,tabFocusable:!0,accessibleAttributes:{role:"combobox","aria-haspopup":"listbox","aria-expanded":b,"aria-controls":`${c}-dropdown-body`,"aria-labelledby":_},onClick:()=>{if(F.current){const{openPosition:t,height:n}=wo(j.current.base,F.current.base,!!i,a);S(t),k(n),y((t=>(t&&e.validateField(r,c,x,p,i),!t)))}}},l&&(0,ee.h)(po,null,(0,ee.h)(io,{thumbnailUrl:v(l),theme:m})),(0,ee.h)(ho,{mode:o,theme:m},(0,ee.h)(oo,{theme:m,mode:o,name:_,truncateLabel:"inline"===o,inputHasValue:!!x},v(d)),(0,ee.h)(yo,{theme:m,mode:o,placeholder:!E},E?E.title:v(h))),(0,ee.h)(so,{fillColor:m.getCSSColor("icon.dropdown"),styles:{flex:"0 0 auto"},ariaHidden:!0}),(0,ee.h)(go,{ref:j,open:b,openPosition:w,theme:m,height:C,className:"dropdown-body",id:`${c}-dropdown-body`,role:"listbox"},(0,ee.h)(ri,{defaultIndex:O,theme:m},u.map(((t,n)=>(0,ee.h)(bo,{onClick:()=>{t.disabled||(I(t.value),f?f(t.value):e.handleFormChange(r,c,t.value,i),e.validateField(r,c,t.value,p,i),M&&M.current&&M.current.base&&M.current.base.focus(),T(n))},ref:t.value===x?A:null,theme:m,disabled:t.disabled,isSelected:t.value===x,"data-testid":`option-${t.title}`},t.title,t.value===x&&(0,ee.h)(uo,{fillColor:m.getCSSColor("background.dropdownMenuSelectedIcon"),style:{flexShrink:0},ariaHidden:!0}))))))),(0,ee.h)(co,{name:c,cardInstanceId:r,subviewId:i,theme:m,isFinalCardNode:g,variableResolver:v}))))})),Co=Zt("div")((e=>{let{mode:t,theme:n}=e;return Object.assign(Object.assign({},n.getCSSFontProperties("stacked"===t?"pinned":"primary")),{display:"stacked"===t?"block":"flex",cursor:"pointer",flex:"1 1 auto",gap:"5px",maxWidth:"100%",minWidth:"0"})})),ko=Zt("div")((()=>({flex:"0 0 auto",alignItems:"center"}))),xo=Zt("div")((()=>({"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none"}))),Io=e=>{var t,n,r,i,o,s,l,d,c,u,h,p;let{nodeKey:m,cardInstanceId:g,subviewId:f,attributes:{format:b,defaultValue:y,thumbnailSrc:w,label:S,name:C,placeholder:k},controlledDateValidator:x,validations:I,theme:O,isFinalCardNode:T,variableResolver:F,onValueChanged:M,embedMode:j}=e;const A=y?new Date(y):void 0,D=he(A?(0,a.addMinutes)(A,A.getTimezoneOffset()):null),[E,_]=le(!1),[L,P]=le(0),[H,R]=le(0),[$,N]=le(D.current),V=he(null),W=he(null),z=he(null),B=(null==I||null===(t=I.maximumDate)||void 0===t||null===(n=t.attributes)||void 0===n?void 0:n.maximumDate)?new Date(null==I||null===(r=I.maximumDate)||void 0===r||null===(i=r.attributes)||void 0===i?void 0:i.maximumDate):void 0,U=(null==I||null===(o=I.minimumDate)||void 0===o||null===(s=o.attributes)||void 0===s?void 0:s.minimumDate)?new Date(null==I||null===(l=I.minimumDate)||void 0===l||null===(d=l.attributes)||void 0===d?void 0:d.minimumDate):void 0,q=new Date;let Y=new Date;if(B&&U){if(!(q<=B&&q>=U)){Y=Math.abs((0,a.differenceInSeconds)(q,B))<Math.abs((0,a.differenceInSeconds)(q,U))?B:U}}else if(U){q>=U||(Y=U)}else if(B){q<=B||(Y=B)}const K=$?new Date($):new Date(Y);K.setHours(0,0,0,0);const Z=()=>{E&&Je().validateField(g,C,$,I,f),_(!1)};let Q;ce((()=>{const e=e=>{z.current&&!z.current.base.contains(e.target)&&V.current&&!V.current.base.contains(e.target)&&Z()};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}})),ce((()=>{const e=$?$.toISOString():void 0,t=$?Ne()($,v):null;if(M)M(e);else{const e=et(g,C,f);e?(D.current=new Date(e),N(e)):Je().handleFormChange(g,C,t,f)}}),[]),ce((()=>{var e;const t=y?new Date(y):void 0,n=t?(0,a.addMinutes)(t,t.getTimezoneOffset()):null;if((null==n?void 0:n.toDateString())!==(null===(e=D.current)||void 0===e?void 0:e.toDateString())){if($===D.current){const e=n?n.toISOString():void 0,t=n?Ne()(n,v):null;M?M(e):Je().handleFormChange(g,C,t,f),N(n)}D.current=n}}),[y]),x?Q=x:((null==I||null===(c=I.maximumDate)||void 0===c||null===(u=c.attributes)||void 0===u?void 0:u.maximumDate)||(null==I||null===(h=I.minimumDate)||void 0===h||null===(p=h.attributes)||void 0===p?void 0:p.minimumDate))&&(Q=e=>{var t,n,r,i;const a=null===(t=I.maximumDate)||void 0===t||null===(n=t.attributes)||void 0===n?void 0:n.maximumDate,o=null===(r=I.minimumDate)||void 0===r||null===(i=r.attributes)||void 0===i?void 0:i.minimumDate,s=a?Re(a,{isMax:!0}):void 0,l=o?Re(o,{isMin:!0}):void 0;return(!s||e<=s)&&(!l||e>=l)});const G=`datepicker-label-${C}`,X=$?Ne()($,"DD MMM YYYY"):F(k),J=()=>{W&&W.current&&W.current.base&&W.current.base.focus()};return(0,ee.h)(Se.lj,{actions:Ye,mapToProps:()=>{}},(e=>(0,ee.h)(xo,null,(0,ee.h)(no,{nodeKey:m,ref:V,innerRef:W,mode:b,theme:O,isFinalCardNode:T,tabFocusable:!0,accessibleAttributes:{role:"button","aria-haspopup":"dialog","aria-expanded":E,"aria-labelledby":G},onClick:()=>{if(V.current){const{openPosition:t,height:n}=wo(z.current.base,V.current.base,!!f,j);P(t),R(n),_((t=>(t&&e.validateField(g,C,$,I,f),!t)))}}},w&&(0,ee.h)(ko,{mode:b},(0,ee.h)(io,{thumbnailUrl:F(w),theme:O})),(0,ee.h)(Co,{mode:b,theme:O},(0,ee.h)(oo,{theme:O,mode:b,name:G,truncateLabel:"inline"===b,inputHasValue:!!$},F(S)),(0,ee.h)(yo,{theme:O,mode:b,placeholder:!$,ariaLabel:X},X)),(0,ee.h)(so,{fillColor:O.getCSSColor("icon.dropdown"),styles:{flex:"0 0 auto"},ariaHidden:!0})),(0,ee.h)(go,{ref:z,open:E,openPosition:L,theme:O,height:H},(0,ee.h)(Xa,{date:K,open:E,theme:O,onDateSelected:t=>{N(t);const n=t?Ne()(t,v):void 0,r=t?t.toISOString():void 0;M?M(r):e.handleFormChange(g,C,n,f),e.validateField(g,C,r,I,f),_(!1),J()},onCancel:()=>{Z(),J()},isDateEnabled:Q})),(0,ee.h)(co,{theme:O,isFinalCardNode:T,name:C,cardInstanceId:g,subviewId:f,variableResolver:F}))))},Oo=15,To=(0,a.startOfDay)(new Date),Fo=e=>{let{cardInstanceId:t,attributes:{format:n,name:r,label:i,defaultValue:o},validations:s,theme:l,maxDateTime:d,selectedDate:c,selectedTime:u,isWorkflow:h,variableResolver:p,onValueChanged:m}=e;const g=new Date(o),[v,f]=le(""),b=he(null),y=he([...Array(96).keys()].map((e=>({title:(0,a.format)((0,a.addMinutes)(To,e*Oo),"h:mm A"),value:""+e*Oo,disabled:!1})))),w=e=>{let t="";return e.forEach((e=>{e.disabled||(t=e.value)})),t};ce((()=>{if(c){const t=y.current.map(((e,t)=>{const n=(0,a.addMinutes)(c,t*Oo);return e.disabled=!!(d&&n>=d),e}));if(y.current=t,u&&d){if((0,a.addMinutes)(c,u||0)>d){const t=w(y.current);var e;if(t)null==m||m(t),null===(e=b.current)||void 0===e||e.setCurrentValue(t)}}}}),[d,c]);return(0,ee.h)(So,{ref:b,attributes:{name:r,label:i,format:n,values:y.current,defaultValue:(()=>{const e=Mo(g);if(d){var t;const n=(0,a.differenceInMinutes)(d,(0,a.startOfDay)(g)),r=w(y.current);if(g>d)return Number(r);if(e<n)return e;const i=(0,a.differenceInMinutes)(d,(0,a.startOfDay)(d));return f((0,a.format)((0,a.addMinutes)(To,i),"h:mm A")),null===(t=b.current)||void 0===t||t.setCurrentValue(""),null==m||m(i.toString()),i}return e})(),placeholder:v},cardInstanceId:t,variableResolver:p,theme:l,validations:s,isWorkflow:h,onValueChanged:m})},Mo=e=>Math.ceil(((0,a.differenceInMinutes)(e,(0,a.startOfDay)(e))+5)/Oo)*Oo,jo=Zt("div")((e=>{let{workflowTheme:t,feedTheme:n,embedMode:r,cardMaximumWidth:i}=e;return Object.assign({backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:"static"},"modal-stream"===r?{position:"relative",height:"auto",width:"100%",maxWidth:i?`${i}px`:"initial",borderRadius:n.getShape("borderRadius.card")||"initial",border:`${n.getShape("border.card")||"0px"} solid ${n.getCSSColor("border.card")}`}:{})})),Ao=Zt("div")({position:"static",top:"60px",bottom:"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"hidden",padding:"0px 20px 20px"}),Do=Zt("div")({overflow:"auto",paddingTop:"10px"}),Eo=t=>{let{workflowTheme:n,feedTheme:r}=t;const i=ge(Hi),o=i.analyticsDispatcher,s=i.cardEventDispatcher,l=i.authTokenProvider,[d,c]=le(void 0),[u,h]=le(0),p=new Date;return(0,ee.h)(Se.lj,{actions:(0,e.Y2)(Ce,Vt),mapToProps:e=>{const t=Me(e);let n,r,i;return t&&Ae(t)&&(n=t.cardInstanceId,r=t.source,i=t.cardExpiry),{screenTitle:e.application.customStrings.cardSnoozeTitle||"Remind me",embedMode:e.application.embedMode,cardMaximumWidth:e.cardFeed.cardMaximumWidth,snoozeCardInstanceId:n,source:r,snoozeCardExpiry:i}}},(e=>{const[t,i]=le(p),[g,v]=le(0),f=e.snoozeCardInstanceId,b=e.snoozeCardExpiry,y=e.source;if(!f||!y)return null;const w=e.screenTitle,S="modal-subview"===e.embedMode?yi:bi;ce((()=>{o.sendEvent({eventName:lt,cardInstanceId:f,cardViewState:"subview"})}),[]);return(0,ee.h)(jo,{workflowTheme:n,feedTheme:r,embedMode:e.embedMode,cardMaximumWidth:e.cardMaximumWidth,id:$i},(0,ee.h)(S,{title:w,theme:n,cardBorderRadius:r.getShape("borderRadius.card"),actionHandler:()=>{o.sendEvent({eventName:dt,cardInstanceId:f,cardViewState:"subview"}),e.navigateBack()}}),(0,ee.h)(Ao,{class:"use-offset"},(0,ee.h)(Do,{class:"offset-child"},(0,ee.h)(Io,{cardInstanceId:f,attributes:{name:"snoozeDate",label:"Date",defaultValue:Ne()(p,"YYYY-MM-DD[T]00:00:00.000[Z]"),format:"inline"},isWorkflow:!0,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{i(new Date(e))},controlledDateValidator:b?e=>{if(b){return e<=new Date(b)}return!0}:void 0}),(0,ee.h)(Fo,{attributes:{name:"snoozeTime",label:"Time",defaultValue:p.toISOString(),format:"inline"},isWorkflow:!0,cardInstanceId:f,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{v(Number.parseInt(e))},selectedDate:t,selectedTime:g,maxDateTime:b?new Date(b):void 0}),(0,ee.h)(vl,{isWorkflow:!0,clickHandler:()=>()=>{const n=_o(t,g);if((0,a.isPast)(n)){const e=u+1;h(e),c({text:"Date must be in the future",messageId:`${e}`,cardInstanceId:f,action:"other"})}else e.navigateBack(),ul(m().getState(),e,f,n,s,l,y)},text:"Done",theme:n,appearance:"primary"}))),(0,ee.h)(Ii,{theme:n,message:d,actionTitle:"Dismiss",onDismiss:()=>{}}))}))},_o=(e,t)=>(0,a.addMinutes)((0,a.startOfDay)(e),t);var Lo=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const Po=e=>{switch(e.type){case"string":return e.defaultValue;case"number":return e.defaultValue.toString();case"boolean":return e.defaultValue?"true":"false";case"list":return e.defaultValue.join(", ");case"date":const t=new Date(e.defaultValue);return isNaN(t.getTime())?e.defaultValue:(0,a.format)(t,e.defaultFormatterOption||"");default:return String(e.defaultValue)}},Ho=(e,t,n,r,i,a,o)=>Lo(void 0,void 0,void 0,(function*(){const s=`feed/${e}${o?"?filters="+JSON.stringify(o):""}`,d=yield zc.get(s,t,r||"",{streamContainerId:e});if(304===d.response.status)return l.debug({level1:["Feed unchanged response received by HTTP"]}),{};if(200===d.response.status){l.debug({level1:["Feed update received by HTTP"]});let e=d.data.cardInstances,t=d.data.metadata;const r=e.length;a&&e.length>a&&(e=e.slice(0,a));const o=yield Vo(e,n,i);return{lastModified:d.response.etag,cardInstances:e,metadata:t,unfilteredCardInstanceCount:r,runtimeVariables:o}}return{error:d.response.error}})),Ro=(e,t,n,r)=>Lo(void 0,void 0,void 0,(function*(){const i=yield zc.post("response",{streamContainerId:e,cardInstanceId:t,values:n},r,{streamContainerId:e,cardInstanceId:t});return{ok:i.data&&1==i.data.ok,event:i.data&&i.data.event,error:i.response&&i.response.error}})),$o=(e,t,n)=>Lo(void 0,void 0,void 0,(function*(){const r=yield zc.post("dismiss",{streamContainerId:e,cardInstanceId:t},n,{streamContainerId:e,cardInstanceId:t});return{ok:r.data&&1==r.data.ok,event:r.data&&r.data.event,error:r.response.error}})),No=(e,t,n,r)=>Lo(void 0,void 0,void 0,(function*(){const i=yield zc.post("snooze",{streamContainerId:e,cardInstanceId:t,interval:`PT${Math.max(0,n)}S`},r,{streamContainerId:e,cardInstanceId:t});return{ok:i.data&&!0===i.data.ok,event:i.data&&i.data.event,error:i.response.error}})),Vo=(e,t,n)=>Lo(void 0,void 0,void 0,(function*(){let r=e.filter((e=>e.runtimeVariables&&e.runtimeVariables.length)).map((e=>{const t=e.runtimeVariables||[];return{eventName:e.instance.eventName,lifecycleId:e.instance.lifecycleId,id:e.instance.id,runtimeVariables:new Map(t.map((e=>[e.name,Po(e)])))}}));if(r.length){let e=r;if(n){let i=!1;const a=new Promise((e=>{setTimeout((()=>{i||(console.error(`Resolution of runtime variables exceeded the timeout (${t}ms). Falling back to default values.`),e(r))}),t)})),o=r.map((e=>Object.assign(Object.assign({},e),{runtimeVariables:new Map(e.runtimeVariables)})));e=yield Promise.race([a,n(o).then((e=>(i=!0,e)))])}const i=e.reduce(((e,t)=>(r.filter((e=>e.id===t.id)).length>0&&e.set(t.id,t.runtimeVariables),e)),new Map);return{values:i}}return{}})),Wo=()=>({updateTotalCardCount:(e,t,n)=>Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{lastModified:null!=n?n:e.cardFeed.lastModified,metadata:Object.assign(Object.assign({},e.cardFeed.metadata),{totalCards:t})})}),setStreamFilter:(e,t)=>Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{streamFilter:t})}),finishExternalAction(e,t){var n;return Object.assign(Object.assign({},e),{externalAction:(null===(n=e.externalAction)||void 0===n?void 0:n.actionId)===t?void 0:e.externalAction})}}),zo=(e,t,n)=>({getTheme:r=>new nn(e,r,t,n)});var Bo=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const Uo="theme_cache",qo=()=>new Promise(((e,t)=>{const n=window.parent.indexedDB.open("AtomicSDK",1);n.onerror=e=>{t(e)},n.onsuccess=()=>{e(n.result)},n.onupgradeneeded=()=>{const r=n.result;n.transaction&&(n.transaction.oncomplete=()=>{e(n.result)},n.transaction.onerror=e=>{t(e)},n.transaction.onabort=e=>{t(e)});r.createObjectStore(Uo).createIndex("stream_container_id","stream_container_id",{unique:!0})}}));var Yo=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const Ko=(e,t)=>Yo(void 0,void 0,void 0,(function*(){const n=`theme/${e}`,{data:r,response:i}=yield zc.get(n,void 0,t,{streamContainerId:e});if(200===i.status){if(r&&r.theme){try{yield((e,t,n)=>Bo(void 0,void 0,void 0,(function*(){const r=yield qo();return new Promise(((i,a)=>{const o=r.transaction(Uo,"readwrite").objectStore(Uo).put({themePayload:t,eTag:n},e);o.onsuccess=()=>{r.close();const t=o.result;i({streamContainerId:e,themePayload:t.themePayload,eTag:t.eTag})},o.onerror=e=>{r.close(),a(e)}}))})))(e,r,i.etag||"")}catch(e){console.warn("Failed to update cached theme.",e)}return{theme:r||{}}}return{error:new Error("Invalid theme returned. Missing `theme` key in payload.")}}return{error:i.error}})),Zo=e=>Yo(void 0,void 0,void 0,(function*(){try{const t=yield(e=>Bo(void 0,void 0,void 0,(function*(){const t=yield qo();return new Promise(((n,r)=>{const i=t.transaction(Uo,"readonly").objectStore(Uo).get(e);i.onsuccess=()=>{t.close(),n(i.result)},i.onerror=e=>{t.close(),r(e)}}))})))(e);return t&&t.themePayload&&t.themePayload.theme?{theme:t.themePayload,eTag:t.eTag}:null}catch(e){return console.warn("Failed to fetch cached theme.",e),null}}));class Qo extends ee.Component{componentDidCatch(e){this.props.onError?this.props.onError(e):console.error(e)}render(){return this.props.children}}const Go=e=>{let{fontFamilies:t}=e;return(0,ee.h)("style",{dangerouslySetInnerHTML:{__html:t.map((e=>Jo(e))).join("\n")}})},Xo={ttf:"truetype",otf:"opentype",woff:"woff",woff2:"woff2"},Jo=e=>{let{fontFamily:t,weight:n,style:r,src:i}=e;if(i&&0===i.split(".").length)throw new Error("Invalid file url provided for font.");const a=i?new URL(i).pathname:null;if(!a)return"";const o=a.split("."),s=o[o.length-1],l=Xo[s];if(!l)return"";if(!t)return"";return`\n @font-face {\n font-family: "${t}";\n ${(i?`src: url('${i}') format('${l}');`:"")||""}\n font-weight: ${n||"normal"};\n font-style: ${r||"normal"};\n font-display: swap;\n }\n `},es=e=>Object.assign(Object.assign({backgroundColor:e.getCSSColor("background.component"),color:e.getCSSColor("text.primary")},e.getCSSFontProperties("primary")),{border:"none",boxSizing:"border-box",height:"100%",width:"100%",display:"flex",flexGrow:"1",overflow:"hidden",":focus":{outline:"none"},"::placeholder":{color:e.getCSSColor("text.hint")},whiteSpace:"pre-wrap"}),ts=Zt("textarea")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},es(t)),{resize:"none",boxSizing:"content-box",paddingLeft:"0px",paddingRight:"0px"})})),ns=Zt("input")((e=>{let t,{theme:n}=e,r=n.getNumericFontSize("primary"),i=n.getCSSFontProperties("primary");if(i&&i.lineHeight&&r){const e=Math.ceil(.05*r);t=Number(i.lineHeight.replace("px",""))+e}return Object.assign(Object.assign({},es(n)),t?{lineHeight:`${t}px`}:{})})),rs=(e,t,n)=>{let r=0;"getComputedStyle"in window&&document.defaultView&&(r=parseInt(document.defaultView.getComputedStyle(e,null).getPropertyValue("line-height"))),e.style.height="auto",n&&(e.style.minHeight=n*r+"px"),1===t?e.style.height="auto":t>0?e.style.height=t*r+"px":(e.style.height=`${e.scrollHeight}px`,e.style.paddingTop="4px")};let is=null;const as=yr.forwardRef(((e,t)=>{let{nodeKey:n,cardInstanceId:r,subviewId:i,attributes:{defaultValue:a,numberOfLines:o,name:s,thumbnailSrc:l,placeholder:d,maxLength:c},minimumLines:u,validations:h,theme:p,isFinalCardNode:m,variableResolver:g,onValueChanged:v}=e;const f=he(null),b=he(a),[y,w]=le(g(a)),S=1===o?ns:ts;ce((()=>{const{current:{base:e}}=f;rs(e,o,u)})),ce((()=>{const e=et(r,s,i);e?(b.current=e,w(e)):Je().handleFormChange(r,s,y,i)}),[]),ce((()=>{if(a!==b.current){if(y===g(b.current)){const e=g(a);w(e),Je().handleFormChange(r,s,e,i)}b.current=a}}),[a]);const C=g(d);return(0,ee.h)(Se.lj,{actions:Ye,mapToProps:()=>{}},(e=>(pe(t,(()=>({clearInput:()=>{w(""),f.current.base&&rs(f.current.base,o),e.handleFormChange(r,s,"",i)}}))),(0,ee.h)(ee.Fragment,null,(0,ee.h)(no,{nodeKey:n,mode:"inline",theme:p,isFinalCardNode:m},l&&(0,ee.h)(io,{thumbnailUrl:g(l),theme:p}),(0,ee.h)(S,{theme:p,ref:f,placeholder:C,value:y,maxlength:c,className:"input-text",onInput:t=>{const{current:{base:n}}=f,{value:a}=t.target;w(a),rs(n,o),((e,t)=>{null!==is&&(clearTimeout(is),is=null),is=setTimeout((()=>{t(r,s,null!=e?e:void 0,h,i)}),200)})(a,e.validateField),e.handleFormChange(r,s,a,i),v&&v(a)},rows:"1"})),(0,ee.h)(co,{name:s,cardInstanceId:r,subviewId:i,theme:p,isFinalCardNode:m,variableResolver:g})))))})),os=Zt("div")((e=>{let{theme:t}=e;return Object.assign({padding:"10px 20px",display:"flex",width:"100%",alignItems:"center",border:"0px"},t.getElementFocusCSSProperties())})),ss=Zt("p")((e=>{let{theme:t}=e;return Object.assign({padding:"0 10px 0 0",margin:"0",flexGrow:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.getCSSColor("text.primary")},t.getCSSFontProperties("primary"))})),ls=Zt("div")((e=>{let{checked:t,theme:n}=e;return{width:"22px",height:"22px",border:t?`7px solid ${n.getCSSColor("icon.selectionIndicatorActive")}`:`1px solid ${n.getCSSColor("icon.selectionIndicator")}`,flexShrink:"0",borderRadius:"100%"}})),ds=e=>{let{title:t,value:n,checked:r,onValueSelected:i,theme:a}=e;return(0,ee.h)(os,{onClick:()=>{i(n)},role:"radio","aria-checked":r,theme:a,tabIndex:"-1"},(0,ee.h)(ss,{theme:a},t),(0,ee.h)(ls,{checked:r,theme:a}))},cs=Zt("div")((e=>{let{}=e;return{display:"flex",flexFlow:"column wrap",width:"100%"}})),us=Zt("div")((e=>{let{}=e;return{display:"none"}})),hs=e=>{let{attributes:{items:t,title:n,name:r},theme:i,onValueChanged:a}=e;const[o,s]=le(null),l=`radio-group-${r}`;return(0,ee.h)(no,{mode:"inline",theme:i,hPadding:0},(0,ee.h)(us,{id:l},n),(0,ee.h)(cs,{role:"radiogroup","aria-labelledby":l},(0,ee.h)(ri,{theme:i},t.map((e=>(0,ee.h)(ds,{title:e.title,value:e.value,theme:i,checked:o===e.value,onValueSelected:e=>{s(e),a&&a(e)}}))))))},ps=Zt("div")((e=>{let{workflowTheme:t,feedTheme:n,embedMode:r,cardMaximumWidth:i}=e;return Object.assign({backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:"static"},"modal-stream"===r?{height:"auto",width:"100%",maxWidth:i?`${i}px`:"initial",borderRadius:n.getShape("borderRadius.card")||"initial",border:`${n.getShape("border.card")||"0px"} solid ${n.getCSSColor("border.card")}`}:{})})),ms=Zt("div")({position:"static",top:"60px",bottom:"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"hidden",padding:"0px 20px 20px"}),gs=Zt("div")({overflow:"auto",paddingTop:"10px"}),vs=Zt("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({color:t.getCSSColor("text.error")},t.getCSSFontProperties("error")),{margin:"-10px 0 30px 0"})})),fs=t=>{let{workflowTheme:n,feedTheme:r}=t;const i=ge(Hi),a=i.analyticsDispatcher,o=i.cardEventDispatcher,s=he(),[l,d]=le(null),[c,u]=le(null),[h,p]=le(!1);return(0,ee.h)(Se.lj,{actions:(0,e.Y2)(Ce,Vt),mapToProps:e=>{const t=Me(e),n=t&&De(t)?t:void 0;return{embedMode:e.application.embedMode,cardMaximumWidth:e.cardFeed.cardMaximumWidth,screenTitle:e.application.customStrings.votingFeedbackTitle||"Send feedback",validationMessage:e.application.customStrings.votingFeedbackValidationMessage||"Feedback is limited to 280 characters.",feedbackSentiment:null==n?void 0:n.sentiment,feedbackCardInstanceId:null==n?void 0:n.cardInstanceId,feedbackSource:null==n?void 0:n.source,textFeedback:null==n?void 0:n.textFeedback,textFeedbackLabel:null==n?void 0:n.textFeedbackLabel}}},(e=>{const t="modal-subview"===e.embedMode?yi:bi,i=e.screenTitle,m=e.feedbackCardInstanceId,g=e.feedbackSource,v="positive"===e.feedbackSentiment&&e.textFeedback,f=[{title:"It's not relevant",value:"not-relevant"},{title:"I see this too often",value:"too-often"}];if(e.textFeedback&&f.push({title:"Something else",value:"other"}),!m||!g)return null;const b="positive"===e.feedbackSentiment?"Add optional feedback...":"Add your feedback...";return(0,ee.h)(ps,{workflowTheme:n,feedTheme:r,embedMode:e.embedMode,cardMaximumWidth:e.cardMaximumWidth,id:$i},(0,ee.h)(t,{title:i,theme:n,cardBorderRadius:r.getShape("borderRadius.card"),actionHandler:()=>{var t;u(null),null===(t=s.current)||void 0===t||t.clearInput(),e.navigateBack()}}),(0,ee.h)(ms,{class:"use-offset"},(0,ee.h)(gs,{class:"offset-child"},"negative"===e.feedbackSentiment&&(0,ee.h)(hs,{attributes:{title:i,name:"feedback-reason",items:f},isWorkflow:!0,cardInstanceId:m,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{d(e)}}),("other"===l||v)&&(0,ee.h)(ee.Fragment,null,(0,ee.h)(as,{ref:s,attributes:{name:"feedback-message",defaultValue:"",placeholder:e.textFeedbackLabel&&e.textFeedbackLabel.length>0?e.textFeedbackLabel:b,numberOfLines:0,maxLength:280},minimumLines:3,isWorkflow:!0,cardInstanceId:m,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{if(e.length>=280)return p(!0);p(!1),u(e)}}),h&&(0,ee.h)(vs,{theme:n,"data-testid":"feedback-validation-error"},e.validationMessage)),(0,ee.h)(vl,{isWorkflow:!0,clickHandler:()=>()=>{var t;if(!v&&null===l)return;if("other"===l&&(null===c||null==c||0===c.trim().length))return;const n="other"===l||v&&c?{message:c}:{};a.sendEvent({cardViewState:"topview",eventName:v?it:at,cardInstanceId:m,properties:Object.assign(Object.assign({source:g},"negative"===e.feedbackSentiment||null!==c?{reason:v?"other":l}:{}),n)}),e.feedbackReceived(m),o.dispatchCardEvent({type:v?Pi.VOTED_USEFUL:Pi.VOTED_NOT_USEFUL}),u(null),null===(t=s.current)||void 0===t||t.clearInput(),e.navigateBack()},text:"Submit",theme:n,appearance:"primary"}))))}))};var bs=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const ys=()=>window.matchMedia("(prefers-color-scheme: dark)"),ws=Zt("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.toast")}})),Ss=t=>{let{store:n,onAnalyticsEvent:r,onCardEvent:i,onAuthTokenRequested:a,onError:o}=t;const s=me((()=>({analyticsDispatcher:{sendEvent:(e,t)=>bs(void 0,void 0,void 0,(function*(){r&&(void 0===t?yield r(e):yield r(e,t))}))},cardEventDispatcher:{dispatchCardEvent:e=>{i&&i(e)}},authTokenProvider:{requestToken:()=>bs(void 0,void 0,void 0,(function*(){return yield a()}))},runtimeVariableResolver:void 0})),[r,i,a]);return(0,ee.h)(Qo,{onError:o},(0,ee.h)(Hi.Provider,{value:s},(0,ee.h)(Se.zt,{store:n},(0,ee.h)(Se.lj,{actions:(0,e.Y2)(Ce,Vt,Ye,Ce)},Cs))))},Cs=e=>{const{cardFeed:t,messages:n,themeLoading:r,themeLoaded:i,clearMessage:a,application:{interfaceStyle:o,streamContainerId:s},theme:l}=e,[d,c]=le(ys().matches?"dark":"light");if(ce((()=>{!function(){bs(this,void 0,void 0,(function*(){const e=yield Zo(s);if(e)i({theme:e.theme}),Ko(s,e.eTag);else{r();const e=yield Ko(s);i(e)}}))}()}),[]),ce((()=>{const e=e=>{c(e.matches?"dark":"light")};return ys().addEventListener("change",e),()=>{ys().removeEventListener("change",e)}}),[]),!l.status||!1===l.status.loaded)return null;const u=l.themePayload?zo(l.themePayload,d,o):void 0;if(!u)return null;const h=u.getTheme("feed"),p=ge(Hi),m=p.cardEventDispatcher,g=p.analyticsDispatcher,v=p.authTokenProvider;return(0,ee.h)(ws,{theme:h},(0,ee.h)(Ii,{theme:h,feedOrientation:kc(t.horizontalContainerConfig),message:n.cardList,actionTitle:n.cardList&&["submit-failed","dismiss-failed","snooze-failed"].includes(n.cardList.action)?"Try again":"Dismiss",actionHandler:()=>{var t,r,i,a,o,s,l,d,c,u;const h=null===(t=n.cardList)||void 0===t?void 0:t.cardInstanceId,p=null===(r=n.cardList)||void 0===r?void 0:r.action;if(h&&p)switch(p){case"submit-failed":cl(e,e,h,!1,m,g,v,(null===(i=e.messages.cardList)||void 0===i?void 0:i.responseValues)||{},{payload:null===(a=e.messages.cardList)||void 0===a?void 0:a.payload,postSubmissionUrl:null===(o=e.messages.cardList)||void 0===o?void 0:o.postSubmissionUrl,subviewData:null===(s=e.messages.cardList)||void 0===s?void 0:s.subviewData,submitButtonName:null===(l=e.messages.cardList)||void 0===l?void 0:l.submitButtonName});break;case"dismiss-failed":const t=null===(d=e.messages.cardList)||void 0===d?void 0:d.source;t&&dl(e,e,h,m,v,t);break;case"snooze-failed":const n=null===(c=e.messages.cardList)||void 0===c?void 0:c.snoozeDate,r=null===(u=e.messages.cardList)||void 0===u?void 0:u.source;n&&r&&ul(e,e,h,n,m,v,r)}},onDismiss:()=>{a("cardList")},delay:500}))};function ks(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let xs;!function(e){e.STATE="state-update",e.ANALYTICS_EVENT="analytics-event-dispatched"}(xs||(xs={}));class Is{constructor(){ks(this,"channel",void 0),ks(this,"isOpen",!1),ks(this,"eventListeners",new Map),this.channel=new BroadcastChannel("stream-container-broadcast-channel"),this.isOpen=!0,window.addEventListener("pagehide",(()=>{this.close()}))}addEventListener(e,t,n){if(!("BroadcastChannel"in window))return l.error({level1:["BroadcastChannel API not supported in this browser"]});const r=n=>{n.type===e&&t(n)},i=n||`${e}-${Date.now().toString()}-${this.eventListeners.size}`;return this.channel.addEventListener(e,r),this.eventListeners.set(i,r),i}removeEventListener(e){if(!("BroadcastChannel"in window))return l.error({level1:["BroadcastChannel API not supported in this browser"]});const t=this.eventListeners.get(e);return!!t&&(this.channel.removeEventListener("message",t),this.eventListeners.delete(e),!0)}postMessage(e){if(!("BroadcastChannel"in window))return l.error({level1:["BroadcastChannel API not supported in this browser"]});this.channel.postMessage(e)}close(){this.channel.close(),this.isOpen=!1}}var Os=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))},Ts=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Fs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ms=()=>window.matchMedia("(prefers-color-scheme: dark)"),js=()=>window.getComputedStyle(document.documentElement).getPropertyValue("font-size"),As={FEED_OVERLAY:"100",CARD_OVERLAY:"110",DROPDOWN:"40",HEADER:"30",BANNER:"20",TOAST:"11",OVERFLOW_MENU:"11",OVERFLOW_MENU_BUTTON:"10",CUSTOM_HEADER:"2"},Ds=Zt("div")((e=>{let{embedMode:t,feedOrientation:n}=e;const r={};return"launcher"===t?Object.assign({width:"calc(100% - 40px)",height:"0px",position:"absolute",bottom:"100px",right:"20px",left:"20px",transition:"height 0.2s"},"horizontal"===n?r:{}):{width:"100%",height:"100%"}})),Es={fontFamily:'-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',height:"100%",overflow:"hidden"},_s=Zt("div")((e=>{var t,n,r,i,a,o;let{embedMode:s,feedTheme:l,workFlowTheme:d,renderMode:c,cardHorizontalAlignment:u,modalContainerPositioning:h,modalContainerVerticalPadding:p}=e;const m="feed"===c?null==l?void 0:l.getNumericalPadding("stream"):null==d?void 0:d.getNumericalPadding("stream");return Object.assign(Object.assign(Object.assign({},Es),"launcher"===s?{borderRadius:"20px",boxShadow:"0 2px 20px 0 rgba(0, 0, 0, 0.1)"}:{}),"modal-stream"===s?{display:"flex",justifyContent:{leading:"safe flex-start",center:"safe center",trailing:"safe flex-end"}[null!=u?u:"center"],alignItems:{top:"safe flex-start",center:"safe center",bottom:"safe flex-end"}[null!=h?h:"center"],backgroundColor:`${null==l?void 0:l.getCSSColor("background.modalContainer")}`,paddingTop:`${"top"===h?null!==(t=null!=p?p:null==m?void 0:m.top)&&void 0!==t?t:10:null!==(n=null==m?void 0:m.top)&&void 0!==n?n:10}px`,paddingRight:`${null!==(r=null==m?void 0:m.right)&&void 0!==r?r:10}px`,paddingBottom:`${"bottom"===h?null!==(i=null!=p?p:null==m?void 0:m.bottom)&&void 0!==i?i:10:null!==(a=null==m?void 0:m.bottom)&&void 0!==a?a:10}px`,paddingLeft:`${null!==(o=null==m?void 0:m.left)&&void 0!==o?o:10}px`,overflowY:"auto"}:{})})),Ls=(yr.forwardRef(((t,n)=>{let{store:r,embedMode:i,applyCardFeedDeltaUpdates:a,cardCountChanged:o,onReady:s,runtimeVariableResolver:d,linkButtonPressed:c,submitButtonPressed:u,onCardListTutorialSeen:h,onAnalyticsEvent:p,onCardEvent:m,onError:g,onAuthTokenRequested:v,onCardFeedSubscribe:f,onModalStreamToggled:b,requestWebSocketReconnect:y,webSocketDisabled:w}=t;const[S,C]=le(Ms().matches?"dark":"light"),[,k]=le(js);ce((()=>{const e=e=>{C(e.matches?"dark":"light")};Ms().addEventListener("change",e);const t=()=>{k(js)};return window.addEventListener("browser-font-changed",t),window.addEventListener("pageshow",(e=>{var t;e.persisted&&!(null===(t=x.containersBroadcastChannel)||void 0===t?void 0:t.isOpen)&&(x.containersBroadcastChannel=new Is)})),()=>{Ms().removeEventListener("change",e),window.removeEventListener("browser-font-changed",t)}}),[]);const x=me((()=>({analyticsDispatcher:{sendEvent:(e,t)=>Os(void 0,void 0,void 0,(function*(){p&&(void 0===t?yield p(e):yield p(e,t))}))},cardEventDispatcher:{dispatchCardEvent:e=>{m&&m(e)}},authTokenProvider:{requestToken:()=>Os(void 0,void 0,void 0,(function*(){return yield v()}))},runtimeVariableResolver:d,containersBroadcastChannel:"BroadcastChannel"in window?new Is:void 0})),[p,m,v]),I=he();return pe(n,(()=>({pollCardList:()=>{var e;l.debug({level3:["Card feed polling initiated"]}),null===(e=I.current)||void 0===e||e.loadCards(!1)},cancelCardListPolling:()=>{var e;null===(e=I.current)||void 0===e||e.cancelCardListPolling()}}))),"toast"===i?(0,ee.h)(Ss,{store:r,onAuthTokenRequested:v}):(0,ee.h)(Qo,{onError:g},(0,ee.h)(Hi.Provider,{value:x},(0,ee.h)(Se.zt,{store:r},(0,ee.h)(Se.lj,{actions:(0,e.Y2)(Vt,Wo),mapToProps:e=>{const{cardResponses:t}=e;return Ts(e,["cardResponses"])}},(e=>{let{cardFeed:t,pendingCardFeedUpdates:n,cardStates:r,navigationStack:i,cardFeedLoading:l,cardFeedLoaded:p,themeLoading:m,themeLoaded:g,finishExternalAction:v,application:{cardListRefreshInterval:C,streamContainerId:k,runtimeVariableResolutionTimeout:x,isPreview:O,embedMode:T,customStrings:F,cardLimit:M,firstLoadStyles:j,interfaceStyle:A},externalAction:D,theme:{themePayload:E}}=e;const _=i.items.length?i.items[i.items.length-1]:void 0;let L;switch(null==_?void 0:_.kind){case"media":L="Media";break;case"subview":L="Card Subview";break;case"snooze":L="Snooze Date & Time Selector";break;case"feedback":L="Send Feedback"}return(0,ee.h)(Ds,{embedMode:T,feedOrientation:kc(t.horizontalContainerConfig),id:"action-cards-sdk-app-root",class:"atomic-sdk-root","data-contentLabel":L},(0,ee.h)(Ps,{ref:I,streamContainerId:k,runtimeVariableResolutionTimeout:x,runtimeVariablesResolver:d,themePayload:E,cardFeed:t,pendingCardFeedUpdates:n,cardStates:r,cardLimit:M,onThemeLoading:m,onThemeLoaded:g,onCardFeedLoading:l,onCardFeedLoaded:p,onCardFeedSubscribe:f,onModalStreamToggled:b,streamFilter:t.streamFilter,requestWebSocketReconnect:y,webSocketDisabled:w,currentNavigationItem:_,onReady:s,onCardCountChanged:o,applyCardFeedDeltaUpdates:a,cardListRefreshInterval:C,isPreview:O,cardListTitle:F.cardListTitle,embedMode:T,externalAction:D,finishExternalAction:v,onLinkButtonPressed:c,onSubmitButtonPressed:u,cardListTutorialSeen:t.tutorialSeen,onCardListTutorialSeen:h,firstLoadStyles:j,colourScheme:S,interfaceStyle:A,noInternetConnectionMessage:F.noInternetConnectionMessage,dataLoadFailedMessage:F.dataLoadFailedMessage,tryAgainTitle:F.tryAgainTitle}))})))))})),e=>"modal-subview"!==e);class Ps extends ee.Component{constructor(e){super(e),Fs(this,"pollCounter",0),Fs(this,"poll",void 0),this.poll=null}componentDidMount(){return Os(this,void 0,void 0,(function*(){this.props.onReady(),Ls(this.props.embedMode)&&this.loadTheme()}))}componentWillUnmount(){this.cancelCardListPolling()}componentDidUpdate(t){var n,r;const{cardFeed:i,externalAction:a}=t,{cardFeed:o,pendingCardFeedUpdates:s,cardStates:l,onCardCountChanged:d,externalAction:c,embedMode:u}=this.props;if("modal-subview"===u||"toast"===u)return;if("modal-stream"===u){var h,p,g,v,f,b;if(0===o.cardInstances.length)null===(h=window.frameElement)||void 0===h||h.classList.add("closed");else null===(p=window.frameElement)||void 0===p||p.classList.remove("closed");if(0===i.cardInstances.length&&o.cardInstances.length>0)null===(g=(v=this.props).onModalStreamToggled)||void 0===g||g.call(v,!0);if(i.cardInstances.length>0&&0===o.cardInstances.length)null===(f=(b=this.props).onModalStreamToggled)||void 0===f||f.call(b,!1)}const y=o.cardInstances.map((e=>e.instance.id)),w=i.cardInstances.map((e=>e.instance.id));var S;Tc(y,w)&&(null===(n=i.metadata)||void 0===n?void 0:n.totalCards)===(null===(r=o.metadata)||void 0===r?void 0:r.totalCards)||this.poll&&d&&d(o.cardInstances.length,null===(S=o.metadata)||void 0===S?void 0:S.totalCards);if(!i.tutorialSeen&&o.tutorialSeen&&this.props.onCardListTutorialSeen&&this.props.onCardListTutorialSeen(),c&&c.actionId!==(null==a?void 0:a.actionId)&&this.handleExternalAction(c),i.runtimeVariables.updateId!==o.runtimeVariables.updateId&&this.trackRuntimeVariablesChanged(o),Object.values(l).every((e=>null===e))&&s&&s.length>0){const t=(0,e.kv)((0,e.Y2)(Vt,Wo),m());this.props.applyCardFeedDeltaUpdates(t,s)}}trackRuntimeVariablesChanged(e){const t=this.context.analyticsDispatcher,n=!1===e.runtimeVariableAnalyticsEnabled;e.cardInstances.forEach((r=>{if(r.runtimeVariables){var i;const a=null===(i=e.runtimeVariables.values)||void 0===i?void 0:i.get(r.instance.id);t.sendEvent({cardInstanceId:r.instance.id,cardViewState:"topview",eventName:ot,properties:{resolvedVariables:r.runtimeVariables.reduce(((e,t)=>(e[t.name]=(null==a?void 0:a.get(t.name))||"",e)),{})}},n)}}))}loadTheme(){return Os(this,void 0,void 0,(function*(){const{streamContainerId:e,onThemeLoading:t,onThemeLoaded:n}=this.props,r=yield Zo(e);if(r)n({theme:r.theme}),Ko(e,r.eTag);else{t();n(yield Ko(e))}const i=m().getState().theme.status;i&&i.loaded&&this.subscribeToCardFeedUpdates()}))}loadCards(e){return Os(this,void 0,void 0,(function*(){const t=this.context,{onCardFeedLoading:n,onCardFeedLoaded:r,streamContainerId:i,runtimeVariableResolutionTimeout:a,cardFeed:o,runtimeVariablesResolver:s,cardLimit:l,streamFilter:d}=this.props;e||n();const c=yield Ho(i,t.authTokenProvider,a,o.lastModified,s,l,d);e&&c.error||r(c),m().getState().cardFeed.status.loaded&&this.pollForNewCards()}))}handleExternalAction(e){return Os(this,void 0,void 0,(function*(){const t=this.context,n=t.analyticsDispatcher,r=t.containersBroadcastChannel,i=()=>Os(this,void 0,void 0,(function*(){var t;return n.sendEvent({cardInstanceId:e.cardInstanceId,cardViewState:e.cardViewState,eventName:rt,properties:Object.assign(Object.assign(Object.assign(Object.assign({linkMethod:e.linkMethod},(null===(t=e.urlLink)||void 0===t?void 0:t.url)?{url:e.urlLink.url}:{}),e.payload?{payload:e.payload.actionPayload}:{}),e.trigger?{detail:e.trigger}:{}),e.subviewData.subviewId?Object.assign(Object.assign({},e.subviewData),{subviewLevel:1}):{})})})),a=()=>{var t;e.payload?(this.props.finishExternalAction(e.actionId),"linkButton"!==e.trigger&&"image"!==e.trigger||!this.props.onLinkButtonPressed?"submitButton"===e.trigger&&this.props.onSubmitButtonPressed&&this.props.onSubmitButtonPressed(e.payload):this.props.onLinkButtonPressed(e.payload)):e.urlLink&&(this.props.finishExternalAction(e.actionId),window.open(e.urlLink.url,null!==(t=e.urlLink.target)&&void 0!==t?t:"_blank"))};if(r){const t=`${e.actionId}-app-external-action`;r.addEventListener("message",(n=>{var i;if(n.data.type!==xs.ANALYTICS_EVENT)return;const o=null===(i=n.data)||void 0===i?void 0:i.eventQueued;o.eventName===rt&&o.cardInstanceId===e.cardInstanceId&&r&&(r.removeEventListener(t),a())}),t),yield i()}else yield i(),a()}))}subscribeToCardFeedUpdates(){return this.props.webSocketDisabled?this.loadCards(!1):this.props.onCardFeedSubscribe()}pollForNewCards(){const{isPreview:e,cardListRefreshInterval:t,embedMode:n}=this.props;!e&&0!==t&&Ls(n)&&(this.poll=setTimeout((()=>Os(this,void 0,void 0,(function*(){this.props.webSocketDisabled?yield this.loadCards(!0):this.pollCounter<9?(this.pollCounter++,yield this.loadCards(!0)):(this.pollCounter=0,l.debug({level3:["Attempt to reconnect websocket initiated"]}),this.props.requestWebSocketReconnect())}))),t))}cancelCardListPolling(){this.poll&&l.debug({level3:["Card feed polling cancelled"]}),clearTimeout(this.poll),this.poll=null,this.pollCounter=0}render(e){var t;let{currentNavigationItem:n,embedMode:r,cardFeed:i,firstLoadStyles:a,colourScheme:o,interfaceStyle:s,noInternetConnectionMessage:l,dataLoadFailedMessage:d,tryAgainTitle:c}=e;const u=m().getState(),h="modal-subview"===r;if(!u.theme.status)return h?null:(0,ee.h)(_s,{embedMode:r,id:$i});if(!1===u.theme.status.loaded)return h?null:(0,ee.h)(_s,{embedMode:r,id:$i},(0,ee.h)(Li,{embedMode:r,textColor:a.textColor,loadingIconColor:a.loadingSpinnerColor,buttonColor:a.buttonTextColor,backgroundColor:a.backgroundColor,onRetry:()=>{this.loadTheme()},state:u.theme.status.errorState,noInternetConnectionMessage:l,dataLoadFailedMessage:d,tryAgainTitle:c}));const{themePayload:p}=this.props;let g;g="standalone"===r&&(null===(t=i.horizontalContainerConfig)||void 0===t?void 0:t.enabled)||"single-card"===r?"feed":Ee(n)?"media":je(n)?"subview":Ae(n)?"snooze":De(n)?"feedback":h?void 0:"feed";const v=p?zo(p,o,s):void 0;if(!g||!v)return null;const f=v.getTheme("feed"),b=v.getTheme("workflow");return(0,ee.h)(ee.Fragment,null,(0,ee.h)(_s,{embedMode:r,feedTheme:f,workFlowTheme:b,renderMode:g,cardHorizontalAlignment:i.cardHorizontalAlignment,modalContainerPositioning:i.modalContainerPositioning,modalContainerVerticalPadding:i.modalContainerVerticalPadding,className:"feed-container",role:"main"},"subview"===g&&(0,ee.h)(ra,{workflowTheme:b,feedTheme:f}),"media"===g&&(0,ee.h)(ma,{workflowTheme:b,feedTheme:f}),"feed"===g&&(0,ee.h)(Ki,{theme:f,onRetry:()=>(this.props.onCardFeedLoading(),this.subscribeToCardFeedUpdates())}),"snooze"===g&&(0,ee.h)(Eo,{workflowTheme:b,feedTheme:f}),"feedback"===g&&(0,ee.h)(fs,{workflowTheme:b,feedTheme:f})),(0,ee.h)(Go,{fontFamilies:f.getFontFamilies()}),(0,ee.h)(hn,null))}}Fs(Ps,"contextType",Hi);const Hs=new Map,Rs=Qt({to:{opacity:"0"}}),$s=Qt({to:{opacity:"1"}}),Ns=Qt({to:{opacity:"1",width:"400%",paddingTop:"400%"}}),Vs=Qt({to:{opacity:"0",transform:"scale(0.9)"}}),Ws=Qt({from:{opacity:"1",transform:"scale(1)"},to:{opacity:"0",transform:"scale(0)"}}),zs=e=>{if(Hs.has(`slideOutleftPadding-${e}`))return Hs.get(`slideOutleftPadding-${e}`);const t=Qt({to:{transform:`translateX(calc(-120% - ${e}px))`}});return Hs.set(`slideOutleftPadding-${e}`,t),t},Bs=Qt({from:{left:"100%"},to:{left:"50%"}}),Us=Qt({from:{},to:{height:"0px"}}),qs=Qt({from:{},to:{width:"0px"}}),Ys=e=>{let{theme:t,animationState:n}=e;return(0,ee.h)(ee.Fragment,null,(0,ee.h)(tl,{theme:t,class:n,"aria-hidden":"true"}),(0,ee.h)(_n,{fillColor:t.getCSSColor("icon.cardCompletion"),className:"tick-icon",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},"aria-hidden":!0}))},Ks=e=>{let{animationState:t,theme:n}=e;return(0,ee.h)(ee.Fragment,null,(0,ee.h)("div",{class:`${t||""} dismiss-icon`,style:{background:n.getCSSColor("background.quickActionPrimary"),pointerEvents:"none"},"aria-hidden":"true"},(0,ee.h)(Ln,{style:{fill:n.getCSSColor("icon.quickActionPrimary")}})),(0,ee.h)("div",{class:`${t||""} clock-icon`,style:{background:n.getCSSColor("background.quickActionSecondary"),pointerEvents:"none"},"aria-hidden":"true"},(0,ee.h)(Pn,{style:{fill:n.getCSSColor("icon.quickActionSecondary")}})))},Zs=Zt("div")((e=>{let{theme:t,topAlign:n,viewState:r,embedMode:i,useHorizontalStyles:a,spaceBetweenCards:o,cardMaximumWidth:s,cardHorizontalAlignment:d}=e,c="rgba(255,255,255,1)";return"subview"===r?c=(ln(t.getCSSColor("background.default")),t.getCSSColor("background.default")):ln(t.getCSSColor("background.card"))&&!ln(t.getCSSColor("background.default"))?c=t.getCSSColor("background.default"):ln(t.getCSSColor("background.card"))||(c=t.getCSSColor("background.card")),c=(e=>{const t=e.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,?\s*(\d*(?:\.\d+)?)?\s*\)$/);if(t){const[,e,n,r]=t;return`rgba(${e},${n},${r},1)`}return l.warn({level3:["Expected a valid RGBA color string, but received:",e,"Returning the original value."]}),e})(c),Object.assign(Object.assign(Object.assign({position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"all",top:"0",bottom:"0",zIndex:As.CARD_OVERLAY,padding:"15px 10px",backgroundColor:c,border:`${t.getShape("border.card")} solid ${t.getCSSColor("border.card")}`,borderRadius:t.getShape("borderRadius.card")||"initial"},n?{}:{display:"flex"}),a?{width:`calc(100% - ${o}px)`}:{}),"modal-stream"===i?{maxWidth:s?`${s}px`:"initial",margin:"0 auto",left:"leading"===d?"0px":"initial",right:"trailing"===d?"0px":"initial"}:{})})),Qs=Zt("div")((e=>{let{topAlign:t}=e;return Object.assign({width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},t?{marginTop:"15vh"}:{})})),Gs=Zt("div")({}),Xs=Zt("div")((e=>{let{theme:t,maxLines:n}=e;return Object.assign({width:"100%",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:`${n}`,textAlign:"center",marginTop:"20px",color:t.getCSSColor("text.processingStateMessage")},t.getCSSFontProperties("processingStateMessage",{skipFallback:!0})||{})})),Js=Zt("button")((e=>{let{theme:t}=e;return Object.assign({width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"15px",padding:"8px",background:"transparent",border:"0",outline:"none",fontWeight:"bold",cursor:"pointer",color:t.getCSSColor("text.processingStateButtonLabel")},t.getCSSFontProperties("processingStateButtonLabel",{skipFallback:!0})||{})})),el=e=>{let{viewState:t,onCancelUpload:n,theme:r,renderOverlay:i,cardMaximumWidth:a,cardHorizontalAlignment:o,spaceBetweenCards:s}=e;return i?(0,ee.h)(Se.lj,{mapToProps:e=>{var t;const n=Me(e),r=n&&je(n);return{customStrings:e.application.customStrings,embedMode:e.application.embedMode,presentingSubview:r,horizontalStreamContainer:!!(null===(t=e.cardFeed.horizontalContainerConfig)||void 0===t?void 0:t.enabled)}}},(e=>{var i,l,d,c;const u=he(null),h=he(null),p=he(null),m=he(null),[g,v]=le(0),f=null!==(i=null===(d=e.customStrings)||void 0===d?void 0:d.processingStateMessage)&&void 0!==i?i:"Sending, please wait...",b=null!==(l=null===(c=e.customStrings)||void 0===c?void 0:c.processingStateCancelButtonTitle)&&void 0!==l?l:"Cancel process";if(ce((()=>{var e,t,n,r,i,a,o,s;const l=null===(e=u.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.clientHeight,d=null===(n=h.current)||void 0===n||null===(r=n.base)||void 0===r?void 0:r.clientHeight,c=null===(i=p.current)||void 0===i||null===(a=i.base)||void 0===a?void 0:a.clientHeight,g=null===(o=m.current)||void 0===o||null===(s=o.base)||void 0===s?void 0:s.clientHeight;if(l&&d&&c&&g){const e=l-d-g-30-20-15,t=parseFloat(getComputedStyle(p.current.base).lineHeight),n=Math.floor(e/t);v(n)}}),[f,b]),"single-card"===e.embedMode&&e.presentingSubview)return null;if("standalone"===e.embedMode&&e.horizontalStreamContainer&&e.presentingSubview)return null;const y="subview"===t&&"standalone"===e.embedMode;return(0,ee.h)(Zs,{theme:r,class:"subview"===t?"use-offset":"",topAlign:y,viewState:t,embedMode:e.embedMode,useHorizontalStyles:e.horizontalStreamContainer&&!e.presentingSubview,spaceBetweenCards:s,cardMaximumWidth:a,cardHorizontalAlignment:o},(0,ee.h)(Qs,{ref:u,theme:r,topAlign:y},(0,ee.h)(Gs,{ref:h},(0,ee.h)(un,{stopColor:r.getCSSColor("icon.processingStateSpinner"),size:30})),(0,ee.h)(Xs,{ref:p,theme:r,maxLines:Math.max(1,g)},f),(0,ee.h)(Js,{ref:m,theme:r,onClick:n},b)))})):null},tl=Zt("div")((e=>{let{theme:t}=e;return{background:t.getCSSColor("background.cardCompletion"),position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",transformOrigin:"center",borderRadius:"999px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",opacity:"0",width:"0px",paddingTop:"0px",".submitting":{animation:`${Ns} 0.6s ease 0.2s forwards`},".submitted":{animation:`${Ns} 0s ease forwards`},".submitted-subview":{animation:`${Ns} 0.6s ease 0.2s forwards`}}})),nl=function(e,t){var n,r,i,a,o;let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const l=e.getNumericalPadding("card"),d=null!==(n=e.getNumericalPadding("stream").left)&&void 0!==n?n:10;return{cardCompletion:{" .tick-icon":{opacity:"0"},".submitting":{overflow:"hidden",padding:`${null!==(r=l.top)&&void 0!==r?r:y}px ${(null!==(i=l.right)&&void 0!==i?i:b)+1}px ${null!==(a=l.bottom)&&void 0!==a?a:y}px ${(null!==(o=l.left)&&void 0!==o?o:b)+1}px`},".submitting .tick-icon":{animation:`${$s} 0.2s ease 0.2s forwards`},".submitting .card-nodes":{animation:`${Rs} 0.2s ease forwards`},".submitted":Object.assign({overflow:"hidden"},"vertical"!==s?{transform:`translateX(calc(-120% - ${d}px))`,opacity:"0"}:{animation:`${Vs} 0.4s ease forwards`}),".submitted .tick-icon":{animation:`${$s} 0.2s ease forwards`},".submitted .card-nodes":{opacity:"0"},".submitted-subview":Object.assign({animation:`${Vs} 0.4s ease 0.8s forwards`,overflow:"hidden"},"vertical"!==s?{transform:`translateX(calc(-120% - ${d}px))`,opacity:"0"}:{}),".submitted-subview .tick-icon":{animation:`${$s} 0.2s ease 0.2s forwards`},".submitted-subview .card-nodes":{animation:`${Rs} 0.2s ease forwards`}},dismissal:{".dismissing":Object.assign({},"vertical"!==s||"modal-stream"===t?{animation:`${Rs} 0.3s ease forwards`}:{animation:`${zs(d)} 0.4s ease forwards`}),".dismissed":Object.assign({transform:`translateX(calc(-120% - ${d}px))`},"vertical"!==s||"modal-stream"===t?{animation:`${Us}`,opacity:"0"}:{})},snooze:{".snoozing":Object.assign({},"vertical"!==s||"modal-stream"===t?{animation:`${Rs} 0.3s ease forwards`}:{animation:`${zs(d)} 0.4s ease forwards`}),".snoozed":Object.assign({transform:`translateX(calc(-120% - ${d}px))`},"vertical"!==s||"modal-stream"===t?{animation:`${Us}`,opacity:"0"}:{})}}},rl=function(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const i=null!==(n=e.right)&&void 0!==n?n:10;return{cardCompletion:{".submitted":Object.assign({overflow:"hidden"},"vertical"===r?{animation:`${Us} 0.4s ease 0.2s forwards`}:{animation:`${qs} 0.4s ease 0.2s forwards`}),".submitted .clock-icon":Object.assign({},"horizontal"===r?{width:"0"}:{}),".submitted .dismiss-icon":Object.assign({},"horizontal"===r?{width:"0"}:{}),".submitted-subview":Object.assign({overflow:"hidden"},"vertical"===r?{animation:`${Us} 0.4s ease 1.0s forwards`}:{animation:`${qs} 0.4s ease 0.2s forwards`})},dismissal:{position:"relative"," .dismiss-icon":Object.assign({position:"absolute",top:"50%",width:"50px",height:"50px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50px"},"vertical"!==r||"modal-stream"===t?{opacity:"0",left:"50%",margin:"-29px 0 0 -20px"}:{left:`calc(120% + ${i+25}px)`,margin:"-25px 0 0 -25px"}),".dismissing .dismiss-icon":Object.assign({},"vertical"!==r||"modal-stream"===t?{animation:`${$s} 0.3s ease 0.3s forwards`}:{animation:`${Bs} 0.4s ease forwards`}),".dismissed":Object.assign({overflow:"hidden"},"vertical"!==r||"modal-stream"===t?{animation:`${qs} 0.3s ease 0.3s forwards`}:{animation:`${Us} 0.4s ease 0.4s forwards`}),".dismissed .dismiss-icon":Object.assign({left:"50%"},"vertical"!==r||"modal-stream"===t?{animation:`${Ws} 0.3s ease forwards`}:{animation:`${Ws} 0.4s ease forwards`}),".dismissed .clock-icon":Object.assign({},"vertical"!==r?{width:"0"}:{})},snooze:{position:"relative"," .clock-icon":Object.assign({position:"absolute",top:"50%",width:"50px",height:"50px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50px"},"vertical"!==r||"modal-stream"===t?{opacity:"0",left:"50%",margin:"-29px 0 0 -20px"}:{left:`calc(120% + ${i+25}px)`,margin:"-25px 0 0 -25px"}),".snoozing .clock-icon":Object.assign({},"vertical"!==r||"modal-stream"===t?{animation:`${$s} 0.3s ease 0.3s forwards`}:{animation:`${Bs} 0.4s ease forwards`}),".snoozed":Object.assign({overflow:"hidden"},"vertical"!==r||"modal-stream"===t?{animation:`${qs} 0.3s ease 0.3s forwards`}:{animation:`${Us} 0.4s ease 0.4s forwards`}),".snoozed .clock-icon":Object.assign({left:"50%"},"vertical"!==r?{animation:`${Ws} 0.3s ease forwards`}:{animation:`${Ws} 0.4s ease forwards`}),".snoozed .dismiss-icon":Object.assign({},"vertical"!==r?{width:"0"}:{})},center:{position:"relative",".centering":{position:"relative",left:"50%",transform:"translateX(-50%)",transition:"left 0.4s ease-out"}}}},il=600,al=600,ol=600,sl=e=>{switch(e){case"submitted":return 400;case"submitted-subview":return 1200;case"dismissed":case"snoozed":return 800;case"centering":return 500;default:return 0}};var ll=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const dl=(e,t,n,r,i,a)=>ll(void 0,void 0,void 0,(function*(){const{dismissingCard:o,dismissedCard:s,failedToDismissCard:d}=t;if(e.application.isPreview)return;o(n);const c=new Promise((e=>setTimeout(e,al)));l.debug({level1:["Dismiss card sent by HTTP"]});const u=yield $o(e.application.streamContainerId,n,i);yield Promise.allSettled([c,u]),u.ok?(l.debug({level1:["Dismiss card sent by HTTP: success"]}),s(n),Oe().clearSubviewsForCardInstance(n),window.AtomicUploadService.cancelUploadForCard(e.application.containerInstanceId,n),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),r.dispatchCardEvent({type:Pi.DISMISSED,eventPayload:u.event})):(l.error({level1:["Dismiss card sent by HTTP: failed"]}),d(n,a,u.error),r.dispatchCardEvent({type:Pi.DISMISS_FAILED}))})),cl=function(e,t,n){var r=arguments;return ll(this,void 0,void 0,(function*(){var i,a,o;let s=r.length>3&&void 0!==r[3]&&r[3],d=r.length>4?r[4]:void 0,c=r.length>5?r[5]:void 0,u=r.length>6?r[6]:void 0,h=r.length>7?r[7]:void 0,p=r.length>8?r[8]:void 0;const{submittingCard:m,submittedCard:g,failedToSubmitCard:v,finishSubview:f,openExternalUrl:b,handleSubmitButtonPayload:y}=t,{postSubmissionUrl:w,payload:S,subviewData:C,submitButtonName:k,cancelSubmitCallback:x}=p||{};if(e.application.isPreview)return;const I=e=>{v(n,s,h,e,{postSubmissionUrl:w,subviewData:C,payload:S,submitButtonName:k}),d.dispatchCardEvent({type:Pi.SUBMIT_FAILED})};let O=!1;const T=(null==C?void 0:C.subviewId)?null===(i=e.cardResponses[n])||void 0===i||null===(a=i.subviews)||void 0===a?void 0:a[null==C?void 0:C.subviewId]:null===(o=e.cardResponses[n])||void 0===o?void 0:o.responses,F=Object.assign(Object.assign({},h),T||{});for(const[e,t]of Object.entries(T||{}))t&&"object"==typeof t&&"image"===t.type&&"string"==typeof t.destinationFilename&&"string"==typeof t.targetBucketId&&(O=!0,F&&(F[e]={filename:t.destinationFilename,targetBucketId:t.targetBucketId}));if(O){const r=window.frameElement,i=r.classList.contains("modal-subview");i&&r.classList.add("uploading-files"),t.startCardFileUpload(n),t.setCardFeedOverlay(!0);const a=yield window.AtomicUploadService.uploadFilesForCard(n,e.application.containerInstanceId,u,c,{subviewData:C,cancelSubmitCallback:x});if(t.finishCardFileUpload(n),!window.AtomicUploadService.getIsUploadingStatus(e.application.containerInstanceId)&&t.setCardFeedOverlay(!1),i&&r.classList.remove("uploading-files"),!a.success)return a.cancelledUploads?null:(l.error({level1:[`Submit of card ${n} failed due to file upload failure`]}),I(a.error))}m(n);const M=new Promise((e=>setTimeout(e,il)));l.debug({level1:["Submit card sent by HTTP"]});const j=yield Ro(e.application.streamContainerId,n,Object.assign(Object.assign({},F),k?{[k]:null}:{}),u);yield Promise.allSettled([M,j]),j.ok?(l.debug({level1:["Submit card sent by HTTP: success"]}),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),f(),(null==w?void 0:w.url)&&b(n,s?"subview":"topview",C||{},"url","submitButton",w),S&&y(n,C||{},S),g(n,s),Oe().clearSubviewsForCardInstance(n),d.dispatchCardEvent({type:Pi.SUBMITTED,eventPayload:j.event})):(l.error({level1:["Submit card sent by HTTP: failed"]}),I(j.error))}))},ul=(e,t,n,r,i,o,s)=>ll(void 0,void 0,void 0,(function*(){const d=(0,a.differenceInSeconds)(r,new Date),{snoozingCard:c,snoozedCard:u,failedToSnoozeCard:h}=t;if(e.application.isPreview)return;c(n);const p=new Promise((e=>setTimeout(e,ol)));l.debug({level1:["Snooze card sent by HTTP"]});const m=yield No(e.application.streamContainerId,n,d,o);yield Promise.allSettled([p,m]),m.ok?(l.debug({level1:["Snooze card sent by HTTP: success"]}),u(n,r),Oe().clearSubviewsForCardInstance(n),Je().clearCardForm(n),window.AtomicUploadService.cancelUploadForCard(e.application.containerInstanceId,n),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),i.dispatchCardEvent({type:Pi.SNOOZED,eventPayload:m.event})):(l.error({level1:["Snooze card sent by HTTP: failed"]}),h(n,r,s,m.error),i.dispatchCardEvent({type:Pi.SNOOZE_FAILED}))})),hl=(e,t,n,r,i)=>{n.sendEvent({cardInstanceId:e,cardViewState:"topview",eventName:it,properties:{source:i}}),t.feedbackReceived(e),r.dispatchCardEvent({type:Pi.VOTED_USEFUL})};var pl=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};function ml(){return ml=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ml.apply(this,arguments)}const gl=(e,t,n,r)=>pl(void 0,void 0,void 0,(function*(){var i;const a=null===(i=(yield Vo([n],t,e)).values)||void 0===i?void 0:i.get(n.instance.id);a&&Object.entries(r).forEach((i=>{let[o,s]=i;"string"==typeof s?r[o]=vc(s,a):Ic(s)&&gl(e,t,n,s)}))})),vl=t=>{let{nodeKey:n,index:r,localIndex:i,isWorkflow:a,clickHandler:o,text:s,icon:l,iconUrl:d,theme:c,appearance:u,loading:h,type:p,urlLink:m}=t;return(0,ee.h)(Se.lj,{actions:(0,e.Y2)(Ye,Ce,Vt),mapToProps:()=>{}},(e=>(0,ee.h)(En,ml({},n&&{nodeKey:n},r&&{index:r},i&&{localIndex:i},{isWorkflow:a,clickHandler:o(e),text:s,icon:l,iconUrl:d,theme:c,appearance:u,loading:h,type:p,urlLink:m}))))},fl=Zt("div")((e=>{let{isWorkflow:t,feedOrientation:n}=e;return Object.assign(Object.assign({},t?{position:"relative"}:{}),t||"horizontal"!==n?{}:{display:"flex",flexDirection:"column",flexGrow:"1",justifyContent:"flex-end"})})),bl=e=>{let{children:t,isWorkflow:n,feedOrientation:r,initializeFormStore:i}=e;return ce((()=>{i()}),[]),(0,ee.h)(fl,{isWorkflow:n,feedOrientation:r},t)},yl=(e,t,n,r)=>()=>{e.createResponseWithDefaults(t,n,r)},wl=Zt("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r,headlineFontProperties:i}=e;const a=t.getShape("padding.elementBottom",{skipFallback:!0});return{color:t.getCSSColor("text.headline"),display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${i.lineHeight} 1fr`,padding:a?`0px 0px ${r?"0px":a}`:`${n?0:10}px 0px ${r?0:10}px`}})),Sl=Zt("h2")((e=>{let{theme:t}=e;return Object.assign(Object.assign({gridColumnStart:"2",gridRowStart:"span 2"},t.getCSSFontProperties("headline")),{margin:"0",whiteSpace:"pre-wrap","overflow-wrap":"break-word","word-wrap":"break-word","word-break":"break-word"})})),Cl="22px",kl=e=>Object.assign(Object.assign({margin:"0",paddingLeft:"0",listStyleType:"none"},e.getCSSFontProperties("body")),{color:e.getCSSColor("text.body")}),xl=e=>{let t;return Oc(t)||(t=e.getCSSFontProperties("bullet")),{"> li":{display:"flex",margin:"0 0 5px"},"> li.without-icon:before":Object.assign({content:'"•"',textAlign:"center",flexBasis:Cl,minWidth:Cl,marginRight:"10px",color:e.getCSSColor("icon.bullet")},t?{fontSize:t.fontSize,lineHeight:t.lineHeight}:{}),"> li.with-icon i":{flexBasis:Cl,minWidth:Cl,textAlign:"center"},"> li:last-child":{marginBottom:"0px"}}},Il=Zt("ul")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return Object.assign(Object.assign(Object.assign({},kl(t)),xl(t)),{padding:i?`0px 0px ${r?"0px":i} 0px`:`${n?0:10}px 0px ${r?0:10}px 0px`})})),Ol=Zt("ol")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return Object.assign(Object.assign(Object.assign({},kl(t)),xl(t)),{padding:i?`0px 0px ${r?"0px":i} 5px`:`${n?0:10}px 20px ${r?0:10}px 0px`,counterReset:"item","> li.without-icon:before":Object.assign(Object.assign(Object.assign({},kl(t)["> li.without-icon:before"]),xl(t)["> li.without-icon:before"]),{content:'counter(item) "."',counterIncrement:"item"})})})),Tl=Zt("ul")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return Object.assign(Object.assign({},kl(t)),{padding:i?`0px 0px ${r?"0px":i} 5px`:`${n?0:10}px 20px ${r?0:10}px 0px`," li":{display:"inline"}," li:before":{content:'", "'}," li:first-child:before":{content:'""'}})}));class Fl{constructor(){this.tagState=new Map,this.tagState.set("__",{open:!1}),this.tagState.set("**",{open:!1}),this.tagState.set("_",{open:!1}),this.tagState.set("*",{open:!1})}toggle(e){const t=this.tagState.get(e);t&&(t.open=!t.open,this.tagState.set(e,t))}}const Ml={"":["<em>","</em>"],_:["<strong>","</strong>"],"\n":["</p><p>"]," ":["<br />"]};function jl(e){return(e+"").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Al(e){return("<p>"+Dl(e)+"</p>").replace(/<p><\/p>/g,"")}function Dl(e,t){const n=new Fl;let r,i,a,o,s,l=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([*+-]|\d+\.)\s+.*)+)|(?:\!\[([^\]]*?)\]\(([^\)]+?)\))|(\[)|(\](?:\(([^\)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(\-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|(__|\*\*|[_*])|( \n\n*|\n{2,})/gm,d=[],c="",u=t||{},h=0;function p(e){var t=Ml[e.replace(/\*/g,"_")[1]||""],n=d[d.length-1]==e;return t?t[1]?(d[n?"pop":"push"](e),t[0|n]):t[0]:e}function m(){let e="";for(;d.length;)e+=p(d[d.length-1]);return e}function g(e){return e.replace(/&%[0-9]+%;/g,(e=>String.fromCharCode(+e.substring(2,e.length-2))))}for(e=e.replace(/\\([*_[\]{}`<>()#+\-!|.])/g,(e=>`&%${e.charCodeAt(1)}%;`)),e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return u[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");a=l.exec(e);){i=e.substring(h,a.index),h=l.lastIndex,r=a[0];let t=!1;if(i.match(/[^\\](\\\\)*\\$/));else if(a[6])s=a[6],s.match(/\./)&&(a[5]=a[5].replace(/^\d+/gm,"")),o=Dl((f=a[5].replace(/^\s*[>*+.-]/gm,"")).replace(RegExp("^"+(f.match(/^(\t| )+/)||"")[0],"gm"),"")),">"!==s&&(t=!0,s=s.match(/\./)?"ol":"ul",o=o.replace(/^(.*)(\n|$)/gm,"<li><span>$1</span></li>")),r="<"+s+">"+o+"</"+s+">";else if(a[10]){const e=(a[11]||"").match(/subview:(?<viewId>.*)/);if(e){const t=((e||{}).groups||{}).viewId?e.groups.viewId:"";c=c.replace("<a>",`<a tabindex="0" class="md-subview-link" data-subview-id="${t}">`)}else c=c.replace("<a>",'<a tabindex="0" target="_blank" class="md-web-link" href="'+jl(a[11]||u[i.toLowerCase()])+'">');r=m()+"</a>"}else if(a[9])r="<a>";else if(a[12])r="<p>"+a[12]+"\n"+a[13]+"</p>",t=!0;else if(a[14])r="<p>"+a[14]+" "+a[15]+"</p>",t=!0;else if(a[17]){const e=a[17];var v=Ml[e.replace(/\*/g,"_")[1]||""];r=n.tagState.has(e)&&n.tagState.get(e).open?v[1]:v[0],n.toggle(e)}else if(a[18]){const e=a[18],t=(a[18].match(/\n/g)||[]).length,n=/[ ]{2}\n/.test(e);r=t>=2?'</p><p class="md-line-break"> </p><p>':n?"<br />":p(e)}else a[4]&&(r="<p>"+a[4]+"</p>",t=!0);c+=i,c+=t?"</p>"+r+"<p>":r}var f;return n.tagState.forEach(((e,t)=>{if(n.tagState.get(t).open){const e=Ml[t.replace(/\*/g,"_")[1]||""][0],n=c.lastIndexOf(e);-1!==n&&(c=c.slice(0,n)+t+c.slice(n+e.length))}})),(g(c)+g(e.substring(h))+m()).trim()}const El=Zt("li")((e=>{let{theme:t}=e;return{color:t.getCSSColor("text.body"),whiteSpace:"pre-wrap","overflow-wrap":"break-word","word-wrap":"break-word","word-break":"break-word"}})),_l=Zt("span")((e=>{let{theme:t}=e;return{" p":{margin:"0",display:"inline"}," a":{color:t.getCSSColor("text.link")}," em":{fontStyle:"italic"}," strong":{fontWeight:"bold"}," .md-subview-link":{textDecoration:"underline",cursor:"pointer"}}})),Ll=Zt("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`}})),Pl=Zt("a")((e=>{let{isLinkEnabled:t,theme:n,url:r}=e;return{border:`1px solid ${n.getCSSColor("border.mediaThumb")}`,borderRadius:n.getShape("borderRadius.mediaThumb")||"0px",overflow:"hidden",display:"flex",backgroundColor:n.getCSSColor("background.mediaThumbnail"),cursor:t||r?"pointer":"default"}})),Hl=Zt("div")((e=>{let{thumbnail:t,theme:n}=e;return{display:"flex",width:"100px",minWidth:"100px",height:"100px",backgroundColor:n.getCSSColor("background.media"),backgroundSize:"cover",backgroundPosition:"center",backgroundImage:`url('${t}')`,alignItems:"center",justifyContent:"center"}})),Rl=Zt("div")((()=>({padding:"12px 15px 10px 15px",display:"flex",flexFlow:"row wrap",minWidth:"0px"}))),$l=Zt("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},t.getCSSFontProperties("mediaTitle")),{color:t.getCSSColor("text.mediaTitle"),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginBottom:"0px",width:"100%"})})),Nl=Zt("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},t.getCSSFontProperties("mediaSubtitle")),{color:t.getCSSColor("text.mediaSubtitle"),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%"})})),Vl=Zt("a")((e=>{let{isLinkEnabled:t,theme:n}=e;return Object.assign(Object.assign(Object.assign({border:"0px"},n.getElementFocusCSSProperties()),n.getCSSFontProperties("mediaAction")),{color:n.getCSSColor("text.mediaAction"),textDecoration:"none",display:"block",marginTop:"auto",width:"100%",cursor:t?"pointer":"default",visibility:t?"visible":"hidden",userSelect:"none"})}));class Wl extends aa{render(){const{nodeKey:e,isFinalCardNode:t,isFirstCardNode:n,children:r,mediaType:i,src:a,theme:o,label:s,description:l,customStrings:d,onClickImage:c,url:u,alt:h}=this.props,{imageLoaded:p,imageLoadFailed:m}=this.state,g=p?a:"",v=this.getPreviewIcon(i),f=i.includes("video"),b=f&&m,y="image"===i||"video"===i,w=this.getElementRole(i),S=f?(null==d?void 0:d.thumbnailVideoActionLinkTitle)||"Watch":(null==d?void 0:d.thumbnailImageActionLinkTitle)||"View",C=f?"A video":"An image";let k="";return y&&(k=(f?"Plays a video":"Displays an image")+": "),k=`${k}${h?h+".":""}`,(0,ee.h)(Ll,{theme:o,isFirstCardNode:n,isFinalCardNode:t},(0,ee.h)(Pl,{key:e,"data-element-key":e,"data-testid":"image-wrapper",theme:o,onClick:c,isLinkEnabled:y,url:u},(0,ee.h)(Hl,{thumbnail:g,theme:o,role:w,"aria-label":k||C},!p&&!b&&v&&(0,ee.h)(v,{fillColor:o.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(p||m)&&r),(0,ee.h)(Rl,null,(0,ee.h)($l,{theme:o,class:"thumbnail-header","aria-label":`${s}.`},s),(0,ee.h)(Nl,{theme:o,class:"thumbnail-format","aria-label":`${l}.`},l),(0,ee.h)(Vl,{theme:o,isLinkEnabled:"image"===i||"video"===i,tabIndex:"0",class:"thumbnail-link",onKeyPress:this.handleKeyPress.bind(this)},S))))}}const zl=Zt("div")((e=>{var t,n,r,i,a,o;let{backgroundImage:s,theme:l,isFinalCardNode:d,dimensions:c,loadedDimensions:u,url:h,isLinkEnabled:p}=e;const m=`calc(${l.getShape("borderRadius.card")} - ${l.getShape("border.card")})`,g=l.getNumericalPadding("card");return Object.assign(Object.assign({width:`calc(100% + ${(null!==(t=g.left)&&void 0!==t?t:b)+(null!==(n=g.right)&&void 0!==n?n:b)}px)`,border:"0px",borderRadius:`${m} ${m} 0 0`,backgroundImage:`url('${s}')`,backgroundSize:"cover",backgroundPosition:"center",backgroundColor:l.getCSSColor("background.media"),display:"flex",alignItems:"center",justifyContent:"center",marginTop:`-${null!==(r=g.top)&&void 0!==r?r:y}px`,marginRight:`-${null!==(i=g.right)&&void 0!==i?i:b}px`,marginBottom:`${d?"0px":null!==(a=l.getShape("padding.elementBottom",{skipFallback:!0}))&&void 0!==a?a:"10px"}`,marginLeft:`-${null!==(o=g.left)&&void 0!==o?o:b}px`,overflow:"hidden",cursor:p||h?"pointer":"default"},Gl({dimensions:c,naturalDimensions:u})),l.getElementFocusCSSProperties())}));class Bl extends aa{onImageLoad(e){super.onImageLoad(e),this.props.onLoad&&this.props.onLoad({width:e.naturalWidth,height:e.naturalHeight})}render(){const{nodeKey:e,children:t,isFinalCardNode:n,mediaType:r,src:i,theme:a,onClickImage:o,dimensions:s,url:l,alt:d}=this.props,{imageLoaded:c,imageLoadFailed:u}=this.state,h=c?i:"",p=this.getPreviewIcon(r),m=r.includes("video")&&u,g="image"===r||"video"===r,v=this.getElementRole(r),f=r.includes("video")?"A banner video":"A banner image";let b="";return g&&(b=(r.includes("video")?"Plays a video":"Displays an image")+": "),b+=d,(0,ee.h)(zl,{key:e,"data-element-key":e,"data-testid":"image-wrapper",backgroundImage:h,theme:a,isFinalCardNode:n,mediaType:r,url:l,dimensions:s,loadedDimensions:this.state.loadedDimensions,onClick:o,onKeyPress:this.handleKeyPress.bind(this),tabIndex:"0",className:"image-banner",role:v,isLinkEnabled:g,"aria-label":b||f},!c&&!m&&p&&(0,ee.h)(p,{fillColor:a.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(c||u)&&t)}}const Ul=Zt("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`}})),ql=Zt("div")((e=>{let{backgroundImage:t,theme:n,dimensions:r,loadedDimensions:i,url:a,isLinkEnabled:o}=e;const s=n.getCSSColor("border.media");return Object.assign(Object.assign(Object.assign(Object.assign({},ln(s)?{}:{border:`1px solid ${n.getCSSColor("border.media")}`}),{borderRadius:`${n.getShape("borderRadius.media")}`,backgroundImage:`url('${t}')`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundColor:n.getCSSColor("background.media"),display:"flex",alignItems:"center",justifyContent:"center",cursor:o||a?"pointer":"default",overflow:"hidden"}),Gl({dimensions:r,naturalDimensions:i})),n.getElementFocusCSSProperties())}));class Yl extends aa{onImageLoad(e){super.onImageLoad(e),this.props.onLoad&&this.props.onLoad({width:e.naturalWidth,height:e.naturalHeight})}render(){const{nodeKey:e,children:t,isFirstCardNode:n,isFinalCardNode:r,mediaType:i,src:a,dimensions:o,url:s,onClickImage:l,theme:d,alt:c}=this.props,{imageLoaded:u,imageLoadFailed:h}=this.state,p=u?a:"",m=this.getPreviewIcon(i),g=i.includes("video")&&h,v="image"===i||"video"===i,f=this.getElementRole(i),b=i.includes("video")?"A video":"An image";let y="";return v&&(y=(i.includes("video")?"Plays a video":"Displays an image")+": "),y+=c,(0,ee.h)(Ul,{theme:d,isFirstCardNode:n,isFinalCardNode:r},(0,ee.h)(ql,{key:e,"data-element-key":e,"data-testid":"image-wrapper",backgroundImage:p,dimensions:o,loadedDimensions:this.state.loadedDimensions,mediaType:i,url:s,onClick:l,onKeyPress:this.handleKeyPress.bind(this),theme:d,tabIndex:"0",className:"image-inline",role:f,isLinkEnabled:v,ariaLabel:y||b},!u&&!g&&m&&(0,ee.h)(m,{fillColor:d.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(u||h)&&t))}}const Kl=Zt("p")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`,margin:"0",overflow:"hidden",textOverflow:"ellipsis"}})),Zl=Zt("a")((e=>{let{theme:t,mediaType:n,url:r}=e;return Object.assign(Object.assign(Object.assign(Object.assign({border:"0px"},t.getElementFocusCSSProperties()),{color:t.getCSSColor("text.link")}),t.getCSSFontProperties("body")),{textDecoration:"none",cursor:"image"===n||"video"===n||r?"pointer":"default","&:hover":{textDecoration:"underline"},whiteSpace:"pre-wrap"})}));class Ql extends aa{preloadsImage(){return!1}render(){const{nodeKey:e,theme:t,isFirstCardNode:n,isFinalCardNode:r,label:i,onClickImage:a,mediaType:o,url:s}=this.props;return(0,ee.h)(Kl,{key:e,"data-element-key":e,theme:t,isFirstCardNode:n,isFinalCardNode:r},(0,ee.h)(Zl,{theme:t,onClick:a,onKeyPress:this.handleKeyPress.bind(this),tabIndex:"0",className:"image-text",mediaType:o,url:s},i))}}const Gl=e=>{var t,n;let{dimensions:r,naturalDimensions:i}=e;if(null==r?void 0:r.height)switch(null==r?void 0:r.height){case"short":return{height:"50px"};case"medium":return{height:"120px"};case"tall":default:return{height:"200px"};case"original":const e=(null==r||null===(t=r.originalDimensions)||void 0===t?void 0:t.width)||(null==i?void 0:i.width),a=(null==r||null===(n=r.originalDimensions)||void 0===n?void 0:n.height)||(null==i?void 0:i.height);return e&&a?{aspectRatio:`${e} / ${a}`}:{height:"200px"}}return{height:"200px"}},Xl=e=>{let{fillColor:t,ariaHidden:n=!1}=e;return(0,ee.h)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"A play button icon","aria-hidden":n},(0,ee.h)("path",{d:"M6 15.1958V3.80425C6 3.01881 6.86395 2.53997 7.53 2.95625L16.6432 8.652C17.2699 9.04367 17.2699 9.95633 16.6432 10.348L7.53 16.0438C6.86395 16.46 6 15.9812 6 15.1958Z",stroke:t,strokeWidth:"2"}))},Jl=Zt("div")((e=>{let{theme:t}=e;return{borderRadius:"40px",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",background:t.getCSSColor("background.mediaControl")}})),ed=e=>{let{onClick:t,theme:n}=e;return(0,ee.h)(Jl,{onClick:t,theme:n},(0,ee.h)(Xl,{fillColor:n.getCSSColor("icon.mediaControl"),ariaHidden:!0}))},td={objectFit:"contain",width:"100%",height:"100%",background:"black"},nd=Zt("video")(Object.assign({},td)),rd=Zt("video")((()=>Object.assign({},td))),id=Zt("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`}})),ad=Zt("div")((e=>{var t,n,r;let{theme:i,isFinalCardNode:a,dimensions:o,loadedDimensions:s,format:l}=e;const d=i.getNumericalPadding("card"),c=i.getShape("padding.elementBottom",{skipFallback:!0}),u=`calc(${i.getShape("borderRadius.card")||"0px"} - ${i.getShape("border.card")})`;return Object.assign(Object.assign({borderRadius:"banner"===l?`${u} ${u} 0 0`:u,overflow:"hidden"},"banner"===l?{margin:`-${null!==(t=d.top)&&void 0!==t?t:y}px -${null!==(n=d.right)&&void 0!==n?n:b}px ${a?"0px":null!=c?c:"10px"} -${null!==(r=d.left)&&void 0!==r?r:b}px`}:{}),o?Gl({dimensions:o,naturalDimensions:s}):{height:"200px"})})),od=Zt("div")((e=>{let{theme:t}=e;return{background:t.getCSSColor("overlay.mediaBanner"),display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"}})),sd=e=>{let t,{nodeKey:n,cardInstanceId:r,label:i,description:a,format:o,src:s,altText:l,theme:d,isFirstCardNode:c,isFinalCardNode:u,thumbnailSrc:h,dimensions:p,setPlaying:m,onLoad:g}=e,v=!1,f=!1;switch(o){case"banner":t=Bl,v=!0,f=!0;break;case"inline":t=Yl,v=!0,f=!0;break;case"thumbnail":t=Wl,v=!0;break;case"text":t=Ql}return(0,ee.h)(Se.lj,{actions:Ce,mapToProps:e=>({customStrings:e.application.customStrings})},(e=>(0,ee.h)(t,{nodeKey:n,theme:d,isFirstCardNode:c,isFinalCardNode:u,customStrings:e.customStrings,src:h,dimensions:p,onLoad:g,alt:null==l?void 0:l.src,label:i,description:a,mediaType:null!==s&&s.length>0?"video":"videoWithoutSrc",onClickImage:()=>{f?m(!0):e.viewMedia(r,{type:"video",url:s,title:i,alt:null==l?void 0:l.src})}},v&&(0,ee.h)(od,{theme:d},(0,ee.h)(ed,{onClick:()=>f&&m(!0),theme:d})))))},ld=e=>{var t,n;let{format:r,theme:i,isFirstCardNode:a,isFinalCardNode:o,src:s,cardInstanceId:l,dimensions:d,loadedDimensions:c,isWorkflow:u}=e;const h=he(null),p=ge(Hi).analyticsDispatcher,m="string"==typeof s&&null!==(t=null===(n=s.match(/[^\/]*$/))||void 0===n?void 0:n[0])&&void 0!==t?t:"";switch(ce((()=>{var e,t,n,r;const i=()=>{p.sendEvent({eventName:pt,cardInstanceId:l,cardViewState:u?"subview":"topview",properties:{media:m,mediaURL:s}})},a=()=>{p.sendEvent({eventName:mt,cardInstanceId:l,cardViewState:u?"subview":"topview",properties:{media:m,mediaURL:s}})};return null===(e=h.current)||void 0===e||null===(t=e.base)||void 0===t||t.addEventListener("play",i),null===(n=h.current)||void 0===n||null===(r=n.base)||void 0===r||r.addEventListener("ended",a),()=>{var e,t,n,r;null===(e=h.current)||void 0===e||null===(t=e.removeEventListener)||void 0===t||t.call(e,"play",i),null===(n=h.current)||void 0===n||null===(r=n.removeEventListener)||void 0===r||r.call(n,"ended",a)}}),[]),r){case"banner":return(0,ee.h)(Se.lj,{mapToProps:e=>({applicationOpen:e.application.open})},(e=>{var t;let{applicationOpen:n}=e;return!n&&(null==h||null===(t=h.current)||void 0===t?void 0:t.base)&&h.current.base.pause(),(0,ee.h)(ad,{theme:i,isFinalCardNode:o,format:r,dimensions:d,loadedDimensions:c},(0,ee.h)(nd,{ref:h,src:s,playsInline:!0,autoplay:!0,controls:!0}))}));case"inline":return(0,ee.h)(Se.lj,{mapToProps:e=>({applicationOpen:e.application.open})},(e=>{var t;let{applicationOpen:n}=e;return!n&&(null==h||null===(t=h.current)||void 0===t?void 0:t.base)&&h.current.base.pause(),(0,ee.h)(id,{theme:i,isFirstCardNode:a,isFinalCardNode:o},(0,ee.h)(ad,{theme:i,isFinalCardNode:o,format:r,dimensions:d,loadedDimensions:c},(0,ee.h)(rd,{ref:h,src:s,playsInline:!0,autoplay:!0,controls:!0})))}));default:return null}},dd=(e,t)=>{let n;return Oc(n)||(n=e.getCSSFontProperties("bullet")),{[`>${t} > li`]:Object.assign({display:"flex",margin:"0 0 5px"},"ol"===t?{counterIncrement:"count"}:{}),[`>${t} > li:before`]:Object.assign({content:"ol"===t?'counter(count)"."':'"•"',textAlign:"center",marginRight:"10px",flexBasis:`${Cl}`,minWidth:`${Cl}`,color:e.getCSSColor("icon.bullet")},n?{fontSize:n.fontSize,lineHeight:n.lineHeight}:{}),[`>${t} > li:last-child`]:{marginBottom:"0px"}}},cd=e=>{var t;let{theme:n,styles:r}=e;const i=null!==(t=n.getShape("padding.elementBottom",{skipFallback:!0}))&&void 0!==t?t:"20px";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:n.getCSSColor("text.body"),gridColumnStart:"2",gridRowStart:"span 2"},n.getCSSFontProperties("body")),{marginRight:"10px"," em":{fontStyle:"italic"}," strong":{fontWeight:"bold"}," code":{borderRadius:"3px",padding:"5px",backgroundColor:"rgba(0,0,0,0.05)"},"> ul":Object.assign({},{paddingLeft:"0",margin:"0",listStyleType:"none"})}),dd(n,"ul")),{"> ol":Object.assign(Object.assign({},{paddingLeft:"0",margin:"0",listStyleType:"none"}),{counterReset:"count"}),"> ul:not(:first-child)":{marginTop:i},"> ol:not(:first-child)":{marginTop:i},"> ul:not(:last-child)":{marginBottom:i},"> ol:not(:last-child)":{marginBottom:i},"> ul:has(+ p.md-line-break)":{marginBottom:"0px"},"> ol:has(+ p.md-line-break)":{marginBottom:"0px"}}),dd(n,"ol")),{" a":{color:n.getCSSColor("text.link")}," p":Object.assign(Object.assign({margin:"0px 0 0 0",whiteSpace:"pre-wrap","overflow-wrap":"break-word","word-wrap":"break-word","word-break":"break-word"},n.getCSSFontProperties("body")),{overflow:"hidden"})," p:not(:first-child)":{marginTop:i}," p:not(:last-child)":{marginBottom:i}," p:has(+ p.md-line-break)":{marginBottom:"0px"}," p.md-line-break + p":{marginTop:"0px"}," p.md-line-break + ul":{marginTop:"0px"}," p.md-line-break + ol":{marginTop:"0px"}," p:not(:first-child).md-line-break":{marginTop:"0px"}," p:not(:last-child).md-line-break":{marginBottom:"0px"}," .md-subview-link":{textDecoration:"underline",cursor:"pointer"}}),r)},ud=Zt("div")((e=>{let{theme:t}=e;return cd({theme:t})})),hd=Zt("div")({position:"absolute",top:"-1000px",left:"-1000px",width:"1px",height:"1px",overflow:"hidden"}),pd=Zt("div")((e=>{let{bodyFontProperties:t}=e;return{position:"absolute",width:"100%",visibility:"hidden",pointerEvents:"none",display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${t.lineHeight} 1fr`}})),md=Zt("div")((e=>{let{theme:t}=e;return cd({theme:t,styles:{"& *":{marginTop:"0!important",marginBottom:"0!important"}}})})),gd=Zt("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r,bodyFontProperties:i}=e;const a=t.getShape("padding.elementBottom",{skipFallback:!0}),o=a?`0px 0px ${r?"0px":a}`:`${n?0:10}px 0px ${r?0:10}px`;return{display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${i.lineHeight} 1fr`,color:t.getCSSColor("text.body"),padding:o}})),vd=()=>window.matchMedia("(prefers-color-scheme: dark)");function fd(){var e;const t=document.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",document.body.appendChild(t);const n=document.createElement("div");t.appendChild(n);const r=t.offsetWidth-n.offsetWidth;return null===(e=t.parentNode)||void 0===e||e.removeChild(t),r}function bd(e,t,n,r,i){var a,o,s,l,d,c,u,h,p,m,g,v;const f=document.createElement("button"),b=document.createElement("span"),y=document.createElement("span");y.innerHTML="… ";const w=t.getCSSFontProperties("expandCollapse",{skipFallback:!0,skipFontFallbacks:!0}),S=t.getCSSFontProperties("body"),C=t.getShape("padding.expandCollapseLeft")||"0px",k="expand"===n?"Show more":"Show less",x="expand"===n;return f.style.fontFamily="inherit",f.style.fontSize="inherit",f.style.lineHeight="inherit",b.style.paddingLeft=x?C:"0px",b.style.color=null!==(a=t.getCSSColor("text.expandCollapse",{skipFallback:!0}))&&void 0!==a?a:t.getCSSColor("text.body"),f.style.color=null!==(o=t.getCSSColor("text.expandCollapse",{skipFallback:!0}))&&void 0!==o?o:t.getCSSColor("text.body"),b.style.fontWeight=null!==(s=null==w?void 0:w.fontWeight)&&void 0!==s?s:null==S?void 0:S.fontWeight,f.style.fontWeight=null!==(l=null==w?void 0:w.fontWeight)&&void 0!==l?l:null==S?void 0:S.fontWeight,b.style.fontStyle=null!==(d=null==w?void 0:w.fontStyle)&&void 0!==d?d:null==S?void 0:S.fontStyle,f.style.fontStyle=null!==(c=null==w?void 0:w.fontStyle)&&void 0!==c?c:null==S?void 0:S.fontStyle,b.style.textTransform=null!==(u=null==w?void 0:w.textTransform)&&void 0!==u?u:null==S?void 0:S.textTransform,f.style.textTransform=null!==(h=null==w?void 0:w.textTransform)&&void 0!==h?h:null==S?void 0:S.textTransform,b.style.fontSynthesis=null!==(p=null==w?void 0:w.fontSynthesis)&&void 0!==p?p:null==S?void 0:S.fontSynthesis,f.style.fontSynthesis=null!==(m=null==w?void 0:w.fontSynthesis)&&void 0!==m?m:null==S?void 0:S.fontSynthesis,b.textContent=e&&e.length?e:k,y.style.color=t.getCSSColor("text.body"),y.style.fontWeight=null!==(g=null==S?void 0:S.fontWeight)&&void 0!==g?g:"normal",y.style.fontStyle=null!==(v=null==S?void 0:S.fontStyle)&&void 0!==v?v:"normal",f.innerHTML=`${x?y.outerHTML:""}${b.outerHTML}`,f.style.display="inline",f.style.border="none",f.style.background="none",f.style.margin="0",f.style.padding="0",f.style.cursor="pointer",f.style.maxWidth=i,f.style.textAlign="left",x&&(f.style.whiteSpace="nowrap",f.style.overflow="hidden",f.style.textOverflow="ellipsis"),f.id=r,f.setAttribute("data-testid","text-expand-collapse-button"),f}function yd(e){let t=e.nextSibling;for(;t;){const e=t;t=t.nextSibling,e.remove()}}function wd(e,t,n,r,i,a){var o,s;if(!e)return!1;const l=bd(null!=a?a:"Show more",i,"expand",`expand-text-${r}`,t.getBoundingClientRect().width+"px");l.style.marginRight=fd()+"px";const d=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),c=[];let u;for(;u=d.nextNode();){const e=null!==(o=u.textContent)&&void 0!==o?o:"",t=/\u00A0/.test(e);(e.trim().length>0||t)&&c.push(u)}let h=null,p=0,m=!1;for(let r=c.length-1;r>=0;r--){var g,v;const i=c[r],a=i.nodeValue||"";let o=0,s=a.length;null===(g=i.parentElement)||void 0===g||g.appendChild(l);const d=i.parentElement;if(!d)continue;for(;o<=s;){const e=Math.floor((o+s)/2);" "===a?i.nodeValue=e>0?" ":"":a.startsWith(" ")?i.nodeValue=0===e?"":" "+a.slice(1,e):i.nodeValue=a.slice(0,e);Math.ceil(t.getBoundingClientRect().height)<=n?(p=e,o=e+1):s=e-1}l.remove();const u=d.closest("li");if(u&&!(null===(v=u.textContent)||void 0===v?void 0:v.trim())){u.remove();continue}const f="p"===e.tagName.toLowerCase()&&"a"===d.tagName.toLowerCase();if(f&&0===p&&d.remove(),0===r||p>0){h=i,m=!f&&p<4;break}}if(h){var f,b;const e=null!==(s=h.textContent)&&void 0!==s?s:"";h.textContent=e.slice(0,m?4:p).trimEnd(),yd(h);const n=null===(f=h.parentElement)||void 0===f?void 0:f.closest("a");n&&yd(n);const o=null===(b=h.parentElement)||void 0===b?void 0:b.closest("li");o&&yd(o);let l=0;if(m){var y;const t=document.createElement("span");t.textContent=e.slice(0,4).trimEnd(),null===(y=h.parentElement)||void 0===y||y.appendChild(t),l=t.getBoundingClientRect().width,t.remove()}const d=bd(null!=a?a:"Show more",i,"expand",`expand-text-${r}`,t.getBoundingClientRect().width-l-fd()+"px"),c=h.parentElement;return"p"===(null==c?void 0:c.tagName.toLowerCase())&&c.classList.contains("md-line-break")?(c.style.marginTop="0px",c.after(d)):"a"===(null==c?void 0:c.tagName.toLowerCase())&&c.parentElement?c.parentElement.insertBefore(d,c.nextSibling):null==c||c.appendChild(d),!0}return!1}const Sd=e=>{let{fillColor:t}=e;return(0,ee.h)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,ee.h)("path",{d:"M15 10V20M20 15H15H10",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))},Cd=e=>{let{fillColor:t}=e;return(0,ee.h)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,ee.h)("path",{d:"M20 15H10",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))},kd=Zt("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.component"),color:t.getCSSColor("text.primary"),display:"flex",":focus":{outline:"none"},"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none"}})),xd=Zt("button")((e=>{let{theme:t,disabled:n}=e;return Object.assign(Object.assign({backgroundColor:n?t.getCSSColor("background.stepperDisabled"):t.getCSSColor("background.stepper"),border:"0px",borderRadius:"99px",width:"24px",height:"24px",display:"flex",padding:"0",alignItems:"center",cursor:n?"initial":"pointer"},t.getElementFocusCSSProperties()),{" svg":{height:"100%"}})})),Id=Zt("input")((e=>{let{theme:t}=e;return Object.assign(Object.assign({color:t.getCSSColor("text.primary")},t.getCSSFontProperties("primary")),{backgroundColor:t.getCSSColor("background.component"),width:"40px",maxWidth:"40px",minWidth:"40px",paddingTop:"1px",textAlign:"center",border:"0","-moz-appearance":"textfield",":focus":{outline:"none"},"::-webkit-inner-spin-button, ::-webkit-outer-spin-button":{"-webkit-appearance":"none",margin:"0"}})})),Od=Zt("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},t.getCSSFontProperties("primary")),{color:t.getCSSColor("text.primary"),flexGrow:"1",whiteSpace:"pre-wrap"})})),Td=(e,t,n)=>e-n>=t,Fd=(e,t,n)=>e+n<=t;let Md=null;const jd=Zt("button")((e=>{let{on:t,theme:n}=e;return Object.assign({backgroundColor:n.getCSSColor(t?"background.switchOn":"background.switchOff"),transition:"0.25s ease-in-out",position:"relative",border:"0px",borderRadius:"99px",width:"40px",height:"22px",cursor:"pointer",flexShrink:"0"},n.getElementFocusCSSProperties())})),Ad=Zt("div")((e=>{let{on:t,theme:n}=e;return{transition:"0.25s ease-in-out",position:"absolute",top:"2px",left:t?"50%":"2px",backgroundColor:n.getCSSColor(t?"icon.switchOn":"icon.switchOff"),width:"18px",height:"18px",borderRadius:"99px"}})),Dd=Zt("p")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return Object.assign(Object.assign({display:"grid",gridTemplateColumns:"auto minmax(0,1fr)",color:t.getCSSColor("text.category")},t.getCSSFontProperties("category")),{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`,margin:"0"})})),Ed=Zt("span")({whiteSpace:"pre-wrap",overflow:"hidden",overflowWrap:"break-word",wordWrap:"break-word",wordBreak:"break-word"});let _d=null;const Ld=e=>{let{fillColor:t,ariaHidden:n}=e;return(0,ee.h)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":null!=n&&n},(0,ee.h)("path",{d:"M12 13V7M3 3H8M17 3H12M4 7V16C4 16.5523 4.44772 17 5 17H15C15.5523 17 16 16.5523 16 16V7M8 3L9 2H11L12 3M8 3H12M8 7V13",stroke:t,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},Pd=e=>{let{fillColor:t,ariaHidden:n}=e;return(0,ee.h)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":null!=n&&n},(0,ee.h)("path",{d:"M15 7V13.5C15 15.9853 12.9853 18 10.5 18V18C8.01472 18 6 15.9853 6 13.5V5C6 3.34315 7.34315 2 9 2V2C10.6569 2 12 3.34315 12 5V13.5C12 14.3284 11.3284 15 10.5 15V15C9.67157 15 9 14.3284 9 13.5V7",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))};var Hd=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const Rd={jpeg:{signatures:[[255,216,255]],offset:0},png:{signatures:[[137,80,78,71,13,10,26,10]],offset:0},webp:{signatures:[[82,73,70,70,,,,,87,69,66,80]],offset:0},avif:{signatures:[[32,102,116,121,112,97,118,105,102]],offset:3}},$d={tif:{signatures:[[73,73,42,0],[77,77,0,42]],offset:0},tiff:{signatures:[[73,73,43,0],[73,73,0,43]],offset:0},heic:{signatures:[[102,116,121,112,104,101,105,99]],offset:4}};var Nd=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const Vd=Zt("label")((()=>({position:"relative",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",display:"flex",alignItems:"center",width:"100%",cursor:"pointer"}))),Wd=Zt("div")((e=>{let{theme:t,enabledThumbnailIcon:n,preview:r}=e;const i=n||(null==r?void 0:r.url)?"30px":"0",a={background:`url(${null==r?void 0:r.url})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"};return Object.assign({width:i,height:i,minWidth:i,minHeight:i,padding:n||(null==r?void 0:r.url)?"7px":"0",marginRight:n||(null==r?void 0:r.url)?"10px":"0",display:"flex",justifyContent:"center",alignItems:"center",borderRadius:t.getShape("borderRadius.uploadPlaceholder")||"0px",backgroundColor:t.getCSSColor("background.uploadPlaceholder")},(null==r?void 0:r.url)&&r.webCompatible?a:{})})),zd=Zt("span")((e=>{let{theme:t,placeholder:n,yPadding:r}=e;return Object.assign(Object.assign({width:"100%",overflow:"hidden",textOverflow:"ellipsis",padding:`${r}px 0`,color:n?t.getCSSColor("text.hint"):t.getCSSColor("text.secondary")},t.getCSSFontProperties("secondary")),{userSelect:"none","-webkit-user-select":"none","-moz-user-select":"none"})})),Bd=Zt("input")({position:"absolute",visibility:"hidden",width:"100%",height:"100%"}),Ud=Zt("button")((()=>({display:"flex",justifyContent:"center",alignItems:"center",border:"0",padding:"0",margin:"0",textDecoration:"none",cursor:"pointer",textAlign:"center",background:"none","-webkit-appearance":"none","-moz-appearance":"none"}))),qd=Zt("button")((()=>({display:"flex",justifyContent:"center",alignItems:"center",border:"0",padding:"0",margin:"0",textDecoration:"none",cursor:"pointer",textAlign:"center",background:"none","-webkit-appearance":"none","-moz-appearance":"none"}))),Yd=e=>{let{theme:n,cardInstanceId:r,subviewId:i,name:a,label:o,validations:s,enabledThumbnailIcon:l,targetBucketId:d,variableResolver:c}=e;const u=he(null),h=he(null),p=et(r,a,i),[g,v]=le(null),[f,b]=le(null),[y,w]=le(0),S=m().getState();ce((()=>{if(S.application.isPreview)return;const e=window.AtomicUploadService.getFile(S.application.containerInstanceId,r,a);p&&e?(k(e),b(p.filename)):Je().handleFormChange(r,a,void 0,i)}),[]),ce((()=>{if(u.current&&h.current&&!y){var e,t,n,r;const i=(null===(e=u.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.offsetHeight)||0,a=(null===(n=h.current)||void 0===n||null===(r=n.base)||void 0===r?void 0:r.offsetHeight)||0;if(i>0&&a>0&&i>a){const e=Math.round((i-a)/2);w(e)}}}),[u]);const C=(e,t)=>{v({url:URL.createObjectURL(e),webCompatible:!t})},k=e=>{const t=u.current.base;if(t){C(e.file,e.convertImage);const n=new DataTransfer;n.items.add(e.file),t.files=n.files}},x=()=>{S.application.isPreview||(window.AtomicUploadService.removeFile(S.application.containerInstanceId,r,a,i),Je().handleFormChange(r,a,void 0,i),Je().validateField(r,a,void 0,s,i),u.current&&(v(null),b(null),u.current.base.value=null))},I=`upload-label=${r}-${a}`;return(0,ee.h)(ee.Fragment,null,(0,ee.h)(Wd,{theme:n,enabledThumbnailIcon:l,preview:g},!g&&l&&(0,ee.h)(mn,{fillColor:n.getCSSColor("icon.uploadPlaceholder"),ariaHidden:!0}),g&&!g.webCompatible&&(0,ee.h)(_n,{fillColor:n.getCSSColor("icon.uploadPlaceholder"),ariaHidden:!0})),(0,ee.h)(Vd,{htmlFor:I},(0,ee.h)(zd,{ref:h,theme:n,placeholder:!f,yPadding:y},f||c(o.length?o:"")),(0,ee.h)(Bd,{id:I,ref:u,type:"file",accept:"image/jpeg, image/png, image/webp, image/avif",onChange:e=>Nd(void 0,void 0,void 0,(function*(){if(S.application.isPreview)return;const n=e.target;if(n.files&&n.files.length){v(null),b(null);const[e]=Array.from(n.files),o=yield(e=>Hd(void 0,void 0,void 0,(function*(){const t=yield e.slice(0,(()=>{const e=Object.assign(Object.assign({},Rd),$d);return Object.values(e).reduce(((e,t)=>{let n=0;return t.signatures.forEach((e=>n=Math.max(n,e.length))),n+=t.offset,Math.max(e,n)}),0)})()).arrayBuffer(),n=new Uint8Array(t),r=(e,t)=>e.every(((e,r)=>n[t+r]===e||void 0===e));for(const{signatures:e,offset:t}of Object.values(Rd))for(const n of e)if(r(n,t))return{requiresConversion:!1,isValidImage:!0};for(const{signatures:e,offset:t}of Object.values($d))for(const n of e)if(r(n,t))return{requiresConversion:!0,isValidImage:!0};return{requiresConversion:!1,isValidImage:!1}})))(e);if(!o.isValidImage)return x(),void Je().validateFieldCustomResult(r,a,{type:"invalid",errorMessage:"Invalid file or unsupported image format selected"},i);const l=`${(0,t.v4)()}_${e.name}`,c={filename:e.name,destinationFilename:l,size:e.size,type:"image",targetBucketId:d};window.AtomicUploadService.storeFile(e,"image",d,r,S.application.containerInstanceId,l,o.requiresConversion,a,i),Je().handleFormChange(r,a,c,i),C(e,o.requiresConversion),b(e.name),Je().validateField(r,a,c,s,i)}}))})),f?(0,ee.h)(qd,{onClick:x,"aria-label":"remove image"},(0,ee.h)(Ld,{fillColor:n.getCSSColor("icon.inputButton"),ariaHidden:!0})):(0,ee.h)(Ud,{onClick:()=>{var e,t;return null==u||null===(e=u.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.click()},"aria-label":"attach image"},(0,ee.h)(Pd,{fillColor:n.getCSSColor("icon.inputButton"),ariaHidden:!0})))},Kd=Jn((e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{label:i,name:a,type:o,enabledThumbnailIcon:s,targetBucketId:l},theme:d,isFinalCardNode:c,validations:u,variableResolver:h}=e;const p="image"===o?(0,ee.h)(Yd,{theme:d,cardInstanceId:n,subviewId:r,name:a,validations:u,label:i,enabledThumbnailIcon:s,targetBucketId:l||"DEFAULT",variableResolver:h}):null;return(0,ee.h)(ee.Fragment,null,(0,ee.h)(no,{nodeKey:t,theme:d,isFinalCardNode:c,cursor:"default",mode:"inline"},p),(0,ee.h)(co,{name:a,cardInstanceId:n,subviewId:r,theme:d,isFinalCardNode:c,variableResolver:h}))}),((e,t)=>e.nodeKey===t.nodeKey&&e.cardInstanceId===t.cardInstanceId&&e.subviewId===t.subviewId&&e.attributes===t.attributes&&e.theme===t.theme&&e.validations===t.validations)),Zd=Zt("div")((e=>{var t,n,r,i,a,o,s,l,d,c,u,h,p;let{theme:m,paddingValues:g,feedOrientation:v,isFirstCardNode:f,ruleBetween:b,buttonLayout:y}=e;const{containerPadding:w,containerHorizontalPaddingFallback:S,containerVerticalPaddingFallback:C,buttonGroupPadding:k,buttonGroupVerticalPaddingFallback:x}=g;let I=b?"0px":null!==(t=m.getShape("buttonSpacingAfter.global",{skipFallback:!0}))&&void 0!==t?t:"10px";const O=m.getShape("buttonAlignment.global"),T=Object.assign({flexGrow:"1",flexDirection:"column"},"horizontal"===y?{alignItems:"flex-end"}:{justifyContent:"flex-end"}),F={flexDirection:"row",overflowX:"scroll","::-webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none",scrollbarWidth:"none",marginLeft:`-${null!==(n=w.left)&&void 0!==n?n:S}px`,marginRight:`-${null!==(r=w.right)&&void 0!==r?r:S}px`,paddingLeft:`${null!==(i=k.left)&&void 0!==i?i:S}px`,paddingRight:`${null!==(a=k.right)&&void 0!==a?a:S}px`,"> button:not(:last-child)":{marginRight:I},"> a:not(:last-child)":{marginRight:I}},M={flexDirection:"column",alignItems:null!==(o={left:"flex-start",center:"center",right:"flex-end"}[O])&&void 0!==o?o:"flex-start","> button:not(:last-child)":{marginBottom:I},"> a:not(:last-child)":{marginBottom:I}};return Object.assign(Object.assign({position:"relative",paddingTop:`${null!==(s=k.top)&&void 0!==s?s:f?0:x}px`,paddingBottom:`${null!==(l=k.bottom)&&void 0!==l?l:0}px`,paddingLeft:`${null!==(d=k.left)&&void 0!==d?d:0}px`,paddingRight:`${null!==(c=k.right)&&void 0!==c?c:0}px`,marginTop:"0px",marginBottom:`-${void 0!==k.bottom?null!==(u=w.bottom)&&void 0!==u?u:C:0}px`,marginLeft:`-${void 0!==k.left?null!==(h=w.left)&&void 0!==h?h:S:0}px`,marginRight:`-${void 0!==k.right?null!==(p=w.right)&&void 0!==p?p:S:0}px`,display:"flex",alignItems:"center"},"horizontal"===v?T:{}),"horizontal"===y?F:M)})),Qd=Zt("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`}})),Gd=Zt("ul")({listStyle:"none",padding:"0",margin:"0","> li":{marginBottom:"10px"},"> :last-child":{marginBottom:"0"}}),Xd=Zt("label")((e=>{let{labelFontProperties:t}=e;return{cursor:"pointer",display:"grid",gridTemplateColumns:"auto minmax(0, 1fr)",gridTemplateRows:`${(null==t?void 0:t.lineHeight)||"auto"} 1fr`,alignItems:"center",width:"fit-content",userSelect:"none"}})),Jd=Zt("input")((e=>{let{theme:t}=e;return{position:"absolute",appearance:"none","&:focus-visible + span":{boxShadow:`0 0 0 2px ${t.getCSSColor("border.focus")} inset`}}})),ec=Zt("span")((e=>{let{theme:t,isChecked:n}=e;const r={backgroundColor:t.getCSSColor("background.checkedCheckbox",{skipFallback:!0})||"#000",borderColor:t.getCSSColor("border.checkedCheckbox",{skipFallback:!0})||"#000",borderWidth:t.getShape("border.checkedCheckbox")||"1px",borderStyle:"solid",borderRadius:t.getShape("borderRadius.checkedCheckbox",{skipFallback:!0})||"4px"},i={backgroundColor:t.getCSSColor("background.uncheckedCheckbox",{skipFallback:!0})||"#FFF",borderColor:t.getCSSColor("border.uncheckedCheckbox",{skipFallback:!0})||"#000",borderWidth:t.getShape("border.uncheckedCheckbox")||"1px",borderStyle:"solid",borderRadius:t.getShape("borderRadius.uncheckedCheckbox",{skipFallback:!0})||"4px"};return Object.assign({height:"20px",width:"20px",padding:"6px 4px 6px 5px",position:"relative",marginRight:"10px",display:"inline-block"},n?r:i)})),tc=Zt("span")((e=>{let{theme:t,labelFontProperties:n}=e;return Object.assign(Object.assign({},n||{}),{gridColumnStart:"2",gridRowStart:"span 2",whiteSpace:"pre-wrap",color:t.getCSSColor("text.primary"),cursor:"pointer",userSelect:"none",webkitUserSelect:"none",overflowWrap:"break-word",wordWrap:"break-word",wordBreak:"break-word"})}));function nc(){return nc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nc.apply(this,arguments)}const rc={linkButton:e=>{let{nodeKey:t,index:n,localIndex:r,cardInstanceId:i,subviewId:a,subviewTitle:o,isWorkflow:s,theme:l,attributes:d,variableResolver:c}=e;const{text:u,icon:h,iconUrl:p,appearance:g}=d,v=d.url,f=d.target,b=Object.assign(Object.assign({},a&&{subviewId:a}),o&&{subviewTitle:o}),y=ge(Hi),w=y.runtimeVariableResolver,S=y.containersBroadcastChannel;return(0,ee.h)(vl,{nodeKey:t,index:n,localIndex:r,theme:l,appearance:g,isWorkflow:s,text:c(u),icon:h,iconUrl:p,clickHandler:e=>{const n=m().getState();return r=>pl(void 0,void 0,void 0,(function*(){let a,o,s;if(d.action){s=d.action;const e=n.cardFeed.cardInstances.find((e=>e.instance.id===i));s&&w&&e&&(yield gl(w,n.application.runtimeVariableResolutionTimeout,e,s))}else if(d.layoutId)a=d.layoutId;else if(d.url){if(r.preventDefault(),o={url:c(v),target:r.ctrlKey||r.metaKey?"_blank":null!=f?f:"_blank"},y.analyticsDispatcher.sendEvent({cardInstanceId:i,cardViewState:n.navigationStack.items.length?"subview":"topview",eventName:rt,properties:Object.assign({linkMethod:"url",url:o.url,trigger:"linkButton"},b.subviewId?Object.assign(Object.assign({},b),{subviewLevel:1}):{})}),"_top"===o.target&&S){const e=`${t}-link-button`;return S.addEventListener("message",(t=>{if(t.data.type===xs.ANALYTICS_EVENT){var n;const r=null===(n=t.data)||void 0===n?void 0:n.eventQueued;r.eventName===rt&&r.cardInstanceId===i&&S&&o&&(S.removeEventListener(e),window.open(o.url,o.target))}}),e)}return window.open(o.url,o.target)}return e.handleLinkButtonPress(i,b,a,s)}))},urlLink:v?{url:c(v),target:f}:void 0})},submitButton:e=>{let{nodeKey:t,index:n,localIndex:r,cardInstanceId:i,subviewId:a,subviewTitle:o,isWorkflow:s,theme:l,attributes:{name:d,text:c,appearance:u,icon:h,iconUrl:p,values:g,url:v,action:f,target:b},variableResolver:y}=e;const[w,S]=le(!1),C=ge(Hi),k=C.cardEventDispatcher,x=C.authTokenProvider,I=C.analyticsDispatcher,O=C.runtimeVariableResolver;return(0,ee.h)(vl,{nodeKey:t,index:n,localIndex:r,theme:l,appearance:u,isWorkflow:s,text:y(c),icon:h,iconUrl:p,clickHandler:e=>{const t=m().getState();return()=>pl(void 0,void 0,void 0,(function*(){var n,r;if(t.application.isPreview)return void e.finishSubview();if(w)return;S(!0);const l=t.cardFeed.cardInstances.find((e=>e.instance.id===i));f&&O&&l&&(yield gl(O,t.application.runtimeVariableResolutionTimeout,l,f));let c={};var u,h;s?(e.validateCurrentSubview(i),c=a&&null!==(n=null===(u=m().getState().validationStates[i])||void 0===u||null===(h=u.subviews)||void 0===h?void 0:h[a])&&void 0!==n?n:{}):(e.validateCardTopLevel(i),c=null!==(r=m().getState().validationStates[i].validations)&&void 0!==r?r:{});const p=m().getState(),C=(e=>!!e.navigationStack.items.length)(t);(e=>{for(var t in e)if("invalid"===e[t].type)return!1;return!0})(c)&&(yield cl(p,e,i,C,k,I,x,g,{postSubmissionUrl:v?{url:y(v),target:b}:void 0,payload:f,subviewData:{subviewId:a,subviewTitle:o},submitButtonName:d,cancelSubmitCallback:()=>S(!1)}),s&&I.sendEvent({cardInstanceId:i,cardViewState:"subview",eventName:ut,properties:{subviewId:a,subviewTitle:o,subviewLevel:1}})),S(!1)}))},loading:w,type:"submit"})},dismissButton:e=>{let{nodeKey:t,index:n,localIndex:r,isWorkflow:i,attributes:a,theme:o,cardInstanceId:s,variableResolver:l}=e;const{text:d,icon:c,iconUrl:u,appearance:h}=a,p=ge(Hi);return(0,ee.h)(vl,{nodeKey:t,index:n,localIndex:r,theme:o,appearance:h,isWorkflow:i,text:l(d),icon:c,iconUrl:u,clickHandler:e=>()=>{dl(m().getState(),e,s,p.cardEventDispatcher,p.authTokenProvider,"card-button")}})},snoozeButton:e=>{let{nodeKey:t,index:n,localIndex:r,isWorkflow:i,attributes:o,theme:s,cardInstanceId:l,cardMetadata:d,variableResolver:c}=e;const{text:u,icon:h,iconUrl:p,snoozePeriod:g,appearance:v}=o,f=ge(Hi);return(0,ee.h)(vl,{nodeKey:t,index:n,localIndex:r,theme:s,appearance:v,isWorkflow:i,text:c(u),icon:h,iconUrl:p,clickHandler:e=>()=>{if(void 0===g||null===bc(g))e.requestSnooze(l,"card-button",null==d?void 0:d.expires);else{const t=yc(g,new Date);(0,a.isPast)(t)||ul(m().getState(),e,l,t,f.cardEventDispatcher,f.authTokenProvider,"card-button")}}})},voteUpButton:e=>{let{nodeKey:t,index:n,localIndex:r,isWorkflow:i,attributes:a,theme:o,cardInstanceId:s,variableResolver:l}=e;const{text:d,icon:c,iconUrl:u,appearance:h}=a,p=ge(Hi);return(0,ee.h)(vl,{nodeKey:t,index:n,localIndex:r,theme:o,appearance:h,isWorkflow:i,text:l(d),icon:c,iconUrl:u,clickHandler:e=>()=>{hl(s,e,p.analyticsDispatcher,p.cardEventDispatcher,"card-button")}})},voteDownButton:e=>{let{nodeKey:t,index:n,localIndex:r,isWorkflow:i,attributes:a,theme:o,cardInstanceId:s,variableResolver:l}=e;const{text:d,icon:c,iconUrl:u,appearance:h}=a;return(0,ee.h)(vl,{nodeKey:t,index:n,localIndex:r,theme:o,appearance:h,isWorkflow:i,text:l(d),icon:c,iconUrl:u,clickHandler:e=>()=>{e.requestFeedback(s,{sentiment:"negative",source:"card-button",textFeedback:!0})}})},actionButtonGroup:e=>{var t,n,r,i,a,o,s;let{children:l,theme:d,feedOrientation:c,isWorkflow:u,isFirstCardNode:h}=e;const p=he(null);if(!l||!l.length)return null;const m=d.getShape("buttonLayout.global"),g={top:d.getHorizontalRule("buttonGroupTop"),between:d.getHorizontalRule("buttonGroupBetween"),bottom:d.getHorizontalRule("buttonGroupBottom")},v=d.getShape("padding.elementBottom",{skipFallback:!0}),f={containerPadding:u?d.getNumericalPadding("stream"):d.getNumericalPadding("card"),containerHorizontalPaddingFallback:u?w:b,containerVerticalPaddingFallback:u?w:y,buttonGroupPadding:d.getNumericalPadding("buttonGroup"),buttonGroupVerticalPaddingFallback:null!==(t=on(v))&&void 0!==t?t:S};let C="0px";if(void 0!==f.buttonGroupPadding.bottom){const e=null!==(n=f.containerPadding.bottom)&&void 0!==n?n:f.containerVerticalPaddingFallback;C=f.buttonGroupPadding.bottom>e?`-${f.buttonGroupPadding.bottom-e}px`:(null!==(r=f.containerPadding.bottom)&&void 0!==r?r:f.containerVerticalPaddingFallback)-f.buttonGroupPadding.bottom+"px"}return(0,ee.h)(ee.Fragment,null,(null===(a=g.top)||void 0===a?void 0:a.enabled)&&(0,ee.h)(yn,{theme:d,ruleStyles:g.top,isSubview:u,translateY:`${null!==(i=f.buttonGroupPadding.top)&&void 0!==i?i:h?0:f.buttonGroupVerticalPaddingFallback}px`}),(0,ee.h)(Zd,{ref:p,theme:d,paddingValues:f,isFirstCardNode:h,feedOrientation:c,buttonLayout:m,ruleBetween:(null===(o=g.between)||void 0===o?void 0:o.enabled)&&"horizontal"!==m},l),(null===(s=g.bottom)||void 0===s?void 0:s.enabled)&&(0,ee.h)(yn,{theme:d,isSubview:u,ruleStyles:g.bottom,translateY:C}))},cardDescription:e=>{var t;let{nodeKey:n,isFirstCardNode:r,isFinalCardNode:i,attributes:{text:a,icon:o,iconUrl:s},theme:l,variableResolver:d}=e;const c=l.getCSSFontProperties("category"),u=l.getNumericFontSize("category"),h=l.getCSSColor("icon.category",{skipFallback:!0}),p=l.getCSSColor("icon.category");return(0,ee.h)(Dd,{theme:l,"data-testid":"card-category",isFirstCardNode:r,isFinalCardNode:i},(o||s)&&(0,ee.h)(fn,{iconName:o,iconUrl:s,size:null!=u?u:20,color:null!==h?h:void 0,fallbackColor:p,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(t=null==c?void 0:c.lineHeight)&&void 0!==t?t:"initial",marginRight:"10px",width:`${u}px`,minWidth:`${u}px`,textAlign:"center"}}),(0,ee.h)(Ed,{key:n},d(a)))},headline:e=>{var t;let{nodeKey:n,isFirstCardNode:r,isFinalCardNode:i,attributes:{text:a,icon:o,iconUrl:s},theme:l,variableResolver:d}=e;const c=l.getCSSFontProperties("headline"),u=l.getNumericFontSize("headline"),h=l.getCSSColor("icon.headline",{skipFallback:!0}),p=l.getCSSColor("icon.headline");return(0,ee.h)(wl,{theme:l,isFirstCardNode:r,isFinalCardNode:i,headlineFontProperties:c},(o||s)&&(0,ee.h)(fn,{iconName:o,iconUrl:s,size:null!=u?u:20,color:null!==h?h:void 0,fallbackColor:p,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(t=null==c?void 0:c.lineHeight)&&void 0!==t?t:"initial",marginRight:"10px",width:`${u}px`,minWidth:`${u}px`,textAlign:"center"}}),(0,ee.h)(Sl,{key:n,theme:l,"data-testid":"card-headline","data-element-key":n},d(a)))},text:e=>{var n,r,i,a,o,s;let{nodeKey:l,isFirstCardNode:d,isFinalCardNode:c,theme:u,attributes:{icon:h,iconUrl:p,text:m,clickToExpandEnabled:g,maxDisplayLines:v,showTextLabel:f,hideTextLabel:b},isWorkflow:y,variableResolver:w,cardInstanceId:S,subviewId:C,subviewTitle:k}=e;const x=he(null),I=he(null),[O,T]=le(!1),[F,M]=le(null),[j,A]=le(null),[D,E]=le(vd().matches?"dark":"light"),_=he((0,t.v4)()),L=null===(i=x.current)||void 0===i?void 0:i.base.querySelector(`#expand-text-${_.current}`),P=null===(a=x.current)||void 0===a?void 0:a.base.querySelector(`#collapse-text-${_.current}`),H=Al(mc(w(m))),R=ge(Hi).analyticsDispatcher;let $;Oc(u.getCSSFontProperties("body"))||($=u.getCSSFontProperties("body"));const N=u.getNumericFontSize("body"),V=Object.assign(Object.assign(Object.assign({},C&&{subviewId:C}),k&&{subviewTitle:k}),C&&{subviewLevel:1}),W=u.getCSSColor("icon.body",{skipFallback:!0}),z=u.getCSSColor("icon.body"),B=()=>{if(!(x.current&&I.current&&v&&g))return M(null),T(!1),A(!1);const e=I.current.base;e.innerHTML="";const t=getComputedStyle(x.current.base),n=parseFloat(t.lineHeight),r=parseFloat(t.fontSize),i=Math.ceil((isNaN(n)?r:n)*v),a=document.createElement("div");a.innerHTML=H;const o=Array.from(a.children);let s=!1;for(let t=0;t<o.length;t++){e.appendChild(o[t]);const n=Math.ceil(e.getBoundingClientRect().height);if(n<i)continue;const r=t<o.length-1;if(n===i&&r){s=wd(o[t],e,i,_.current,u,f);break}if(n>i){s=wd(o[t],e,i,_.current,u,f);break}}s?(M(e.innerHTML),A(!0)):A(!1)};ce((()=>{let e;if(g){const t=()=>{B()};document.fonts.onloadingdone=t,"ResizeObserver"in window&&(e=new ResizeObserver(B),e.observe(document.body))}const t=e=>{E(e.matches?"dark":"light")};return vd().addEventListener("change",t),()=>{var n;null===(n=e)||void 0===n||n.disconnect(),document.fonts.onloadingdone=null,vd().removeEventListener("change",t)}}),[H]),ce(B,[H,v,g,D,f,b]),ce((()=>{const e=()=>T(!0),t=()=>T(!1),n=x.current.base;if(!n)return;const r=n.querySelector(`#expand-text-${_.current}`),i=n.querySelector(`#collapse-text-${_.current}`);return r&&r.addEventListener("click",e),i&&i.addEventListener("click",t),()=>{r&&r.removeEventListener("click",e),i&&i.removeEventListener("click",t)}}),[L,P,F,O,j]),ce((()=>{const e=document.querySelector(`#markdown-${_.current}`);if(e){Array.from(e.querySelectorAll(".md-subview-link")).forEach((e=>{e.addEventListener("click",(()=>{var t;T(!1),A(!1),M(null),Oe().handleSubviewLinkPress(S,null==e||null===(t=e.dataset)||void 0===t?void 0:t.subviewId)})),e.addEventListener("keydown",(t=>{var n;zr(t.key)===Nr&&(T(!1),A(!1),M(null),Oe().handleSubviewLinkPress(S,null==e||null===(n=e.dataset)||void 0===n?void 0:n.subviewId))}))}));Array.from(e.querySelectorAll(".md-web-link")).forEach((e=>{e.addEventListener("click",(e=>{var t;const n=null===(t=e.target.attributes.getNamedItem("href"))||void 0===t?void 0:t.value;R.sendEvent({cardInstanceId:S,cardViewState:y?"subview":"topview",eventName:rt,properties:Object.assign({linkMethod:"url",url:null!=n?n:"",detail:"textLink"},V)})}))}))}}),[H,j,O]);return(0,ee.h)(ee.Fragment,null,(0,ee.h)(gd,{key:l,isFirstCardNode:d,isFinalCardNode:c,theme:u,bodyFontProperties:$,"data-element-key":l,"data-testid":"text-block"},(h||p)&&(0,ee.h)(fn,{iconName:h,iconUrl:p,size:null!=N?N:20,color:null!==W?W:void 0,fallbackColor:z,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(n=null===(o=$)||void 0===o?void 0:o.lineHeight)&&void 0!==n?n:"initial",marginRight:"10px",width:`${N}px`,minWidth:`${N}px`,textAlign:"center"}}),(0,ee.h)(ud,{id:`markdown-${_.current}`,"data-testid":"text-markdown",theme:u,ref:x,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:H&&0!==H.length&&null!==j?O||!F?function(e,t,n,r){if(!t||!n||!r)return e;const i=n.cloneNode(!0);i.innerHTML=e;const a=document.createTreeWalker(i,NodeFilter.SHOW_TEXT),o=[];let s=null;for(;s=a.nextNode();){var l;s&&(null===(l=s.textContent)||void 0===l?void 0:l.trim())&&o.push(s)}if(o.length>0){const e=o[o.length-1],t=e.parentElement;"a"===(null==t?void 0:t.tagName.toLowerCase())&&t.parentElement?(r.style.paddingLeft="5px",t.parentElement.insertBefore(r,t.nextSibling)):(e.textContent=e.textContent+" ",null==t||t.appendChild(r))}return i.innerHTML}(H,j,null===(U=I.current)||void 0===U?void 0:U.base,bd(null!=b?b:"Show less",u,"collapse",`collapse-text-${_.current}`,(null===(q=x.current)||void 0===q?void 0:q.base.getBoundingClientRect().width)+"px")):F:"<p></p>"}}),(0,ee.h)(hd,{dangerouslySetInnerHTML:{__html:H}})),(0,ee.h)(pd,{bodyFontProperties:$,isWorkflow:y,"aria-hidden":"true"},(h||p)&&(0,ee.h)(fn,{iconName:h,iconUrl:p,size:null!=N?N:20,color:null!==W?W:void 0,fallbackColor:z,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(r=null===(s=$)||void 0===s?void 0:s.lineHeight)&&void 0!==r?r:"initial",marginRight:"10px",width:`${N}px`,minWidth:`${N}px`,textAlign:"center"}}),(0,ee.h)(md,{theme:u,ref:I})));var U,q},list:e=>{let t,{nodeKey:n,isFirstCardNode:r,isFinalCardNode:i,attributes:{type:a},children:o,theme:s}=e;switch(a){case"bullet":t=Il;break;case"number":t=Ol;break;case"comma":t=Tl}return t?(0,ee.h)(t,{key:n,"data-element-key":n,theme:s,isFirstCardNode:r,isFinalCardNode:i},o):null},listItem:e=>{let{nodeKey:n,attributes:{text:r,icon:i},theme:a,isWorkflow:o,variableResolver:s,cardInstanceId:l,subviewId:d,subviewTitle:c}=e;const u=he((0,t.v4)()),h=ge(Hi).analyticsDispatcher,p=Al(mc(s(r))),m=Object.assign(Object.assign(Object.assign({},d&&{subviewId:d}),c&&{subviewTitle:s(c)}),d&&{subviewLevel:1});let g;ce((()=>{const e=document.querySelector(`#markdown-${u.current}`);if(e){Array.from(e.querySelectorAll(".md-subview-link")).forEach((e=>{const t=()=>{var t,n;Oe().handleSubviewLinkPress(l,null==e||null===(t=e.dataset)||void 0===t?void 0:t.subviewId),d&&(null==e||null===(n=e.dataset)||void 0===n?void 0:n.subviewId)!==d&&h.sendEvent({cardInstanceId:l,cardViewState:"subview",eventName:ut,properties:m})};e.addEventListener("click",t),e.addEventListener("keydown",(e=>{zr(e.key)===Nr&&t()}))}));Array.from(e.querySelectorAll(".md-web-link")).forEach((e=>{e.addEventListener("click",(e=>{var t;const n=null===(t=e.target.attributes.getNamedItem("href"))||void 0===t?void 0:t.value;h.sendEvent({cardInstanceId:l,cardViewState:o?"subview":"topview",eventName:rt,properties:Object.assign({linkMethod:"url",url:null!=n?n:"",detail:"textLink"},m)})}))}))}}),[p]),Oc(g)||(g=a.getCSSFontProperties("bullet"));const v=a.getCSSColor("icon.bullet",{skipFallback:!0}),f=a.getCSSColor("icon.bullet");return(0,ee.h)(El,{key:n,"data-element-key":n,theme:a,class:i?"with-icon":"without-icon"},i&&(0,ee.h)(fn,{iconName:i,size:g?g.fontSize:20,color:null!==v?v:void 0,fallbackColor:f,styles:{lineHeight:g?g.lineHeight:"initial",marginRight:"10px",width:"22px",minWidth:"22px",textAlign:"center"}}),(0,ee.h)(_l,{id:`markdown-${u.current}`,theme:a,"data-testid":"list-item-text",dangerouslySetInnerHTML:{__html:p}}))},image:t=>{let n,{nodeKey:r,cardInstanceId:i,subviewId:a,subviewTitle:o,theme:s,isFirstCardNode:d,isFinalCardNode:c,attributes:{format:u,thumbnailSrc:h,description:p,label:m,src:g,dimensions:v,altText:f,behaviour:b,url:y,target:w,layoutId:S,payload:C},variableResolver:k}=t;const x=ge(Hi),I=x.containersBroadcastChannel;switch(u){case"inline":n=Yl;break;case"banner":n=Bl;break;case"thumbnail":n=Wl;break;case"text":n=Ql}const O=g&&g.length>0?"image":"imageWithoutSrc";return n?(0,ee.h)(Se.lj,{actions:(0,e.Y2)(Ce,Ye),mapToProps:e=>({customStrings:e.application.customStrings})},(e=>{const t=me((()=>{switch(b){case"url":return y?e=>{e.preventDefault();const t={url:k(y),target:e.ctrlKey||e.metaKey?"_blank":null!=w?w:"_blank"};if(x.analyticsDispatcher.sendEvent({cardInstanceId:i,cardViewState:a?"subview":"topview",eventName:rt,properties:Object.assign({linkMethod:"url",url:t.url,trigger:"image"},a?{subviewId:a,subviewTitle:o,subviewLevel:1}:{})}),"_top"===t.target&&I){const e=`${r}-image-link`;return I.addEventListener("message",(n=>{if(n.data.type===xs.ANALYTICS_EVENT){var r;const a=null===(r=n.data)||void 0===r?void 0:r.eventQueued;a.eventName===rt&&a.cardInstanceId===i&&I&&t&&(I.removeEventListener(e),window.open(t.url,t.target))}}),e)}return window.open(t.url,t.target)}:()=>{l.error({level2:[`url type image link for card: ${i} has no url`]})};case"subview":return S?()=>{e.handleImageLinkPress(i,{layoutId:S,currentSubviewId:a,currentSubviewTitle:o})}:()=>{l.error({level2:[`subview type image link for card: ${i} has no subview id`]})};case"payload":return C?()=>{e.handleImageLinkPress(i,{payload:C,currentSubviewId:a,currentSubviewTitle:o})}:()=>{l.error({level2:[`payload type image link for card: ${i} has no payload`]})};case"none":return;default:return()=>{e.viewMedia(i,Object.assign({type:O,url:k(g),title:k(m)},(null==f?void 0:f.src)?{alt:k(f.src)}:{}))}}}),[b,i,I]);return(0,ee.h)(n,{nodeKey:r,mediaType:O,theme:s,isFirstCardNode:d,isFinalCardNode:c,customStrings:e.customStrings,src:k(h),dimensions:v,url:y,label:k(m),description:k(p),alt:k(null==f?void 0:f.thumbnailSrc),onClickImage:t})})):null},video:e=>{let{nodeKey:t,cardInstanceId:n,attributes:r,theme:i,isFirstCardNode:a,isFinalCardNode:o,isWorkflow:s,variableResolver:l}=e;const[d,c]=le(!1),[u,h]=le(void 0);return d?(0,ee.h)(ld,{nodeKey:t,cardInstanceId:n,isWorkflow:s,format:r.format,src:l(r.src),thumbnailSrc:l(r.thumbnailSrc),dimensions:r.dimensions,loadedDimensions:u,theme:i,isFirstCardNode:a,isFinalCardNode:o,label:l(r.label),description:l(r.description)}):(0,ee.h)(sd,{nodeKey:t,cardInstanceId:n,isWorkflow:s,format:r.format,src:l(r.src),thumbnailSrc:l(r.thumbnailSrc),dimensions:r.dimensions,onLoad:h,theme:i,isFirstCardNode:a,isFinalCardNode:o,label:l(r.label),description:l(r.description),altText:{src:l(null===(p=r.altText)||void 0===p?void 0:p.src),thumbnailSrc:l(null===(m=r.altText)||void 0===m?void 0:m.thumbnailSrc)},setPlaying:c});var p,m},form:e=>{let{cardInstanceId:t,subviewId:n,attributes:{defaultValues:r},theme:i,isWorkflow:a,feedOrientation:o,children:s}=e;return(0,ee.h)(Se.lj,{actions:Ye,mapToProps:()=>{}},(e=>(0,ee.h)(bl,{theme:i,isWorkflow:a,feedOrientation:o,initializeFormStore:yl(e,t,r,n)},s)))},textInput:as,numberInput:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{defaultValue:i,thumbnailSrc:a,placeholder:o,name:s},theme:l,isFinalCardNode:d,validations:c,variableResolver:u}=e;const h=he(null),p=he(i&&lc(i.toString())?i.toString():""),[m,g]=le(p.current);ce((()=>{const e=et(n,s,r);if(e)p.current=e.toString(),g(e.toString());else{const e=lc(m);Je().handleFormChange(n,s,null!=e?e:void 0,r)}}),[]),ce((()=>{const e=i&&lc(i.toString())?i.toString():"";if(e!==p.current){if(m===p.current){const t=lc(e);Je().handleFormChange(n,s,null!=t?t:void 0,r),g(e)}p.current=e}}),[i]);const v=u(o);return(0,ee.h)(Se.lj,{actions:Ye,mapToProps:()=>{}},(e=>(0,ee.h)(ee.Fragment,null,(0,ee.h)(no,{nodeKey:t,mode:"inline",theme:l,isFinalCardNode:d},a&&(0,ee.h)(io,{thumbnailUrl:u(a),theme:l}),(0,ee.h)(ns,{theme:l,ref:h,placeholder:v,value:m,title:v,className:"input-number",inputmode:"decimal",onInput:t=>{const{value:i}=t.target,a=m;let o;g(i),o=cc(i)?i.trim():a,g(o);const l=lc(o);((e,t)=>{null!==_d&&(clearTimeout(_d),_d=null),_d=setTimeout((()=>{t(n,s,null!=e?e:void 0,c,r)}),200)})(l,e.validateField),e.handleFormChange(n,s,null!=l?l:void 0,r)}})),(0,ee.h)(co,{name:s,cardInstanceId:n,subviewId:r,theme:l,isFinalCardNode:d,variableResolver:u}))))},stepper:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{defaultValue:i,minimumValue:a,maximumValue:o,stepValue:s,thumbnailSrc:l,label:d,name:c},validations:u,theme:h,isFinalCardNode:p,variableResolver:m}=e;const g=a||0,v=o||100,f=s&&s>0?s:1,b=he(i&&i>=g&&i<=v?i:g),[y,w]=le(b.current),[S,C]=le(b.current),[k,x]=le(!0),I=h.getCSSColor("icon.stepper"),O=h.getCSSColor("icon.stepperDisabled"),T=null==y||!Fd(y,v,f)||!k,F=null==y||!Td(y,g,f)||!k;ce((()=>{const e=et(n,c,r);e?(b.current=e,w(e),C(e)):Je().handleFormChange(n,c,y,r)}),[]),ce((()=>{const e=i&&i>=g&&i<=v?i:g;e!==b.current&&(S===b.current&&(Je().handleFormChange(n,c,e,r),w(e),C(e)),b.current=e)}),[i]);const M=m(d),j=(e,t)=>{null!==Md&&(clearTimeout(Md),Md=null),Md=setTimeout((()=>{t(n,c,null!=e?e:void 0,u,r)}),400)};return(0,ee.h)(Se.lj,{actions:Ye,mapToProps:e=>{let{}=e}},(e=>(0,ee.h)(ee.Fragment,null,(0,ee.h)(no,{nodeKey:t,mode:"inline",theme:h,isFinalCardNode:p,cursor:"default"},l&&(0,ee.h)(io,{thumbnailUrl:m(l),theme:h}),(0,ee.h)(Od,{theme:h},M),(0,ee.h)(kd,{theme:h},(0,ee.h)(xd,{theme:h,disabled:F,tabIndex:"0","aria-label":`Decrease value by ${f}`,class:"stepper-decrement",onClick:()=>{if(null==y||!Td(y,g,f)||!k)return;const t=((e,t,n)=>e-t<n?n:e-t)(y,f,g);C(t),w(t),e.handleFormChange(n,c,t,r),j(t,e.validateField)}},(0,ee.h)(Cd,{fillColor:F?O:I})),(0,ee.h)(Id,{type:"number",theme:h,tabIndex:"0",title:M,className:"stepper-value",onInput:t=>{const{value:i}=t.target,a=S;let o;C(i),o=cc(i)?i.trim():a,x(((e,t,n)=>e>=t&&e<=n)(o,g,v)),C(o);const s=lc(o);w(s),e.handleFormChange(n,c,null!=s?s:void 0,r),j(s,e.validateField)},onBlur:()=>{e.validateField(n,c,y,u,r)},value:S}),(0,ee.h)(xd,{theme:h,disabled:T,tabIndex:"0","aria-label":`Increase value by ${f}`,class:"stepper-increment",onClick:()=>{if(null==y||!Fd(y,v,f)||!k)return;const t=((e,t,n)=>e+t>n?n:e+t)(y,f,v);C(t),w(t),e.handleFormChange(n,c,t,r),j(t,e.validateField)}},(0,ee.h)(Sd,{fillColor:T?O:I})))),(0,ee.h)(co,{name:c,cardInstanceId:n,subviewId:r,theme:h,isFinalCardNode:p,variableResolver:m}))))},checkbox:e=>{let{nodeKey:t,children:n,cardInstanceId:r,subviewId:i,attributes:{name:a},theme:o,isFirstCardNode:s,isFinalCardNode:l,variableResolver:d}=e;return(0,ee.h)(ee.Fragment,null,(0,ee.h)(Qd,{theme:o,isFirstCardNode:s,isFinalCardNode:l,key:t,"data-element-key":t,role:"group"},(0,ee.h)(Gd,{"aria-label":"checkbox group"},n)),(0,ee.h)(co,{name:a,cardInstanceId:r,subviewId:i,theme:o,isFinalCardNode:l,variableResolver:d}))},checkboxItem:e=>{var t,n;let{nodeKey:r,cardInstanceId:i,subviewId:a,attributes:{label:o,key:s,checked:l},theme:d,variableResolver:c,parentFieldName:u,parentValidations:h}=e;const p=he(l),m=he(`${i}-${s}`),[g,v]=le(null!==(t=p.current)&&void 0!==t&&t),f=null!==(n=d.getCSSColor("icon.checkedCheckbox",{skipFallback:!0}))&&void 0!==n?n:"#FFF";let b;Oc(b)||(b=d.getCSSFontProperties("primary"),parseInt(b.lineHeight)<20&&(b.lineHeight="20px"));const y=e=>{const t=et(i,u,a)||{};return Je().handleFormChange(i,u,Object.assign(Object.assign({},t),{[s]:e}),a),Object.assign(Object.assign({},t),{[s]:e})};return ce((()=>{const e=et(i,u,a);void 0!==e&&void 0!==e[s]?(p.current=e[s],v(e[s])):y(g)}),[]),ce((()=>{void 0!==l&&l!==p.current&&(g===p.current&&(v(l),y(l)),p.current=l)}),[l]),(0,ee.h)("li",null,(0,ee.h)(Xd,{key:r,"data-element-key":r,labelFontProperties:b,role:"checkbox","aria-labelledby":m.current,"aria-checked":g},(0,ee.h)(Jd,{type:"checkbox",checked:g,theme:d,onChange:()=>{v(!g);const e=y(!g);Je().validateField(i,u,e,h,a)},"aria-hidden":"true"}),(0,ee.h)(ec,{theme:d,isChecked:g},g&&(0,ee.h)(uo,{fillColor:f,style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},ariaHidden:!0})),(0,ee.h)(tc,{theme:d,id:m.current,"data-testid":"checkbox-label",labelFontProperties:b,"aria-hidden":"true"},c(o))))},switch:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{defaultValue:i,thumbnailSrc:a,label:o,name:s},theme:l,isFinalCardNode:d,variableResolver:c}=e;const u=he(i),[h,p]=le(u.current);ce((()=>{const e=et(n,s,r);void 0!==e?(u.current=e,p(e)):Je().handleFormChange(n,s,h,r)}),[]),ce((()=>{i!==u.current&&(h===u.current&&(Je().handleFormChange(n,s,i,r),p(i)),u.current=i)}),[i]);const m=`switch-label-${s}`;return(0,ee.h)(Se.lj,{actions:Ye,mapToProps:()=>{}},(e=>(0,ee.h)(no,{nodeKey:t,mode:"inline",theme:l,isFinalCardNode:d},a&&(0,ee.h)(io,{thumbnailUrl:c(a),theme:l}),(0,ee.h)(oo,{theme:l,name:m,mode:"inline",truncateLabel:!0},c(o)),(0,ee.h)(jd,{on:h,theme:l,tabIndex:"0",role:"switch","aria-checked":h,"aria-labelledby":m,className:"switch-toggle",onClick:()=>{p(!h),e.handleFormChange(n,s,!h,r)}},(0,ee.h)(Ad,{on:h,theme:l})))))},dropdown:So,datePicker:Io,upload:Kd},ic=["linkButton","submitButton","dismissButton","snoozeButton","voteUpButton","voteDownButton"],ac=e=>{let{node:t,cardContext:n,cardInstanceId:r,cardMetadata:i,isWorkflow:a,theme:o,runtimeVariables:s,feedOrientation:l,subviewId:d,subviewTitle:c,embedMode:u,parentNodeType:h,parentFieldName:p,parentValidations:m,index:g,localIndex:v}=e;const f=rc[t.type];if(f){let e=0===g,b=g===n.nodeCount-(1+(n.hasButtonFinalNode?1:0));return a&&(e="form"===h&&0===v,b="form"===h&&v===n.nodeCount-(1+(n.hasButtonFinalNode?1:0))),(0,ee.h)(f,nc({},t.key&&{nodeKey:t.key},{isFirstCardNode:e,isFinalCardNode:b,cardInstanceId:r,cardMetadata:i,subviewId:d,subviewTitle:c,attributes:t.attributes,validations:t.validations,isWorkflow:a,theme:o,variableResolver:e=>vc(e,s),feedOrientation:l,embedMode:u,parentNodeType:h,parentFieldName:p,parentValidations:m,index:g,localIndex:null!=v?v:g}),t.children&&t.children.map(((e,l)=>{var h;return(0,ee.h)(ac,{cardInstanceId:r,cardMetadata:i,subviewId:d,subviewTitle:c,node:e,index:g,localIndex:l,isWorkflow:a,cardContext:n,theme:o,runtimeVariables:s,embedMode:u,parentNodeType:t.type,parentFieldName:null===(h=t.attributes)||void 0===h?void 0:h.name,parentValidations:t.validations})})))}return null},oc={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},sc=/[&<>"'\/]/g,lc=e=>{if(""===e)return null;const t=Number(e);return Number.isNaN(t)?null:t},dc=e=>{let t;return"string"!=typeof e&&"number"!=typeof e||("string"==typeof e&&(t=null!==lc(e)?lc(e):void 0),"number"==typeof e&&(t=e),void 0!==t&&(t=t>=0?Math.round(t):void 0)),t},cc=e=>null!==lc(e)||""===e||"-"===e,uc=e=>{let t=Array();for(var n in e){const r=e[n];t.push(r),r.children&&(t=t.concat(uc(r.children)))}return t},hc=e=>{const t=[],n=(e,r)=>{const i=[];for(let r=0;r<e.length;r++){var a;const o=e[r];"actionButtonGroup"!==o.type&&o.children&&(null===(a=o.children)||void 0===a?void 0:a.length)>0&&(o.children=n(o.children,o)),ic.includes(o.type)?t.push(o):i.push(o)}if("form"===(null==r?void 0:r.type)){var o;let e=!1;null===(o=r.children)||void 0===o||o.forEach((t=>{"actionButtonGroup"===t.type&&(e=!0)})),!e&&i.push({type:"actionButtonGroup",attributes:{},children:t})}return i};return n(e)},pc=(e,t)=>{const n=e=>{for(let r in e){const i=e[r];"string"==typeof i&&(e[r]=vc(i,t)),"object"==typeof i&&n(i)}},r=e=>{const t=[];for(let a=0;a<e.length;a++){var i;const o=e[a];o.children&&(null===(i=o.children)||void 0===i?void 0:i.length)>0&&(o.children=r(o.children)),o.attributes&&n(o.attributes),t.push(o)}return t};e.defaultView.nodes=r(e.defaultView.nodes);for(let n in e.subviews){const i=e.subviews[n];e.subviews[n].nodes=r(i.nodes),i.title&&(e.subviews[n].title=vc(i.title,t))}},mc=e=>e?e.replace(sc,(e=>oc[e]||e)):"",gc=/!\{([\w\.]+?)\}/g,vc=(e,t)=>e&&t&&"string"==typeof e?e.replace(gc,((e,n)=>t.get(n)||"")):e||"",fc={years:a.addYears,months:a.addMonths,weeks:a.addWeeks,days:a.addDays,hours:a.addHours,minutes:a.addMinutes,seconds:a.addSeconds},bc=e=>{if("string"!=typeof e)return null;const t=e.match(f);if(t){const[,,e,n,r,i,a,o,s]=t.map((e=>void 0!==e?Number(e):void 0));return{years:e,months:n,weeks:r,days:i,hours:a,minutes:o,seconds:s}}return null},yc=(e,t)=>{const n=bc(e);return n?Object.entries(fc).reduce(((e,t)=>{let[r,i]=t;const a=n[r];return a?i(e,a):e}),t):t},wc=e=>{if("string"!=typeof e)return!1;const t=new Date(e);if(t instanceof Date)try{return t.toISOString()===e}catch(e){return!1}return!1},Sc=e=>{if(!Cc(e))throw new Error("JWT supplied has an incorrect format");try{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(t);return JSON.parse(n)}catch(e){throw new Error("JWT payload could not be parsed")}},Cc=e=>!!e.match(/^[\w-]+\.[\w-]+\.[\w-]*$/),kc=e=>{const t=m().getState().application.embedMode;return(null==e?void 0:e.enabled)&&"standalone"===t?"horizontal":"vertical"},xc=()=>{const e=sessionStorage.getItem(F),t=e?JSON.parse(e):void 0;return new Set(t)},Ic=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Oc=e=>e&&Ic(e)&&0===Object.keys(e).length,Tc=(e,t)=>e.length===t.length&&(e.sort(),t.sort(),e.every(((e,n)=>e===t[n])));var Fc=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};function Mc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jc=(e,t)=>{if(!e)return null;let n;try{n=Sc(e)}catch(e){return null}if(t)return n[t]&&["number","string"].includes(typeof n[t])?String(n[t]):null;const r=["atomic_sub","atomic_id","sub","id"];for(const e of r)if(n[e]&&["number","string"].includes(typeof n[e]))return String(n[e]);return null},Ac="AtomicAnalyticsQueue";var Dc=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};function Ec(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _c={noInternet:"AACNoInternetError",missingApiHost:"AACMissingApiHostError",apiError:"AACApiError",invalidParameters:"AACInvalidParametersError",notPermitted:"AACOperationNotPermittedError",authTokenError:"AACAuthTokenError"},Lc="Device is not connected to the internet",Pc="API host was not specified for the request.",Hc="An API error occurred.",Rc="Failed to retrieve an authentication token for request.",$c={method:"GET",mode:"cors"},Nc=e=>Dc(void 0,void 0,void 0,(function*(){const t=yield e.text();try{return{text:t,json:JSON.parse(t)}}catch(e){}return{text:t}})),Vc=e=>e<400,Wc=(e,t,n,r,a)=>{var o,s;const l=null!==(o=jc(n,a))&&void 0!==o?o:void 0;i("request-failed",{request:{path:e,statusCode:t,streamContainerId:"string"==typeof(null==r?void 0:r.streamContainerId)?null==r?void 0:r.streamContainerId:void 0,streamContainerIds:null==r||null===(s=r.streamContainerIds)||void 0===s?void 0:s.filter((e=>"string"==typeof e)),cardInstanceId:"string"==typeof(null==r?void 0:r.cardInstanceId)?null==r?void 0:r.cardInstanceId:void 0,endUserId:l}})};class zc{static initialise(e,n,r){this.apiHost=e,this.apiKey=n,this.environmentId=r,this.instanceId=(0,t.v4)()}static reset(){this.apiHost="https://client-api.atomic.io",this.apiKey=void 0,this.environmentId=void 0}static setTestHostHeader(e){this.testHost=e}static setTokenUserIdAttribute(e){this.tokenUserIdAttribute=e}static setClientAppVersion(e){this.clientAppVersion=e}static verifyInitialised(){if(!this.isInitialised())throw new Error("The Atomic SDK has not been initialised with an API host, API key and environment ID. Call `AtomicSDK.initialise(apiHost, apiKey, environmentId)` before attempting to use the SDK.")}static isInitialised(){return void 0!==this.apiKey&&void 0!==this.environmentId}static get(e,t,n,r){return Dc(this,void 0,void 0,(function*(){let i,a;if(this.verifyInitialised(),!navigator.onLine){const e=new Error(Lc);return e.name=_c.noInternet,{response:{error:e}}}{const o=qc(this.apiHost,e,this.environmentId);if(!o){const e=new Error(Pc);return e.name=_c.missingApiHost,{response:{error:e}}}let s;if(t)try{s=yield t.requestToken()}catch(e){const t=new Error(`${Rc} ${e}`);return t.name=_c.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},$c),{headers:Bc({instanceId:this.instanceId,apiKey:this.apiKey,authToken:s,lastModified:n,testHost:this.testHost,clientAppVersion:this.clientAppVersion})});try{const t=yield fetch(o,l);a=t.status;const n=yield Nc(t);if(n.json&&(i=n.json),!Vc(t.status))throw Wc(e,a,s,r,this.tokenUserIdAttribute),new Error(`GET request failed with status code ${t.status}.`);return{data:i,response:{status:t.status,etag:t.headers.get("etag")}}}catch(e){const t=new Error(`${Hc} ${e}`);return t.name=_c.apiError,{data:i,response:{status:a,error:t}}}}}))}static post(e,t,n,r){return Dc(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(Lc);return e.name=_c.noInternet,{response:{error:e}}}{let i,a;const o=qc(this.apiHost,e,this.environmentId);if(!o){const e=new Error(Pc);return e.name=_c.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${Rc} ${e}`);return t.name=_c.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},$c),{method:"POST",headers:Bc({instanceId:this.instanceId,apiKey:this.apiKey,authToken:s,testHost:this.testHost,clientAppVersion:this.clientAppVersion}),body:JSON.stringify(t)});try{const t=yield fetch(o,l);a=t.status;const n=yield Nc(t);if(n.json&&(i=n.json),!Vc(t.status))throw Wc(e,a,s,r,this.tokenUserIdAttribute),new Error(`POST request failed with status code ${t.status}.`);return{data:i,response:{status:t.status}}}catch(e){const t=new Error(`${Hc} ${e}`);return t.name=_c.apiError,{data:i,response:{status:a,error:t}}}}}))}static put(e,t,n,r){return Dc(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(Lc);return e.name=_c.noInternet,{response:{error:e}}}{let i,a;const o=qc(this.apiHost,e,this.environmentId);if(!o){const e=new Error(Pc);return e.name=_c.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${Rc} ${e}`);return t.name=_c.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},$c),{method:"PUT",headers:Bc({instanceId:this.instanceId,apiKey:this.apiKey,authToken:s,testHost:this.testHost,clientAppVersion:this.clientAppVersion}),body:JSON.stringify(t)});try{const t=yield fetch(o,l);a=t.status;const n=yield Nc(t);if(n.json&&(i=n.json),!Vc(t.status))throw Wc(e,a,s,r,this.tokenUserIdAttribute),new Error(`PUT request failed with status code ${t.status}.`);return{data:i,response:{status:t.status}}}catch(e){const t=new Error(`${Hc} ${e}`);return t.name=_c.apiError,{data:i,response:{status:a,error:t}}}}}))}static delete(e,t,n,r){return Dc(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(Lc);return e.name=_c.noInternet,{response:{error:e}}}{let i,a;const o=qc(this.apiHost,e,this.environmentId);if(!o){const e=new Error(Pc);return e.name=_c.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${Rc} ${e}`);return t.name=_c.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},$c),{method:"DELETE",headers:Bc({instanceId:this.instanceId,apiKey:this.apiKey,authToken:s,testHost:this.testHost,clientAppVersion:this.clientAppVersion}),body:JSON.stringify(t)});try{const t=yield fetch(o,l);a=t.status;const n=yield Nc(t);if(n.json&&(i=n.json),!Vc(t.status))throw Wc(e,a,s,r,this.tokenUserIdAttribute),new Error(`DELETE request failed with status code ${t.status}.`);return{data:i,response:{status:t.status}}}catch(e){const t=new Error(`${Hc} ${e}`);return t.name=_c.apiError,{data:i,response:{status:a,error:t}}}}}))}}Ec(zc,"apiHost","https://client-api.atomic.io"),Ec(zc,"apiKey",void 0),Ec(zc,"environmentId",void 0),Ec(zc,"instanceId",void 0),Ec(zc,"testHost",void 0),Ec(zc,"clientAppVersion","unknown"),Ec(zc,"tokenUserIdAttribute",void 0);const Bc=e=>Uc("header",Object.assign({},e)),Uc=(e,t)=>{const n="header"===e;let r={"x-atomic-sdk-platform":"Web","x-atomic-sdk-version":"25.4.2","x-atomic-sdk-timezone":Intl.DateTimeFormat().resolvedOptions().timeZone,"x-atomic-sdk-device":navigator.userAgent};if(t.instanceId&&(r["x-atomic-sdk-instance-id"]=t.instanceId),n&&(r["Content-Type"]="application/json"),t.apiKey){r["ws"===t.scheme?"api-key":"x-atomic-sdk-api-key"]=t.apiKey}return t.authToken&&(n?r.Authorization=`Bearer ${t.authToken}`:r.Token=t.authToken),t.lastModified&&n&&(r["If-None-Match"]=t.lastModified),t.testHost&&(r["x-atomic-test-host"]=t.testHost),t.clientAppVersion&&(r["x-atomic-sdk-client-app-version"]=t.clientAppVersion),t.error&&(r.error=t.error),r},qc=(e,t,n)=>{if(!e||0==e.trim().length)return null;return`${e.endsWith("/")?e:`${e}/`}${n&&n.trim().length>0?`${n}/`:""}${t}`};function Yc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Kc=e=>{const t=new Error(e);return t.name="Stream filter error",l.error({level1:[t]}),t},Zc=(e,t)=>{let n=!0;return!!e.length&&(e.reduce(((e,r)=>(t.includes(typeof r)||(n=!1),typeof e!=typeof r&&(n=!1),r))),n)};class Qc{constructor(e,t){var n=this;Yc(this,"filters",void 0),Yc(this,"onApplyFilter",void 0),Yc(this,"onClearFilter",void 0),Yc(this,"addVariableFilter",(e=>this.genericFilter("variables",e,"addVariableFilter"))),Yc(this,"addPayloadVariableFilter",(e=>this.genericFilter("eventPayload.detail",e,"addPayloadVariableFilter"))),Yc(this,"addCardContentFilter",(e=>this.genericFilter("defaultView",e,"addCardContentFilter","card property"))),Yc(this,"addSubviewContentFilter",(e=>this.genericFilter("subviews",e,"addSubviewContentFilter","subview property"))),Yc(this,"addPayloadMetadataFilter",(e=>this.genericFilter("eventPayload.metadata",e,"addPayloadMetadataFilter","metadata"))),Yc(this,"genericFilter",(function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"variable";if(!t)throw Kc(`The name of the ${i} you are filtering by must be supplied to \`${r}\``);return Gc(n.filters,e,t,(e=>{const t=Array.isArray(e);if(!t&&!["string","number","boolean","null"].includes(typeof e))throw Kc(`Incorrect value provided for "${i}" filter. Must be a string, a number, a boolean or null.`);if(t&&!Zc(e,["string","number"]))throw Kc(`Incorrect value provided for "${i}" filter, for "in" or "notIn" must be either an array of numbers or an array of strings.`)}),["equals","greaterThan","greaterThanOrEqualTo","in","lessThan","lessThanOrEqualTo","notEqualTo","notIn","between","includes","excludes","isIncludedIn","isExcludedFrom"])})),Yc(this,"addCardTemplateIdFilter",(()=>Gc(this.filters,"metadata","cardTemplateId",(e=>{const t=Array.isArray(e);if(!t&&"string"!=typeof e)throw Kc('Incorrect "card template id" filter value provided, must be a string.');if(t&&!Zc(e,["string"]))throw Kc('Incorrect "card template id" filter value provided, for "in" or "notIn" an array of strings must be supplied.')}),["equals","in","notEqualTo","notIn","includes","excludes","isIncludedIn","isExcludedFrom"]))),Yc(this,"addCardTemplateNameFilter",(()=>Gc(this.filters,"metadata","cardTemplateName",(e=>{const t=Array.isArray(e);if(!t&&"string"!=typeof e)throw Kc('Incorrect "card template name" filter value provided, must be a string.');if(t&&!Zc(e,["string"]))throw Kc('Incorrect "card template name" filter value provided, for "in" or "notIn" an array of strings must be supplied.')}),["equals","in","notEqualTo","notIn","includes","excludes","isIncludedIn","isExcludedFrom"]))),Yc(this,"addCardCreatedFilter",(()=>Gc(this.filters,"metadata","created",(e=>{if("string"!=typeof e||!wc(e))throw Kc('Incorrect "card created" filter value provided, must be a valid ISO date string')}),["equals","greaterThan","greaterThanOrEqualTo","lessThan","lessThanOrEqualTo","notEqualTo"]))),Yc(this,"addCardPriorityFilter",(()=>Gc(this.filters,"metadata","priority",(e=>{const t=typeof e,n=Array.isArray(e);if(n&&!Zc(e,["number"]))throw Kc('Incorrect "card priority" filter value provided. For "in" and "notIn" must be a number between 1 & 10 inclusive.');if(n){let t=!1;if(e.forEach((e=>{(e>10||e<1)&&(t=!0)})),t)throw Kc('Incorrect "card priority" filter value provided. For "in" and "notIn" must be a number between 1 & 10 inclusive.')}else if(!n&&"number"!==t||isNaN(e)||e>10||e<1)throw Kc('Incorrect "card priority" filter value provided, must be a number between 1 & 10 inclusive.')}),["equals","greaterThan","greaterThanOrEqualTo","in","lessThan","lessThanOrEqualTo","notEqualTo","notIn","between"]))),Yc(this,"clearFilters",(()=>{this.filters={},this.onClearFilter()})),Yc(this,"apply",(()=>{this.onApplyFilter()})),Yc(this,"getFilterObject",(()=>this.filters)),this.filters={},this.onApplyFilter=e,this.onClearFilter=t}}const Gc=(e,t,n,r,i)=>{const a=(i,a)=>o=>{r(o),((e,t,n)=>{const r=typeof t;switch(e){case"eq":case"ne":if(!["number","string","boolean","null"].includes(r))throw Kc(`Operator "${n}" must be a number, string, boolean or null`);break;case"gt":case"gte":case"lt":case"lte":if(!["string","number"].includes(r))throw Kc(`Operator "${n}" must be a number or ISO date string`);if("string"===r&&!wc(t))throw Kc(`Operator "${n}" must be a number or ISO date string`);break;case"in":case"nin":if(!Array.isArray(t))throw Kc(`Operator "${n}" must be either an array of numbers or an array of strings`);if(!Zc(t,["string","number"]))throw Kc(`Operator "${n}" must be either an array of numbers or an array of strings`);break;case"between":if(2!==t.length||!Zc(t,["number"]))throw Kc(`Operator "${n}" must be an array of 2 numbers: [minimumValue, maximumValue]`)}})(i,o,a),e[`${t}.${n}__${i}`]=o},o={equals:a("eq","equals"),greaterThan:a("gt","greaterThan"),greaterThanOrEqualTo:a("gte","greaterThanOrEqualTo"),in:a("in","in"),lessThan:a("lt","lessThan"),lessThanOrEqualTo:a("lte","lessThanOrEqualTo"),notEqualTo:a("ne","notEqualTo"),notIn:a("nin","notIn"),between:a("between","between"),includes:a("includes","includes"),excludes:a("excludes","excludes"),isIncludedIn:a("is_included_in","isIncludedIn"),isExcludedFrom:a("is_excluded_from","isExcludedFrom")};return Object.keys(o).forEach((e=>{i.includes(e)||delete o[e]})),o},Xc="custom-ping",Jc="auth",eu="subscribe",tu="unsubscribe",nu="events",ru="custom-pong",iu="auth-success",au="token-expiry",ou="update-cards",su="events-processed",lu="error",du="invalid-token",cu="expired-token",uu="invalid-stream-container-id",hu="invalid-filter",pu="invalid-message",mu=()=>{const e=document.querySelector("script#atomic-frame-manager"),t=e?e.src:null;if(!t)return null;const n=new URL(t),r=n.protocol.toLowerCase();return("http:"===r||"https:"===r)&&"localhost"!==n.hostname?null:t};var gu=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};function vu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fu={name:"Invalid stream container id",message:"an invalid stream container id was provided with the subscription request"},bu={name:"Invalid filter",message:"an invalid filter was provided with the subscription request"},yu={name:"Invalid token",message:'Atomic platform responded with an "invalid token" message'},wu={name:"Expired token",message:'Atomic platform responded with an "expired token" message'};class Su{static reset(){this.activeSubscriptions={},this.lastPongSuccess=void 0}static messageSubscribedContainer(e,t){if(void 0===nh.streamContainers[e])return l.error({level3:["No stream container found for subscriptionId: ",e]});nh.streamContainers[e].sendMessageToIframe(t)}static messageAllSubscribedContainers(e){Object.values(this.activeSubscriptions).forEach((t=>{this.messageSubscribedContainer(t.subscriptionId,e)}))}static handleWebSocketMessage(e){return gu(this,void 0,void 0,(function*(){switch(e.messageType){case ru:l.debug({level1:["pong received by WebSockets"],level2:[e]}),this.lastPongSuccess=(new Date).toISOString();break;case iu:Fu.connectionAuthenticated||(Fu.connectionAuthenticated=!0,nh.authMessageResolve()),l.debug({level1:["auth success received by WebSockets"],level2:[e]});break;case au:l.debug({level1:["token expiry received by WebSockets"],level2:[e]}),Fu.connectionAuthenticated=!1;try{yield nh.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){l.error({level1:["Token expired, new token request failed"],level2:[e]})}break;case ou:{l.debug({level1:["update cards received by WebSockets"],level2:[e]});const t=e.data.updates,n={};null==t||t.forEach((e=>{const{subscriptionId:t}=e.data;n[t]||(n[t]=[]),n[t].push(e)}));Object.keys(n).forEach((e=>{this.messageSubscribedContainer(e,{action:C,values:{cardFeedUpdates:n[e]}})}));break}case su:{var t;l.debug({level1:["analytics events processed received by WebSockets"],level2:[e]});const n=null===(t=e.data)||void 0===t?void 0:t.eventIds;n&&Array.isArray(n)&&nh.analyticsQueue.removeProcessedEvents(n);break}case lu:this.handleWebSocketErrorMessage(e);break;default:l.debug({level1:["unknown message received by WebSockets"],level2:[e]})}}))}static handleWebSocketErrorMessage(e){return gu(this,void 0,void 0,(function*(){var t;switch(e.data.errorType){case du:{const e=new Error(yu.message);e.name=yu.name,l.error({level1:["Invalid token error received by WebSockets."],level2:[e]}),Fu.connectionAuthenticated||nh.authMessageReject(e),Fu.connectionAuthenticated=!1;try{yield nh.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){l.error({level1:["Token invalid, new token request failed"],level2:[e]}),this.messageAllSubscribedContainers({action:"io.atomic.events.invalidToken",values:e instanceof Error?e.message:String(e)})}break}case cu:{const n=new Error(null!==(t=e.data.errorMessage)&&void 0!==t?t:wu.message);n.name=wu.name,l.error({level1:["Expired token error received by WebSockets"],level2:[n]}),Fu.connectionAuthenticated||nh.authMessageReject(n),Fu.connectionAuthenticated=!1;try{yield nh.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){l.error({level1:["Token expired, new token request failed"],level2:[e]}),this.messageAllSubscribedContainers({action:"io.atomic.events.expiredToken",values:e instanceof Error?e.message:String(e)})}break}case uu:{var n;const t=e.data.subscriptionId,r=new Error(`${fu.message} - ${null===(n=this.activeSubscriptions[t])||void 0===n?void 0:n.streamContainerId}`);r.name=fu.name,l.error({level1:["Invalid stream container id error received by WebSockets"],level2:[r]}),this.messageSubscribedContainer(t,{action:"io.atomic.events.invalidStreamContainerId",values:r.message});break}case hu:{const t=e.data.subscriptionId,n=new Error(bu.message);n.name=bu.name,n.message=bu.message,l.error({level1:["Invalid filter error received by WebSockets"],level2:[n]}),this.messageSubscribedContainer(t,{action:"io.atomic.events.invalidFilter",values:n.message});break}case pu:l.error({level1:["Invalid message error received by WebSockets"],level2:[e]});break;default:l.debug({level1:["unknown error received by WebSockets"],level2:[e]})}}))}static subscribeToCardFeed(e){try{Fu.dispatchMessage({messageType:eu,data:{subscriptions:e}}),e.forEach((e=>this.activeSubscriptions[e.subscriptionId]=e))}catch(e){throw l.error({level1:["Error subscribing to card feed via WebSocket"],level2:[e]}),e}}static unsubscribeFromCardFeed(e){try{Fu.dispatchMessage({messageType:tu,data:{subscriptionIds:e}}),e.forEach((e=>delete this.activeSubscriptions[e]))}catch(e){l.error({level1:["Error unsubscribing from card feed via WebSocket"],level2:[e]})}}static resubscribeActiveSubscriptions(){const e=Object.values(this.activeSubscriptions);e.length&&(this.subscribeToCardFeed(e),e.forEach((e=>this.messageSubscribedContainer(e.subscriptionId,{action:x}))))}static unsubscribeActiveSubscriptions(){const e=Object.values(this.activeSubscriptions);e.length&&this.unsubscribeFromCardFeed(e.map((e=>e.subscriptionId)))}static sendAuthMessage(e){try{Fu.dispatchMessage({messageType:Jc,authToken:e})}catch(e){l.error({level1:["Error sending auth message to WebSocket"],level2:[e]})}}static sendAnalyticsMessage(e,t){if(!nh.webSocketDisabled&&Fu.isConnected())try{Fu.dispatchMessage({messageType:nu,authToken:t,data:{events:e}})}catch(e){l.error({level1:["Error sending analytics message to WebSocket"],level2:[e]})}}}function Cu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ku;vu(Su,"activeSubscriptions",{}),vu(Su,"lastPongSuccess",void 0),function(e){e[e.notPermitted=1013]="notPermitted",e[e.missingApi=1008]="missingApi",e[e.retryConnection=1011]="retryConnection",e[e.goingAway=1001]="goingAway",e[e.abnormalClosure=1006]="abnormalClosure",e[e.sdkClosedConnection=3e3]="sdkClosedConnection",e[e.sdkChangingProtocol=3001]="sdkChangingProtocol",e[e.sdkReinitialisedWebSocket=3002]="sdkReinitialisedWebSocket",e[e.sdkSessionEnding=3003]="sdkSessionEnding",e[e.sdkCordovaBackgrounded=3004]="sdkCordovaBackgrounded",e[e.sdkPersistedToBrowserCache=3005]="sdkPersistedToBrowserCache",e[e.unitTestConnectionClose=3006]="unitTestConnectionClose"}(ku||(ku={}));const xu={name:"Not initialised",message:"WebSocket client has not been initialised"},Iu={name:"No connection",message:"WebSocket connection is not established"},Ou={name:"WebSocket not ready",message:"WebSocket connection is not ready to send message"},Tu={name:"Dispatch message error",message:"Unable to dispatch the client message on the WebSocket connection"};class Fu{static initialise(e,t,n){let r;try{r=new URL(e),r.protocol="https:"===r.protocol?"wss":"ws"}catch(e){throw l.error({level1:["error creating WebSocket URL from supplied API host"],level2:[e]}),e}this.apiHost===r.toString()&&this.apiKey===t&&this.environmentId===n||this.isConnected()&&this.close(ku.sdkReinitialisedWebSocket,"Connection closed by SDK, WebSocket has been reinitialised"),this.apiHost=r.toString(),this.apiKey=t,this.environmentId=n,window.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&(l.debug({level3:[`WebSocket client visibilitychange event triggered, page is ${document.visibilityState} checking connection health`]}),this.connectionHealthCheck())})),mu()&&(document.addEventListener("pause",(()=>{l.debug({level3:["Cordova app pause event triggered"]}),this.close(ku.sdkCordovaBackgrounded,"Connection closed by SDK, clean up WebSocket connection as app has been backgrounded")}),!1),document.addEventListener("resume",(()=>{l.debug({level3:["Cordova app resume event triggered"]}),nh.reinitialiseWebSocketConnection()}),!1))}static isInitialised(){return void 0!==this.apiKey&&void 0!==this.environmentId&&void 0!==this.apiHost}static reset(){this.apiHost=void 0,this.apiKey=void 0,this.environmentId=void 0,this.openingConnection=!1,this.connectionAuthenticated=!1,this.webSocketConnection=void 0,this.connectionTimeout=void 0,this.pingTimeout=void 0}static setTestHostParam(e){this.testHost=e}static setConnectionTimeout(){this.clearTimeouts(),this.connectionTimeout=setTimeout((()=>{try{this.dispatchMessage({messageType:Xc})}catch(e){l.error({level3:["Error sending custom ping message:",e]})}this.pingTimeout=setTimeout((()=>{l.debug({level3:["WebSocket client ping timeout reached, closing connection"]}),this.close(ku.sdkClosedConnection,"connection timed out")}),this.connectionTimer)}),this.connectionTimer)}static setClientAppVersion(e){this.clientAppVersion=e}static connectionHealthCheck(){Fu.isInitialised()&&Fu.isConnected()&&Su.lastPongSuccess&&(0,a.differenceInMilliseconds)((new Date).toISOString(),Su.lastPongSuccess)>this.staleConnectionTimer&&(l.debug({level3:["WebSocket connection has become stale, re-initialising"]}),nh.reinitialiseWebSocketConnection())}static clearTimeouts(){this.connectionTimeout&&clearTimeout(this.connectionTimeout),this.pingTimeout&&clearTimeout(this.pingTimeout)}static isConnected(){return!this.openingConnection&&!!this.webSocketConnection&&this.webSocketConnection.readyState==this.webSocketConnection.OPEN}static close(e,t){var n;e===ku.sdkSessionEnding&&Su.unsubscribeActiveSubscriptions(),null===(n=this.webSocketConnection)||void 0===n||n.close(e,t),this.connectionAuthenticated=!1,this.clearTimeouts()}static purgeMessageQueue(){this.messageQueue.length&&(this.messageQueue.forEach((e=>{let t;if(e.messageType===eu)t=e,t.data.subscriptions=t.data.subscriptions.filter((e=>Object.keys(nh.streamContainers).includes(e.subscriptionId))),t.data.subscriptions.length||(t=null);else t=e;try{t&&this.dispatchMessage(t),l.debug({level3:["WebSocket client purging message queue, message sent by WebSockets: ",t]})}catch(e){l.error({level1:["purging message queue, error sending message"],level2:[e]})}})),this.messageQueue=[])}static dispatchMessage(e){var n;const r=(0,t.v4)(),i=Object.assign(Object.assign({},e),{messageId:r}),a=JSON.stringify(i);try{const t=this.webSocketConnection;if(!t)throw new Error(Iu.message);if(t.readyState===t.CLOSING||t.readyState===t.CLOSED)throw new Error(Ou.message);return t.readyState===t.CONNECTING?this.messageQueue.push(e):t.send(a)}catch(e){const t=new Error;throw t.name=Tu.name,t.message="object"==typeof e&&null!==e&&"message"in e&&null!==(n=e.message)&&void 0!==n?n:Tu.message,t}}static setEventListeners(e,t){e.onmessage=e=>{if(this.setConnectionTimeout(),e.data)try{const n=JSON.parse(e.data);t.onMessage(n)}catch(e){console.error(e)}},e.onopen=()=>{var e;this.setConnectionTimeout(),null===(e=t.onOpen)||void 0===e||e.call(t)},e.onclose=e=>{var n;null===(n=t.onClose)||void 0===n||n.call(t,e)},e.onerror=e=>{t.onError(e)}}static open(e,t,n){try{if(!this.isInitialised())throw new Error(xu.message);if(!navigator.onLine){const e=new Error(Lc);throw e.name=_c.noInternet,e}const r=qc(this.apiHost,e,this.environmentId);if(!r){const e=new Error(Pc);throw e.name=_c.missingApiHost,e}if(this.webSocketConnection)switch(this.webSocketConnection.readyState){case this.webSocketConnection.OPEN:this.close(ku.sdkReinitialisedWebSocket,"Connection closed by SDK, request to open new connection received");break;case this.webSocketConnection.CLOSING:return setTimeout((()=>{this.open(e,t,n)}),500)}const i=((e,t)=>{let n=Uc("query",Object.assign({},t));for(const t in n)e.searchParams.set(t.toLowerCase(),n[t]);return e})(new URL(r),Object.assign(Object.assign({apiKey:this.apiKey,scheme:"ws",clientAppVersion:this.clientAppVersion},this.testHost?{testHost:this.testHost}:{}),n?{error:n}:{}));this.openingConnection=!0,this.webSocketConnection=new WebSocket(i.toString()),this.setEventListeners(this.webSocketConnection,t),this.openingConnection=!1;const a=e=>{let t=ku.sdkSessionEnding;e.persisted&&(t=ku.sdkPersistedToBrowserCache),this.close(t,"Connection closed by SDK, clean up WebSocket connection as page has been closed"),Su.lastPongSuccess=void 0,window.removeEventListener("pagehide",a)};return window.addEventListener("pagehide",a),this.webSocketConnection.readyState}catch(e){throw this.openingConnection=!1,e}}}Cu(Fu,"apiHost",void 0),Cu(Fu,"apiKey",void 0),Cu(Fu,"environmentId",void 0),Cu(Fu,"clientAppVersion","unknown"),Cu(Fu,"testHost",void 0),Cu(Fu,"openingConnection",!1),Cu(Fu,"authenticatingConnection",!1),Cu(Fu,"connectionAuthenticated",!1),Cu(Fu,"authenticationTimeout",7e3),Cu(Fu,"messageQueue",[]),Cu(Fu,"webSocketConnection",void 0),Cu(Fu,"connectionTimeout",void 0),Cu(Fu,"pingTimeout",void 0),Cu(Fu,"connectionTimer",3e4),Cu(Fu,"staleConnectionTimer",2*Fu.connectionTimer+5e3);const Mu={cardCompleted:"card-completed",cardDismissed:"card-dismissed",cardSnoozed:"card-snoozed",cardFeedUpdated:"card-feed-updated",cardDisplayed:"card-displayed",cardVotedUp:"card-voted-up",cardVotedDown:"card-voted-down",runtimeVarsUpdated:"runtime-vars-updated",streamDisplayed:"stream-displayed",userRedirected:"user-redirected",snoozeOptionsDisplayed:"snooze-options-displayed",snoozeOptionsCanceled:"snooze-options-canceled",cardSubviewDisplayed:"card-subview-displayed",cardSubviewExited:"card-subview-exited",videoPlayed:"video-played",videoCompleted:"video-completed",sdkInitialized:"sdk-initialized",requestFailed:"request-failed",notificationReceived:"notification-received",userFileUploadsStarted:"user-file-uploads-started",userFileUploadsCompleted:"user-file-uploads-completed",userFileUploadsFailed:"user-file-uploads-failed"},ju=[Mu.cardFeedUpdated,Mu.cardCompleted,Mu.cardDismissed,Mu.cardSnoozed,Mu.streamDisplayed,Mu.sdkInitialized,Mu.cardDisplayed],Au=e=>(!e.eventName&&e.analyticsEvent&&(e.eventName=e.analyticsEvent),e),Du=e=>{const n=(new Date).toISOString();return{id:(0,t.v4)(),analyticsEvent:Mu.cardFeedUpdated,eventName:Mu.cardFeedUpdated,endUserId:e.endUserId,timestamp:n,properties:{cardCount:e.cardCount},sdkContext:{containerId:e.streamContainerId},eventContext:{userLocalTimestamp:(0,a.format)(n,"YYYY-MM-DDTHH:mm:ss.SSSZ")}}};function Eu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class _u{constructor(e){var t,n,r,i,a;Eu(this,"totals",void 0),Eu(this,"metricsByContainer",void 0);const o=xc();let s={active:0,unseen:0};(null==e||null===(t=e.aggregates)||void 0===t||null===(n=t.cards)||void 0===n?void 0:n.total)&&(s.active=e.aggregates.cards.total.active,s.unseen=e.aggregates.cards.total.unseenCardInstanceIds.filter((e=>!o.has(e))).length),this.totals=s,this.metricsByContainer=(null==e||null===(r=e.aggregates)||void 0===r||null===(i=r.cards)||void 0===i||null===(a=i.byContainer)||void 0===a?void 0:a.reduce(((e,t)=>(e[t.containerId]={unseen:t.unseenCardInstanceIds.filter((e=>!o.has(e))).length,active:t.active},e)),{}))||{}}unseenCards(){return this.totals.unseen||0}totalCards(){return this.totals.active||0}unseenCardsForStreamContainer(e){var t;return(null===(t=this.metricsByContainer[e])||void 0===t?void 0:t.unseen)||0}totalCardsForStreamContainer(e){var t;return(null===(t=this.metricsByContainer[e])||void 0===t?void 0:t.active)||0}}var Lu=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};let Pu;const Hu=(e,t,n)=>Lu(void 0,void 0,void 0,(function*(){if(Wu(),!e||!Array.isArray(e)||0===e.length||e.some((e=>"string"!=typeof e)))throw new Error("containerIds must be a non-empty array of strings");let r=Object.assign({deviceId:Pu.deviceId,appId:Pu.appId,streamContainerIds:e,platform:Pu.platform},n?{notificationsEnabled:n}:{});const{data:i,response:a}=yield zc.put("register-containers",r,t,{streamContainerIds:e});if(zu(Hu.name,i),a.error)throw a.error;return 200===a.status})),Ru=(e,t)=>Lu(void 0,void 0,void 0,(function*(){Wu();let n={token:e,deviceId:Pu.deviceId,appId:Pu.appId,platform:Pu.platform};const{data:r,response:i}=yield zc.put("register",n,t);if(zu(Ru.name,r),i.error)throw i.error;return 200===i.status})),$u=e=>Lu(void 0,void 0,void 0,(function*(){Wu();let t={deviceId:Pu.deviceId,appId:Pu.appId};const{data:n,response:r}=yield zc.delete("deregister-token",t,e);if(zu($u.name,n),r.error)throw r.error;return 200===r.status})),Nu=e=>{if(!Ic(e))return null;const t=e.atomic;if(!Ic(t))return null;const n=t,{source:r,cardInstanceId:i,streamContainerId:a,detail:o}=n;return"io.atomic"!==r||"string"!=typeof i||"number"!=typeof a&&"string"!=typeof a?null:{cardInstanceId:i,containerId:a.toString(),detail:Ic(o)?o:{}}},Vu=e=>{const t=[];return e||t.push("deviceInfo should be a non-null object."),(null==e?void 0:e.platform)||t.push('platform should be either "iOS" or "Android".'),(null==e?void 0:e.deviceId)||t.push("deviceId should be a non-empty string."),(null==e?void 0:e.appId)||t.push("appId should be a non-empty string."),(null==e?void 0:e.platform)&&!["ios","android"].includes(e.platform.toLowerCase())&&t.push('platform is invalid: should be either "iOS" or "Android".'),t.length>0?{success:!1,errors:t}:{success:!0,errors:[]}},Wu=()=>{if(!Vu(Pu).success)throw new Error("You must call setNativeDeviceInfo before registering for native notifications")},zu=(e,t)=>{var n;(null==t||null===(n=t.errors)||void 0===n?void 0:n.length)&&l.error({level1:[`Errors detected with ${e}`,...t.errors.map((e=>null==e?void 0:e.title))]})};var Bu=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};const Uu=e=>{var t;const n=[],r=["mon","tue","wed","thu","fri","sat","sun","default"];if(null===(t=e.preferences)||void 0===t?void 0:t.notifications){for(const[t,a]of Object.entries(null===(i=e.preferences)||void 0===i?void 0:i.notifications)){var i;if(!r.includes(t)){n.push(`Invalid key provided for "${t}", notification preferences can only be provided for the following keys: ${r.toString()}`);continue}if(!(null==a?void 0:a.length))continue;const o=a.map((e=>{const{from:r,to:i}=e,a=e=>`${e.hours.toString().padStart(2,"0")}:${e.minutes.toString().padStart(2,"0")}`;if(!r&&!i||r&&!i||!r&&i)n.push(`Invalid notification range provided for ${t}, both a "from" & "to" value are required`);else if(isNaN(r.hours)||isNaN(r.minutes)||isNaN(i.hours)||isNaN(i.minutes))n.push(`Invalid notification range provided for ${t}, non-numeric value provided for "from" or "to"`);else if(r.hours>23||r.hours<0||i.hours>23||i.hours<0)n.push(`Invalid notification range provided for ${t}, hours must be between 0 & 23 inclusive`);else if(r.minutes>59||r.minutes<0||i.minutes>59||i.minutes<0)n.push(`Invalid notification range provided for ${t}, minutes must be between 0 & 59 inclusive`);else{if(!(r.hours>i.hours))return{from:a(r),to:a(i)};n.push(`Invalid notification range provided for ${t}, end time must be earlier than start time`)}}));e.preferences.notifications[t]=o}n.length&&(l.warn({level1:n}),delete e.preferences.notifications)}};var qu=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))};function Yu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ku=n(5373),Zu="atomic-sdk-modal-stream-embed",Qu="atomic-sdk-text-observer",Gu="authCallbackError",Xu="authRetryIntervalPending",Ju="authTokenError",eh=(e,t)=>{t(e)},th=(e,t)=>{var n,r,i,a,o;const s=(null===(n=t.features)||void 0===n||null===(r=n.cordova)||void 0===r?void 0:r.enabled)||!1,l=s?mu():"https://downloads.atomic.io/web-sdk/release/25.4.2/iframe-manager-cdn-icons.js";if(s&&!l)return void console.error("The Atomic SDK could not locate a required script (iframe-manager.js). Ensure you have included the script on your page and have added the ID `atomic-frame-manager` to the element.");const d=null===(i=t.enabledUiElements)||void 0===i||null===(a=i.customContainerHeader)||void 0===a?void 0:a.headerElement;(null===(o=t.enabledUiElements)||void 0===o?void 0:o.customContainerHeader)&&(t.enabledUiElements.customContainerHeader.headerElement="");const c=`\n <!doctype html>\n <head>\n <title>Atomic SDK</title>\n <style>\n html,body {margin: 0; height: 100%; width:100%; overflow: hidden;}\n * {box-sizing: border-box;}\n </style>\n </head>\n <body>\n <script src='${l}' data-config='${JSON.stringify(t).replace(/'/g,"'")}' type='application/javascript'><\/script>\n <div id='custom-container-header' style='display:none;'>${null!=d?d:""}</div>\n </body>\n </html>\n`;e.setAttribute("srcdoc",c)};class nh{static setSessionDelegate(e,t){this.tokenRetryInterval=t||0,this.onAuthTokenRequested=e}static setTokenExpiryInterval(e){if(!("number"==typeof e&&e>0))return l.error({level1:["Could not set token expiry interval, invalid value provided. The value must be a number greater than 0."]});this.tokenExpiryInterval=e}static launch(e){nh.init();const t=new rh(e,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:!1}),"launcher",this.analyticsQueue);return nh.streamContainers[t.instanceId]={sendMessageToIframe:e=>t.sendMessageToIframe(e),logout:()=>{t.sendMessageToIframe({action:g})},embedMode:"launcher"},t}static embed(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];nh.init();const r=new rh(t,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:n}),"standalone",this.analyticsQueue,e);return nh.streamContainers[r.instanceId]={sendMessageToIframe:e=>r.sendMessageToIframe(e),logout:()=>{r.sendMessageToIframe({action:g})},embedMode:"standalone"},r}static singleCard(e,t){nh.init();const n=new rh(t,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:!0}),"single-card",this.analyticsQueue,e);return nh.streamContainers[n.instanceId]={sendMessageToIframe:e=>n.sendMessageToIframe(e),logout:()=>{n.sendMessageToIframe({action:g})},embedMode:"single-card"},n}static modalStreamContainer(e){if(Object.values(nh.streamContainers).find((e=>"modal-stream"===e.embedMode)))return console.warn("AtomicSDK Web - A modal stream container already exists, only one instance can be created.");nh.init();let t=document.createElement("div");document.getElementById(Zu)?t=document.getElementById(Zu):t.id=Zu,document.body.appendChild(t);const n=new rh(e,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:!0}),"modal-stream",this.analyticsQueue,t);return nh.streamContainers[n.instanceId]={sendMessageToIframe:e=>n.sendMessageToIframe(e),logout:()=>{n.sendMessageToIframe({action:g})},embedMode:"modal-stream"},n}static observableStreamContainer(e){nh.init();const t=new ih(e,Object.assign({},this.internalConfig),this.analyticsQueue);return nh.streamContainers[t.instanceId]={sendMessageToIframe:e=>t.onMessageReceived(e),logout:()=>{t.onMessageReceived({action:g})},embedMode:"headless"},t}static init(){return qu(this,void 0,void 0,(function*(){if(!nh.hasPerformedInitialisation){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Ku)),document.head.appendChild(e),window.addEventListener("request-failed",(e=>qu(this,void 0,void 0,(function*(){const t=e.detail,n=yield this.analyticsQueue.enqueue({timestamp:new Date,endUserId:t.request.endUserId||"",containerId:t.request.streamContainerId,containerIds:t.request.streamContainerIds,cardInstanceId:t.request.cardInstanceId,eventName:ht,properties:{path:t.request.path,statusCode:t.request.statusCode}},"standard","unauthenticated");if(n){var r;Su.sendAnalyticsMessage([n]);const e=Au(n);null===(r=nh.sdkEventObserver)||void 0===r||r.call(nh,e)}})))),nh.hasPerformedInitialisation=!0}const e=Fu.webSocketConnection;e&&(null==e?void 0:e.readyState)!==(null==e?void 0:e.CLOSED)||this.internalConfig.webSocketDisabled||(yield this.createWebSocketConnection().catch((e=>{var t;l.debug({level3:[`SDK init, error creating WebSocket connection: ${e}`]}),null===(t=nh.onError)||void 0===t||t.call(nh,e)})))}))}static initialise(e,t,n){return qu(this,void 0,void 0,(function*(){const r={webSocketDisabled:this.internalConfig.webSocketDisabled,pollingFallbackDisabled:this.internalConfig.pollingFallbackDisabled,testHost:this.internalConfig.testHost,clientAppVersion:this.internalConfig.clientAppVersion,tokenUserIdAttribute:this.internalConfig.tokenUserIdAttribute};this.internalConfig=Object.assign({apiHost:e,apiKey:t,environmentId:n},r),e&&t&&n&&sessionStorage.setItem(T,JSON.stringify({initialiseCalled:!0,eventDispatched:!1})),nh.cachedToken=void 0,zc.initialise(e,t,n),this.internalConfig.webSocketDisabled||(Fu.initialise(e,t,n),Su.reset(),yield this.createWebSocketConnection().catch((e=>{var t;l.debug({level3:[`SDK initialise, error creating WebSocket connection: ${e}`]}),null===(t=nh.onError)||void 0===t||t.call(nh,e)}))),window.AtomicUploadService=At,window.addEventListener("pageshow",(r=>{r.persisted&&(zc.initialise(e,t,n),this.internalConfig.webSocketDisabled||(Fu.initialise(e,t,n),this.createWebSocketConnection().catch((e=>{var t;l.debug({level3:[`SDK network clients reinitialized after page loaded from cache, error creating WebSocket connection: ${e}`]}),null===(t=nh.onError)||void 0===t||t.call(nh,e)}))),this.initialiseSDKBroadcastChannel())}))}))}static initialiseSDKBroadcastChannel(){var e;(null===(e=nh.containersBroadcastChannel)||void 0===e?void 0:e.isOpen)||(nh.containersBroadcastChannel=new Is)}static setApiProtocol(e){const{apiHost:t,apiKey:n,environmentId:r}=this.internalConfig;if(t||n||r)throw new Error("You must set API protocol before initializing the SDK. This is because the SDK needs to know the protocol to use when creating a connection to the Atomic Platform.");this.internalConfig.webSocketDisabled="http"===e,this.webSocketDisabled="http"===e}static enableDebugMode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;l.logLevel=e,Object.values(nh.streamContainers).forEach((t=>t.sendMessageToIframe({action:"io.atomic.events.logLevelUpdate",values:{logLevel:e}})))}static createWebSocketConnection(){var e=arguments;return qu(this,void 0,void 0,(function*(){let t=e.length>0&&void 0!==e[0]?e[0]:0,n=e.length>1?e[1]:void 0;const r={1:100,2:15e3,3:6e4};if(Fu.openingConnection)return;const i={onMessage:e=>{Su.handleWebSocketMessage(e)},onError:e=>{l.error({level3:["WebSocket error handler received error message",e]})},onOpen:()=>qu(this,void 0,void 0,(function*(){try{yield this.handleTokenRequest({skipCache:!0,authWebSocket:!0}),Su.lastPongSuccess=(new Date).toISOString(),Su.resubscribeActiveSubscriptions()}catch(e){l.error({level1:["Error authenticating WebSocket."],level2:[e]}),Object.values(nh.streamContainers).forEach((t=>{t.sendMessageToIframe({action:I,values:e instanceof Error?e.message:e})}))}})),onClose:e=>{switch(e.code){case ku.sdkChangingProtocol:case ku.sdkReinitialisedWebSocket:case ku.sdkSessionEnding:case ku.sdkCordovaBackgrounded:case ku.sdkPersistedToBrowserCache:case ku.unitTestConnectionClose:l.debug({level1:[`WebSocket closed with ${e.code} connection close code`],level2:[e]});break;case ku.retryConnection:if(l.debug({level1:[`WebSocket closed with ${e.code} connection close code`],level2:[e]}),t<3){const e=t+1;setTimeout((()=>{this.createWebSocketConnection(e).catch((e=>{var t;l.debug({level3:["Error on websocket connection retry",e]}),null===(t=nh.onError)||void 0===t||t.call(nh,e)}))}),r[e])}else this.triggerPollingFallback(n);break;case ku.sdkClosedConnection:case ku.notPermitted:case ku.abnormalClosure:default:nh.internalConfig.pollingFallbackDisabled||this.triggerPollingFallback(n),l.debug({level1:[`WebSocket closed with ${e.code} connection close code`],level2:[e]})}}};try{Fu.open("socket",i,n)}catch(e){l.error({level1:["Error creating WebSocket connection"],level2:[e]});const t=new Error(`Error creating WebSocket connection: ${e}`);throw t.name="WebSocket connection error",t}}))}static reinitialiseWebSocketConnection(){Fu.close(ku.sdkReinitialisedWebSocket),this.createWebSocketConnection().catch((e=>{var t;l.debug({level3:["Error reinitializing websocket connection",e]}),null===(t=nh.onError)||void 0===t||t.call(nh,e)}))}static authenticateWebSocketConnection(e){return qu(this,void 0,void 0,(function*(){Su.sendAuthMessage(e),Fu.connectionAuthenticated||(Fu.authenticatingConnection=!0,yield new Promise(((e,t)=>{const n=setTimeout((()=>{nh.authMessageReject("WebSocket authentication timed out")}),Fu.authenticationTimeout);nh.authMessageResolve=()=>{l.debug({level3:["WebSocket auth promise resolved."]}),e(),Fu.purgeMessageQueue(),clearTimeout(n),Fu.authenticatingConnection=!1},nh.authMessageReject=e=>{l.error({level3:["WebSocket auth promise rejected.",e]}),Object.values(nh.streamContainers).forEach((t=>{var n;t.sendMessageToIframe({action:I,values:null!==(n=e.message)&&void 0!==n?n:e})})),t(e),clearTimeout(n),Fu.authenticatingConnection=!1}})))}))}static simulateWebSocketError(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Fu.close(),t&&this.createWebSocketConnection(0,e).catch((e=>{l.debug({level3:["Error reconnecting websocket",e]})}))}static triggerPollingFallback(e){return qu(this,void 0,void 0,(function*(){var t;nh.authMessageResolve=()=>null,nh.authMessageReject=()=>null,e&&(Fu.close(),Fu.clearTimeouts()),Object.values(this.streamContainers).forEach((e=>{e.sendMessageToIframe({action:k})}));const n=yield this.analyticsQueue.enqueue({timestamp:new Date,eventName:ht,endUserId:null!==(t=jc(nh.cachedToken,nh.internalConfig.tokenUserIdAttribute))&&void 0!==t?t:"",properties:Object.assign({path:`${this.internalConfig.environmentId}/socket`},e?{source:"user-simulate"}:{})},"standard","unauthenticated");if(n){var r;Su.sendAnalyticsMessage([n]);const e=Au(n);null===(r=nh.sdkEventObserver)||void 0===r||r.call(nh,e)}}))}static setTestHostHeader(e){this.internalConfig.testHost=e,zc.setTestHostHeader(e),Fu.setTestHostParam(e)}static setClientAppVersion(e){if(!("string"==typeof e))return l.error({level1:["Could not set client app version"],level2:[": Invalid value provided, must be a string."]});e.length>128&&l.warn({level1:["Client app version truncated"],level2:[": value provided was longer than 128 character maximum."]});const t=e.substring(0,128);zc.setClientAppVersion(t),Fu.setClientAppVersion(t),this.internalConfig.clientAppVersion=t}static setTokenUserIdAttribute(e){return"string"==typeof e?e.length>128?l.error({level1:["Could not set token user ID attribute"],level2:[": value provided was longer than 128 character maximum."]}):(zc.setTokenUserIdAttribute(e),void(this.internalConfig.tokenUserIdAttribute=e)):l.error({level1:["Could not set token user ID attribute"],level2:[": Invalid value provided, must be a string."]})}static setRetryTimer(){nh.tokenRetryInterval&&!nh.tokenRetryTimer&&(nh.tokenRetryTimer=setTimeout((()=>{nh.tokenRetryTimer=void 0}),nh.tokenRetryInterval))}static handleTokenRequest(e){return qu(this,void 0,void 0,(function*(){var t;let n,r=new Error;if(!nh.onAuthTokenRequested)throw r.message="Could not resolve an auth token. `AtomicSDK.setSessionDelegate` must be used to set a callback resolving to a promise that supplies an authentication token.",r.name=Gu,r;if(nh.tokenRetryTimer)throw r.message="Not ready to retry token request",r.name=Xu,r;if(nh.cachedToken&&!(null==e?void 0:e.skipCache)){const e=Sc(nh.cachedToken);if(!(e=>{const t=Math.floor((new Date).getTime()/1e3);return 1===(0,a.compareAsc)(t,e)})(e.exp-nh.tokenExpiryInterval))return nh.cachedToken;n=e}const i=yield Promise.race([new Promise((e=>{setTimeout((()=>{e(void 0)}),5e3)})),null===(t=nh.onAuthTokenRequested)||void 0===t?void 0:t.call(nh)]);if(!i||0===i.length)throw r.message="An authentication token was required for the request, however no token was returned.",r.name=Ju,nh.setRetryTimer(),r;if(!Cc(i))throw r.message="The auth token provided is not a valid JWT.",r.name=Ju,nh.setRetryTimer(),r;if(n&&n.exp-n.iat<3600){jc(nh.cachedToken,nh.internalConfig.tokenUserIdAttribute)!==jc(i,nh.internalConfig.tokenUserIdAttribute)&&l.error({level1:["User ID has changed between authenticated requests without first calling `AtomicSDK.logout` be sure to call this when a user is logged out"]})}const o=jc(i,nh.internalConfig.tokenUserIdAttribute);o&&o!==jc(nh.cachedToken,nh.internalConfig.tokenUserIdAttribute)&&nh.analyticsQueue.initializeAuthenticatedQueue(o);const s=JSON.parse(sessionStorage.getItem(T)||"{}");if(o&&s.initialiseCalled&&!s.eventDispatched){const e={endUserId:o,eventName:tt,timestamp:new Date,properties:{}};nh.analyticsQueue.enqueue(e,"sdk-initialized","authenticated").then((e=>{if(e){var t;Su.sendAnalyticsMessage([e]);const n=Au(e);null===(t=nh.sdkEventObserver)||void 0===t||t.call(nh,n)}})),sessionStorage.setItem(T,JSON.stringify(Object.assign(Object.assign({},s),{eventDispatched:!0})))}if((null==e?void 0:e.authWebSocket)&&Fu.isConnected()&&!Fu.authenticatingConnection)try{yield nh.authenticateWebSocketConnection(i)}catch(r){throw l.error({level3:["Fresh auth token received, error authenticating WebSocket connection with new token.",r]}),r}return nh.cachedToken=i}))}static getCurrentUserId(){var e;return null!==(e=jc(nh.cachedToken,nh.internalConfig.tokenUserIdAttribute))&&void 0!==e?e:""}static requestCardCount(e){return qu(this,void 0,void 0,(function*(){if(!e)throw new Error("A stream container ID is required when requesting card count.");if(!zc.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to request card count.");try{const t=yield zc.get(`feed/${e}`,{requestToken:yield nh.handleTokenRequest},void 0,{streamContainerId:e});if(t.response.error)throw t.response.error;if(200===t.response.status&&t.data&&t.data.cardInstances)return{totalCards:t.data.cardInstances.length};throw new Error("Unexpected response returned when fetching card count.")}catch(e){throw new Error(`Card count could not be retrieved. ${e instanceof Error?e.message:String(e)}`)}}))}static sendEvent(e){return qu(this,void 0,void 0,(function*(){var t,n,r;if(console.error(new Error("`AtomicSDK.sendEvent` is deprecated and will be removed in a future release.")),!e.name)throw new Error("An event name is required to send an event.");if(!zc.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to send an event.");let i={name:e.name,payload:{detail:(null===(t=e.payload)||void 0===t?void 0:t.detail)||{},metadata:(null===(n=e.payload)||void 0===n?void 0:n.metadata)||{},notificationDetail:(null===(r=e.payload)||void 0===r?void 0:r.notificationDetail)||{}}};e.lifecycleId&&(i.lifecycleId=e.lifecycleId);try{const e=yield zc.post("event",{data:i},{requestToken:yield nh.handleTokenRequest});if(e.data&&e.data.errors){const t=e.data.errors.map((e=>e.title||"")).join("\n");throw new Error(`The following errors were returned: ${t}`)}if(e.response.error)throw e.response.error;if(200!==e.response.status)throw new Error("No error information was available.");return e.data}catch(e){throw new Error(`The event could not be sent. ${e instanceof Error?e.message:String(e)}`)}}))}static sendCustomEvent(e){return qu(this,void 0,void 0,(function*(){var t;if(!zc.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to send a custom event.");const n=jc(yield nh.handleTokenRequest(),nh.internalConfig.tokenUserIdAttribute);if(!n)throw new Error("Could not send custom event, a valid user ID was not obtained from the auth token.");if("string"!=typeof e.eventName||!(null===(t=e.eventName)||void 0===t?void 0:t.length))throw new Error("Could not send custom event, an invalid event name was supplied. The `eventName` must be a string of non zero length.");if(void 0!==e.properties&&(Array.isArray(e.properties)||null===e.properties||"object"!=typeof e.properties))throw new Error("Could not send custom event, an invalid value was supplied for event properties.");this.analyticsQueue.enqueue(Object.assign({endUserId:n,eventName:e.eventName,timestamp:new Date},e.properties?{properties:e.properties}:{}),"custom","authenticated").then((e=>{e&&Su.sendAnalyticsMessage([e])}))}))}static observeSDKEvents(e){this.sdkEventObserver=e}static requestUserMetrics(){return qu(this,void 0,void 0,(function*(){if(!zc.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to request user metrics.");try{const e=yield zc.get("user-metrics",{requestToken:yield nh.handleTokenRequest},this.cachedUserMetrics.lastModified);if(e.response.error)throw e.response.error;switch(e.response.status){case 200:return this.cachedUserMetrics={lastModified:e.response.etag||void 0,userMetricsResponse:e.data,userMetrics:new _u(e.data)},this.cachedUserMetrics.userMetrics;case 304:if(this.cachedUserMetrics.userMetricsResponse)return new _u(this.cachedUserMetrics.userMetricsResponse);throw new Error("Response indicated that there were no new metrics, but no cached metrics could be returned.");default:throw new Error("No error information was available.")}}catch(e){throw new Error(`User metrics could not be retrieved. ${e instanceof Error?e.message:String(e)}`)}}))}static updateUser(e){return qu(this,void 0,void 0,(function*(){if(!zc.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to update a user profile.");try{const{ok:r,error:i}=yield(t=e,n={requestToken:yield nh.handleTokenRequest},Bu(void 0,void 0,void 0,(function*(){var e,r;(null===(e=t.preferences)||void 0===e?void 0:e.notifications)&&Uu(t);const{data:i,response:a}=yield zc.put("update-user",t,n);return(null==i||null===(r=i.errors)||void 0===r?void 0:r.length)&&l.error({level1:["Errors detected with user update:",...i.errors.map((e=>null==e?void 0:e.title))]}),a.error?{ok:!1,error:a.error}:{ok:200===a.status}})));if(i)throw i;return r}catch(e){throw new Error(`User update could not be completed. ${e instanceof Error?e.message:String(e)}`)}var t,n}))}static onCardAction(e,t){if(!zc.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to execute a card action.");if(!e||!t)throw new Error("You must provide a valid container ID and card ID to execute a card action.");return{dismiss:(n,r)=>qu(this,void 0,void 0,(function*(){const i=yield $o(e,t,{requestToken:yield nh.handleTokenRequest});i.ok?n():i.error&&r(i.error)})),snooze:(n,r,i)=>qu(this,void 0,void 0,(function*(){if(!i||"number"!=typeof i||i<0)throw new Error("Invalid snooze interval, interval must be a positive number");const a=yield No(e,t,i,{requestToken:yield nh.handleTokenRequest});a.ok?n():a.error&&r(a.error)})),submit:(n,r,i,a)=>qu(this,void 0,void 0,(function*(){const o=null!=a?a:{};if(!i)throw new Error("Submit button name missing, a button name must be supplied to submit a card response");for(const[e,t]of Object.entries(o)){if("string"!=typeof e)throw new Error("Invalid card response supplied, response keys must be strings");if(!["string","number","boolean"].includes(typeof t))throw new Error("Invalid card response supplied, response values must be strings, numbers or booleans")}const s=yield Ro(e,t,Object.assign(Object.assign({},o),{[i]:null}),{requestToken:yield nh.handleTokenRequest});s.ok?n():s.error&&r(s.error)}))}}static logout(){var e=arguments;return qu(this,void 0,void 0,(function*(){if(e.length>0&&void 0!==e[0]&&e[0])try{yield nh.deregisterDeviceForNotifications()}catch(e){const t=e instanceof Error?e.message:String(e);t.includes("You must call setNativeDeviceInfo before registering for native notifications")||console.error(`Problem de-registering notifications when logging out: ${t}`)}Object.values(nh.streamContainers).forEach((e=>{e.logout()})),nh.streamContainers={},yield this.analyticsQueue.flush(),nh.cachedUserMetrics={},nh.cachedToken=void 0,nh.tokenRetryTimer=void 0,nh.sdkEventObserver=null,sessionStorage.removeItem(F),Fu.close(ku.sdkSessionEnding,"Connection closed by SDK, user logged out"),Fu.reset(),nh.internalConfig=Object.assign(Object.assign({},nh.internalConfig),{apiHost:void 0,apiKey:void 0,environmentId:void 0}),zc.reset()}))}static login(e,t,n,r,i){nh.initialise(e,t,n),nh.setSessionDelegate(r,i)}static setNativeDeviceInfo(e){try{return(e=>{const t=Vu(e);if(t.success)return Pu=e,!0;{const e=`Device info set with invalid parameters: ${t.errors.join("\n")}`;throw console.error(e),new Error(e)}})(e)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to setNativeDeviceInfo: ${t}`)}}static registerDeviceForNotifications(e){return qu(this,void 0,void 0,(function*(){if(!zc.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to register the device for push notifications");try{return yield Ru(e,{requestToken:yield nh.handleTokenRequest})}catch(e){throw new Error(`${Ru.name} could not be completed. ${e instanceof Error?e.message:String(e)}`)}}))}static deregisterDeviceForNotifications(){return qu(this,void 0,void 0,(function*(){if(!zc.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to deregister the device for push notifications");try{return yield $u({requestToken:yield nh.handleTokenRequest})}catch(e){throw new Error(`${$u.name} could not be completed. ${e instanceof Error?e.message:String(e)}`)}}))}static registerStreamContainersForNotifications(e,t){return qu(this,void 0,void 0,(function*(){if(!zc.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to register stream containers for notifications");try{return yield Hu(e,{requestToken:yield nh.handleTokenRequest},t)}catch(e){throw new Error(`${Hu.name} could not be completed. ${e instanceof Error?e.message:String(e)}`)}}))}static notificationFromPushPayload(e){return Nu(e)}static trackPushNotificationReceived(e){const t=Nu(e);if(null==t)return!1;const n=jc(nh.cachedToken,nh.internalConfig.tokenUserIdAttribute);if(!n)return l.warn({level1:["Atomic push notification received, no user ID found so could not log analytics event for notification received"]}),!0;let r={eventName:gt,endUserId:n,containerId:t.containerId,cardInstanceId:t.cardInstanceId,timestamp:new Date};return nh.analyticsQueue.enqueue(r,"standard","authenticated").then((e=>{if(e){var t;Su.sendAnalyticsMessage([e]);const n=Au(e);null===(t=nh.sdkEventObserver)||void 0===t||t.call(nh,n)}})),!0}}Yu(nh,"hasPerformedInitialisation",!1),Yu(nh,"webSocketDisabled",!1),Yu(nh,"cachedUserMetrics",{}),Yu(nh,"internalConfig",{}),Yu(nh,"cachedToken",void 0),Yu(nh,"onError",void 0),Yu(nh,"sdkEventObserver",null),Yu(nh,"SDKEvents",Mu),Yu(nh,"userMetricsTriggerEvents",new Set(ju)),Yu(nh,"onAuthTokenRequested",void 0),Yu(nh,"tokenRetryInterval",0),Yu(nh,"tokenRetryTimer",void 0),Yu(nh,"tokenExpiryInterval",60),Yu(nh,"authMessageResolve",(()=>null)),Yu(nh,"authMessageReject",(()=>null)),Yu(nh,"streamContainers",{}),Yu(nh,"containersBroadcastChannel","BroadcastChannel"in window?new Is:void 0),Yu(nh,"analyticsQueue",new class{constructor(e){Mc(this,"authenticatedEventQueue",void 0),Mc(this,"unauthenticatedEventQueue",[]),Mc(this,"flushTimeout",null),Mc(this,"flushPromise",null),Mc(this,"authTokenProvider",void 0),Mc(this,"tokenUserIdAttribute",void 0),this.authTokenProvider=e;const t=localStorage.getItem(Ac);if(t)try{this.unauthenticatedEventQueue=JSON.parse(t)}catch(e){}this.scheduleFlush()}getKeyForAuthenticatedQueue(e){return`${e}_AuthenticatedAtomicAnalyticsQueue`}initializeAuthenticatedQueue(e,t){const n=localStorage.getItem(this.getKeyForAuthenticatedQueue(e));if(n)try{this.authenticatedEventQueue=JSON.parse(n)}catch(t){this.authenticatedEventQueue=[],l.error({level1:["Failed to parse existing authenticated analytics queue for user:",e]})}else this.authenticatedEventQueue=[],l.debug({level1:["No existing authenticated analytics queue found for user:",e]});this.tokenUserIdAttribute=t}createEventPayload(e,n){const r={id:(0,t.v4)(),endUserId:e.endUserId,timestamp:e.timestamp.toISOString(),properties:e.properties||{},eventContext:{userLocalTimestamp:(0,a.format)(e.timestamp,"YYYY-MM-DDTHH:mm:ss.SSSZ")}};switch(n){case"standard":{const t=e;return Object.assign(Object.assign({},r),{analyticsEvent:t.eventName,hostContext:t.hostContext||{},sdkContext:Object.assign({containerId:t.containerId||""},t.containerIds?{containerIds:t.containerIds}:{}),streamContext:Object.assign({streamLength:t.streamLength||0,streamLengthVisible:t.streamLengthVisible||0,cardPositionInStream:t.streamCardPosition||0},t.displayMode?{displayMode:t.displayMode}:{}),cardContext:{cardInstanceId:t.cardInstanceId||"",cardInstanceStatus:t.cardInstanceStatus||"",cardViewState:t.cardViewState||"topview",cardPresentation:"individual"}})}case"custom":return Object.assign(Object.assign({},r),{eventType:"custom",eventName:e.eventName,sdkContext:{}});case"sdk-initialized":return Object.assign(Object.assign({},r),{analyticsEvent:e.eventName,hostContext:{},cardContext:{},streamContext:{},sdkContext:{}});default:return null}}enqueue(e){var t=arguments;return Fc(this,void 0,void 0,(function*(){let n=t.length>1&&void 0!==t[1]?t[1]:"standard",r=t.length>2&&void 0!==t[2]?t[2]:"authenticated";if(!zc.isInitialised())return null;const i=this.createEventPayload(e,n);if(i){let t;if("authenticated"===r){if(!this.authenticatedEventQueue)return l.warn({level1:["Attempt to send authenticated event but authenticated queue not initialized, dropping analytic event."],level2:[`${e.eventName}: `,e]}),null;t=this.authenticatedEventQueue}else t=this.unauthenticatedEventQueue;t.push(i),t.length>500&&t.splice(0,t.length-500)}return yield this.persistQueue(r),i}))}removeProcessedEvents(e){var t;(null===(t=this.authenticatedEventQueue)||void 0===t?void 0:t.length)&&(this.authenticatedEventQueue=this.authenticatedEventQueue.filter((t=>!e.includes(t.id))),this.persistQueue("authenticated")),this.unauthenticatedEventQueue.length&&(this.unauthenticatedEventQueue=this.unauthenticatedEventQueue.filter((t=>!e.includes(t.id))),this.persistQueue("unauthenticated"))}performFlush(){return Fc(this,void 0,void 0,(function*(){null!=this.flushTimeout&&(window.clearTimeout(this.flushTimeout),this.flushTimeout=null);const e={};let t=[...this.authenticatedEventQueue||[]],n=[...this.unauthenticatedEventQueue||[]];if(t.length&&zc.isInitialised()){const n=yield this.authTokenProvider.requestToken();t=t.filter((e=>e.endUserId===jc(n,this.tokenUserIdAttribute))),e.authenticated=zc.put("sdk-events",{data:t},this.authTokenProvider)}n.length&&zc.isInitialised()&&(e.unauthenticated=zc.put("analytics",{data:n}));const r=Object.keys(e);if(0===r.length)return this.scheduleFlush();try{const i=Object.values(e).filter((e=>void 0!==e)),a=yield Promise.allSettled(i),o={};a.forEach(((e,t)=>{"fulfilled"===e.status?o[r[t]]=e.value:l.error({level1:[`Error flushing analytics events for ${r[t]}`],level2:[`Error: ${e.reason instanceof Error?e.reason.message:e.reason}`]})})),o.authenticated&&200===o.authenticated.response.status&&this.authenticatedEventQueue&&(this.authenticatedEventQueue=this.authenticatedEventQueue.filter((e=>!t.includes(e))),this.persistQueue("authenticated")),o.unauthenticated&&200===o.unauthenticated.response.status&&(this.unauthenticatedEventQueue=this.unauthenticatedEventQueue.filter((e=>!n.includes(e))),this.persistQueue("unauthenticated"))}catch(e){l.error({level1:["Error flushing analytics events"],level2:[`Error: ${e instanceof Error?e.message:String(e)}`]})}finally{this.scheduleFlush()}}))}flush(){return Fc(this,void 0,void 0,(function*(){return this.flushPromise=null===this.flushPromise?this.performFlush():this.flushPromise.then((()=>this.performFlush())),this.flushPromise}))}scheduleFlush(){this.flushTimeout=window.setTimeout(this.flush.bind(this),3e4)}persistQueue(){var e=arguments;return Fc(this,void 0,void 0,(function*(){if("unauthenticated"===(e.length>0&&void 0!==e[0]?e[0]:"authenticated"))return localStorage.setItem(Ac,JSON.stringify(this.unauthenticatedEventQueue));const t=yield this.authTokenProvider.requestToken();if(!t)return l.error({level1:["No auth token available for persisting authenticated analytics queue."]});const n=jc(t,this.tokenUserIdAttribute);if(!n)return l.error({level1:["No user ID found in auth token for persisting authenticated analytics queue."]});localStorage.setItem(this.getKeyForAuthenticatedQueue(n),JSON.stringify(this.authenticatedEventQueue))}))}}({requestToken:nh.handleTokenRequest}));class rh{constructor(e,n,r,i,a){Yu(this,"iframe",void 0),Yu(this,"modalIframe",void 0),Yu(this,"toastIframe",void 0),Yu(this,"outsideClickListener",void 0),Yu(this,"queuedMessages",[]),Yu(this,"iframeLoaded",!1),Yu(this,"appOpen",!1),Yu(this,"launchButtonIconContainer",void 0),Yu(this,"launcher",void 0),Yu(this,"resizeObserver",void 0),Yu(this,"resolvedConfiguration",void 0),Yu(this,"instanceId",void 0),Yu(this,"streamFilters",new Qc((()=>this.sendMessageToIframe({action:O,values:{filter:this.streamFilters.getFilterObject()}})),(()=>{this.sendMessageToIframe({action:O,values:{filter:void 0}})}))),Yu(this,"config",void 0),Yu(this,"analyticsQueue",void 0);const o=`${e.streamContainerId}`;if(null===e.streamContainerId||void 0===e.streamContainerId||"string"!=typeof e.streamContainerId&&"number"!=typeof e.streamContainerId||0===o.trim().length)throw new Error("The Atomic SDK failed to start. You must pass a `streamContainerId` when instantiating a stream container.");var s,l,d,c;if(!nh.onAuthTokenRequested)throw new Error("You must use `AtomicSDK.setSessionDelegate` to set a callback resolving to a promise that supplies an authentication token before attempting to create a stream container.");if(void 0!==(null===(s=e.features)||void 0===s?void 0:s.cardVoting)&&console.warn("Stream container configuration for card voting is deprecated. Stream container feature configuration should not include `cardVoting` as it will be removed in a future release. Instead, use the card voting menu configuration in the Atomic workbench: https://documentation.atomic.io/guide/cards/behaviour#card-voting"),void 0!==(null===(l=e.features)||void 0===l?void 0:l.cardMinimumHeight)&&console.warn("Configuration in `features` is deprecated. Use the top level configuration property `cardMinimumHeight` instead."),void 0!==(null===(d=e.features)||void 0===d?void 0:d.horizontalContainerConfig)&&console.warn("Configuration in `features` is deprecated. Use the top level configuration property `horizontalContainerConfig` instead."),void 0!==(null===(c=e.features)||void 0===c?void 0:c.controlledContainerOpenState)&&console.warn("Configuration in `features` is deprecated. Use the top level configuration property `controlledContainerOpenState` instead."),!this.iframeLoaded){var u,h,p;let s=Object.assign(Object.assign(Object.assign({},e),{streamContainerId:o}),n),l=s.cardListRefreshInterval;s.cardListRefreshInterval=null!=l?0==l?0:Math.max(1e3,l):void 0;let d=s.runtimeVariableResolutionTimeout;if(s.runtimeVariableResolutionTimeout=null!=d?Math.max(0,d):void 0,"single-card"!==r&&((null===(u=e.horizontalContainerConfig)||void 0===u?void 0:u.enabled)&&!e.horizontalContainerConfig.cardWidth||(null===(h=e.features)||void 0===h||null===(p=h.horizontalContainerConfig)||void 0===p?void 0:p.enabled)&&!e.features.horizontalContainerConfig.cardWidth))throw new Error("The card width must be specified in the `horizontalContainerConfig` configuration object when attempting to create a stream container in horizontal mode.");this.resolvedConfiguration=s,this.instanceId=(0,t.v4)(),this.analyticsQueue=i,this.initIframe(s,r,a)}}stop(){this.iframeLoaded=!1,this.iframe&&this.iframe.parentNode&&this.iframe.parentNode.removeChild(this.iframe),this.modalIframe&&this.modalIframe.parentNode&&this.modalIframe.parentNode.removeChild(this.modalIframe),this.toastIframe&&this.toastIframe.parentNode&&this.toastIframe.parentNode.removeChild(this.toastIframe),this.launcher&&this.launcher.parentNode&&this.launcher.parentNode.removeChild(this.launcher),Su.activeSubscriptions[this.instanceId]&&(Su.unsubscribeFromCardFeed([this.instanceId]),delete nh.streamContainers[this.instanceId])}updateVariables(){this.sendMessageToIframe({action:"io.atomic.events.requestRuntimeVariables"})}setOpen(e){var t;if(void 0===e)return l.error({level1:["Open status not supplied to updateOpenStatus"]});if("launcher"===this.config.embedMode)document.removeEventListener("click",this.outsideClickListener);else if(!(null===(t=this.config.features)||void 0===t?void 0:t.controlledContainerOpenState)&&!this.config.controlledContainerOpenState)return l.error({level1:["To change the open status for this container you must enable `controlledContainerOpenState` in the features configuration"]});this.appOpen!==e&&(this.appOpen=e,this.updateAppOpen())}getIcon(e){var t;const{openIconSrc:n,closeIconSrc:r}=(null===(t=this.config.enabledUiElements)||void 0===t?void 0:t.launcherButton)||{};return n&&r?`<img src="${e?r:n}" style="max-height: 100%; max-width: 100%; margin: auto">`:e?'\n <svg width="12" height="12" viewBox="0 0 12 12">\n <path\n d="M1 1L6 6L11 11M1 11L11 1"\n stroke-width="2"\n stroke-linecap="round"\n stroke="white"\n style="pointer-events: none;"\n />\n </svg>\n ':'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="32"\n viewBox="0 0 28 32"\n fill="none"\n style="pointer-events: none;"\n >\n <path\n d="M18 22.8V26C18 28.2091 16.2091 30 14 30C11.7909 30 10 28.2091 10 26V22.8M18 22.8H10M18 22.8H26L22.8 19.6V17.2M10 22.8H2L5.2 19.6C5.2 19.6 5.2 15.5998 5.2 10.7998C5.2 5.9998 9.2 2 14 2C15.433 2 16.7947 2.3565 18 2.98436M11.6 11.6L15.6 15.6L26 5.2"\n stroke="white"\n stroke-width="3"\n stroke-linecap="round"\n stroke-linejoin="round"\n />\n </svg>\n '}toggleAppOpen(){this.appOpen=!this.appOpen,this.updateAppOpen()}updateAppOpen(){const e={action:"updateAppOpen",values:{open:this.appOpen}};this.sendMessageToIframe(e)}initLauncherButton(){var e;const{disabled:t,backgroundColor:n}=(null===(e=this.config.enabledUiElements)||void 0===e?void 0:e.launcherButton)||{};if(t)return;const r=document.createElement("div"),i=document.createElement("button");i.tabIndex=0,r.className="atomic-sdk-launcher-wrapper",i.className="atomic-sdk-launcher",i.setAttribute("data-testid","launcher-button"),this.launchButtonIconContainer=i,this.launcher=r,i.style.backgroundColor=n||"",i.innerHTML=this.getIcon(!1),r.appendChild(i),document.body.appendChild(r),r.addEventListener("click",(()=>{this.toggleAppOpen()})),this.outsideClickListener=e=>{e.target&&this.launcher&&this.launcher.contains(e.target)||this.toggleAppOpen()}}initIframe(e,t,n){var r,a,o,s,d,c,u;const h=Object.assign(Object.assign({},e),{windowOrigin:this.getWindowOrigin(),embedMode:t,instanceId:this.instanceId});if(this.config=h,this.iframe=document.createElement("iframe"),this.iframe.classList.add("atomic-sdk-frame"),this.iframe.classList.add(h.embedMode),this.iframe.setAttribute("frameBorder","0"),this.iframe.setAttribute("title",(null===(r=e.customStrings)||void 0===r?void 0:r.cardListTitle)||"Cards"),"modal-stream"===t&&(this.iframe.setAttribute("aria-hidden","true"),this.iframe.setAttribute("tabIndex","-1"),this.iframe.setAttribute("role","dialog"),this.iframe.setAttribute("aria-modal","true")),"ResizeObserver"in window){if(!document.querySelector(`#${Qu}`)){const e=document.createElement("div");e.style.width="1rem",e.style.visibility="hidden",e.id=Qu,document.body.appendChild(e)}this.resizeObserver=new ResizeObserver((e=>{var t,n;const r=null===(t=e[0])||void 0===t||null===(n=t.contentRect)||void 0===n?void 0:n.width;r&&this.iframe.contentWindow&&i("browser-font-changed",{fontSize:r},this.iframe.contentWindow)})),this.resizeObserver.observe(document.querySelector(`#${Qu}`))}h.logLevel=l.logLevel,n?n.appendChild(this.iframe):document.body.appendChild(this.iframe),this.iframe.addEventListener("load",(()=>{this.iframeLoaded=!0,this.flushMessages()})),th(this.iframe,h),("single-card"===t&&!1!==(null===(a=e.enabledUiElements)||void 0===a?void 0:a.cardListToast)||"modal-stream"===t&&!1!==(null===(o=e.enabledUiElements)||void 0===o?void 0:o.cardListToast)||(null===(s=e.enabledUiElements)||void 0===s?void 0:s.customToastContainer)&&!1!==e.enabledUiElements.cardListToast)&&(this.toastIframe=document.createElement("iframe"),this.toastIframe.classList.add("atomic-sdk-frame"),this.toastIframe.classList.add("toast-container"),this.toastIframe.setAttribute("id","atomic-sdk-toast-container"),this.toastIframe.setAttribute("frameBorder","0"),"modal-stream"===t&&(this.toastIframe.style.zIndex=1e5.toString()),this.toastIframe.setAttribute("title","Toast messages"),this.toastIframe.setAttribute("role","presentation"),this.toastIframe.setAttribute("aria-hidden","true"),n?n.appendChild(this.toastIframe):document.body.appendChild(this.toastIframe),th(this.toastIframe,Object.assign(Object.assign({},h),{embedMode:"toast"}))),("single-card"===t||"standalone"===t&&((null===(d=e.horizontalContainerConfig)||void 0===d?void 0:d.enabled)||(null===(c=e.features)||void 0===c||null===(u=c.horizontalContainerConfig)||void 0===u?void 0:u.enabled)))&&(this.modalIframe=document.createElement("iframe"),this.modalIframe.classList.add("atomic-sdk-frame"),this.modalIframe.classList.add("modal-subview"),this.modalIframe.setAttribute("frameBorder","0"),this.modalIframe.setAttribute("role","presentation"),this.modalIframe.setAttribute("aria-hidden","true"),this.modalIframe.setAttribute("title","Empty Modal"),n?n.appendChild(this.modalIframe):document.body.appendChild(this.modalIframe),th(this.modalIframe,Object.assign(Object.assign({},h),{embedMode:"modal-subview"}))),window.addEventListener("message",this.onMessageReceived.bind(this))}onMessageReceived(e){return qu(this,void 0,void 0,(function*(){if(e.source===this.iframe.contentWindow||this.modalIframe&&e.source===this.modalIframe.contentWindow||this.toastIframe&&e.source===this.toastIframe.contentWindow)switch(e.data.action){case"io.atomic.events.cardCountChanged":{var t;this.config.onCardCountChanged&&this.config.onCardCountChanged(e.data.cardCount,e.data.totalCards);const n=Du({cardCount:e.data.cardCount,streamContainerId:this.resolvedConfiguration.streamContainerId||"",endUserId:nh.getCurrentUserId()});null===(t=nh.sdkEventObserver)||void 0===t||t.call(nh,n);break}case"io.atomic.events.ready":switch(this.config.embedMode){case"standalone":case"single-card":var n;this.appOpen=!(null===(n=this.config.features)||void 0===n?void 0:n.controlledContainerOpenState)&&!this.config.controlledContainerOpenState,this.updateAppOpen();break;case"modal-stream":this.appOpen=!1,this.updateAppOpen();break;case"launcher":this.iframe.tabIndex=-1,this.initLauncherButton()}break;case"io.atomic.events.resolveRuntimeVariables":this.handleRuntimeVariableResolution(e.data.requestId,e.data.cards,this.config.onRuntimeVariablesRequested||eh);break;case"io.atomic.events.linkButtonPressed":this.config.onLinkButtonPressed&&this.config.onLinkButtonPressed(e.data.payload);break;case"io.atomic.events.submitButtonPressed":this.config.onSubmitButtonPressed&&this.config.onSubmitButtonPressed(e.data.payload);break;case"io.atomic.events.didUpdateAppOpen":var r,i;if(this.appOpen=e.data.values.open,"launcher"===this.config.embedMode)this.updateVisibilityForLauncher(),null===(r=(i=this.resolvedConfiguration).onLauncherToggled)||void 0===r||r.call(i,this.appOpen);break;case"io.atomic.events.didUpdateModalStreamVisibility":const s=e=>{this.iframe.contains(e.target)||this.iframe.focus()};this.config.onModalStreamToggled&&this.config.onModalStreamToggled(e.data.visible),e.data.visible?(this.iframe.setAttribute("aria-hidden","false"),this.iframe.setAttribute("tabIndex","0"),this.iframe.focus(),document.addEventListener("focusin",s,!0)):(this.iframe.setAttribute("aria-hidden","true"),this.iframe.setAttribute("tabIndex","-1"),document.removeEventListener("focusin",s,!0));break;case"io.atomic.events.frameHeightChanged":this.config.onSizeChanged&&this.config.onSizeChanged(this.iframe.clientWidth,e.data.height);break;case"io.atomic.events.analyticsEventReceived":if(e.data.sdkOnlyEvent){var a;const t=this.analyticsQueue.createEventPayload(e.data.event,"standard");t&&(null===(a=nh.sdkEventObserver)||void 0===a||a.call(nh,Au(t)))}else this.enqueueAnalyticsEvent(e.data.event);break;case"io.atomic.events.cardEventReceived":{this.config.onCardEvent&&this.config.onCardEvent(e.data.event);const t=((e,t)=>{const n=e.eventPayload?Object.assign({},e.eventPayload):null;if(!n)return null;switch(e.type){case"snoozed":n.eventName=Mu.cardSnoozed,n.analyticsEvent=Mu.cardSnoozed;break;case"dismissed":n.eventName=Mu.cardDismissed,n.analyticsEvent=Mu.cardDismissed;break;case"submitted":n.eventName=Mu.cardCompleted,n.analyticsEvent=Mu.cardCompleted;break;default:return null}return n.sdkContext={containerId:t},n})(e.data.event,e.data.streamContainerId);var o;if(t)nh.cachedUserMetrics={},null===(o=nh.sdkEventObserver)||void 0===o||o.call(nh,t);break}case"io.atomic.events.errorReceived":nh.onError&&nh.onError(e.data.error);break;case"io.atomic.events.authTokenRequested":if(e.data.requestId&&nh.onAuthTokenRequested){let t;try{t=yield nh.handleTokenRequest(),this.sendMessageToIframe({action:"io.atomic.events.authTokenReceived",values:{requestId:e.data.requestId,authToken:t}},e.source)}catch(t){l.error({level3:["stream container requested auth token, error retrieving token",t]}),this.sendMessageToIframe({action:"io.atomic.events.authTokenError",values:{requestId:e.data.requestId,error:t instanceof Error?t.message:String(t)}})}}else console.error("The Atomic SDK requested an authentication token but no authentication callback has been set using `AtomicSDK.setSessionDelegate`. Use this method to set a callback resolving to a promise that supplies an authentication token");break;case"io.atomic.events.cardFeedSubscribeRequested":try{Fu.connectionAuthenticated||(yield nh.handleTokenRequest({skipCache:!0,authWebSocket:!0})),Su.subscribeToCardFeed([{subscriptionId:this.instanceId,streamContainerId:e.data.streamContainerId,filters:this.streamFilters.getFilterObject()}]),this.sendMessageToIframe({action:"io.atomic.events.cardFeedSubscriptionId",values:{subscriptionId:this.instanceId}})}catch(e){this.sendMessageToIframe({action:"io.atomic.events.feedSubscribeError",values:e instanceof Error?e.message:String(e)}),l.error({level1:["error sending card feed subscription request by WebSockets"],level2:[e]})}break;case"io.atomic.events.subscriptionRetryExceeded":Fu.close(ku.sdkClosedConnection,"Subscription retry exceeded"),nh.authMessageResolve=()=>null,nh.authMessageReject=()=>null;break;case"io.atomic.events.cardFeedUnsubscribeRequested":e.data.subscriptionId===this.instanceId&&(Su.unsubscribeFromCardFeed([this.instanceId]),delete nh.streamContainers[this.instanceId]);break;case"io.atomic.events.socketReconnectionRequested":nh.createWebSocketConnection().catch((e=>{var t;this.sendMessageToIframe({action:I,values:null!==(t=e.message)&&void 0!==t?t:e})}));break;case"io.atomic.events.socketConnectionHealthcheck":Fu.connectionHealthCheck()}}))}enqueueAnalyticsEvent(e){return qu(this,void 0,void 0,(function*(){const t=yield this.analyticsQueue.enqueue(e,"standard","authenticated");if(t){var n;Su.sendAnalyticsMessage([t]);const e=Au(t);null===(n=nh.sdkEventObserver)||void 0===n||n.call(nh,e)}nh.containersBroadcastChannel?nh.containersBroadcastChannel.postMessage({type:xs.ANALYTICS_EVENT,eventQueued:e}):l.error({level1:["BroadcastChannel API unavailable"]})}))}updateVisibilityForLauncher(){var e;this.appOpen?(this.iframe.className+=" open",this.iframe.tabIndex=0,this.iframe.focus(),document.addEventListener("click",this.outsideClickListener)):(this.iframe.className=this.iframe.className.replace(" open",""),this.iframe.tabIndex=-1,null===(e=this.launchButtonIconContainer)||void 0===e||e.focus(),document.removeEventListener("click",this.outsideClickListener));this.launchButtonIconContainer&&(this.launchButtonIconContainer.innerHTML=this.getIcon(this.appOpen))}handleRuntimeVariableResolution(e,t,n){n(t.map((e=>Object.assign(Object.assign({},e),{runtimeVariables:new Map(e.runtimeVariables)}))),(n=>{let r=t;if(Array.isArray(n))if(n.length!==t.length)console.error(`The number of cards returned from the runtime variable resolver (${n.length}) is not equal to the cards provided (${t.length}).`);else{n.every((e=>{if(!(e.runtimeVariables instanceof Map))return!1;for(const t of e.runtimeVariables)if("string"!=typeof t[0]||"string"!=typeof t[1])return!1;return!0}))?r=n:console.error("One or more runtime variables have been resolved to non-string types. Runtime variables can only be resolved to strings currently.")}else console.error("Incorrect type returned when resolving runtime variables - an array of cards was expected.");const i={action:"didResolveRuntimeVariables",values:{cards:r.map((e=>Object.assign(Object.assign({},e),{runtimeVariables:Array.from(e.runtimeVariables.entries())}))),requestId:e}};this.sendMessageToIframe(i)}))}sendMessageToIframe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.iframe.contentWindow;t&&(this.iframeLoaded?t.postMessage(e,this.getWindowOrigin()):this.queuedMessages.push(e))}flushMessages(){const e=this.iframe.contentWindow;e&&(this.queuedMessages.forEach((t=>e.postMessage(t,this.getWindowOrigin()))),this.queuedMessages=[])}getWindowOrigin(){var e,t;return(null===(e=this.resolvedConfiguration.features)||void 0===e||null===(t=e.cordova)||void 0===t?void 0:t.enabled)?"*":`${window.location.protocol}//${window.location.host}`}}class ih{constructor(n,r,i){if(Yu(this,"resolvedConfiguration",void 0),Yu(this,"instanceId",void 0),Yu(this,"streamFilters",new Qc((()=>{l.debug({level1:[`applied stream filter for stream container: ${this.instanceId}`],level2:[this.streamFilters.getFilterObject()]}),this.sendWebSocketFeedSubscriptionMessage()}),(()=>{l.debug({level1:[`cleared stream filter for stream container: ${this.instanceId}`]}),this.sendWebSocketFeedSubscriptionMessage()}))),Yu(this,"analyticsQueue",void 0),Yu(this,"pollCounter",0),Yu(this,"pollTimer",void 0),Yu(this,"store",void 0),Yu(this,"boundActions",void 0),Yu(this,"tokenProvider",{requestToken:()=>qu(this,void 0,void 0,(function*(){return yield nh.handleTokenRequest()}))}),"string"!=typeof n.streamContainerId||0===n.streamContainerId.trim().length)throw new Error("Failed to start stream container. You must pass a `streamContainerId` when instantiating a stream container.");{if(!nh.onAuthTokenRequested)throw new Error("You must use `AtomicSDK.setSessionDelegate` to set a callback resolving to a promise that supplies an authentication token before attempting to create a stream container.");let a=Object.assign(Object.assign({},n),r),o=a.cardListRefreshInterval;a.cardListRefreshInterval=null!=o?0==o?0:Math.max(1e3,o):void 0;let s=a.runtimeVariableResolutionTimeout;a.runtimeVariableResolutionTimeout=null!=s?Math.max(0,s):void 0,this.resolvedConfiguration=a,this.instanceId=(0,t.v4)(),this.store=((e,t)=>{var n,r,i;let{streamContainerId:a,instanceId:o,windowOrigin:s,subviewCardInstance:l,startingLayoutId:d,cardInstances:m,cardListRefreshInterval:g,runtimeVariableResolutionTimeout:v,embedMode:f,customStrings:b,cardListTutorialSeen:y,features:w,firstLoadStyles:S,enabledUiElements:C,interfaceStyle:k,horizontalContainerConfig:x,cardMinimumHeight:I,cardMaximumWidth:O,cardHorizontalAlignment:T,modalContainerPositioning:F,modalContainerVerticalPadding:M}=e;const j=t&&t.length?(0,u.m)(...t):null,A="preview"===f,D=null==w?void 0:w.runtimeVariableAnalytics;return p=c()(Object.assign(Object.assign({},h),{application:Object.assign(Object.assign({},h.application),{isPreview:A,streamContainerId:void 0!==a?a:h.application.streamContainerId,containerInstanceId:void 0!==o?o:h.application.containerInstanceId,windowOrigin:s||h.application.windowOrigin,cardListRefreshInterval:void 0!==g?g:h.application.cardListRefreshInterval,runtimeVariableResolutionTimeout:void 0!==v?v:h.application.runtimeVariableResolutionTimeout,embedMode:f,customStrings:b||h.application.customStrings,cardLimit:"single-card"===f||"modal-stream"===f?1:void 0,firstLoadStyles:{backgroundColor:(null==S?void 0:S.backgroundColor)||h.application.firstLoadStyles.backgroundColor,textColor:(null==S?void 0:S.textColor)||h.application.firstLoadStyles.textColor,loadingSpinnerColor:(null==S?void 0:S.loadingSpinnerColor)||h.application.firstLoadStyles.loadingSpinnerColor,buttonTextColor:(null==S?void 0:S.buttonTextColor)||h.application.firstLoadStyles.buttonTextColor},enabledUiElements:{cardListToast:null===(n=null==C?void 0:C.cardListToast)||void 0===n||n,customToastContainer:null!==(r=null==C?void 0:C.customToastContainer)&&void 0!==r&&r,toastConfig:null==C?void 0:C.toastConfig,cardListHeader:null===(i=null==C?void 0:C.cardListHeader)||void 0===i||i,customContainerHeader:null==C?void 0:C.customContainerHeader},interfaceStyle:void 0!==k?k:"automatic"}),navigationStack:{items:l&&d?[{cardInstance:l,cardInstanceId:l.instance.id,subviewId:d,kind:"subview"}]:h.navigationStack.items},cardFeed:Object.assign(Object.assign({},h.cardFeed),{cardInstances:m||h.cardFeed.cardInstances,tutorialSeen:void 0===y||y,runtimeVariableAnalyticsEnabled:void 0!==D&&D,cardVoting:null==w?void 0:w.cardVoting,cardMaximumWidth:dc(O),cardMinimumHeight:null!=I?I:null==w?void 0:w.cardMinimumHeight,cardHorizontalAlignment:T,horizontalContainerConfig:null!=x?x:null==w?void 0:w.horizontalContainerConfig,modalContainerPositioning:F,modalContainerVerticalPadding:dc(M)})}),j),p})(Object.assign(Object.assign({},a),{embedMode:"headless"})),this.boundActions=(0,e.kv)((0,e.Y2)(Vt,Wo),this.store),this.analyticsQueue=i}}start(){if(!this.resolvedConfiguration.apiHost||!this.resolvedConfiguration.apiKey||!this.resolvedConfiguration.environmentId)return l.error({level1:["The Atomic SDK must be initialized before launching an observable stream container. Call `AtomicSDK.initialise` to configure the API host, API key and environment ID."]});l.debug({level3:[`Starting card feed updates for observable stream container: ${this.instanceId}`]}),nh.streamContainers[this.instanceId]||(nh.streamContainers[this.instanceId]={sendMessageToIframe:e=>this.onMessageReceived(e),logout:()=>{this.onMessageReceived({action:g})},embedMode:"headless"}),this.resolvedConfiguration.webSocketDisabled?this.pollCardFeed():Su.activeSubscriptions[this.instanceId]||this.sendWebSocketFeedSubscriptionMessage()}stop(){l.debug({level3:[`Stopping card feed updates for observable stream container: ${this.instanceId}`]}),Su.activeSubscriptions[this.instanceId]&&Su.unsubscribeFromCardFeed([this.instanceId]),this.cancelCardListPolling(),delete nh.streamContainers[this.instanceId]}pollCardFeed(){return qu(this,void 0,void 0,(function*(){var e,t;const n=this.store.getState(),r=n.cardFeed,i=yield Ho(n.application.streamContainerId,this.tokenProvider,n.application.runtimeVariableResolutionTimeout,n.cardFeed.lastModified,this.runtimeVariableResolver.bind(this),void 0,this.streamFilters.getFilterObject());this.trackCardCountChange(r,i),this.boundActions.cardFeedLoaded(i),this.boundActions.runtimeVariableReplacement(),this.resolvedConfiguration.cardFeedHandler(null!==(e=this.store.getState().cardFeed.cardInstances)&&void 0!==e?e:[]),0!==this.resolvedConfiguration.cardListRefreshInterval&&(this.pollTimer=setTimeout((()=>{clearTimeout(this.pollTimer),this.resolvedConfiguration.webSocketDisabled?this.pollCardFeed():this.pollCounter<9?(this.pollCounter++,this.pollCardFeed()):(this.pollCounter=0,this.pollTimer=null,l.debug({level3:["Attempt to reconnect websocket initiated"]}),nh.createWebSocketConnection().catch((e=>{var t;l.debug({level3:["Error reconnecting websocket",e]}),null===(t=nh.onError)||void 0===t||t.call(nh,e)})))}),null!==(t=this.resolvedConfiguration.cardListRefreshInterval)&&void 0!==t?t:h.application.cardListRefreshInterval))}))}cancelCardListPolling(){this.pollTimer&&(clearTimeout(this.pollTimer),l.debug({level3:[`Observable stream container ${this.instanceId}, card feed polling cancelled`]})),this.pollTimer=null,this.pollCounter=0}sendWebSocketFeedSubscriptionMessage(){try{Su.subscribeToCardFeed([{subscriptionId:this.instanceId,streamContainerId:this.resolvedConfiguration.streamContainerId||"",filters:this.streamFilters.getFilterObject()}])}catch(e){l.error({level1:["Unable to subscribe observable stream container to card feed updates via WebSocket."],level2:[`Container instance: ${this.instanceId}.`]})}}handleCardFeedUpdate(e){return qu(this,void 0,void 0,(function*(){var t,n;const r=this.store.getState(),i=r.cardFeed;let a;const o=e.filter((e=>("replace-feed"===e.type&&(a=e),"replace-feed"!==e.type)));if(a){const{instances:e,totalCards:n}=a.data.cardInstances,o=yield Vo(e,r.application.runtimeVariableResolutionTimeout,this.runtimeVariableResolver.bind(this)),s={cardInstances:e,unfilteredCardInstanceCount:e.length,runtimeVariables:o,metadata:{totalCards:n},lastModified:void 0};this.trackCardCountChange(i,s),this.boundActions.cardFeedLoaded(s),this.boundActions.runtimeVariableReplacement(),this.resolvedConfiguration.cardFeedHandler(null!==(t=this.store.getState().cardFeed.cardInstances)&&void 0!==t?t:[])}if(o.length){const e=e=>qu(this,void 0,void 0,(function*(){if(e){const e=yield(t=r.application.streamContainerId,n=this.tokenProvider,Lo(void 0,void 0,void 0,(function*(){const e=yield zc.get(`feed/${t}`,n,void 0,{streamContainerId:t});var r,i;return 200===e.response.status&&e.data&&e.data.metadata?{cardCount:null===(r=e.data.cardInstances)||void 0===r?void 0:r.length,totalCards:null===(i=e.data.metadata)||void 0===i?void 0:i.totalCards,lastModified:e.response.etag}:{error:e.response.error}})));if(e.error)l.error({level1:["error retrieving total card count after card feed updated"],level2:[e.error]});else{const{totalCards:t,lastModified:n}=e;t&&this.boundActions.updateTotalCardCount(t,n),this.trackCardCountChange(i,this.store.getState().cardFeed)}}var t,n})),t=e=>qu(this,void 0,void 0,(function*(){return yield Vo(e,r.application.runtimeVariableResolutionTimeout,this.runtimeVariableResolver.bind(this))}));yield this.boundActions.applyCardFeedDeltaUpdate(o,e,t),this.boundActions.runtimeVariableReplacement(),this.resolvedConfiguration.cardFeedHandler(null!==(n=this.store.getState().cardFeed.cardInstances)&&void 0!==n?n:[])}}))}trackCardCountChange(e,t){var n,r,i,a,o;const s=e.cardInstances.map((e=>e.instance.id)),l=(null==t||null===(i=t.cardInstances)||void 0===i?void 0:i.map((e=>e.instance.id)))||[],d=(null===(a=e.metadata)||void 0===a?void 0:a.totalCards)||0,c=(null===(o=t.metadata)||void 0===o?void 0:o.totalCards)||0;if(!Tc(s,l)||d!==c){var u,h,p;if(this.resolvedConfiguration.onCardCountChanged)this.resolvedConfiguration.onCardCountChanged(null!==(n=null===(p=t.cardInstances)||void 0===p?void 0:p.length)&&void 0!==n?n:0,c);const e=Du({cardCount:null!==(r=null===(u=t.cardInstances)||void 0===u?void 0:u.length)&&void 0!==r?r:0,streamContainerId:this.resolvedConfiguration.streamContainerId||"",endUserId:nh.getCurrentUserId()});null===(h=nh.sdkEventObserver)||void 0===h||h.call(nh,e)}}runtimeVariableResolver(e){const t=this.resolvedConfiguration.onRuntimeVariablesRequested||eh;return new Promise((n=>{t(e.map((e=>Object.assign(Object.assign({},e),{runtimeVariables:new Map(e.runtimeVariables)}))),(t=>{let r=e;if(Array.isArray(t))if(t.length!==e.length)console.error(`The number of cards returned from the runtime variable resolver (${t.length}) is not equal to the cards provided (${e.length}).`);else{t.every((e=>{if(!(e.runtimeVariables instanceof Map))return!1;for(const t of e.runtimeVariables)if("string"!=typeof t[0]||"string"!=typeof t[1])return!1;return!0}))?r=t:console.error("One or more runtime variables have been resolved to non-string types. Runtime variables can only be resolved to strings currently.")}else console.error("Incorrect type returned when resolving runtime variables - an array of cards was expected.");n(r)}))}))}sendAnalyticsEvent(e){var t=arguments;return qu(this,void 0,void 0,(function*(){let n=t.length>1&&void 0!==t[1]&&t[1];Fu.connectionHealthCheck();const r=this.store.getState(),i=r.cardFeed.cardInstances||[],a=i.filter((t=>t.instance.id===e.cardInstanceId)),o=a.length?a[0]:null,s=o?i.indexOf(o)+1:0;let d;try{d=yield this.tokenProvider.requestToken()}catch(e){l.error({level1:["Error requesting auth token to send analytics event"],level2:[e]})}const c=Object.assign(Object.assign({},e),{endUserId:jc(d,zc.tokenUserIdAttribute)||"",cardInstanceStatus:o?o.instance.status:"",containerId:r.application.streamContainerId,timestamp:new Date,streamCardPosition:s,streamLength:r.cardFeed.unfilteredCardInstanceCount,streamLengthVisible:i.length});let u;if(n?u=this.analyticsQueue.createEventPayload(c,"standard"):(u=this.analyticsQueue.enqueue(c,"standard","authenticated"),Su.sendAnalyticsMessage([u])),u){var h;const e=Au(u);null===(h=nh.sdkEventObserver)||void 0===h||h.call(nh,e)}}))}updateVariables(){return qu(this,void 0,void 0,(function*(){var e,t;const n=this.store.getState(),r=yield Ho(n.application.streamContainerId,this.tokenProvider,n.application.runtimeVariableResolutionTimeout,"",this.runtimeVariableResolver.bind(this),void 0,this.streamFilters.getFilterObject());r.error&&l.error({level1:["error retrieving card feed for runtime variable update"],level2:[r.error]});const i=yield Vo(null!==(e=r.cardInstances)&&void 0!==e?e:[],n.application.runtimeVariableResolutionTimeout,this.runtimeVariableResolver.bind(this));this.boundActions.cardFeedLoaded(r),this.boundActions.runtimeVariableReplacement(i),this.resolvedConfiguration.cardFeedHandler(null!==(t=this.store.getState().cardFeed.cardInstances)&&void 0!==t?t:[]),n.cardFeed.cardInstances.forEach((e=>{var t;if(null===(t=e.runtimeVariables)||void 0===t?void 0:t.length){var r;const t=null===(r=n.cardFeed.runtimeVariables.values)||void 0===r?void 0:r.get(e.instance.id);this.sendAnalyticsEvent({cardInstanceId:e.instance.id,cardViewState:"topview",eventName:ot,properties:{resolvedVariables:e.runtimeVariables.reduce(((e,n)=>(e[n.name]=(null==t?void 0:t.get(n.name))||"",e)),{})}},!1===n.cardFeed.runtimeVariableAnalyticsEnabled)}}))}))}onMessageReceived(e){switch(e.action){case C:const t=e.values.cardFeedUpdates;this.handleCardFeedUpdate(t);break;case k:void 0===this.pollTimer&&this.pollCardFeed();break;case x:this.cancelCardListPolling();break;case g:this.stop();break;default:l.debug({level3:["Unknown message received by headless stream container: ",e.data]})}}}})(),r=r.default})()));
|
|
9
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AtomicSDK=t():e.AtomicSDK=t()}(globalThis,(()=>(()=>{var e={4963:e=>{e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},7722:(e,t,n)=>{var r=n(6314)("unscopables"),i=Array.prototype;null==i[r]&&n(7728)(i,r,{}),e.exports=function(e){i[r][e]=!0}},7007:(e,t,n)=>{var r=n(5286);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},9315:(e,t,n)=>{var r=n(2110),i=n(875),o=n(2337);e.exports=function(e){return function(t,n,a){var s,l=r(t),d=i(l.length),c=o(a,d);if(e&&n!=n){for(;d>c;)if((s=l[c++])!=s)return!0}else for(;d>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}}},2032:e=>{var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},5645:e=>{var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},741:(e,t,n)=>{var r=n(4963);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},1355:e=>{e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},7057:(e,t,n)=>{e.exports=!n(4253)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},2457:(e,t,n)=>{var r=n(5286),i=n(3816).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},4430:e=>{e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},2985:(e,t,n)=>{var r=n(3816),i=n(5645),o=n(7728),a=n(3415),s=n(741),l="prototype",d=function(e,t,n){var c,u,h,p,m=e&d.F,g=e&d.G,v=e&d.S,f=e&d.P,b=e&d.B,S=g?r:v?r[t]||(r[t]={}):(r[t]||{})[l],y=g?i:i[t]||(i[t]={}),w=y[l]||(y[l]={});for(c in g&&(n=t),n)h=((u=!m&&S&&void 0!==S[c])?S:n)[c],p=b&&u?s(h,r):f&&"function"==typeof h?s(Function.call,h):h,S&&a(S,c,h,e&d.U),y[c]!=h&&o(y,c,p),f&&w[c]!=h&&(w[c]=h)};r.core=i,d.F=1,d.G=2,d.S=4,d.P=8,d.B=16,d.W=32,d.U=64,d.R=128,e.exports=d},4253:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},18:(e,t,n)=>{e.exports=n(3825)("native-function-to-string",Function.toString)},3816:e=>{var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},9181:e=>{var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},7728:(e,t,n)=>{var r=n(9275),i=n(681);e.exports=n(7057)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},639:(e,t,n)=>{var r=n(3816).document;e.exports=r&&r.documentElement},1734:(e,t,n)=>{e.exports=!n(7057)&&!n(4253)((function(){return 7!=Object.defineProperty(n(2457)("div"),"a",{get:function(){return 7}}).a}))},9797:(e,t,n)=>{var r=n(2032);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},5286:e=>{e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},9988:(e,t,n)=>{"use strict";var r=n(2503),i=n(681),o=n(2943),a={};n(7728)(a,n(6314)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},2923:(e,t,n)=>{"use strict";var r=n(4461),i=n(2985),o=n(3415),a=n(7728),s=n(7234),l=n(9988),d=n(2943),c=n(468),u=n(6314)("iterator"),h=!([].keys&&"next"in[].keys()),p="keys",m="values",g=function(){return this};e.exports=function(e,t,n,v,f,b,S){l(n,t,v);var y,w,k,C=function(e){if(!h&&e in M)return M[e];switch(e){case p:case m:return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",I=f==m,O=!1,M=e.prototype,N=M[u]||M["@@iterator"]||f&&M[f],T=N||C(f),F=f?I?C("entries"):T:void 0,A="Array"==t&&M.entries||N;if(A&&(k=c(A.call(new e)))!==Object.prototype&&k.next&&(d(k,x,!0),r||"function"==typeof k[u]||a(k,u,g)),I&&N&&N.name!==m&&(O=!0,T=function(){return N.call(this)}),r&&!S||!h&&!O&&M[u]||a(M,u,T),s[t]=T,s[x]=g,f)if(y={values:I?T:C(m),keys:b?T:C(p),entries:F},S)for(w in y)w in M||o(M,w,y[w]);else i(i.P+i.F*(h||O),t,y);return y}},5436:e=>{e.exports=function(e,t){return{value:t,done:!!e}}},7234:e=>{e.exports={}},4461:e=>{e.exports=!1},2503:(e,t,n)=>{var r=n(7007),i=n(5588),o=n(4430),a=n(9335)("IE_PROTO"),s=function(){},l="prototype",d=function(){var e,t=n(2457)("iframe"),r=o.length;for(t.style.display="none",n(639).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),d=e.F;r--;)delete d[l][o[r]];return d()};e.exports=Object.create||function(e,t){var n;return null!==e?(s[l]=r(e),n=new s,s[l]=null,n[a]=e):n=d(),void 0===t?n:i(n,t)}},9275:(e,t,n)=>{var r=n(7007),i=n(1734),o=n(1689),a=Object.defineProperty;t.f=n(7057)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},5588:(e,t,n)=>{var r=n(9275),i=n(7007),o=n(7184);e.exports=n(7057)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,l=0;s>l;)r.f(e,n=a[l++],t[n]);return e}},468:(e,t,n)=>{var r=n(9181),i=n(508),o=n(9335)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},189:(e,t,n)=>{var r=n(9181),i=n(2110),o=n(9315)(!1),a=n(9335)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),l=0,d=[];for(n in s)n!=a&&r(s,n)&&d.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~o(d,n)||d.push(n));return d}},7184:(e,t,n)=>{var r=n(189),i=n(4430);e.exports=Object.keys||function(e){return r(e,i)}},681:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},3415:(e,t,n)=>{var r=n(3816),i=n(7728),o=n(9181),a=n(3953)("src"),s=n(18),l="toString",d=(""+s).split(l);n(5645).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var l="function"==typeof n;l&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(l&&(o(n,a)||i(n,a,e[t]?""+e[t]:d.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,l,(function(){return"function"==typeof this&&this[a]||s.call(this)}))},2943:(e,t,n)=>{var r=n(9275).f,i=n(9181),o=n(6314)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},9335:(e,t,n)=>{var r=n(3825)("keys"),i=n(3953);e.exports=function(e){return r[e]||(r[e]=i(e))}},3825:(e,t,n)=>{var r=n(5645),i=n(3816),o="__core-js_shared__",a=i[o]||(i[o]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(4461)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},2337:(e,t,n)=>{var r=n(1467),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):o(e,t)}},1467:e=>{var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},2110:(e,t,n)=>{var r=n(9797),i=n(1355);e.exports=function(e){return r(i(e))}},875:(e,t,n)=>{var r=n(1467),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},508:(e,t,n)=>{var r=n(1355);e.exports=function(e){return Object(r(e))}},1689:(e,t,n)=>{var r=n(5286);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},3953:e=>{var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},6314:(e,t,n)=>{var r=n(3825)("wks"),i=n(3953),o=n(3816).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},6997:(e,t,n)=>{"use strict";var r=n(7722),i=n(5436),o=n(7234),a=n(2110);e.exports=n(2923)(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},1181:(e,t,n)=>{for(var r=n(6997),i=n(7184),o=n(3415),a=n(3816),s=n(7728),l=n(7234),d=n(6314),c=d("iterator"),u=d("toStringTag"),h=l.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},m=i(p),g=0;g<m.length;g++){var v,f=m[g],b=p[f],S=a[f],y=S&&S.prototype;if(y&&(y[c]||s(y,c,h),y[u]||s(y,u,f),l[f]=h,b))for(v in r)y[v]||o(y,v,r[v],!0)}},4630:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(6213),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,"/* Take care to only target specific ID base styles here to avoid style pollution in the host site */\niframe.atomic-sdk-frame.launcher {\n width: 460px;\n position: fixed;\n bottom: 100px;\n right: 0px;\n top: 0px;\n height: 100%;\n max-width: 100%;\n animation: atomic-sdk-launcher-close 0.1s ease forwards;\n}\n\niframe.atomic-sdk-frame.launcher.open {\n animation: atomic-sdk-launcher-open 0.1s ease forwards;\n}\n\n@keyframes atomic-sdk-launcher-open {\n 0% {\n opacity: 0;\n transform: translateY(20px);\n pointer-events: auto;\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n z-index: 2;\n }\n}\n\n@keyframes atomic-sdk-launcher-close {\n 0% {\n opacity: 1;\n transform: translateY(0);\n pointer-events: none;\n }\n 100% {\n opacity: 0;\n transform: translateY(20px);\n z-index: -2;\n }\n}\n\n.atomic-sdk-launcher {\n background-color: blue;\n overflow: hidden;\n height: 60px;\n width: 60px;\n border-radius: 999px;\n box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.1);\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transform: scale(0.1);\n animation: atomic-sdk-launcher 0.2s forwards;\n transition: all 0.1s ease;\n cursor: pointer;\n border: 0;\n}\n\n@keyframes atomic-sdk-launcher {\n from {\n transform: scale(0.1);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n}\n\n.atomic-sdk-launcher-wrapper {\n width: 60px;\n height: 60px;\n display: flex;\n position: fixed;\n bottom: 20px;\n right: 20px;\n}\n\niframe.atomic-sdk-frame.standalone.shrink {\n max-height: 2000px;\n transition: max-height 1s ease-out 2.3s;\n}\n\n#atomic-sdk-toast-container {\n position: fixed;\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n max-width: 500px;\n height: 0px;\n z-index: 2;\n}\n\niframe.atomic-sdk-frame.modal-stream {\n position: fixed;\n display: flex;\n align-items: center;\n justify-content: center;\n top: 0;\n left: 0;\n width: 100vw;\n width: 100dvw;\n height: 100vh;\n height: 100dvh;\n border: 0;\n z-index: 100000;\n}\n\niframe.atomic-sdk-frame.modal-stream.closed {\n display: none;\n}\n",""]);const s=a},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var d=0;d<e.length;d++){var c=[].concat(e[d]);r&&a[c[0]]||(void 0!==o&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},6213:e=>{"use strict";e.exports=function(e){return e[1]}},3561:e=>{e.exports=function(e){var t=new Date(e.getTime()),n=t.getTimezoneOffset();return t.setSeconds(0,0),6e4*n+t.getTime()%6e4}},4844:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setDate(n.getDate()+i),n}},2680:(e,t,n)=>{var r=n(2951);e.exports=function(e,t){var n=Number(t);return r(e,36e5*n)}},7538:(e,t,n)=>{var r=n(2385),i=n(1138);e.exports=function(e,t){var n=Number(t);return i(e,r(e)+n)}},2951:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e).getTime(),i=Number(t);return new Date(n+i)}},1318:(e,t,n)=>{var r=n(2951);e.exports=function(e,t){var n=Number(t);return r(e,6e4*n)}},9331:(e,t,n)=>{var r=n(1884),i=n(2807);e.exports=function(e,t){var n=r(e),o=Number(t),a=n.getMonth()+o,s=new Date(0);s.setFullYear(n.getFullYear(),a,1),s.setHours(0,0,0,0);var l=i(s);return n.setMonth(a,Math.min(l,n.getDate())),n}},1482:(e,t,n)=>{var r=n(9331);e.exports=function(e,t){var n=Number(t);return r(e,3*n)}},9723:(e,t,n)=>{var r=n(2951);e.exports=function(e,t){var n=Number(t);return r(e,1e3*n)}},5932:(e,t,n)=>{var r=n(4844);e.exports=function(e,t){var n=Number(t);return r(e,7*n)}},6083:(e,t,n)=>{var r=n(9331);e.exports=function(e,t){var n=Number(t);return r(e,12*n)}},6739:(e,t,n)=>{var r=n(1884);e.exports=function(e,t,n,i){var o=r(e).getTime(),a=r(t).getTime(),s=r(n).getTime(),l=r(i).getTime();if(o>a||s>l)throw new Error("The start of the range cannot be after the end of the range");return o<l&&s<a}},7886:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){if(!(t instanceof Array))throw new TypeError(toString.call(t)+" is not an instance of Array");var n,i,o=r(e).getTime();return t.forEach((function(e,t){var a=r(e),s=Math.abs(o-a.getTime());(void 0===n||s<i)&&(n=t,i=s)})),n}},3806:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){if(!(t instanceof Array))throw new TypeError(toString.call(t)+" is not an instance of Array");var n,i,o=r(e).getTime();return t.forEach((function(e){var t=r(e),a=Math.abs(o-t.getTime());(void 0===n||a<i)&&(n=t,i=a)})),n}},3374:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e).getTime(),i=r(t).getTime();return n<i?-1:n>i?1:0}},3558:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e).getTime(),i=r(t).getTime();return n>i?-1:n<i?1:0}},6656:(e,t,n)=>{var r=n(6579);e.exports=function(e,t){var n=r(e),i=r(t),o=n.getTime()-6e4*n.getTimezoneOffset(),a=i.getTime()-6e4*i.getTimezoneOffset();return Math.round((o-a)/864e5)}},6554:(e,t,n)=>{var r=n(1971);e.exports=function(e,t){var n=r(e),i=r(t),o=n.getTime()-6e4*n.getTimezoneOffset(),a=i.getTime()-6e4*i.getTimezoneOffset();return Math.round((o-a)/6048e5)}},7051:(e,t,n)=>{var r=n(2385);e.exports=function(e,t){return r(e)-r(t)}},1924:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return 12*(n.getFullYear()-i.getFullYear())+(n.getMonth()-i.getMonth())}},9729:(e,t,n)=>{var r=n(21),i=n(1884);e.exports=function(e,t){var n=i(e),o=i(t);return 4*(n.getFullYear()-o.getFullYear())+(r(n)-r(o))}},9871:(e,t,n)=>{var r=n(5344);e.exports=function(e,t,n){var i=r(e,n),o=r(t,n),a=i.getTime()-6e4*i.getTimezoneOffset(),s=o.getTime()-6e4*o.getTimezoneOffset();return Math.round((a-s)/6048e5)}},8509:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getFullYear()-i.getFullYear()}},6056:(e,t,n)=>{var r=n(1884),i=n(6656),o=n(3374);e.exports=function(e,t){var n=r(e),a=r(t),s=o(n,a),l=Math.abs(i(n,a));return n.setDate(n.getDate()-s*l),s*(l-(o(n,a)===-s))}},298:(e,t,n)=>{var r=n(8081);e.exports=function(e,t){var n=r(e,t)/36e5;return n>0?Math.floor(n):Math.ceil(n)}},9973:(e,t,n)=>{var r=n(1884),i=n(7051),o=n(3374),a=n(9883);e.exports=function(e,t){var n=r(e),s=r(t),l=o(n,s),d=Math.abs(i(n,s));return n=a(n,l*d),l*(d-(o(n,s)===-l))}},8081:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()-i.getTime()}},604:(e,t,n)=>{var r=n(8081);e.exports=function(e,t){var n=r(e,t)/6e4;return n>0?Math.floor(n):Math.ceil(n)}},1387:(e,t,n)=>{var r=n(1884),i=n(1924),o=n(3374);e.exports=function(e,t){var n=r(e),a=r(t),s=o(n,a),l=Math.abs(i(n,a));return n.setMonth(n.getMonth()-s*l),s*(l-(o(n,a)===-s))}},9403:(e,t,n)=>{var r=n(1387);e.exports=function(e,t){var n=r(e,t)/3;return n>0?Math.floor(n):Math.ceil(n)}},7977:(e,t,n)=>{var r=n(8081);e.exports=function(e,t){var n=r(e,t)/1e3;return n>0?Math.floor(n):Math.ceil(n)}},4496:(e,t,n)=>{var r=n(6056);e.exports=function(e,t){var n=r(e,t)/7;return n>0?Math.floor(n):Math.ceil(n)}},760:(e,t,n)=>{var r=n(1884),i=n(8509),o=n(3374);e.exports=function(e,t){var n=r(e),a=r(t),s=o(n,a),l=Math.abs(i(n,a));return n.setFullYear(n.getFullYear()-s*l),s*(l-(o(n,a)===-s))}},3332:(e,t,n)=>{var r=n(3558),i=n(1884),o=n(7977),a=n(1387),s=n(7479),l=43200;e.exports=function(e,t,n){var d=n||{},c=r(e,t),u=d.locale,h=s.distanceInWords.localize;u&&u.distanceInWords&&u.distanceInWords.localize&&(h=u.distanceInWords.localize);var p,m,g={addSuffix:Boolean(d.addSuffix),comparison:c};c>0?(p=i(e),m=i(t)):(p=i(t),m=i(e));var v,f=o(m,p),b=m.getTimezoneOffset()-p.getTimezoneOffset(),S=Math.round(f/60)-b;if(S<2)return d.includeSeconds?f<5?h("lessThanXSeconds",5,g):f<10?h("lessThanXSeconds",10,g):f<20?h("lessThanXSeconds",20,g):f<40?h("halfAMinute",null,g):h(f<60?"lessThanXMinutes":"xMinutes",1,g):0===S?h("lessThanXMinutes",1,g):h("xMinutes",S,g);if(S<45)return h("xMinutes",S,g);if(S<90)return h("aboutXHours",1,g);if(S<1440)return h("aboutXHours",Math.round(S/60),g);if(S<2520)return h("xDays",1,g);if(S<l)return h("xDays",Math.round(S/1440),g);if(S<86400)return h("aboutXMonths",v=Math.round(S/l),g);if((v=a(m,p))<12)return h("xMonths",Math.round(S/l),g);var y=v%12,w=Math.floor(v/12);return y<3?h("aboutXYears",w,g):y<9?h("overXYears",w,g):h("almostXYears",w+1,g)}},7666:(e,t,n)=>{var r=n(3558),i=n(1884),o=n(7977),a=n(7479),s=525600;e.exports=function(e,t,n){var l=n||{},d=r(e,t),c=l.locale,u=a.distanceInWords.localize;c&&c.distanceInWords&&c.distanceInWords.localize&&(u=c.distanceInWords.localize);var h,p,m,g={addSuffix:Boolean(l.addSuffix),comparison:d};d>0?(h=i(e),p=i(t)):(h=i(t),p=i(e));var v=Math[l.partialMethod?String(l.partialMethod):"floor"],f=o(p,h),b=p.getTimezoneOffset()-h.getTimezoneOffset(),S=v(f/60)-b;if("s"===(m=l.unit?String(l.unit):S<1?"s":S<60?"m":S<1440?"h":S<43200?"d":S<s?"M":"Y"))return u("xSeconds",f,g);if("m"===m)return u("xMinutes",S,g);if("h"===m)return u("xHours",v(S/60),g);if("d"===m)return u("xDays",v(S/1440),g);if("M"===m)return u("xMonths",v(S/43200),g);if("Y"===m)return u("xYears",v(S/s),g);throw new Error("Unknown unit: "+m)}},6272:(e,t,n)=>{var r=n(3332);e.exports=function(e,t){return r(Date.now(),e,t)}},5411:(e,t,n)=>{var r=n(1884);e.exports=function(e,t,n){var i=r(e),o=void 0!==n?n:1,a=r(t).getTime();if(i.getTime()>a)throw new Error("The first date cannot be after the second date");var s=[],l=i;for(l.setHours(0,0,0,0);l.getTime()<=a;)s.push(r(l)),l.setDate(l.getDate()+o);return s}},549:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setHours(23,59,59,999),t}},2653:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setMinutes(59,59,999),t}},6718:(e,t,n)=>{var r=n(1322);e.exports=function(e){return r(e,{weekStartsOn:1})}},5648:(e,t,n)=>{var r=n(2385),i=n(1971);e.exports=function(e){var t=r(e),n=new Date(0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);var o=i(n);return o.setMilliseconds(o.getMilliseconds()-1),o}},9877:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setSeconds(59,999),t}},9356:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}},5661:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getMonth(),i=n-n%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}},6415:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setMilliseconds(999),t}},4404:(e,t,n)=>{var r=n(549);e.exports=function(){return r(new Date)}},7410:e=>{e.exports=function(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=new Date(0);return i.setFullYear(t,n,r+1),i.setHours(23,59,59,999),i}},1322:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=t&&Number(t.weekStartsOn)||0,i=r(e),o=i.getDay(),a=6+(o<n?-7:0)-(o-n);return i.setDate(i.getDate()+a),i.setHours(23,59,59,999),i}},782:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}},4106:e=>{e.exports=function(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=new Date(0);return i.setFullYear(t,n,r-1),i.setHours(23,59,59,999),i}},5616:(e,t,n)=>{var r=n(8612),i=n(6563),o=n(2385),a=n(1884),s=n(623),l=n(7479);var d={M:function(e){return e.getMonth()+1},MM:function(e){return h(e.getMonth()+1,2)},Q:function(e){return Math.ceil((e.getMonth()+1)/3)},D:function(e){return e.getDate()},DD:function(e){return h(e.getDate(),2)},DDD:function(e){return r(e)},DDDD:function(e){return h(r(e),3)},d:function(e){return e.getDay()},E:function(e){return e.getDay()||7},W:function(e){return i(e)},WW:function(e){return h(i(e),2)},YY:function(e){return h(e.getFullYear(),4).substr(2)},YYYY:function(e){return h(e.getFullYear(),4)},GG:function(e){return String(o(e)).substr(2)},GGGG:function(e){return o(e)},H:function(e){return e.getHours()},HH:function(e){return h(e.getHours(),2)},h:function(e){var t=e.getHours();return 0===t?12:t>12?t%12:t},hh:function(e){return h(d.h(e),2)},m:function(e){return e.getMinutes()},mm:function(e){return h(e.getMinutes(),2)},s:function(e){return e.getSeconds()},ss:function(e){return h(e.getSeconds(),2)},S:function(e){return Math.floor(e.getMilliseconds()/100)},SS:function(e){return h(Math.floor(e.getMilliseconds()/10),2)},SSS:function(e){return h(e.getMilliseconds(),3)},Z:function(e){return u(e.getTimezoneOffset(),":")},ZZ:function(e){return u(e.getTimezoneOffset())},X:function(e){return Math.floor(e.getTime()/1e3)},x:function(e){return e.getTime()}};function c(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|]$/g,""):e.replace(/\\/g,"")}function u(e,t){t=t||"";var n=e>0?"-":"+",r=Math.abs(e),i=r%60;return n+h(Math.floor(r/60),2)+t+h(i,2)}function h(e,t){for(var n=Math.abs(e).toString();n.length<t;)n="0"+n;return n}e.exports=function(e,t,n){var r=t?String(t):"YYYY-MM-DDTHH:mm:ss.SSSZ",i=(n||{}).locale,o=l.format.formatters,u=l.format.formattingTokensRegExp;i&&i.format&&i.format.formatters&&(o=i.format.formatters,i.format.formattingTokensRegExp&&(u=i.format.formattingTokensRegExp));var h=a(e);return s(h)?function(e,t,n){var r,i,o=e.match(n),a=o.length;for(r=0;r<a;r++)i=t[o[r]]||d[o[r]],o[r]=i||c(o[r]);return function(e){for(var t="",n=0;n<a;n++)o[n]instanceof Function?t+=o[n](e,d):t+=o[n];return t}}(r,o,u)(h):"Invalid Date"}},5540:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getDate()}},2476:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getDay()}},8612:(e,t,n)=>{var r=n(1884),i=n(9834),o=n(6656);e.exports=function(e){var t=r(e);return o(t,i(t))+1}},2807:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getFullYear(),i=t.getMonth(),o=new Date(0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}},4789:(e,t,n)=>{var r=n(1164);e.exports=function(e){return r(e)?366:365}},7921:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getHours()}},6373:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e).getDay();return 0===t&&(t=7),t}},6563:(e,t,n)=>{var r=n(1884),i=n(1971),o=n(3892);e.exports=function(e){var t=r(e),n=i(t).getTime()-o(t).getTime();return Math.round(n/6048e5)+1}},7098:(e,t,n)=>{var r=n(3892),i=n(5932);e.exports=function(e){var t=r(e),n=r(i(t,60)).valueOf()-t.valueOf();return Math.round(n/6048e5)}},2385:(e,t,n)=>{var r=n(1884),i=n(1971);e.exports=function(e){var t=r(e),n=t.getFullYear(),o=new Date(0);o.setFullYear(n+1,0,4),o.setHours(0,0,0,0);var a=i(o),s=new Date(0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);var l=i(s);return t.getTime()>=a.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}},8597:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getMilliseconds()}},3362:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getMinutes()}},3503:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getMonth()}},5541:(e,t,n)=>{var r=n(1884);e.exports=function(e,t,n,i){var o=r(e).getTime(),a=r(t).getTime(),s=r(n).getTime(),l=r(i).getTime();if(o>a||s>l)throw new Error("The start of the range cannot be after the end of the range");if(!(o<l&&s<a))return 0;var d=(l>a?a:l)-(s<o?o:s);return Math.ceil(d/864e5)}},21:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return Math.floor(t.getMonth()/3)+1}},8780:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getSeconds()}},2482:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getTime()}},8194:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getFullYear()}},7292:(e,t,n)=>{e.exports={addDays:n(4844),addHours:n(2680),addISOYears:n(7538),addMilliseconds:n(2951),addMinutes:n(1318),addMonths:n(9331),addQuarters:n(1482),addSeconds:n(9723),addWeeks:n(5932),addYears:n(6083),areRangesOverlapping:n(6739),closestIndexTo:n(7886),closestTo:n(3806),compareAsc:n(3374),compareDesc:n(3558),differenceInCalendarDays:n(6656),differenceInCalendarISOWeeks:n(6554),differenceInCalendarISOYears:n(7051),differenceInCalendarMonths:n(1924),differenceInCalendarQuarters:n(9729),differenceInCalendarWeeks:n(9871),differenceInCalendarYears:n(8509),differenceInDays:n(6056),differenceInHours:n(298),differenceInISOYears:n(9973),differenceInMilliseconds:n(8081),differenceInMinutes:n(604),differenceInMonths:n(1387),differenceInQuarters:n(9403),differenceInSeconds:n(7977),differenceInWeeks:n(4496),differenceInYears:n(760),distanceInWords:n(3332),distanceInWordsStrict:n(7666),distanceInWordsToNow:n(6272),eachDay:n(5411),endOfDay:n(549),endOfHour:n(2653),endOfISOWeek:n(6718),endOfISOYear:n(5648),endOfMinute:n(9877),endOfMonth:n(9356),endOfQuarter:n(5661),endOfSecond:n(6415),endOfToday:n(4404),endOfTomorrow:n(7410),endOfWeek:n(1322),endOfYear:n(782),endOfYesterday:n(4106),format:n(5616),getDate:n(5540),getDay:n(2476),getDayOfYear:n(8612),getDaysInMonth:n(2807),getDaysInYear:n(4789),getHours:n(7921),getISODay:n(6373),getISOWeek:n(6563),getISOWeeksInYear:n(7098),getISOYear:n(2385),getMilliseconds:n(8597),getMinutes:n(3362),getMonth:n(3503),getOverlappingDaysInRanges:n(5541),getQuarter:n(21),getSeconds:n(8780),getTime:n(2482),getYear:n(8194),isAfter:n(2849),isBefore:n(7754),isDate:n(4286),isEqual:n(9601),isFirstDayOfMonth:n(1364),isFriday:n(2350),isFuture:n(9593),isLastDayOfMonth:n(4399),isLeapYear:n(1164),isMonday:n(126),isPast:n(798),isSameDay:n(4801),isSameHour:n(3344),isSameISOWeek:n(8029),isSameISOYear:n(7877),isSameMinute:n(4465),isSameMonth:n(248),isSameQuarter:n(5347),isSameSecond:n(1742),isSameWeek:n(4868),isSameYear:n(2130),isSaturday:n(2687),isSunday:n(2978),isThisHour:n(1587),isThisISOWeek:n(657),isThisISOYear:n(6106),isThisMinute:n(7980),isThisMonth:n(2767),isThisQuarter:n(1687),isThisSecond:n(7391),isThisWeek:n(147),isThisYear:n(576),isThursday:n(7999),isToday:n(5886),isTomorrow:n(7962),isTuesday:n(6330),isValid:n(623),isWednesday:n(5999),isWeekend:n(7455),isWithinRange:n(6254),isYesterday:n(9099),lastDayOfISOWeek:n(1944),lastDayOfISOYear:n(9312),lastDayOfMonth:n(4949),lastDayOfQuarter:n(3146),lastDayOfWeek:n(106),lastDayOfYear:n(2674),max:n(1489),min:n(3185),parse:n(1884),setDate:n(6130),setDay:n(1110),setDayOfYear:n(1418),setHours:n(6574),setISODay:n(8212),setISOWeek:n(570),setISOYear:n(1138),setMilliseconds:n(3934),setMinutes:n(4809),setMonth:n(6059),setQuarter:n(4059),setSeconds:n(1670),setYear:n(3821),startOfDay:n(6579),startOfHour:n(555),startOfISOWeek:n(1971),startOfISOYear:n(3892),startOfMinute:n(5580),startOfMonth:n(5130),startOfQuarter:n(9309),startOfSecond:n(9966),startOfToday:n(9978),startOfTomorrow:n(7743),startOfWeek:n(5344),startOfYear:n(9834),startOfYesterday:n(6441),subDays:n(5627),subHours:n(7413),subISOYears:n(9883),subMilliseconds:n(8502),subMinutes:n(3350),subMonths:n(1141),subQuarters:n(6607),subSeconds:n(9256),subWeeks:n(9862),subYears:n(8524)}},2849:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()>i.getTime()}},7754:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()<i.getTime()}},4286:e=>{e.exports=function(e){return e instanceof Date}},9601:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},1364:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 1===r(e).getDate()}},2350:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 5===r(e).getDay()}},9593:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getTime()>(new Date).getTime()}},4399:(e,t,n)=>{var r=n(1884),i=n(549),o=n(9356);e.exports=function(e){var t=r(e);return i(t).getTime()===o(t).getTime()}},1164:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e).getFullYear();return t%400==0||t%4==0&&t%100!=0}},126:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 1===r(e).getDay()}},798:(e,t,n)=>{var r=n(1884);e.exports=function(e){return r(e).getTime()<(new Date).getTime()}},4801:(e,t,n)=>{var r=n(6579);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},3344:(e,t,n)=>{var r=n(555);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},8029:(e,t,n)=>{var r=n(4868);e.exports=function(e,t){return r(e,t,{weekStartsOn:1})}},7877:(e,t,n)=>{var r=n(3892);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},4465:(e,t,n)=>{var r=n(5580);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},248:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()}},5347:(e,t,n)=>{var r=n(9309);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},1742:(e,t,n)=>{var r=n(9966);e.exports=function(e,t){var n=r(e),i=r(t);return n.getTime()===i.getTime()}},4868:(e,t,n)=>{var r=n(5344);e.exports=function(e,t,n){var i=r(e,n),o=r(t,n);return i.getTime()===o.getTime()}},2130:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=r(t);return n.getFullYear()===i.getFullYear()}},2687:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 6===r(e).getDay()}},2978:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 0===r(e).getDay()}},1587:(e,t,n)=>{var r=n(3344);e.exports=function(e){return r(new Date,e)}},657:(e,t,n)=>{var r=n(8029);e.exports=function(e){return r(new Date,e)}},6106:(e,t,n)=>{var r=n(7877);e.exports=function(e){return r(new Date,e)}},7980:(e,t,n)=>{var r=n(4465);e.exports=function(e){return r(new Date,e)}},2767:(e,t,n)=>{var r=n(248);e.exports=function(e){return r(new Date,e)}},1687:(e,t,n)=>{var r=n(5347);e.exports=function(e){return r(new Date,e)}},7391:(e,t,n)=>{var r=n(1742);e.exports=function(e){return r(new Date,e)}},147:(e,t,n)=>{var r=n(4868);e.exports=function(e,t){return r(new Date,e,t)}},576:(e,t,n)=>{var r=n(2130);e.exports=function(e){return r(new Date,e)}},7999:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 4===r(e).getDay()}},5886:(e,t,n)=>{var r=n(6579);e.exports=function(e){return r(e).getTime()===r(new Date).getTime()}},7962:(e,t,n)=>{var r=n(6579);e.exports=function(e){var t=new Date;return t.setDate(t.getDate()+1),r(e).getTime()===r(t).getTime()}},6330:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 2===r(e).getDay()}},623:(e,t,n)=>{var r=n(4286);e.exports=function(e){if(r(e))return!isNaN(e);throw new TypeError(toString.call(e)+" is not an instance of Date")}},5999:(e,t,n)=>{var r=n(1884);e.exports=function(e){return 3===r(e).getDay()}},7455:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e).getDay();return 0===t||6===t}},6254:(e,t,n)=>{var r=n(1884);e.exports=function(e,t,n){var i=r(e).getTime(),o=r(t).getTime(),a=r(n).getTime();if(o>a)throw new Error("The start of the range cannot be after the end of the range");return i>=o&&i<=a}},9099:(e,t,n)=>{var r=n(6579);e.exports=function(e){var t=new Date;return t.setDate(t.getDate()-1),r(e).getTime()===r(t).getTime()}},1944:(e,t,n)=>{var r=n(106);e.exports=function(e){return r(e,{weekStartsOn:1})}},9312:(e,t,n)=>{var r=n(2385),i=n(1971);e.exports=function(e){var t=r(e),n=new Date(0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);var o=i(n);return o.setDate(o.getDate()-1),o}},4949:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}},3146:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getMonth(),i=n-n%3+3;return t.setMonth(i,0),t.setHours(0,0,0,0),t}},106:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=t&&Number(t.weekStartsOn)||0,i=r(e),o=i.getDay(),a=6+(o<n?-7:0)-(o-n);return i.setHours(0,0,0,0),i.setDate(i.getDate()+a),i}},2674:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(0,0,0,0),t}},8854:e=>{var t=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];e.exports=function(e){var n=[];for(var r in e)e.hasOwnProperty(r)&&n.push(r);var i=t.concat(n).sort().reverse();return new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+i.join("|")+"|.)","g")}},2894:e=>{e.exports=function(){var e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};return{localize:function(t,n,r){var i;return r=r||{},i="string"==typeof e[t]?e[t]:1===n?e[t].one:e[t].other.replace("{{count}}",n),r.addSuffix?r.comparison>0?"in "+i:i+" ago":i}}}},664:(e,t,n)=>{var r=n(8854);e.exports=function(){var e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],a=["AM","PM"],s=["am","pm"],l=["a.m.","p.m."],d={MMM:function(t){return e[t.getMonth()]},MMMM:function(e){return t[e.getMonth()]},dd:function(e){return n[e.getDay()]},ddd:function(e){return i[e.getDay()]},dddd:function(e){return o[e.getDay()]},A:function(e){return e.getHours()/12>=1?a[1]:a[0]},a:function(e){return e.getHours()/12>=1?s[1]:s[0]},aa:function(e){return e.getHours()/12>=1?l[1]:l[0]}};return["M","D","DDD","d","Q","W"].forEach((function(e){d[e+"o"]=function(t,n){return function(e){var t=e%100;if(t>20||t<10)switch(t%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"}(n[e](t))}})),{formatters:d,formattingTokensRegExp:r(d)}}},7479:(e,t,n)=>{var r=n(2894),i=n(664);e.exports={distanceInWords:r(),format:i()}},1489:(e,t,n)=>{var r=n(1884);e.exports=function(){var e=Array.prototype.slice.call(arguments).map((function(e){return r(e)})),t=Math.max.apply(null,e);return new Date(t)}},3185:(e,t,n)=>{var r=n(1884);e.exports=function(){var e=Array.prototype.slice.call(arguments).map((function(e){return r(e)})),t=Math.min.apply(null,e);return new Date(t)}},1884:(e,t,n)=>{var r=n(3561),i=n(4286),o=36e5,a=6e4,s=/[T ]/,l=/:/,d=/^(\d{2})$/,c=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],u=/^(\d{4})/,h=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],p=/^-(\d{2})$/,m=/^-?(\d{3})$/,g=/^-?(\d{2})-?(\d{2})$/,v=/^-?W(\d{2})$/,f=/^-?W(\d{2})-?(\d{1})$/,b=/^(\d{2}([.,]\d*)?)$/,S=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,y=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,w=/([Z+-].*)$/,k=/^(Z)$/,C=/^([+-])(\d{2})$/,x=/^([+-])(\d{2}):?(\d{2})$/;function I(e,t,n){t=t||0,n=n||0;var r=new Date(0);r.setUTCFullYear(e,0,4);var i=7*t+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+i),r}e.exports=function(e,t){if(i(e))return new Date(e.getTime());if("string"!=typeof e)return new Date(e);var n=(t||{}).additionalDigits;n=null==n?2:Number(n);var O=function(e){var t,n={},r=e.split(s);l.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1]);if(t){var i=w.exec(t);i?(n.time=t.replace(i[1],""),n.timezone=i[1]):n.time=t}return n}(e),M=function(e,t){var n,r=c[t],i=h[t];if(n=u.exec(e)||i.exec(e)){var o=n[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(n=d.exec(e)||r.exec(e)){var a=n[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(O.date,n),N=M.year,T=function(e,t){if(null===t)return null;var n,r,i;if(0===e.length)return(r=new Date(0)).setUTCFullYear(t),r;if(n=p.exec(e))return r=new Date(0),i=parseInt(n[1],10)-1,r.setUTCFullYear(t,i),r;if(n=m.exec(e)){r=new Date(0);var o=parseInt(n[1],10);return r.setUTCFullYear(t,0,o),r}if(n=g.exec(e)){r=new Date(0),i=parseInt(n[1],10)-1;var a=parseInt(n[2],10);return r.setUTCFullYear(t,i,a),r}if(n=v.exec(e))return I(t,parseInt(n[1],10)-1);if(n=f.exec(e)){return I(t,parseInt(n[1],10)-1,parseInt(n[2],10)-1)}return null}(M.restDateString,N);if(T){var F,A=T.getTime(),L=0;if(O.time&&(L=function(e){var t,n,r;if(t=b.exec(e))return(n=parseFloat(t[1].replace(",",".")))%24*o;if(t=S.exec(e))return n=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),n%24*o+r*a;if(t=y.exec(e)){n=parseInt(t[1],10),r=parseInt(t[2],10);var i=parseFloat(t[3].replace(",","."));return n%24*o+r*a+1e3*i}return null}(O.time)),O.timezone)F=function(e){var t,n;if(t=k.exec(e))return 0;if(t=C.exec(e))return n=60*parseInt(t[2],10),"+"===t[1]?-n:n;if(t=x.exec(e))return n=60*parseInt(t[2],10)+parseInt(t[3],10),"+"===t[1]?-n:n;return 0}(O.timezone)*a;else{var E=A+L,j=new Date(E);F=r(j);var D=new Date(E);D.setDate(j.getDate()+1);var _=r(D)-r(j);_>0&&(F+=_)}return new Date(A+L+F)}return new Date(e)}},6130:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setDate(i),n}},1110:(e,t,n)=>{var r=n(1884),i=n(4844);e.exports=function(e,t,n){var o=n&&Number(n.weekStartsOn)||0,a=r(e),s=Number(t),l=a.getDay();return i(a,((s%7+7)%7<o?7:0)+s-l)}},1418:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setMonth(0),n.setDate(i),n}},6574:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setHours(i),n}},8212:(e,t,n)=>{var r=n(1884),i=n(4844),o=n(6373);e.exports=function(e,t){var n=r(e),a=Number(t),s=o(n);return i(n,a-s)}},570:(e,t,n)=>{var r=n(1884),i=n(6563);e.exports=function(e,t){var n=r(e),o=Number(t),a=i(n)-o;return n.setDate(n.getDate()-7*a),n}},1138:(e,t,n)=>{var r=n(1884),i=n(3892),o=n(6656);e.exports=function(e,t){var n=r(e),a=Number(t),s=o(n,i(n)),l=new Date(0);return l.setFullYear(a,0,4),l.setHours(0,0,0,0),(n=i(l)).setDate(n.getDate()+s),n}},3934:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setMilliseconds(i),n}},4809:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setMinutes(i),n}},6059:(e,t,n)=>{var r=n(1884),i=n(2807);e.exports=function(e,t){var n=r(e),o=Number(t),a=n.getFullYear(),s=n.getDate(),l=new Date(0);l.setFullYear(a,o,15),l.setHours(0,0,0,0);var d=i(l);return n.setMonth(o,Math.min(s,d)),n}},4059:(e,t,n)=>{var r=n(1884),i=n(6059);e.exports=function(e,t){var n=r(e),o=Number(t)-(Math.floor(n.getMonth()/3)+1);return i(n,n.getMonth()+3*o)}},1670:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setSeconds(i),n}},3821:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=r(e),i=Number(t);return n.setFullYear(i),n}},6579:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setHours(0,0,0,0),t}},555:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setMinutes(0,0,0),t}},1971:(e,t,n)=>{var r=n(5344);e.exports=function(e){return r(e,{weekStartsOn:1})}},3892:(e,t,n)=>{var r=n(2385),i=n(1971);e.exports=function(e){var t=r(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),i(n)}},5580:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setSeconds(0,0),t}},5130:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setDate(1),t.setHours(0,0,0,0),t}},9309:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=t.getMonth(),i=n-n%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}},9966:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e);return t.setMilliseconds(0),t}},9978:(e,t,n)=>{var r=n(6579);e.exports=function(){return r(new Date)}},7743:e=>{e.exports=function(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=new Date(0);return i.setFullYear(t,n,r+1),i.setHours(0,0,0,0),i}},5344:(e,t,n)=>{var r=n(1884);e.exports=function(e,t){var n=t&&Number(t.weekStartsOn)||0,i=r(e),o=i.getDay(),a=(o<n?7:0)+o-n;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}},9834:(e,t,n)=>{var r=n(1884);e.exports=function(e){var t=r(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}},6441:e=>{e.exports=function(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=new Date(0);return i.setFullYear(t,n,r-1),i.setHours(0,0,0,0),i}},5627:(e,t,n)=>{var r=n(4844);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},7413:(e,t,n)=>{var r=n(2680);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},9883:(e,t,n)=>{var r=n(7538);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},8502:(e,t,n)=>{var r=n(2951);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},3350:(e,t,n)=>{var r=n(1318);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},1141:(e,t,n)=>{var r=n(9331);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},6607:(e,t,n)=>{var r=n(1482);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},9256:(e,t,n)=>{var r=n(9723);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},9862:(e,t,n)=>{var r=n(5932);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},8524:(e,t,n)=>{var r=n(6083);e.exports=function(e,t){var n=Number(t);return r(e,-n)}},6400:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Component:()=>y,Fragment:()=>S,_unmount:()=>j,cloneElement:()=>H,createContext:()=>R,createElement:()=>v,createRef:()=>b,h:()=>v,hydrate:()=>P,isValidElement:()=>i,options:()=>r,render:()=>_,toChildArray:()=>O});var r,i,o,a,s,l,d,c,u={},h=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function m(e,t){for(var n in t)e[n]=t[n];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n){var r,i=arguments,o={};for(r in t)"key"!==r&&"ref"!==r&&(o[r]=t[r]);if(arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(i[r]);if(null!=n&&(o.children=n),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===o[r]&&(o[r]=e.defaultProps[r]);return f(e,o,t&&t.key,t&&t.ref,null)}function f(e,t,n,i,o){var a={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o};return null==o&&(a.__v=a),r.vnode&&r.vnode(a),a}function b(){return{}}function S(e){return e.children}function y(e,t){this.props=e,this.context=t}function w(e,t){if(null==t)return e.__?w(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?w(e):null}function k(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return k(e)}}function C(e){(!e.__d&&(e.__d=!0)&&o.push(e)&&!a++||l!==r.debounceRendering)&&((l=r.debounceRendering)||s)(x)}function x(){for(var e;a=o.length;)e=o.sort((function(e,t){return e.__v.__b-t.__v.__b})),o=[],e.some((function(e){var t,n,r,i,o,a,s;e.__d&&(a=(o=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=m({},o)).__v=r,i=F(s,o,r,t.__n,void 0!==s.ownerSVGElement,null,n,null==a?w(o):a),A(n,o),i!=a&&k(o)))}))}function I(e,t,n,r,i,o,a,s,l){var d,c,p,m,v,f,b,S=n&&n.__k||h,y=S.length;if(s==u&&(s=null!=o?o[0]:y?w(n,0):null),d=0,t.__k=O(t.__k,(function(n){if(null!=n){if(n.__=t,n.__b=t.__b+1,null===(p=S[d])||p&&n.key==p.key&&n.type===p.type)S[d]=void 0;else for(c=0;c<y;c++){if((p=S[c])&&n.key==p.key&&n.type===p.type){S[c]=void 0;break}p=null}if(m=F(e,n,p=p||u,r,i,o,a,s,l),(c=n.ref)&&p.ref!=c&&(b||(b=[]),p.ref&&b.push(p.ref,null,n),b.push(c,n.__c||m,n)),null!=m){var h;if(null==f&&(f=m),void 0!==n.__d)h=n.__d,n.__d=void 0;else if(o==p||m!=s||null==m.parentNode){e:if(null==s||s.parentNode!==e)e.appendChild(m),h=null;else{for(v=s,c=0;(v=v.nextSibling)&&c<y;c+=2)if(v==m)break e;e.insertBefore(m,s),h=s}"option"==t.type&&(e.value="")}s=void 0!==h?h:m.nextSibling,"function"==typeof t.type&&(t.__d=s)}else s&&p.__e==s&&s.parentNode!=e&&(s=w(p))}return d++,n})),t.__e=f,null!=o&&"function"!=typeof t.type)for(d=o.length;d--;)null!=o[d]&&g(o[d]);for(d=y;d--;)null!=S[d]&&j(S[d],S[d]);if(b)for(d=0;d<b.length;d++)E(b[d],b[++d],b[++d])}function O(e,t,n){if(null==n&&(n=[]),null==e||"boolean"==typeof e)t&&n.push(t(null));else if(Array.isArray(e))for(var r=0;r<e.length;r++)O(e[r],t,n);else n.push(t?t("string"==typeof e||"number"==typeof e?f(null,e,null,null,e):null!=e.__e||null!=e.__c?f(e.type,e.props,e.key,null,e.__v):e):e);return n}function M(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]="number"==typeof n&&!1===p.test(t)?n+"px":null==n?"":n}function N(e,t,n,r,i){var o,a,s,l,d;if(i?"className"===t&&(t="class"):"class"===t&&(t="className"),"style"===t)if(o=e.style,"string"==typeof n)o.cssText=n;else{if("string"==typeof r&&(o.cssText="",r=null),r)for(l in r)n&&l in n||M(o,l,"");if(n)for(d in n)r&&n[d]===r[d]||M(o,d,n[d])}else"o"===t[0]&&"n"===t[1]?(a=t!==(t=t.replace(/Capture$/,"")),s=t.toLowerCase(),t=(s in e?s:t).slice(2),n?(r||e.addEventListener(t,T,a),(e.l||(e.l={}))[t]=n):e.removeEventListener(t,T,a)):"list"!==t&&"tagName"!==t&&"form"!==t&&"type"!==t&&"size"!==t&&!i&&t in e?e[t]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==t&&(t!==(t=t.replace(/^xlink:?/,""))?null==n||!1===n?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):null==n||!1===n&&!/^ar/.test(t)?e.removeAttribute(t):e.setAttribute(t,n))}function T(e){this.l[e.type](r.event?r.event(e):e)}function F(e,t,n,i,o,a,s,l,d){var c,u,h,p,g,v,f,b,w,k,C=t.type;if(void 0!==t.constructor)return null;(c=r.__b)&&c(t);try{e:if("function"==typeof C){if(b=t.props,w=(c=C.contextType)&&i[c.__c],k=c?w?w.props.value:c.__:i,n.__c?f=(u=t.__c=n.__c).__=u.__E:("prototype"in C&&C.prototype.render?t.__c=u=new C(b,k):(t.__c=u=new y(b,k),u.constructor=C,u.render=D),w&&w.sub(u),u.props=b,u.state||(u.state={}),u.context=k,u.__n=i,h=u.__d=!0,u.__h=[]),null==u.__s&&(u.__s=u.state),null!=C.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=m({},u.__s)),m(u.__s,C.getDerivedStateFromProps(b,u.__s))),p=u.props,g=u.state,h)null==C.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==C.getDerivedStateFromProps&&b!==p&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(b,k),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(b,u.__s,k)||t.__v===n.__v&&!u.__){for(u.props=b,u.state=u.__s,t.__v!==n.__v&&(u.__d=!1),u.__v=t,t.__e=n.__e,t.__k=n.__k,u.__h.length&&s.push(u),c=0;c<t.__k.length;c++)t.__k[c]&&(t.__k[c].__=t);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(b,u.__s,k),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(p,g,v)}))}u.context=k,u.props=b,u.state=u.__s,(c=r.__r)&&c(t),u.__d=!1,u.__v=t,u.__P=e,c=u.render(u.props,u.state,u.context),t.__k=null!=c&&c.type==S&&null==c.key?c.props.children:Array.isArray(c)?c:[c],null!=u.getChildContext&&(i=m(m({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(v=u.getSnapshotBeforeUpdate(p,g)),I(e,t,n,i,o,a,s,l,d),u.base=t.__e,u.__h.length&&s.push(u),f&&(u.__E=u.__=null),u.__e=!1}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=L(n.__e,t,n,i,o,a,s,d);(c=r.diffed)&&c(t)}catch(e){t.__v=null,r.__e(e,t,n)}return t.__e}function A(e,t){r.__c&&r.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){r.__e(e,t.__v)}}))}function L(e,t,n,r,i,o,a,s){var l,d,c,p,m,g=n.props,v=t.props;if(i="svg"===t.type||i,null!=o)for(l=0;l<o.length;l++)if(null!=(d=o[l])&&((null===t.type?3===d.nodeType:d.localName===t.type)||e==d)){e=d,o[l]=null;break}if(null==e){if(null===t.type)return document.createTextNode(v);e=i?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type,v.is&&{is:v.is}),o=null,s=!1}if(null===t.type)g!==v&&e.data!=v&&(e.data=v);else{if(null!=o&&(o=h.slice.call(e.childNodes)),c=(g=n.props||u).dangerouslySetInnerHTML,p=v.dangerouslySetInnerHTML,!s){if(g===u)for(g={},m=0;m<e.attributes.length;m++)g[e.attributes[m].name]=e.attributes[m].value;(p||c)&&(p&&c&&p.__html==c.__html||(e.innerHTML=p&&p.__html||""))}(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||N(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||N(e,o,t[o],n[o],r)})(e,v,g,i,s),p?t.__k=[]:(t.__k=t.props.children,I(e,t,n,r,"foreignObject"!==t.type&&i,o,a,u,s)),s||("value"in v&&void 0!==(l=v.value)&&l!==e.value&&N(e,"value",l,g.value,!1),"checked"in v&&void 0!==(l=v.checked)&&l!==e.checked&&N(e,"checked",l,g.checked,!1))}return e}function E(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){r.__e(e,n)}}function j(e,t,n){var i,o,a;if(r.unmount&&r.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||E(i,null,t)),n||"function"==typeof e.type||(n=null!=(o=e.__e)),e.__e=e.__d=void 0,null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){r.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&j(i[a],t,n);null!=o&&g(o)}function D(e,t,n){return this.constructor(e,n)}function _(e,t,n){var i,o,a;r.__&&r.__(e,t),o=(i=n===d)?null:n&&n.__k||t.__k,e=v(S,null,[e]),a=[],F(t,(i?t:n||t).__k=e,o||u,u,void 0!==t.ownerSVGElement,n&&!i?[n]:o?null:h.slice.call(t.childNodes),a,n||u,i),A(a,e)}function P(e,t){_(e,t,d)}function H(e,t){var n,r;for(r in t=m(m({},e.props),t),arguments.length>2&&(t.children=h.slice.call(arguments,2)),n={},t)"key"!==r&&"ref"!==r&&(n[r]=t[r]);return f(e.type,n,t.key||e.key,t.ref||e.ref,null)}function R(e){var t={},n={__c:"__cC"+c++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,i=this;return this.getChildContext||(r=[],this.getChildContext=function(){return t[n.__c]=i,t},this.shouldComponentUpdate=function(e){i.props.value!==e.value&&r.some((function(t){t.context=e.value,C(t)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Consumer.contextType=n,n.Provider.__=n,n}r={__e:function(e,t){for(var n,r;t=t.__;)if((n=t.__c)&&!n.__)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError&&(r=!0,n.setState(n.constructor.getDerivedStateFromError(e))),null!=n.componentDidCatch&&(r=!0,n.componentDidCatch(e)),r)return C(n.__E=n)}catch(t){e=t}throw e}},i=function(e){return null!=e&&void 0===e.constructor},y.prototype.setState=function(e,t){var n;n=this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(n,this.props)),e&&m(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),C(this))},y.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},y.prototype.render=S,o=[],a=0,s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,d=u,c=0},4798:e=>{"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};e.exports=function(e,n){void 0===e&&(e={}),void 0===n&&(n=null);var r=e||{},i=[];function o(){i.forEach((function(e){return e(r)}))}return{middleware:n,setState:function(e){r=t({},r,"function"==typeof e?e(r):e),o()},subscribe:function(e){return i.push(e),function(){i.splice(i.indexOf(e),1)}},getState:function(){return r},reset:function(){r=e,o()}}}},1042:(e,t)=>{"use strict";function n(e,t){if(null!=t){if(t.then)return t.then(e.setState);e.setState(t)}}t.m=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reverse(),function(t,r,i){if(e.length<1)return n(t,r.apply(void 0,[t.getState()].concat(i)));var o=e.map((function(e){return e(t)})).reduce((function(e,t){return t(e,i)}),function(e,t){return function(r){return n(e,r.apply(void 0,[e.getState()].concat(t)))}}(t,i));return o(r)}}},5576:(e,t,n)=>{"use strict";var r=n(6400),i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},i(e,t)};function o(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},a.apply(this,arguments)};function s(e,t){for(var n in e)if(e[n]!==t[n])return!1;for(var n in t)if(!(n in e))return!1;return!0}function l(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return"function"==typeof t.middleware?t.middleware(t,e,n):function(e,t){if(null!=t){if(t.then)return t.then(e.setState);e.setState(t)}}(t,e.apply(void 0,[t.getState()].concat(n)))}}var d=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.update=function(){var e=r.getProps(r.props,r.context);s(e,r.state)||r.setState(e)},r.state=r.getProps(t,n),r.actions=r.getActions(),r}return o(t,e),t.prototype.componentWillMount=function(){this.unsubscribe=this.context.store.subscribe(this.update)},t.prototype.componentWillUnmount=function(){this.unsubscribe(this.update)},t.prototype.componentWillReceiveProps=function(e,t){var n=this.getProps(e,t);s(n,this.state)||this.setState(n)},t.prototype.getProps=function(e,t){var n=e.mapToProps,r=t.store&&t.store.getState()||{};return n?n(r,e):r},t.prototype.getActions=function(){return function(e,t,n){e="function"==typeof e?e(t,n):e;var r={};for(var i in e){var o=e[i];r[i]=l(o,t)}return r}(this.props.actions,this.context.store,this.props)},t.prototype.render=function(e,t,n){var r=e.children,i=n.store;return(r&&r[0]||r)(a({store:i},t,this.actions))},t}(r.Component),c=d;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.getChildContext=function(){return{store:this.props.store}},t.prototype.render=function(){return this.props.children&&this.props.children[0]||this.props.children},t}(r.Component);t.zt=u,t.lj=d},7867:(e,t)=>{"use strict";function n(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return"function"==typeof t.middleware?t.middleware(t,e,n):function(e,t){if(null!=t){if(t.then)return t.then(e.setState);e.setState(t)}}(t,e.apply(void 0,[t.getState()].concat(n)))}}var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};t.kv=function(e,t,r){e="function"==typeof e?e(t,r):e;var i={};for(var o in e){var a=e[o];i[o]=n(a,t)}return i},t.Y2=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.reduce((function(e,n){return r({},e,"function"==typeof n?n.apply(void 0,t):n)}),{})}}},5373:(e,t,n)=>{var r=n(4630);r&&r.__esModule&&(r=r.default),e.exports="string"==typeof r?r:r.toString()},1295:e=>{"use strict";let t=0;e.exports={incr:()=>++t,decr:()=>--t,curr:()=>t}},6756:e=>{"use strict";e.exports=(e,t,n="")=>{const r=/url\(['"]?#([\w:.-]+)['"]?\)/g,i=/#([\w:.-]+)/g;return t.match(r)&&(t=t.replace(r,(function(t,n){return e[n]?`url(#${e[n]})`:t}))),["href","xlink:href"].includes(n)&&t.match(i)&&(t=t.replace(i,(function(t,n){return e[n]?`#${e[n]}`:t}))),t}},3054:e=>{"use strict";e.exports=(e,t,n)=>{const r=new RegExp("([^\r\n,{}]+)(,(?=[^}]*{)|s*{)","g");return e=e.replace(r,(function(e,r,i){if(r.match(/^\s*(@media|@.*keyframes|to|from|@font-face|1?[0-9]?[0-9])/))return r+i;const o=r.match(/#(\w+)/);return o&&n[o[1]]&&(r=r.replace(o[0],`#${n[o[1]]}`)),(r=r.replace(/^(\s*)/,"$1"+t+" "))+i}))}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.d(r,{default:()=>Cm});n(1181);var e,t=n(7867),i=new Uint8Array(16);function o(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(i)}const a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const s=function(e){return"string"==typeof e&&a.test(e)};for(var l=[],d=0;d<256;++d)l.push((d+256).toString(16).substr(1));const c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n};const u=function(e,t,n){var r=(e=e||{}).random||(e.rng||o)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return c(r)},h=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;let r=new CustomEvent(e,{bubbles:!1,cancelable:!1,detail:t});n.dispatchEvent(r)};var p=n(7292);function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let g;!function(e){e[e.DISABLED=0]="DISABLED",e[e.TRANSACTIONS=1]="TRANSACTIONS",e[e.PAYLOAD=2]="PAYLOAD",e[e.FULL_DETAIL=3]="FULL_DETAIL"}(g||(g={}));class v{static debug(e){v.logLevel!==g.DISABLED&&(e.level1||e.level2||e.level3)&&console.log(...this.constructLogPayload(e))}static warn(e){v.logLevel!==g.DISABLED&&(e.level1||e.level2||e.level3)&&console.warn(...this.constructLogPayload(e))}static error(e){v.logLevel!==g.DISABLED&&(e.level1||e.level2||e.level3)&&console.error(...this.constructLogPayload(e))}}m(v,"logLevel",g.DISABLED),m(v,"constructLogPayload",(e=>{const t=["AtomicSDK Web -"];return v.logLevel>=g.TRANSACTIONS&&e.level1&&t.push(...e.level1),v.logLevel>=g.PAYLOAD&&e.level2&&t.push(...e.level2),v.logLevel>=g.FULL_DETAIL&&e.level3&&t.push(...e.level3),t}));var f=n(4798),b=n.n(f),S=n(1042);const y={application:{open:!1,windowOrigin:null,streamContainerId:"",containerInstanceId:"",isPreview:!1,cardListRefreshInterval:15e3,runtimeVariableResolutionTimeout:5e3,embedMode:"launcher",customStrings:{},firstLoadStyles:{backgroundColor:"#FFFFFF",textColor:"rgba(0,0,0,0.5)",loadingSpinnerColor:"#000000",buttonTextColor:"#000000"},enabledUiElements:{cardListToast:!0,customToastContainer:!1,cardListHeader:!0},interfaceStyle:"automatic"},cardFeed:{lastModified:"",cardInstances:[],runtimeVariables:{},runtimeVariableAnalyticsEnabled:!1,tutorialSeen:!0,status:{loaded:!1}},navigationStack:{items:[]},cardResponses:{},validationStates:{},theme:{},cardStates:{},messages:{lastMessageId:"0"}};let w;const k=()=>{if(!w)throw new Error("You must initialise the store before accessing it.");return w},C="io.atomic.events.sdkLogout",x="YYYY-MM-DD[T]HH:mm:ssZZ",I=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,O=20,M=20,N=20,T=20,F="io.atomic.events.cardFeedUpdateReceived",A="io.atomic.events.pollingFallbackEnabled",L="io.atomic.events.pollingFallbackDisabled",E="io.atomic.events.socketAuthenticationError",j="io.atomic.events.streamFilterApplied",D="sdkInitialisation",_="displayedCards",P="cardDescription",H="headline",R="text",$="list",V="image",W="video",B="textInput",z="numberInput",U="datePicker",q="dropdown",Y="checkbox",K="stepper",Z="switch",Q="upload",G="form",X="actionButtonGroup",J="submitButton",ee="linkButton",te="dismissButton",ne="snoozeButton",re="voteUpButton",ie="voteDownButton";var oe,ae,se,le=n(6400),de=0,ce=[],ue=le.options.__r,he=le.options.diffed,pe=le.options.__c,me=le.options.unmount;function ge(e,t){le.options.__h&&le.options.__h(ae,e,de||t),de=0;var n=ae.__H||(ae.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ve(e){return de=1,fe(Ne,e)}function fe(e,t,n){var r=ge(oe++,2);return r.__c||(r.__c=ae,r.__=[n?n(t):Ne(void 0,t),function(t){var n=e(r.__[0],t);r.__[0]!==n&&(r.__[0]=n,r.__c.setState({}))}]),r.__}function be(e,t){var n=ge(oe++,3);!le.options.__s&&Me(n.__H,t)&&(n.__=e,n.__H=t,ae.__H.__h.push(n))}function Se(e,t){var n=ge(oe++,4);!le.options.__s&&Me(n.__H,t)&&(n.__=e,n.__H=t,ae.__h.push(n))}function ye(e){return de=5,ke((function(){return{current:e}}),[])}function we(e,t,n){de=6,Se((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))}function ke(e,t){var n=ge(oe++,7);return Me(n.__H,t)?(n.__H=t,n.__h=e,n.__=e()):n.__}function Ce(e){var t=ae.context[e.__c],n=ge(oe++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(ae)),t.props.value):e.__}function xe(){ce.some((function(e){if(e.__P)try{e.__H.__h.forEach(Ie),e.__H.__h.forEach(Oe),e.__H.__h=[]}catch(t){return e.__H.__h=[],le.options.__e(t,e.__v),!0}})),ce=[]}function Ie(e){e.t&&e.t()}function Oe(e){var t=e.__();"function"==typeof t&&(e.t=t)}function Me(e,t){return!e||t.some((function(t,n){return t!==e[n]}))}function Ne(e,t){return"function"==typeof t?t(e):t}le.options.__r=function(e){ue&&ue(e),oe=0,(ae=e.__c).__H&&(ae.__H.__h.forEach(Ie),ae.__H.__h.forEach(Oe),ae.__H.__h=[])},le.options.diffed=function(e){he&&he(e);var t=e.__c;if(t){var n=t.__H;n&&n.__h.length&&(1!==ce.push(t)&&se===le.options.requestAnimationFrame||((se=le.options.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);"undefined"!=typeof window&&(t=requestAnimationFrame(n))})(xe))}},le.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Ie),e.__h=e.__h.filter((function(e){return!e.__||Oe(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],le.options.__e(n,e.__v)}})),pe&&pe(e,t)},le.options.unmount=function(e){me&&me(e);var t=e.__c;if(t){var n=t.__H;if(n)try{n.__.forEach((function(e){return e.t&&e.t()}))}catch(e){le.options.__e(e,t.__v)}}};var Te=n(5576);const Fe=()=>({handleSubviewLinkPress:(e,t,n)=>Ae(e,t,n),finishSubview:e=>Le(e),viewMedia(e,t,n){if(e.application.isPreview)return e;if(!n||!n.url||0===n.url.trim().length)return e;return De(e,{kind:"media",cardInstanceId:t,item:n})},navigateBack(e){if(e.navigationStack.items.length){const r=e.navigationStack.items[e.navigationStack.items.length-1];let i=e.cardResponses[r.cardInstanceId]?Object.assign({},e.cardResponses[r.cardInstanceId]):void 0,o=e.validationStates[r.cardInstanceId]?Object.assign({},e.validationStates[r.cardInstanceId]):void 0;var t,n;if(r&&"subview"===r.kind)i&&(null===(t=i.subviews)||void 0===t||delete t[r.subviewId]),o&&(null===(n=o.subviews)||void 0===n||delete n[r.subviewId]),e.application.isPreview||window.AtomicUploadService.removeFilesForCardSubview(e.application.containerInstanceId,r.cardInstanceId,r.subviewId);return Object.assign(Object.assign({},_e(e)),{cardResponses:Object.assign(Object.assign({},e.cardResponses),i?{[r.cardInstanceId]:i}:{}),validationStates:Object.assign(Object.assign({},e.validationStates),o?{[r.cardInstanceId]:o}:{}),messages:Object.assign(Object.assign({},e.messages),{subview:void 0})})}return e},clearSubviewsForCardInstance(e,t){const n=e.navigationStack.items.slice().filter((e=>e.cardInstanceId!==t));return Object.assign(Object.assign({},e),{navigationStack:{items:n}})},requestSnooze(e,t,n,r){if(e.application.isPreview)return e;const i=Object.assign({kind:"snooze",cardInstanceId:t,source:n},r?{cardExpiry:r}:{});return De(e,i)},requestFeedback(e,t,n){if(e.application.isPreview)return e;const r={kind:"feedback",cardInstanceId:t,sentiment:n.sentiment,textFeedback:n.textFeedback,textFeedbackLabel:n.textFeedbackLabel,source:n.source};return De(e,r)}}),Ae=(e,t,n)=>{const r=e.cardFeed.cardInstances;if(r){const i=r.find((e=>e.instance.id===t)),o=i&&i.subviews[n];if(i&&o){const t={kind:"subview",cardInstance:i,cardInstanceId:i.instance.id,subviewId:n};return De(e,t)}}return e},Le=e=>{const t=e.cardFeed.cardInstances;return Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{cardInstances:t,status:{loaded:!0}}),navigationStack:{items:[]}})};let Ee;const je=()=>(Ee||(Ee=(0,t.kv)((0,t.Y2)(Fe),k())),Ee),De=(e,t)=>{let n=e.navigationStack.items.slice();for(const[e,r]of n.entries())switch(r.cardInstanceId!==t.cardInstanceId&&(n=[]),r.kind){case"subview":case"snooze":case"feedback":r.kind===t.kind&&n.splice(e,1);break;case"media":r.kind===t.kind&&r.item.url===t.item.url&&n.splice(e,1)}return Object.assign(Object.assign({},e),{navigationStack:{items:[...n,t]}})},_e=e=>{const t=e.navigationStack.items.slice();return t.pop(),Object.assign(Object.assign({},e),{navigationStack:{items:t}})},Pe=e=>e.navigationStack.items.length?e.navigationStack.items[e.navigationStack.items.length-1]:null;function He(e){return void 0!==e&&"subview"===e.kind}function Re(e){return void 0!==e&&"snooze"===e.kind}function $e(e){return void 0!==e&&"feedback"===e.kind}function Ve(e){return void 0!==e&&"media"===e.kind}var We=n(2807),Be=n.n(We);const ze=e=>Object.keys(e).filter((t=>e[t])).join(" "),Ue=(e,t)=>{const n=((e,t)=>Be()(new Date(t,e-1)))(e,t),r=new Date(t,e-1,1).getDay()||7,i={week1:[],week2:[],week3:[],week4:[],week5:[],week6:[]};for(let o=0;o<n;o++){const n=new Date(t,e-1,o+1),a=Math.ceil((r+o)/7)-1,s=(r-1+o)%7+1;i[`week${Math.ceil((r+o)/7)}`].push({date:n,row:a,col:s,style:{gridRowStart:a,gridColumnStart:s}})}return i},qe=(e,t)=>{let{isMax:n,isMin:r}=t;const i=new Date(e);return n?(0,p.endOfDay)((0,p.addMinutes)(i,i.getTimezoneOffset())):r?(0,p.addMinutes)(i,i.getTimezoneOffset()):i};var Ye=n(5616),Ke=n.n(Ye),Ze=n(623),Qe=n.n(Ze);const Ge={required:"This field is required",minimumDate:e=>`Value must be after ${e}`,maximumDate:e=>`Value must be before ${e}`,regexp:"Value does not meet requirements",minimum:e=>`Value must be at least ${e}`,maximum:e=>`Value must be no more than ${e}`,minimumLength:e=>1===e?"Value must be at least 1 character":`Value must be at least ${e} characters`,maximumLength:e=>1===e?"Value must be no more than 1 character":`Value must be no more than ${e} characters`,minChecked:(e,t)=>1===t?"This option must be checked":1===e?"You must select at least one option":`At least ${e} options must be selected`,maxChecked:e=>1===e?"You cannot select more than one option":`You cannot select more than ${e} options`},Xe={required:(e,t)=>{const n=e.errorMessage||Ge.required;return e.required&&(null==t||null==t||"string"==typeof t&&0==t.length)?{type:"invalid",errorMessage:n}:{type:"valid"}},minimumDate:(e,t)=>{const n=qe(e.minimumDate,{isMin:!0}),r=e.errorMessage||Ge.minimumDate(Ke()(n,"DD MMM YYYY"));if(null==t||null==t)return{type:"invalid",errorMessage:r};const i=new Date(t);return!Qe()(i)||i<n?{type:"invalid",errorMessage:r}:{type:"valid"}},maximumDate:(e,t)=>{const n=qe(e.maximumDate,{isMax:!0}),r=e.errorMessage||Ge.maximumDate(Ke()(n,"DD MMM YYYY"));if(null==t||null==t)return{type:"invalid",errorMessage:r};const i=new Date(t);return!Qe()(i)||i>n?{type:"invalid",errorMessage:r}:{type:"valid"}},regexp:(e,t)=>{const n=e.errorMessage||Ge.regexp;if(null==t||null==t)return{type:"invalid",errorMessage:n};try{if(!new RegExp(e.regexp).test(t))return{type:"invalid",errorMessage:n}}catch(e){}return{type:"valid"}},minimum:(e,t)=>{const n=e.errorMessage||Ge.minimum(e.minimum);return null==t||null==t||t<e.minimum?{type:"invalid",errorMessage:n}:{type:"valid"}},maximum:(e,t)=>{const n=e.errorMessage||Ge.maximum(e.maximum);return null==t||null==t||t>e.maximum?{type:"invalid",errorMessage:n}:{type:"valid"}},minimumLength:(e,t)=>{const n=e.errorMessage||Ge.minimumLength(e.minimumLength);return null==t||null==t||t.length<e.minimumLength?{type:"invalid",errorMessage:n}:{type:"valid"}},maximumLength:(e,t)=>{const n=e.errorMessage||Ge.maximumLength(e.maximumLength);return null==t||null==t?{type:"valid"}:t.length>e.maximumLength?{type:"invalid",errorMessage:n}:{type:"valid"}},minChecked:(e,t)=>{const n=e.errorMessage||Ge.minChecked(e.minChecked,Object.keys(t).length);return null==t||null==t||Object.values(t).filter((e=>e)).length<e.minChecked?{type:"invalid",errorMessage:n}:{type:"valid"}},maxChecked:(e,t)=>{const n=e.errorMessage||Ge.maxChecked(e.maxChecked);return null==t||null==t||Object.values(t).filter((e=>e)).length>e.maxChecked?{type:"invalid",errorMessage:n}:{type:"valid"}},maxSizeBytes:(e,t)=>{const n=Math.round(e.maxSizeBytes/1048576),r=e.errorMessage||`File size must be no more than ${n}MB`;return null==t||null==t?{type:"valid"}:t.size&&t.size>e.maxSizeBytes?{type:"invalid",errorMessage:r}:{type:"valid"}}},Je=["required","minimumLength","maximumLength","minimum","maximum","minimumDate","maximumDate","minChecked","maxChecked","maxSizeBytes","regexp"],et=(e,t)=>{if(!t)return{type:"valid"};for(const n in Je){const r=Je[n],i=t[r];if(void 0===i)continue;const o=Xe[r];if(o){const t=o(i.attributes,e);if("invalid"===t.type)return t}}return{type:"valid"}},tt=()=>({handleImageLinkPress(e,t,n){const r=e.navigationStack.items.length?"subview":"topview",i=Object.assign(Object.assign({},n.currentSubviewId&&{subviewId:n.currentSubviewId}),n.currentSubviewTitle&&{subviewTitle:n.currentSubviewTitle});return n.layoutId?Ae(e,t,n.layoutId):n.payload&&!e.application.isPreview?rt(e,"payload","image",t,r,n.payload,i):e},handleLinkButtonPress(e,t,n,r,i){const o=e.navigationStack.items.length?"subview":"topview";return r?Ae(e,t,r):i&&!e.application.isPreview?rt(e,"payload","linkButton",t,o,i,n):e},handleSubmitButtonPayload(e,t,n,r){const i=e.navigationStack.items.length?"subview":"topview";return rt(e,"payload","submitButton",t,i,r,n)},openExternalUrl:(e,t,n,r,i,o,a)=>(null==a?void 0:a.url)&&!e.application.isPreview?it(e,i,o,t,n,a,r):e,handleFormChange:(e,t,n,r,i)=>nt(e,t,{[n]:r},i),createResponseWithDefaults:(e,t,n,r)=>nt(e,t,n,r),clearCardForm(e,t){var n,r;return Object.assign(Object.assign({},e),{cardResponses:Object.assign(Object.assign({},e.cardResponses),{[t]:Object.assign(Object.assign({},(null===(n=e.cardResponses[t])||void 0===n?void 0:n.responses)?{responses:{}}:{}),(null===(r=e.cardResponses[t])||void 0===r?void 0:r.subviews)?{subviews:{}}:{})})})},validateField(e,t,n,r,i,o){var a,s,l,d;let c=et(r,i);const u=c&&!o?{[n]:c}:{},h=c&&o?{[n]:c}:{},p=e.validationStates,m=null!==(a=null===(l=p[t])||void 0===l?void 0:l.validations)&&void 0!==a?a:{},g=null!==(s=null===(d=p[t])||void 0===d?void 0:d.subviews)&&void 0!==s?s:{};return Object.assign(Object.assign({},e),{validationStates:Object.assign(Object.assign({},p),{[t]:{validations:Object.assign(Object.assign({},m),u),subviews:Object.assign(Object.assign({},g),h&&o?{[o]:Object.assign(Object.assign({},g[o]),h)}:{})}})})},validateFieldCustomResult(e,t,n,r,i){var o,a,s,l;const d=r&&!i?{[n]:r}:{},c=r&&i?{[n]:r}:{},u=e.validationStates,h=null!==(o=null===(s=u[t])||void 0===s?void 0:s.validations)&&void 0!==o?o:{},p=null!==(a=null===(l=u[t])||void 0===l?void 0:l.subviews)&&void 0!==a?a:{};return Object.assign(Object.assign({},e),{validationStates:Object.assign(Object.assign({},u),{[t]:{validations:Object.assign(Object.assign({},h),d),subviews:Object.assign(Object.assign({},p),c&&i?{[i]:Object.assign(Object.assign({},p[i]),c)}:{})}})})},validateCurrentSubview(e,t){const n=Pe(e);if(n&&He(n)){const r=n.subviewId,i=n.cardInstance.subviews[r],o=ot(e,i.nodes,t,r);let a=e.validationStates;return Object.assign(Object.assign({},e),{validationStates:Object.assign(Object.assign({},a),{[t]:Object.assign(Object.assign({},e.validationStates[t]),{subviews:{[r]:o}})})})}return e},validateCardTopLevel(e,t){const[n]=e.cardFeed.cardInstances.filter((e=>e.instance.id===t));let r={};return n&&(r=ot(e,n.defaultView.nodes,t)),Object.assign(Object.assign({},e),{validationStates:Object.assign(Object.assign({},e.validationStates),{[t]:Object.assign(Object.assign({},e.validationStates[t]),{validations:r})})})}}),nt=(e,t,n,r)=>{var i;const o=e.cardResponses[t]||{},a=r?null===(i=o.subviews)||void 0===i?void 0:i[r]:{};return Object.assign(Object.assign({},e),{cardResponses:Object.assign(Object.assign({},e.cardResponses),{[t]:{responses:Object.assign(Object.assign({},o.responses),r?{}:n),subviews:Object.assign(Object.assign({},o.subviews),r?{[r]:Object.assign(Object.assign({},a),n)}:{})}})})},rt=(e,t,n,r,i,o,a)=>Object.assign(Object.assign({},e),{externalAction:Object.assign({actionId:(new Date).getTime(),linkMethod:t,trigger:n,cardInstanceId:r,cardViewState:i,subviewData:a},o?{payload:{actionPayload:o,cardInstanceId:r,streamContainerId:e.application.streamContainerId}}:{})}),it=(e,t,n,r,i,o,a)=>Object.assign(Object.assign({},e),{externalAction:{actionId:(new Date).getTime(),linkMethod:t,trigger:n,urlLink:o,cardInstanceId:r,cardViewState:i,subviewData:a}}),ot=(e,t,n,r)=>{var i;const o=Ah(t),a=r?null===(i=e.cardResponses[n].subviews)||void 0===i?void 0:i[r]:e.cardResponses[n].responses;let s={};for(const e in o){const t=o[e];t.attributes.name&&a&&(s[t.attributes.name]=et(a[t.attributes.name],t.validations))}return s};let at;const st=()=>(at||(at=(0,t.kv)((0,t.Y2)(tt),k())),at),lt=(e,t,n)=>{var r,i;const o=k().getState().cardResponses,a=null===(r=o[e])||void 0===r||null===(i=r.responses)||void 0===i?void 0:i[t];return null!=a?a:n?null===(s=o[e])||void 0===s||null===(l=s.subviews)||void 0===l||null===(d=l[n])||void 0===d?void 0:d[t]:void 0;var s,l,d},dt="sdk-initialized",ct="card-displayed",ut="user-redirected",ht="card-voted-up",pt="card-voted-down",mt="runtime-vars-updated",gt="stream-displayed",vt="snooze-options-displayed",ft="snooze-options-canceled",bt="card-subview-displayed",St="card-subview-exited",yt="request-failed",wt="video-played",kt="video-completed",Ct="notification-received",xt="user-file-uploads-started",It="user-file-uploads-completed",Ot="user-file-uploads-failed";var Mt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},Nt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ft="AACUploadFailedError",At="AACUploadSignedUrlFailedError",Lt="AACNoFileToUploadError",Et="AACUploadCancelledError",jt="Couldn't upload file(s)",Dt="Couldn't upload file(s)",_t="No files to upload",Pt="File upload cancelled";class Ht{constructor(){Tt(this,"_fileStorage",void 0),Tt(this,"_uploadQueue",void 0),this._fileStorage=new Map,this._uploadQueue=new Map,Ht._instance=this}static getInstance(){return Ht._instance||(Ht._instance=new Ht),Ht._instance}storeFile(e,t,n,r,i,o,a,s,l){var d,c,u,h;(this._fileStorage.get(i)||this._fileStorage.set(i,new Map),null===(d=this._fileStorage.get(i))||void 0===d?void 0:d.get(r))||(null===(h=this._fileStorage.get(i))||void 0===h||h.set(r,{topLevel:new Map,subviews:{}}));l&&!(null===(c=this._fileStorage.get(i))||void 0===c||null===(u=c.get(r))||void 0===u?void 0:u.subviews[l])&&(this._fileStorage.get(i).get(r).subviews[l]=new Map);const p={file:e,type:t,targetBucketId:n,destinationFilename:o,convertImage:a,size:e.size,uploaded:!1};l?this._fileStorage.get(i).get(r).subviews[l].set(s,p):this._fileStorage.get(i).get(r).topLevel.set(s,p)}getFile(e,t,n,r){var i,o,a,s,l,d;return r?(null===(s=this._fileStorage.get(e))||void 0===s||null===(l=s.get(t))||void 0===l||null===(d=l.subviews[r])||void 0===d?void 0:d.get(n))||null:(null===(i=this._fileStorage.get(e))||void 0===i||null===(o=i.get(t))||void 0===o||null===(a=o.topLevel)||void 0===a?void 0:a.get(n))||null}getAllFilesForCard(e,t){var n;return(null===(n=this._fileStorage.get(e))||void 0===n?void 0:n.get(t))||null}removeFile(e,t,n,r){var i,o,a,s,l,d,c,u;return r?null!==(i=null===(d=this._fileStorage.get(e))||void 0===d||null===(c=d.get(t))||void 0===c||null===(u=c.subviews[r])||void 0===u?void 0:u.delete(n))&&void 0!==i&&i:null!==(o=null===(a=this._fileStorage.get(e))||void 0===a||null===(s=a.get(t))||void 0===s||null===(l=s.topLevel)||void 0===l?void 0:l.delete(n))&&void 0!==o&&o}removeAllFilesForCard(e,t){var n;null===(n=this._fileStorage.get(e))||void 0===n||n.delete(t)}removeFilesForCardSubview(e,t,n){var r,i;null===(r=this._fileStorage.get(e))||void 0===r||(null===(i=r.get(t))||void 0===i||delete i.subviews[n])}removeFilesForContainer(e){this._fileStorage.delete(e)}getIsUploadingStatus(e){var t;const n=null===(t=this._uploadQueue.get(e))||void 0===t?void 0:t.size;return!!n&&n>0}uploadFile(e,t,n,r,i){return Mt(this,void 0,void 0,(function*(){return new Promise(((o,a)=>Mt(this,void 0,void 0,(function*(){var s;const{file:l,targetBucketId:d,destinationFilename:c}=n,u=null===(s=this._uploadQueue.get(t))||void 0===s?void 0:s.get(e);let h=!1;const p=new Error(Pt);p.name=Et,u&&(u.uploadRequests[r]={abort:()=>{h=!0,v.debug({level1:[`File upload for card: ${e} in container instance: ${t} was cancelled`,c]}),a({error:p,fieldname:r,filename:c})}});let m=`get-file-upload-url?filename=${encodeURIComponent(c)}&targetBucketId=${d}&card_instance_id=${e}`;n.convertImage&&(m+="&jpeg_convert=1");const{data:{uploadUrl:g},response:f}=yield cp.get(m,i);if(h)return;if(f.error){v.error({level1:["Failed to get upload URL",f.error]});const e=new Error(Dt);return e.name=At,a({error:e,fieldname:r,filename:c})}const b=new XMLHttpRequest,S=new Error(jt);S.name=Ft,b.onload=()=>{b.status>=200&&b.status<300?(v.debug({level1:[`File upload for card: ${e} in container instance: ${t} was successful`,c]}),o(r)):(v.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,c]}),a({error:S,fieldname:r,filename:c}))},b.onerror=()=>{v.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,c]}),a({error:S,fieldname:r,filename:c})},b.onabort=()=>{v.debug({level1:[`File upload for card: ${e} in container instance: ${t} was cancelled`,c]});const n=new Error(Pt);n.name=Et,a({error:n,fieldname:r,filename:c})},u&&(u.uploadRequests[r]=b);try{b.open("PUT",g,!0);const e=new FormData;e.append("file",l,c),b.send(e.get("file"))}catch(n){v.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,n]}),a({error:S,fieldname:r,filename:c})}}))))}))}uploadFilesForCard(e,t,n,r,i){return Mt(this,void 0,void 0,(function*(){var o,a,s,l,d,c;const u=null==i?void 0:i.subviewData,h=(null==u?void 0:u.subviewId)?null===(o=this._fileStorage.get(t))||void 0===o||null===(a=o.get(e))||void 0===a?void 0:a.subviews[u.subviewId]:null===(s=this._fileStorage.get(t))||void 0===s||null===(l=s.get(e))||void 0===l?void 0:l.topLevel;if(!h){const e=new Error(_t);return e.name=Lt,{success:!1,error:e}}this._uploadQueue.set(t,(new Map).set(e,{cancelSubmitCallback:null==i?void 0:i.cancelSubmitCallback,uploadRequests:[]}));const p=[];for(const[e,t]of h)t.uploaded||p.push(Object.assign(Object.assign({},t),{fieldname:e}));const m=Object.assign({},(null==u?void 0:u.subviewId)?{subviewId:u.subviewId,subviewTitle:u.subviewTitle,subviewLevel:1}:{}),g=Object.assign({},m),f=p.map((r=>{const{fieldname:i}=r,o=Nt(r,["fieldname"]);if(g[i]={filename:o.destinationFilename,targetBucketId:o.targetBucketId},"image"===o.type)return this.uploadFile(e,t,o,i,n)})),b={success:!1};return r.sendEvent({cardInstanceId:e,cardViewState:(null==u?void 0:u.subviewId)?"subview":"topview",eventName:xt,properties:g}),yield Promise.allSettled(f).then((n=>{const i=[],o=[],a=Object.assign({},m),s=Object.assign({},m),l=n=>{var r,i,o,a,s;return(null==u?void 0:u.subviewId)?null===(r=this._fileStorage.get(t))||void 0===r||null===(i=r.get(e))||void 0===i||null===(o=i.subviews[u.subviewId])||void 0===o?void 0:o.get(n):null===(a=this._fileStorage.get(t))||void 0===a||null===(s=a.get(e))||void 0===s?void 0:s.topLevel.get(n)};n.forEach((n=>{var r;if("fulfilled"===n.status&&(null===(r=this._fileStorage.get(t))||void 0===r?void 0:r.get(e))){const e=l(n.value);e&&(e.uploaded=!0),a[n.value]={filename:null==e?void 0:e.destinationFilename,targetBucketId:null==e?void 0:e.targetBucketId}}else if("rejected"===n.status){const e=n.reason;if(e.error.name===Et)o.push(n.reason);else{i.push(e);const t=l(e.fieldname);s[e.fieldname]={filename:null==t?void 0:t.destinationFilename,targetBucketId:null==t?void 0:t.targetBucketId},b.error=e.error}}})),i.length||o.length||(v.debug({level1:[`All files successfully uploaded for card: ${e} in container instance: ${t}`]}),r.sendEvent({cardInstanceId:e,cardViewState:(null==u?void 0:u.subviewId)?"subview":"topview",eventName:It,properties:a}),b.success=!0),i.length&&(v.error({level1:[`Failed to upload files for card: ${e} in container instance: ${t}`,...i]}),r.sendEvent({cardInstanceId:e,cardViewState:(null==u?void 0:u.subviewId)?"subview":"topview",eventName:Ot,properties:s}),b.failedUploads=i),o.length&&(b.cancelledUploads=o)})),null===(d=this._uploadQueue.get(t))||void 0===d||d.delete(e),(null===(c=this._uploadQueue.get(t))||void 0===c?void 0:c.size)||this._uploadQueue.delete(t),b}))}cancelUploadForCard(e,t){return Mt(this,void 0,void 0,(function*(){var n,r,i;const o=null===(n=this._uploadQueue.get(e))||void 0===n?void 0:n.get(t);var a;o&&(Object.values(o.uploadRequests).forEach((e=>{e.abort()})),null===(a=o.cancelSubmitCallback)||void 0===a||a.call(o));null===(r=this._uploadQueue.get(e))||void 0===r||r.delete(t),(null===(i=this._uploadQueue.get(e))||void 0===i?void 0:i.size)||this._uploadQueue.delete(e)}))}cancelUploadsForContainer(e){return Mt(this,void 0,void 0,(function*(){const t=this._uploadQueue.get(e);t&&(t.forEach((e=>{var t;Object.values(e.uploadRequests).forEach((e=>{e.abort()})),null===(t=e.cancelSubmitCallback)||void 0===t||t.call(e)})),this._uploadQueue.delete(e))}))}}Tt(Ht,"_instance",void 0);const Rt=Ht.getInstance();var $t=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const Vt=(e,t)=>e?Object.keys(e).reduce(((n,r)=>{const i=e[r];return t.includes(i||"")||(n[r]=e[r]),n}),{}):e,Wt=e=>Vt(e,["submitted","dismissed","snoozed","submitted-subview","centering"]),Bt=(e,t,n)=>{var r,i;const o=null===(r=e.cardFeed.cardInstances.filter((e=>e.instance.id!==t))[0])||void 0===r||null===(i=r.instance)||void 0===i?void 0:i.id;return Object.assign(Object.assign({},e.cardStates),o&&{[o]:n})},zt=(e,t,n)=>(e||[]).reduce(((e,r,i)=>(n[r.instance.id]&&void 0===(t||[]).find((e=>e.instance.id===r.instance.id))&&e.splice(i,0,r),e)),[...t]),Ut=function(){let e=Number(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0);return""+ ++e},qt=(e,t,n)=>{var r;if(!n)return e;switch(n.name){case tp.noInternet:return"No internet connection";case Ft:case Lt:case At:return(null==t||null===(r=t.toastMessages)||void 0===r?void 0:r.fileUploadFailed)||n.message;default:return e}},Yt=(e,t)=>{var n;return((null===(n=t.application.enabledUiElements.toastConfig)||void 0===n?void 0:n.toastMessages)||{})[e]},Kt=(e,t)=>{switch(t){case"cardList":return Object.assign(Object.assign({},e.messages),{cardList:void 0});case"subview":return Object.assign(Object.assign({},e.messages),{subview:void 0});default:return{lastMessageId:Ut(e.messages.lastMessageId),cardList:void 0,subview:void 0}}},Zt=()=>({updateAppOpen(e,t){const n="launcher"===e.application.embedMode&&!0===e.application.open&&!1===t;return Object.assign(Object.assign({},e),{application:Object.assign(Object.assign({},e.application),{open:t}),messages:n?Kt(e):e.messages})},startCardFileUpload:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"uploading-files"})}),finishCardFileUpload:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:null})}),submittingCard:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"submitting"})}),submittedCard(e,t,n){const r=Yt("submittedCard",e),i=Ut(e.messages.lastMessageId);return Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:n?"submitted-subview":"submitted"}),messages:Object.assign(Object.assign({},e.messages),{cardList:{text:null!=r?r:"Card submitted",messageId:i,cardInstanceId:t,action:"submitted"},lastMessageId:i})})},failedToSubmitCard(e,t,n,r,i,o){const a=Vt(e.cardStates,["centering","fixed-position"]),s=Ut(e.messages.lastMessageId),l=e.application.enabledUiElements.toastConfig,d=Object.assign({text:qt("Couldn't submit",l,i),messageId:s,cardInstanceId:t,action:"submit-failed",responseValues:r},o||{});return Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},a),{[t]:null}),messages:Object.assign(Object.assign({},n?{subview:d}:{cardList:d}),{lastMessageId:s})})},dismissingCard:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"dismissing"})}),dismissedCard(e,t){const n=Yt("dismissedCard",e),r=Ut(e.messages.lastMessageId);return Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"dismissed"}),messages:Object.assign(Object.assign({},e.messages),{cardList:{text:null!=n?n:"Card dismissed",messageId:r,cardInstanceId:t,action:"dismissed"},lastMessageId:r})})},failedToDismissCard(e,t,n,r){const i=Vt(e.cardStates,["centering","fixed-position"]),o=Ut(e.messages.lastMessageId),a=e.application.enabledUiElements.toastConfig;return Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},i),{[t]:null}),messages:Object.assign(Object.assign({},e.messages),{cardList:{text:qt("Couldn't dismiss",a,r),messageId:o,cardInstanceId:t,action:"dismiss-failed",source:n},lastMessageId:o})})},snoozingCard:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"snoozing"})}),snoozedCard(e,t,n){const r=Yt("snoozedCard",e),i=Ut(e.messages.lastMessageId);let o;return o=(0,p.isToday)(n)?(0,p.format)(n,"h:mm A"):(0,p.format)(n,"D MMM YYYY, h:mm A"),Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"snoozed"}),messages:Object.assign(Object.assign({},e.messages),{cardList:{text:null!=r?r:`Snoozed until ${o}`,messageId:i,cardInstanceId:t,action:"snoozed"},lastMessageId:i})})},failedToSnoozeCard(e,t,n,r,i){const o=Vt(e.cardStates,["centering","fixed-position"]),a=Ut(e.messages.lastMessageId),s=e.application.enabledUiElements.toastConfig;return Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},o),{[t]:null}),messages:Object.assign(Object.assign({},e.messages),{cardList:{text:qt("Couldn't snooze",s,i),messageId:a,cardInstanceId:t,action:"snooze-failed",snoozeDate:n,source:r},lastMessageId:a})})},fixPositionRemainingCard:(e,t)=>Object.assign(Object.assign({},e),{cardStates:e.cardFeed.cardInstances.length<=2?Bt(e,t,"fixed-position"):Vt(e.cardStates,["centering","fixed-position"])}),centerRemainingCard(e,t){const n=e.cardFeed.cardInstances,r=n.filter((e=>e.instance.id!==t));return Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{cardInstances:e.cardFeed.cardInstances.length<=2?r:n,status:{loaded:!0},updateId:(new Date).getTime()}),cardStates:e.cardFeed.cardInstances.length<=2?Bt(e,t,"centering"):Vt(e.cardStates,["centering","fixed-position"])})},removeCardState:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:null})}),removeCard(e,t){if(e.application.isPreview)return e;const n=e.cardFeed.cardInstances.filter((e=>e.instance.id!==t)),r=Object.assign({},e.cardStates);return delete r[t],Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{cardInstances:n,status:{loaded:!0},updateId:(new Date).getTime()}),cardStates:r})},queueCardFeedDeltaUpdate:(e,t)=>Object.assign(Object.assign({},e),{pendingCardFeedUpdates:[...e.pendingCardFeedUpdates||[],...t]}),clearCardFeedDeltaUpdateQueue:e=>Object.assign(Object.assign({},e),{pendingCardFeedUpdates:[]}),applyCardFeedDeltaUpdate(e,t,n,r){return $t(this,void 0,void 0,(function*(){let i={cardFeed:{cardInstances:e.cardFeed.cardInstances,runtimeVariables:e.cardFeed.runtimeVariables},cardStates:e.cardStates,navigationStack:e.navigationStack},o=!1,a=[];if(t.forEach((t=>{switch(t.type){case"remove-card":{const{cardInstanceId:n,actionType:r}=t.data;if("limit"!==r&&(o=!0),e.application.isPreview)break;const a=i.cardFeed.cardInstances,s=e.application.isPreview?a:a.filter((e=>e.instance.id!==n));i.cardFeed.cardInstances=s;break}case"update-card":{const{cardInstance:e,actionType:n}=t.data;let r=!1;e.runtimeVariables&&a.push(e);const s=i.cardFeed.cardInstances.map((t=>(t.instance.id===e.instance.id&&(r=!0,t=Object.assign({},e)),t)));r||(o=!0,s.push(e)),"unsnooze"===n&&(i.cardStates[e.instance.id]=null),i.cardFeed.cardInstances=s;break}}})),a.length>0){const t=yield r(a),n=e.cardFeed.runtimeVariables.values;i.cardFeed.runtimeVariables={values:new Map([...n||new Map,...(null==t?void 0:t.values)||new Map]),updateId:(new Date).getTime()}}i.cardFeed.cardInstances=(e=>null==e?void 0:e.sort(((e,t)=>{const{priority:n,lastCardActiveTime:r,receivedAt:i}=e.metadata,{priority:o,lastCardActiveTime:a,receivedAt:s}=t.metadata;let l=0;return l=n-o,0===l&&(l=new Date(a).getTime()-new Date(r).getTime()),0===l&&(l=new Date(s).getTime()-new Date(i).getTime()),l})))(i.cardFeed.cardInstances),n(e.cardFeed.cardInstances.length!==i.cardFeed.cardInstances.length||o),"single-card"===e.application.embedMode&&(i.navigationStack={items:[]});const s=Vt(i.cardStates,["centering","fixed-position"]),l=Wt(s),d=zt(e.cardFeed.cardInstances,i.cardFeed.cardInstances,l);return i.cardFeed.cardInstances=d,{cardFeed:Object.assign(Object.assign({},e.cardFeed),{cardInstances:i.cardFeed.cardInstances,runtimeVariables:i.cardFeed.runtimeVariables,tutorialSeen:e.cardFeed.tutorialSeen||d.length>0,updateId:(new Date).getTime(),status:{loaded:!0}}),cardStates:s,navigationStack:i.navigationStack}}))},clearMessage:(e,t)=>Object.assign(Object.assign({},e),{messages:Kt(e,t)}),cardFeedLoading:e=>Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{status:{loaded:!1}})}),cardFeedLoaded(e,t){if(t.error){let n;if(t.error.name===tp.noInternet)n="noInternet";else n="apiError";return v.error({level1:["Error loading card feed"],level2:[n],level3:[t.error]}),Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{status:{loaded:!1,errorState:n}})})}if(!t.cardInstances)return Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{status:Object.assign(Object.assign({},e.cardFeed.status),{loaded:!0})})});const n=Vt(e.cardStates,["centering","fixed-position"]),r=Wt(n),i=zt(e.cardFeed.cardInstances,t.cardInstances,r);return Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{lastModified:t.lastModified,cardInstances:i,unfilteredCardInstanceCount:t.unfilteredCardInstanceCount||t.cardInstances.length,runtimeVariables:Object.assign(Object.assign({},t.runtimeVariables),{updateId:(new Date).getTime()}),tutorialSeen:e.cardFeed.tutorialSeen||t.cardInstances.length>0,status:{loaded:!0},updateId:(new Date).getTime(),metadata:t.metadata}),navigationStack:{items:"single-card"===e.application.embedMode?[]:e.navigationStack.items},cardStates:r})},setCardFeedOverlay:(e,t)=>Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{displayingOverlay:t})}),runtimeVariablesResolved:(e,t)=>t.values?Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{runtimeVariables:Object.assign(Object.assign({},e.cardFeed.runtimeVariables),{values:t.values,updateId:(new Date).getTime()})})}):e,runtimeVariableReplacement(e,t){var n,r;const i=null!==(n=null==t?void 0:t.values)&&void 0!==n?n:null===(r=e.cardFeed.runtimeVariables)||void 0===r?void 0:r.values;return e.cardFeed.cardInstances.map((e=>Eh(e,(null==i?void 0:i.get(e.instance.id))||new Map([])))),Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{runtimeVariables:null!=t?t:e.cardFeed.runtimeVariables})})},themeLoading:e=>Object.assign(Object.assign({},e),{theme:Object.assign(Object.assign({},e.theme),{status:{loaded:!1}})}),themeLoaded(e,t){if(t.error){let n;if(t.error.name===tp.noInternet)n="noInternet";else n="apiError";return Object.assign(Object.assign({},e),{theme:Object.assign(Object.assign({},e.theme),{status:{loaded:!1,errorState:n}})})}return t.theme?Object.assign(Object.assign({},e),{theme:{themePayload:t.theme,status:{loaded:!0}}}):e},feedbackReceived(e,t){if(e.application.isPreview)return e;const n=Yt("feedbackReceived",e),r=Ut(e.messages.lastMessageId);return Object.assign(Object.assign({},e),{messages:Object.assign(Object.assign({},e.messages),{cardList:{text:null!=n?n:"Feedback received",messageId:r,cardInstanceId:t,action:"other"},lastMessageId:r})})},userLoggedOut:e=>Object.assign(Object.assign({},e),{application:Object.assign(Object.assign({},e.application),{open:!1}),cardFeed:Object.assign(Object.assign({},e.cardFeed),{lastModified:"",cardInstances:[],runtimeVariables:{},status:{loaded:!0}}),navigationStack:{items:[]},cardResponses:{},validationStates:{},cardStates:{},messages:{lastMessageId:"0"}})});let Qt;const Gt=()=>(Qt||(Qt=(0,t.kv)((0,t.Y2)(Zt),k())),Qt);var Xt=0,Jt=document.head.appendChild(document.createElement("style")).sheet;function en(e,t){var n="p"+Xt++,r=t+n;return e.forEach((function(e){if(/^@/.test(e)){var t=e.indexOf("{")+1;e=e.slice(0,t)+r+e.slice(t)}else e=r+e;try{Jt.insertRule(e,Jt.cssRules.length)}catch(e){}})),n}function tn(e,t){return t+"{"+e+"}"}function nn(e,t){var n=[""];for(var r in t=t||0,e){var i=e[r];i&&(r=r.replace(/[A-Z]/g,"-$&").toLowerCase(),i.sub||Array.isArray(i)?(i=Array.isArray(i)?i:[i]).forEach((function(e){return n[0]+=r+":"+e+";"})):(r=r.replace(/&/g,""),n.push(tn(nn(i,!/^@/.test(r)).join(""),r))))}return t||(n[0]=tn(n[0],"")),n}const rn=function(e,t){var n={};return(t=t||{}).returnObject?{style:r,css:i}:r;function r(t){return function(n){return function(r,o){var a="function"==typeof n?n(r):n;return delete r.theme,r.class=[i(a),r.class].filter(Boolean).join(" "),e(t,r,r.children||[])}}}function i(e){var t=nn(e),r=t.join("");return n[r]||(n[r]=en(t,"."))}}(le.h),on=function(e){return en([tn(nn(e,1).join(""),"")],"@keyframes ")};function an(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sn="rgba(0, 0, 0, 1)",ln="rgba(255, 255, 255, 1)",dn='-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',cn={colors:{},typography:{},shape:{}};class un{constructor(e,t,n,r){an(this,"theme",void 0),an(this,"themeName",void 0),an(this,"fontFamilies",void 0),an(this,"hasSecondaryButtonStyle",!1),an(this,"testSecondaryStyles",((e,t,n)=>{const r=e=>{null===e||"object"!=typeof e||Array.isArray(e)?"string"==typeof e&&e.match(/\w+/g)&&(this.hasSecondaryButtonStyle=!0):Object.values(e).length>0&&(this.hasSecondaryButtonStyle=!0)};for(const[l,d]of Object.entries(e)){switch(l){case"actionSecondary":case"buttonSecondary":case"buttonHoverSecondary":case"buttonActiveSecondary":case"actionIconSecondary":case"buttonIconSecondary":case"actionSecondaryTop":case"actionSecondaryRight":case"actionSecondaryBottom":case"actionSecondaryLeft":case"buttonSecondaryTop":case"buttonSecondaryRight":case"buttonSecondaryBottom":case"buttonSecondaryLeft":case"buttonHoverSecondaryTop":case"buttonHoverSecondaryRight":case"buttonHoverSecondaryBottom":case"buttonHoverSecondaryLeft":case"buttonActiveSecondaryTop":case"buttonActiveSecondaryRight":case"buttonActiveSecondaryBottom":case"buttonActiveSecondaryLeft":case"actionSecondaryShadow":case"buttonSecondaryShadow":case"buttonHoverSecondaryShadow":case"buttonActiveSecondaryShadow":case"actionSecondaryXAxis":case"actionSecondaryYAxis":case"buttonSecondaryXAxis":case"buttonHoverSecondaryXAxis":case"buttonActiveSecondaryXAxis":case"buttonSecondaryYAxis":case"buttonHoverSecondaryYAxis":case"buttonActiveSecondaryYAxis":if(t.includes("shadowOffsets")&&!l.includes("XAxis")&&!l.includes("YAxis")){var i,o;const e="true"===(null==n||null===(i=n.shape)||void 0===i||null===(o=i.equalShadowOffsets)||void 0===o?void 0:o[l]);"string"==typeof d&&d.match(/\w+/g)&&e&&(this.hasSecondaryButtonStyle=!0);break}if(t.includes("equalShadowOffsets")||t.includes("equalPaddings"))break;r(d);break;case"actionSecondaryWidth":case"buttonSecondaryWidth":case"buttonHoverSecondaryWidth":case"buttonActiveSecondaryWidth":{var a,s;const e=l.replace("Width",""),t="true"===(null==n||null===(a=n.shape)||void 0===a||null===(s=a.equalPaddings)||void 0===s?void 0:s[e]);"string"==typeof d&&d.match(/\w+/g)&&t&&(this.hasSecondaryButtonStyle=!0);break}}if(!this.hasSecondaryButtonStyle&&null!==d&&"object"==typeof d&&!Array.isArray(d)){const e=t?t+"."+l:l;this.testSecondaryStyles(d,e,n)}}}));let i,o=!1;switch(r){case"automatic":o="dark"===n&&window.matchMedia("not all and (prefers-color-scheme), (prefers-color-scheme)").matches;break;case"light":o=!1;break;case"dark":o=!0}var a;o?i=(null===(a=e.alternate)||void 0===a?void 0:a.dark)||e.theme||{}:i=e.theme||{};this.testSecondaryStyles(i.feed||{},"",i.feed),this.testSecondaryStyles(i.workflow||{},"",i.workflow),this.themeName=t,this.theme=i[t]||cn,this.fontFamilies=i.fontFamilies||[]}getShape(e,t){return pn(this.theme.shape,e,(null==t?void 0:t.skipFallback)?null:"")}getCSSShadowProperties(e,t){var n,r;const i=this.getShape(`blur.${e}Shadow`,t),o=this.getShape(`equalShadowOffsets.${e}`,t),a=this.getShape(`shadowOffsets.${e}`,t),s=this.getShape(`shadowOffsets.${e}XAxis`,t),l=this.getShape(`shadowOffsets.${e}YAxis`,t),d=this.getShape(`shadowOffsetType.${e}`,t),c=this.getCSSColor(`shadow.${e}`,{skipFallback:!0}),u="inset"===d?"inset":"",h=null!==(n="true"===o?a:s)&&void 0!==n?n:"0px",p=null!==(r="true"===o?a:l)&&void 0!==r?r:"0px";if(!c||c.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/))return"";return`${u} ${h} ${p} ${i||""} ${c}`.trim()}getShadowVerticalExtent(e,t){var n,r;const i=this.getCSSColor(`shadow.${e}`,{skipFallback:!0});if(!i||i.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/))return 0;const o=this.getShape(`equalShadowOffsets.${e}`,t),a=this.getShape(`shadowOffsets.${e}`,t),s=this.getShape(`shadowOffsets.${e}YAxis`,t),l="true"===o?a:s,d=this.getShape(`blur.${e}Shadow`,t),c=Math.max(0,null!==(n=mn(d))&&void 0!==n?n:0),u=null!==(r=mn(l))&&void 0!==r?r:0;return c+Math.abs(u)}getNumericalPadding(e){var t,n,r,i;const o=null!==(t=null===(r=this.theme.shape)||void 0===r?void 0:r.padding)&&void 0!==t?t:{},a=null!==(n=null===(i=this.theme.shape)||void 0===i?void 0:i.equalPaddings)&&void 0!==n?n:{},s=pn(a,`${e}`,null),l=pn(o,`${e}Width`,null),d=pn(o,`${e}Top`,null),c=pn(o,`${e}Right`,null),u=pn(o,`${e}Bottom`,null),h=pn(o,`${e}Left`,null),p=mn(l);if(!0===s||"true"===s)return{top:p,right:p,bottom:p,left:p};const m=mn(d),g=mn(c),v=mn(u),f=mn(h);return void 0!==m||void 0!==g||void 0!==v||void 0!==f?{top:null!=m?m:0,right:null!=g?g:0,bottom:null!=v?v:0,left:null!=f?f:0}:{top:m,right:g,bottom:v,left:f}}getPadding(e){const{top:t,right:n,bottom:r,left:i}=this.getNumericalPadding(e);return void 0!==t||void 0!==n||void 0!==r||void 0!==i?`${t||0}px ${n||0}px ${r||0}px ${i||0}px`:""}getHorizontalRule(e){const t={enabled:!1,insetLeft:void 0,insetRight:void 0,width:void 0,color:void 0};if(!this.theme.horizontalRule)return t;t.enabled=pn(this.theme.horizontalRule,`${e}.enabled`,!1),t.insetLeft=pn(this.theme.horizontalRule,`${e}.insetLeft`,"0px"),t.insetRight=pn(this.theme.horizontalRule,`${e}.insetRight`,"0px"),t.width=pn(this.theme.horizontalRule,`${e}.width`,"0px");const n={color:pn(this.theme.horizontalRule,`${e}.color`,null),opacity:pn(this.theme.horizontalRule,`${e}.opacity`,null)};return t.color=n&&(null==n?void 0:n.color)?hn(n.color,n.opacity):hn("#000000",0),t}getCSSColor(e,t){const n=pn(this.theme.colors,e,null);if(n&&(null==n?void 0:n.color)&&!(null==t?void 0:t.skipPrimaryStyle))return hn(n.color,n.opacity);if(null==t?void 0:t.skipFallback)return null;const r=pn(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"feed";return{icon:{switchOff:ln,switchOn:ln,selectionIndicator:sn,selectionIndicatorActive:sn},background:Object.assign(Object.assign({switchOff:"rgba(128, 128, 128, 1)",switchOn:sn,modalContainer:"rgba(0, 0, 0, 0.5)",dropdownMenu:ln,dropdownMenuSelectedIcon:sn},"feed"===e?{card:ln}:{}),"workflow"===e?{default:sn}:{}),text:{dropdownMenuItem:sn}}}(this.themeName),e,null);return r||("workflow"===this.themeName?e.startsWith("background")?sn:ln:e.startsWith("background")?"rgba(0, 0, 0, 0)":sn)}getFontFamilies(){return this.fontFamilies}getTypographyStyle(e){return pn(this.theme.typography,e,null)||{size:"17px",isDefaultTypography:!0}}getNumericFontSize(e,t){var n;const r=this.getTypographyStyle(e);return(null==t?void 0:t.skipFallback)&&r.isDefaultTypography?null:r&&r.size?(null===(n=r.scaling)||void 0===n?void 0:n.enabled)?this.getNumericScaledFontSize(r):Number(r.size.replace(/px/g,"")):null}getNumericScaledFontSize(e){const t=Number(window.getComputedStyle(document.documentElement).getPropertyValue("font-size").replace("px","")),n=t?t/16:1,r=e.size?Number(e.size.replace(/px/g,"")):17,i=r*n;if(e.scaling){const t=e.scaling.minimumSize?Number(e.scaling.minimumSize.replace(/px/g,"")):void 0,n=e.scaling.maximumSize?Number(e.scaling.maximumSize.replace(/px/g,"")):void 0;if(void 0===t&&void 0===n)return r;if(t&&i<t)return t;if(n&&i>n)return n}return i}getCSSFontProperties(e,t){var n,r;const i=this.getTypographyStyle(e);if(!i)return{};if((null==t?void 0:t.skipFallback)&&i.isDefaultTypography)return null;const o=i.transform?i.transform:(null==t?void 0:t.skipFontFallbacks)?null:"none",a=Math.max(i.lineHeight||1,1),s=(null!==(n=this.getNumericFontSize(e,t))&&void 0!==n?n:17)*a+"px",l=(null===(r=i.scaling)||void 0===r?void 0:r.enabled)?`${this.getNumericScaledFontSize(i)}px`:i.size,d=i.fontFamily?`"${i.fontFamily}", ${dn}`:dn,c=i.weight||((null==t?void 0:t.skipFontFallbacks)?null:"normal"),u=i.style||((null==t?void 0:t.skipFontFallbacks)?null:"normal"),h=i.align;return Object.assign({textTransform:o,lineHeight:s,fontSize:l,fontFamily:d,fontWeight:c,fontStyle:u,fontSynthesis:"weight style"},h?{textAlign:h}:{})}getElementFocusCSSProperties(){return{outline:"none","&.focus-visible":{boxShadow:`0 0 0 2px ${this.getCSSColor("border.focus")} inset`}}}}const hn=(e,t)=>{const n=e.replace("#",""),r=parseInt(n,16);return`rgba(${[r>>16&255,r>>8&255,255&r].join(",")},${t})`},pn=(e,t,n)=>(e=e[(t=Array.isArray(t)?t:t.split("."))[0]])&&t.length>1?pn(e,t.slice(1),n):void 0!==e?e:n,mn=e=>{if(null==e)return;if("number"==typeof e)return e;const t=parseFloat(e.replace(/px/g,""));return isNaN(t)?void 0:t},gn=e=>"secondaryVariant"===e?"Secondary":"tertiaryVariant"===e?"Tertiary":"",vn=e=>"h2"===e?"H2":"h3"===e?"H3":"",fn=e=>"secondaryVariant"===e?"Secondary":"tertiaryVariant"===e?"Tertiary":"Primary",bn=(e,t)=>n=>{let{themeMethod:r,primaryAccessor:i,secondaryAccessor:o,fallbackStyle:a,skipThemeHelperFallbacks:s,skipDefaultStyle:l}=n;const d=i?e[r](i,{skipFallback:s}):void 0,c=o?e[r](o,{skipFallback:!0}):void 0;let u="getCSSColor"===r?e.getCSSColor(i||o||"",{skipPrimaryStyle:!0}):e[r]("");return l&&(u=""),"secondary"===t&&c?c:d&&("primary"===t||"secondary"===t&&!e.hasSecondaryButtonStyle)?d:a||u||""},Sn=e=>"string"!=typeof e?(v.warn({level3:["Expected a string value for RGBA color, but received:",e]}),!1):null!==e.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/),yn=on({from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}),wn=rn("svg")((()=>({animation:`${yn} 1s infinite linear`}))),kn=e=>{let{stopColor:t,size:n}=e;return(0,le.h)(wn,{width:n,height:n,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,le.h)("path",{d:"M31 16C31 7.71573 24.2843 1 16 1C7.71573 1 1 7.71573 1 16C1 24.2843 7.71573 31 16 31",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))},Cn=()=>(0,le.h)("style",null,"/*!\n * @license\n * Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com\n * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)\n */\n \n @font-face {\n font-family: 'Font Awesome 5 Free';\n font-style: normal;\n font-weight: 900;\n font-display: block;\n src: url('https://downloads.atomic.io/web-sdk/release/26.2.0/assets/fonts/font-awesome-5-15-4/fa-solid-900.woff');\n }\n "),xn={"500px":"","accessible-icon":"",accusoft:"","acquisitions-incorporated":"",ad:"","address-book":"","address-card":"",adjust:"",adn:"",adversal:"",affiliatetheme:"","air-freshener":"",airbnb:"",algolia:"","align-center":"","align-justify":"","align-left":"","align-right":"",alipay:"",allergies:"",amazon:"","amazon-pay":"",ambulance:"","american-sign-language-interpreting":"",amilia:"",anchor:"",android:"",angellist:"","angle-double-down":"","angle-double-left":"","angle-double-right":"","angle-double-up":"","angle-down":"","angle-left":"","angle-right":"","angle-up":"",angry:"",angrycreative:"",angular:"",ankh:"","app-store":"","app-store-ios":"",apper:"",apple:"","apple-alt":"","apple-pay":"",archive:"",archway:"","arrow-alt-circle-down":"","arrow-alt-circle-left":"","arrow-alt-circle-right":"","arrow-alt-circle-up":"","arrow-circle-down":"","arrow-circle-left":"","arrow-circle-right":"","arrow-circle-up":"","arrow-down":"","arrow-left":"","arrow-right":"","arrow-up":"","arrows-alt":"","arrows-alt-h":"","arrows-alt-v":"",artstation:"","assistive-listening-systems":"",asterisk:"",asymmetrik:"",at:"",atlas:"",atlassian:"",atom:"",audible:"","audio-description":"",autoprefixer:"",avianex:"",aviato:"",award:"",aws:"",baby:"","baby-carriage":"",backspace:"",backward:"",bacon:"",bacteria:"",bacterium:"",bahai:"","balance-scale":"","balance-scale-left":"","balance-scale-right":"",ban:"","band-aid":"",bandcamp:"",barcode:"",bars:"","baseball-ball":"","basketball-ball":"",bath:"","battery-empty":"","battery-full":"","battery-half":"","battery-quarter":"","battery-three-quarters":"","battle-net":"",bed:"",beer:"",behance:"","behance-square":"",bell:"","bell-slash":"","bezier-curve":"",bible:"",bicycle:"",biking:"",bimobject:"",binoculars:"",biohazard:"","birthday-cake":"",bitbucket:"",bitcoin:"",bity:"","black-tie":"",blackberry:"",blender:"","blender-phone":"",blind:"",blog:"",blogger:"","blogger-b":"",bluetooth:"","bluetooth-b":"",bold:"",bolt:"",bomb:"",bone:"",bong:"",book:"","book-dead":"","book-medical":"","book-open":"","book-reader":"",bookmark:"",bootstrap:"","border-all":"","border-none":"","border-style":"","bowling-ball":"",box:"","box-open":"","box-tissue":"",boxes:"",braille:"",brain:"","bread-slice":"",briefcase:"","briefcase-medical":"","broadcast-tower":"",broom:"",brush:"",btc:"",buffer:"",bug:"",building:"",bullhorn:"",bullseye:"",burn:"",buromobelexperte:"",bus:"","bus-alt":"","business-time":"","buy-n-large":"",buysellads:"",calculator:"",calendar:"","calendar-alt":"","calendar-check":"","calendar-day":"","calendar-minus":"","calendar-plus":"","calendar-times":"","calendar-week":"",camera:"","camera-retro":"",campground:"","canadian-maple-leaf":"","candy-cane":"",cannabis:"",capsules:"",car:"","car-alt":"","car-battery":"","car-crash":"","car-side":"",caravan:"","caret-down":"","caret-left":"","caret-right":"","caret-square-down":"","caret-square-left":"","caret-square-right":"","caret-square-up":"","caret-up":"",carrot:"","cart-arrow-down":"","cart-plus":"","cash-register":"",cat:"","cc-amazon-pay":"","cc-amex":"","cc-apple-pay":"","cc-diners-club":"","cc-discover":"","cc-jcb":"","cc-mastercard":"","cc-paypal":"","cc-stripe":"","cc-visa":"",centercode:"",centos:"",certificate:"",chair:"",chalkboard:"","chalkboard-teacher":"","charging-station":"","chart-area":"","chart-bar":"","chart-line":"","chart-pie":"",check:"","check-circle":"","check-double":"","check-square":"",cheese:"",chess:"","chess-bishop":"","chess-board":"","chess-king":"","chess-knight":"","chess-pawn":"","chess-queen":"","chess-rook":"","chevron-circle-down":"","chevron-circle-left":"","chevron-circle-right":"","chevron-circle-up":"","chevron-down":"","chevron-left":"","chevron-right":"","chevron-up":"",child:"",chrome:"",chromecast:"",church:"",circle:"","circle-notch":"",city:"","clinic-medical":"",clipboard:"","clipboard-check":"","clipboard-list":"",clock:"",clone:"","closed-captioning":"",cloud:"","cloud-download-alt":"","cloud-meatball":"","cloud-moon":"","cloud-moon-rain":"","cloud-rain":"","cloud-showers-heavy":"","cloud-sun":"","cloud-sun-rain":"","cloud-upload-alt":"",cloudflare:"",cloudscale:"",cloudsmith:"",cloudversify:"",cocktail:"",code:"","code-branch":"",codepen:"",codiepie:"",coffee:"",cog:"",cogs:"",coins:"",columns:"",comment:"","comment-alt":"","comment-dollar":"","comment-dots":"","comment-medical":"","comment-slash":"",comments:"","comments-dollar":"","compact-disc":"",compass:"",compress:"","compress-alt":"","compress-arrows-alt":"","concierge-bell":"",confluence:"",connectdevelop:"",contao:"",cookie:"","cookie-bite":"",copy:"",copyright:"","cotton-bureau":"",couch:"",cpanel:"","creative-commons":"","creative-commons-by":"","creative-commons-nc":"","creative-commons-nc-eu":"","creative-commons-nc-jp":"","creative-commons-nd":"","creative-commons-pd":"","creative-commons-pd-alt":"","creative-commons-remix":"","creative-commons-sa":"","creative-commons-sampling":"","creative-commons-sampling-plus":"","creative-commons-share":"","creative-commons-zero":"","credit-card":"","critical-role":"",crop:"","crop-alt":"",cross:"",crosshairs:"",crow:"",crown:"",crutch:"",css3:"","css3-alt":"",cube:"",cubes:"",cut:"",cuttlefish:"","d-and-d":"","d-and-d-beyond":"",dailymotion:"",dashcube:"",database:"",deaf:"",deezer:"",delicious:"",democrat:"",deploydog:"",deskpro:"",desktop:"",dev:"",deviantart:"",dharmachakra:"",dhl:"",diagnoses:"",diaspora:"",dice:"","dice-d20":"","dice-d6":"","dice-five":"","dice-four":"","dice-one":"","dice-six":"","dice-three":"","dice-two":"",digg:"","digital-ocean":"","digital-tachograph":"",directions:"",discord:"",discourse:"",disease:"",divide:"",dizzy:"",dna:"",dochub:"",docker:"",dog:"","dollar-sign":"",dolly:"","dolly-flatbed":"",donate:"","door-closed":"","door-open":"","dot-circle":"",dove:"",download:"",draft2digital:"","drafting-compass":"",dragon:"","draw-polygon":"",dribbble:"","dribbble-square":"",dropbox:"",drum:"","drum-steelpan":"","drumstick-bite":"",drupal:"",dumbbell:"",dumpster:"","dumpster-fire":"",dungeon:"",dyalog:"",earlybirds:"",ebay:"",edge:"","edge-legacy":"",edit:"",egg:"",eject:"",elementor:"","ellipsis-h":"","ellipsis-v":"",ello:"",ember:"",empire:"",envelope:"","envelope-open":"","envelope-open-text":"","envelope-square":"",envira:"",equals:"",eraser:"",erlang:"",ethereum:"",ethernet:"",etsy:"","euro-sign":"",evernote:"","exchange-alt":"",exclamation:"","exclamation-circle":"","exclamation-triangle":"",expand:"","expand-alt":"","expand-arrows-alt":"",expeditedssl:"","external-link-alt":"","external-link-square-alt":"",eye:"","eye-dropper":"","eye-slash":"",facebook:"","facebook-f":"","facebook-messenger":"","facebook-square":"",fan:"","fantasy-flight-games":"","fast-backward":"","fast-forward":"",faucet:"",fax:"",feather:"","feather-alt":"",fedex:"",fedora:"",female:"","fighter-jet":"",figma:"",file:"","file-alt":"","file-archive":"","file-audio":"","file-code":"","file-contract":"","file-csv":"","file-download":"","file-excel":"","file-export":"","file-image":"","file-import":"","file-invoice":"","file-invoice-dollar":"","file-medical":"","file-medical-alt":"","file-pdf":"","file-powerpoint":"","file-prescription":"","file-signature":"","file-upload":"","file-video":"","file-word":"",fill:"","fill-drip":"",film:"",filter:"",fingerprint:"",fire:"","fire-alt":"","fire-extinguisher":"",firefox:"","firefox-browser":"","first-aid":"","first-order":"","first-order-alt":"",firstdraft:"",fish:"","fist-raised":"",flag:"","flag-checkered":"","flag-usa":"",flask:"",flickr:"",flipboard:"",flushed:"",fly:"",folder:"","folder-minus":"","folder-open":"","folder-plus":"",font:"","font-awesome":"","font-awesome-alt":"","font-awesome-flag":"","font-awesome-logo-full":"",fonticons:"","fonticons-fi":"","football-ball":"","fort-awesome":"","fort-awesome-alt":"",forumbee:"",forward:"",foursquare:"","free-code-camp":"",freebsd:"",frog:"",frown:"","frown-open":"",fulcrum:"","funnel-dollar":"",futbol:"","galactic-republic":"","galactic-senate":"",gamepad:"","gas-pump":"",gavel:"",gem:"",genderless:"","get-pocket":"",gg:"","gg-circle":"",ghost:"",gift:"",gifts:"",git:"","git-alt":"","git-square":"",github:"","github-alt":"","github-square":"",gitkraken:"",gitlab:"",gitter:"","glass-cheers":"","glass-martini":"","glass-martini-alt":"","glass-whiskey":"",glasses:"",glide:"","glide-g":"",globe:"","globe-africa":"","globe-americas":"","globe-asia":"","globe-europe":"",gofore:"","golf-ball":"",goodreads:"","goodreads-g":"",google:"","google-drive":"","google-pay":"","google-play":"","google-plus":"","google-plus-g":"","google-plus-square":"","google-wallet":"",gopuram:"","graduation-cap":"",gratipay:"",grav:"","greater-than":"","greater-than-equal":"",grimace:"",grin:"","grin-alt":"","grin-beam":"","grin-beam-sweat":"","grin-hearts":"","grin-squint":"","grin-squint-tears":"","grin-stars":"","grin-tears":"","grin-tongue":"","grin-tongue-squint":"","grin-tongue-wink":"","grin-wink":"","grip-horizontal":"","grip-lines":"","grip-lines-vertical":"","grip-vertical":"",gripfire:"",grunt:"",guilded:"",guitar:"",gulp:"","h-square":"","hacker-news":"","hacker-news-square":"",hackerrank:"",hamburger:"",hammer:"",hamsa:"","hand-holding":"","hand-holding-heart":"","hand-holding-medical":"","hand-holding-usd":"","hand-holding-water":"","hand-lizard":"","hand-middle-finger":"","hand-paper":"","hand-peace":"","hand-point-down":"","hand-point-left":"","hand-point-right":"","hand-point-up":"","hand-pointer":"","hand-rock":"","hand-scissors":"","hand-sparkles":"","hand-spock":"",hands:"","hands-helping":"","hands-wash":"",handshake:"","handshake-alt-slash":"","handshake-slash":"",hanukiah:"","hard-hat":"",hashtag:"","hat-cowboy":"","hat-cowboy-side":"","hat-wizard":"",hdd:"","head-side-cough":"","head-side-cough-slash":"","head-side-mask":"","head-side-virus":"",heading:"",headphones:"","headphones-alt":"",headset:"",heart:"","heart-broken":"",heartbeat:"",helicopter:"",highlighter:"",hiking:"",hippo:"",hips:"","hire-a-helper":"",history:"",hive:"","hockey-puck":"","holly-berry":"",home:"",hooli:"",hornbill:"",horse:"","horse-head":"",hospital:"","hospital-alt":"","hospital-symbol":"","hospital-user":"","hot-tub":"",hotdog:"",hotel:"",hotjar:"",hourglass:"","hourglass-end":"","hourglass-half":"","hourglass-start":"","house-damage":"","house-user":"",houzz:"",hryvnia:"",html5:"",hubspot:"","i-cursor":"","ice-cream":"",icicles:"",icons:"","id-badge":"","id-card":"","id-card-alt":"",ideal:"",igloo:"",image:"",images:"",imdb:"",inbox:"",indent:"",industry:"",infinity:"",info:"","info-circle":"",innosoft:"",instagram:"","instagram-square":"",instalod:"",intercom:"","internet-explorer":"",invision:"",ioxhost:"",italic:"","itch-io":"",itunes:"","itunes-note":"",java:"",jedi:"","jedi-order":"",jenkins:"",jira:"",joget:"",joint:"",joomla:"","journal-whills":"",js:"","js-square":"",jsfiddle:"",kaaba:"",kaggle:"",key:"",keybase:"",keyboard:"",keycdn:"",khanda:"",kickstarter:"","kickstarter-k":"",kiss:"","kiss-beam":"","kiss-wink-heart":"","kiwi-bird":"",korvue:"",landmark:"",language:"",laptop:"","laptop-code":"","laptop-house":"","laptop-medical":"",laravel:"",lastfm:"","lastfm-square":"",laugh:"","laugh-beam":"","laugh-squint":"","laugh-wink":"","layer-group":"",leaf:"",leanpub:"",lemon:"",less:"","less-than":"","less-than-equal":"","level-down-alt":"","level-up-alt":"","life-ring":"",lightbulb:"",line:"",link:"",linkedin:"","linkedin-in":"",linode:"",linux:"","lira-sign":"",list:"","list-alt":"","list-ol":"","list-ul":"","location-arrow":"",lock:"","lock-open":"","long-arrow-alt-down":"","long-arrow-alt-left":"","long-arrow-alt-right":"","long-arrow-alt-up":"","low-vision":"","luggage-cart":"",lungs:"","lungs-virus":"",lyft:"",magento:"",magic:"",magnet:"","mail-bulk":"",mailchimp:"",male:"",mandalorian:"",map:"","map-marked":"","map-marked-alt":"","map-marker":"","map-marker-alt":"","map-pin":"","map-signs":"",markdown:"",marker:"",mars:"","mars-double":"","mars-stroke":"","mars-stroke-h":"","mars-stroke-v":"",mask:"",mastodon:"",maxcdn:"",mdb:"",medal:"",medapps:"",medium:"","medium-m":"",medkit:"",medrt:"",meetup:"",megaport:"",meh:"","meh-blank":"","meh-rolling-eyes":"",memory:"",mendeley:"",menorah:"",mercury:"",meteor:"",microblog:"",microchip:"",microphone:"","microphone-alt":"","microphone-alt-slash":"","microphone-slash":"",microscope:"",microsoft:"",minus:"","minus-circle":"","minus-square":"",mitten:"",mix:"",mixcloud:"",mixer:"",mizuni:"",mobile:"","mobile-alt":"",modx:"",monero:"","money-bill":"","money-bill-alt":"","money-bill-wave":"","money-bill-wave-alt":"","money-check":"","money-check-alt":"",monument:"",moon:"","mortar-pestle":"",mosque:"",motorcycle:"",mountain:"",mouse:"","mouse-pointer":"","mug-hot":"",music:"",napster:"",neos:"","network-wired":"",neuter:"",newspaper:"",nimblr:"",node:"","node-js":"","not-equal":"","notes-medical":"",npm:"",ns8:"",nutritionix:"","object-group":"","object-ungroup":"","octopus-deploy":"",odnoklassniki:"","odnoklassniki-square":"","oil-can":"","old-republic":"",om:"",opencart:"",openid:"",opera:"","optin-monster":"",orcid:"",osi:"",otter:"",outdent:"",page4:"",pagelines:"",pager:"","paint-brush":"","paint-roller":"",palette:"",palfed:"",pallet:"","paper-plane":"",paperclip:"","parachute-box":"",paragraph:"",parking:"",passport:"",pastafarianism:"",paste:"",patreon:"",pause:"","pause-circle":"",paw:"",paypal:"",peace:"",pen:"","pen-alt":"","pen-fancy":"","pen-nib":"","pen-square":"","pencil-alt":"","pencil-ruler":"","penny-arcade":"","people-arrows":"","people-carry":"","pepper-hot":"",perbyte:"",percent:"",percentage:"",periscope:"","person-booth":"",phabricator:"","phoenix-framework":"","phoenix-squadron":"",phone:"","phone-alt":"","phone-slash":"","phone-square":"","phone-square-alt":"","phone-volume":"","photo-video":"",php:"","pied-piper":"","pied-piper-alt":"","pied-piper-hat":"","pied-piper-pp":"","pied-piper-square":"","piggy-bank":"",pills:"",pinterest:"","pinterest-p":"","pinterest-square":"","pizza-slice":"","place-of-worship":"",plane:"","plane-arrival":"","plane-departure":"","plane-slash":"",play:"","play-circle":"",playstation:"",plug:"",plus:"","plus-circle":"","plus-square":"",podcast:"",poll:"","poll-h":"",poo:"","poo-storm":"",poop:"",portrait:"","pound-sign":"","power-off":"",pray:"","praying-hands":"",prescription:"","prescription-bottle":"","prescription-bottle-alt":"",print:"",procedures:"","product-hunt":"","project-diagram":"","pump-medical":"","pump-soap":"",pushed:"","puzzle-piece":"",python:"",qq:"",qrcode:"",question:"","question-circle":"",quidditch:"",quinscape:"",quora:"","quote-left":"","quote-right":"",quran:"","r-project":"",radiation:"","radiation-alt":"",rainbow:"",random:"","raspberry-pi":"",ravelry:"",react:"",reacteurope:"",readme:"",rebel:"",receipt:"","record-vinyl":"",recycle:"","red-river":"",reddit:"","reddit-alien":"","reddit-square":"",redhat:"",redo:"","redo-alt":"",registered:"","remove-format":"",renren:"",reply:"","reply-all":"",replyd:"",republican:"",researchgate:"",resolving:"",restroom:"",retweet:"",rev:"",ribbon:"",ring:"",road:"",robot:"",rocket:"",rocketchat:"",rockrms:"",route:"",rss:"","rss-square":"","ruble-sign":"",ruler:"","ruler-combined":"","ruler-horizontal":"","ruler-vertical":"",running:"","rupee-sign":"",rust:"","sad-cry":"","sad-tear":"",safari:"",salesforce:"",sass:"",satellite:"","satellite-dish":"",save:"",schlix:"",school:"",screwdriver:"",scribd:"",scroll:"","sd-card":"",search:"","search-dollar":"","search-location":"","search-minus":"","search-plus":"",searchengin:"",seedling:"",sellcast:"",sellsy:"",server:"",servicestack:"",shapes:"",share:"","share-alt":"","share-alt-square":"","share-square":"","shekel-sign":"","shield-alt":"","shield-virus":"",ship:"","shipping-fast":"",shirtsinbulk:"","shoe-prints":"",shopify:"","shopping-bag":"","shopping-basket":"","shopping-cart":"",shopware:"",shower:"","shuttle-van":"",sign:"","sign-in-alt":"","sign-language":"","sign-out-alt":"",signal:"",signature:"","sim-card":"",simplybuilt:"",sink:"",sistrix:"",sitemap:"",sith:"",skating:"",sketch:"",skiing:"","skiing-nordic":"",skull:"","skull-crossbones":"",skyatlas:"",skype:"",slack:"","slack-hash":"",slash:"",sleigh:"","sliders-h":"",slideshare:"",smile:"","smile-beam":"","smile-wink":"",smog:"",smoking:"","smoking-ban":"",sms:"",snapchat:"","snapchat-ghost":"","snapchat-square":"",snowboarding:"",snowflake:"",snowman:"",snowplow:"",soap:"",socks:"","solar-panel":"",sort:"","sort-alpha-down":"","sort-alpha-down-alt":"","sort-alpha-up":"","sort-alpha-up-alt":"","sort-amount-down":"","sort-amount-down-alt":"","sort-amount-up":"","sort-amount-up-alt":"","sort-down":"","sort-numeric-down":"","sort-numeric-down-alt":"","sort-numeric-up":"","sort-numeric-up-alt":"","sort-up":"",soundcloud:"",sourcetree:"",spa:"","space-shuttle":"",speakap:"","speaker-deck":"","spell-check":"",spider:"",spinner:"",splotch:"",spotify:"","spray-can":"",square:"","square-full":"","square-root-alt":"",squarespace:"","stack-exchange":"","stack-overflow":"",stackpath:"",stamp:"",star:"","star-and-crescent":"","star-half":"","star-half-alt":"","star-of-david":"","star-of-life":"",staylinked:"",steam:"","steam-square":"","steam-symbol":"","step-backward":"","step-forward":"",stethoscope:"","sticker-mule":"","sticky-note":"",stop:"","stop-circle":"",stopwatch:"","stopwatch-20":"",store:"","store-alt":"","store-alt-slash":"","store-slash":"",strava:"",stream:"","street-view":"",strikethrough:"",stripe:"","stripe-s":"",stroopwafel:"",studiovinari:"",stumbleupon:"","stumbleupon-circle":"",subscript:"",subway:"",suitcase:"","suitcase-rolling":"",sun:"",superpowers:"",superscript:"",supple:"",surprise:"",suse:"",swatchbook:"",swift:"",swimmer:"","swimming-pool":"",symfony:"",synagogue:"",sync:"","sync-alt":"",syringe:"",table:"","table-tennis":"",tablet:"","tablet-alt":"",tablets:"","tachometer-alt":"",tag:"",tags:"",tape:"",tasks:"",taxi:"",teamspeak:"",teeth:"","teeth-open":"",telegram:"","telegram-plane":"","temperature-high":"","temperature-low":"","tencent-weibo":"",tenge:"",terminal:"","text-height":"","text-width":"",th:"","th-large":"","th-list":"","the-red-yeti":"","theater-masks":"",themeco:"",themeisle:"",thermometer:"","thermometer-empty":"","thermometer-full":"","thermometer-half":"","thermometer-quarter":"","thermometer-three-quarters":"","think-peaks":"","thumbs-down":"","thumbs-up":"",thumbtack:"","ticket-alt":"",tiktok:"",times:"","times-circle":"",tint:"","tint-slash":"",tired:"","toggle-off":"","toggle-on":"",toilet:"","toilet-paper":"","toilet-paper-slash":"",toolbox:"",tools:"",tooth:"",torah:"","torii-gate":"",tractor:"","trade-federation":"",trademark:"","traffic-light":"",trailer:"",train:"",tram:"",transgender:"","transgender-alt":"",trash:"","trash-alt":"","trash-restore":"","trash-restore-alt":"",tree:"",trello:"",trophy:"",truck:"","truck-loading":"","truck-monster":"","truck-moving":"","truck-pickup":"",tshirt:"",tty:"",tumblr:"","tumblr-square":"",tv:"",twitch:"",twitter:"","twitter-square":"",typo3:"",uber:"",ubuntu:"",uikit:"",umbraco:"",umbrella:"","umbrella-beach":"",uncharted:"",underline:"",undo:"","undo-alt":"",uniregistry:"",unity:"","universal-access":"",university:"",unlink:"",unlock:"","unlock-alt":"",unsplash:"",untappd:"",upload:"",ups:"",usb:"",user:"","user-alt":"","user-alt-slash":"","user-astronaut":"","user-check":"","user-circle":"","user-clock":"","user-cog":"","user-edit":"","user-friends":"","user-graduate":"","user-injured":"","user-lock":"","user-md":"","user-minus":"","user-ninja":"","user-nurse":"","user-plus":"","user-secret":"","user-shield":"","user-slash":"","user-tag":"","user-tie":"","user-times":"",users:"","users-cog":"","users-slash":"",usps:"",ussunnah:"","utensil-spoon":"",utensils:"",vaadin:"","vector-square":"",venus:"","venus-double":"","venus-mars":"",vest:"","vest-patches":"",viacoin:"",viadeo:"","viadeo-square":"",vial:"",vials:"",viber:"",video:"","video-slash":"",vihara:"",vimeo:"","vimeo-square":"","vimeo-v":"",vine:"",virus:"","virus-slash":"",viruses:"",vk:"",vnv:"",voicemail:"","volleyball-ball":"","volume-down":"","volume-mute":"","volume-off":"","volume-up":"","vote-yea":"","vr-cardboard":"",vuejs:"",walking:"",wallet:"",warehouse:"","watchman-monitoring":"",water:"","wave-square":"",waze:"",weebly:"",weibo:"",weight:"","weight-hanging":"",weixin:"",whatsapp:"","whatsapp-square":"",wheelchair:"",whmcs:"",wifi:"","wikipedia-w":"",wind:"","window-close":"","window-maximize":"","window-minimize":"","window-restore":"",windows:"","wine-bottle":"","wine-glass":"","wine-glass-alt":"",wix:"","wizards-of-the-coast":"",wodu:"","wolf-pack-battalion":"","won-sign":"",wordpress:"","wordpress-simple":"",wpbeginner:"",wpexplorer:"",wpforms:"",wpressr:"",wrench:"","x-ray":"",xbox:"",xing:"","xing-square":"","y-combinator":"",yahoo:"",yammer:"",yandex:"","yandex-international":"",yarn:"",yelp:"","yen-sign":"","yin-yang":"",yoast:"",youtube:"","youtube-square":"",zhihu:""},In=e=>{let{fillColor:t,ariaHidden:n=!1,alt:r=""}=e;return(0,le.h)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":n},(0,le.h)("title",null,r),(0,le.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 2H2V13.398L9.66274 8.25944C10.1695 7.91961 10.8316 7.92061 11.3374 8.26198L14 10.0593V2ZM14 14H2.89774L10.2197 9.08999C10.3886 8.97671 10.6093 8.97704 10.7779 9.09083L14 11.2657V14ZM2 1C1.44772 1 1 1.44772 1 2V14C1 14.5523 1.44772 15 2 15H14C14.5523 15 15 14.5523 15 14V2C15 1.44772 14.5523 1 14 1H2ZM6 4C4.89543 4 4 4.89543 4 6C4 7.10457 4.89543 8 6 8C7.10457 8 8 7.10457 8 6C8 4.89543 7.10457 4 6 4ZM5 6C5 5.44771 5.44771 5 6 5C6.55229 5 7 5.44771 7 6C7 6.55229 6.55229 7 6 7C5.44771 7 5 6.55229 5 6Z",fill:t}))},On=rn("i")((e=>{let{size:t,styles:n}=e;return Object.assign({fontFamily:"'Font Awesome 5 Free'",fontWeight:"900",fontSize:`${t}px`,width:`${t}px`,textAlign:"center",fontStyle:"normal",fontVariant:"normal",textRendering:"auto","-moz-osx-font-smoothing":"grayscale","-webkit-font-smoothing":"antialiased"},n)})),Mn=rn("div")((e=>{var t;let{color:n,size:r,styles:i}=e;return Object.assign(Object.assign(Object.assign({display:"flex",justifyContent:"center",alignItems:"center"},n?{fill:n}:{}),i),{width:`${r}px`,height:null!==(t=i.lineHeight)&&void 0!==t?t:`${r}px`})})),Nn=e=>{let{iconName:t,iconUrl:n,iconAltText:r,size:i,color:o,fallbackColor:a,styles:s={},scaleToFit:l=!1}=e;const[d,c]=ve(!1),[u,h]=ve(!1),p=ye(n);be((()=>{n&&n!==p.current&&(p.current=n,c(!1),h(!1))}),[n]);if(n&&d&&!u)return(0,le.h)(Mn,{size:i,styles:s},(0,le.h)("img",{"aria-hidden":!r,"aria-label":r||"",alt:r||"",src:n,onError:()=>{v.error({level1:[`Error loading custom icon: ${n}`]}),h(!0)},style:{width:"100%",height:"100%",objectFit:"cover"}}));if(n&&!d)return(0,le.h)(Mn,{size:i,styles:s},(0,le.h)("svg",{"aria-hidden":!r,"aria-label":r||"","data-src":n,"data-replacement-color":o,"data-container-size":i,"data-scale-to-fit":l?"enabled":void 0,oniconloaderror:()=>{v.warn({level1:[`Could not load custom icon via SVG loader: ${n}`]}),c(!0)},style:Object.assign({maxWidth:`${i}px`,maxHeight:`${i}px`},o?{color:o}:{})}));if(t){const e=xn[t];return o&&(s.color=o),e?(0,le.h)(On,{styles:s,size:i,role:"img","aria-hidden":!r,"aria-label":r||""},e):(0,le.h)(Mn,{size:i,styles:s,role:"img","aria-hidden":!r,"aria-label":r||""},t)}return(0,le.h)(Mn,{size:i,styles:s},(0,le.h)(In,{alt:"",fillColor:null!=o?o:a}))},Tn=rn("hr")((e=>{var t,n,r,i,o,a;let{theme:s,ruleStyles:l,isSubview:d,isBetweenButtons:c,translateY:u}=e,h="0px",p="0px",m=0,g=0;if(d){const e=s.getNumericalPadding("stream");m=null!==(t=null==e?void 0:e.left)&&void 0!==t?t:N,g=null!==(n=null==e?void 0:e.right)&&void 0!==n?n:N}else{const e=s.getNumericalPadding("card");m=null!==(r=null==e?void 0:e.left)&&void 0!==r?r:O,g=null!==(i=null==e?void 0:e.right)&&void 0!==i?i:O}if(c){const e=s.getNumericalPadding("buttonGroup");m=null!==(o=null==e?void 0:e.left)&&void 0!==o?o:m,g=null!==(a=null==e?void 0:e.right)&&void 0!==a?a:g}return h=(mn(null==l?void 0:l.insetLeft)||0)-m+"px",p=(mn(null==l?void 0:l.insetRight)||0)-g+"px",Object.assign({border:"none",borderBottom:`${(null==l?void 0:l.width)||"0px"} solid ${(null==l?void 0:l.color)||"rgba(0,0,0,0)"}`,margin:"0",width:`calc(100% + ${m-(mn(null==l?void 0:l.insetLeft)||0)}px + ${g-(mn(null==l?void 0:l.insetRight)||0)}px)`,marginLeft:h,marginRight:p},u?{transform:`translateY(${u})`}:{})})),Fn=e=>{let{theme:t,ruleStyles:n,isSubview:r,isBetweenButtons:i,class:o,translateY:a}=e;return(0,le.h)(Tn,{"aria-hidden":"true",theme:t,ruleStyles:n,isSubview:r,isBetweenButtons:i,class:o,translateY:a})};function An(){return An=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},An.apply(this,arguments)}const Ln=e=>{let{theme:t,appearance:n}=e;const r=bn(t,n),i=(e,t)=>t?{[e]:t}:{},o=t.getShape("buttonWidth.global"),a=r({themeMethod:"getCSSFontProperties",primaryAccessor:"button",secondaryAccessor:"buttonSecondary",fallbackStyle:{}});return Object.assign(Object.assign(Object.assign({position:"relative",cursor:"pointer",width:"hugsLabel"===o?"auto":"100%",maxWidth:"100%",padding:r({themeMethod:"getPadding",primaryAccessor:"button",secondaryAccessor:"buttonSecondary",fallbackStyle:"10px 20px"}),backgroundColor:r({themeMethod:"getCSSColor",primaryAccessor:"background.button",secondaryAccessor:"background.buttonSecondary"}),color:r({themeMethod:"getCSSColor",primaryAccessor:"text.button",secondaryAccessor:"text.buttonSecondary"}),textAlign:"center"},a),{borderStyle:"solid",borderColor:r({themeMethod:"getCSSColor",primaryAccessor:"border.button",secondaryAccessor:"border.buttonSecondary",fallbackStyle:"transparent",skipThemeHelperFallbacks:!0}),borderWidth:r({themeMethod:"getShape",primaryAccessor:"border.button",secondaryAccessor:"border.buttonSecondary",fallbackStyle:"0px"}),borderRadius:r({themeMethod:"getShape",primaryAccessor:"borderRadius.button",secondaryAccessor:"borderRadius.buttonSecondary",fallbackStyle:"0px"}),boxShadow:r({themeMethod:"getCSSShadowProperties",primaryAccessor:"button",secondaryAccessor:"buttonSecondary",skipThemeHelperFallbacks:!0,fallbackStyle:"none"}),display:"flex",alignItems:"center",whiteSpace:"pre-wrap",":hover":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i("color",r({themeMethod:"getCSSColor",primaryAccessor:"text.buttonHover",secondaryAccessor:"text.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("backgroundColor",r({themeMethod:"getCSSColor",primaryAccessor:"background.buttonHover",secondaryAccessor:"background.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("padding",r({themeMethod:"getPadding",primaryAccessor:"buttonHover",secondaryAccessor:"buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderColor",r({themeMethod:"getCSSColor",primaryAccessor:"border.buttonHover",secondaryAccessor:"border.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderWidth",r({themeMethod:"getShape",primaryAccessor:"border.buttonHover",secondaryAccessor:"border.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderRadius",r({themeMethod:"getShape",primaryAccessor:"borderRadius.buttonHover",secondaryAccessor:"borderRadius.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("boxShadow",r({themeMethod:"getCSSShadowProperties",primaryAccessor:"buttonHover",secondaryAccessor:"buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),":active":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i("color",r({themeMethod:"getCSSColor",primaryAccessor:"text.buttonActive",secondaryAccessor:"text.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),{backgroundColor:r({themeMethod:"getCSSColor",primaryAccessor:"background.buttonActive",secondaryAccessor:"background.buttonActiveSecondary",fallbackStyle:"rgba(0,0,0,0.1)",skipThemeHelperFallbacks:!0})}),i("borderColor",r({themeMethod:"getCSSColor",primaryAccessor:"border.buttonActive",secondaryAccessor:"border.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderWidth",r({themeMethod:"getShape",primaryAccessor:"border.buttonActive",secondaryAccessor:"border.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderRadius",r({themeMethod:"getShape",primaryAccessor:"borderRadius.buttonActive",secondaryAccessor:"borderRadius.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("padding",r({themeMethod:"getPadding",primaryAccessor:"buttonActive",secondaryAccessor:"buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("boxShadow",r({themeMethod:"getCSSShadowProperties",primaryAccessor:"buttonActive",secondaryAccessor:"buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})))}),t.getElementFocusCSSProperties())},En=rn("button")((e=>Object.assign({},Ln(e)))),jn=rn("a")((e=>Object.assign(Object.assign({},Ln(e)),{textDecoration:"none"}))),Dn=rn("div")((e=>{var t,n;let r,i,{labelAlignment:o,iconAlignment:a,visible:s}=e;return"right"===a?(r="row-reverse",i=null!==(t=null==o?void 0:o.replace("left","flex-end").replace("right","flex-start"))&&void 0!==t?t:"center"):(r="row",i=null!==(n=null==o?void 0:o.replace("left","flex-start").replace("right","flex-end"))&&void 0!==n?n:"center"),{width:"100%",display:"flex",justifyContent:i,alignItems:"center",flexDirection:r,visibility:s?"visible":"hidden"}})),_n=rn("div")({display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}),Pn=rn("span")({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),Hn=e=>{let{nodeKey:t,localIndex:n,clickHandler:r,text:i,icon:o,iconUrl:a,iconAltText:s,theme:l,appearance:d,loading:c,type:u,urlLink:h}=e;const p=h?jn:En,m=bn(l,d),g=m({themeMethod:"getCSSFontProperties",primaryAccessor:"button",secondaryAccessor:"buttonSecondary",fallbackStyle:{}}),v=m({themeMethod:"getShape",primaryAccessor:"align.buttonIcon",secondaryAccessor:"align.buttonIconSecondary",fallbackStyle:"left",skipThemeHelperFallbacks:!0}),f=m({themeMethod:"getShape",primaryAccessor:"lineHeight.buttonIcon",secondaryAccessor:"lineHeight.buttonIconSecondary",fallbackStyle:"1",skipThemeHelperFallbacks:!0}),b=m({themeMethod:"getNumericFontSize",primaryAccessor:"button",secondaryAccessor:"buttonSecondary"}),S=Object.assign(Object.assign({},"left"===v?{marginRight:"10px"}:{marginLeft:"10px"}),{lineHeight:b*f+"px",color:m({themeMethod:"getCSSColor",primaryAccessor:"icon.button",secondaryAccessor:"icon.buttonSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),y=m({themeMethod:"getCSSColor",primaryAccessor:"icon.button",secondaryAccessor:"icon.buttonSecondary"}),w=l.getHorizontalRule("buttonGroupBetween"),k=l.getShape("buttonLayout.global"),C=(null==w?void 0:w.enabled)&&"horizontal"!==k&&n&&n>0,x={href:null==h?void 0:h.url,target:null==h?void 0:h.target,role:"button"};return(0,le.h)(le.Fragment,null,C&&(0,le.h)(Fn,{class:"horizontal-rule-between",theme:l,ruleStyles:w,isSubview:!0,isBetweenButtons:!0}),(0,le.h)(p,An({key:t,"data-element-key":t,ariaLabel:Kh({elementName:"button",label:i,iconAltText:s,hasIcon:!(!o&&!a)}),class:"action-button submit-button",onClick:r,theme:l,appearance:d,tabIndex:"0",type:u},h?x:{}),(0,le.h)(le.Fragment,null,c&&(0,le.h)(_n,null,(0,le.h)(kn,{stopColor:l.getCSSColor("text.button"),size:22})),(0,le.h)(Dn,{"data-testid":"button-content-wrapper",labelAlignment:null==g?void 0:g.textAlign,iconAlignment:v,visible:!c},(o||a)&&(0,le.h)(Nn,{iconName:o,iconUrl:a,size:b,color:S.color,fallbackColor:y,styles:Object.assign(Object.assign(Object.assign({},S),!i&&{marginLeft:0,marginRight:0}),{alignSelf:"center",justifySelf:"start"})}),(0,le.h)(Pn,null,i)))))};function Rn(){return Rn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rn.apply(this,arguments)}const $n=e=>{let{theme:t,appearance:n}=e;const r=bn(t,n),i=(e,t)=>t?{[e]:t}:{},o=t.getShape("buttonWidth.global"),a=r({themeMethod:"getCSSFontProperties",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:{}});return Object.assign(Object.assign(Object.assign({cursor:"pointer",width:"hugsLabel"===o?"auto":"100%",maxWidth:"100%",padding:r({themeMethod:"getPadding",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:"10px 20px"}),backgroundColor:r({themeMethod:"getCSSColor",primaryAccessor:"background.action",secondaryAccessor:"background.actionSecondary"}),color:r({themeMethod:"getCSSColor",primaryAccessor:"text.action",secondaryAccessor:"text.actionSecondary"}),textAlign:"left"},a),{borderStyle:"solid",borderColor:r({themeMethod:"getCSSColor",primaryAccessor:"border.action",secondaryAccessor:"border.actionSecondary",fallbackStyle:"transparent",skipThemeHelperFallbacks:!0}),borderWidth:r({themeMethod:"getShape",primaryAccessor:"border.action",secondaryAccessor:"border.actionSecondary",fallbackStyle:"0px"}),borderRadius:r({themeMethod:"getShape",primaryAccessor:"borderRadius.action",secondaryAccessor:"borderRadius.actionSecondary",fallbackStyle:"0px"}),boxShadow:r({themeMethod:"getCSSShadowProperties",primaryAccessor:"action",secondaryAccessor:"actionSecondary",skipThemeHelperFallbacks:!0,fallbackStyle:"none"}),display:"flex",alignItems:"center",":hover":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i("color",r({themeMethod:"getCSSColor",primaryAccessor:"text.buttonHover",secondaryAccessor:"text.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),{backgroundColor:r({themeMethod:"getCSSColor",primaryAccessor:"background.buttonHover",secondaryAccessor:"background.buttonHoverSecondary",fallbackStyle:"rgba(0,0,0,0.05)",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),i("padding",r({themeMethod:"getPadding",primaryAccessor:"buttonHover",secondaryAccessor:"buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderColor",r({themeMethod:"getCSSColor",primaryAccessor:"border.buttonHover",secondaryAccessor:"border.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderWidth",r({themeMethod:"getShape",primaryAccessor:"border.buttonHover",secondaryAccessor:"border.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderRadius",r({themeMethod:"getShape",primaryAccessor:"borderRadius.buttonHover",secondaryAccessor:"borderRadius.buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("boxShadow",r({themeMethod:"getCSSShadowProperties",primaryAccessor:"buttonHover",secondaryAccessor:"buttonHoverSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),":active":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i("color",r({themeMethod:"getCSSColor",primaryAccessor:"text.buttonActive",secondaryAccessor:"text.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),{backgroundColor:r({themeMethod:"getCSSColor",primaryAccessor:"background.buttonActive",secondaryAccessor:"background.buttonActiveSecondary",fallbackStyle:"rgba(0,0,0,0.1)",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),i("borderColor",r({themeMethod:"getCSSColor",primaryAccessor:"border.buttonActive",secondaryAccessor:"border.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderWidth",r({themeMethod:"getShape",primaryAccessor:"border.buttonActive",secondaryAccessor:"border.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("borderRadius",r({themeMethod:"getShape",primaryAccessor:"borderRadius.buttonActive",secondaryAccessor:"borderRadius.buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("padding",r({themeMethod:"getPadding",primaryAccessor:"buttonActive",secondaryAccessor:"buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0}))),i("boxShadow",r({themeMethod:"getCSSShadowProperties",primaryAccessor:"buttonActive",secondaryAccessor:"buttonActiveSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})))}),t.getElementFocusCSSProperties())},Vn=rn("button")((e=>Object.assign({},$n(e)))),Wn=rn("a")((e=>Object.assign(Object.assign({},$n(e)),{textDecoration:"none"}))),Bn=rn("div")((e=>{var t,n;let r,i,{labelAlignment:o,iconAlignment:a}=e;return"right"===a?(r="row-reverse",i=null!==(t=null==o?void 0:o.replace("left","flex-end").replace("right","flex-start"))&&void 0!==t?t:"flex-end"):(r="row",i=null!==(n=null==o?void 0:o.replace("left","flex-start").replace("right","flex-end"))&&void 0!==n?n:"flex-start"),{width:"100%",display:"flex",justifyContent:i,alignItems:"center",flexDirection:r}})),zn=rn("span")((()=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}))),Un=e=>{let{nodeKey:t,localIndex:n,clickHandler:r,text:i,icon:o,iconUrl:a,iconAltText:s,theme:l,appearance:d,type:c,urlLink:u}=e;const h=u?Wn:Vn,p=bn(l,d),m=p({themeMethod:"getCSSFontProperties",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:{}}),g=p({themeMethod:"getShape",primaryAccessor:"align.actionIcon",secondaryAccessor:"align.actionIconSecondary",fallbackStyle:"left",skipThemeHelperFallbacks:!0}),v=p({themeMethod:"getShape",primaryAccessor:"lineHeight.actionIcon",secondaryAccessor:"lineHeight.actionIconSecondary",fallbackStyle:"1",skipThemeHelperFallbacks:!0}),f=p({themeMethod:"getNumericFontSize",primaryAccessor:"action",secondaryAccessor:"actionSecondary"}),b=Object.assign(Object.assign({},"left"===g?{marginRight:"10px"}:{marginLeft:"10px"}),{lineHeight:f*v+"px",color:p({themeMethod:"getCSSColor",primaryAccessor:"icon.action",secondaryAccessor:"icon.actionSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),S=p({themeMethod:"getCSSColor",primaryAccessor:"icon.action",secondaryAccessor:"icon.actionSecondary"}),y=l.getHorizontalRule("buttonGroupBetween"),w=l.getShape("buttonLayout.global"),k=(null==y?void 0:y.enabled)&&"horizontal"!==w&&n&&n>0,C={href:null==u?void 0:u.url,target:null==u?void 0:u.target,role:"button"};return(0,le.h)(le.Fragment,null,k&&(0,le.h)(Fn,{class:"horizontal-rule-between",theme:l,ruleStyles:y,isSubview:!1,isBetweenButtons:!0}),(0,le.h)(h,Rn({key:t,"data-element-key":t,class:"action-button",ariaLabel:Kh({elementName:"button",label:i,iconAltText:s,hasIcon:!(!o&&!a)}),onClick:r,theme:l,appearance:d,tabIndex:"0",type:c},u?C:{}),(0,le.h)(Bn,{labelAlignment:null==m?void 0:m.textAlign,iconAlignment:g},(o||a)&&(0,le.h)(Nn,{iconName:o,iconUrl:a,size:f,color:b.color,fallbackColor:S,styles:Object.assign(Object.assign(Object.assign({},b),!i&&{marginLeft:0,marginRight:0}),{alignSelf:"center",justifySelf:"start"})}),(0,le.h)(zn,{"data-testid":"button-label"},i))))},qn=e=>e.isWorkflow?(0,le.h)(Hn,e):(0,le.h)(Un,e),Yn=e=>{let{fillColor:t,className:n,style:r,ariaHidden:i=!0}=e;return(0,le.h)("svg",{width:"14",height:"10",viewBox:"0 0 14 10",class:n,style:r,focusable:"false","aria-hidden":i},(0,le.h)("path",{d:"M13.7071 0.292893C14.0976 0.683417 14.0976 1.31658 13.7071 1.70711L5.70711 9.70711C5.31658 10.0976 4.68342 10.0976 4.29289 9.70711L0.292893 5.70711C-0.0976311 5.31658 -0.0976311 4.68342 0.292893 4.29289C0.683417 3.90237 1.31658 3.90237 1.70711 4.29289L5 7.58579L12.2929 0.292893C12.6834 -0.0976311 13.3166 -0.0976311 13.7071 0.292893Z",fill:t}))},Kn=e=>{let{style:t}=e;return(0,le.h)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,focusable:"false"},(0,le.h)("path",{d:"M11 13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13H11ZM13 7C13 6.44772 12.5523 6 12 6C11.4477 6 11 6.44772 11 7H13ZM9 2V1C8.73478 1 8.48043 1.10536 8.29289 1.29289L9 2ZM11 2L11.7071 1.29289C11.5196 1.10536 11.2652 1 11 1V2ZM3 2C2.44772 2 2 2.44772 2 3C2 3.55228 2.44772 4 3 4V2ZM17 4C17.5523 4 18 3.55228 18 3C18 2.44772 17.5523 2 17 2V4ZM5 7C5 6.44772 4.55228 6 4 6C3.44772 6 3 6.44772 3 7H5ZM17 7C17 6.44772 16.5523 6 16 6C15.4477 6 15 6.44772 15 7H17ZM9 7C9 6.44772 8.55228 6 8 6C7.44772 6 7 6.44772 7 7H9ZM7 13C7 13.5523 7.44772 14 8 14C8.55228 14 9 13.5523 9 13H7ZM13 13V7H11V13H13ZM9 3H11V1H9V3ZM15 7V16H17V7H15ZM15 16H5V18H15V16ZM5 16V7H3V16H5ZM3 4H8V2H3V4ZM8.29289 1.29289L7.29289 2.29289L8.70711 3.70711L9.70711 2.70711L8.29289 1.29289ZM8 4H12V2H8V4ZM12 4H17V2H12V4ZM10.2929 2.70711L11.2929 3.70711L12.7071 2.29289L11.7071 1.29289L10.2929 2.70711ZM7 7V13H9V7H7ZM5 16L5 16H3C3 17.1046 3.89543 18 5 18V16ZM15 16L15 16V18C16.1046 18 17 17.1046 17 16H15Z"}))},Zn=e=>{let{style:t}=e;return(0,le.h)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,focusable:"false"},(0,le.h)("path",{d:"M10 7C10 6.44772 9.55228 6 9 6C8.44772 6 8 6.44772 8 7H10ZM9 11H8C8 11.5523 8.44772 12 9 12V11ZM13 12C13.5523 12 14 11.5523 14 11C14 10.4477 13.5523 10 13 10V12ZM10 17C6.13401 17 3 13.866 3 10H1C1 14.9706 5.02944 19 10 19V17ZM17 10C17 13.866 13.866 17 10 17V19C14.9706 19 19 14.9706 19 10H17ZM10 3C13.866 3 17 6.13401 17 10H19C19 5.02944 14.9706 1 10 1V3ZM10 1C5.02944 1 1 5.02944 1 10H3C3 6.13401 6.13401 3 10 3V1ZM8 7V11H10V7H8ZM9 12H13V10H9V12Z"}))},Qn=n(3054),Gn=n(6756),Xn=n(1295),Jn=[];const er={},tr=(e,t,n)=>{const{enableJs:r,disableUniqueIds:i,disableCssScoping:o,spriteIconId:a,replacementColor:s,containerSize:l,scaleToFit:d}=t,c=!!a,u=(new DOMParser).parseFromString(n,"text/html"),h=c?u.getElementById(a):u.querySelector("svg"),p=(()=>{if(Jn.length)return Jn;for(const e in document.body)e.startsWith("on")&&Jn.push(e);return Jn.push("onbegin","onend","onrepeat"),Jn.push("onfocusin","onfocusout","onbounce","onfinish","onshow"),Jn})(),m=er[e.getAttribute("data-id")]||new Set,g=e.getAttribute("data-id")||`svg-loader_${Xn.incr()}`,v={};if(i||Array.from(h.querySelectorAll("[id]")).forEach((e=>{const t=e.getAttribute("id"),n=`${t}_${Xn.incr()}`;e.setAttribute("id",n),v[t]=n})),Array.from(h.querySelectorAll("*")).concat(h).forEach((t=>{if("script"===t.tagName){if(t.remove(),!r)return;{const n=document.createElement("script");n.appendChild(t.childNodes[0]),e.appendChild(n)}}const n=[];for(let e=0;e<t.attributes.length;e++){const{name:i,value:o}=t.attributes[e],a=Gn(v,o,i);o!==a&&t.setAttribute(i,a),!p.includes(i.toLowerCase())||r?["href","xlink:href","values"].includes(i)&&o.startsWith("javascript")&&!r&&n.push(i):n.push(i)}if(n.forEach((e=>t.removeAttribute(e))),"style"===t.tagName&&!o){let e=Qn(t.innerHTML,`[data-id="${g}"]`,v);e=Gn(v,e),e!==t.innerHTML&&(t.innerHTML=e)}})),e.innerHTML=a?h.outerHTML:h.innerHTML,!c)for(let t=0;t<h.attributes.length;t++){const{name:n,value:r}=h.attributes[t];e.getAttribute(n)&&!m.has(n)||(m.add(n),e.setAttribute(n,r))}er[g]=m,e.setAttribute("data-id",g),function(e,t){const n=e.querySelectorAll("*"),r=new Map,i=(e,t,n)=>{r.has(e)?r.get(e)?.set(t,n):r.set(e,(new Map).set(t,n))};n.forEach((e=>{const t=e.getAttribute("style");let n,r,o=e.getAttribute("fill"),a=e.getAttribute("stroke");t&&(n=t.match(/fill\s*:\s*([^;]+)/),r=t.match(/stroke\s*:\s*([^;]+)/));const s={...o?{fill:o}:{},...a?{stroke:a}:{},...n?{fillMatch:n}:{},...r?{strokeMatch:r}:{}};o&&i(o,e,s),a&&i(a,e,s),n&&i(n[1],e,s),r&&i(r[1],e,s)})),1===r.size&&t&&r.forEach(((e,n)=>{"currentcolor"===n.toLowerCase()&&e.forEach(((e,n)=>{if(e.fill&&n.setAttribute("fill",t),e.stroke&&n.setAttribute("stroke",t),e.fillMatch){const r=n.getAttribute("style")?.replace(e.fillMatch[0],`fill: ${t}`)??"";n.setAttribute("style",r)}if(e.strokeMatch){const r=n.getAttribute("style")?.replace(e.strokeMatch[0],`stroke: ${t}`)??"";n.setAttribute("style",r)}}))}))}(e,s),function(e,t,n){if(e.getAttribute("viewBox"))return;const r=e.getBBox({stroke:!0,fill:!0});if(r.width<=0||r.height<=0)return;const i=t&&(r.width>t||r.height>t),o=n&&t&&(r.width<t||r.height<t);(i||o)&&e.setAttribute("viewBox",`${r.x} ${r.y} ${r.width} ${r.height}`)}(e,l,d),function(e,t,n){if(e.getAttribute("viewBox"))return void(n?(e.setAttribute("width","100%"),e.setAttribute("height","100%")):t&&(e.setAttribute("width",t),e.setAttribute("height",t)));const r=e.getBBox({stroke:!0,fill:!0});n&&t&&(r.width<t||r.height<t)?(e.setAttribute("width",t),e.setAttribute("height",t)):(e.setAttribute("width",r.width),e.setAttribute("height",r.height))}(e,l,d);const f=new CustomEvent("iconload",{bubbles:!0});if(e.dispatchEvent(f),e.getAttribute("oniconload")){e.setAttribute("onauxclick",e.getAttribute("oniconload"));const t=new CustomEvent("auxclick",{bubbles:!1,view:window});e.dispatchEvent(t),e.removeAttribute("onauxclick")}},nr={},rr={},ir=async e=>{const t=new URL(e.getAttribute("data-src"),globalThis.location),n=t.toString().replace(t.hash,""),r=t.hash.replace("#",""),i="enabled"===e.getAttribute("data-js"),o="disabled"===e.getAttribute("data-unique-ids"),a="disabled"===e.getAttribute("data-css-scoping"),s=e.getAttribute("data-replacement-color"),l=e.getAttribute("data-container-size"),d="enabled"===e.getAttribute("data-scale-to-fit"),c=tr.bind(self,e,{enableJs:i,disableUniqueIds:o,disableCssScoping:a,spriteIconId:r,replacementColor:s,containerSize:l,scaleToFit:d});if(rr[n]){const e=rr[n];c(e)}else{if(nr[n])return void setTimeout((()=>ir(e)),20);nr[n]=!0,fetch(n).then((e=>{if(!e.ok)throw Error(`Request for '${n}' returned ${e.status} (${e.statusText})`);return e.text()})).then((e=>{const t=e.toLowerCase().trim();if(!(t.startsWith("<svg")||t.startsWith("<?xml")||t.startsWith("<!doctype")))throw Error(`Resource '${n}' returned an invalid SVG file`);rr[n]=e,c(e)})).catch((t=>{console.error(t);const n=new CustomEvent("iconloaderror",{bubbles:!0,detail:t.toString()});if(e.dispatchEvent(n),e.getAttribute("oniconloaderror")){Function("error",e.getAttribute("oniconloaderror"))(t)}})).finally((()=>{delete nr[n]}))}};let or;globalThis.IntersectionObserver&&(or=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(ir(e.target),or.unobserve(e.target))}))}),{rootMargin:"1200px"}));const ar=[];function sr(){Array.from(document.querySelectorAll("svg[data-src]:not([data-id])")).forEach((e=>{-1===ar.indexOf(e)&&(ar.push(e),"lazy"===e.getAttribute("data-loading")?or.observe(e):ir(e))}))}let lr=!1;if(globalThis.addEventListener){const Om=setInterval((()=>{sr()}),100);function Mm(){clearInterval(Om),sr(),(()=>{if(lr)return;lr=!0,new MutationObserver((e=>{e.some((e=>Array.from(e.addedNodes).some((e=>e.nodeType===Node.ELEMENT_NODE&&(e.getAttribute("data-src")&&!e.getAttribute("data-id")||e.querySelector("svg[data-src]:not([data-id])"))))))&&sr(),e.forEach((e=>{"attributes"===e.type&&ir(e.target)}))})).observe(document.documentElement,{attributeFilter:["data-src"],attributes:!0,childList:!0,subtree:!0})})()}"interactive"===document.readyState||"complete"===document.readyState?Mm():globalThis.addEventListener("DOMContentLoaded",(()=>{Mm()}))}function dr(e,t){for(var n in t)e[n]=t[n];return e}function cr(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}globalThis.SVGLoader={},globalThis.SVGLoader.updateMemoryCache=async(e,t)=>{rr[e]=t};var ur=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).isPureReactComponent=!0,n}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.prototype.shouldComponentUpdate=function(e,t){return cr(this.props,e)||cr(this.state,t)},r}(le.Component);function hr(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:cr(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,le.createElement)(e,dr({},t))}return r.prototype.isReactComponent=!0,r.displayName="Memo("+(e.displayName||e.name)+")",r.t=!0,r}var pr=le.options.__b;function mr(e){function t(t){var n=dr({},t);return delete n.ref,e(n,t.ref)}return t.prototype.isReactComponent=t.t=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}le.options.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),pr&&pr(e)};var gr=function(e,t){return e?(0,le.toChildArray)(e).reduce((function(e,n,r){return e.concat(t(n,r))}),[]):null},vr={map:gr,forEach:gr,count:function(e){return e?(0,le.toChildArray)(e).length:0},only:function(e){if(1!==(e=(0,le.toChildArray)(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:le.toChildArray},fr=le.options.__e;function br(e){return e&&((e=dr({},e)).__c=null,e.__k=e.__k&&e.__k.map(br)),e}function Sr(){this.__u=0,this.o=null,this.__b=null}function yr(e){var t=e.__.__c;return t&&t.u&&t.u(e)}function wr(){this.i=null,this.l=null}le.options.__e=function(e,t,n){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return r.__c(e,t.__c);fr(e,t,n)},(Sr.prototype=new le.Component).__c=function(e,t){var n=this;null==n.o&&(n.o=[]),n.o.push(t);var r=yr(n.__v),i=!1,o=function(){i||(i=!0,r?r(a):a())};t.__c=t.componentWillUnmount,t.componentWillUnmount=function(){o(),t.__c&&t.__c()};var a=function(){var e;if(! --n.__u)for(n.__v.__k[0]=n.state.u,n.setState({u:n.__b=null});e=n.o.pop();)e.forceUpdate()};n.__u++||n.setState({u:n.__b=n.__v.__k[0]}),e.then(o,o)},Sr.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=br(this.__b),this.__b=null),[(0,le.createElement)(le.Component,null,t.u?null:e.children),t.u&&e.fallback]};var kr=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(wr.prototype=new le.Component).u=function(e){var t=this,n=yr(t.__v),r=t.l.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),kr(t,e,r)):i()};n?n(o):o()}},wr.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,le.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},wr.prototype.componentDidUpdate=wr.prototype.componentDidMount=function(){var e=this;e.l.forEach((function(t,n){kr(e,n,t)}))};var Cr=function(){function e(){}var t=e.prototype;return t.getChildContext=function(){return this.props.context},t.render=function(e){return e.children},e}();function xr(e){var t=this,n=e.container,r=(0,le.createElement)(Cr,{context:t.context},e.vnode);return t.s&&t.s!==n&&(t.v.parentNode&&t.s.removeChild(t.v),(0,le._unmount)(t.h),t.p=!1),e.vnode?t.p?(n.__k=t.__k,(0,le.render)(r,n),t.__k=n.__k):(t.v=document.createTextNode(""),(0,le.hydrate)("",n),n.appendChild(t.v),t.p=!0,t.s=n,(0,le.render)(r,n,t.v),t.__k=t.v.__k):t.p&&(t.v.parentNode&&t.s.removeChild(t.v),(0,le._unmount)(t.h)),t.h=r,t.componentWillUnmount=function(){t.v.parentNode&&t.s.removeChild(t.v),(0,le._unmount)(t.h)},null}var Ir=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;le.Component.prototype.isReactComponent={};var Or="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;function Mr(e,t,n){if(null==t.__k)for(;t.firstChild;)t.removeChild(t.firstChild);return(0,le.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}var Nr=le.options.event;function Tr(e,t){e["UNSAFE_"+t]&&!e[t]&&Object.defineProperty(e,t,{configurable:!1,get:function(){return this["UNSAFE_"+t]},set:function(e){this["UNSAFE_"+t]=e}})}le.options.event=function(e){Nr&&(e=Nr(e)),e.persist=function(){};var t=!1,n=!1,r=e.stopPropagation;e.stopPropagation=function(){r.call(e),t=!0};var i=e.preventDefault;return e.preventDefault=function(){i.call(e),n=!0},e.isPropagationStopped=function(){return t},e.isDefaultPrevented=function(){return n},e.nativeEvent=e};var Fr={configurable:!0,get:function(){return this.class}},Ar=le.options.vnode;le.options.vnode=function(e){e.$$typeof=Or;var t=e.type,n=e.props;if(t){if(n.class!=n.className&&(Fr.enumerable="className"in n,null!=n.className&&(n.class=n.className),Object.defineProperty(n,"className",Fr)),"function"!=typeof t){var r,i,o;for(o in n.defaultValue&&void 0!==n.value&&(n.value||0===n.value||(n.value=n.defaultValue),delete n.defaultValue),Array.isArray(n.value)&&n.multiple&&"select"===t&&((0,le.toChildArray)(n.children).forEach((function(e){-1!=n.value.indexOf(e.props.value)&&(e.props.selected=!0)})),delete n.value),n)if(r=Ir.test(o))break;if(r)for(o in i=e.props={},n)i[Ir.test(o)?o.replace(/[A-Z0-9]/,"-$&").toLowerCase():o]=n[o]}!function(t){var n=e.type,r=e.props;if(r&&"string"==typeof n){var i={};for(var o in r)/^on(Ani|Tra|Tou)/.test(o)&&(r[o.toLowerCase()]=r[o],delete r[o]),i[o.toLowerCase()]=o;if(i.ondoubleclick&&(r.ondblclick=r[i.ondoubleclick],delete r[i.ondoubleclick]),i.onbeforeinput&&(r.onbeforeinput=r[i.onbeforeinput],delete r[i.onbeforeinput]),i.onchange&&("textarea"===n||"input"===n.toLowerCase()&&!/^fil|che|ra/i.test(r.type))){var a=i.oninput||"oninput";r[a]||(r[a]=r[i.onchange],delete r[i.onchange])}}}(),"function"==typeof t&&!t.m&&t.prototype&&(Tr(t.prototype,"componentWillMount"),Tr(t.prototype,"componentWillReceiveProps"),Tr(t.prototype,"componentWillUpdate"),t.m=!0)}Ar&&Ar(e)};function Lr(e){return!!e&&e.$$typeof===Or}const Er={useState:ve,useReducer:fe,useEffect:be,useLayoutEffect:Se,useRef:ye,useImperativeHandle:we,useMemo:ke,useCallback:function(e,t){return de=8,ke((function(){return e}),t)},useContext:Ce,useDebugValue:function(e,t){le.options.useDebugValue&&le.options.useDebugValue(t?t(e):e)},version:"16.8.0",Children:vr,render:Mr,hydrate:Mr,unmountComponentAtNode:function(e){return!!e.__k&&((0,le.render)(null,e),!0)},createPortal:function(e,t){return(0,le.createElement)(xr,{vnode:e,container:t})},createElement:le.createElement,createContext:le.createContext,createFactory:function(e){return le.createElement.bind(null,e)},cloneElement:function(e){return Lr(e)?le.cloneElement.apply(null,arguments):e},createRef:le.createRef,Fragment:le.Fragment,isValidElement:Lr,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:le.Component,PureComponent:ur,memo:hr,forwardRef:mr,unstable_batchedUpdates:function(e,t){return e(t)},Suspense:Sr,SuspenseList:wr,lazy:function(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return(0,le.createElement)(n,i)}return i.displayName="Lazy",i.t=!0,i}},jr=()=>(0,le.h)("svg",{width:"3",height:"15",viewBox:"0 0 3 15",xmlns:"http://www.w3.org/2000/svg"},(0,le.h)("path",{d:"M3 1.5C3 2.32843 2.32843 3 1.5 3C0.671573 3 0 2.32843 0 1.5C0 0.671573 0.671573 0 1.5 0C2.32843 0 3 0.671573 3 1.5Z"}),(0,le.h)("path",{d:"M3 7.5C3 8.32843 2.32843 9 1.5 9C0.671573 9 0 8.32843 0 7.5C0 6.67157 0.671573 6 1.5 6C2.32843 6 3 6.67157 3 7.5Z"}),(0,le.h)("path",{d:"M3 13.5C3 14.3284 2.32843 15 1.5 15C0.671573 15 0 14.3284 0 13.5C0 12.6716 0.671573 12 1.5 12C2.32843 12 3 12.6716 3 13.5Z"})),Dr=e=>{let{style:t}=e;return(0,le.h)("svg",{width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:"false",style:t},(0,le.h)("path",{d:"M11 8V9C10.5955 9 10.2309 8.75636 10.0761 8.38268C9.92134 8.00901 10.0069 7.57889 10.2929 7.29289L11 8ZM10.5 2.5L11.2071 3.20711L10.5 2.5ZM6 8V18H4V8H6ZM5 17H14.3604V19H5V17ZM15.341 16.1961L16.541 10.1961L18.5021 10.5884L17.3021 16.5883L15.341 16.1961ZM11.2071 3.20711L5.70711 8.70711L4.29289 7.29289L9.79289 1.79289L11.2071 3.20711ZM15.5604 9H11V7H15.5604V9ZM10.2929 7.29289L12.7929 4.79289L14.2071 6.20711L11.7071 8.70711L10.2929 7.29289ZM5 9H3V7H5V9ZM2 10V16H0V10H2ZM3 17H5V19H3V17ZM2 16C2 16.5523 2.44771 17 3 17V19C1.34315 19 0 17.6569 0 16H2ZM3 9C2.44772 9 2 9.44772 2 10H0C0 8.34315 1.34315 7 3 7V9ZM12.7929 4.79289C13.2308 4.35499 13.2308 3.64501 12.7929 3.20711L14.2071 1.79289C15.4261 3.01184 15.4261 4.98815 14.2071 6.20711L12.7929 4.79289ZM9.79289 1.79289C11.0118 0.573941 12.9882 0.573942 14.2071 1.79289L12.7929 3.20711C12.355 2.7692 11.645 2.7692 11.2071 3.20711L9.79289 1.79289ZM14.3604 17C14.8371 17 15.2475 16.6635 15.341 16.1961L17.3021 16.5883C17.0217 17.9906 15.7904 19 14.3604 19V17ZM16.541 10.1961C16.6647 9.57732 16.1914 9 15.5604 9V7C17.4535 7 18.8734 8.73198 18.5021 10.5884L16.541 10.1961Z"}))},_r=e=>{let{style:t}=e;return(0,le.h)("svg",{width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t},(0,le.h)("path",{d:"M8 11V10C8.40446 10 8.7691 10.2436 8.92388 10.6173C9.07866 10.991 8.9931 11.4211 8.70711 11.7071L8 11ZM8.5 16.5L7.79289 15.7929L8.5 16.5ZM13 11L13 1H15L15 11H13ZM14 2H4.63961V0H14V2ZM3.65903 2.80388L2.45903 8.80388L0.497866 8.41165L1.69787 2.41165L3.65903 2.80388ZM7.79289 15.7929L13.2929 10.2929L14.7071 11.7071L9.20711 17.2071L7.79289 15.7929ZM3.43961 10H8V12H3.43961V10ZM8.70711 11.7071L6.20711 14.2071L4.79289 12.7929L7.29289 10.2929L8.70711 11.7071ZM14 10H16L16 12H14L14 10ZM17 9V3H19L19 9H17ZM16 2L14 2V0L16 0V2ZM17 3C17 2.44771 16.5523 2 16 2V0C17.6569 0 19 1.34315 19 3H17ZM16 10C16.5523 10 17 9.55228 17 9H19C19 10.6569 17.6569 12 16 12L16 10ZM6.20711 14.2071C5.7692 14.645 5.7692 15.355 6.20711 15.7929L4.79289 17.2071C3.57394 15.9882 3.57394 14.0118 4.79289 12.7929L6.20711 14.2071ZM9.20711 17.2071C7.98815 18.4261 6.01184 18.4261 4.79289 17.2071L6.20711 15.7929C6.64501 16.2308 7.35499 16.2308 7.79289 15.7929L9.20711 17.2071ZM4.63961 2C4.16293 2 3.75251 2.33646 3.65903 2.80388L1.69787 2.41165C1.97832 1.00938 3.20956 0 4.63961 0V2ZM2.45903 8.80388C2.33527 9.42268 2.80856 10 3.43961 10V12C1.54647 12 0.126591 10.268 0.497866 8.41165L2.45903 8.80388Z"}))},Pr=e=>e&&e.current&&e.current.base,Hr=30,Rr=10,$r=e=>{var t,n,r,i,o,a,s,l;const d=e.getNumericalPadding("card"),c=e.getNumericalPadding("menuButton"),u=(null!==(t=c.top)&&void 0!==t?t:Rr)+Hr+(null!==(n=c.bottom)&&void 0!==n?n:Rr),h=(null!==(r=c.right)&&void 0!==r?r:Rr)+Hr+(null!==(i=c.left)&&void 0!==i?i:Rr);return{top:u>(null!==(o=d.top)&&void 0!==o?o:M)?u-(null!==(a=d.top)&&void 0!==a?a:M):0,right:h>(null!==(s=d.right)&&void 0!==s?s:O)?h-(null!==(l=d.right)&&void 0!==l?l:O):0}},Vr=e=>{var t,n,r,i;const{top:o,right:a,bottom:s,left:l}=e.getNumericalPadding("menuButton"),d=e.getNumericalPadding("card");return void 0===o&&void 0===a&&void 0===s&&void 0===l?{top:Rr-(null!==(t=d.top)&&void 0!==t?t:M),right:Rr-(null!==(n=d.right)&&void 0!==n?n:20),bottom:Rr,left:Rr}:{top:(null!=o?o:0)-(null!==(r=d.top)&&void 0!==r?r:M),right:(null!=a?a:0)-(null!==(i=d.right)&&void 0!==i?i:20),bottom:null!=s?s:0,left:null!=l?l:0}},Wr=rn("button")((e=>{let{open:t,theme:n}=e;const{top:r,right:i}=Vr(n);return Object.assign({cursor:"pointer",position:"absolute",top:`${r}px`,right:`${i}px`,width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"center",border:"0px",borderRadius:"30px",zIndex:Xs.OVERFLOW_MENU_BUTTON,background:n.getCSSColor(t?"background.optionsActive":"background.options"),"&:hover":{background:n.getCSSColor("background.optionsHover")}," > svg":{fill:n.getCSSColor(t?"icon.optionsActive":"icon.options")},"&:hover > svg":{fill:n.getCSSColor("icon.optionsHover")}},n.getElementFocusCSSProperties())})),Br=rn("button")((e=>{let{theme:t}=e;const{top:n,right:r}=Vr(t);return Object.assign({cursor:"pointer",position:"absolute",top:`${n}px`,right:`${r}px`,width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"center",border:"0px",borderRadius:"30px",zIndex:Xs.OVERFLOW_MENU_BUTTON,background:t.getCSSColor("background.options")," > svg":{stroke:t.getCSSColor("icon.options")},"&:hover":{background:t.getCSSColor("background.optionsHover")},"&:active":{background:t.getCSSColor("background.optionsActive")},"&:hover > svg":{stroke:t.getCSSColor("icon.optionsHover")},"&:active > svg":{stroke:t.getCSSColor("icon.optionsActive")}},t.getElementFocusCSSProperties())})),zr=e=>{let{theme:t,open:n,feedOrientation:r,children:i,cardRef:o,ariaLabelledBy:a}=e;const s=ye(null);let l={direction:"down",maxHeight:0,maxWidth:0};if(n){const e=t.getNumericalPadding("card"),n=Vr(t);l=((e,t,n,r,i)=>{var o,a,s,l;if(Pr(t)&&Pr(n)){const d=t.current.base,c=t.current.base.offsetParent,u=c.offsetParent,h=n.current.base,p=d.clientWidth-((null!==(o=null==r?void 0:r.left)&&void 0!==o?o:O)+(null!==(a=null==i?void 0:i.right)&&void 0!==a?a:0));if("horizontal"===e){const e=c.offsetLeft+h.offsetLeft-u.scrollLeft,t=u.clientWidth-(e>0?e:0),n=200,r=e>=n||t<n;return{direction:r?"left":"right",maxWidth:r?p:t}}const m=h.offsetTop,g=u.scrollHeight-c.offsetTop-(null!==(s=r.top)&&void 0!==s?s:M)-(m+(null!==(l=r.top)&&void 0!==l?l:M)),v=c.offsetTop,f=h.scrollHeight,b=g>=f||v<f;return{direction:b?"down":"up",maxHeight:b?g:v,maxWidth:p}}return{direction:"down",maxHeight:0,maxWidth:0}})(r,o,s,e,n),setTimeout((()=>{if(Pr(s)){const e=s.current.base.querySelector('[tabindex="0"]');if(e){e.focus()}}}),0)}return(0,le.h)(Ur,{maxHeight:`${l.maxHeight}px`,maxWidth:`${l.maxWidth}px`,open:n,theme:t,ref:s,children:i,direction:l.direction,"aria-labelledBy":a})},Ur=rn("ul")((e=>{var t,n;let{theme:r,open:i,maxHeight:o,maxWidth:a,direction:s}=e;const{top:l,right:d,bottom:c}=Vr(r),u=r.getNumericalPadding("card");let h;switch(s){case"up":h=`translateY(-100%) translateY(-${(null!=l?l:Rr)+(null!==(t=u.top)&&void 0!==t?t:M)+(null!=c?c:Rr)+Hr}px)`;break;case"down":case"left":h="translateY(0)";break;case"right":h="translateX(90%)"}return{position:"absolute",top:`${(null!=l?l:Rr)+(null!=c?c:Rr)+Hr}px`,right:`${null!=d?d:Rr}px`,width:"300px",flexShrink:"0",background:r.getCSSColor("background.sheet"),display:"flex",flexFlow:"column",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.2)",borderRadius:null!==(n=r.getShape("borderRadius.sheet",{skipFallback:!0}))&&void 0!==n?n:"5px",padding:"10px 0",overflow:"auto",listStyle:"none",margin:"0",zIndex:Xs.OVERFLOW_MENU,maxHeight:i?`${o}`:"0px",maxWidth:i?`${a}`:"0px",visibility:i?"visible":"hidden",transform:h}})),qr=rn("button")((e=>{let{theme:t}=e;return Object.assign(Object.assign(Object.assign({padding:"15px 20px",cursor:"pointer",display:"flex",flexShrink:"0",alignItems:"center",background:"transparent"},t.getCSSFontProperties("sheetItem")),{color:t.getCSSColor("text.sheetItem"),width:"100%",margin:"0 0 0 0"," svg":{fill:t.getCSSColor("icon.sheetItem")},"&:hover":{background:t.getCSSColor("background.sheetItemActive"),color:t.getCSSColor("text.sheetItemActive")},"&:hover svg":{fill:t.getCSSColor("icon.sheetItemActive")},border:"0px"}),t.getElementFocusCSSProperties())})),Yr=rn("span")((()=>({maxWidth:"240px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}))),Kr=rn("li")((e=>{let{theme:t}=e;return{borderTop:`1px solid ${t.getCSSColor("border.sheetItemDivider")}`,height:"1px",margin:"10px 0"}})),Zr=rn("li")((()=>({flexShrink:"0"}))),Qr=e=>{let{title:t,icon:n,onClick:r,theme:i,className:o}=e;const a={marginRight:"20px",minWidth:"20px"};return(0,le.h)(Zr,{role:"none"},(0,le.h)(qr,{theme:i,tabIndex:"-1",onClick:r,className:o},"bin"===n&&(0,le.h)(Kn,{style:a}),"clock"===n&&(0,le.h)(Zn,{style:a}),"thumbs-up"===n&&(0,le.h)(Dr,{style:a}),"thumbs-down"===n&&(0,le.h)(_r,{style:a}),(0,le.h)(Yr,null,t)))},Gr=32,Xr=38,Jr=40,ei=13,ti=27,ni=-1,ri=e=>{switch(e){case"ArrowUp":case"Up":return Xr;case"ArrowDown":case"Down":return Jr;case"Enter":return ei;case"Spacebar":case" ":return Gr;case"Escape":return ti;default:return ni}},ii="ArrowUp",oi="ArrowDown",ai="ArrowLeft",si="ArrowRight",li="Enter",di=" ",ci="Escape",ui="PageUp",hi="PageDown",pi="Tab",mi=rn("div")((e=>{let{theme:t}=e;return Object.assign({width:"100%",border:"0"},t.getElementFocusCSSProperties())})),gi=(e,t)=>{try{const n=vi(e)[t];return n&&"none"===n.getAttribute("role")&&n.childNodes.length>0?n.childNodes[0]:n}catch(e){return null}},vi=e=>e&&e.current&&e.current.base&&e.current.base.childNodes?[...e.current.base.childNodes].filter((e=>"true"!==e.getAttribute("aria-hidden"))):[],fi=e=>{let{defaultIndex:t,theme:n,children:r}=e;const[i,o]=ve(t||0),a=(0,le.createRef)(),s=ye(-1);be((()=>{s.current=i}));const l=s.current;return be((()=>{o(t||0)}),[t]),be((()=>{var e,t,n;-1!==l&&(null===(n=gi(a,l))||void 0===n||n.setAttribute("tabIndex","-1"));null===(e=gi(a,i))||void 0===e||e.setAttribute("tabIndex","0"),null===(t=gi(a,i))||void 0===t||t.focus()}),[i]),(0,le.h)(mi,{theme:n,className:"supports-keyboard-navigation",ref:a,onKeyDown:e=>{var t;let n=null;switch(ri(e.key)){case Jr:n=i+1;break;case Xr:n=i-1;break;case ei:case Gr:null===(t=gi(a,i))||void 0===t||t.click(),e.stopPropagation(),e.preventDefault()}var r,s;null!==n&&(r=n,s=vi(a).length,n=(r+s)%s,o(n),e.view.event.preventDefault())}},r)},bi=e=>{let{fillColor:t}=e;return(0,le.h)("svg",{width:"12",height:"12",viewBox:"0 0 12 12"},(0,le.h)("path",{d:"M1 1L6 6L11 11M1 11L11 1","stroke-width":"2","stroke-linecap":"round",stroke:t}))},Si=rn("div")((e=>{let{firstChildNodeMargin:t}=e;return Object.assign({position:"relative",height:"100%",display:"flex",flexDirection:"column"},t.right||t.top||t.left?{"& > *:nth-child(2)":Object.assign(Object.assign(Object.assign({},null!==t.right?{marginRight:`${t.right}px`}:{}),null!==t.top?{marginTop:`${t.top}px`}:{}),null!==t.left&&t.left>0?{marginLeft:`min(${t.left}px, 50%)`}:{})}:{})})),yi=rn("div")((e=>{let{theme:t,embedMode:n,margin:r,minHeight:i,maxWidth:o,feedOrientation:a,cardWidth:s}=e;const l={width:`${s}px`,marginRight:`${r}px`,marginBottom:"0px"};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({backgroundColor:t.getCSSColor("background.card"),marginBottom:`${r}px`,borderRadius:t.getShape("borderRadius.card")||"initial",boxShadow:"single-card"!==n?`0 ${t.getShape("offset.cardShadow")} ${t.getShape("blur.cardShadow")} ${t.getCSSColor("shadow.card")}`:"none",padding:`${t.getPadding("card")||"20px 20px"}`,border:`${t.getShape("border.card")||"0px"} solid ${t.getCSSColor("border.card")}`,position:"relative",minHeight:i?`${i}px`:"0px"},"horizontal"===a?l:{}),"modal-stream"===n?{width:"100%",maxWidth:o?`${o}px`:"initial"}:{}),Cl(t,n,a).cardCompletion),Cl(t,n,a).dismissal),Cl(t,n,a).snooze),{".submitting, .submitted, .submitted-subview":{border:"0"}})})),wi=rn("div")((e=>{let{theme:t,dimensions:n,horizontalFeedCenterAlign:r,leftPosition:i,feedOrientation:o,embedMode:a,cardHorizontalAlignment:s}=e;const l=t.getNumericalPadding("stream"),d=Object.assign({width:n.width,display:"flex",flexShrink:"0",scrollSnapAlign:"center",".fixed-position":{position:"unset",left:`${i?i/2+i:0}px`}},r&&{left:"50%",transform:"translateX(-50%)"}),c={width:"100%",display:"flex",justifyContent:{leading:"flex-start",center:"center",trailing:"flex-end"}[null!=s?s:"center"],alignItems:"center"};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({height:n.height},"horizontal"===o?d:{}),"modal-stream"===a?c:{}),xl(l,a,o).cardCompletion),xl(l,a,o).dismissal),xl(l,a,o).snooze),xl(l,a,o).center)})),ki=rn("div")((()=>({})));var Ci;!function(e){e.menu="menu",e.dismiss="dismiss",e.hidden="hidden"}(Ci||(Ci={}));const xi=hr((e=>{let{containerInstanceId:t,cardInstanceId:n,children:r,theme:i,embedMode:o,animationState:a,cardFeedOverlayDisplayed:s,onDismiss:l,onSnooze:d,onFeedbackSelected:c,removeCard:u,customStrings:h,margin:p,horizontalFeedCenterAlign:m,accessibilityRole:g,actions:v,votingOptions:f,cardMinimumHeight:b,cardMaximumWidth:S,cardHorizontalAlignment:y,horizontalContainerConfig:w}=e;const[k,C]=ve(!1),x=ye(k),I=e=>{x.current=e,C(e)},[O,M]=ve({height:"auto",width:"auto"}),[N,T]=ve(0),F=ye(null),A=ye(null),L=ye(null),E=`card-overflow-menu-${n}`,j=Bh(w);Se((()=>{A.current&&A.current.base&&("submitted"===a||"submitted-subview"===a||"dismissed"===a||"snoozed"===a?(M({height:A.current.base.offsetHeight+("horizontal"!==j?p:0)-1+"px",width:`${A.current.base.offsetWidth+p}px`}),"horizontal"===j&&"center"===(null==w?void 0:w.lastCardAlignment)?(Gt().fixPositionRemainingCard(n),T(L.current.base.offsetLeft),setTimeout((()=>{Gt().centerRemainingCard(n)}),200),setTimeout((()=>{u()}),Nl(a))):setTimeout((()=>{u()}),Nl(a))):M({height:"auto",width:"auto"})),L.current&&L.current.base&&(T("fixed-position"===a?L.current.base.offsetLeft:0),"centering"===a&&setTimeout((()=>{Gt().removeCardState(n)}),Nl(a)))}),[a,A.current,L.current]),be((()=>{const e=e=>{var t;(null===(t=F.current)||void 0===t?void 0:t.base)&&!F.current.base.contains(e.target)&&I(!1)};document.addEventListener("mousedown",e);const t=e=>{if(x.current&&("Tab"===e.key&&I(!1),"Escape"===e.key&&x.current)){const e=document.getElementById(E);I(!1),null==e||e.focus()}};return document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}}),[n]);const{dismiss:{overflow:D},snooze:{overflow:_},voteUp:{overflow:oe,feedback:ae,feedbackLabel:se},voteDown:{overflow:de,feedback:ce,feedbackLabel:ue}}=v,he={voteUp:!0===(null==f?void 0:f.canVoteUseful)||oe,voteDown:!0===(null==f?void 0:f.canVoteNotUseful)||de};let pe=Ci.hidden;he.voteUp||he.voteDown||_?pe=Ci.menu:D&&(pe=Ci.dismiss);const me=(he.voteUp||he.voteDown)&&(D||_),ge=((e,t,n)=>{var r,i;if(!n||!t||0===t.length)return{top:0,right:0,left:0};const o=t=>{if(!t)return{top:0,right:0,left:0};const n=Array.isArray(t)?t[0]:t;switch(null==n?void 0:n.type){case V:case W:{var r;const t=null==n||null===(r=n.attributes)||void 0===r?void 0:r.format;return"banner"===t?{top:null,right:null,left:null}:"text"===t?{top:0,right:$r(e).right,left:0}:{top:$r(e).top,right:0,left:0}}case B:case z:case U:case q:case Y:case K:case Z:case Q:case J:case ee:case te:case ne:case re:case ie:return{top:$r(e).top,right:0,left:0};case P:case $:return{top:0,right:$r(e).right,left:0};case H:{var i;const t=$r(e).right,r="h2"===(s=null==n||null===(i=n.attributes)||void 0===i?void 0:i.appearance)?"H2":"h3"===s?"H3":"",o=e.getCSSFontProperties(`headline${r}`);return{top:0,right:t,left:"center"===(null==o?void 0:o.textAlign)?t:0}}case R:{var a;const t=$r(e).right,r=(e=>"secondaryVariant"===e?"Secondary":"tertiaryVariant"===e?"Tertiary":"")(null==n||null===(a=n.attributes)||void 0===a?void 0:a.appearance),i=e.getCSSFontProperties(`body${r}`);return{top:0,right:t,left:"center"===(null==i?void 0:i.textAlign)?t:0}}case G:case X:return o(null==n?void 0:n.children);default:return{top:null,right:null,left:null}}var s},a=null===(r=t[0])||void 0===r||null===(i=r.props)||void 0===i?void 0:i.node;return o(a)})(i,r||[],pe!==Ci.hidden);return(0,le.h)(wi,{theme:i,ref:L,id:n,dimensions:O,feedOrientation:j,embedMode:o,horizontalFeedCenterAlign:m,leftPosition:N,cardHorizontalAlignment:y,class:a,role:g},(0,le.h)(yi,{theme:i,embedMode:o,class:`card-content ${a||""}`,ref:A,margin:p,minHeight:b,maxWidth:S,feedOrientation:j,cardWidth:null==w?void 0:w.cardWidth,inert:s},(0,le.h)(Si,{firstChildNodeMargin:ge,class:"card-nodes"},pe===Ci.menu&&(0,le.h)(ki,{ref:F},(0,le.h)(Wr,{class:"overflow-action",theme:i,open:k,tabIndex:"0",ariaLabel:"Card overflow menu",id:E,ariaHasPopup:"true",ariaExpanded:k,onClick:e=>{e.target&&e.target.focus(),I(!k)}},(0,le.h)(jr,null)),(0,le.h)(zr,{theme:i,ariaLabelledBy:E,open:k,feedOrientation:j,cardRef:A},(0,le.h)(fi,{theme:i},he.voteUp&&(0,le.h)(Qr,{onClick:()=>{c({sentiment:"positive",textFeedback:ae,textFeedbackLabel:se,source:"overflow-menu"}),I(!1)},theme:i,title:(null==h?void 0:h.votingUsefulTitle)||"This is useful",icon:"thumbs-up",className:"vote-up-action"}),he.voteDown&&(0,le.h)(Qr,{onClick:()=>{c({sentiment:"negative",textFeedback:ce,textFeedbackLabel:ue,source:"overflow-menu"}),I(!1)},theme:i,title:(null==h?void 0:h.votingNotUsefulTitle)||"This isn't useful",icon:"thumbs-down",className:"vote-down-action"}),me&&(0,le.h)(Kr,{theme:i,className:"card-overflow-divider","aria-hidden":"true"}),_&&(0,le.h)(Qr,{onClick:()=>{d(),I(!1)},theme:i,title:(null==h?void 0:h.cardSnoozeTitle)||"Remind me",icon:"clock",className:"snooze-action"}),D&&(0,le.h)(Qr,{onClick:()=>{l(),I(!1)},theme:i,title:(null==h?void 0:h.cardDismissTitle)||"Dismiss",icon:"bin",className:"dismiss-action"})))),pe===Ci.dismiss&&(0,le.h)(Br,{ariaLabel:"Dismiss card",theme:i,tabIndex:"0",onClick:l,className:"dismiss-button"},(0,le.h)(bi,null)),r),(0,le.h)(ml,{theme:i,animationState:a})),(0,le.h)(wl,{viewState:"topview",onCancelUpload:()=>{window.AtomicUploadService.cancelUploadForCard(t,n),Gt().finishCardFileUpload(n),!window.AtomicUploadService.getIsUploadingStatus(t)&&Gt().setCardFeedOverlay(!1)},theme:i,renderOverlay:"uploading-files"===a,cardMaximumWidth:S,cardHorizontalAlignment:y,spaceBetweenCards:p}),(0,le.h)(gl,{theme:i,animationState:a}))}),((e,t)=>0==t.isPreview&&e.animationState===t.animationState&&e.cardInstanceId===t.cardInstanceId&&e.runtimeVariables===t.runtimeVariables&&e.theme===t.theme)),Ii=rn("div")((e=>{let{embedMode:t,feedOrientation:n,snapScroll:r,theme:i}=e;const o={position:"relative",display:"flex",flexDirection:"row nowrap",alignItems:"stretch",flexShrink:"0",padding:i.getPadding("stream")||"10px",overflowX:"auto",scrollSnapType:r?"x mandatory":"none"};return Object.assign(Object.assign({},"modal-stream"===t?{height:"100%",width:"100%",padding:"0"}:{}),"horizontal"===n?o:{})})),Oi=Er.forwardRef(((e,t)=>{let{cardInstances:n,theme:r,isPreview:i,onDismiss:o,onSnooze:a,onFeedbackSelected:s,removeCard:l,cardStates:d,margin:c,runtimeVariables:u,customStrings:h,votingOptions:p,horizontalContainerConfig:m}=e;const g=k().getState();let v=n;g.application.cardLimit&&(v=v.slice(0,g.application.cardLimit));const f=Bh(m);return(0,le.h)(Ii,{embedMode:g.application.embedMode,feedOrientation:f,snapScroll:"free"!==(null==m?void 0:m.scrollMode),class:"card-list",ref:t,theme:r},v.map(((e,t)=>{if(e.defaultView){var b;let S=null==u||null===(b=u.values)||void 0===b?void 0:b.get(e.instance.id);S=S||new Map;const y=1===v.length&&"horizontal"===f&&"center"===(null==m?void 0:m.lastCardAlignment);e.defaultView.nodes=Lh(e.defaultView.nodes);let w=0;if(v.length>1&&t!==n.length-1){const e=mn(r.getShape("spaceBetweenCards.global",{skipFallback:!0}));w=null!=e?e:c}return(0,le.h)(xi,{key:e.instance.id,cardInstanceId:e.instance.id,containerInstanceId:g.application.containerInstanceId,theme:r,isPreview:i,embedMode:g.application.embedMode,animationState:d[e.instance.id],cardFeedOverlayDisplayed:g.cardFeed.displayingOverlay,onDismiss:()=>{o(e.instance.id)},onSnooze:()=>{a(e.instance.id,e.metadata.expires)},onFeedbackSelected:t=>{s(t,e.instance.id)},removeCard:()=>{l(e.instance.id)},runtimeVariables:S,customStrings:h,margin:w,horizontalFeedCenterAlign:y,accessibilityRole:"listitem",actions:e.actions,votingOptions:p,cardMinimumHeight:g.cardFeed.cardMinimumHeight,cardMaximumWidth:g.cardFeed.cardMaximumWidth,cardHorizontalAlignment:g.cardFeed.cardHorizontalAlignment,horizontalContainerConfig:m},e.defaultView.nodes.map(((t,n)=>{var i,o,a;const s=null===(i=e.defaultView)||void 0===i?void 0:i.nodes[e.defaultView.nodes.length-1],l="form"===s.type?s:void 0,d=null==l||null===(o=l.children)||void 0===o?void 0:o.find((e=>"actionButtonGroup"===e.type));return(0,le.h)(Ih,{cardInstanceId:e.instance.id,cardMetadata:e.metadata,node:t,cardContext:{nodeCount:(null===(a=e.defaultView)||void 0===a?void 0:a.nodes.length)||0,hasButtonFinalNode:void 0!==l,hasButtons:void 0!==(null==d?void 0:d.children)&&d.children.length>0},index:n,isWorkflow:!1,theme:r,runtimeVariables:S,feedOrientation:f,embedMode:g.application.embedMode})})))}return null})))})),Mi=rn("button")((e=>{let{theme:t}=e;return Object.assign({justifySelf:"end",alignSelf:"center",border:"0px",borderRadius:"999px",width:"40px",height:"40px",display:"flex",flexBasis:"40px",flex:"none",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:"transparent",":hover":{backgroundColor:"rgba(0, 0, 0, 0.05)",transition:"background-color 0.1s ease"},":active":{backgroundColor:"rgba(0, 0, 0, 0.1)"}},t.getElementFocusCSSProperties())})),Ni={settings:e=>{let{fillColor:t}=e;return(0,le.h)("svg",{fill:t,width:"18",height:"14",viewBox:"0 0 18 14"},(0,le.h)("path",{d:"M17 4C17.5523 4 18 3.55228 18 3C18 2.44772 17.5523 2 17 2V4ZM1 2C0.447715 2 0 2.44772 0 3C0 3.55228 0.447715 4 1 4V2ZM17 12C17.5523 12 18 11.5523 18 11C18 10.4477 17.5523 10 17 10V12ZM1 10C0.447715 10 0 10.4477 0 11C0 11.5523 0.447715 12 1 12V10ZM13 3C13 3.55228 12.5523 4 12 4V6C13.6569 6 15 4.65685 15 3H13ZM12 4C11.4477 4 11 3.55228 11 3H9C9 4.65685 10.3431 6 12 6V4ZM11 3C11 2.44772 11.4477 2 12 2V0C10.3431 0 9 1.34315 9 3H11ZM12 2C12.5523 2 13 2.44772 13 3H15C15 1.34315 13.6569 0 12 0V2ZM14 4H17V2H14V4ZM10 2H1V4H10V2ZM7 11C7 11.5523 6.55228 12 6 12V14C7.65685 14 9 12.6569 9 11H7ZM6 12C5.44772 12 5 11.5523 5 11H3C3 12.6569 4.34315 14 6 14V12ZM5 11C5 10.4477 5.44772 10 6 10V8C4.34315 8 3 9.34315 3 11H5ZM6 10C6.55228 10 7 10.4477 7 11H9C9 9.34315 7.65685 8 6 8V10ZM8 12H17V10H8V12ZM4 10H1V12H4V10Z"}))},arrowLeft:e=>{let{fillColor:t}=e;return(0,le.h)("svg",{stroke:t,width:"14",height:"12",viewBox:"0 0 14 12"},(0,le.h)("path",{d:"M6 11L1 6M1 6L6 1M1 6L13 6","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},cross:bi},Ti=e=>{let{title:t,iconName:n,onClick:r,theme:i}=e;const o=Ni[n];return(0,le.h)(Mi,{onClick:r,tabIndex:"0",ariaLabel:t,theme:i,className:`button-${n}`},(0,le.h)(o,{fillColor:i.getCSSColor("text.navigationAction")}))},Fi=rn("div")((e=>{let{theme:t,feedOrientation:n,cardBorderRadius:r}=e;return Object.assign({padding:"10px 20px 10px 15px",display:"flex",alignItems:"center",backgroundColor:t.getCSSColor("background.navigation"),zIndex:Xs.HEADER,boxShadow:`0 ${t.getShape("offset.navigationShadow")} ${t.getShape("blur.navigationShadow")} ${t.getCSSColor("shadow.navigation")}`,borderTopLeftRadius:r||"initial",borderTopRightRadius:r||"initial"},"horizontal"===n?{padding:"10px"}:{})})),Ai=rn("h1")((e=>{let{theme:t,feedOrientation:n,alignment:r="left"}=e;const i={paddingLeft:"0",textAlign:r};return Object.assign(Object.assign({alignSelf:"center",paddingLeft:"10px",flexGrow:"1",color:t.getCSSColor("text.navigationTitle")},"horizontal"===n?i:{}),t.getCSSFontProperties("navigationTitle"))})),Li=Er.forwardRef(((e,t)=>{let{theme:n,title:r,actionHandler:i,feedOrientation:o,alignment:a,inert:s,cardBorderRadius:l}=e;return(0,le.h)(Fi,{theme:n,cardBorderRadius:l,feedOrientation:o,ref:t,inert:s},i&&(0,le.h)(Ti,{title:"Back",onClick:i,iconName:"arrowLeft",theme:n}),(0,le.h)(Ai,{theme:n,feedOrientation:o,alignment:a},r))})),Ei=e=>{let{theme:t,title:n,actionHandler:r,inert:i}=e;return(0,le.h)(Fi,{theme:t,inert:i},(0,le.h)(Ai,{theme:t},n),r&&(0,le.h)(Ti,{title:"Close",onClick:r,iconName:"cross",theme:t}))},ji=rn("div")((e=>{let{theme:t,hasRetry:n,feedOrientation:r}=e;const i={maxWidth:"380px",flexGrow:"1"};return Object.assign(Object.assign(Object.assign({},t.getElementFocusCSSProperties()),{margin:"10px",background:t.getCSSColor("background.toast"),padding:"20px",border:"0px",borderRadius:"10px",display:"flex",flexDirection:"row",pointerEvents:"auto",cursor:!n&&"pointer",transform:"translateY(100%) translateY(50px)",transition:"300ms transform ease-in-out 300ms",".visible":{transform:"translateY(0)"}}),"horizontal"===r?i:{})})),Di=rn("div")((e=>{let{feedOrientation:t}=e;return Object.assign({position:"absolute",bottom:"0",left:"0",right:"0",overflow:"hidden",pointerEvents:"none",zIndex:Xs.TOAST},"horizontal"===t?{display:"flex",justifyContent:"center"}:{})})),_i=rn("p")((e=>{let{theme:t}=e;return Object.assign({flexGrow:"1",margin:"0",userSelect:"none",webkitUserSelect:"none",color:t.getCSSColor("text.toast")},t.getCSSFontProperties("toast"))})),Pi=rn("span")((e=>{let{theme:t,hasRetry:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign({border:"0px"},t.getElementFocusCSSProperties()),{color:t.getCSSColor("text.toastAction")}),t.getCSSFontProperties("toastAction")),{cursor:n&&"pointer",background:"transparent",padding:"0",userSelect:"none",webkitUserSelect:"none",display:"flex",alignItems:"center"})})),Hi=(e,t)=>new Promise((n=>{t(setTimeout((()=>{n(void 0)}),e))})),Ri=e=>{var t;let{theme:n,feedOrientation:r,message:i,actionTitle:o,actionHandler:a,onDismiss:s,delay:l=0}=e;const[d,c]=ve(!1),[u,h]=ve(""),[p,m]=ve(null),[g,v]=ve(""),f=null==i?void 0:i.messageId,b="Try again"===o,S=(null===(t=k().getState().application.enabledUiElements.toastConfig)||void 0===t?void 0:t.timeout)||2e3;be((()=>{null!=(null==i?void 0:i.messageId)&&u!=i.messageId&&(h(i.messageId),i.text&&v(i.text),null!=p&&(clearTimeout(p),m(null)),Hi(l,m).then((()=>(c(!0),Hi(S+600,m)))).then((()=>(c(!1),Hi(600,m)))).then((()=>{s&&(s(),v(""))})))}),[f]);const y=()=>{c(!1),a?a():v("")},w=e=>{const t=e.keyCode;13!==t&&32!==t||y()};return(0,le.h)(Di,{id:"action-cards-sdk-toast-wrapper",class:"floating",feedOrientation:r},void 0!==i&&(0,le.h)(ji,{id:"toast-body",theme:n,feedOrientation:r,hasRetry:b,onClick:b?void 0:y,onKeyUp:b?void 0:w,tabIndex:d&&!b?0:-1,class:d?"visible":"",role:d?"alert":void 0},(0,le.h)(_i,{theme:n,class:"toast-message"},g||""),b&&(0,le.h)(Pi,{theme:n,class:"toast-action",hasRetry:b,onClick:b?y:void 0,onKeyUp:b?w:void 0,tabIndex:d&&b?0:-1},o)))},$i=e=>{let{fillColor:t}=e;return(0,le.h)("svg",{width:"79",height:"53",viewBox:"0 0 79 53",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,le.h)("path",{d:"M20.0172 47.9056C20.0172 49.5625 21.3604 50.9056 23.0172 50.9056H73.0172C74.6741 50.9056 76.0172 49.5625 76.0172 47.9056V17.9056C76.0172 16.2488 74.6741 14.9056 73.0172 14.9056V12.9056C75.7786 12.9056 78.0172 15.1442 78.0172 17.9056V47.9056C78.0172 50.667 75.7786 52.9056 73.0172 52.9056H23.0172C20.2558 52.9056 18.0172 50.667 18.0172 47.9056H20.0172Z",fill:t}),(0,le.h)("path",{d:"M68.0172 9.90561H59.5V7.90561H68.0172C70.7786 7.90561 73.0172 10.1442 73.0172 12.9056V42.9056C73.0172 45.667 70.7786 47.9056 68.0172 47.9056H18.0172V45.9056H68.0172C69.6741 45.9056 71.0172 44.5625 71.0172 42.9056V12.9056C71.0172 11.2488 69.6741 9.90561 68.0172 9.90561Z",fill:t}),(0,le.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M54.5117 2.83786L5.27133 11.5203C3.63965 11.808 2.55015 13.3639 2.83786 14.9956L8.0473 44.5399C8.33501 46.1715 9.89098 47.2611 11.5227 46.9733L60.7631 38.2909C62.3947 38.0032 63.4842 36.4472 63.1965 34.8156L57.9871 5.27133C57.6994 3.63965 56.1434 2.55015 54.5117 2.83786ZM4.92404 9.55065C2.20457 10.0302 0.388724 12.6235 0.86824 15.3429L6.07769 44.8872C6.5572 47.6066 9.15049 49.4225 11.87 48.943L61.1104 40.2605C63.8298 39.781 65.6457 37.1877 65.1662 34.4683L59.9567 4.92404C59.4772 2.20457 56.8839 0.388724 54.1644 0.86824L4.92404 9.55065Z",fill:t}),(0,le.h)("path",{d:"M28.2341 24.1607C27.7817 23.8439 27.1582 23.9539 26.8414 24.4063C26.5246 24.8587 26.6346 25.4822 27.087 25.799L28.2341 24.1607ZM32.2944 28.2245L31.7208 29.0436C32.1732 29.3604 32.7967 29.2505 33.1135 28.7981L32.2944 28.2245ZM39.6028 19.5304C39.9196 19.078 39.8096 18.4545 39.3572 18.1377C38.9048 17.8209 38.2813 17.9309 37.9645 18.3833L39.6028 19.5304ZM27.087 25.799L31.7208 29.0436L32.8679 27.4053L28.2341 24.1607L27.087 25.799ZM33.1135 28.7981L39.6028 19.5304L37.9645 18.3833L31.4752 27.6509L33.1135 28.7981Z",fill:t}))},Vi=e=>{let{fillColor:t}=e;return(0,le.h)("svg",{width:"42",height:"42",viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,le.h)("path",{d:"M40 21C40 31.4934 31.4934 40 21 40V42C32.598 42 42 32.598 42 21H40ZM21 40C10.5066 40 2 31.4934 2 21H0C0 32.598 9.40202 42 21 42V40ZM2 21C2 10.5066 10.5066 2 21 2V0C9.40202 0 0 9.40202 0 21H2ZM21 2C31.4934 2 40 10.5066 40 21H42C42 9.40202 32.598 0 21 0V2Z",fill:t}),(0,le.h)("path",{d:"M16.7071 20.2929C16.3166 19.9024 15.6834 19.9024 15.2929 20.2929C14.9024 20.6834 14.9024 21.3166 15.2929 21.7071L16.7071 20.2929ZM20 25L19.2929 25.7071C19.6834 26.0976 20.3166 26.0976 20.7071 25.7071L20 25ZM28.7071 17.7071C29.0976 17.3166 29.0976 16.6834 28.7071 16.2929C28.3166 15.9024 27.6834 15.9024 27.2929 16.2929L28.7071 17.7071ZM15.2929 21.7071L19.2929 25.7071L20.7071 24.2929L16.7071 20.2929L15.2929 21.7071ZM20.7071 25.7071L28.7071 17.7071L27.2929 16.2929L19.2929 24.2929L20.7071 25.7071Z",fill:t}))},Wi=rn("div")((()=>({width:"100%",display:"flex",flexFlow:"column wrap",alignItems:"center",justifyContent:"center",minHeight:"250px"}))),Bi=rn("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({padding:"20px 20px 0 20px",color:t.getCSSColor("text.listEmptyState")},t.getCSSFontProperties("listEmptyState")),{textAlign:"center",width:"100%"})})),zi=e=>{let{hasSeenTutorial:t,tutorialMessage:n,emptyMessage:r,theme:i}=e;return(0,le.h)(Wi,null,t?(0,le.h)(le.Fragment,null,(0,le.h)(Vi,{fillColor:i.getCSSColor("icon.listEmptyState")}),(0,le.h)(Bi,{theme:i},r||"All caught up")):(0,le.h)(le.Fragment,null,(0,le.h)($i,{fillColor:i.getCSSColor("icon.listEmptyState")}),(0,le.h)(Bi,{theme:i},n||"Cards will appear here when there’s something to action.")))},Ui=e=>{let{title:t,textColor:n,buttonColor:r,theme:i,onRetry:o,tryAgainTitle:a}=e;return(0,le.h)(le.Fragment,null,(0,le.h)(Yi,{textColor:n,theme:i},t),(0,le.h)(Ki,{textColor:r,theme:i,onClick:o},null!=a?a:"Try again"))},qi=rn("div")((e=>{let{background:t,embedMode:n}=e;return{display:"flex",width:"100%",height:"launcher"===n?"350px":"100%",minHeight:"250px",alignItems:"center",justifyContent:"center",flexFlow:"column nowrap",background:t,font:`16px ${dn}`}})),Yi=rn("p")((e=>{let{textColor:t,theme:n}=e;return Object.assign(Object.assign({color:(null==n?void 0:n.getCSSColor("text.errorOverlayTitle"))||t},(null==n?void 0:n.getCSSFontProperties("errorOverlayTitle"))||{}),{textAlign:"center"})})),Ki=rn("button")((e=>{let{textColor:t,theme:n}=e;return Object.assign({color:(null==n?void 0:n.getCSSColor("text.errorOverlayAction"))||t,font:`16px ${dn}`,background:"transparent",border:"0",outline:"none",fontWeight:"bold",cursor:"pointer"},(null==n?void 0:n.getCSSFontProperties("errorOverlayAction"))||{})})),Zi=e=>{let{embedMode:t,state:n,onRetry:r,loadingIconColor:i,textColor:o,buttonColor:a,backgroundColor:s,theme:l,noInternetConnectionMessage:d,dataLoadFailedMessage:c,tryAgainTitle:u}=e;return"single-card"===t||"preview"===t||"modal-subview"===t?null:(0,le.h)(qi,{background:s,className:"loading-wrapper",embedMode:t},!n&&(0,le.h)(kn,{stopColor:(null==l?void 0:l.getCSSColor("icon.loadingSpinner"))||i||"#000000",size:32}),"apiError"===n&&(0,le.h)(Ui,{title:null!=c?c:"Couldn't load data",textColor:o,buttonColor:a,theme:l,onRetry:r,tryAgainTitle:u}),"noInternet"===n&&(0,le.h)(Ui,{title:null!=d?d:"No internet connection",textColor:o,buttonColor:a,theme:l,onRetry:r,tryAgainTitle:u}))};let Qi;!function(e){e.DISMISSED="dismissed",e.DISMISS_FAILED="dismiss-failed",e.SUBMITTED="submitted",e.SUBMIT_FAILED="submit-failed",e.SNOOZED="snoozed",e.SNOOZE_FAILED="snooze-failed",e.VOTED_USEFUL="voted-useful",e.VOTED_NOT_USEFUL="voted-not-useful"}(Qi||(Qi={}));const Gi=(0,le.createContext)({cardEventDispatcher:{dispatchCardEvent:e=>{}},analyticsDispatcher:{sendEvent:e=>{}},authTokenProvider:{requestToken:()=>Promise.resolve(void 0)},runtimeVariableResolver:void 0});var Xi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const Ji="action-cards-sdk-overflow-container",eo=rn("div")((e=>{let{theme:t,rendersBackground:n,embedMode:r}=e;return Object.assign({display:"flex",flexDirection:"column",height:"100%",backgroundColor:n?t.getCSSColor("background.default"):"transparent"},"modal-stream"===r?{width:"100%",height:"auto"}:{})})),to=rn("div")((e=>{let{embedMode:t}=e;return{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",zIndex:Xs.FEED_OVERLAY,backgroundColor:"rgba(0, 0, 0, 0.4)",borderRadius:"launcher"===t?"20px":"0"}})),no=rn("div")((e=>{let{embedMode:t}=e;return{width:"100%",position:"absolute",top:"0px",left:"0px",zIndex:Xs.CUSTOM_HEADER,overflow:"hidden",borderRadius:"launcher"===t?"20px 20px 0 0":"0"}})),ro=rn("div")((e=>{let{scrollPosition:t,scrollbarWidth:n,headerOffset:r}=e;return{width:"100%",marginTop:`${r}px`,paddingRight:`${n}px`,transform:`translateY(-${t}px)`}})),io=rn("div")((e=>{let{embedMode:t,feedOrientation:n,headerPadding:r,theme:i,isEmptyState:o,isLoadingState:a}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({padding:"single-card"===t?i.getPadding("stream")||"0px":i.getPadding("stream")||"10px"},r?{paddingTop:`${r+10}px`}:{}),{overflowX:"hidden",overflowY:"auto",maxHeight:"100%",height:"standalone"===t?"100%":"auto",position:"relative"}),"horizontal"===n?{padding:"0",overflowY:"auto"}:{}),o||a?{padding:"10px"}:{}),"modal-stream"===t?{padding:"0px"}:{})})),oo=rn("div")((e=>{let{embedMode:t,feedOrientation:n,horizontalOffset:r}=e;const i={position:"relative",bottom:r&&`${r}px`};return Object.assign({height:"standalone"===t?"100%":"350px",display:"flex",flexFlow:"row wrap",justifyItems:"center",alignItems:"center"},"horizontal"===n?i:{})})),ao={scrollTop:0,lastScrollTimeout:null,lastCardIds:[]},so=e=>{const t=e.messages.cardList,n=e.cardFeed.cardInstances,r=e.cardStates,{enabled:i,emptyStyle:o}=e.cardFeed.horizontalContainerConfig||{};return t&&1===n.length&&i&&"shrink"===o?0:t&&["submitted-subview"].includes(r[t.cardInstanceId]||"")?1100:800},lo=e=>{let{theme:n,onRetry:r}=e;const i=ye(null),o=ye(null),a=ye(null),s=ye(null),l=ye(null),[d,c]=ve(0),[u,h]=ve(0),p=Ce(Gi),m=p.analyticsDispatcher,g=p.cardEventDispatcher,v=p.authTokenProvider;return be((()=>(l.current=new IntersectionObserver(((e,t)=>{const n=zh();let r=[];e.forEach((e=>{if(e.isIntersecting){const t=e.target.id;n.add(t),ao.lastCardIds.includes(t)||r.push(t)}})),r.forEach((e=>{const t=k().getState().cardFeed.cardInstances.find((t=>t.instance.id===e)),n=null==t?void 0:t.metadata.payloadMetadata;m.sendEvent(Object.assign({cardInstanceId:e,cardViewState:"topview",eventName:ct},n?{properties:n}:{}))}));const i=JSON.stringify(Array.from(n));sessionStorage.setItem(_,i),ao.lastCardIds=r}),{root:null,rootMargin:"0px",threshold:0}),()=>{var e;null===(e=l.current)||void 0===e||e.disconnect()})),[]),(0,le.h)(Te.lj,{actions:(0,t.Y2)(tt,Fe,Zt)},(e=>{var t,p,f,b,S,y,w,k,C,x;const{embedMode:I,enabledUiElements:O,customStrings:M,open:N}=e.application,T="preview"===I,F="single-card"===I,A="single-card"!==I&&"modal-stream"!==I,L=("standalone"===I||"launcher"===I)&&e.cardFeed.displayingOverlay,E=e.cardFeed.horizontalContainerConfig,j=!("modal-stream"===I||F||"standalone"===I&&(null==E?void 0:E.enabled)&&"shrink"===(null==E?void 0:E.emptyStyle)),D=!e.application.isPreview&&!F&&"modal-stream"!==I&&!0===O.cardListToast&&!O.customToastContainer,_=Bh(E),P=e.cardFeed.cardInstances.length,H="horizontal"===_&&O.cardListHeader&&"left"===(null==E?void 0:E.headerAlignment)&&(null!==(t=null===(p=o.current)||void 0===p||null===(f=p.base)||void 0===f?void 0:f.scrollHeight)&&void 0!==t?t:0)/2,R=()=>{if(s.current&&s.current.base&&l.current){var e;(null===(e=s.current)||void 0===e?void 0:e.base.childNodes).forEach((e=>{var t;null===(t=l.current)||void 0===t||t.observe(e)}))}};return be((()=>{N&&R()}),[e.cardFeed.updateId]),be((()=>{N&&(ao.lastCardIds=[],R(),m.sendEvent({cardViewState:"topview",eventName:gt,properties:{displayMode:F?"single":"stream"}}))}),[N]),be((()=>{var e,t;h(null==o||null===(e=o.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.scrollHeight)}),[o]),be((()=>{const e=window.frameElement,t=n.getCSSColor("background.default");"standalone"===I&&(null==E?void 0:E.enabled)&&"shrink"===(null==E?void 0:E.emptyStyle)&&(e.style.backgroundColor=t);const r=()=>{"visible"===document.visibilityState&&N&&R()};return window.addEventListener("visibilitychange",r),()=>{window.removeEventListener("visibilitychange",r)}}),[]),be((()=>{ao.lastCardIds=[];let e=e=>{let t=!1;t||(window.requestAnimationFrame((()=>{var n;const r=e.target;!1!==(null===(n=O.customContainerHeader)||void 0===n?void 0:n.scrollHeader)&&c(r.scrollTop),t=!1})),t=!0),ao.scrollTop=e.target.scrollTop};return i.current&&i.current.base&&(i.current.base.scrollTop=ao.scrollTop,i.current.base.addEventListener("scroll",e)),()=>{i.current&&i.current.base&&(ao.scrollTop=i.current.base.scrollTop,i.current.base.removeEventListener("scroll",e))}}),[]),(0,le.h)(eo,{theme:n,id:Ji,rendersBackground:A,embedMode:I},L&&(0,le.h)(to,{class:"use-offset",embedMode:I}),A&&O.cardListHeader&&(0,le.h)(Li,{title:M.cardListTitle||"Cards",theme:n,feedOrientation:_,ref:o,alignment:null==E?void 0:E.headerAlignment}),O.customContainerHeader&&("standalone"===I||"launcher"===I)&&(0,le.h)(no,{embedMode:I},(0,le.h)(ro,{ref:a,headerOffset:u,scrollbarWidth:(null==i||null===(b=i.current)||void 0===b||null===(S=b.base)||void 0===S?void 0:S.offsetWidth)-(null==i||null===(y=i.current)||void 0===y||null===(w=y.base)||void 0===w?void 0:w.clientWidth),scrollPosition:d,dangerouslySetInnerHTML:{__html:null===(k=document.getElementById("custom-container-header"))||void 0===k?void 0:k.innerHTML}})),(0,le.h)(io,{theme:n,embedMode:I,feedOrientation:_,headerPadding:null==a||null===(C=a.current)||void 0===C||null===(x=C.base)||void 0===x?void 0:x.scrollHeight,isEmptyState:0===P&&j,isLoadingState:!e.cardFeed.status.loaded,ref:i,cardCount:P,id:"action-cards-sdk-card-container",class:"card-container",role:"list"},!e.cardFeed.status.loaded&&"modal-stream"!==I&&(0,le.h)(Zi,{embedMode:I,state:e.cardFeed.status.errorState,backgroundColor:"transparent",theme:n,onRetry:r,noInternetConnectionMessage:M.noInternetConnectionMessage,dataLoadFailedMessage:M.dataLoadFailedMessage,tryAgainTitle:M.tryAgainTitle}),e.cardFeed.status.loaded&&P>0&&(0,le.h)(Oi,{cardInstances:e.cardFeed.cardInstances,theme:n,isPreview:T,onDismiss:t=>Xi(void 0,void 0,void 0,(function*(){Fl(e,e,t,g,v,"overflow-menu")})),onSnooze:(t,n)=>{e.requestSnooze(t,"overflow-menu",n)},onFeedbackSelected:(t,n)=>{t.textFeedback||"negative"===t.sentiment?e.requestFeedback(n,t):"positive"===t.sentiment&&El(n,e,m,g,t.source)},removeCard:t=>{e.removeCard(t)},cardStates:e.cardStates,margin:F?0:10,runtimeVariables:e.cardFeed.runtimeVariables,customStrings:M,votingOptions:e.cardFeed.cardVoting,horizontalContainerConfig:E,ref:s}),e.cardFeed.status.loaded&&0===P&&j&&(0,le.h)(oo,{embedMode:I,feedOrientation:_,horizontalOffset:H,class:"empty-state-wrapper"},(0,le.h)(zi,{theme:n,hasSeenTutorial:e.cardFeed.tutorialSeen,tutorialMessage:M.awaitingFirstCard,emptyMessage:M.allCardsCompleted}))),D&&(0,le.h)(Ri,{theme:n,feedOrientation:_,message:e.messages.cardList,delay:so(e),actionTitle:e.messages.cardList&&["submit-failed","dismiss-failed","snooze-failed"].includes(e.messages.cardList.action)?"Try again":"Dismiss",actionHandler:()=>Xi(void 0,void 0,void 0,(function*(){var t,n,r,i,o,a,s,l,d,c;const u=null===(t=e.messages.cardList)||void 0===t?void 0:t.cardInstanceId,h=null===(n=e.messages.cardList)||void 0===n?void 0:n.action;if(u&&h)switch(h){case"submit-failed":Al(e,e,u,!1,g,m,v,(null===(r=e.messages.cardList)||void 0===r?void 0:r.responseValues)||{},{payload:null===(i=e.messages.cardList)||void 0===i?void 0:i.payload,postSubmissionUrl:null===(o=e.messages.cardList)||void 0===o?void 0:o.postSubmissionUrl,subviewData:null===(a=e.messages.cardList)||void 0===a?void 0:a.subviewData,submitButtonName:null===(s=e.messages.cardList)||void 0===s?void 0:s.submitButtonName});break;case"dismiss-failed":const t=null===(l=e.messages.cardList)||void 0===l?void 0:l.source;t&&Fl(e,e,u,g,v,t);break;case"snooze-failed":const n=null===(d=e.messages.cardList)||void 0===d?void 0:d.snoozeDate,h=null===(c=e.messages.cardList)||void 0===c?void 0:c.source;n&&h&&Ll(e,e,u,n,g,v,h)}})),onDismiss:()=>{e.clearMessage("cardList")}}))}))},co=rn("div")((e=>{let{yOffset:t}=e;return{position:"absolute",top:`${t}px`,left:"0",right:"0",zIndex:Xs.BANNER,overflow:"hidden"}})),uo=rn("div")((e=>{let{theme:t}=e;return{position:"absolute",top:"0",left:"0",right:"0",background:t.getCSSColor("background.banner"),padding:"12px",transform:"translateY(-100%)",transition:"transform 300ms ease-in-out",".visible":{transform:"translateY(0)",position:"initial"},".animating":{position:"initial"}}})),ho=rn("p")((e=>{let{theme:t}=e;return Object.assign(Object.assign({flexGrow:"1",margin:"0",color:t.getCSSColor("text.banner")},t.getCSSFontProperties("banner")),{textAlign:"center",overflow:"hidden"})})),po=e=>{let{theme:t,message:n,yOffset:r,onDismiss:i}=e;const[o,a]=ve(null),[s,l]=ve(null),[d,c]=ve(!1);return be((()=>{null!=n&&null!=n.text?(null!=s&&(clearTimeout(s),l(null)),null!=o&&(clearTimeout(o),a(null)),c(!0),l(setTimeout((()=>{c(!1),l(null),a(setTimeout((()=>{i&&i(),a(null)}),300))}),3300))):c(!1)}),[n]),(0,le.h)(co,{theme:t,yOffset:r},(0,le.h)(uo,{theme:t,class:`${d?"visible":""} ${o?"animating":""}`},(0,le.h)(ho,{theme:t},n?n.text:"")))},mo=rn("div")((e=>{let{workflowTheme:t,feedTheme:n,embedMode:r,cardMaximumWidth:i}=e;return Object.assign({backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:"relative"},"modal-stream"===r?{height:"auto",width:"100%",maxWidth:i?`${i}px`:"initial",borderRadius:n.getShape("borderRadius.card")||"initial",border:`${n.getShape("border.card")||"0px"} solid ${n.getCSSColor("border.card")}`}:{})})),go=rn("div")((e=>{let{workflowTheme:t,feedTheme:n,embedMode:r,isPreview:i}=e;return Object.assign({background:t.getCSSColor("background.default"),position:"relative",bottom:i?"auto":"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"visible",padding:t.getPadding("stream")||"0px 20px 20px",boxSizing:"border-box",display:"flex",flex:"1"},"modal-stream"===r?{borderBottomLeftRadius:n.getShape("borderRadius.card")||"initial",borderBottomRightRadius:n.getShape("borderRadius.card")||"initial"}:{})})),vo=rn("div")({paddingTop:"10px"}),fo={scrollTop:0,subviewId:""},bo=e=>{let{workflowTheme:n,feedTheme:r}=e;const i=ye(null),o=Ce(Gi).analyticsDispatcher;return(0,le.h)(Te.lj,{actions:(0,t.Y2)(Fe,Zt),mapToProps:e=>{const t=Pe(e);return{containerInstanceId:e.application.containerInstanceId,cardStates:e.cardStates,cardMaximumWidth:e.cardFeed.cardMaximumWidth,customStrings:e.application.customStrings,subview:t&&He(t)?t:null,isPreview:e.application.isPreview||!1,embedMode:e.application.embedMode,runtimeVariables:e.cardFeed.runtimeVariables,bannerMessage:e.messages.subview}}},(e=>{if(null===e.subview)return null;const{cardInstance:t,subviewId:a}=e.subview;if(t&&a){const l=t.subviews[a],{id:d}=t.instance,c=e.cardStates[d],u="modal-subview"===e.embedMode?Ei:Li;if(l){var s;let h=null===(s=e.runtimeVariables.values)||void 0===s?void 0:s.get(d);return h=h||new Map,be((()=>{var e;const t=()=>{let e=!1;e||(window.requestAnimationFrame((()=>{var t;const n=null==i||null===(t=i.current)||void 0===t?void 0:t.base;n&&(fo.scrollTop=n.scrollTop,fo.subviewId=a),e=!1})),e=!0)};return(null==i||null===(e=i.current)||void 0===e?void 0:e.base)&&(i.current.base.scrollTop=fo.subviewId===a?fo.scrollTop:0,i.current.base.addEventListener("scroll",t)),()=>{var e;(null==i||null===(e=i.current)||void 0===e?void 0:e.base)&&(i.current.base.scrollTop=fo.subviewId===a?fo.scrollTop:0,i.current.base.removeEventListener("scroll",t))}}),[]),be((()=>{o.sendEvent({cardInstanceId:d,cardViewState:"subview",eventName:bt,properties:{subviewId:a,subviewTitle:_h(l.title,h),subviewLevel:1}})}),[a]),l.nodes=Lh(l.nodes),(0,le.h)(le.Fragment,null,(0,le.h)(mo,{workflowTheme:n,feedTheme:r,embedMode:e.embedMode,id:Ji,cardMaximumWidth:e.cardMaximumWidth},(0,le.h)(wl,{viewState:"subview",onCancelUpload:()=>{window.AtomicUploadService.cancelUploadForCard(e.containerInstanceId,d),Gt().finishCardFileUpload(d),!window.AtomicUploadService.getIsUploadingStatus(e.containerInstanceId)&&Gt().setCardFeedOverlay(!1)},theme:n,renderOverlay:"uploading-files"===c,cardMaximumWidth:e.cardMaximumWidth}),(0,le.h)(u,{title:_h(l.title,h),theme:n,cardBorderRadius:r.getShape("borderRadius.card"),actionHandler:()=>{e.navigateBack(),o.sendEvent({cardInstanceId:d,cardViewState:"subview",eventName:St,properties:{subviewId:a,subviewTitle:_h(l.title,h),subviewLevel:1}})},inert:"uploading-files"===c}),(0,le.h)(go,{workflowTheme:n,feedTheme:r,embedMode:e.embedMode,ref:i,isPreview:e.isPreview,class:"use-offset",id:"action-cards-subview-container",inert:"uploading-files"===c,cardMaximumWidth:e.cardMaximumWidth},(0,le.h)(vo,{class:"offset-child"},l.nodes.map((r=>{var i;const o=l.nodes.find((e=>"form"===e.type)),s=null==o||null===(i=o.children)||void 0===i?void 0:i.find((e=>"actionButtonGroup"===e.type));return(0,le.h)(Ih,{cardInstanceId:d,cardMetadata:t.metadata,node:r,cardContext:{nodeCount:(null==o?void 0:o.children)?o.children.length:0,hasButtonFinalNode:void 0!==s,hasButtons:void 0!==(null==s?void 0:s.children)&&s.children.length>0},isWorkflow:!0,theme:n,runtimeVariables:h,subviewId:a,subviewTitle:_h(l.title,h),embedMode:e.embedMode})}))))),!e.isPreview&&(0,le.h)(po,{theme:n,message:e.bannerMessage,yOffset:60,onDismiss:()=>{e.clearMessage("subview")}}))}}return null}))},So=e=>{let{fillColor:t,ariaHidden:n=!1}=e;return(0,le.h)("svg",{width:"19",height:"12",viewBox:"0 0 19 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"A blank video icon","aria-hidden":n},(0,le.h)("path",{d:"M12 1H2C1.44772 1 1 1.44772 1 2V10C1 10.5523 1.44772 11 2 11H12C12.5523 11 13 10.5523 13 10V2C13 1.44772 12.5523 1 12 1Z",stroke:t,strokeWidth:"2"}),(0,le.h)("path",{d:"M17.1464 1.85355L13.3536 5.64645C13.1583 5.84171 13.1583 6.15829 13.3536 6.35355L17.1464 10.1464C17.4614 10.4614 18 10.2383 18 9.79289V2.20711C18 1.76165 17.4614 1.53857 17.1464 1.85355Z",stroke:t,strokeWidth:"2"}))};class yo extends le.Component{constructor(e){super(e),this.state={imageLoaded:!1,imageLoadFailed:!1}}preloadsImage(){return!0}onImageLoad(e){this.setState((t=>Object.assign(Object.assign({},t),{loadedDimensions:{width:e.naturalWidth,height:e.naturalHeight}})))}preloadImage(){if(this.preloadsImage()){const e=new Image;e.src=this.props.src,e.onload=()=>{this.setState({imageLoaded:!0}),this.onImageLoad(e)},e.onerror=()=>{this.setState({imageLoadFailed:!0})}}}getPreviewIcon(e){switch(e){case"image":case"imageWithoutSrc":return In;case"video":case"videoWithoutSrc":return So;default:return null}}getElementRole(e){switch(e){case"image":case"video":return"button";case"imageWithoutSrc":case"videoWithoutSrc":return"img"}}componentDidMount(){this.props.src&&this.preloadImage()}componentDidUpdate(e){this.props.src&&this.props.src!==e.src&&this.preloadImage()}handleKeyPress(e){e.charCode===Gr&&this.props.onClickImage&&(this.props.onClickImage(),e.preventDefault())}}const wo=rn("div")((e=>{let{workflowTheme:t,feedTheme:n,embedMode:r,cardMaximumWidth:i}=e;return Object.assign({backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column"},"modal-stream"===r?{height:"auto",width:"100%",maxWidth:i?`${i}px`:"initial",borderRadius:n.getShape("borderRadius.card")||"initial",border:`${n.getShape("border.card")||"0px"} solid ${n.getCSSColor("border.card")}`}:{})})),ko=rn("div")({width:"100%",height:"100%",maxWidth:"100%",minHeight:"420px",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),Co=rn("div")((e=>{let{autoSizes:t}=e;return{overflow:"auto",flexGrow:t?"0":"1",height:t?"auto":"100%",display:"flex",flexDirection:"column",width:"100%"}})),xo=rn("div")((e=>{let{imageLoaded:t,theme:n}=e;return{width:"100%",height:"100%",backgroundColor:t?"":n.getCSSColor("background.media"),display:"flex",alignItems:"center",justifyContent:"center",flexGrow:"1"}})),Io=rn("video")({maxWidth:"100%"}),Oo=rn("img")({maxWidth:"100%",flexShrink:"0"});class Mo extends yo{render(){const{theme:e,src:t,label:n,alt:r}=this.props,{imageLoaded:i}=this.state;return(0,le.h)(le.Fragment,null,!i&&(0,le.h)(xo,{imageLoaded:i,theme:e},(0,le.h)(In,{fillColor:e.getCSSColor("icon.mediaBanner"),ariaHidden:!0})),i&&(0,le.h)(Oo,{src:t,alt:r||n}))}}const No=e=>{var t,n;let{src:r,alt:i,cardInstanceId:o}=e;const a=ye(null),s=Ce(Gi).analyticsDispatcher,l="string"==typeof r&&null!==(t=null===(n=r.match(/[^\/]*$/))||void 0===n?void 0:n[0])&&void 0!==t?t:"";return be((()=>{var e,t,n,i;const d=()=>{s.sendEvent({eventName:wt,cardInstanceId:o,cardViewState:"subview",properties:{media:l,mediaURL:r}})},c=()=>{s.sendEvent({eventName:kt,cardInstanceId:o,cardViewState:"subview",properties:{media:l,mediaURL:r}})};return null===(e=a.current)||void 0===e||null===(t=e.base)||void 0===t||t.addEventListener("play",d),null===(n=a.current)||void 0===n||null===(i=n.base)||void 0===i||i.addEventListener("ended",c),()=>{var e,t,n,r;null===(e=a.current)||void 0===e||null===(t=e.removeEventListener)||void 0===t||t.call(e,"play",d),null===(n=a.current)||void 0===n||null===(r=n.removeEventListener)||void 0===r||r.call(n,"ended",c)}}),[]),(0,le.h)(Io,{ref:a,src:r,alt:i||"video",autoplay:!0,controls:!0})},To=e=>{let{workflowTheme:t,feedTheme:n}=e;return(0,le.h)(Te.lj,{actions:Fe,mapToProps:e=>{const t=Pe(e);return{embedMode:e.application.embedMode,cardMaximumWidth:e.cardFeed.cardMaximumWidth,cardInstanceId:null==t?void 0:t.cardInstanceId,currentMediaItem:t&&Ve(t)?t.item:void 0}}},(e=>{const r=e.currentMediaItem;if(!r)return null;const i="modal-subview"===e.embedMode?Ei:Li,o="launcher"===e.embedMode;return(0,le.h)(wo,{workflowTheme:t,feedTheme:n,embedMode:e.embedMode,cardMaximumWidth:e.cardMaximumWidth,id:Ji},(0,le.h)(i,{title:`View ${r.type}`,theme:t,cardBorderRadius:n.getShape("borderRadius.card"),actionHandler:e.navigateBack}),(0,le.h)(Co,{autoSizes:o},(0,le.h)(ko,null,"image"==r.type&&(0,le.h)(Mo,{mediaType:r.type,src:r.url,label:r.title,alt:r.alt,theme:t,isFirstCardNode:!1,isFinalCardNode:!1}),"video"==r.type&&(0,le.h)(No,{src:r.url,alt:r.alt,cardInstanceId:e.cardInstanceId}))))}))};var Fo=n(6083),Ao=n.n(Fo),Lo=n(9331),Eo=n.n(Lo),jo=n(5932),Do=n.n(jo),_o=n(4844),Po=n.n(_o),Ho=n(4801),Ro=n.n(Ho),$o=n(7754),Vo=n.n($o),Wo=n(6254),Bo=n.n(Wo),zo=n(5886),Uo=n.n(zo);const qo=e=>{let{fillColor:t}=e;return(0,le.h)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,le.h)("path",{d:"M1 1L5.96464 5.96464C5.98417 5.98417 5.98417 6.01583 5.96464 6.03536L1 11",stroke:t,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},Yo=e=>{let{fillColor:t}=e;return(0,le.h)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,le.h)("path",{d:"M6.16235 11L1.16235 6L6.16235 1",stroke:t,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},Ko=rn("button")((e=>{let{theme:t}=e;return Object.assign({height:"100%",width:"30px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",justifySelf:"center",border:"none",backgroundColor:"transparent"},t.getElementFocusCSSProperties())})),Zo=rn("div")((e=>{var t;let{theme:n}=e;return{"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none",display:"grid",gridTemplate:"auto / 42px 1fr 42px",alignItems:"center",margin:"0 auto",width:"100%",color:null!==(t=n.getCSSColor("text.datePickerCalendarMonthYear",{skipFallback:!0}))&&void 0!==t?t:"black","> h1":{textAlign:"center",textTransform:"none",lineHeight:"30px",margin:"0 0 10px",gridColumn:"2"},"> input":{display:"block",fontSize:"small",fontWeight:"bold",textAlign:"center",lineHeight:"15px",height:"18px",width:"60px",margin:"0 auto",backgroundColor:"transparent",fontFamily:"inherit",border:"1px solid lightgray",paddingLeft:"11px"},"> div:first-of-type":{gridColumn:"1"},"> div:last-of-type":{gridColumn:"3"}}})),Qo=rn("span")({fontSize:"15px"}),Go=rn("span")({fontSize:"15px",fontWeight:"normal"}),Xo=e=>{var t,n;let{theme:r,month:i,year:o="",onBack:a,onForward:s,locale:l}=e;return(0,le.h)(Zo,{theme:r},(0,le.h)(Ko,{theme:r,onClick:a,"aria-label":"previous month"},(0,le.h)(Yo,{fillColor:null!==(t=r.getCSSColor("background.datePickerCalendarMonthNavArrows",{skipFallback:!0}))&&void 0!==t?t:"rgba(0,0,0,0.5)"})),(0,le.h)("h1",{className:"MonthDisplay","aria-live":"assertive"},(0,le.h)(Qo,null,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US";return window.months=window.months||[...Array(12)].map(((t,n)=>new Date(2017,n,1).toLocaleDateString(e,{month:"long"}))),window.months}(l)[i-1]+" "),(0,le.h)(Go,null,o)),(0,le.h)(Ko,{theme:r,onClick:s,"aria-label":"next month"},(0,le.h)(qo,{fillColor:null!==(n=r.getCSSColor("background.datePickerCalendarMonthNavArrows",{skipFallback:!0}))&&void 0!==n?n:"rgba(0,0,0,0.5)"})))};var Jo=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const ea=rn("button")((e=>{var t,n,r,i,o,a,s;let{isDisabled:l,isSelected:d,isToday:c,isFocused:u,theme:h}=e,p=null!==(t=h.getCSSColor("text.datePickerCalendarDateItem",{skipFallback:!0}))&&void 0!==t?t:"rgba(0, 0, 0, 1)",m=h.getCSSColor("text.datePickerCalendarHoverDateItem",{skipFallback:!0}),g="transparent",v=null!==(n=h.getCSSColor("background.datePickerCalendarHoverDateItem",{skipFallback:!0}))&&void 0!==n?n:"rgba(0, 0, 0, 0.05)";const f="#1E6EFA";c&&!d?p=null!==(r=h.getCSSColor("text.datePickerCalendarCurrentDate",{skipFallback:!0}))&&void 0!==r?r:f:d?(p=null!==(i=h.getCSSColor("text.datePickerCalendarSelectedDateItem",{skipFallback:!0}))&&void 0!==i?i:"white",g=null!==(o=h.getCSSColor("background.datePickerCalendarSelectedDateItem",{skipFallback:!0}))&&void 0!==o?o:f,v=g):u?g="rgba(0, 0, 0, 0.05)":l&&(p="rgba(0, 0, 0, 0.2)",v="transparent");const b=null!==(a=h.getShape("borderRadius.datePickerCalendarDateItem",{skipFallback:!0}))&&void 0!==a?a:"99px";return{userSelect:"none",display:"flex",justifySelf:"center",alignItems:"center",justifyContent:"center",fontFamily:"inherit",fontSize:"small",lineHeight:"15px",margin:"0",position:"relative",width:"string"==typeof b&&(null===(s=b.match(new RegExp(/([1-9])+/g)))||void 0===s?void 0:s.length)?"40px":"100%",height:"40px",outline:"none",border:"2px solid transparent",cursor:l?"initial":"pointer",backgroundColor:g,borderRadius:b,":hover":Object.assign(Object.assign({},m?{color:m}:{}),{backgroundColor:v}),color:p}})),ta=e=>{let{theme:t,date:n,dateLabel:r,style:i,col:o,onSelect:a,onHover:s,onFocus:l}=e,d=Jo(e,["theme","date","dateLabel","style","col","onSelect","onHover","onFocus"]);const c=ye(null);return(0,le.h)(ea,{"data-testid":"calendar-day-button",ref:c,title:r,"aria-label":r,"aria-selected":d.isSelected?"true":"false","aria-disabled":d.isDisabled?"true":"false","aria-colindex":o,role:"gridcell",key:n,style:i,class:`CalendarDay ${ze(d)}`,isToday:Uo()(n),isDisabled:d.isDisabled,isSelected:d.isSelected,isFocused:d.isFocused,theme:t,tabIndex:"-1",onMouseDown:e=>{e.stopPropagation(),d.isDisabled||(c.current&&document.activeElement!==c.current&&c.current.base.focus(),a(n))},onMouseEnter:()=>{d.isDisabled||s(n)},onMouseLeave:()=>{d.isDisabled||s(null)},onFocus:()=>{d.isDisabled||l(n)}},n.getDate())},na=rn("div")((e=>{var t;let{theme:n}=e;return{cursor:"default",borderWidth:"1px",backgroundColor:null!==(t=n.getCSSColor("background.datePickerCalendar",{skipFallback:!0}))&&void 0!==t?t:"white",width:"100%",margin:"0",padding:"10px",borderRadius:"5px",boxSizing:"border-box","> div:focus":{outline:"none"},"> .focus-visible":{outline:"none",boxShadow:`0 0 0 2px ${n.getCSSColor("border.focus")} inset`}}})),ra=rn("div")({padding:"5px"}),ia=rn("div")({}),oa=rn("div")({display:"grid",gridTemplate:"auto / repeat(7, 1fr)"}),aa=rn("div")((e=>{var t;let{theme:n}=e;return{userSelect:"none",textAlign:"center",textTransform:"none",color:null!==(t=n.getCSSColor("text.datePickerCalendarDaysSubHeading",{skipFallback:!0}))&&void 0!==t?t:"rgba(0,0,0,0.5)",fontSize:"13px"}})),sa=rn("div")({display:"grid",gridTemplate:"auto / repeat(7, 1fr)","-ms-grid-rows":"auto","-ms-grid-columns":"(1fr)[7]",marginBottom:"5px"}),la=e=>{const{month:t,year:n,isDateHovered:r,isDateFocused:i,isDateSelected:o,isDateInRange:a,isDateEnabled:s,onDateFocused:l,onDateHovered:d,onDateSelected:c,onChangeMonth:u,onChangeYear:h,calendarRef:p,disabled:m,locale:g,theme:v}=e,f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US";return window.days=window.days||[...Array(7)].map(((t,n)=>{const r=n+1;return{dayName:new Date(Date.UTC(2017,0,n+2)).toLocaleDateString(e,{weekday:"long"}),col:r,style:{gridColumnStart:r}}})),window.days}(g),b=Ue(t,n||0),S=e=>{let{date:t,style:n,col:u}=e;return(0,le.h)(ta,{key:t,theme:v,date:t,col:u,dateLabel:Ke()(t,"dddd, MMMM D, YYYY"),style:n,isToday:Uo()(t),isHovered:r(t),isFocused:i(t),isSelected:o(t),isInRange:a(t),isDisabled:m||!s(t),onSelect:c,onHover:d,onFocus:l})};return(0,le.h)(na,{theme:v},(0,le.h)(Xo,{theme:v,month:t,year:n,onBack:u(-1),onForward:u(1),onChangeYear:h,locale:g,disabled:m}),(0,le.h)(ra,{className:"Calendar",role:"grid",ref:p,tabIndex:0,"aria-colcount":7,"aria-rowcount":6,"aria-label":"Calendar picker"},(0,le.h)(sa,{role:"row"},f.map((e=>{let{dayName:t,style:n,col:r}=e;return(0,le.h)(aa,{key:t,theme:v,style:n,role:"columnheader","aria-colindex":r,"aria-label":t},(0,le.h)("abbr",null,t.slice(0,1)))}))),(0,le.h)(ia,{role:"rowgroup"},(0,le.h)(oa,{role:"row","aria-rowIndex":1},b.week1.map(S)),(0,le.h)(oa,{role:"row","aria-rowIndex":2},b.week2.map(S)),(0,le.h)(oa,{role:"row","aria-rowIndex":3},b.week3.map(S)),(0,le.h)(oa,{role:"row","aria-rowIndex":4},b.week4.map(S)),(0,le.h)(oa,{role:"row","aria-rowIndex":5},b.week5.map(S)),(0,le.h)(oa,{role:"row","aria-rowIndex":6},b.week6.map(S)))))};function da(){return da=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},da.apply(this,arguments)}const ca="DatePicker",ua="DateRangePicker";class ha extends le.Component{constructor(e){var t,n,r;super(e),r=void 0,(n="calendar")in(t=this)?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r;const i=e.date||new Date,o=i.getMonth()+1,a=i.getFullYear();this.state={month:o,year:a,focused:i,hovered:new Date},this.calendar=(0,le.createRef)(),this.handleKeyPress=this.handleKeyPress.bind(this),this.onDateHovered=this.onDateHovered.bind(this),this.onDateSelected=this.onDateSelected.bind(this),this.onDateFocused=this.onDateFocused.bind(this),this.isDateHovered=this.isDateHovered.bind(this),this.isDateFocused=this.isDateFocused.bind(this),this.isDateSelected=this.isDateSelected.bind(this),this.isDateInRange=this.isDateInRange.bind(this),this.isDateEnabled=this.isDateEnabled.bind(this),this.onChangeMonth=this.onChangeMonth.bind(this),this.onChangeYear=this.onChangeYear.bind(this)}componentDidMount(){window.addEventListener("keydown",this.handleKeyPress)}componentWillUnmount(){window.removeEventListener("keydown",this.handleKeyPress)}handleKeyPress(e){var t,n;if(!(null===(n=this.calendar)||void 0===n?void 0:n.current.base.contains(document.activeElement)))return;if(e.key===pi)return void(this.props.onCancel&&this.props.onCancel());e.preventDefault();const{shiftKey:r,key:i}=e,o=i===li,a=i===ci,s=i===ui,l=i===hi,d=i===ai,c=i===ii,u=i===si,h=i===oi,p=i===di,m=null!==(t=this.props.isDateEnabled)&&void 0!==t?t:function(){return!0};let{focused:g}=this.state;if(o)m(g)&&this.onDateSelected(g);else if(r&&s){const e=Ao()(g,-1);m(e)&&this.onDateFocused(e)}else if(r&&l){const e=Ao()(g,1);m(e)&&this.onDateFocused(e)}else if(s){const e=Eo()(g,-1);m(e)&&this.onDateFocused(e)}else if(l){const e=Eo()(g,1);m(e)&&this.onDateFocused(e)}else if(c){const e=Do()(g,-1);m(e)&&this.onDateFocused(e)}else if(h){const e=Do()(g,1);m(e)&&this.onDateFocused(e)}else if(d){const e=Po()(g,-1);m(e)&&this.onDateFocused(e)}else if(u){const e=Po()(g,1);m(e)&&this.onDateFocused(e)}else p?this.onDateSelected(g):a&&this.props.onCancel&&this.props.onCancel()}onChangeYear(e){e.preventDefault(),this.setState({year:parseInt(e.target.value)||void 0})}onChangeMonth(e){let{month:t,year:n=0}=this.state,r=t+e,i=n;return r<1&&(r=12+r,i-=1),r>12&&(r-=12,i+=1),()=>{this.setState({month:r,year:i})}}onDateSelected(e){const{type:t,onDateSelected:n,onStartDateSelected:r,onEndDateSelected:i}=this.props;if(t===ca)n&&n(e);else if(t===ua){const t=!this.props.startDate,n=this.props.startDate&&this.props.endDate,o=this.props.startDate&&this.props.startDate>e;t||n||o?(r&&r(e),i&&i(null)):i&&i(e)}}onDateHovered(e){const{onDateHovered:t}=this.props;e&&this.state.hovered&&this.state.hovered.getDate()!==e.getDate()&&this.setState({hovered:e},(()=>{t&&t(e)}))}onDateFocused(e){const{onDateFocused:t}=this.props,n=e.getMonth()+1,r=e.getFullYear();this.state.focused&&this.state.focused!==e&&this.setState({focused:e,month:n,year:r},(()=>{t&&t(e)}))}isDateEnabled(e){var t;return(null!==(t=this.props.isDateEnabled)&&void 0!==t?t:function(){return!0})(e)}isDateFocused(e){return Ro()(e,this.state.focused)}isDateHovered(e){return Ro()(e,this.state.hovered)}isDateSelected(e){return(this.props.type===ca?[this.props.date]:[this.props.startDate,this.props.endDate]).some((t=>!!t&&Ro()(t,e)))}isDateInRange(e){if(this.props.type===ca)return!1;const{startDate:t,endDate:n}=this.props,{focused:r,hovered:i}=this.state,o=n||(t&&r&&!Ro()(t,r)?r:i);return!(!t||!o||Vo()(o,t))&&Bo()(e,t,o)}componentWillReceiveProps(e){var t;e&&e.open!==this.props.open&&!0===e.open&&((null===(t=this.calendar)||void 0===t?void 0:t.current)&&this.calendar.current.base.focus())}render(){return(0,le.h)(la,{calendarRef:this.calendar,month:this.state.month,year:this.state.year,isDateHovered:this.isDateHovered,isDateFocused:this.isDateFocused,isDateSelected:this.isDateSelected,isDateInRange:this.isDateInRange,isDateEnabled:this.isDateEnabled,onDateSelected:this.onDateSelected,onDateHovered:this.onDateHovered,onDateFocused:this.onDateFocused,onChangeMonth:this.onChangeMonth,onChangeYear:this.onChangeYear,locale:this.props.locale||"en-US",disabled:this.props.disabled||!1,theme:this.props.theme})}}const pa=e=>(0,le.h)(ha,da({type:ca},e));function ma(){return ma=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ma.apply(this,arguments)}const ga="inline",va="stacked",fa="external",ba=e=>{let{theme:t,mode:n,yPadding:r,clickable:i,truncateLabel:o,inputHasValue:a,styles:s}=e;const l=Object.assign(Object.assign(Object.assign({},t.getCSSFontProperties("pinned")),{color:t.getCSSColor("text.pinned"),paddingBottom:"2px",cursor:"inherit"}),void 0!==r?{paddingTop:`${r}px`}:{}),d=Object.assign(Object.assign(Object.assign({},t.getCSSFontProperties("labelInline",{skipFallback:!0})||t.getCSSFontProperties("primary")),{color:t.getCSSColor("text.labelInline",{skipFallback:!0})||t.getCSSColor("text.primary"),paddingBottom:"0px",cursor:"inherit"}),o?{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",minWidth:"0",flex:"1 1 auto",flexShrink:a?"2":"1",paddingRight:"0.1em",marginRight:"-0.1em",paddingBottom:"0.1em",marginBottom:"-0.1em"}:{}),c=Object.assign(Object.assign({},t.getCSSFontProperties("labelExternal")),{color:t.getCSSColor("text.labelExternal"),paddingBottom:"8px",cursor:i?"pointer":"inherit"});return Object.assign(Object.assign(Object.assign(Object.assign({display:"block",flexGrow:"1",whiteSpace:"pre-wrap"},n===va?l:{}),n===ga?d:{}),n===fa?c:{}),s)},Sa=rn("label")((e=>{let{theme:t,mode:n,yPadding:r,clickable:i,truncateLabel:o,inputHasValue:a,styles:s}=e;return ba({theme:t,mode:n,yPadding:r,clickable:i,truncateLabel:o,inputHasValue:a,styles:s})})),ya=rn("span")((e=>{let{theme:t,mode:n,yPadding:r,clickable:i,truncateLabel:o,styles:a}=e;return ba({theme:t,mode:n,yPadding:r,clickable:i,truncateLabel:o,styles:a})})),wa=e=>{let{theme:t,children:n,useSpanElement:r,clickable:i=!0,mode:o,name:a,id:s,yPadding:l,onClick:d,truncateLabel:c,inputHasValue:u,styles:h}=e;return r?(0,le.h)(ya,ma({theme:t,mode:o||ga,"aria-hidden":!n,yPadding:l,clickable:i,onClick:d,styles:h},a?{for:a}:{},s?{id:s}:{}),n):(0,le.h)(Sa,ma({theme:t,mode:o||ga,"aria-hidden":!n,yPadding:l,clickable:i,onClick:d,truncateLabel:c,inputHasValue:u,styles:h},a?{for:a}:{},s?{id:s}:{}),n)};function ka(){return ka=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ka.apply(this,arguments)}const Ca=rn("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`}})),xa=rn("div")((e=>{let{theme:t,mode:n,cursor:r,hPadding:i}=e;return Object.assign(Object.assign({minHeight:n===va?"70px":"50px",borderRadius:"4px",border:`1px solid ${t.getCSSColor("border.component")}`},t.getElementFocusCSSProperties()),{backgroundColor:t.getCSSColor("background.component"),display:"flex",justifyContent:"space-between",alignItems:"center",overflow:"hidden",minWidth:"0",padding:`10px ${void 0!==i?i:20}px`,flexGrow:"1",cursor:r||"pointer"})})),Ia=e=>{let{nodeKey:t,children:n,label:r,labelFor:i,labelId:o,mode:a,cursor:s,ref:l,theme:d,isFirstCardNode:c,isFinalCardNode:u,onClick:h,clickableLabel:p=!0,tabFocusable:m,innerRef:g,hPadding:v,accessibleAttributes:f}=e;const b=m?e=>{e.charCode===Gr&&h&&(e.preventDefault(),h())}:void 0;return(0,le.h)(Ca,{ref:l,isFirstCardNode:c,isFinalCardNode:u,theme:d},a===fa&&(0,le.h)(wa,{theme:d,mode:a,name:i,id:o,onClick:p?h:e=>null==e?void 0:e.preventDefault(),clickable:p},r),(0,le.h)(xa,ka({key:t,"data-element-key":t,mode:a,theme:d,cursor:s,class:"component-field-wrapper",onClick:h,onKeyPress:b,tabIndex:m?0:void 0,ref:g,hPadding:v},f),n))},Oa=rn("div")((e=>{let{thumbnailUrl:t,theme:n}=e;return{backgroundColor:n.getCSSColor("background.media"),borderRadius:n.getShape("borderRadius.media")||"initial",width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",marginRight:"10px",backgroundImage:`url('${t}')`,backgroundSize:"cover",backgroundPosition:"center"}})),Ma=e=>{let{thumbnailUrl:t,theme:n,altText:r}=e;return(0,le.h)(Oa,{role:r?"img":"",ariaLabel:r,thumbnailUrl:t,theme:n})},Na=e=>{let{fillColor:t,ariaHidden:n,styles:r}=e;return(0,le.h)("svg",{style:r,width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":n},(0,le.h)("path",{d:"M1 1L6 6L11 1",stroke:t,"stroke-opacity":"1","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},Ta=rn("div")((e=>{let{theme:t,requiresTopSpacing:n}=e;const r=t.getShape("padding.elementBottom",{skipFallback:!0}),i=r?Number(r.replace("px","")):10;return Object.assign(Object.assign({color:t.getCSSColor("text.error")},t.getCSSFontProperties("error")),{marginTop:`${n?"":"-"}${.5*Math.floor(i)}px`,marginRight:"0px",marginBottom:`${i}px`,marginLeft:"0px"})})),Fa=e=>{let{theme:t,isFinalCardNode:n,cardInstanceId:r,subviewId:i,name:o,variableResolver:a}=e;return(0,le.h)(Te.lj,{mapToProps:e=>{let{validationStates:t}=e;return{validationStates:t}}},(e=>{let{validationStates:s}=e;const l=s[r]||{};let d;var c,u,h;i?d=null===(c=l.subviews)||void 0===c||null===(u=c[i])||void 0===u?void 0:u[o]:d=null===(h=l.validations)||void 0===h?void 0:h[o];return d&&d.errorMessage?(0,le.h)(Ta,{theme:t,requiresTopSpacing:n,role:"alert","data-testid":"validation"},a(d.errorMessage)):null}))},Aa=e=>{let{fillColor:t,style:n,ariaHidden:r}=e;return(0,le.h)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",height:"8",viewBox:"0 0 11 8",width:"11",style:n,"aria-hidden":r},(0,le.h)("path",{"clip-rule":"evenodd",d:"m10.7071.292893c.3905.390524.3905 1.023687 0 1.414217l-5.99999 6c-.39053.39052-1.02369.39052-1.41422 0l-2.999997-3c-.3905241-.39053-.3905241-1.02369 0-1.41422.390524-.39052 1.023687-.39052 1.414217 0l2.29289 2.2929 5.29289-5.292897c.39053-.3905241 1.02371-.3905241 1.41421 0z",fill:null!=t?t:"#000","fill-rule":"evenodd"}))},La=rn("div")((e=>{let{mode:t}=e;return Object.assign({display:"block",cursor:"pointer",flex:"1 1 auto",maxWidth:"100%",minWidth:"0"},t===ga?{display:"flex",justifyContent:"space-between",gap:"5px"}:{})})),Ea=rn("div")((()=>({flex:"0 0 auto",alignItems:"center"}))),ja=rn("div")((()=>({"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none"}))),Da=rn("div")((e=>{var t,n,r,i,o;let{open:a,openPosition:s,height:l,theme:d,horizontalInset:c}=e;return Object.assign(Object.assign({position:"absolute",top:`${s}px`,left:a?`${null!=c?c:0}px`:"-999px",width:`calc(100% - ${2*(null!=c?c:0)}px)`,backgroundColor:d.getCSSColor("background.dropdownMenu"),boxShadow:`${null!==(t=d.getShape("offset.dropdownMenuShadow",{skipFallback:!0}))&&void 0!==t?t:"2px"} ${null!==(n=d.getShape("offset.dropdownMenuShadow",{skipFallback:!0}))&&void 0!==n?n:"2px"} ${null!==(r=d.getShape("blur.dropdownMenuShadow",{skipFallback:!0}))&&void 0!==r?r:"10px"} ${null!==(i=d.getCSSColor("shadow.dropdownMenu",{skipFallback:!0}))&&void 0!==i?i:"rgba(0,0,0,0.2)"}`,cursor:"pointer",height:`${l}px`,maxHeight:"335px",overflow:"auto",zIndex:Xs.DROPDOWN,borderRadius:null!==(o=d.getShape("borderRadius.dropdownMenu",{skipFallback:!0}))&&void 0!==o?o:"5px",color:"black"},d.getCSSFontProperties("primary")),{visibility:a?"visible":"hidden"})})),_a=rn("div")((e=>{var t,n;let{theme:r,disabled:i}=e;return Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"5px",padding:"20px",":hover":{backgroundColor:null!==(t=r.getCSSColor("background.dropdownMenuItem",{skipFallback:!0}))&&void 0!==t?t:"rgba(0,0,0,0.05)"},":active":{backgroundColor:null!==(n=r.getCSSColor("background.dropdownMenuItem",{skipFallback:!0}))&&void 0!==n?n:"rgba(0,0,0,0.1)"},border:"0px",color:i?"rgba(0,0,0,0.3)":r.getCSSColor("text.dropdownMenuItem")},r.getCSSFontProperties("dropdownMenuItem")),r.getElementFocusCSSProperties())})),Pa=rn("div")((e=>{let{theme:t,mode:n,placeholder:r}=e;const i=Object.assign({paddingTop:"0px",color:t.getCSSColor("text.secondary"),maxWidth:"100%",minWidth:"0",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",flex:r?"1 1 0":"1 0 auto",textAlign:"right",paddingRight:"0.1em",paddingBottom:"0.1em",marginBottom:"-0.1em"},t.getCSSFontProperties("secondary")),o=Object.assign({paddingTop:"2px",color:t.getCSSColor("text.valueStacked",{skipFallback:!0})||t.getCSSColor("text.primary")},t.getCSSFontProperties("valueStacked",{skipFallback:!0})||t.getCSSFontProperties("primary")),a=Object.assign({paddingTop:"0px",color:t.getCSSColor("text.valueStacked")},t.getCSSFontProperties("valueStacked"));return Object.assign(Object.assign(Object.assign(Object.assign({marginRight:"10px"},n===ga?i:{}),n===va?o:{}),n===fa?a:{}),r?{color:t.getCSSColor("text.hint")}:{})})),Ha=e=>{let{onClick:t,children:n,ref:r,theme:i,disabled:o,isSelected:a}=e;return(0,le.h)(_a,{onClick:t,ref:r,tabIndex:"-1",theme:i,disabled:o,"aria-disabled":o,"aria-selected":a,role:"option"},n)},Ra=e=>{let{children:t,mode:n,theme:r,placeholder:i,ariaLabel:o}=e;return(0,le.h)(Pa,{theme:r,mode:n,placeholder:i,class:"dropdown-selected-value","aria-label":o},t)},$a=(e,t,n,r)=>{var i,o,a,s,l,d;let c=0,u=0,h=0,p=0,m=null;const g=null===(s=window.frameElement)||void 0===s?void 0:s.parentElement,v=document.querySelector("#action-cards-sdk-card-container"),f=(null==g?void 0:g.scrollHeight)!==(null==g?void 0:g.clientHeight),b=(null==v?void 0:v.scrollHeight)!==(null==v?void 0:v.clientHeight);if("launcher"!==r&&g&&f&&!b)m=g;else if(n){m=document.querySelector("#action-cards-subview-container")}else null!==v&&(m=v);if(null!==window.frameElement){var S,y;const e=t.getBoundingClientRect(),n=null===(S=m)||void 0===S?void 0:S.getBoundingClientRect();c=e.top-(n?null==n?void 0:n.top:0),u=e.bottom-(n?null==n?void 0:n.top:0),h=null!==(i=null===(y=m)||void 0===y?void 0:y.scrollHeight)&&void 0!==i?i:window.innerHeight}else{const e=document.querySelector("#workbench-card-preview");if(e){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();p=e.scrollTop,c=r.top-n.top-p,u=c+t.offsetHeight,h=e.offsetHeight}}e.style.height="auto";const w=c-20+(m?m.scrollTop:0),k=h-u-20,C=w-(null!==(o=null===(l=m)||void 0===l?void 0:l.scrollTop)&&void 0!==o?o:0),x=(null!==(a=null===(d=m)||void 0===d?void 0:d.offsetHeight)&&void 0!==a?a:h)-C-20-t.offsetHeight,I=e.offsetHeight;e.style.height="";const O=t.offsetTop,M=window.getComputedStyle(t),N=e=>{const t=parseFloat(null!=e?e:"");return Number.isFinite(t)?t:0},T=N(M.paddingTop),F=N(M.paddingBottom),A={openPosition:O+t.offsetHeight+10-F,height:I},L={openPosition:O-I-10+T,height:I};return I<=x?A:I<=C?L:I<=k?A:I<=w?L:{openPosition:O,height:Math.min(I,k+t.offsetHeight)}},Va=Er.forwardRef(((e,t)=>{let{nodeKey:n,cardInstanceId:r,subviewId:i,embedMode:o,attributes:{format:a,defaultValue:s,thumbnailSrc:l,thumbnailAltText:d,label:c,name:u,values:h,placeholder:p},validations:m,theme:g,horizontalInset:v,isFinalCardNode:f,variableResolver:b,onValueChanged:S}=e;const[y,w]=ve(!1),[k,C]=ve(0),[x,I]=ve(0),[O,M]=ve(s?b(s.toString()):null),[N,T]=ve(-1),F=ye(null),A=ye(null),L=ye(null),E=ye(null),j=ye(s?b(s.toString()):null),D=h.find((e=>{let{value:t}=e;return O===t}));we(t,(()=>({getCurrentValue:()=>O,setCurrentValue:e=>M(e)}))),be((()=>{const e=e=>{F.current&&!F.current.base.contains(e.target)&&(y&&st().validateField(r,u,O,m),w(!1))},t=e=>{var t,n;(null==L||null===(t=L.current)||void 0===t||null===(n=t.base)||void 0===n?void 0:n.contains(document.activeElement))&&e.key===ci&&(w(!1),A.current.base.focus())};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}})),be((()=>{if(S)S(O);else{const e=lt(r,u,i);e?(j.current=e.toString(),M(e)):st().handleFormChange(r,u,O,i)}L.current&&E.current&&(L.current.base.scrollTop=E.current.base.offsetTop)}),[]),be((()=>{const e=s?b(s.toString()):null;e!==j.current&&(O===j.current&&(S?S(e):st().handleFormChange(r,u,e,i),M(e)),j.current=s?b(s.toString()):null)}),[s]),be((()=>{if(y){const e=h.findIndex((e=>O===e.value));T(Math.max(0,e))}else T(-1)}),[y]);const _=`dropdown-input-${r}-${u}`;return(0,le.h)(Te.lj,{actions:tt,mapToProps:()=>{}},(e=>(0,le.h)(ja,null,(0,le.h)(Ia,{nodeKey:n,ref:F,innerRef:A,mode:a,label:b(c),labelId:_,theme:g,isFinalCardNode:f,tabFocusable:!0,accessibleAttributes:{role:"combobox","aria-haspopup":"listbox","aria-expanded":y,"aria-controls":`${u}-dropdown-body`,"aria-labelledby":_},clickableLabel:!1,onClick:()=>{if(F.current){const{openPosition:t,height:n}=$a(L.current.base,F.current.base,!!i,o);C(t),I(n),w((t=>(t&&e.validateField(r,u,O,m,i),!t)))}}},l&&(0,le.h)(Ea,null,(0,le.h)(Ma,{thumbnailUrl:b(l),altText:null!=d?d:"",theme:g})),(0,le.h)(La,{mode:a},c&&a!==fa&&(0,le.h)(wa,{theme:g,mode:a,name:_,truncateLabel:a===ga,inputHasValue:!!O,styles:{flex:"0 1 auto"}},b(c)),(0,le.h)(Ra,{theme:g,mode:a,placeholder:!D},D?D.title:b(p))),(0,le.h)(Na,{fillColor:g.getCSSColor("icon.dropdown"),styles:{flex:"0 0 auto"},ariaHidden:!0}),(0,le.h)(Da,{ref:L,open:y,openPosition:k,theme:g,height:x,className:"dropdown-body",id:`${u}-dropdown-body`,role:"listbox",horizontalInset:v},(0,le.h)(fi,{defaultIndex:N,theme:g},h.map(((t,n)=>(0,le.h)(Ha,{onClick:()=>{t.disabled||(M(t.value),S?S(t.value):e.handleFormChange(r,u,t.value,i),e.validateField(r,u,t.value,m,i),A&&A.current&&A.current.base&&A.current.base.focus(),T(n))},ref:t.value===O?E:null,theme:g,disabled:t.disabled,isSelected:t.value===O,"data-testid":`option-${t.title}`},t.title,t.value===O&&(0,le.h)(Aa,{fillColor:g.getCSSColor("background.dropdownMenuSelectedIcon"),style:{flexShrink:0},ariaHidden:!0}))))))),(0,le.h)(Fa,{name:u,cardInstanceId:r,subviewId:i,theme:g,isFinalCardNode:f,variableResolver:b}))))})),Wa=rn("div")((e=>{let{mode:t}=e;return Object.assign(Object.assign({display:"block"},t!==va?{display:"flex",justifyContent:"space-between",gap:"5px"}:{}),{cursor:"pointer",flex:"1 1 auto",maxWidth:"100%",minWidth:"0"})})),Ba=rn("div")((()=>({flex:"0 0 auto",alignItems:"center"}))),za=rn("div")((()=>({"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none"}))),Ua=e=>{var t,n,r,i,o,a,s,l,d,c,u,h;let{nodeKey:m,cardInstanceId:g,subviewId:v,attributes:{format:f,defaultValue:b,thumbnailSrc:S,thumbnailAltText:y,label:w,name:k,placeholder:C},controlledDateValidator:I,validations:O,theme:M,horizontalInset:N,isFinalCardNode:T,variableResolver:F,onValueChanged:A,embedMode:L}=e;const E=b?new Date(b):void 0,j=ye(E?(0,p.addMinutes)(E,E.getTimezoneOffset()):null),D=`datepicker-input-${g}-${k}`,[_,P]=ve(!1),[H,R]=ve(0),[$,V]=ve(0),[W,B]=ve(j.current),z=ye(null),U=ye(null),q=ye(null),Y=(null==O||null===(t=O.maximumDate)||void 0===t||null===(n=t.attributes)||void 0===n?void 0:n.maximumDate)?new Date(null==O||null===(r=O.maximumDate)||void 0===r||null===(i=r.attributes)||void 0===i?void 0:i.maximumDate):void 0,K=(null==O||null===(o=O.minimumDate)||void 0===o||null===(a=o.attributes)||void 0===a?void 0:a.minimumDate)?new Date(null==O||null===(s=O.minimumDate)||void 0===s||null===(l=s.attributes)||void 0===l?void 0:l.minimumDate):void 0,Z=new Date;let Q=new Date;if(Y&&K){if(!(Z<=Y&&Z>=K)){Q=Math.abs((0,p.differenceInSeconds)(Z,Y))<Math.abs((0,p.differenceInSeconds)(Z,K))?Y:K}}else if(K){Z>=K||(Q=K)}else if(Y){Z<=Y||(Q=Y)}const G=W?new Date(W):new Date(Q);G.setHours(0,0,0,0);const X=()=>{_&&st().validateField(g,k,W,O,v),P(!1)};let J;be((()=>{const e=e=>{q.current&&!q.current.base.contains(e.target)&&z.current&&!z.current.base.contains(e.target)&&X()};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}})),be((()=>{const e=W?W.toISOString():void 0,t=W?Ke()(W,x):null;if(A)A(e);else{const e=lt(g,k,v);e?(j.current=new Date(e),B(e)):st().handleFormChange(g,k,t,v)}}),[]),be((()=>{var e;const t=b?new Date(b):void 0,n=t?(0,p.addMinutes)(t,t.getTimezoneOffset()):null;if((null==n?void 0:n.toDateString())!==(null===(e=j.current)||void 0===e?void 0:e.toDateString())){if(W===j.current){const e=n?n.toISOString():void 0,t=n?Ke()(n,x):null;A?A(e):st().handleFormChange(g,k,t,v),B(n)}j.current=n}}),[b]),I?J=I:((null==O||null===(d=O.maximumDate)||void 0===d||null===(c=d.attributes)||void 0===c?void 0:c.maximumDate)||(null==O||null===(u=O.minimumDate)||void 0===u||null===(h=u.attributes)||void 0===h?void 0:h.minimumDate))&&(J=e=>{var t,n,r,i;const o=null===(t=O.maximumDate)||void 0===t||null===(n=t.attributes)||void 0===n?void 0:n.maximumDate,a=null===(r=O.minimumDate)||void 0===r||null===(i=r.attributes)||void 0===i?void 0:i.minimumDate,s=o?qe(o,{isMax:!0}):void 0,l=a?qe(a,{isMin:!0}):void 0;return(!s||e<=s)&&(!l||e>=l)});const ee=W?Ke()(W,"DD MMM YYYY"):F(C),te=()=>{U&&U.current&&U.current.base&&U.current.base.focus()};return(0,le.h)(Te.lj,{actions:tt,mapToProps:()=>{}},(e=>(0,le.h)(za,null,(0,le.h)(Ia,{nodeKey:m,ref:z,innerRef:U,mode:f,label:F(w),labelId:D,theme:M,isFinalCardNode:T,tabFocusable:!0,accessibleAttributes:{role:"button","aria-haspopup":"dialog","aria-expanded":_,"aria-labelledby":D},clickableLabel:!1,onClick:()=>{if(z.current){const{openPosition:t,height:n}=$a(q.current.base,z.current.base,!!v,L);R(t),V(n),P((t=>(t&&e.validateField(g,k,W,O,v),!t)))}}},S&&(0,le.h)(Ba,{mode:f},(0,le.h)(Ma,{thumbnailUrl:F(S),altText:null!=y?y:"",theme:M})),(0,le.h)(Wa,{mode:f},w&&f!==fa&&(0,le.h)(wa,{theme:M,mode:f,name:D,truncateLabel:f===ga,styles:{flex:"0 1 auto"}},F(w)),(0,le.h)(Ra,{theme:M,mode:f,placeholder:!W,ariaLabel:ee},ee)),(0,le.h)(Na,{fillColor:M.getCSSColor("icon.dropdown"),styles:{flex:"0 0 auto"},ariaHidden:!0})),(0,le.h)(Da,{ref:q,open:_,openPosition:H,horizontalInset:N,theme:M,height:$},(0,le.h)(pa,{date:G,open:_,theme:M,onDateSelected:t=>{B(t);const n=t?Ke()(t,x):void 0,r=t?t.toISOString():void 0;A?A(r):e.handleFormChange(g,k,n,v),e.validateField(g,k,r,O,v),P(!1),te()},onCancel:()=>{X(),te()},isDateEnabled:J})),(0,le.h)(Fa,{theme:M,isFinalCardNode:T,name:k,cardInstanceId:g,subviewId:v,variableResolver:F}))))},qa=15,Ya=(0,p.startOfDay)(new Date),Ka=e=>{let{cardInstanceId:t,attributes:{format:n,name:r,label:i,defaultValue:o},validations:a,theme:s,horizontalInset:l,maxDateTime:d,selectedDate:c,selectedTime:u,isWorkflow:h,variableResolver:m,onValueChanged:g}=e;const v=new Date(o),[f,b]=ve(""),S=ye(null),y=ye([...Array(96).keys()].map((e=>({title:(0,p.format)((0,p.addMinutes)(Ya,e*qa),"h:mm A"),value:""+e*qa,disabled:!1})))),w=e=>{let t="";return e.forEach((e=>{e.disabled||(t=e.value)})),t};be((()=>{if(c){const t=y.current.map(((e,t)=>{const n=(0,p.addMinutes)(c,t*qa);return e.disabled=!!(d&&n>=d),e}));if(y.current=t,u&&d){if((0,p.addMinutes)(c,u||0)>d){const t=w(y.current);var e;if(t)null==g||g(t),null===(e=S.current)||void 0===e||e.setCurrentValue(t)}}}}),[d,c]);return(0,le.h)(Va,{ref:S,attributes:{name:r,label:i,format:n,values:y.current,defaultValue:(()=>{const e=Za(v);if(d){var t;const n=(0,p.differenceInMinutes)(d,(0,p.startOfDay)(v)),r=w(y.current);if(v>d)return Number(r);if(e<n)return e;const i=(0,p.differenceInMinutes)(d,(0,p.startOfDay)(d));return b((0,p.format)((0,p.addMinutes)(Ya,i),"h:mm A")),null===(t=S.current)||void 0===t||t.setCurrentValue(""),null==g||g(i.toString()),i}return e})(),placeholder:f},cardInstanceId:t,variableResolver:m,theme:s,horizontalInset:l,validations:a,isWorkflow:h,onValueChanged:g})},Za=e=>Math.ceil(((0,p.differenceInMinutes)(e,(0,p.startOfDay)(e))+5)/qa)*qa,Qa=rn("div")((e=>{let{workflowTheme:t,feedTheme:n,embedMode:r,cardMaximumWidth:i}=e;return Object.assign({backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:"static"},"modal-stream"===r?{position:"relative",height:"auto",width:"100%",maxWidth:i?`${i}px`:"initial",borderRadius:n.getShape("borderRadius.card")||"initial",border:`${n.getShape("border.card")||"0px"} solid ${n.getCSSColor("border.card")}`}:{})})),Ga=rn("div")({position:"static",top:"60px",bottom:"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"hidden",padding:"0px 20px 20px"}),Xa=rn("div")({overflow:"auto",paddingTop:"10px"}),Ja=e=>{let{workflowTheme:n,feedTheme:r}=e;const i=Ce(Gi),o=i.analyticsDispatcher,a=i.cardEventDispatcher,s=i.authTokenProvider,[l,d]=ve(void 0),[c,u]=ve(0),h=new Date;return(0,le.h)(Te.lj,{actions:(0,t.Y2)(Fe,Zt),mapToProps:e=>{const t=Pe(e);let n,r,i;return t&&Re(t)&&(n=t.cardInstanceId,r=t.source,i=t.cardExpiry),{screenTitle:e.application.customStrings.cardSnoozeTitle||"Remind me",embedMode:e.application.embedMode,cardMaximumWidth:e.cardFeed.cardMaximumWidth,snoozeCardInstanceId:n,source:r,snoozeCardExpiry:i}}},(e=>{const[t,i]=ve(h),[m,g]=ve(0),v=e.snoozeCardInstanceId,f=e.snoozeCardExpiry,b=e.source;if(!v||!b)return null;const S=e.screenTitle,y="modal-subview"===e.embedMode?Ei:Li;be((()=>{o.sendEvent({eventName:vt,cardInstanceId:v,cardViewState:"subview"})}),[]);return(0,le.h)(Qa,{workflowTheme:n,feedTheme:r,embedMode:e.embedMode,cardMaximumWidth:e.cardMaximumWidth,id:Ji},(0,le.h)(y,{title:S,theme:n,cardBorderRadius:r.getShape("borderRadius.card"),actionHandler:()=>{o.sendEvent({eventName:ft,cardInstanceId:v,cardViewState:"subview"}),e.navigateBack()}}),(0,le.h)(Ga,{class:"use-offset"},(0,le.h)(Xa,{class:"offset-child"},(0,le.h)(Ua,{cardInstanceId:v,attributes:{name:"snoozeDate",label:"Date",defaultValue:Ke()(h,"YYYY-MM-DD[T]00:00:00.000[Z]"),format:ga},isWorkflow:!0,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{i(new Date(e))},controlledDateValidator:f?e=>{if(f){return e<=new Date(f)}return!0}:void 0,horizontalInset:N}),(0,le.h)(Ka,{attributes:{name:"snoozeTime",label:"Time",defaultValue:h.toISOString(),format:ga},isWorkflow:!0,cardInstanceId:v,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{g(Number.parseInt(e))},selectedDate:t,selectedTime:m,maxDateTime:f?new Date(f):void 0,horizontalInset:N}),(0,le.h)(Pl,{isWorkflow:!0,clickHandler:()=>()=>{const n=es(t,m);if((0,p.isPast)(n)){const e=c+1;u(e),d({text:"Date must be in the future",messageId:`${e}`,cardInstanceId:v,action:"other"})}else e.navigateBack(),Ll(k().getState(),e,v,n,a,s,b)},text:"Done",theme:n,appearance:"primary"}))),(0,le.h)(Ri,{theme:n,message:l,actionTitle:"Dismiss",onDismiss:()=>{}}))}))},es=(e,t)=>(0,p.addMinutes)((0,p.startOfDay)(e),t);var ts=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const ns=e=>{switch(e.type){case"string":return e.defaultValue;case"number":return e.defaultValue.toString();case"boolean":return e.defaultValue?"true":"false";case"list":return e.defaultValue.join(", ");case"date":const t=new Date(e.defaultValue);return isNaN(t.getTime())?e.defaultValue:(0,p.format)(t,e.defaultFormatterOption||"");default:return String(e.defaultValue)}},rs=(e,t,n,r,i,o,a)=>ts(void 0,void 0,void 0,(function*(){const s=`feed/${e}${a?"?filters="+JSON.stringify(a):""}`,l=yield cp.get(s,t,r||"",{streamContainerId:e});if(304===l.response.status)return v.debug({level1:["Feed unchanged response received by HTTP"]}),{};if(200===l.response.status){v.debug({level1:["Feed update received by HTTP"]});let e=l.data.cardInstances,t=l.data.metadata;const r=e.length;o&&e.length>o&&(e=e.slice(0,o));const a=yield ss(e,n,i);return{lastModified:l.response.etag,cardInstances:e,metadata:t,unfilteredCardInstanceCount:r,runtimeVariables:a}}return{error:l.response.error}})),is=(e,t,n,r)=>ts(void 0,void 0,void 0,(function*(){const i=yield cp.post("response",{streamContainerId:e,cardInstanceId:t,values:n},r,{streamContainerId:e,cardInstanceId:t});return{ok:i.data&&1==i.data.ok,event:i.data&&i.data.event,error:i.response&&i.response.error}})),os=(e,t,n)=>ts(void 0,void 0,void 0,(function*(){const r=yield cp.post("dismiss",{streamContainerId:e,cardInstanceId:t},n,{streamContainerId:e,cardInstanceId:t});return{ok:r.data&&1==r.data.ok,event:r.data&&r.data.event,error:r.response.error}})),as=(e,t,n,r)=>ts(void 0,void 0,void 0,(function*(){const i=yield cp.post("snooze",{streamContainerId:e,cardInstanceId:t,interval:`PT${Math.max(0,n)}S`},r,{streamContainerId:e,cardInstanceId:t});return{ok:i.data&&!0===i.data.ok,event:i.data&&i.data.event,error:i.response.error}})),ss=(e,t,n)=>ts(void 0,void 0,void 0,(function*(){let r=e.filter((e=>e.runtimeVariables&&e.runtimeVariables.length)).map((e=>{const t=e.runtimeVariables||[];return{eventName:e.instance.eventName,lifecycleId:e.instance.lifecycleId,id:e.instance.id,runtimeVariables:new Map(t.map((e=>[e.name,ns(e)])))}}));if(r.length){let e=r;if(n){let i=!1;const o=new Promise((e=>{setTimeout((()=>{i||(console.error(`Resolution of runtime variables exceeded the timeout (${t}ms). Falling back to default values.`),e(r))}),t)})),a=r.map((e=>Object.assign(Object.assign({},e),{runtimeVariables:new Map(e.runtimeVariables)})));e=yield Promise.race([o,n(a).then((e=>(i=!0,e)))])}const i=e.reduce(((e,t)=>(r.filter((e=>e.id===t.id)).length>0&&e.set(t.id,t.runtimeVariables),e)),new Map);return{values:i}}return{}})),ls=()=>({updateTotalCardCount:(e,t,n)=>Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{lastModified:null!=n?n:e.cardFeed.lastModified,metadata:Object.assign(Object.assign({},e.cardFeed.metadata),{totalCards:t})})}),setStreamFilter:(e,t)=>Object.assign(Object.assign({},e),{cardFeed:Object.assign(Object.assign({},e.cardFeed),{streamFilter:t})}),finishExternalAction(e,t){var n;return Object.assign(Object.assign({},e),{externalAction:(null===(n=e.externalAction)||void 0===n?void 0:n.actionId)===t?void 0:e.externalAction})}}),ds=(e,t,n)=>({getTheme:r=>new un(e,r,t,n)});var cs=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const us="theme_cache",hs=()=>new Promise(((e,t)=>{const n=window.parent.indexedDB.open("AtomicSDK",1);n.onerror=e=>{t(e)},n.onsuccess=()=>{e(n.result)},n.onupgradeneeded=()=>{const r=n.result;n.transaction&&(n.transaction.oncomplete=()=>{e(n.result)},n.transaction.onerror=e=>{t(e)},n.transaction.onabort=e=>{t(e)});r.createObjectStore(us).createIndex("stream_container_id","stream_container_id",{unique:!0})}}));var ps=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const ms=(e,t)=>ps(void 0,void 0,void 0,(function*(){const n=`theme/${e}`,{data:r,response:i}=yield cp.get(n,void 0,t,{streamContainerId:e});if(200===i.status){if(r&&r.theme){try{yield((e,t,n)=>cs(void 0,void 0,void 0,(function*(){const r=yield hs();return new Promise(((i,o)=>{const a=r.transaction(us,"readwrite").objectStore(us).put({themePayload:t,eTag:n},e);a.onsuccess=()=>{r.close();const t=a.result;i({streamContainerId:e,themePayload:t.themePayload,eTag:t.eTag})},a.onerror=e=>{r.close(),o(e)}}))})))(e,r,i.etag||"")}catch(e){console.warn("Failed to update cached theme.",e)}return{theme:r||{}}}return{error:new Error("Invalid theme returned. Missing `theme` key in payload.")}}return{error:i.error}})),gs=e=>ps(void 0,void 0,void 0,(function*(){try{const t=yield(e=>cs(void 0,void 0,void 0,(function*(){const t=yield hs();return new Promise(((n,r)=>{const i=t.transaction(us,"readonly").objectStore(us).get(e);i.onsuccess=()=>{t.close(),n(i.result)},i.onerror=e=>{t.close(),r(e)}}))})))(e);return t&&t.themePayload&&t.themePayload.theme?{theme:t.themePayload,eTag:t.eTag}:null}catch(e){return console.warn("Failed to fetch cached theme.",e),null}}));class vs extends le.Component{componentDidCatch(e){this.props.onError?this.props.onError(e):console.error(e)}render(){return this.props.children}}const fs=e=>{let{fontFamilies:t}=e;return(0,le.h)("style",{dangerouslySetInnerHTML:{__html:t.map((e=>Ss(e))).join("\n")}})},bs={ttf:"truetype",otf:"opentype",woff:"woff",woff2:"woff2"},Ss=e=>{let{fontFamily:t,weight:n,style:r,src:i}=e;if(i&&0===i.split(".").length)throw new Error("Invalid file url provided for font.");const o=i?new URL(i).pathname:null;if(!o)return"";const a=o.split("."),s=a[a.length-1],l=bs[s];if(!l)return"";if(!t)return"";return`\n @font-face {\n font-family: "${t}";\n ${(i?`src: url('${i}') format('${l}');`:"")||""}\n font-weight: ${n||"normal"};\n font-style: ${r||"normal"};\n font-display: swap;\n }\n `},ys=e=>{let t,{theme:n,mode:r,singleLine:i}=e,o=n.getNumericFontSize("primary"),a=n.getCSSFontProperties("primary");if(a&&a.lineHeight&&o){const e=Math.ceil(.05*o);t=Number(a.lineHeight.replace("px",""))+e}const s=Object.assign({color:n.getCSSColor("text.secondary"),textOverflow:"ellipsis"},n.getCSSFontProperties("secondary")),l=Object.assign({color:n.getCSSColor("text.valueStacked",{skipFallback:!0})||n.getCSSColor("text.primary")},n.getCSSFontProperties("valueStacked",{skipFallback:!0})||n.getCSSFontProperties("primary")),d=Object.assign({color:n.getCSSColor("text.valueStacked")},n.getCSSFontProperties("valueStacked"));return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({backgroundColor:n.getCSSColor("background.component")},n.getCSSFontProperties("primary")),{border:"none",boxSizing:"border-box",height:"100%",width:"100%",display:"flex",flexGrow:"1",overflow:"hidden !important"}),r===ga?s:{}),r===va?l:{}),r===fa?d:{}),i&&t?{lineHeight:`${t}px`}:{}),{":focus":{outline:"none"},"::placeholder":{color:n.getCSSColor("text.hint")},whiteSpace:"pre-wrap"})},ws=rn("textarea")((e=>{let{theme:t,mode:n}=e;return Object.assign(Object.assign({},ys({theme:t,mode:n})),{resize:"none",boxSizing:"content-box",padding:"0px"})})),ks=rn("input")((e=>{let{theme:t,mode:n}=e;return Object.assign(Object.assign({},ys({theme:t,mode:n,singleLine:!0})),{textOverflow:"ellipsis",paddingLeft:"0px",paddingRight:"0px"})})),Cs=(e,t,n)=>{const{minimumLines:r,hasContent:i,labelFormat:o}=n||{};let a=0;"getComputedStyle"in window&&document.defaultView&&(a=parseInt(document.defaultView.getComputedStyle(e,null).getPropertyValue("line-height"))),e.style.height="auto",r&&(e.style.minHeight=r*a+"px"),1===t?e.style.height="auto":t>0?e.style.height=t*a+"px":o!==ga||i?e.scrollHeight-e.clientHeight>a/2&&(e.style.height=`${e.scrollHeight}px`):e.style.height="auto"},xs=rn("div")((e=>{let{mode:t}=e;return{display:t===va?"block":"flex",flexDirection:"column",flexGrow:"1"}}));let Is=null;const Os=Er.forwardRef(((e,t)=>{let{nodeKey:n,cardInstanceId:r,subviewId:i,attributes:{format:o,defaultValue:a,numberOfLines:s,name:l,thumbnailSrc:d,thumbnailAltText:c,label:u,placeholder:h,maxLength:p},minimumLines:m,validations:g,theme:v,isFinalCardNode:f,variableResolver:b,onValueChanged:S}=e;const y=ye(null),w=ye(a),k=`text-input-${r}-${l}`,[C,x]=ve(b(a)),I=1===s?ks:ws;be((()=>{const{current:{base:e}}=y,t=lt(r,l,i),n=!!C||!!t;t?(w.current=t,x(t)):st().handleFormChange(r,l,C,i),Cs(e,s,{minimumLines:m,hasContent:n,labelFormat:o})}),[]),be((()=>{if(a!==w.current){if(C===b(w.current)){const e=b(a);x(e),st().handleFormChange(r,l,e,i)}w.current=a}}),[a]);const O=b(h);return(0,le.h)(Te.lj,{actions:tt,mapToProps:()=>{}},(e=>(we(t,(()=>({clearInput:()=>{x(""),y.current.base&&Cs(y.current.base,s,{hasContent:!1,labelFormat:o}),e.handleFormChange(r,l,"",i)}}))),(0,le.h)(le.Fragment,null,(0,le.h)(Ia,{nodeKey:n,mode:o,label:b(u),labelFor:k,theme:v,isFinalCardNode:f,clickableLabel:!1,onClick:()=>{var e,t;null===(e=y.current)||void 0===e||null===(t=e.base)||void 0===t||t.focus()}},d&&(0,le.h)(Ma,{thumbnailUrl:b(d),altText:null!=c?c:"",theme:v}),(0,le.h)(xs,{mode:o},u&&o===va&&(0,le.h)(wa,{theme:v,mode:o,name:k},b(u)),(0,le.h)(I,{theme:v,mode:o,id:k,ref:y,placeholder:O,value:C,maxlength:p,className:"input-text",onInput:t=>{const{current:{base:n}}=y,{value:a}=t.target;x(a),Cs(n,s,{hasContent:!!a,labelFormat:o}),((e,t)=>{null!==Is&&(clearTimeout(Is),Is=null),Is=setTimeout((()=>{t(r,l,null!=e?e:void 0,g,i)}),200)})(a,e.validateField),e.handleFormChange(r,l,a,i),S&&S(a)},rows:"1"}))),(0,le.h)(Fa,{name:l,cardInstanceId:r,subviewId:i,theme:v,isFinalCardNode:f,variableResolver:b})))))})),Ms=rn("div")((e=>{let{theme:t}=e;return Object.assign({padding:"10px 20px",display:"flex",width:"100%",alignItems:"center",border:"0px"},t.getElementFocusCSSProperties())})),Ns=rn("p")((e=>{let{theme:t}=e;return Object.assign({padding:"0 10px 0 0",margin:"0",flexGrow:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:t.getCSSColor("text.labelInline",{skipFallback:!0})||t.getCSSColor("text.primary")},t.getCSSFontProperties("labelInline",{skipFallback:!0})||t.getCSSFontProperties("primary"))})),Ts=rn("div")((e=>{let{checked:t,theme:n}=e;return{width:"22px",height:"22px",border:t?`7px solid ${n.getCSSColor("icon.selectionIndicatorActive")}`:`1px solid ${n.getCSSColor("icon.selectionIndicator")}`,flexShrink:"0",borderRadius:"100%"}})),Fs=e=>{let{title:t,value:n,checked:r,onValueSelected:i,theme:o}=e;return(0,le.h)(Ms,{onClick:()=>{i(n)},role:"radio","aria-checked":r,theme:o,tabIndex:"-1"},(0,le.h)(Ns,{theme:o},t),(0,le.h)(Ts,{checked:r,theme:o}))},As=rn("div")((e=>{let{}=e;return{display:"flex",flexFlow:"column wrap",width:"100%"}})),Ls=rn("div")((e=>{let{}=e;return{display:"none"}})),Es=e=>{let{attributes:{items:t,title:n,name:r},theme:i,onValueChanged:o}=e;const[a,s]=ve(null),l=`radio-group-${r}`;return(0,le.h)(Ia,{mode:"inline",theme:i,hPadding:0},(0,le.h)(Ls,{id:l},n),(0,le.h)(As,{role:"radiogroup","aria-labelledby":l},(0,le.h)(fi,{theme:i},t.map((e=>(0,le.h)(Fs,{title:e.title,value:e.value,theme:i,checked:a===e.value,onValueSelected:e=>{s(e),o&&o(e)}}))))))},js=rn("div")((e=>{let{workflowTheme:t,feedTheme:n,embedMode:r,cardMaximumWidth:i}=e;return Object.assign({backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:"static"},"modal-stream"===r?{height:"auto",width:"100%",maxWidth:i?`${i}px`:"initial",borderRadius:n.getShape("borderRadius.card")||"initial",border:`${n.getShape("border.card")||"0px"} solid ${n.getCSSColor("border.card")}`}:{})})),Ds=rn("div")({position:"static",top:"60px",bottom:"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"hidden",padding:"0px 20px 20px"}),_s=rn("div")({overflow:"auto",paddingTop:"10px"}),Ps=rn("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({color:t.getCSSColor("text.error")},t.getCSSFontProperties("error")),{margin:"-10px 0 30px 0"})})),Hs=e=>{let{workflowTheme:n,feedTheme:r}=e;const i=Ce(Gi),o=i.analyticsDispatcher,a=i.cardEventDispatcher,s=ye(),[l,d]=ve(null),[c,u]=ve(null),[h,p]=ve(!1);return(0,le.h)(Te.lj,{actions:(0,t.Y2)(Fe,Zt),mapToProps:e=>{const t=Pe(e),n=t&&$e(t)?t:void 0;return{embedMode:e.application.embedMode,cardMaximumWidth:e.cardFeed.cardMaximumWidth,screenTitle:e.application.customStrings.votingFeedbackTitle||"Send feedback",validationMessage:e.application.customStrings.votingFeedbackValidationMessage||"Feedback is limited to 280 characters.",feedbackSentiment:null==n?void 0:n.sentiment,feedbackCardInstanceId:null==n?void 0:n.cardInstanceId,feedbackSource:null==n?void 0:n.source,textFeedback:null==n?void 0:n.textFeedback,textFeedbackLabel:null==n?void 0:n.textFeedbackLabel}}},(e=>{const t="modal-subview"===e.embedMode?Ei:Li,i=e.screenTitle,m=e.feedbackCardInstanceId,g=e.feedbackSource,v="positive"===e.feedbackSentiment&&e.textFeedback,f=[{title:"It's not relevant",value:"not-relevant"},{title:"I see this too often",value:"too-often"}];if(e.textFeedback&&f.push({title:"Something else",value:"other"}),!m||!g)return null;const b="positive"===e.feedbackSentiment?"Add optional feedback...":"Add your feedback...";return(0,le.h)(js,{workflowTheme:n,feedTheme:r,embedMode:e.embedMode,cardMaximumWidth:e.cardMaximumWidth,id:Ji},(0,le.h)(t,{title:i,theme:n,cardBorderRadius:r.getShape("borderRadius.card"),actionHandler:()=>{var t;u(null),null===(t=s.current)||void 0===t||t.clearInput(),e.navigateBack()}}),(0,le.h)(Ds,{class:"use-offset"},(0,le.h)(_s,{class:"offset-child"},"negative"===e.feedbackSentiment&&(0,le.h)(Es,{attributes:{title:i,name:"feedback-reason",items:f},isWorkflow:!0,cardInstanceId:m,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{d(e)}}),("other"===l||v)&&(0,le.h)(le.Fragment,null,(0,le.h)(Os,{ref:s,attributes:{name:"feedback-message",defaultValue:"",placeholder:e.textFeedbackLabel&&e.textFeedbackLabel.length>0?e.textFeedbackLabel:b,numberOfLines:0,maxLength:280,format:va},minimumLines:3,isWorkflow:!0,cardInstanceId:m,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{if(e.length>=280)return p(!0);p(!1),u(e)}}),h&&(0,le.h)(Ps,{theme:n,"data-testid":"feedback-validation-error"},e.validationMessage)),(0,le.h)(Pl,{isWorkflow:!0,clickHandler:()=>()=>{var t;if(!v&&null===l)return;if("other"===l&&(null===c||null==c||0===c.trim().length))return;const n="other"===l||v&&c?{message:c}:{};o.sendEvent({cardViewState:"topview",eventName:v?ht:pt,cardInstanceId:m,properties:Object.assign(Object.assign({source:g},"negative"===e.feedbackSentiment||null!==c?{reason:v?"other":l}:{}),n)}),e.feedbackReceived(m),a.dispatchCardEvent({type:v?Qi.VOTED_USEFUL:Qi.VOTED_NOT_USEFUL}),u(null),null===(t=s.current)||void 0===t||t.clearInput(),e.navigateBack()},text:"Submit",theme:n,appearance:"primary"}))))}))};var Rs=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const $s=()=>window.matchMedia("(prefers-color-scheme: dark)"),Vs=rn("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.toast")}})),Ws=e=>{let{store:n,onAnalyticsEvent:r,onCardEvent:i,onAuthTokenRequested:o,onError:a}=e;const s=ke((()=>({analyticsDispatcher:{sendEvent:(e,t)=>Rs(void 0,void 0,void 0,(function*(){r&&(void 0===t?yield r(e):yield r(e,t))}))},cardEventDispatcher:{dispatchCardEvent:e=>{i&&i(e)}},authTokenProvider:{requestToken:()=>Rs(void 0,void 0,void 0,(function*(){return yield o()}))},runtimeVariableResolver:void 0})),[r,i,o]);return(0,le.h)(vs,{onError:a},(0,le.h)(Gi.Provider,{value:s},(0,le.h)(Te.zt,{store:n},(0,le.h)(Te.lj,{actions:(0,t.Y2)(Fe,Zt,tt,Fe)},Bs))))},Bs=e=>{const{cardFeed:t,messages:n,themeLoading:r,themeLoaded:i,clearMessage:o,application:{interfaceStyle:a,streamContainerId:s},theme:l}=e,[d,c]=ve($s().matches?"dark":"light");if(be((()=>{!function(){Rs(this,void 0,void 0,(function*(){const e=yield gs(s);if(e)i({theme:e.theme}),ms(s,e.eTag);else{r();const e=yield ms(s);i(e)}}))}()}),[]),be((()=>{const e=e=>{c(e.matches?"dark":"light")};return $s().addEventListener("change",e),()=>{$s().removeEventListener("change",e)}}),[]),!l.status||!1===l.status.loaded)return null;const u=l.themePayload?ds(l.themePayload,d,a):void 0;if(!u)return null;const h=u.getTheme("feed"),p=Ce(Gi),m=p.cardEventDispatcher,g=p.analyticsDispatcher,v=p.authTokenProvider;return(0,le.h)(Vs,{theme:h},(0,le.h)(Ri,{theme:h,feedOrientation:Bh(t.horizontalContainerConfig),message:n.cardList,actionTitle:n.cardList&&["submit-failed","dismiss-failed","snooze-failed"].includes(n.cardList.action)?"Try again":"Dismiss",actionHandler:()=>{var t,r,i,o,a,s,l,d,c,u;const h=null===(t=n.cardList)||void 0===t?void 0:t.cardInstanceId,p=null===(r=n.cardList)||void 0===r?void 0:r.action;if(h&&p)switch(p){case"submit-failed":Al(e,e,h,!1,m,g,v,(null===(i=e.messages.cardList)||void 0===i?void 0:i.responseValues)||{},{payload:null===(o=e.messages.cardList)||void 0===o?void 0:o.payload,postSubmissionUrl:null===(a=e.messages.cardList)||void 0===a?void 0:a.postSubmissionUrl,subviewData:null===(s=e.messages.cardList)||void 0===s?void 0:s.subviewData,submitButtonName:null===(l=e.messages.cardList)||void 0===l?void 0:l.submitButtonName});break;case"dismiss-failed":const t=null===(d=e.messages.cardList)||void 0===d?void 0:d.source;t&&Fl(e,e,h,m,v,t);break;case"snooze-failed":const n=null===(c=e.messages.cardList)||void 0===c?void 0:c.snoozeDate,r=null===(u=e.messages.cardList)||void 0===u?void 0:u.source;n&&r&&Ll(e,e,h,n,m,v,r)}},onDismiss:()=>{o("cardList")},delay:500}))};function zs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Us;!function(e){e.STATE="state-update",e.ANALYTICS_EVENT="analytics-event-dispatched"}(Us||(Us={}));class qs{constructor(){zs(this,"channel",void 0),zs(this,"isOpen",!1),zs(this,"eventListeners",new Map),this.channel=new BroadcastChannel("stream-container-broadcast-channel"),this.isOpen=!0,window.addEventListener("pagehide",(()=>{this.close()}))}addEventListener(e,t,n){if(!("BroadcastChannel"in window))return v.error({level1:["BroadcastChannel API not supported in this browser"]});const r=n=>{n.type===e&&t(n)},i=n||`${e}-${Date.now().toString()}-${this.eventListeners.size}`;return this.channel.addEventListener(e,r),this.eventListeners.set(i,r),i}removeEventListener(e){if(!("BroadcastChannel"in window))return v.error({level1:["BroadcastChannel API not supported in this browser"]});const t=this.eventListeners.get(e);return!!t&&(this.channel.removeEventListener("message",t),this.eventListeners.delete(e),!0)}postMessage(e){if(!("BroadcastChannel"in window))return v.error({level1:["BroadcastChannel API not supported in this browser"]});this.channel.postMessage(e)}close(){this.channel.close(),this.isOpen=!1}}var Ys=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},Ks=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Zs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Qs=()=>window.matchMedia("(prefers-color-scheme: dark)"),Gs=()=>window.getComputedStyle(document.documentElement).getPropertyValue("font-size"),Xs={FEED_OVERLAY:"100",CARD_OVERLAY:"110",DROPDOWN:"40",HEADER:"30",BANNER:"20",TOAST:"11",OVERFLOW_MENU:"11",OVERFLOW_MENU_BUTTON:"10",CUSTOM_HEADER:"2"},Js=rn("div")((e=>{let{embedMode:t,feedOrientation:n}=e;const r={};return"launcher"===t?Object.assign({width:"calc(100% - 40px)",height:"0px",position:"absolute",bottom:"100px",right:"20px",left:"20px",transition:"height 0.2s"},"horizontal"===n?r:{}):{width:"100%",height:"100%"}})),el={fontFamily:'-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',height:"100%",overflow:"hidden"},tl=rn("div")((e=>{var t,n,r,i,o,a;let{embedMode:s,feedTheme:l,workFlowTheme:d,renderMode:c,cardHorizontalAlignment:u,modalContainerPositioning:h,modalContainerVerticalPadding:p}=e;const m="feed"===c?null==l?void 0:l.getNumericalPadding("stream"):null==d?void 0:d.getNumericalPadding("stream");return Object.assign(Object.assign(Object.assign({},el),"launcher"===s?{borderRadius:"20px",boxShadow:"0 2px 20px 0 rgba(0, 0, 0, 0.1)"}:{}),"modal-stream"===s?{display:"flex",justifyContent:{leading:"safe flex-start",center:"safe center",trailing:"safe flex-end"}[null!=u?u:"center"],alignItems:{top:"safe flex-start",center:"safe center",bottom:"safe flex-end"}[null!=h?h:"center"],backgroundColor:`${null==l?void 0:l.getCSSColor("background.modalContainer")}`,paddingTop:`${"top"===h?null!==(t=null!=p?p:null==m?void 0:m.top)&&void 0!==t?t:10:null!==(n=null==m?void 0:m.top)&&void 0!==n?n:10}px`,paddingRight:`${null!==(r=null==m?void 0:m.right)&&void 0!==r?r:10}px`,paddingBottom:`${"bottom"===h?null!==(i=null!=p?p:null==m?void 0:m.bottom)&&void 0!==i?i:10:null!==(o=null==m?void 0:m.bottom)&&void 0!==o?o:10}px`,paddingLeft:`${null!==(a=null==m?void 0:m.left)&&void 0!==a?a:10}px`,overflowY:"auto"}:{})})),nl=(Er.forwardRef(((e,n)=>{let{store:r,embedMode:i,applyCardFeedDeltaUpdates:o,cardCountChanged:a,onReady:s,runtimeVariableResolver:l,linkButtonPressed:d,submitButtonPressed:c,onCardListTutorialSeen:u,onAnalyticsEvent:h,onCardEvent:p,onError:m,onAuthTokenRequested:g,onCardFeedSubscribe:f,onModalStreamToggled:b,requestWebSocketReconnect:S,webSocketDisabled:y}=e;const[w,k]=ve(Qs().matches?"dark":"light"),[,C]=ve(Gs);be((()=>{const e=e=>{k(e.matches?"dark":"light")};Qs().addEventListener("change",e);const t=()=>{C(Gs)};return window.addEventListener("browser-font-changed",t),window.addEventListener("pageshow",(e=>{var t;e.persisted&&!(null===(t=x.containersBroadcastChannel)||void 0===t?void 0:t.isOpen)&&(x.containersBroadcastChannel=new qs)})),()=>{Qs().removeEventListener("change",e),window.removeEventListener("browser-font-changed",t)}}),[]);const x=ke((()=>({analyticsDispatcher:{sendEvent:(e,t)=>Ys(void 0,void 0,void 0,(function*(){h&&(void 0===t?yield h(e):yield h(e,t))}))},cardEventDispatcher:{dispatchCardEvent:e=>{p&&p(e)}},authTokenProvider:{requestToken:()=>Ys(void 0,void 0,void 0,(function*(){return yield g()}))},runtimeVariableResolver:l,containersBroadcastChannel:"BroadcastChannel"in window?new qs:void 0})),[h,p,g]),I=ye();return we(n,(()=>({pollCardList:()=>{var e;v.debug({level3:["Card feed polling initiated"]}),null===(e=I.current)||void 0===e||e.loadCards(!1)},cancelCardListPolling:()=>{var e;null===(e=I.current)||void 0===e||e.cancelCardListPolling()}}))),"toast"===i?(0,le.h)(Ws,{store:r,onAuthTokenRequested:g}):(0,le.h)(vs,{onError:m},(0,le.h)(Gi.Provider,{value:x},(0,le.h)(Te.zt,{store:r},(0,le.h)(Te.lj,{actions:(0,t.Y2)(Zt,ls),mapToProps:e=>{const{cardResponses:t}=e;return Ks(e,["cardResponses"])}},(e=>{let{cardFeed:t,pendingCardFeedUpdates:n,cardStates:r,navigationStack:i,cardFeedLoading:h,cardFeedLoaded:p,themeLoading:m,themeLoaded:g,finishExternalAction:v,application:{cardListRefreshInterval:k,streamContainerId:C,runtimeVariableResolutionTimeout:x,isPreview:O,embedMode:M,customStrings:N,cardLimit:T,firstLoadStyles:F,interfaceStyle:A},externalAction:L,theme:{themePayload:E}}=e;const j=i.items.length?i.items[i.items.length-1]:void 0;let D;switch(null==j?void 0:j.kind){case"media":D="Media";break;case"subview":D="Card Subview";break;case"snooze":D="Snooze Date & Time Selector";break;case"feedback":D="Send Feedback"}return(0,le.h)(Js,{embedMode:M,feedOrientation:Bh(t.horizontalContainerConfig),id:"action-cards-sdk-app-root",class:"atomic-sdk-root","data-contentLabel":D},(0,le.h)(rl,{ref:I,streamContainerId:C,runtimeVariableResolutionTimeout:x,runtimeVariablesResolver:l,themePayload:E,cardFeed:t,pendingCardFeedUpdates:n,cardStates:r,cardLimit:T,onThemeLoading:m,onThemeLoaded:g,onCardFeedLoading:h,onCardFeedLoaded:p,onCardFeedSubscribe:f,onModalStreamToggled:b,streamFilter:t.streamFilter,requestWebSocketReconnect:S,webSocketDisabled:y,currentNavigationItem:j,onReady:s,onCardCountChanged:a,applyCardFeedDeltaUpdates:o,cardListRefreshInterval:k,isPreview:O,cardListTitle:N.cardListTitle,embedMode:M,externalAction:L,finishExternalAction:v,onLinkButtonPressed:d,onSubmitButtonPressed:c,cardListTutorialSeen:t.tutorialSeen,onCardListTutorialSeen:u,firstLoadStyles:F,colourScheme:w,interfaceStyle:A,noInternetConnectionMessage:N.noInternetConnectionMessage,dataLoadFailedMessage:N.dataLoadFailedMessage,tryAgainTitle:N.tryAgainTitle}))})))))})),e=>"modal-subview"!==e);class rl extends le.Component{constructor(e){super(e),Zs(this,"pollCounter",0),Zs(this,"poll",void 0),this.poll=null}componentDidMount(){return Ys(this,void 0,void 0,(function*(){this.props.onReady(),nl(this.props.embedMode)&&this.loadTheme()}))}componentWillUnmount(){this.cancelCardListPolling()}componentDidUpdate(e){var n,r;const{cardFeed:i,externalAction:o}=e,{cardFeed:a,pendingCardFeedUpdates:s,cardStates:l,onCardCountChanged:d,externalAction:c,embedMode:u}=this.props;if("modal-subview"===u||"toast"===u)return;if("modal-stream"===u){var h,p,m,g,v,f;if(0===a.cardInstances.length)null===(h=window.frameElement)||void 0===h||h.classList.add("closed");else null===(p=window.frameElement)||void 0===p||p.classList.remove("closed");if(0===i.cardInstances.length&&a.cardInstances.length>0)null===(m=(g=this.props).onModalStreamToggled)||void 0===m||m.call(g,!0);if(i.cardInstances.length>0&&0===a.cardInstances.length)null===(v=(f=this.props).onModalStreamToggled)||void 0===v||v.call(f,!1)}const b=a.cardInstances.map((e=>e.instance.id)),S=i.cardInstances.map((e=>e.instance.id));var y;Yh(b,S)&&(null===(n=i.metadata)||void 0===n?void 0:n.totalCards)===(null===(r=a.metadata)||void 0===r?void 0:r.totalCards)||this.poll&&d&&d(a.cardInstances.length,null===(y=a.metadata)||void 0===y?void 0:y.totalCards);if(!i.tutorialSeen&&a.tutorialSeen&&this.props.onCardListTutorialSeen&&this.props.onCardListTutorialSeen(),c&&c.actionId!==(null==o?void 0:o.actionId)&&this.handleExternalAction(c),i.runtimeVariables.updateId!==a.runtimeVariables.updateId&&this.trackRuntimeVariablesChanged(a),Object.values(l).every((e=>null===e))&&s&&s.length>0){const e=(0,t.kv)((0,t.Y2)(Zt,ls),k());this.props.applyCardFeedDeltaUpdates(e,s)}}trackRuntimeVariablesChanged(e){const t=this.context.analyticsDispatcher,n=!1===e.runtimeVariableAnalyticsEnabled;e.cardInstances.forEach((r=>{if(r.runtimeVariables){var i;const o=null===(i=e.runtimeVariables.values)||void 0===i?void 0:i.get(r.instance.id);t.sendEvent({cardInstanceId:r.instance.id,cardViewState:"topview",eventName:mt,properties:{resolvedVariables:r.runtimeVariables.reduce(((e,t)=>(e[t.name]=(null==o?void 0:o.get(t.name))||"",e)),{})}},n)}}))}loadTheme(){return Ys(this,void 0,void 0,(function*(){const{streamContainerId:e,onThemeLoading:t,onThemeLoaded:n}=this.props,r=yield gs(e);if(r)n({theme:r.theme}),ms(e,r.eTag);else{t();n(yield ms(e))}const i=k().getState().theme.status;i&&i.loaded&&this.subscribeToCardFeedUpdates()}))}loadCards(e){return Ys(this,void 0,void 0,(function*(){const t=this.context,{onCardFeedLoading:n,onCardFeedLoaded:r,streamContainerId:i,runtimeVariableResolutionTimeout:o,cardFeed:a,runtimeVariablesResolver:s,cardLimit:l,streamFilter:d}=this.props;e||n();const c=yield rs(i,t.authTokenProvider,o,a.lastModified,s,l,d);e&&c.error||r(c),k().getState().cardFeed.status.loaded&&this.pollForNewCards()}))}handleExternalAction(e){return Ys(this,void 0,void 0,(function*(){const t=this.context,n=t.analyticsDispatcher,r=t.containersBroadcastChannel,i=()=>Ys(this,void 0,void 0,(function*(){var t;return n.sendEvent({cardInstanceId:e.cardInstanceId,cardViewState:e.cardViewState,eventName:ut,properties:Object.assign(Object.assign(Object.assign(Object.assign({linkMethod:e.linkMethod},(null===(t=e.urlLink)||void 0===t?void 0:t.url)?{url:e.urlLink.url}:{}),e.payload?{payload:e.payload.actionPayload}:{}),e.trigger?{detail:e.trigger}:{}),e.subviewData.subviewId?Object.assign(Object.assign({},e.subviewData),{subviewLevel:1}):{})})})),o=()=>{var t;e.payload?(this.props.finishExternalAction(e.actionId),"linkButton"!==e.trigger&&"image"!==e.trigger||!this.props.onLinkButtonPressed?"submitButton"===e.trigger&&this.props.onSubmitButtonPressed&&this.props.onSubmitButtonPressed(e.payload):this.props.onLinkButtonPressed(e.payload)):e.urlLink&&(this.props.finishExternalAction(e.actionId),window.open(e.urlLink.url,null!==(t=e.urlLink.target)&&void 0!==t?t:"_blank"))};if(r){const t=`${e.actionId}-app-external-action`;r.addEventListener("message",(n=>{var i;if(n.data.type!==Us.ANALYTICS_EVENT)return;const a=null===(i=n.data)||void 0===i?void 0:i.eventQueued;a.eventName===ut&&a.cardInstanceId===e.cardInstanceId&&r&&(r.removeEventListener(t),o())}),t),yield i()}else yield i(),o()}))}subscribeToCardFeedUpdates(){return this.props.webSocketDisabled?this.loadCards(!1):this.props.onCardFeedSubscribe()}pollForNewCards(){const{isPreview:e,cardListRefreshInterval:t,embedMode:n}=this.props;!e&&0!==t&&nl(n)&&(this.poll=setTimeout((()=>Ys(this,void 0,void 0,(function*(){this.props.webSocketDisabled?yield this.loadCards(!0):this.pollCounter<9?(this.pollCounter++,yield this.loadCards(!0)):(this.pollCounter=0,v.debug({level3:["Attempt to reconnect websocket initiated"]}),this.props.requestWebSocketReconnect())}))),t))}cancelCardListPolling(){this.poll&&v.debug({level3:["Card feed polling cancelled"]}),clearTimeout(this.poll),this.poll=null,this.pollCounter=0}render(e){var t;let{currentNavigationItem:n,embedMode:r,cardFeed:i,firstLoadStyles:o,colourScheme:a,interfaceStyle:s,noInternetConnectionMessage:l,dataLoadFailedMessage:d,tryAgainTitle:c}=e;const u=k().getState(),h="modal-subview"===r;if(!u.theme.status)return h?null:(0,le.h)(tl,{embedMode:r,id:Ji});if(!1===u.theme.status.loaded)return h?null:(0,le.h)(tl,{embedMode:r,id:Ji},(0,le.h)(Zi,{embedMode:r,textColor:o.textColor,loadingIconColor:o.loadingSpinnerColor,buttonColor:o.buttonTextColor,backgroundColor:o.backgroundColor,onRetry:()=>{this.loadTheme()},state:u.theme.status.errorState,noInternetConnectionMessage:l,dataLoadFailedMessage:d,tryAgainTitle:c}));const{themePayload:p}=this.props;let m;m="standalone"===r&&(null===(t=i.horizontalContainerConfig)||void 0===t?void 0:t.enabled)||"single-card"===r?"feed":Ve(n)?"media":He(n)?"subview":Re(n)?"snooze":$e(n)?"feedback":h?void 0:"feed";const g=p?ds(p,a,s):void 0;if(!m||!g)return null;const v=g.getTheme("feed"),f=g.getTheme("workflow");return(0,le.h)(le.Fragment,null,(0,le.h)(tl,{embedMode:r,feedTheme:v,workFlowTheme:f,renderMode:m,cardHorizontalAlignment:i.cardHorizontalAlignment,modalContainerPositioning:i.modalContainerPositioning,modalContainerVerticalPadding:i.modalContainerVerticalPadding,className:"feed-container",role:"main"},"subview"===m&&(0,le.h)(bo,{workflowTheme:f,feedTheme:v}),"media"===m&&(0,le.h)(To,{workflowTheme:f,feedTheme:v}),"feed"===m&&(0,le.h)(lo,{theme:v,onRetry:()=>(this.props.onCardFeedLoading(),this.subscribeToCardFeedUpdates())}),"snooze"===m&&(0,le.h)(Ja,{workflowTheme:f,feedTheme:v}),"feedback"===m&&(0,le.h)(Hs,{workflowTheme:f,feedTheme:v})),(0,le.h)(fs,{fontFamilies:v.getFontFamilies()}),(0,le.h)(Cn,null))}}Zs(rl,"contextType",Gi);const il=new Map,ol=on({to:{opacity:"0"}}),al=on({to:{opacity:"1"}}),sl=on({to:{opacity:"1",width:"400%",paddingTop:"400%"}}),ll=on({to:{opacity:"0",transform:"scale(0.9)"}}),dl=on({from:{opacity:"1",transform:"scale(1)"},to:{opacity:"0",transform:"scale(0)"}}),cl=e=>{if(il.has(`slideOutleftPadding-${e}`))return il.get(`slideOutleftPadding-${e}`);const t=on({to:{transform:`translateX(calc(-120% - ${e}px))`}});return il.set(`slideOutleftPadding-${e}`,t),t},ul=on({from:{left:"100%"},to:{left:"50%"}}),hl=on({from:{},to:{height:"0px"}}),pl=on({from:{},to:{width:"0px"}}),ml=e=>{let{theme:t,animationState:n}=e;return(0,le.h)(le.Fragment,null,(0,le.h)(kl,{theme:t,class:n,"aria-hidden":"true"}),(0,le.h)(Yn,{fillColor:t.getCSSColor("icon.cardCompletion"),className:"tick-icon",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},"aria-hidden":!0}))},gl=e=>{let{animationState:t,theme:n}=e;return(0,le.h)(le.Fragment,null,(0,le.h)("div",{class:`${t||""} dismiss-icon`,style:{background:n.getCSSColor("background.quickActionPrimary"),pointerEvents:"none"},"aria-hidden":"true"},(0,le.h)(Kn,{style:{fill:n.getCSSColor("icon.quickActionPrimary")}})),(0,le.h)("div",{class:`${t||""} clock-icon`,style:{background:n.getCSSColor("background.quickActionSecondary"),pointerEvents:"none"},"aria-hidden":"true"},(0,le.h)(Zn,{style:{fill:n.getCSSColor("icon.quickActionSecondary")}})))},vl=rn("div")((e=>{let{theme:t,topAlign:n,viewState:r,embedMode:i,useHorizontalStyles:o,spaceBetweenCards:a,cardMaximumWidth:s,cardHorizontalAlignment:l}=e,d="rgba(255,255,255,1)";return"subview"===r?d=(Sn(t.getCSSColor("background.default")),t.getCSSColor("background.default")):Sn(t.getCSSColor("background.card"))&&!Sn(t.getCSSColor("background.default"))?d=t.getCSSColor("background.default"):Sn(t.getCSSColor("background.card"))||(d=t.getCSSColor("background.card")),d=(e=>{const t=e.match(/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,?\s*(\d*(?:\.\d+)?)?\s*\)$/);if(t){const[,e,n,r]=t;return`rgba(${e},${n},${r},1)`}return v.warn({level3:["Expected a valid RGBA color string, but received:",e,"Returning the original value."]}),e})(d),Object.assign(Object.assign(Object.assign({position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"all",top:"0",bottom:"0",zIndex:Xs.CARD_OVERLAY,padding:"15px 10px",backgroundColor:d,border:`${t.getShape("border.card")} solid ${t.getCSSColor("border.card")}`,borderRadius:t.getShape("borderRadius.card")||"initial"},n?{}:{display:"flex"}),o?{width:`calc(100% - ${a}px)`}:{}),"modal-stream"===i?{maxWidth:s?`${s}px`:"initial",margin:"0 auto",left:"leading"===l?"0px":"initial",right:"trailing"===l?"0px":"initial"}:{})})),fl=rn("div")((e=>{let{topAlign:t}=e;return Object.assign({width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},t?{marginTop:"15vh"}:{})})),bl=rn("div")({}),Sl=rn("div")((e=>{let{theme:t,maxLines:n}=e;return Object.assign({width:"100%",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:`${n}`,textAlign:"center",marginTop:"20px",color:t.getCSSColor("text.processingStateMessage")},t.getCSSFontProperties("processingStateMessage",{skipFallback:!0})||{})})),yl=rn("button")((e=>{let{theme:t}=e;return Object.assign({width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"15px",padding:"8px",background:"transparent",border:"0",outline:"none",fontWeight:"bold",cursor:"pointer",color:t.getCSSColor("text.processingStateButtonLabel")},t.getCSSFontProperties("processingStateButtonLabel",{skipFallback:!0})||{})})),wl=e=>{let{viewState:t,onCancelUpload:n,theme:r,renderOverlay:i,cardMaximumWidth:o,cardHorizontalAlignment:a,spaceBetweenCards:s}=e;return i?(0,le.h)(Te.lj,{mapToProps:e=>{var t;const n=Pe(e),r=n&&He(n);return{customStrings:e.application.customStrings,embedMode:e.application.embedMode,presentingSubview:r,horizontalStreamContainer:!!(null===(t=e.cardFeed.horizontalContainerConfig)||void 0===t?void 0:t.enabled)}}},(e=>{var i,l,d,c;const u=ye(null),h=ye(null),p=ye(null),m=ye(null),[g,v]=ve(0),f=null!==(i=null===(d=e.customStrings)||void 0===d?void 0:d.processingStateMessage)&&void 0!==i?i:"Sending, please wait...",b=null!==(l=null===(c=e.customStrings)||void 0===c?void 0:c.processingStateCancelButtonTitle)&&void 0!==l?l:"Cancel process";if(be((()=>{var e,t,n,r,i,o,a,s;const l=null===(e=u.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.clientHeight,d=null===(n=h.current)||void 0===n||null===(r=n.base)||void 0===r?void 0:r.clientHeight,c=null===(i=p.current)||void 0===i||null===(o=i.base)||void 0===o?void 0:o.clientHeight,g=null===(a=m.current)||void 0===a||null===(s=a.base)||void 0===s?void 0:s.clientHeight;if(l&&d&&c&&g){const e=l-d-g-30-20-15,t=parseFloat(getComputedStyle(p.current.base).lineHeight),n=Math.floor(e/t);v(n)}}),[f,b]),"single-card"===e.embedMode&&e.presentingSubview)return null;if("standalone"===e.embedMode&&e.horizontalStreamContainer&&e.presentingSubview)return null;const S="subview"===t&&"standalone"===e.embedMode;return(0,le.h)(vl,{theme:r,class:"subview"===t?"use-offset":"",topAlign:S,viewState:t,embedMode:e.embedMode,useHorizontalStyles:e.horizontalStreamContainer&&!e.presentingSubview,spaceBetweenCards:s,cardMaximumWidth:o,cardHorizontalAlignment:a},(0,le.h)(fl,{ref:u,theme:r,topAlign:S},(0,le.h)(bl,{ref:h},(0,le.h)(kn,{stopColor:r.getCSSColor("icon.processingStateSpinner"),size:30})),(0,le.h)(Sl,{ref:p,theme:r,maxLines:Math.max(1,g)},f),(0,le.h)(yl,{ref:m,theme:r,onClick:n},b)))})):null},kl=rn("div")((e=>{let{theme:t}=e;return{background:t.getCSSColor("background.cardCompletion"),position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",transformOrigin:"center",borderRadius:"999px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",opacity:"0",width:"0px",paddingTop:"0px",".submitting":{animation:`${sl} 0.6s ease 0.2s forwards`},".submitted":{animation:`${sl} 0s ease forwards`},".submitted-subview":{animation:`${sl} 0.6s ease 0.2s forwards`}}})),Cl=function(e,t){var n,r,i,o,a;let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const l=e.getNumericalPadding("card"),d=null!==(n=e.getNumericalPadding("stream").left)&&void 0!==n?n:10;return{cardCompletion:{" .tick-icon":{opacity:"0"},".submitting":{overflow:"hidden",padding:`${null!==(r=l.top)&&void 0!==r?r:M}px ${(null!==(i=l.right)&&void 0!==i?i:O)+1}px ${null!==(o=l.bottom)&&void 0!==o?o:M}px ${(null!==(a=l.left)&&void 0!==a?a:O)+1}px`},".submitting .tick-icon":{animation:`${al} 0.2s ease 0.2s forwards`},".submitting .card-nodes":{animation:`${ol} 0.2s ease forwards`},".submitted":Object.assign({overflow:"hidden"},"vertical"!==s?{transform:`translateX(calc(-120% - ${d}px))`,opacity:"0"}:{animation:`${ll} 0.4s ease forwards`}),".submitted .tick-icon":{animation:`${al} 0.2s ease forwards`},".submitted .card-nodes":{opacity:"0"},".submitted-subview":Object.assign({animation:`${ll} 0.4s ease 0.8s forwards`,overflow:"hidden"},"vertical"!==s?{transform:`translateX(calc(-120% - ${d}px))`,opacity:"0"}:{}),".submitted-subview .tick-icon":{animation:`${al} 0.2s ease 0.2s forwards`},".submitted-subview .card-nodes":{animation:`${ol} 0.2s ease forwards`}},dismissal:{".dismissing":Object.assign({},"vertical"!==s||"modal-stream"===t?{animation:`${ol} 0.3s ease forwards`}:{animation:`${cl(d)} 0.4s ease forwards`}),".dismissed":Object.assign({transform:`translateX(calc(-120% - ${d}px))`},"vertical"!==s||"modal-stream"===t?{animation:`${hl}`,opacity:"0"}:{})},snooze:{".snoozing":Object.assign({},"vertical"!==s||"modal-stream"===t?{animation:`${ol} 0.3s ease forwards`}:{animation:`${cl(d)} 0.4s ease forwards`}),".snoozed":Object.assign({transform:`translateX(calc(-120% - ${d}px))`},"vertical"!==s||"modal-stream"===t?{animation:`${hl}`,opacity:"0"}:{})}}},xl=function(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertical";const i=null!==(n=e.right)&&void 0!==n?n:10;return{cardCompletion:{".submitted":Object.assign({overflow:"hidden"},"vertical"===r?{animation:`${hl} 0.4s ease 0.2s forwards`}:{animation:`${pl} 0.4s ease 0.2s forwards`}),".submitted .clock-icon":Object.assign({},"horizontal"===r?{width:"0"}:{}),".submitted .dismiss-icon":Object.assign({},"horizontal"===r?{width:"0"}:{}),".submitted-subview":Object.assign({overflow:"hidden"},"vertical"===r?{animation:`${hl} 0.4s ease 1.0s forwards`}:{animation:`${pl} 0.4s ease 0.2s forwards`})},dismissal:{position:"relative"," .dismiss-icon":Object.assign({position:"absolute",top:"50%",width:"50px",height:"50px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50px"},"vertical"!==r||"modal-stream"===t?{opacity:"0",left:"50%",margin:"-29px 0 0 -20px"}:{left:`calc(120% + ${i+25}px)`,margin:"-25px 0 0 -25px"}),".dismissing .dismiss-icon":Object.assign({},"vertical"!==r||"modal-stream"===t?{animation:`${al} 0.3s ease 0.3s forwards`}:{animation:`${ul} 0.4s ease forwards`}),".dismissed":Object.assign({overflow:"hidden"},"vertical"!==r||"modal-stream"===t?{animation:`${pl} 0.3s ease 0.3s forwards`}:{animation:`${hl} 0.4s ease 0.4s forwards`}),".dismissed .dismiss-icon":Object.assign({left:"50%"},"vertical"!==r||"modal-stream"===t?{animation:`${dl} 0.3s ease forwards`}:{animation:`${dl} 0.4s ease forwards`}),".dismissed .clock-icon":Object.assign({},"vertical"!==r?{width:"0"}:{})},snooze:{position:"relative"," .clock-icon":Object.assign({position:"absolute",top:"50%",width:"50px",height:"50px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50px"},"vertical"!==r||"modal-stream"===t?{opacity:"0",left:"50%",margin:"-29px 0 0 -20px"}:{left:`calc(120% + ${i+25}px)`,margin:"-25px 0 0 -25px"}),".snoozing .clock-icon":Object.assign({},"vertical"!==r||"modal-stream"===t?{animation:`${al} 0.3s ease 0.3s forwards`}:{animation:`${ul} 0.4s ease forwards`}),".snoozed":Object.assign({overflow:"hidden"},"vertical"!==r||"modal-stream"===t?{animation:`${pl} 0.3s ease 0.3s forwards`}:{animation:`${hl} 0.4s ease 0.4s forwards`}),".snoozed .clock-icon":Object.assign({left:"50%"},"vertical"!==r?{animation:`${dl} 0.3s ease forwards`}:{animation:`${dl} 0.4s ease forwards`}),".snoozed .dismiss-icon":Object.assign({},"vertical"!==r?{width:"0"}:{})},center:{position:"relative",".centering":{position:"relative",left:"50%",transform:"translateX(-50%)",transition:"left 0.4s ease-out"}}}},Il=600,Ol=600,Ml=600,Nl=e=>{switch(e){case"submitted":return 400;case"submitted-subview":return 1200;case"dismissed":case"snoozed":return 800;case"centering":return 500;default:return 0}};var Tl=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const Fl=(e,t,n,r,i,o)=>Tl(void 0,void 0,void 0,(function*(){const{dismissingCard:a,dismissedCard:s,failedToDismissCard:l}=t;if(e.application.isPreview)return;a(n);const d=new Promise((e=>setTimeout(e,Ol)));v.debug({level1:["Dismiss card sent by HTTP"]});const c=yield os(e.application.streamContainerId,n,i);yield Promise.allSettled([d,c]),c.ok?(v.debug({level1:["Dismiss card sent by HTTP: success"]}),s(n),je().clearSubviewsForCardInstance(n),window.AtomicUploadService.cancelUploadForCard(e.application.containerInstanceId,n),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),r.dispatchCardEvent({type:Qi.DISMISSED,eventPayload:c.event})):(v.error({level1:["Dismiss card sent by HTTP: failed"]}),l(n,o,c.error),r.dispatchCardEvent({type:Qi.DISMISS_FAILED}))})),Al=function(e,t,n){var r=arguments;return Tl(this,void 0,void 0,(function*(){var i,o,a;let s=r.length>3&&void 0!==r[3]&&r[3],l=r.length>4?r[4]:void 0,d=r.length>5?r[5]:void 0,c=r.length>6?r[6]:void 0,u=r.length>7?r[7]:void 0,h=r.length>8?r[8]:void 0;const{submittingCard:p,submittedCard:m,failedToSubmitCard:g,finishSubview:f,openExternalUrl:b,handleSubmitButtonPayload:S}=t,{postSubmissionUrl:y,payload:w,subviewData:k,submitButtonName:C,cancelSubmitCallback:x}=h||{};if(e.application.isPreview)return;const I=e=>{g(n,s,u,e,{postSubmissionUrl:y,subviewData:k,payload:w,submitButtonName:C}),l.dispatchCardEvent({type:Qi.SUBMIT_FAILED})};let O=!1;const M=(null==k?void 0:k.subviewId)?null===(i=e.cardResponses[n])||void 0===i||null===(o=i.subviews)||void 0===o?void 0:o[null==k?void 0:k.subviewId]:null===(a=e.cardResponses[n])||void 0===a?void 0:a.responses,N=Object.assign(Object.assign({},u),M||{});for(const[e,t]of Object.entries(M||{}))t&&"object"==typeof t&&"image"===t.type&&"string"==typeof t.destinationFilename&&"string"==typeof t.targetBucketId&&(O=!0,N&&(N[e]={filename:t.destinationFilename,targetBucketId:t.targetBucketId}));if(O){const r=window.frameElement,i=r.classList.contains("modal-subview");i&&r.classList.add("uploading-files"),t.startCardFileUpload(n),t.setCardFeedOverlay(!0);const o=yield window.AtomicUploadService.uploadFilesForCard(n,e.application.containerInstanceId,c,d,{subviewData:k,cancelSubmitCallback:x});if(t.finishCardFileUpload(n),!window.AtomicUploadService.getIsUploadingStatus(e.application.containerInstanceId)&&t.setCardFeedOverlay(!1),i&&r.classList.remove("uploading-files"),!o.success)return o.cancelledUploads?null:(v.error({level1:[`Submit of card ${n} failed due to file upload failure`]}),I(o.error))}p(n);const T=new Promise((e=>setTimeout(e,Il)));v.debug({level1:["Submit card sent by HTTP"]});const F=yield is(e.application.streamContainerId,n,Object.assign(Object.assign({},N),C?{[C]:null}:{}),c);yield Promise.allSettled([T,F]),F.ok?(v.debug({level1:["Submit card sent by HTTP: success"]}),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),f(),(null==y?void 0:y.url)&&b(n,s?"subview":"topview",k||{},"url","submitButton",y),w&&S(n,k||{},w),m(n,s),je().clearSubviewsForCardInstance(n),l.dispatchCardEvent({type:Qi.SUBMITTED,eventPayload:F.event})):(v.error({level1:["Submit card sent by HTTP: failed"]}),I(F.error))}))},Ll=(e,t,n,r,i,o,a)=>Tl(void 0,void 0,void 0,(function*(){const s=(0,p.differenceInSeconds)(r,new Date),{snoozingCard:l,snoozedCard:d,failedToSnoozeCard:c}=t;if(e.application.isPreview)return;l(n);const u=new Promise((e=>setTimeout(e,Ml)));v.debug({level1:["Snooze card sent by HTTP"]});const h=yield as(e.application.streamContainerId,n,s,o);yield Promise.allSettled([u,h]),h.ok?(v.debug({level1:["Snooze card sent by HTTP: success"]}),d(n,r),je().clearSubviewsForCardInstance(n),st().clearCardForm(n),window.AtomicUploadService.cancelUploadForCard(e.application.containerInstanceId,n),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),i.dispatchCardEvent({type:Qi.SNOOZED,eventPayload:h.event})):(v.error({level1:["Snooze card sent by HTTP: failed"]}),c(n,r,a,h.error),i.dispatchCardEvent({type:Qi.SNOOZE_FAILED}))})),El=(e,t,n,r,i)=>{n.sendEvent({cardInstanceId:e,cardViewState:"topview",eventName:ht,properties:{source:i}}),t.feedbackReceived(e),r.dispatchCardEvent({type:Qi.VOTED_USEFUL})};var jl=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};function Dl(){return Dl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dl.apply(this,arguments)}const _l=(e,t,n,r)=>jl(void 0,void 0,void 0,(function*(){var i;const o=null===(i=(yield ss([n],t,e)).values)||void 0===i?void 0:i.get(n.instance.id);o&&Object.entries(r).forEach((i=>{let[a,s]=i;"string"==typeof s?r[a]=_h(s,o):Uh(s)&&_l(e,t,n,s)}))})),Pl=e=>{let{nodeKey:n,index:r,localIndex:i,isWorkflow:o,clickHandler:a,text:s,icon:l,iconUrl:d,iconAltText:c,theme:u,appearance:h,loading:p,type:m,urlLink:g}=e;return(0,le.h)(Te.lj,{actions:(0,t.Y2)(tt,Fe,Zt),mapToProps:()=>{}},(e=>(0,le.h)(qn,Dl({},n&&{nodeKey:n},r&&{index:r},i&&{localIndex:i},{isWorkflow:o,clickHandler:a(e),text:s,icon:l,iconUrl:d,iconAltText:c,theme:u,appearance:h,loading:p,type:m,urlLink:g}))))},Hl=rn("div")((e=>{let{isWorkflow:t,feedOrientation:n}=e;return Object.assign(Object.assign({},t?{position:"relative"}:{}),t||"horizontal"!==n?{}:{display:"flex",flexDirection:"column",flexGrow:"1",justifyContent:"flex-end"})})),Rl=e=>{let{children:t,isWorkflow:n,feedOrientation:r,initializeFormStore:i}=e;return be((()=>{i()}),[]),(0,le.h)(Hl,{isWorkflow:n,feedOrientation:r},t)},$l=(e,t,n,r)=>()=>{e.createResponseWithDefaults(t,n,r)},Vl=rn("div")((e=>{let{theme:t,appearance:n,isFirstCardNode:r,isFinalCardNode:i,headlineFontProperties:o}=e;const a=vn(n),s=t.getShape("padding.elementBottom",{skipFallback:!0});return{color:t.getCSSColor(`text.headline${a}`),display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${o.lineHeight} 1fr`,padding:s?`0px 0px ${i?"0px":s}`:`${r?0:10}px 0px ${i?0:10}px`}})),Wl=rn("h2")((e=>{let{theme:t,appearance:n}=e;return Object.assign(Object.assign({gridColumnStart:"2",gridRowStart:"span 2"},t.getCSSFontProperties(`headline${vn(n)}`)),{margin:"0",whiteSpace:"pre-wrap","overflow-wrap":"break-word","word-wrap":"break-word","word-break":"break-word"})})),Bl="22px",zl=(e,t)=>{const n=gn(t);return Object.assign(Object.assign({margin:"0",paddingLeft:"0",listStyleType:"none"},e.getCSSFontProperties(`body${n}`)),{color:e.getCSSColor(`text.body${n}`)})},Ul=(e,t)=>{const n=gn(t);let r;return qh(r)||(r=e.getCSSFontProperties(`bullet${n}`)),{"> li":{display:"flex",margin:"0 0 5px"},"> li.without-icon:before":Object.assign({content:'"•"',textAlign:"center",flexBasis:Bl,minWidth:Bl,marginRight:"10px",color:e.getCSSColor(`icon.bullet${n}`)},r?{fontSize:r.fontSize,lineHeight:r.lineHeight}:{}),"> li.with-icon i":{flexBasis:Bl,minWidth:Bl,textAlign:"center"},"> li:last-child":{marginBottom:"0px"}}},ql=rn("ul")((e=>{let{theme:t,appearance:n,isFirstCardNode:r,isFinalCardNode:i}=e;const o=t.getShape("padding.elementBottom",{skipFallback:!0});return Object.assign(Object.assign(Object.assign(Object.assign({},zl(t,n)),{textAlign:"left"}),Ul(t,n)),{padding:o?`0px 0px ${i?"0px":o} 0px`:`${r?0:10}px 0px ${i?0:10}px 0px`})})),Yl=rn("ol")((e=>{let{theme:t,appearance:n,isFirstCardNode:r,isFinalCardNode:i}=e;const o=t.getShape("padding.elementBottom",{skipFallback:!0});return Object.assign(Object.assign(Object.assign(Object.assign({},zl(t,n)),{textAlign:"left"}),Ul(t,n)),{padding:o?`0px 0px ${i?"0px":o} 5px`:`${r?0:10}px 20px ${i?0:10}px 0px`,counterReset:"item","> li.without-icon:before":Object.assign(Object.assign(Object.assign({},zl(t,n)["> li.without-icon:before"]),Ul(t,n)["> li.without-icon:before"]),{content:'counter(item) "."',counterIncrement:"item"})})})),Kl=rn("ul")((e=>{let{theme:t,appearance:n,isFirstCardNode:r,isFinalCardNode:i}=e;const o=t.getShape("padding.elementBottom",{skipFallback:!0});return Object.assign(Object.assign({},zl(t,n)),{padding:o?`0px 0px ${i?"0px":o} 5px`:`${r?0:10}px 20px ${i?0:10}px 0px`," li":{display:"inline"}," li:before":{content:'", "'}," li:first-child:before":{content:'""'}})}));class Zl{constructor(){this.tagState=new Map,this.tagState.set("__",{open:!1}),this.tagState.set("**",{open:!1}),this.tagState.set("_",{open:!1}),this.tagState.set("*",{open:!1})}toggle(e){const t=this.tagState.get(e);t&&(t.open=!t.open,this.tagState.set(e,t))}}const Ql={"":["<em>","</em>"],_:["<strong>","</strong>"],"\n":["</p><p>"]," ":["<br />"]};function Gl(e){return(e+"").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Xl(e){return("<p>"+Jl(e)+"</p>").replace(/<p><\/p>/g,"")}function Jl(e,t){const n=new Zl;let r,i,o,a,s,l=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([*+-]|\d+\.)\s+.*)+)|(?:\!\[([^\]]*?)\]\(([^\)]+?)\))|(\[)|(\](?:\(([^\)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(\-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|(__|\*\*|[_*])|( \n\n*|\n{2,})/gm,d=[],c="",u=t||{},h=0;function p(e){var t=Ql[e.replace(/\*/g,"_")[1]||""],n=d[d.length-1]==e;return t?t[1]?(d[n?"pop":"push"](e),t[0|n]):t[0]:e}function m(){let e="";for(;d.length;)e+=p(d[d.length-1]);return e}function g(e){return e.replace(/&%[0-9]+%;/g,(e=>String.fromCharCode(+e.substring(2,e.length-2))))}for(e=e.replace(/\\([*_[\]{}`<>()#+\-!|.])/g,(e=>`&%${e.charCodeAt(1)}%;`)),e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,(function(e,t,n){return u[t.toLowerCase()]=n,""})).replace(/^\n+|\n+$/g,"");o=l.exec(e);){i=e.substring(h,o.index),h=l.lastIndex,r=o[0];let t=!1;if(i.match(/[^\\](\\\\)*\\$/));else if(o[6])s=o[6],s.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),a=Jl((f=o[5].replace(/^\s*[>*+.-]/gm,"")).replace(RegExp("^"+(f.match(/^(\t| )+/)||"")[0],"gm"),"")),">"!==s&&(t=!0,s=s.match(/\./)?"ol":"ul",a=a.replace(/^(.*)(\n|$)/gm,"<li><span>$1</span></li>")),r="<"+s+">"+a+"</"+s+">";else if(o[10]){const e=(o[11]||"").match(/subview:(?<viewId>.*)/);if(e){const t=((e||{}).groups||{}).viewId?e.groups.viewId:"";c=c.replace("<a>",`<a tabindex="0" class="md-subview-link" data-subview-id="${t}">`)}else c=c.replace("<a>",'<a tabindex="0" target="_blank" class="md-web-link" href="'+Gl(o[11]||u[i.toLowerCase()])+'">');r=m()+"</a>"}else if(o[9])r="<a>";else if(o[12])r="<p>"+o[12]+"\n"+o[13]+"</p>",t=!0;else if(o[14])r="<p>"+o[14]+" "+o[15]+"</p>",t=!0;else if(o[17]){const e=o[17];var v=Ql[e.replace(/\*/g,"_")[1]||""];r=n.tagState.has(e)&&n.tagState.get(e).open?v[1]:v[0],n.toggle(e)}else if(o[18]){const e=o[18],t=(o[18].match(/\n/g)||[]).length,n=/[ ]{2}\n/.test(e);r=t>=2?'</p><p class="md-line-break"> </p><p>':n?"<br />":p(e)}else o[4]&&(r="<p>"+o[4]+"</p>",t=!0);c+=i,c+=t?"</p>"+r+"<p>":r}var f;return n.tagState.forEach(((e,t)=>{if(n.tagState.get(t).open){const e=Ql[t.replace(/\*/g,"_")[1]||""][0],n=c.lastIndexOf(e);-1!==n&&(c=c.slice(0,n)+t+c.slice(n+e.length))}})),(g(c)+g(e.substring(h))+m()).trim()}const ed=rn("li")({whiteSpace:"pre-wrap","overflow-wrap":"break-word","word-wrap":"break-word","word-break":"break-word"}),td=rn("span")((e=>{let{theme:t}=e;return{" p":{margin:"0",display:"inline"}," a":{color:t.getCSSColor("text.link")}," em":{fontStyle:"italic"}," strong":{fontWeight:"bold"}," .md-subview-link":{textDecoration:"underline",cursor:"pointer"}}})),nd=rn("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`}})),rd=rn("a")((e=>{let{isLinkEnabled:t,theme:n,url:r}=e;return{border:`1px solid ${n.getCSSColor("border.mediaThumb")}`,borderRadius:n.getShape("borderRadius.mediaThumb")||"0px",overflow:"hidden",display:"flex",backgroundColor:n.getCSSColor("background.mediaThumbnail"),cursor:t||r?"pointer":"default"}})),id=rn("div")((e=>{let{thumbnail:t,theme:n}=e;return{display:"flex",width:"100px",minWidth:"100px",height:"100px",backgroundColor:n.getCSSColor("background.media"),backgroundSize:"cover",backgroundPosition:"center",backgroundImage:`url('${t}')`,alignItems:"center",justifyContent:"center"}})),od=rn("div")((()=>({padding:"12px 15px 10px 15px",display:"flex",flexFlow:"row wrap",minWidth:"0px"}))),ad=rn("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},t.getCSSFontProperties("mediaTitle")),{color:t.getCSSColor("text.mediaTitle"),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginBottom:"0px",width:"100%"})})),sd=rn("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},t.getCSSFontProperties("mediaSubtitle")),{color:t.getCSSColor("text.mediaSubtitle"),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%"})})),ld=rn("a")((e=>{let{isLinkEnabled:t,theme:n}=e;return Object.assign(Object.assign(Object.assign({border:"0px"},n.getElementFocusCSSProperties()),n.getCSSFontProperties("mediaAction")),{color:n.getCSSColor("text.mediaAction"),textDecoration:"none",display:"block",marginTop:"auto",width:"100%",cursor:t?"pointer":"default",visibility:t?"visible":"hidden",userSelect:"none"})}));class dd extends yo{render(){const{nodeKey:e,isFinalCardNode:t,isFirstCardNode:n,children:r,mediaType:i,src:o,theme:a,label:s,description:l,customStrings:d,onClickImage:c,url:u,alt:h}=this.props,{imageLoaded:p,imageLoadFailed:m}=this.state,g=p?o:"",v=this.getPreviewIcon(i),f=i.includes("video"),b=f&&m,S="image"===i||"video"===i,y=this.getElementRole(i),w=f?(null==d?void 0:d.thumbnailVideoActionLinkTitle)||"Watch":(null==d?void 0:d.thumbnailImageActionLinkTitle)||"View",k=f?"A video":"An image";let C="";return S&&(C=(f?"Plays a video":"Displays an image")+": "),C=`${C}${h?h+".":""}`,(0,le.h)(nd,{theme:a,isFirstCardNode:n,isFinalCardNode:t},(0,le.h)(rd,{key:e,"data-element-key":e,"data-testid":"image-wrapper",theme:a,onClick:c,isLinkEnabled:S,url:u},(0,le.h)(id,{thumbnail:g,theme:a,role:y,"aria-label":C||k},!p&&!b&&v&&(0,le.h)(v,{fillColor:a.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(p||m)&&r),(0,le.h)(od,null,(0,le.h)(ad,{theme:a,class:"thumbnail-header","aria-label":`${s}.`},s),(0,le.h)(sd,{theme:a,class:"thumbnail-format","aria-label":`${l}.`},l),(0,le.h)(ld,{theme:a,isLinkEnabled:"image"===i||"video"===i,tabIndex:"0",class:"thumbnail-link",onKeyPress:this.handleKeyPress.bind(this)},w))))}}const cd=rn("div")((e=>{var t,n,r,i,o,a;let{backgroundImage:s,theme:l,isFinalCardNode:d,dimensions:c,loadedDimensions:u,url:h,isLinkEnabled:p}=e;const m=`calc(${l.getShape("borderRadius.card")} - ${l.getShape("border.card")})`,g=l.getNumericalPadding("card");return Object.assign(Object.assign({width:`calc(100% + ${(null!==(t=g.left)&&void 0!==t?t:O)+(null!==(n=g.right)&&void 0!==n?n:O)}px)`,border:"0px",borderRadius:`${m} ${m} 0 0`,backgroundImage:`url('${s}')`,backgroundSize:"cover",backgroundPosition:"center",backgroundColor:l.getCSSColor("background.media"),display:"flex",alignItems:"center",justifyContent:"center",marginTop:`-${null!==(r=g.top)&&void 0!==r?r:M}px`,marginRight:`-${null!==(i=g.right)&&void 0!==i?i:O}px`,marginBottom:`${d?"0px":null!==(o=l.getShape("padding.elementBottom",{skipFallback:!0}))&&void 0!==o?o:"10px"}`,marginLeft:`-${null!==(a=g.left)&&void 0!==a?a:O}px`,overflow:"hidden",cursor:p||h?"pointer":"default"},bd({dimensions:c,naturalDimensions:u})),l.getElementFocusCSSProperties())}));class ud extends yo{onImageLoad(e){super.onImageLoad(e),this.props.onLoad&&this.props.onLoad({width:e.naturalWidth,height:e.naturalHeight})}render(){const{nodeKey:e,children:t,isFinalCardNode:n,mediaType:r,src:i,theme:o,onClickImage:a,dimensions:s,url:l,alt:d}=this.props,{imageLoaded:c,imageLoadFailed:u}=this.state,h=c?i:"",p=this.getPreviewIcon(r),m=r.includes("video")&&u,g="image"===r||"video"===r,v=this.getElementRole(r),f=r.includes("video")?"A banner video":"A banner image";let b="";return g&&(b=(r.includes("video")?"Plays a video":"Displays an image")+": "),b+=d,(0,le.h)(cd,{key:e,"data-element-key":e,"data-testid":"image-wrapper",backgroundImage:h,theme:o,isFinalCardNode:n,mediaType:r,url:l,dimensions:s,loadedDimensions:this.state.loadedDimensions,onClick:a,onKeyPress:this.handleKeyPress.bind(this),tabIndex:"0",className:"image-banner",role:v,isLinkEnabled:g,"aria-label":b||f},!c&&!m&&p&&(0,le.h)(p,{fillColor:o.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(c||u)&&t)}}const hd=rn("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`}})),pd=rn("div")((e=>{let{backgroundImage:t,theme:n,dimensions:r,loadedDimensions:i,url:o,isLinkEnabled:a}=e;const s=n.getCSSColor("border.media");return Object.assign(Object.assign(Object.assign(Object.assign({},Sn(s)?{}:{border:`1px solid ${n.getCSSColor("border.media")}`}),{borderRadius:`${n.getShape("borderRadius.media")}`,backgroundImage:`url('${t}')`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundColor:n.getCSSColor("background.media"),display:"flex",alignItems:"center",justifyContent:"center",cursor:a||o?"pointer":"default",overflow:"hidden"}),bd({dimensions:r,naturalDimensions:i})),n.getElementFocusCSSProperties())}));class md extends yo{onImageLoad(e){super.onImageLoad(e),this.props.onLoad&&this.props.onLoad({width:e.naturalWidth,height:e.naturalHeight})}render(){const{nodeKey:e,children:t,isFirstCardNode:n,isFinalCardNode:r,mediaType:i,src:o,dimensions:a,url:s,onClickImage:l,theme:d,alt:c}=this.props,{imageLoaded:u,imageLoadFailed:h}=this.state,p=u?o:"",m=this.getPreviewIcon(i),g=i.includes("video")&&h,v="image"===i||"video"===i,f=this.getElementRole(i),b=i.includes("video")?"A video":"An image";let S="";return v&&(S=(i.includes("video")?"Plays a video":"Displays an image")+": "),S+=c,(0,le.h)(hd,{theme:d,isFirstCardNode:n,isFinalCardNode:r},(0,le.h)(pd,{key:e,"data-element-key":e,"data-testid":"image-wrapper",backgroundImage:p,dimensions:a,loadedDimensions:this.state.loadedDimensions,mediaType:i,url:s,onClick:l,onKeyPress:this.handleKeyPress.bind(this),theme:d,tabIndex:"0",className:"image-inline",role:f,isLinkEnabled:v,ariaLabel:S||b},!u&&!g&&m&&(0,le.h)(m,{fillColor:d.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(u||h)&&t))}}const gd=rn("p")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`,margin:"0",overflow:"hidden",textOverflow:"ellipsis"}})),vd=rn("a")((e=>{let{theme:t,mediaType:n,url:r}=e;return Object.assign(Object.assign(Object.assign(Object.assign({border:"0px"},t.getElementFocusCSSProperties()),{color:t.getCSSColor("text.link")}),t.getCSSFontProperties("body")),{textDecoration:"none",cursor:"image"===n||"video"===n||r?"pointer":"default","&:hover":{textDecoration:"underline"},whiteSpace:"pre-wrap"})}));class fd extends yo{preloadsImage(){return!1}render(){const{nodeKey:e,theme:t,isFirstCardNode:n,isFinalCardNode:r,label:i,onClickImage:o,mediaType:a,url:s}=this.props;return(0,le.h)(gd,{key:e,"data-element-key":e,theme:t,isFirstCardNode:n,isFinalCardNode:r},(0,le.h)(vd,{theme:t,onClick:o,onKeyPress:this.handleKeyPress.bind(this),tabIndex:"0",className:"image-text",mediaType:a,url:s},i))}}const bd=e=>{var t,n;let{dimensions:r,naturalDimensions:i}=e;if(null==r?void 0:r.height)switch(null==r?void 0:r.height){case"short":return{height:"50px"};case"medium":return{height:"120px"};case"tall":default:return{height:"200px"};case"original":const e=(null==r||null===(t=r.originalDimensions)||void 0===t?void 0:t.width)||(null==i?void 0:i.width),o=(null==r||null===(n=r.originalDimensions)||void 0===n?void 0:n.height)||(null==i?void 0:i.height);return e&&o?{aspectRatio:`${e} / ${o}`}:{height:"200px"}}return{height:"200px"}},Sd=e=>{let{fillColor:t,ariaHidden:n=!1}=e;return(0,le.h)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"A play button icon","aria-hidden":n},(0,le.h)("path",{d:"M6 15.1958V3.80425C6 3.01881 6.86395 2.53997 7.53 2.95625L16.6432 8.652C17.2699 9.04367 17.2699 9.95633 16.6432 10.348L7.53 16.0438C6.86395 16.46 6 15.9812 6 15.1958Z",stroke:t,strokeWidth:"2"}))},yd=rn("div")((e=>{let{theme:t}=e;return{borderRadius:"40px",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",background:t.getCSSColor("background.mediaControl")}})),wd=e=>{let{onClick:t,theme:n}=e;return(0,le.h)(yd,{onClick:t,theme:n},(0,le.h)(Sd,{fillColor:n.getCSSColor("icon.mediaControl"),ariaHidden:!0}))},kd={objectFit:"contain",width:"100%",height:"100%",background:"black"},Cd=rn("video")(Object.assign({},kd)),xd=rn("video")((()=>Object.assign({},kd))),Id=rn("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`}})),Od=rn("div")((e=>{var t,n,r;let{theme:i,isFinalCardNode:o,dimensions:a,loadedDimensions:s,format:l}=e;const d=i.getNumericalPadding("card"),c=i.getShape("padding.elementBottom",{skipFallback:!0}),u=`calc(${i.getShape("borderRadius.card")||"0px"} - ${i.getShape("border.card")})`;return Object.assign(Object.assign({borderRadius:"banner"===l?`${u} ${u} 0 0`:u,overflow:"hidden"},"banner"===l?{margin:`-${null!==(t=d.top)&&void 0!==t?t:M}px -${null!==(n=d.right)&&void 0!==n?n:O}px ${o?"0px":null!=c?c:"10px"} -${null!==(r=d.left)&&void 0!==r?r:O}px`}:{}),a?bd({dimensions:a,naturalDimensions:s}):{height:"200px"})})),Md=rn("div")((e=>{let{theme:t}=e;return{background:t.getCSSColor("overlay.mediaBanner"),display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"}})),Nd=e=>{let t,{nodeKey:n,cardInstanceId:r,label:i,description:o,format:a,src:s,altText:l,theme:d,isFirstCardNode:c,isFinalCardNode:u,thumbnailSrc:h,dimensions:p,setPlaying:m,onLoad:g}=e,v=!1,f=!1;switch(a){case"banner":t=ud,v=!0,f=!0;break;case"inline":t=md,v=!0,f=!0;break;case"thumbnail":t=dd,v=!0;break;case"text":t=fd}return(0,le.h)(Te.lj,{actions:Fe,mapToProps:e=>({customStrings:e.application.customStrings})},(e=>(0,le.h)(t,{nodeKey:n,theme:d,isFirstCardNode:c,isFinalCardNode:u,customStrings:e.customStrings,src:h,dimensions:p,onLoad:g,alt:null==l?void 0:l.src,label:i,description:o,mediaType:null!==s&&s.length>0?"video":"videoWithoutSrc",onClickImage:()=>{f?m(!0):e.viewMedia(r,{type:"video",url:s,title:i,alt:null==l?void 0:l.src})}},v&&(0,le.h)(Md,{theme:d},(0,le.h)(wd,{onClick:()=>f&&m(!0),theme:d})))))},Td=e=>{var t,n;let{format:r,theme:i,isFirstCardNode:o,isFinalCardNode:a,src:s,cardInstanceId:l,dimensions:d,loadedDimensions:c,isWorkflow:u}=e;const h=ye(null),p=Ce(Gi).analyticsDispatcher,m="string"==typeof s&&null!==(t=null===(n=s.match(/[^\/]*$/))||void 0===n?void 0:n[0])&&void 0!==t?t:"";switch(be((()=>{var e,t,n,r;const i=()=>{p.sendEvent({eventName:wt,cardInstanceId:l,cardViewState:u?"subview":"topview",properties:{media:m,mediaURL:s}})},o=()=>{p.sendEvent({eventName:kt,cardInstanceId:l,cardViewState:u?"subview":"topview",properties:{media:m,mediaURL:s}})};return null===(e=h.current)||void 0===e||null===(t=e.base)||void 0===t||t.addEventListener("play",i),null===(n=h.current)||void 0===n||null===(r=n.base)||void 0===r||r.addEventListener("ended",o),()=>{var e,t,n,r;null===(e=h.current)||void 0===e||null===(t=e.removeEventListener)||void 0===t||t.call(e,"play",i),null===(n=h.current)||void 0===n||null===(r=n.removeEventListener)||void 0===r||r.call(n,"ended",o)}}),[]),r){case"banner":return(0,le.h)(Te.lj,{mapToProps:e=>({applicationOpen:e.application.open})},(e=>{var t;let{applicationOpen:n}=e;return!n&&(null==h||null===(t=h.current)||void 0===t?void 0:t.base)&&h.current.base.pause(),(0,le.h)(Od,{theme:i,isFinalCardNode:a,format:r,dimensions:d,loadedDimensions:c},(0,le.h)(Cd,{ref:h,src:s,playsInline:!0,autoplay:!0,controls:!0}))}));case"inline":return(0,le.h)(Te.lj,{mapToProps:e=>({applicationOpen:e.application.open})},(e=>{var t;let{applicationOpen:n}=e;return!n&&(null==h||null===(t=h.current)||void 0===t?void 0:t.base)&&h.current.base.pause(),(0,le.h)(Id,{theme:i,isFirstCardNode:o,isFinalCardNode:a},(0,le.h)(Od,{theme:i,isFinalCardNode:a,format:r,dimensions:d,loadedDimensions:c},(0,le.h)(xd,{ref:h,src:s,playsInline:!0,autoplay:!0,controls:!0})))}));default:return null}},Fd=(e,t,n)=>{const r=gn(n);let i;return qh(i)||(i=e.getCSSFontProperties(`bullet${r}`)),{[`>${t} > li`]:Object.assign({display:"flex",margin:"0 0 5px"},"ol"===t?{counterIncrement:"count"}:{}),[`>${t} > li:before`]:Object.assign({content:"ol"===t?'counter(count)"."':'"•"',textAlign:"center",marginRight:"10px",flexBasis:`${Bl}`,minWidth:`${Bl}`,color:e.getCSSColor(`icon.bullet${r}`)},i?{fontSize:i.fontSize,lineHeight:i.lineHeight}:{}),[`>${t} > li:last-child`]:{marginBottom:"0px"}}},Ad=e=>{var t;let{theme:n,appearance:r,styles:i}=e;const o=gn(r),a=null!==(t=n.getShape("padding.elementBottom",{skipFallback:!0}))&&void 0!==t?t:"20px";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:n.getCSSColor(`text.body${o}`),gridColumnStart:"2",gridRowStart:"span 2"},n.getCSSFontProperties(`body${o}`)),{marginRight:"10px"," em":{fontStyle:"italic"}," strong":{fontWeight:"bold"}," code":{borderRadius:"3px",padding:"5px",backgroundColor:"rgba(0,0,0,0.05)"},"> ul":Object.assign({},{paddingLeft:"0",margin:"0",listStyleType:"none",textAlign:"left"})}),Fd(n,"ul",r)),{"> ol":Object.assign(Object.assign({},{paddingLeft:"0",margin:"0",listStyleType:"none",textAlign:"left"}),{counterReset:"count"}),"> ul:not(:first-child)":{marginTop:a},"> ol:not(:first-child)":{marginTop:a},"> ul:not(:last-child)":{marginBottom:a},"> ol:not(:last-child)":{marginBottom:a},"> ul:has(+ p.md-line-break)":{marginBottom:"0px"},"> ol:has(+ p.md-line-break)":{marginBottom:"0px"}}),Fd(n,"ol",r)),{" a":{color:n.getCSSColor(`text.link${o}`)}," p":Object.assign(Object.assign({margin:"0px 0 0 0",whiteSpace:"pre-wrap","overflow-wrap":"break-word","word-wrap":"break-word","word-break":"break-word"},n.getCSSFontProperties(`body${o}`)),{overflow:"hidden"})," p:not(:first-child)":{marginTop:a}," p:not(:last-child)":{marginBottom:a}," p:has(+ p.md-line-break)":{marginBottom:"0px"}," p.md-line-break + p":{marginTop:"0px"}," p.md-line-break + ul":{marginTop:"0px"}," p.md-line-break + ol":{marginTop:"0px"}," p:not(:first-child).md-line-break":{marginTop:"0px"}," p:not(:last-child).md-line-break":{marginBottom:"0px"}," .md-subview-link":{textDecoration:"underline",cursor:"pointer"}}),i)},Ld=rn("div")((e=>{let{theme:t,appearance:n}=e;return Ad({theme:t,appearance:n})})),Ed=rn("div")((e=>{let{bodyFontProperties:t}=e;return{position:"absolute",width:"100%",visibility:"hidden",pointerEvents:"none",display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${t.lineHeight} 1fr`}})),jd=rn("div")((e=>{let{theme:t,appearance:n}=e;return Ad({theme:t,appearance:n,styles:{"& *":{marginTop:"0!important",marginBottom:"0!important"}}})})),Dd=rn("div")((e=>{let{theme:t,appearance:n,isFirstCardNode:r,isFinalCardNode:i,bodyFontProperties:o}=e;const a=gn(n),s=t.getShape("padding.elementBottom",{skipFallback:!0}),l=s?`0px 0px ${i?"0px":s}`:`${r?0:10}px 0px ${i?0:10}px`;return{position:"relative",display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${o.lineHeight} 1fr`,color:t.getCSSColor(`text.body${a}`),padding:l}})),_d=e=>{const t=document.createElement("div");return t.innerHTML=e,t},Pd=()=>window.matchMedia("(prefers-color-scheme: dark)");function Hd(){var e;const t=document.createElement("div");t.style.visibility="hidden",t.style.overflow="scroll",document.body.appendChild(t);const n=document.createElement("div");t.appendChild(n);const r=t.offsetWidth-n.offsetWidth;return null===(e=t.parentNode)||void 0===e||e.removeChild(t),r}function Rd(e,t,n,r,i,o){var a,s,l,d,c,u,h,p,m,g,v,f,b,S;const y=gn(o),w=document.createElement("button"),k=document.createElement("span"),C=document.createElement("span");C.innerHTML="… ";const x=t.getCSSFontProperties(`expandCollapse${y}`,{skipFallback:!0,skipFontFallbacks:!0}),I=t.getCSSFontProperties(`body${y}`),O=t.getShape("padding.expandCollapseLeft")||"0px",M="expand"===n?"Show more":"Show less",N="expand"===n;return w.style.fontFamily="inherit",w.style.fontSize="inherit",w.style.lineHeight="inherit",k.style.paddingLeft=N?O:"0px",k.style.color=null!==(a=t.getCSSColor(`text.expandCollapse${y}`,{skipFallback:!0}))&&void 0!==a?a:t.getCSSColor(`text.body${y}`),w.style.color=null!==(s=t.getCSSColor(`text.expandCollapse${y}`,{skipFallback:!0}))&&void 0!==s?s:t.getCSSColor(`text.body${y}`),k.style.fontWeight=null!==(l=null==x?void 0:x.fontWeight)&&void 0!==l?l:null==I?void 0:I.fontWeight,w.style.fontWeight=null!==(d=null==x?void 0:x.fontWeight)&&void 0!==d?d:null==I?void 0:I.fontWeight,k.style.fontStyle=null!==(c=null==x?void 0:x.fontStyle)&&void 0!==c?c:null==I?void 0:I.fontStyle,w.style.fontStyle=null!==(u=null==x?void 0:x.fontStyle)&&void 0!==u?u:null==I?void 0:I.fontStyle,k.style.textTransform=null!==(h=null==x?void 0:x.textTransform)&&void 0!==h?h:null==I?void 0:I.textTransform,w.style.textTransform=null!==(p=null==x?void 0:x.textTransform)&&void 0!==p?p:null==I?void 0:I.textTransform,k.style.fontSynthesis=null!==(m=null==x?void 0:x.fontSynthesis)&&void 0!==m?m:null==I?void 0:I.fontSynthesis,w.style.fontSynthesis=null!==(g=null==x?void 0:x.fontSynthesis)&&void 0!==g?g:null==I?void 0:I.fontSynthesis,k.textContent=e&&e.length?e:M,C.style.color=t.getCSSColor(`text.body${y}`),C.style.fontWeight=null!==(v=null==I?void 0:I.fontWeight)&&void 0!==v?v:"normal",C.style.fontStyle=null!==(f=null==I?void 0:I.fontStyle)&&void 0!==f?f:"normal",w.innerHTML=`${N?C.outerHTML:""}${k.outerHTML}`,w.style.display="inline",w.style.border="none",w.style.background="none",w.style.margin="0",w.style.padding="0",w.style.cursor="pointer",w.style.maxWidth=i,w.style.textAlign=null!==(b=null===(S=I)||void 0===S?void 0:S.textAlign)&&void 0!==b?b:"left",N&&(w.style.whiteSpace="nowrap",w.style.overflow="hidden",w.style.textOverflow="ellipsis"),w.id=r,w.setAttribute("data-testid","text-expand-collapse-button"),w}function $d(e){let t=e.nextSibling;for(;t;){const e=t;t=t.nextSibling,e.remove()}}function Vd(e,t,n,r,i,o,a){var s,l;if(!e)return!1;const d=Rd(null!=o?o:"Show more",i,"expand",`expand-text-${r}`,t.getBoundingClientRect().width+"px",a);d.style.marginRight=Hd()+"px";const c=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),u=[];let h;for(;h=c.nextNode();){const e=null!==(s=h.textContent)&&void 0!==s?s:"",t=/\u00A0/.test(e);(e.trim().length>0||t)&&u.push(h)}let p=null,m=0,g=!1;for(let r=u.length-1;r>=0;r--){var v,f;const i=u[r],o=i.nodeValue||"";let a=0,s=o.length,l=!1;null===(v=i.parentElement)||void 0===v||v.appendChild(d);const c=i.parentElement;if(!c)continue;for(;a<=s;){const e=Math.floor((a+s)/2);" "===o?i.nodeValue=e>0?" ":"":o.startsWith(" ")?i.nodeValue=0===e?"":" "+o.slice(1,e):i.nodeValue=o.slice(0,e);Math.ceil(t.getBoundingClientRect().height)<=n?(m=e,l=!0,a=e+1):s=e-1}d.remove();const h=c.closest("li");if(h&&!(null===(f=h.textContent)||void 0===f?void 0:f.trim())){h.remove();continue}const b="p"===e.tagName.toLowerCase()&&"a"===c.tagName.toLowerCase();if(b&&0===m&&c.remove(),0===r||m>0){if(0===r&&!l){i.nodeValue=o;break}p=i,g=!b&&m<4;break}}if(p){var b,S;const e=null!==(l=p.textContent)&&void 0!==l?l:"";p.textContent=e.slice(0,g?4:m).trimEnd(),$d(p);const n=null===(b=p.parentElement)||void 0===b?void 0:b.closest("a");n&&$d(n);const s=null===(S=p.parentElement)||void 0===S?void 0:S.closest("li");s&&$d(s);let d=0;if(g){var y;const t=document.createElement("span");t.textContent=e.slice(0,4).trimEnd(),null===(y=p.parentElement)||void 0===y||y.appendChild(t),d=t.getBoundingClientRect().width,t.remove()}const c=Rd(null!=o?o:"Show more",i,"expand",`expand-text-${r}`,t.getBoundingClientRect().width-d-Hd()+"px",a),u=p.parentElement;return"p"===(null==u?void 0:u.tagName.toLowerCase())&&u.classList.contains("md-line-break")?(u.style.marginTop="0px",u.after(c)):"a"===(null==u?void 0:u.tagName.toLowerCase())&&u.parentElement?u.parentElement.insertBefore(c,u.nextSibling):null==u||u.appendChild(c),!0}return!1}const Wd=e=>{let{fillColor:t}=e;return(0,le.h)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,le.h)("path",{d:"M15 10V20M20 15H15H10",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))},Bd=e=>{let{fillColor:t}=e;return(0,le.h)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,le.h)("path",{d:"M20 15H10",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))},zd=rn("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.component"),color:t.getCSSColor("text.secondary"),display:"flex",":focus":{outline:"none"},"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none"}})),Ud=rn("button")((e=>{let{theme:t,disabled:n}=e;return Object.assign(Object.assign({backgroundColor:n?t.getCSSColor("background.stepperDisabled"):t.getCSSColor("background.stepper"),border:"0px",borderRadius:"99px",width:"24px",height:"24px",display:"flex",padding:"0",alignItems:"center",cursor:n?"initial":"pointer"},t.getElementFocusCSSProperties()),{" svg":{height:"100%"}})})),qd=rn("input")((e=>{let{theme:t}=e;return Object.assign(Object.assign({color:t.getCSSColor("text.secondary",{skipFallback:!0})||t.getCSSColor("text.primary")},t.getCSSFontProperties("secondary")),{backgroundColor:t.getCSSColor("background.component"),width:"40px",maxWidth:"40px",minWidth:"40px",paddingTop:"1px",textAlign:"center",border:"0","-moz-appearance":"textfield",":focus":{outline:"none"},"::-webkit-inner-spin-button, ::-webkit-outer-spin-button":{"-webkit-appearance":"none",margin:"0"}})})),Yd=(e,t,n)=>e-n>=t,Kd=(e,t,n)=>e+n<=t;let Zd=null;const Qd=rn("button")((e=>{let{on:t,theme:n}=e;return Object.assign({backgroundColor:n.getCSSColor(t?"background.switchOn":"background.switchOff"),transition:"0.25s ease-in-out",position:"relative",border:"0px",borderRadius:"99px",width:"40px",height:"22px",cursor:"pointer",flexShrink:"0"},n.getElementFocusCSSProperties())})),Gd=rn("div")((e=>{let{on:t,theme:n}=e;return{transition:"0.25s ease-in-out",position:"absolute",top:"2px",left:t?"50%":"2px",backgroundColor:n.getCSSColor(t?"icon.switchOn":"icon.switchOff"),width:"18px",height:"18px",borderRadius:"99px"}})),Xd=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],Jd=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function ec(e){if(e<=255)return Xd[e];let t=0,n=Jd.length-1;for(;t<=n;){const r=t+n>>1,i=Jd[r];if(e<i[0])n=r-1;else{if(!(e>i[1]))return i[2];t=r+1}}return"L"}function tc(e,t){const n=function(e){const t=e.length;if(0===t)return null;const n=new Array(t);let r=!1;for(let i=0;i<t;){const o=e.charCodeAt(i);let a=o,s=1;if(o>=55296&&o<=56319&&i+1<t){const t=e.charCodeAt(i+1);t>=56320&&t<=57343&&(a=t-56320+(o-55296<<10)+65536,s=2)}const l=ec(a);"R"!==l&&"AL"!==l&&"AN"!==l||(r=!0);for(let e=0;e<s;e++)n[i+e]=l;i+=s}if(!r)return null;let i=0;for(let e=0;e<t;e++){const t=n[e];if("L"===t){i=0;break}if("R"===t||"AL"===t){i=1;break}}const o=new Int8Array(t);for(let e=0;e<t;e++)o[e]=i;const a=1&i?"R":"L",s=a;let l=s;for(let e=0;e<t;e++)"NSM"===n[e]?n[e]=l:l=n[e];l=s;for(let e=0;e<t;e++){const t=n[e];"EN"===t?n[e]="AL"===l?"AN":"EN":"R"!==t&&"L"!==t&&"AL"!==t||(l=t)}for(let e=0;e<t;e++)"AL"===n[e]&&(n[e]="R");for(let e=1;e<t-1;e++)"ES"===n[e]&&"EN"===n[e-1]&&"EN"===n[e+1]&&(n[e]="EN"),"CS"!==n[e]||"EN"!==n[e-1]&&"AN"!==n[e-1]||n[e+1]!==n[e-1]||(n[e]=n[e-1]);for(let e=0;e<t;e++){if("EN"!==n[e])continue;let r;for(r=e-1;r>=0&&"ET"===n[r];r--)n[r]="EN";for(r=e+1;r<t&&"ET"===n[r];r++)n[r]="EN"}for(let e=0;e<t;e++){const t=n[e];"WS"!==t&&"ES"!==t&&"ET"!==t&&"CS"!==t||(n[e]="ON")}l=s;for(let e=0;e<t;e++){const t=n[e];"EN"===t?n[e]="L"===l?"L":"EN":"R"!==t&&"L"!==t||(l=t)}for(let e=0;e<t;e++){if("ON"!==n[e])continue;let r=e+1;for(;r<t&&"ON"===n[r];)r++;const i="L"!==(e>0?n[e-1]:s)?"R":"L";if(i===("L"!==(r<t?n[r]:s)?"R":"L"))for(let t=e;t<r;t++)n[t]=i;e=r-1}for(let e=0;e<t;e++)"ON"===n[e]&&(n[e]=a);for(let e=0;e<t;e++){const t=n[e];0==(1&o[e])?"R"===t?o[e]++:"AN"!==t&&"EN"!==t||(o[e]+=2):"L"!==t&&"AN"!==t&&"EN"!==t||o[e]++}return o}(e);if(null===n)return null;const r=new Int8Array(t.length);for(let e=0;e<t.length;e++)r[e]=n[t[e]];return r}const nc=/[ \t\n\r\f]+/g,rc=/[\t\n\r\f]| {2,}|^ | $/;let ic,oc=null;const ac=/\p{Script=Arabic}/u,sc=/\p{M}/u,lc=/\p{Nd}/u;function dc(e){return ac.test(e)}function cc(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function uc(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){if(cc(r-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(cc(n))return!0}}return!1}const hc=new Set([" "," ","","\ufeff"]),pc=new Set(["-","‐","–","—"]);function mc(e,t){return!function(e){const t=Mc(e);return null!==t&&hc.has(t)}(e)&&(!t||!function(e){const t=Mc(e);return null!==t&&(gc.has(t)||bc.has(t))}(e)&&!function(e){const t=Mc(e);return null!==t&&pc.has(t)}(e))}const gc=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),vc=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),fc=new Set(["'","’"]),bc=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Sc=new Set([":",".","،","؛"]),yc=new Set(["၏"]),wc=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function kc(e){if(Ic(e))return!0;let t=!1;for(const n of e)if(bc.has(n)||Tc(n))t=!0;else if(!t||!sc.test(n))return!1;return t}function Cc(e){for(const t of e)if(!gc.has(t)&&!bc.has(t))return!1;return e.length>0}function xc(e){if(Ic(e))return!0;for(const t of e)if(!(vc.has(t)||fc.has(t)||sc.test(t)||Tc(t)))return!1;return e.length>0}function Ic(e){let t=!1;for(const n of e)if("\\"!==n&&!sc.test(n)){if(!(vc.has(n)||bc.has(n)||fc.has(n)))return!1;t=!0}return t}function Oc(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const r=e.charCodeAt(n);if(r<56320||r>57343)return n;const i=n-1;if(i<0)return n;const o=e.charCodeAt(i);return o>=55296&&o<=56319?i:n}function Mc(e){if(0===e.length)return null;const t=Oc(e,e.length);return e.slice(t)}const Nc=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Tc(e){const t=e.codePointAt(0);return void 0!==t&&function(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}(t,Nc)}function Fc(e){const t=function(e){for(let t=e.length;t>0;){const n=Oc(e,t),r=e.slice(n,t);if(!sc.test(r))return r;t=n}return null}(e);return null!==t&&Tc(t)}function Ac(e){const t=function(e){for(const t of e)if(!sc.test(t))return t;return null}(e);return null!==t&&lc.test(t)}function Lc(e){const t=Array.from(e);let n=t.length;for(;n>0;){const e=t[n-1];if(sc.test(e))n--;else{if(!vc.has(e)&&!fc.has(e))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Ec(e,t,n,r){const i=t[r],o=e[r];if(null==i)return o;const a=n[r];if(o.length===a)return o;const s=i.repeat(a);return e[r]=s,s}function jc(e,t){return e&&null!==t&&Sc.has(t)}function Dc(e){const t=Mc(e);return null!==t&&yc.has(t)}function _c(e){if(e.length<2||" "!==e[0])return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function Pc(e){let t=e.length;for(;t>0;){const n=Oc(e,t),r=e.slice(n,t);if(wc.has(r))return!0;if(!bc.has(r))return!1;t=n}return!1}function Hc(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(" "===e)return"preserved-space";if("\t"===e)return"tab";if(t.preserveHardBreaks&&"\n"===e)return"hard-break"}return" "===e?"space":" "===e||" "===e||""===e||"\ufeff"===e?"glue":""===e?"zero-width-break":""===e?"soft-hyphen":"text"}const Rc=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function $c(e){return 1===e.length?e[0]:e.join("")}function Vc(e,t){const n=[];for(let t=e.length-1;t>=0;t--)n.push(e[t]);return n.push(t),$c(n)}function Wc(e,t,n,r){if(!Rc.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const i=[];let o=null,a=[],s=n,l=!1,d=0;for(const c of e){const e=Hc(c,r),u="text"===e&&t;null===o||e!==o||u!==l?(null!==o&&i.push({text:$c(a),isWordLike:l,kind:o,start:s}),o=e,a=[c],s=n+d,l=u,d+=c.length):(a.push(c),d+=c.length)}return null!==o&&i.push({text:$c(a),isWordLike:l,kind:o,start:s}),i}function Bc(e){return"space"===e||"preserved-space"===e||"zero-width-break"===e||"hard-break"===e}const zc=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Uc(e,t){const n=e.texts[t];return!!n.startsWith("www.")||zc.test(n)&&t+1<e.len&&"text"===e.kinds[t+1]&&"//"===e.texts[t+1]}function qc(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const Yc=new Set([":","-","/","×",",",".","+","–","—"]),Kc=new Set([".",",",":",";"]);function Zc(e){for(let t=e.length;t>0;){const n=Oc(e,t),r=e.slice(n,t);if(!sc.test(r))return Kc.has(r)||Tc(r);t=n}return!1}function Qc(e,t){return t&&!uc(e)}function Gc(e){for(const t of e)if(lc.test(t))return!0;return!1}function Xc(e){if(0===e.length)return!1;for(const t of e)if(!lc.test(t)&&!Yc.has(t))return!1;return!0}function Jc(e,t,n){const r=(null===oc&&(oc=new Intl.Segmenter(ic,{granularity:"word"})),oc);let i=0;const o=[],a=[],s=[],l=[],d=[],c=[],u=[],h=[],p=[],m=[],g=[],v=[];for(const x of r.segment(e))for(const I of Wc(x.segment,x.isWordLike??!1,x.index,n)){const O="text"===I.kind,M=(f=I.text,b=I.isWordLike,"text"!==I.kind||b||1!==f.length||"-"===f||"—"===f?null:f),N=uc(I.text),T=dc(I.text),F=Mc(I.text),A=Pc(I.text),L=Dc(I.text),E=i-1;function j(){null!==c[E]&&(a[E]=[Ec(o,c,u,E)],c[E]=null),a[E].push(I.text),s[E]=s[E]||I.isWordLike,h[E]=h[E]||N,p[E]=p[E]||T,m[E]=A,g[E]=L,v[E]=jc(p[E],F)}t.carryCJKAfterClosingQuote&&O&&i>0&&"text"===l[E]&&N&&h[E]&&m[E]||O&&i>0&&"text"===l[E]&&Cc(I.text)&&h[E]||O&&i>0&&"text"===l[E]&&g[E]?j():O&&i>0&&"text"===l[E]&&I.isWordLike&&T&&v[E]?(j(),s[E]=!0):null!==M&&i>0&&"text"===l[E]&&c[E]===M?u[E]=(u[E]??1)+1:O&&!I.isWordLike&&i>0&&"text"===l[E]&&!h[E]&&(kc(I.text)||"-"===I.text&&s[E])?j():(o[i]=I.text,a[i]=[I.text],s[i]=I.isWordLike,l[i]=I.kind,d[i]=I.start,c[i]=M,u[i]=null===M?0:1,h[i]=N,p[i]=T,m[i]=A,g[i]=L,v[i]=jc(T,F),i++)}var f,b;for(let D=0;D<i;D++)null===c[D]?o[D]=$c(a[D]):o[D]=Ec(o,c,u,D);for(let _=1;_<i;_++)"text"!==l[_]||s[_]||!Ic(o[_])||"text"!==l[_-1]||h[_-1]||(o[_-1]+=o[_],s[_-1]=s[_-1]||s[_],o[_]="");const S=Array.from({length:i},(()=>null));let y=-1;for(let P=i-1;P>=0;P--){const H=o[P];if(0!==H.length)if("text"===l[P]&&!s[P]&&y>=0&&"text"===l[y]&&(xc(H)||"-"===H&&Ac(o[y]))){const R=S[y]??[];R.push(H),S[y]=R,d[y]=d[P],o[P]=""}else y=P}for(let $=0;$<i;$++){const V=S[$];null!=V&&(o[$]=Vc(V,o[$]))}let w=0;for(let W=0;W<i;W++){const B=o[W];0!==B.length&&(w!==W&&(o[w]=B,s[w]=s[W],l[w]=l[W],d[w]=d[W]),w++)}o.length=w,s.length=w,l.length=w,d.length=w;const k=function(e){const t=[],n=[],r=[],i=[];let o=0;for(;o<e.len;){const a=[e.texts[o]];let s=e.isWordLike[o],l=e.kinds[o],d=e.starts[o];if("glue"===l){const c=[a[0]],u=d;for(o++;o<e.len&&"glue"===e.kinds[o];)c.push(e.texts[o]),o++;const h=$c(c);if(!(o<e.len&&"text"===e.kinds[o])){t.push(h),n.push(!1),r.push("glue"),i.push(u);continue}a[0]=h,a.push(e.texts[o]),s=e.isWordLike[o],l="text",d=u,o++}else o++;if("text"===l)for(;o<e.len&&"glue"===e.kinds[o];){const t=[];for(;o<e.len&&"glue"===e.kinds[o];)t.push(e.texts[o]),o++;const n=$c(t);o<e.len&&"text"===e.kinds[o]?(a.push(n,e.texts[o]),s=s||e.isWordLike[o],o++):a.push(n)}t.push($c(a)),n.push(s),r.push(l),i.push(d)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}({len:w,texts:o,isWordLike:s,kinds:l,starts:d}),C=function(e){const t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let e=0;e<t.length-1;e++){if("text"!==r[e]||"text"!==r[e+1])continue;if(!uc(t[e])||!uc(t[e+1]))continue;const n=Lc(t[e]);null!==n&&(t[e]=n.head,t[e+1]=n.tail+t[e+1],i[e+1]=i[e]+n.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}(function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){const a=e.texts[o],s=e.kinds[o],l=e.isWordLike[o];if("text"!==s||!Zc(a)||!l&&!Fc(a)||uc(a))t.push(a),n.push(l),r.push(s),i.push(e.starts[o]);else{const s=[a];let l=!0,d=o+1;for(;l&&d<e.len&&"text"===e.kinds[d]&&Qc(e.texts[d],e.isWordLike[d]);){const t=e.texts[d];s.push(t),l=Zc(t),d++}t.push($c(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=d-1}}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}(function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){const a=e.texts[o];if("text"===e.kinds[o]&&a.includes("-")){const s=a.split("-");let l=s.length>1;for(let e=0;e<s.length;e++){const t=s[e];if(!l)break;0!==t.length&&Gc(t)&&Xc(t)||(l=!1)}if(l){let a=0;for(let l=0;l<s.length;l++){const d=s[l],c=l<s.length-1?`${d}-`:d;t.push(c),n.push(!0),r.push("text"),i.push(e.starts[o]+a),a+=c.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}(function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){const a=e.texts[o],s=e.kinds[o];if("text"===s&&Xc(a)&&Gc(a)){const s=[a];let l=o+1;for(;l<e.len&&"text"===e.kinds[l]&&Xc(e.texts[l]);)s.push(e.texts[l]),l++;t.push($c(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=l-1}else t.push(a),n.push(e.isWordLike[o]),r.push(s),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}(function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){const a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o]),!qc(a))continue;const s=o+1;if(s>=e.len||Bc(e.kinds[s]))continue;const l=[],d=e.starts[s];let c=s;for(;c<e.len&&!Bc(e.kinds[c]);)l.push(e.texts[c]),c++;l.length>0&&(t.push($c(l)),n.push(!0),r.push("text"),i.push(d),o=c-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}(function(e){const t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let i=0;i<e.len;i++){if("text"!==r[i]||!Uc(e,i))continue;const o=[t[i]];let a=i+1;for(;a<e.len&&!Bc(r[a]);){o.push(t[a]),n[i]=!0;const e=t[a].includes("?");if(r[a]="text",t[a]="",a++,e)break}t[i]=$c(o)}let o=0;for(let e=0;e<t.length;e++){const a=t[e];0!==a.length&&(o!==e&&(t[o]=a,n[o]=n[e],r[o]=r[e],i[o]=i[e]),o++)}return t.length=o,n.length=o,r.length=o,i.length=o,{len:o,texts:t,isWordLike:n,kinds:r,starts:i}}(k))))));for(let z=0;z<C.len-1;z++){const U=_c(C.texts[z]);null!==U&&("space"!==C.kinds[z]&&"preserved-space"!==C.kinds[z]||"text"!==C.kinds[z+1]||!dc(C.texts[z+1])||(C.texts[z]=U.space,C.isWordLike[z]=!1,C.kinds[z]="preserved-space"===C.kinds[z]?"preserved-space":"space",C.texts[z+1]=U.marks+C.texts[z+1],C.starts[z+1]=C.starts[z]+U.space.length))}return C}function eu(e,t){if(0===e.len)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let r=0;for(let t=0;t<e.len;t++)"hard-break"===e.kinds[t]&&(n.push({startSegmentIndex:r,endSegmentIndex:t,consumedEndSegmentIndex:t+1}),r=t+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function tu(e,t,n){if(t.len<=1)return t;const r=[],i=[],o=[],a=[];let s=-1,l=!1;function d(e){r.push(t.texts[e]),i.push(t.isWordLike[e]),o.push("text"),a.push(t.starts[e])}function c(n){if(!(s<0)){if(l)s+1===n?d(s):function(n,s){let l=!1;for(let e=n;e<s;e++)l=l||t.isWordLike[e];const d=t.starts[n],c=s<t.len?t.starts[s]:e.length;r.push(e.slice(d,c)),i.push(l),o.push("text"),a.push(d)}(s,n);else for(let e=s;e<n;e++)d(e);s=-1,l=!1}}for(let e=0;e<t.len;e++){const d=t.texts[e],u=t.kinds[e];"text"!==u?(c(e),r.push(d),i.push(t.isWordLike[e]),o.push(u),a.push(t.starts[e])):(s>=0&&!mc(t.texts[e-1],n)&&c(e),s<0&&(s=e),l=l||uc(d))}return c(t.len),{len:r.length,texts:r,isWordLike:i,kinds:o,starts:a}}function nu(e,t,n="normal",r="normal"){const i=function(e){const t=e??"normal";return"pre-wrap"===t?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}(n),o="pre-wrap"===i.mode?function(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,"\n").replace(/[\r\f]/g,"\n"):e}(e):function(e){if(!rc.test(e))return e;let t=e.replace(nc," ");return 32===t.charCodeAt(0)&&(t=t.slice(1)),t.length>0&&32===t.charCodeAt(t.length-1)&&(t=t.slice(0,-1)),t}(e);if(0===o.length)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const a=Jc(o,t,i),s="keep-all"===r?tu(o,a,t.breakKeepAllAfterPunctuation):a;return{normalized:o,chunks:eu(s,i),...s}}let ru=null;const iu=new Map;let ou=null;const au=96,su=/\p{Emoji_Presentation}/u,lu=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let du=null;const cu=new Map;function uu(){if(null!==ru)return ru;if("undefined"!=typeof OffscreenCanvas)return ru=new OffscreenCanvas(1,1).getContext("2d"),ru;if("undefined"!=typeof document)return ru=document.createElement("canvas").getContext("2d"),ru;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function hu(e,t){let n=t.get(e);if(void 0===n){n={width:uu().measureText(e).width,containsCJK:uc(e)},t.set(e,n)}return n}function pu(){if(null!==ou)return ou;if("undefined"==typeof navigator)return ou={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ou;const e=navigator.userAgent,t="Apple Computer, Inc."===navigator.vendor&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return ou={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},ou}function mu(){return null===du&&(du=new Intl.Segmenter(void 0,{granularity:"grapheme"})),du}function gu(e){return su.test(e)||e.includes("️")}function vu(e,t){return void 0===t.emojiCount&&(t.emojiCount=function(e){let t=0;const n=mu();for(const r of n.segment(e))gu(r.segment)&&t++;return t}(e)),t.emojiCount}function fu(e,t,n){return 0===n?t.width:t.width-vu(e,t)*n}function bu(e,t){uu().font=e;const n=function(e){let t=iu.get(e);return t||(t=new Map,iu.set(e,t)),t}(e),r=function(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}(e),i=t?function(e,t){let n=cu.get(e);if(void 0!==n)return n;const r=uu();r.font=e;const i=r.measureText("😀").width;if(n=0,i>t+.5&&"undefined"!=typeof document&&null!==document.body){const t=document.createElement("span");t.style.font=e,t.style.display="inline-block",t.style.visibility="hidden",t.style.position="absolute",t.textContent="😀",document.body.appendChild(t);const r=t.getBoundingClientRect().width;document.body.removeChild(t),i-r>.5&&(n=i-r)}return cu.set(e,n),n}(e,r):0;return{cache:n,fontSize:r,emojiCorrection:i}}function Su(e){return"space"===e||"zero-width-break"===e||"soft-hyphen"===e}function yu(e){return"space"===e||"preserved-space"===e||"tab"===e||"zero-width-break"===e||"soft-hyphen"===e}function wu(e,t,n=e.widths.length){for(;t<n;){if(!Su(e.kinds[t]))break;t++}return t}function ku(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Cu(e,t,n){return 0!==e.letterSpacing&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function xu(e,t){return 0===t?0:e+t}function Iu(e,t,n,r,i){return xu(r,"tab"===t?i+function(e,t){return 0!==e.letterSpacing&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}(e,n):e.lineEndFitAdvances[n])}function Ou(e,t,n,r){return xu(r,"tab"===t?0:e.lineEndFitAdvances[n])}function Mu(e,t,n,r,i){return xu(r,"tab"===t?i:e.lineEndPaintAdvances[n])}function Nu(e,t,n){return 0!==e.letterSpacing&&t?n+e.letterSpacing:n}function Tu(e,t){return 0===e.letterSpacing?t:t+e.letterSpacing}function Fu(e,t,n,r,i,o){return t+function(e,t,n,r,i){if(0===e.letterSpacing)return 0;if(i>0)return e.spacingGraphemeCounts[r]>0?e.letterSpacing:0;for(let i=r-1;i>=t;i--){const o=e.kinds[i];if("space"!==o&&"zero-width-break"!==o&&"hard-break"!==o){if("soft-hyphen"!==o)return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0;if(i===r-1)return 0}}return 0}(e,n,r,i,o)}function Au(e,t,n){const{widths:r,kinds:i,breakableFitAdvances:o}=e;if(0===r.length)return 0;const a=t+pu().lineFitEpsilon;let s=0,l=0,d=!1,c=0,u=0,h=0,p=0,m=-1,g=0;function v(e=h,t=p,r=l){s++,n?.(r,c,u,e,t),l=0,d=!1,m=-1,g=0}function f(e,t){d=!0,c=e,u=0,h=e+1,p=0,l=t}function b(e,t,n){d=!0,c=e,u=t,h=e,p=t+1,l=n}function S(e,t){d?(l+=t,h=e+1,p=0):f(e,t)}function y(e,t){const n=o[e];for(let r=t;r<n.length;r++){const t=n[r];d?l+t>a?(v(),b(e,r,t)):(l+=t,h=e,p=r+1):b(e,r,t)}d&&h===e&&p===n.length&&(h=e+1,p=0)}let w=0;for(;w<r.length&&(d||(w=wu(e,w),!(w>=r.length)));){const e=r[w],t=yu(i[w]);if(!d){e>a&&null!==o[w]?y(w,0):f(w,e),t&&(m=w+1,g=l-e),w++;continue}if(l+e>a){if(t){S(w,e),v(w+1,0,l-e),w++;continue}if(m>=0){if(h>m||h===m&&p>0){v();continue}v(m,0,g);continue}if(e>a&&null!==o[w]){v(),y(w,0),w++;continue}v()}else S(w,e),t&&(m=w+1,g=l-e),w++}return d&&v(),s}function Lu(e,t,n){if(e.simpleLineWalkFastPath)return Au(e,t,n);const{widths:r,kinds:i,breakableFitAdvances:o,discretionaryHyphenWidth:a,chunks:s}=e;if(0===r.length||0===s.length)return 0;const l=pu(),d=t+l.lineFitEpsilon;let c=0,u=0,h=!1,p=0,m=0,g=0,v=0,f=-1,b=0,S=0,y=null;function w(){f=-1,b=0,S=0,y=null}function k(t=g,r=v,i){c++,void 0!==n&&n(Fu(e,i??("soft-hyphen"===y&&f===g&&0===v?S:u),p,m,t,r),p,m,t,r),u=0,h=!1,w()}function C(e,t){h=!0,p=e,m=0,g=e+1,v=0,u=t}function x(e,t,n){h=!0,p=e,m=t,g=e,v=t+1,u=n}function I(e,t){h?(u+=t,g=e+1,v=0):C(e,t)}function O(t,n,r,i,o,a){if(!n)return;const s=Ou(e,t,r,o),l=Mu(e,t,r,o,i);f=r+1,b=u-a+s,S=u-a+l,y=t}function M(t,n){const r=o[t];for(let i=n;i<r.length;i++){const n=r[i];if(h){const r=Nu(e,!0,n),o=u+r;Tu(e,o)>d?(k(),x(t,i,n)):(u=o,g=t,v=i+1)}else x(t,i,n)}h&&g===t&&v===r.length&&(g=t+1,v=0)}function N(e){c++,n?.(0,e.startSegmentIndex,0,e.consumedEndSegmentIndex,0),w()}for(let t=0;t<s.length;t++){const n=s[t];if(n.startSegmentIndex===n.endSegmentIndex){N(n);continue}h=!1,u=0,p=n.startSegmentIndex,m=0,g=n.startSegmentIndex,v=0,w();let c=n.startSegmentIndex;for(;c<n.endSegmentIndex&&(h||(c=wu(e,c,n.endSegmentIndex),!(c>=n.endSegmentIndex)));){const t=i[c],n=yu(t),s=Cu(e,h,c),p="tab"===t?ku(u+s,e.tabStopAdvance):r[c],m=s+p,w=Iu(e,t,c,s,p);if("soft-hyphen"===t){h&&(g=c+1,v=0,f=c+1,b=u+a,S=u+a,y=t),c++;continue}if(!h){w>d&&null!==o[c]?M(c,0):C(c,p),O(t,n,c,p,s,m),c++;continue}if(u+w>d){const r=u+Ou(e,t,c,s),i=u+Mu(e,t,c,s,p);if("soft-hyphen"===y&&l.preferEarlySoftHyphenBreak&&b<=d){k(f,0,S);continue}if(n&&r<=d){I(c,m),k(c+1,0,i),c++;continue}if(f>=0&&b<=d){if(g>f||g===f&&v>0){k();continue}const e=f;k(e,0,S),c=e;continue}if(w>d&&null!==o[c]){k(),M(c,0),c++;continue}k()}else I(c,m),O(t,n,c,p,s,m),c++}if(h){const e=f===n.consumedEndSegmentIndex?S:u;k(n.consumedEndSegmentIndex,0,e)}}return c}let Eu=null;function ju(){return null===Eu&&(Eu=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Eu}function Du(e,t){const n=[];let r=[],i=0,o=!1,a=!1,s=!1;function l(){0!==r.length&&(n.push({text:1===r.length?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,s=!1)}function d(e,t,n){r=[e],i=t,o=n,a=Pc(e),s=vc.has(e)}function c(e,t){r.push(e),o=o||t;const n=Pc(e);a=1===e.length&&bc.has(e)&&a||n,s=!1}for(const n of ju().segment(e)){const e=n.segment,i=uc(e);0!==r.length?s||gc.has(e)||bc.has(e)||t.carryCJKAfterClosingQuote&&i&&a?c(e,i):o||i?(l(),d(e,n.index,i)):c(e,i):d(e,n.index,i)}return l(),n}function _u(e,t,n){if(t.length<=1)return t;const r=[];let i=-1,o=!1;function a(n){if(!(i<0)){if(o)i+1===n?r.push(t[i]):function(n,i){const o=t[n].start,a=i<t.length?t[i].start:e.length;r.push({text:e.slice(o,a),start:o})}(i,n);else for(let e=i;e<n;e++)r.push(t[e]);i=-1,o=!1}}for(let e=0;e<t.length;e++){const r=t[e];i>=0&&!mc(t[e-1].text,n)&&a(e),i<0&&(i=e),o=o||uc(r.text)}return a(t.length),r}function Pu(e,t){if("zero-width-break"===t||"soft-hyphen"===t||"hard-break"===t)return 0;if("tab"===t)return 1;let n=0;const r=ju();for(const t of r.segment(e))n++;return n}function Hu(e,t,n,r,i){const o=pu(),{cache:a,emojiCorrection:s}=bu(t,(l=e.normalized,lu.test(l)));var l;const d=fu("-",hu("-",a),s)+(0===i?0:2*i),c=8*fu(" ",hu(" ",a),s),u=0!==i;if(0===e.len)return function(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}(n);const h=[],p=[],m=[],g=[];let v=e.chunks.length<=1&&!u;const f=n?[]:null,b=[],S=[],y=n?[]:null,w=Array.from({length:e.len});function k(e,t,n,r,i,o,a,s){"text"!==i&&"space"!==i&&"zero-width-break"!==i&&(v=!1),h.push(t),p.push(n),m.push(r),g.push(i),f?.push(o),b.push(a),u&&S.push(s),null!==y&&y.push(e)}function C(e,t,n,r,l){const d=hu(e,a),c=u?Pu(e,t):0,h=function(e,t,n){return t>1?e+(t-1)*n:e}(fu(e,d,s),c,i),p="space"===t||"preserved-space"===t||"zero-width-break"===t?0:h,m=0===p?0:p+(c>0?i:0),g="space"===t||"zero-width-break"===t?0:h;if(l&&r&&e.length>1){let r="sum-graphemes";0!==i?r="segment-prefixes":Xc(e)?r="pair-context":o.preferPrefixWidthsForBreakableRuns&&(r="segment-prefixes");const l=function(e,t,n,r,i){if(void 0!==t.breakableFitAdvances&&t.breakableFitMode===i)return t.breakableFitAdvances;t.breakableFitMode=i;const o=mu(),a=[];for(const t of o.segment(e))a.push(t.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if("sum-graphemes"===i){const e=[];for(const t of a){const i=hu(t,n);e.push(fu(t,i,r))}return t.breakableFitAdvances=e,t.breakableFitAdvances}if("pair-context"===i||a.length>au){const e=[];let i=null,o=0;for(const t of a){const a=fu(t,hu(t,n),r);if(null===i)e.push(a);else{const a=i+t,s=hu(a,n);e.push(fu(a,s,r)-o)}i=t,o=a}return t.breakableFitAdvances=e,t.breakableFitAdvances}const s=[];let l="",d=0;for(const e of a){l+=e;const t=fu(l,hu(l,n),r);s.push(t-d),d=t}return t.breakableFitAdvances=s,t.breakableFitAdvances}(e,d,a,s,r);k(e,h,m,g,t,n,l,c)}else k(e,h,m,g,t,n,null,c)}for(let t=0;t<e.len;t++){w[t]=h.length;const n=e.texts[t],i=e.isWordLike[t],s=e.kinds[t],l=e.starts[t];if("soft-hyphen"===s){k(n,0,d,d,s,l,null,0);continue}if("hard-break"===s){k(n,0,0,0,s,l,null,0);continue}if("tab"===s){k(n,0,0,0,s,l,null,u?Pu(n,s):0);continue}const c=hu(n,a);if("text"===s&&c.containsCJK){const e=Du(n,o),t="keep-all"===r?_u(n,e,o.breakKeepAllAfterPunctuation):e;for(let e=0;e<t.length;e++){const n=t[e];C(n.text,"text",l+n.start,i,"keep-all"===r||!uc(n.text))}}else C(n,s,l,i,!0)}const x=function(e,t,n){const r=[];for(let i=0;i<e.length;i++){const o=e[i],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,s=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,l=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:s,consumedEndSegmentIndex:l})}return r}(e.chunks,w,h.length),I=null===f?null:tc(e.normalized,f);return null!==y?{widths:h,lineEndFitAdvances:p,lineEndPaintAdvances:m,kinds:g,simpleLineWalkFastPath:v,segLevels:I,breakableFitAdvances:b,letterSpacing:i,spacingGraphemeCounts:S,discretionaryHyphenWidth:d,tabStopAdvance:c,chunks:x,segments:y}:{widths:h,lineEndFitAdvances:p,lineEndPaintAdvances:m,kinds:g,simpleLineWalkFastPath:v,segLevels:I,breakableFitAdvances:b,letterSpacing:i,spacingGraphemeCounts:S,discretionaryHyphenWidth:d,tabStopAdvance:c,chunks:x}}function Ru(e,t,n,r){const i=r?.wordBreak??"normal",o=r?.letterSpacing??0;return Hu(nu(e,pu(),r?.whiteSpace,i),t,n,i,o)}function $u(e,t,n){return Ru(e,t,!1,n)}function Vu(e,t,n){const r=function(e,t){return Lu(e,t)}(e,t);return{lineCount:r,height:r*n}}function Wu(e){let{containerWidth:t,iconSpacing:n,headerText:r,headerFont:i,headerLineHeight:o,subText:a,subTextFont:s,subTextLineHeight:l,textsSpacing:d,initialSize:c}=e;if(t<=0)return c;const u=$u(r,i),h=a&&s?$u(a,s):null;let p=c;for(let e=0;e<10;e++){const e=t-p-n;if(e<=0)return c;let r=Vu(u,e,o).height;if(h&&l&&(r+=Vu(h,e,l).height+d),Math.abs(r-p)<.5)return Math.round(r);p=r}return c}function Bu(e,t,n,r){const i=null!=e?e:"17px",o=null!=t?t:'-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',a=[];return r&&"normal"!==r&&a.push(r),n&&"normal"!==n&&a.push(n),a.push(i),a.push(o),a.join(" ")}function zu(e,t){return t&&"none"!==t?"uppercase"===t?e.toUpperCase():"lowercase"===t?e.toLowerCase():"capitalize"===t?e.replace(/\b\w/g,(e=>e.toUpperCase())):e:e}function Uu(){return Uu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uu.apply(this,arguments)}const qu=rn("p")((e=>{let{theme:t,fontProperties:n,isFirstCardNode:r,isFinalCardNode:i,iconAlignment:o}=e;const a=t.getShape("padding.elementBottom",{skipFallback:!0});return Object.assign(Object.assign({display:"grid",gridTemplateColumns:"auto minmax(0,1fr)",alignItems:"center"===o?"center":"start",color:t.getCSSColor("text.category")},null!=n?n:{}),{padding:a?`0px 0px ${i?"0px":a}`:`${r?0:10}px 0px ${i?0:10}px`,margin:"0"})})),Yu=rn("span")({whiteSpace:"pre-wrap",overflow:"hidden",overflowWrap:"break-word",wordWrap:"break-word",wordBreak:"break-word"}),Ku=rn("span")((e=>{var t;let{theme:n,fontProperties:r}=e;return Object.assign(Object.assign({display:"block",whiteSpace:"pre-wrap",overflow:"hidden",overflowWrap:"break-word",wordWrap:"break-word",wordBreak:"break-word",color:null!==(t=n.getCSSColor("text.categorySubText",{skipFallback:!0}))&&void 0!==t?t:n.getCSSColor("text.category")},null!=r?r:{}),"italic"===(null==r?void 0:r.fontStyle)?{paddingRight:"0.2em"}:{})})),Zu=rn("span")((e=>{let{theme:t,iconSpacing:n,iconAlignment:r,iconSize:i,iconVerticalOffset:o}=e;const a=t.getCSSColor("background.categoryIcon",{skipFallback:!0}),s=t.getCSSColor("border.categoryIcon",{skipFallback:!0}),l=t.getShape("border.categoryIcon",{skipFallback:!0}),d=t.getShape("borderRadius.categoryIcon",{skipFallback:!0}),c=t.getCSSShadowProperties("categoryIcon",{skipFallback:!0});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({display:"flex",alignItems:"center",justifyContent:"center",alignSelf:"top"===r?"flex-start":"center",boxSizing:"border-box",width:`${i}px`,height:`${i}px`,minWidth:`${i}px`,overflow:"hidden",marginRight:n},o>0?{marginTop:`${o}px`}:{}),a&&i>0?{backgroundColor:a}:{}),s&&l&&i>0?{border:`${l} solid ${s}`}:{}),d&&i>0?{borderRadius:d}:{}),c&&i>0?{boxShadow:c}:{})}));let Qu=null;const Gu=rn("div")((e=>{let{mode:t}=e;return{display:t===va?"block":"flex",flexDirection:"column",flexGrow:"1"}})),Xu=e=>{let{fillColor:t,ariaHidden:n}=e;return(0,le.h)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":null!=n&&n},(0,le.h)("path",{d:"M12 13V7M3 3H8M17 3H12M4 7V16C4 16.5523 4.44772 17 5 17H15C15.5523 17 16 16.5523 16 16V7M8 3L9 2H11L12 3M8 3H12M8 7V13",stroke:t,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},Ju=e=>{let{fillColor:t,ariaHidden:n}=e;return(0,le.h)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":null!=n&&n},(0,le.h)("path",{d:"M15 7V13.5C15 15.9853 12.9853 18 10.5 18V18C8.01472 18 6 15.9853 6 13.5V5C6 3.34315 7.34315 2 9 2V2C10.6569 2 12 3.34315 12 5V13.5C12 14.3284 11.3284 15 10.5 15V15C9.67157 15 9 14.3284 9 13.5V7",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))};var eh=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const th={jpeg:{signatures:[[255,216,255]],offset:0},png:{signatures:[[137,80,78,71,13,10,26,10]],offset:0},webp:{signatures:[[82,73,70,70,,,,,87,69,66,80]],offset:0},avif:{signatures:[[32,102,116,121,112,97,118,105,102]],offset:3}},nh={tif:{signatures:[[73,73,42,0],[77,77,0,42]],offset:0},tiff:{signatures:[[73,73,43,0],[73,73,0,43]],offset:0},heic:{signatures:[[102,116,121,112,104,101,105,99]],offset:4}};var rh=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const ih=rn("label")((()=>({position:"relative",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",display:"flex",alignItems:"center",width:"100%",cursor:"pointer"}))),oh=rn("div")((e=>{let{theme:t,enabledThumbnailIcon:n,preview:r}=e;const i=n||(null==r?void 0:r.url)?"30px":"0",o={background:`url(${null==r?void 0:r.url})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"};return Object.assign({width:i,height:i,minWidth:i,minHeight:i,padding:n||(null==r?void 0:r.url)?"7px":"0",marginRight:n||(null==r?void 0:r.url)?"10px":"0",display:"flex",justifyContent:"center",alignItems:"center",borderRadius:t.getShape("borderRadius.uploadPlaceholder")||"0px",backgroundColor:t.getCSSColor("background.uploadPlaceholder")},(null==r?void 0:r.url)&&r.webCompatible?o:{})})),ah=rn("span")((e=>{let{theme:t,mode:n,placeholder:r,yPadding:i}=e;const o=Object.assign({overflow:"hidden",textOverflow:"ellipsis",color:t.getCSSColor("text.secondary")},t.getCSSFontProperties("secondary")),a=Object.assign(Object.assign({whiteSpace:"normal",color:t.getCSSColor("text.valueStacked",{skipFallback:!0})||t.getCSSColor("text.primary")},t.getCSSFontProperties("valueStacked",{skipFallback:!0})||t.getCSSFontProperties("primary")),i?{paddingBottom:`${i}px`}:{}),s=Object.assign({whiteSpace:"normal",color:t.getCSSColor("text.valueStacked")},t.getCSSFontProperties("valueStacked"));return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({width:"100%"},n===ga?o:{}),n===va?a:{}),n===fa?s:{}),r?{color:t.getCSSColor("text.hint")}:{}),{userSelect:"none","-webkit-user-select":"none","-moz-user-select":"none"})})),sh=rn("div")({display:"flex",flexDirection:"column",flexGrow:"1",minWidth:"0"}),lh=rn("input")({position:"absolute",visibility:"hidden",width:"100%",height:"100%"}),dh=rn("button")((()=>({display:"flex",justifyContent:"center",alignItems:"center",border:"0",padding:"0",margin:"0",textDecoration:"none",cursor:"pointer",textAlign:"center",background:"none","-webkit-appearance":"none","-moz-appearance":"none"}))),ch=rn("button")((()=>({display:"flex",justifyContent:"center",alignItems:"center",border:"0",padding:"0",margin:"0",textDecoration:"none",cursor:"pointer",textAlign:"center",background:"none","-webkit-appearance":"none","-moz-appearance":"none"}))),uh=mr(((e,t)=>{let{theme:n,cardInstanceId:r,subviewId:i,format:o,name:a,label:s,placeholder:l,validations:d,enabledThumbnailIcon:c,targetBucketId:h}=e;const p=ye(null),m=ye(null),g=lt(r,a,i),[v,f]=ve(null),[b,S]=ve(null),[y,w]=ve(0),C=k().getState();be((()=>{if(C.application.isPreview)return;const e=window.AtomicUploadService.getFile(C.application.containerInstanceId,r,a);g&&e?(I(e),S(g.filename)):st().handleFormChange(r,a,void 0,i)}),[]),be((()=>{if(p.current&&m.current&&!y){var e,t,n,r;const i=(null===(e=p.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.offsetHeight)||0,o=(null===(n=m.current)||void 0===n||null===(r=n.base)||void 0===r?void 0:r.offsetHeight)||0;if(i>0&&o>0&&i>o){const e=Math.round((i-o)/2);w(e>0?e:0)}}}),[p]);const x=(e,t)=>{f({url:URL.createObjectURL(e),webCompatible:!t})},I=e=>{var t;const n=null===(t=p.current)||void 0===t?void 0:t.base;if(n){x(e.file,e.convertImage);const t=new DataTransfer;t.items.add(e.file),n.files=t.files}},O=()=>{C.application.isPreview||(window.AtomicUploadService.removeFile(C.application.containerInstanceId,r,a,i),st().handleFormChange(r,a,void 0,i),st().validateField(r,a,void 0,d,i),p.current&&(f(null),S(null),p.current.base.value=null))},M=`upload-input-${r}-${a}`;let N=(null==l?void 0:l.length)&&"\n"!==l?l:"";return o!==ga||N.length||(N=s),(0,le.h)(le.Fragment,null,(0,le.h)(oh,{theme:n,enabledThumbnailIcon:c,preview:v},!v&&c&&(0,le.h)(In,{fillColor:n.getCSSColor("icon.uploadPlaceholder"),ariaHidden:!0}),v&&!v.webCompatible&&(0,le.h)(Yn,{fillColor:n.getCSSColor("icon.uploadPlaceholder"),ariaHidden:!0})),(0,le.h)(ih,{htmlFor:M},(0,le.h)(sh,{ref:m},o===va&&(0,le.h)(wa,{theme:n,mode:o,yPadding:y,useSpanElement:!0},s),(0,le.h)(ah,{theme:n,mode:o,placeholder:!b,yPadding:y},b||N)),(0,le.h)(lh,{id:M,ref:e=>{p.current=e,"function"==typeof t?t(e):t&&(t.current=e)},type:"file",accept:"image/jpeg, image/png, image/webp, image/avif",onChange:e=>rh(void 0,void 0,void 0,(function*(){if(C.application.isPreview)return;const t=e.target;if(t.files&&t.files.length){f(null),S(null);const[e]=Array.from(t.files),n=yield(e=>eh(void 0,void 0,void 0,(function*(){const t=yield e.slice(0,(()=>{const e=Object.assign(Object.assign({},th),nh);return Object.values(e).reduce(((e,t)=>{let n=0;return t.signatures.forEach((e=>n=Math.max(n,e.length))),n+=t.offset,Math.max(e,n)}),0)})()).arrayBuffer(),n=new Uint8Array(t),r=(e,t)=>e.every(((e,r)=>n[t+r]===e||void 0===e));for(const{signatures:e,offset:t}of Object.values(th))for(const n of e)if(r(n,t))return{requiresConversion:!1,isValidImage:!0};for(const{signatures:e,offset:t}of Object.values(nh))for(const n of e)if(r(n,t))return{requiresConversion:!0,isValidImage:!0};return{requiresConversion:!1,isValidImage:!1}})))(e);if(!n.isValidImage)return O(),void st().validateFieldCustomResult(r,a,{type:"invalid",errorMessage:"Invalid file or unsupported image format selected"},i);const o=`${u()}_${e.name}`,s={filename:e.name,destinationFilename:o,size:e.size,type:"image",targetBucketId:h};window.AtomicUploadService.storeFile(e,"image",h,r,C.application.containerInstanceId,o,n.requiresConversion,a,i),st().handleFormChange(r,a,s,i),x(e,n.requiresConversion),S(e.name),st().validateField(r,a,s,d,i)}}))})),b?(0,le.h)(ch,{onClick:O,"aria-label":"remove image"},(0,le.h)(Xu,{fillColor:n.getCSSColor("icon.inputButton"),ariaHidden:!0})):(0,le.h)(dh,{onClick:()=>{var e,t;return null==p||null===(e=p.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.click()},"aria-label":`attach image ${o===ga&&l||s}`},(0,le.h)(Ju,{fillColor:n.getCSSColor("icon.inputButton"),ariaHidden:!0})))})),hh=hr((e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{format:i,label:o,placeholder:a,name:s,type:l,enabledThumbnailIcon:d,targetBucketId:c},theme:u,isFinalCardNode:h,validations:p,variableResolver:m}=e;const g=`upload-label-${n}-${s}`,v=m(o),f=m(a||""),b=ye(null),S="image"===l?(0,le.h)(uh,{ref:b,theme:u,cardInstanceId:n,subviewId:r,format:i,name:s,validations:p,label:v,placeholder:f,enabledThumbnailIcon:d,targetBucketId:c||"DEFAULT"}):null;return(0,le.h)(le.Fragment,null,(0,le.h)(Ia,{nodeKey:t,theme:u,isFinalCardNode:h,mode:i,label:v,labelId:g,onClick:e=>{const t=e.target;t.closest("label")||t.closest("button")||b.current.base.click()},clickableLabel:!1},S),(0,le.h)(Fa,{name:s,cardInstanceId:n,subviewId:r,theme:u,isFinalCardNode:h,variableResolver:m}))}),((e,t)=>e.nodeKey===t.nodeKey&&e.cardInstanceId===t.cardInstanceId&&e.subviewId===t.subviewId&&e.attributes===t.attributes&&e.theme===t.theme&&e.validations===t.validations)),ph={left:"flex-start",center:"center",right:"flex-end"},mh=rn("div")((e=>{var t,n,r,i,o,a,s,l,d,c,u,h,p;let{theme:m,paddingValues:g,feedOrientation:v,isFirstCardNode:f,ruleBetween:b,buttonLayout:S,buttonWidth:y,shadowVerticalExtent:w}=e;const{containerPadding:k,containerHorizontalPaddingFallback:C,containerVerticalPaddingFallback:x,buttonGroupPadding:I,buttonGroupVerticalPaddingFallback:O}=g;let M=b?"0px":null!==(t=m.getShape("buttonSpacingAfter.global",{skipFallback:!0}))&&void 0!==t?t:"10px";const N=m.getShape("buttonAlignment.global"),T=Object.assign({flexGrow:"1",flexDirection:"column"},"horizontal"===S?{alignItems:"flex-end"}:{justifyContent:"flex-end"}),F={flexDirection:"row",overflowX:"scroll","::-webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none",scrollbarWidth:"none",marginLeft:`-${null!==(n=k.left)&&void 0!==n?n:C}px`,marginRight:`-${null!==(r=k.right)&&void 0!==r?r:C}px`,paddingLeft:`${null!==(i=I.left)&&void 0!==i?i:C}px`,paddingRight:`${null!==(o=I.right)&&void 0!==o?o:C}px`},A={flexDirection:"row"},L={flexDirection:"column",alignItems:null!==(a=ph[N])&&void 0!==a?a:"flex-start","> button:not(:last-child)":{marginBottom:M},"> a:not(:last-child)":{marginBottom:M}},E="horizontal"===S&&"fillsContainer"!==y?w:0,j=null!==(s=I.top)&&void 0!==s?s:f?0:O,D=null!==(l=I.bottom)&&void 0!==l?l:0,_=void 0!==I.bottom?null!==(d=k.bottom)&&void 0!==d?d:x:0;return Object.assign(Object.assign({position:"relative",paddingTop:`${j+E}px`,paddingBottom:`${D+E}px`,paddingLeft:`${null!==(c=I.left)&&void 0!==c?c:0}px`,paddingRight:`${null!==(u=I.right)&&void 0!==u?u:0}px`,marginTop:-E+"px",marginBottom:-(_+E)+"px",marginLeft:`-${void 0!==I.left?null!==(h=k.left)&&void 0!==h?h:C:0}px`,marginRight:`-${void 0!==I.right?null!==(p=k.right)&&void 0!==p?p:C:0}px`,display:"flex",alignItems:"center"},"horizontal"===v?T:{}),"horizontal"!==S?L:"fillsContainer"===y?A:F)})),gh=rn("div")((e=>{let{buttonAlignment:t,spaceBetweenButtons:n,fillsContainer:r}=e;if(r){const e={flex:"1",minWidth:"0",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"};return{display:"flex",width:"100%",alignItems:"center",gap:n,"> button":e,"> a":e}}let i={};return"center"===t?i={marginLeft:"auto",marginRight:"auto"}:"right"===t&&(i={marginLeft:"auto"}),Object.assign({display:"flex",flexShrink:"0",alignItems:"center","> button:not(:last-child)":{marginRight:n},"> a:not(:last-child)":{marginRight:n}},i)})),vh=rn("div")((e=>{let{theme:t,isFirstCardNode:n,isFinalCardNode:r}=e;const i=t.getShape("padding.elementBottom",{skipFallback:!0});return{padding:i?`0px 0px ${r?"0px":i}`:`${n?0:10}px 0px ${r?0:10}px`}})),fh=rn("ul")({listStyle:"none",padding:"0",margin:"0","> li":{marginBottom:"10px"},"> :last-child":{marginBottom:"0"}}),bh=rn("label")((e=>{let{labelFontProperties:t}=e;return{cursor:"pointer",display:"grid",gridTemplateColumns:"auto minmax(0, 1fr)",gridTemplateRows:`${(null==t?void 0:t.lineHeight)||"auto"} 1fr`,alignItems:"center",width:"fit-content",userSelect:"none"}})),Sh=rn("input")((e=>{let{theme:t}=e;return{position:"absolute",appearance:"none","&:focus-visible + span":{boxShadow:`0 0 0 2px ${t.getCSSColor("border.focus")} inset`}}})),yh=rn("span")((e=>{let{theme:t,isChecked:n}=e;const r={backgroundColor:t.getCSSColor("background.checkedCheckbox",{skipFallback:!0})||"#000",borderColor:t.getCSSColor("border.checkedCheckbox",{skipFallback:!0})||"#000",borderWidth:t.getShape("border.checkedCheckbox")||"1px",borderStyle:"solid",borderRadius:t.getShape("borderRadius.checkedCheckbox",{skipFallback:!0})||"4px"},i={backgroundColor:t.getCSSColor("background.uncheckedCheckbox",{skipFallback:!0})||"#FFF",borderColor:t.getCSSColor("border.uncheckedCheckbox",{skipFallback:!0})||"#000",borderWidth:t.getShape("border.uncheckedCheckbox")||"1px",borderStyle:"solid",borderRadius:t.getShape("borderRadius.uncheckedCheckbox",{skipFallback:!0})||"4px"};return Object.assign({height:"20px",width:"20px",padding:"6px 4px 6px 5px",position:"relative",marginRight:"10px",display:"inline-block"},n?r:i)})),wh=rn("span")((e=>{let{theme:t,labelFontProperties:n}=e;return Object.assign(Object.assign({},n||{}),{gridColumnStart:"2",gridRowStart:"span 2",whiteSpace:"pre-wrap",color:t.getCSSColor("text.labelInline",{skipFallback:!0})||t.getCSSColor("text.primary"),cursor:"pointer",userSelect:"none",webkitUserSelect:"none",overflowWrap:"break-word",wordWrap:"break-word",wordBreak:"break-word"})}));function kh(){return kh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kh.apply(this,arguments)}const Ch={linkButton:e=>{let{nodeKey:t,index:n,localIndex:r,cardInstanceId:i,subviewId:o,subviewTitle:a,isWorkflow:s,theme:l,attributes:d,variableResolver:c}=e;const{text:u,icon:h,iconUrl:p,iconAltText:m,appearance:g}=d,v=d.url,f=d.target,b=Object.assign(Object.assign({},o&&{subviewId:o}),a&&{subviewTitle:a}),S=Ce(Gi),y=S.runtimeVariableResolver,w=S.containersBroadcastChannel;return(0,le.h)(Pl,{nodeKey:t,index:n,localIndex:r,theme:l,appearance:g,isWorkflow:s,text:c(u),icon:h,iconUrl:p,iconAltText:m,clickHandler:e=>{const n=k().getState();return r=>jl(void 0,void 0,void 0,(function*(){let o,a,s;if(d.action){s=d.action;const e=n.cardFeed.cardInstances.find((e=>e.instance.id===i));s&&y&&e&&(yield _l(y,n.application.runtimeVariableResolutionTimeout,e,s))}else if(d.layoutId)o=d.layoutId;else if(d.url){if(r.preventDefault(),a={url:c(v),target:r.ctrlKey||r.metaKey?"_blank":null!=f?f:"_blank"},S.analyticsDispatcher.sendEvent({cardInstanceId:i,cardViewState:n.navigationStack.items.length?"subview":"topview",eventName:ut,properties:Object.assign({linkMethod:"url",url:a.url,trigger:"linkButton"},b.subviewId?Object.assign(Object.assign({},b),{subviewLevel:1}):{})}),"_top"===a.target&&w){const e=`${t}-link-button`;return w.addEventListener("message",(t=>{if(t.data.type===Us.ANALYTICS_EVENT){var n;const r=null===(n=t.data)||void 0===n?void 0:n.eventQueued;r.eventName===ut&&r.cardInstanceId===i&&w&&a&&(w.removeEventListener(e),window.open(a.url,a.target))}}),e)}return window.open(a.url,a.target)}return e.handleLinkButtonPress(i,b,o,s)}))},urlLink:v?{url:c(v),target:f}:void 0})},submitButton:e=>{let{nodeKey:t,index:n,localIndex:r,cardInstanceId:i,subviewId:o,subviewTitle:a,isWorkflow:s,theme:l,attributes:{name:d,text:c,appearance:u,icon:h,iconUrl:p,iconAltText:m,values:g,url:v,action:f,target:b},variableResolver:S}=e;const[y,w]=ve(!1),C=Ce(Gi),x=C.cardEventDispatcher,I=C.authTokenProvider,O=C.analyticsDispatcher,M=C.runtimeVariableResolver;return(0,le.h)(Pl,{nodeKey:t,index:n,localIndex:r,theme:l,appearance:u,isWorkflow:s,text:S(c),icon:h,iconUrl:p,iconAltText:m,clickHandler:e=>{const t=k().getState();return()=>jl(void 0,void 0,void 0,(function*(){var n,r;if(t.application.isPreview)return void e.finishSubview();if(y)return;w(!0);const l=t.cardFeed.cardInstances.find((e=>e.instance.id===i));f&&M&&l&&(yield _l(M,t.application.runtimeVariableResolutionTimeout,l,f));let c={};var u,h;s?(e.validateCurrentSubview(i),c=o&&null!==(n=null===(u=k().getState().validationStates[i])||void 0===u||null===(h=u.subviews)||void 0===h?void 0:h[o])&&void 0!==n?n:{}):(e.validateCardTopLevel(i),c=null!==(r=k().getState().validationStates[i].validations)&&void 0!==r?r:{});const p=k().getState(),m=(e=>!!e.navigationStack.items.length)(t);(e=>{for(var t in e)if("invalid"===e[t].type)return!1;return!0})(c)&&(yield Al(p,e,i,m,x,O,I,g,{postSubmissionUrl:v?{url:S(v),target:b}:void 0,payload:f,subviewData:{subviewId:o,subviewTitle:a},submitButtonName:d,cancelSubmitCallback:()=>w(!1)}),s&&O.sendEvent({cardInstanceId:i,cardViewState:"subview",eventName:St,properties:{subviewId:o,subviewTitle:a,subviewLevel:1}})),w(!1)}))},loading:y,type:"submit"})},dismissButton:e=>{let{nodeKey:t,index:n,localIndex:r,isWorkflow:i,attributes:o,theme:a,cardInstanceId:s,variableResolver:l}=e;const{text:d,icon:c,iconUrl:u,iconAltText:h,appearance:p}=o,m=Ce(Gi);return(0,le.h)(Pl,{nodeKey:t,index:n,localIndex:r,theme:a,appearance:p,isWorkflow:i,text:l(d),icon:c,iconUrl:u,iconAltText:h,clickHandler:e=>()=>{Fl(k().getState(),e,s,m.cardEventDispatcher,m.authTokenProvider,"card-button")}})},snoozeButton:e=>{let{nodeKey:t,index:n,localIndex:r,isWorkflow:i,attributes:o,theme:a,cardInstanceId:s,cardMetadata:l,variableResolver:d}=e;const{text:c,icon:u,iconUrl:h,iconAltText:m,snoozePeriod:g,appearance:v}=o,f=Ce(Gi);return(0,le.h)(Pl,{nodeKey:t,index:n,localIndex:r,theme:a,appearance:v,isWorkflow:i,text:d(c),icon:u,iconUrl:h,iconAltText:m,clickHandler:e=>()=>{if(void 0===g||null===Hh(g))e.requestSnooze(s,"card-button",null==l?void 0:l.expires);else{const t=Rh(g,new Date);(0,p.isPast)(t)||Ll(k().getState(),e,s,t,f.cardEventDispatcher,f.authTokenProvider,"card-button")}}})},voteUpButton:e=>{let{nodeKey:t,index:n,localIndex:r,isWorkflow:i,attributes:o,theme:a,cardInstanceId:s,variableResolver:l}=e;const{text:d,icon:c,iconUrl:u,iconAltText:h,appearance:p}=o,m=Ce(Gi);return(0,le.h)(Pl,{nodeKey:t,index:n,localIndex:r,theme:a,appearance:p,isWorkflow:i,text:l(d),icon:c,iconUrl:u,iconAltText:h,clickHandler:e=>()=>{El(s,e,m.analyticsDispatcher,m.cardEventDispatcher,"card-button")}})},voteDownButton:e=>{let{nodeKey:t,index:n,localIndex:r,isWorkflow:i,attributes:o,theme:a,cardInstanceId:s,variableResolver:l}=e;const{text:d,icon:c,iconUrl:u,iconAltText:h,appearance:p}=o;return(0,le.h)(Pl,{nodeKey:t,index:n,localIndex:r,theme:a,appearance:p,isWorkflow:i,text:l(d),icon:c,iconUrl:u,iconAltText:h,clickHandler:e=>()=>{e.requestFeedback(s,{sentiment:"negative",source:"card-button",textFeedback:!0})}})},actionButtonGroup:e=>{var t,n,r,i,o,a,s,l;let{children:d,theme:c,feedOrientation:u,isWorkflow:h,isFirstCardNode:p,subviewId:m}=e;const g=ye(null),v=c.getShape("buttonLayout.global"),f=c.getShape("buttonWidth.global"),b=c.getShape("buttonAlignment.global"),S=h?["button","buttonSecondary"]:["action","actionSecondary"],y=Math.max(...S.map((e=>c.getShadowVerticalExtent(e))));if(be((()=>{var e;if("horizontal"!==v||"fillsContainer"===f||!g.current)return;const t=null===(e=g.current)||void 0===e?void 0:e.base;"right"===b?t.scrollLeft=t.scrollWidth-t.clientWidth:"center"===b&&(t.scrollLeft=Math.round((t.scrollWidth-t.clientWidth)/2))}),[m]),!d||!d.length)return null;const w=null!==(t=c.getShape("buttonSpacingAfter.global",{skipFallback:!0}))&&void 0!==t?t:"10px",k={top:c.getHorizontalRule("buttonGroupTop"),between:c.getHorizontalRule("buttonGroupBetween"),bottom:c.getHorizontalRule("buttonGroupBottom")},C=c.getShape("padding.elementBottom",{skipFallback:!0}),x={containerPadding:h?c.getNumericalPadding("stream"):c.getNumericalPadding("card"),containerHorizontalPaddingFallback:h?N:O,containerVerticalPaddingFallback:h?N:M,buttonGroupPadding:c.getNumericalPadding("buttonGroup"),buttonGroupVerticalPaddingFallback:null!==(n=mn(C))&&void 0!==n?n:T};let I="0px";if(void 0!==x.buttonGroupPadding.bottom){const e=null!==(r=x.containerPadding.bottom)&&void 0!==r?r:x.containerVerticalPaddingFallback;I=x.buttonGroupPadding.bottom>e?`-${x.buttonGroupPadding.bottom-e}px`:(null!==(i=x.containerPadding.bottom)&&void 0!==i?i:x.containerVerticalPaddingFallback)-x.buttonGroupPadding.bottom+"px"}return(0,le.h)(le.Fragment,null,(null===(a=k.top)||void 0===a?void 0:a.enabled)&&(0,le.h)(Fn,{theme:c,ruleStyles:k.top,isSubview:h,translateY:`${null!==(o=x.buttonGroupPadding.top)&&void 0!==o?o:p?0:x.buttonGroupVerticalPaddingFallback}px`}),(0,le.h)(mh,{ref:g,theme:c,paddingValues:x,isFirstCardNode:p,feedOrientation:u,buttonLayout:v,buttonWidth:f,shadowVerticalExtent:y,ruleBetween:(null===(s=k.between)||void 0===s?void 0:s.enabled)&&"horizontal"!==v},"horizontal"===v?(0,le.h)(gh,{buttonAlignment:b,spaceBetweenButtons:w,fillsContainer:"fillsContainer"===f},d):d),(null===(l=k.bottom)||void 0===l?void 0:l.enabled)&&(0,le.h)(Fn,{theme:c,isSubview:h,ruleStyles:k.bottom,translateY:I}))},cardDescription:e=>{var t,n,r,i,o,a,s,l,d,c,u;let{nodeKey:h,isFirstCardNode:p,isFinalCardNode:m,attributes:{text:g,subText:v,elementsOrder:f=["text","subText"],icon:b,iconUrl:S,iconAltText:y,iconAttributes:w},theme:k,variableResolver:C}=e;const x=k.getCSSFontProperties("category"),I=k.getNumericFontSize("category"),O=null!==(t=k.getCSSFontProperties("categorySubText",{skipFallback:!0}))&&void 0!==t?t:k.getCSSFontProperties("category");x.textAlign="left",O&&(O.textAlign="left");const M=null!==(n=f[0])&&void 0!==n?n:"text",N=k.getCSSColor("icon.category",{skipFallback:!0}),T=k.getCSSColor("icon.category"),F=null!==(r=k.getShape("padding.categoryTextsIconSpacing",{skipFallback:!0}))&&void 0!==r?r:"0px",A=k.getShape("padding.categoryTextsSpacing",{skipFallback:!0}),L=k.getShape("border.categoryIcon",{skipFallback:!0}),E=ye(null),j=ye(null),D=ye(null),[_,P]=ve(0),[H,R]=ve(1),[$,V]=ve(!1);be((()=>{document.fonts.ready.then((()=>V(!0)))}),[]);const W=!(!b&&!S),B=!!g,z=!!v,U=B||z,q=null==w?void 0:w.displaySize,Y=("matchTextBlockHeight"!==q||U)&&null!=q?q:"matchHeaderHeight";be((()=>{var e;if(!W||!("matchTextBlockHeight"===Y||"fixedSize"===Y))return;const t=null===(e=D.current)||void 0===e?void 0:e.base;if(!t)return;const n=()=>{const e=t.offsetWidth;e>0&&P(e)};n();const r=new ResizeObserver((()=>{n()}));return r.observe(t),()=>{r.disconnect()}}),[W,Y]);const K=null!==(i=C(g))&&void 0!==i?i:"",Z=null!==(o=C(v))&&void 0!==o?o:"",Q=x.textTransform,G=null==O?void 0:O.textTransform,X=zu(K,Q),J=zu(Z,G),ee=Bu(x.fontSize,x.fontFamily,x.fontWeight,x.fontStyle),te=x.lineHeight?parseFloat(x.lineHeight):null!=I?I:20,ne=O?Bu(O.fontSize,O.fontFamily,O.fontWeight,O.fontStyle):void 0,re=(null==O?void 0:O.lineHeight)?parseFloat(O.lineHeight):void 0,ie=parseFloat(F)||0,oe=L?parseFloat(L):0,ae=A?parseFloat(A):0,se=ke((()=>"matchTextBlockHeight"!==Y||_<=0||!X&&!J||!$?null:!X&&J&&ne&&re?Wu({containerWidth:_,iconSpacing:ie,headerText:J,headerFont:ne,headerLineHeight:re,textsSpacing:0,initialSize:re}):X?Wu({containerWidth:_,iconSpacing:ie,headerText:X,headerFont:ee,headerLineHeight:te,subText:J||void 0,subTextFont:ne,subTextLineHeight:re,textsSpacing:ae,initialSize:te}):null),[Y,_,X,J,ee,te,ne,re,ie,ae,$]),de="fixedSize"===Y&&_>0?Math.max(0,.9*(_-ie)):1/0,ce=Math.max(0,"fixedSize"===Y?Math.min(null!==(s=null!==(a=null==w||null===(u=w.dimension)||void 0===u?void 0:u.height)&&void 0!==a?a:I)&&void 0!==s?s:20,de):"matchTextBlockHeight"===Y?null!==(d=null!==(l=null!=se?se:re)&&void 0!==l?l:I)&&void 0!==d?d:20:te),ue=Math.max(0,ce-2*oe);be((()=>{if(!W||ue<=0)return void R(1);if(!!b&&!S){const e=xn[b];if(e){const t=document.createElement("canvas").getContext("2d");if(t){t.font=`900 ${ue}px 'Font Awesome 5 Free'`;const n=t.measureText(e).width;return void R(n>ue?ue/n:1)}}}if(j.current){const e=j.current.firstElementChild;if(e){const t=e.scrollWidth,n=e.scrollHeight,r=Math.max(t,n);R(r>ue?ue/r:1)}}}),[W,ce,b,S,$]);const he="matchHeaderHeight"===Y?"top":null!==(c=null==w?void 0:w.alignment)&&void 0!==c?c:"center",pe="matchHeaderHeight"===Y&&z&&(!B||"subText"===M),me=pe&&(re||0)>ce?((re||0)-ce)/2:0,ge=pe&&ce>(re||0)?(ce-(re||0))/2:0,fe=Kh({elementName:"card title",label:[C(g),C(v)],iconAltText:y,hasIcon:W}),Se=B?(0,le.h)(Yu,{"data-testid":"category-text"},C(g)):null,we=z?(0,le.h)(Ku,{theme:k,fontProperties:O,"data-testid":"category-subtext"},C(v)):null,Ce=f.map((e=>"text"===e?Se:we)).filter(Boolean),xe=H<1?Math.round(ue*H):ue,Ie=W?(0,le.h)(Zu,{theme:k,iconSpacing:F,iconAlignment:he,iconSize:ce,iconVerticalOffset:me,"data-testid":"category-icon-wrapper"},(0,le.h)("span",{ref:j,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"}},(0,le.h)(Nn,{iconName:b,iconUrl:S,size:xe,color:null!==N?N:void 0,fallbackColor:T,scaleToFit:!0,styles:{alignSelf:"top"===he?"flex-start":"center",lineHeight:"matchHeaderHeight"===Y?te:`${ue}px`,width:`${ue}px`,maxWidth:`${ue}px`,maxHeight:`${ue}px`,textAlign:"center"}}))):null;return(0,le.h)(qu,{ref:D,theme:k,fontProperties:x,"data-testid":"card-category",isFirstCardNode:p,isFinalCardNode:m,iconAlignment:he},Ie,U&&(0,le.h)("span",Uu({ref:E,role:"text",key:h,"data-testid":"category-text-block"},fe?{"aria-label":fe}:{},{style:Object.assign(Object.assign({display:"flex",flexDirection:"column",overflow:"hidden"},A?{gap:A}:{}),ge>0?{marginTop:`${ge}px`}:{})}),Ce))},headline:e=>{var t,n;let{nodeKey:r,isFirstCardNode:i,isFinalCardNode:o,attributes:{text:a,icon:s,iconUrl:l,iconAltText:d,appearance:c},theme:u,variableResolver:h}=e;const p=vn(c),m=u.getCSSFontProperties(`headline${p}`),g=u.getNumericFontSize(`headline${p}`),v=u.getCSSColor(`icon.headline${p}`,{skipFallback:!0}),f=u.getCSSColor(`icon.headline${p}`),b=!(!s&&!l),S=null===(n=m)||void 0===n?void 0:n.textAlign,y=b&&"center"!==S&&"right"!==S,w=(e=>"h2"===e?"Secondary":"h3"===e?"Tertiary":"Primary")(c),k=`${w} Heading. ${y?Kh({elementName:"card headline",label:h(a),iconAltText:d,hasIcon:!0}):h(a)}.`;return(0,le.h)(Vl,{theme:u,appearance:c,isFirstCardNode:i,isFinalCardNode:o,headlineFontProperties:m},y&&(0,le.h)(Nn,{iconName:s,iconUrl:l,size:null!=g?g:20,color:null!==v?v:void 0,fallbackColor:f,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(t=null==m?void 0:m.lineHeight)&&void 0!==t?t:"initial",marginRight:"10px",width:`${g}px`,minWidth:`${g}px`,textAlign:"center"}}),(0,le.h)(Wl,{key:r,theme:u,appearance:c,"data-testid":"card-headline","data-element-key":r,"aria-label":k},h(a)))},text:e=>{var t,n,r,i,o,a,s,l;let{nodeKey:d,isFirstCardNode:c,isFinalCardNode:h,theme:p,attributes:{icon:m,iconUrl:g,iconAltText:v,text:f,clickToExpandEnabled:b,maxDisplayLines:S,showTextLabel:y,hideTextLabel:w,appearance:k},isWorkflow:C,variableResolver:x,cardInstanceId:I,subviewId:O,subviewTitle:M}=e;const N=ye(null),T=ye(null),[F,A]=ve(!1),[L,E]=ve(null),[j,D]=ve(null),[_,P]=ve(Pd().matches?"dark":"light"),H=ye(u()),R=ye(!1),$=null===(r=N.current)||void 0===r?void 0:r.base.querySelector(`#expand-text-${H.current}`),V=null===(i=N.current)||void 0===i?void 0:i.base.querySelector(`#collapse-text-${H.current}`),W=Xl(jh(x(f))),B=Ce(Gi).analyticsDispatcher,z=gn(k);let U;qh(p.getCSSFontProperties(`body${z}`))||(U=p.getCSSFontProperties(`body${z}`));const q=p.getNumericFontSize(`body${z}`),Y=Object.assign(Object.assign(Object.assign({},O&&{subviewId:O}),M&&{subviewTitle:M}),O&&{subviewLevel:1}),K=null===(o=U)||void 0===o?void 0:o.textAlign,Z="center"===K||"right"===K,Q=null===(a=_d(W).firstElementChild)||void 0===a?void 0:a.tagName.toLowerCase(),G=!(!m&&!g)&&(!Z||("ul"===Q||"ol"===Q)),X=p.getCSSColor(`icon.body${z}`,{skipFallback:!0}),J=p.getCSSColor(`icon.body${z}`),ee=fn(k);let te;te=G&&v?`${ee} text block. With an icon, ${v}.`:G?`${ee} text block. With an icon.`:`${ee} text block.`;const ne=()=>{if(!(N.current&&T.current&&S&&b))return E(null),A(!1),D(!1);const e=T.current.base;e.innerHTML="";const t=getComputedStyle(N.current.base),n=parseFloat(t.lineHeight),r=parseFloat(t.fontSize),i=Math.ceil((isNaN(n)?r:n)*S),o=document.createElement("div");o.innerHTML=W;const a=Array.from(o.children);let s=!1;for(let t=0;t<a.length;t++){e.appendChild(a[t]);const n=Math.ceil(e.getBoundingClientRect().height);if(n<i)continue;const r=t<a.length-1;if(n===i&&r){s=Vd(a[t],e,i,H.current,p,y,k);break}if(n>i){s=Vd(a[t],e,i,H.current,p,y,k),!s&&t>0&&(a[t].remove(),s=Vd(a[t-1],e,i,H.current,p,y,k));break}}s?(E(e.innerHTML),D(!0)):D(!1)};be((()=>{let e;if(b){const t=()=>{ne()};document.fonts.onloadingdone=t,"ResizeObserver"in window&&(e=new ResizeObserver(ne),e.observe(document.body))}const t=e=>{P(e.matches?"dark":"light")};return Pd().addEventListener("change",t),()=>{var n;null===(n=e)||void 0===n||n.disconnect(),document.fonts.onloadingdone=null,Pd().removeEventListener("change",t)}}),[W]),be(ne,[W,S,b,_,y,w,k]),be((()=>{var e;R.current&&(null===(e=N.current)||void 0===e?void 0:e.base)&&(N.current.base.focus(),R.current=!1)}),[F]),be((()=>{const e=()=>{R.current=!0,A(!0)},t=()=>{R.current=!0,A(!1)},n=N.current.base;if(!n)return;const r=n.querySelector(`#expand-text-${H.current}`),i=n.querySelector(`#collapse-text-${H.current}`);return r&&r.addEventListener("click",e),i&&i.addEventListener("click",t),()=>{r&&r.removeEventListener("click",e),i&&i.removeEventListener("click",t)}}),[$,V,L,F,j]),be((()=>{const e=document.querySelector(`#markdown-${H.current}`);if(e){Array.from(e.querySelectorAll(".md-subview-link")).forEach((e=>{e.addEventListener("click",(()=>{var t;A(!1),D(!1),E(null),je().handleSubviewLinkPress(I,null==e||null===(t=e.dataset)||void 0===t?void 0:t.subviewId)})),e.addEventListener("keydown",(t=>{var n;ri(t.key)===ei&&(A(!1),D(!1),E(null),je().handleSubviewLinkPress(I,null==e||null===(n=e.dataset)||void 0===n?void 0:n.subviewId))}))}));Array.from(e.querySelectorAll(".md-web-link")).forEach((e=>{e.addEventListener("click",(e=>{var t;const n=null===(t=e.target.attributes.getNamedItem("href"))||void 0===t?void 0:t.value;B.sendEvent({cardInstanceId:I,cardViewState:C?"subview":"topview",eventName:ut,properties:Object.assign({linkMethod:"url",url:null!=n?n:"",detail:"textLink"},Y)})}))}))}}),[W,j,F]);const re=e=>{const t=_d(e),n=t.querySelector("p, li");if(n){const e=document.createElement("span");e.setAttribute("data-sr-prefix","true"),e.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;",e.textContent=te.trimEnd()+" ",n.insertBefore(e,n.firstChild)}return t.innerHTML};return(0,le.h)(le.Fragment,null,(0,le.h)(Dd,{key:d,appearance:k,isFirstCardNode:c,isFinalCardNode:h,theme:p,bodyFontProperties:U,"data-element-key":d,"data-testid":"text-block"},G&&(0,le.h)(Nn,{iconName:m,iconUrl:g,size:null!=q?q:20,color:null!==X?X:void 0,fallbackColor:J,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(t=null===(s=U)||void 0===s?void 0:s.lineHeight)&&void 0!==t?t:"initial",marginRight:"10px",width:`${q}px`,minWidth:`${q}px`,textAlign:"center"}}),(0,le.h)(Ld,{id:`markdown-${H.current}`,"data-testid":"text-markdown",theme:p,appearance:k,ref:N,tabIndex:j?-1:void 0,dangerouslySetInnerHTML:{__html:W&&0!==W.length&&null!==j?re(F||!L?function(e,t,n,r){if(!t||!n||!r)return e;const i=n.cloneNode(!0);i.innerHTML=e;const o=document.createTreeWalker(i,NodeFilter.SHOW_TEXT),a=[];let s=null;for(;s=o.nextNode();){var l;s&&(null===(l=s.textContent)||void 0===l?void 0:l.trim())&&a.push(s)}if(a.length>0){const e=a[a.length-1],t=e.parentElement;"a"===(null==t?void 0:t.tagName.toLowerCase())&&t.parentElement?(r.style.paddingLeft="5px",t.parentElement.insertBefore(r,t.nextSibling)):(e.textContent=e.textContent+" ",null==t||t.appendChild(r))}return i.innerHTML}(W,j,null===(ie=T.current)||void 0===ie?void 0:ie.base,Rd(null!=w?w:"Show less",p,"collapse",`collapse-text-${H.current}`,(null===(oe=N.current)||void 0===oe?void 0:oe.base.getBoundingClientRect().width)+"px",k)):L):"<p></p>"}})),(0,le.h)(Ed,{bodyFontProperties:U,isWorkflow:C,"aria-hidden":"true"},G&&(0,le.h)(Nn,{iconName:m,iconUrl:g,size:null!=q?q:20,color:null!==X?X:void 0,fallbackColor:J,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(n=null===(l=U)||void 0===l?void 0:l.lineHeight)&&void 0!==n?n:"initial",marginRight:"10px",width:`${q}px`,minWidth:`${q}px`,textAlign:"center"}}),(0,le.h)(jd,{theme:p,appearance:k,ref:T})));var ie,oe},list:e=>{let t,{nodeKey:n,isFirstCardNode:r,isFinalCardNode:i,attributes:{type:o,appearance:a},children:s,theme:l}=e;switch(o){case"bullet":t=ql;break;case"number":t=Yl;break;case"comma":t=Kl}return t?(0,le.h)(t,{key:n,"data-element-key":n,theme:l,appearance:a,isFirstCardNode:r,isFinalCardNode:i,"aria-label":`${fn(a)} list`},s):null},listItem:e=>{let{nodeKey:t,attributes:{text:n,icon:r},theme:i,isWorkflow:o,variableResolver:a,cardInstanceId:s,subviewId:l,subviewTitle:d}=e;const c=ye(u()),h=Ce(Gi).analyticsDispatcher,p=Xl(jh(a(n))),m=Object.assign(Object.assign(Object.assign({},l&&{subviewId:l}),d&&{subviewTitle:a(d)}),l&&{subviewLevel:1});let g;be((()=>{const e=document.querySelector(`#markdown-${c.current}`);if(e){Array.from(e.querySelectorAll(".md-subview-link")).forEach((e=>{const t=()=>{var t,n;je().handleSubviewLinkPress(s,null==e||null===(t=e.dataset)||void 0===t?void 0:t.subviewId),l&&(null==e||null===(n=e.dataset)||void 0===n?void 0:n.subviewId)!==l&&h.sendEvent({cardInstanceId:s,cardViewState:"subview",eventName:St,properties:m})};e.addEventListener("click",t),e.addEventListener("keydown",(e=>{ri(e.key)===ei&&t()}))}));Array.from(e.querySelectorAll(".md-web-link")).forEach((e=>{e.addEventListener("click",(e=>{var t;const n=null===(t=e.target.attributes.getNamedItem("href"))||void 0===t?void 0:t.value;h.sendEvent({cardInstanceId:s,cardViewState:o?"subview":"topview",eventName:ut,properties:Object.assign({linkMethod:"url",url:null!=n?n:"",detail:"textLink"},m)})}))}))}}),[p]),qh(g)||(g=i.getCSSFontProperties("bullet"));const v=i.getCSSColor("icon.bullet",{skipFallback:!0}),f=i.getCSSColor("icon.bullet");return(0,le.h)(ed,{key:t,"data-element-key":t,class:r?"with-icon":"without-icon"},r&&(0,le.h)(Nn,{iconName:r,size:g?g.fontSize:20,color:null!==v?v:void 0,fallbackColor:f,styles:{lineHeight:g?g.lineHeight:"initial",marginRight:"10px",width:"22px",minWidth:"22px",textAlign:"center"}}),(0,le.h)(td,{id:`markdown-${c.current}`,theme:i,"data-testid":"list-item-text",dangerouslySetInnerHTML:{__html:p}}))},image:e=>{let n,{nodeKey:r,cardInstanceId:i,subviewId:o,subviewTitle:a,theme:s,isFirstCardNode:l,isFinalCardNode:d,attributes:{format:c,thumbnailSrc:u,description:h,label:p,src:m,dimensions:g,altText:f,behaviour:b,url:S,target:y,layoutId:w,payload:k},variableResolver:C}=e;const x=Ce(Gi),I=x.containersBroadcastChannel;switch(c){case"inline":n=md;break;case"banner":n=ud;break;case"thumbnail":n=dd;break;case"text":n=fd}const O=m&&m.length>0?"image":"imageWithoutSrc";return n?(0,le.h)(Te.lj,{actions:(0,t.Y2)(Fe,tt),mapToProps:e=>({customStrings:e.application.customStrings})},(e=>{const t=ke((()=>{switch(b){case"url":return S?e=>{e.preventDefault();const t={url:C(S),target:e.ctrlKey||e.metaKey?"_blank":null!=y?y:"_blank"};if(x.analyticsDispatcher.sendEvent({cardInstanceId:i,cardViewState:o?"subview":"topview",eventName:ut,properties:Object.assign({linkMethod:"url",url:t.url,trigger:"image"},o?{subviewId:o,subviewTitle:a,subviewLevel:1}:{})}),"_top"===t.target&&I){const e=`${r}-image-link`;return I.addEventListener("message",(n=>{if(n.data.type===Us.ANALYTICS_EVENT){var r;const o=null===(r=n.data)||void 0===r?void 0:r.eventQueued;o.eventName===ut&&o.cardInstanceId===i&&I&&t&&(I.removeEventListener(e),window.open(t.url,t.target))}}),e)}return window.open(t.url,t.target)}:()=>{v.error({level2:[`url type image link for card: ${i} has no url`]})};case"subview":return w?()=>{e.handleImageLinkPress(i,{layoutId:w,currentSubviewId:o,currentSubviewTitle:a})}:()=>{v.error({level2:[`subview type image link for card: ${i} has no subview id`]})};case"payload":return k?()=>{e.handleImageLinkPress(i,{payload:k,currentSubviewId:o,currentSubviewTitle:a})}:()=>{v.error({level2:[`payload type image link for card: ${i} has no payload`]})};case"none":return;default:return()=>{e.viewMedia(i,Object.assign({type:O,url:C(m),title:C(p)},(null==f?void 0:f.src)?{alt:C(f.src)}:{}))}}}),[b,i,I]);return(0,le.h)(n,{nodeKey:r,mediaType:O,theme:s,isFirstCardNode:l,isFinalCardNode:d,customStrings:e.customStrings,src:C(u),dimensions:g,url:S,label:C(p),description:C(h),alt:C(null==f?void 0:f.thumbnailSrc),onClickImage:t})})):null},video:e=>{let{nodeKey:t,cardInstanceId:n,attributes:r,theme:i,isFirstCardNode:o,isFinalCardNode:a,isWorkflow:s,variableResolver:l}=e;const[d,c]=ve(!1),[u,h]=ve(void 0);return d?(0,le.h)(Td,{nodeKey:t,cardInstanceId:n,isWorkflow:s,format:r.format,src:l(r.src),thumbnailSrc:l(r.thumbnailSrc),dimensions:r.dimensions,loadedDimensions:u,theme:i,isFirstCardNode:o,isFinalCardNode:a,label:l(r.label),description:l(r.description)}):(0,le.h)(Nd,{nodeKey:t,cardInstanceId:n,isWorkflow:s,format:r.format,src:l(r.src),thumbnailSrc:l(r.thumbnailSrc),dimensions:r.dimensions,onLoad:h,theme:i,isFirstCardNode:o,isFinalCardNode:a,label:l(r.label),description:l(r.description),altText:{src:l(null===(p=r.altText)||void 0===p?void 0:p.src),thumbnailSrc:l(null===(m=r.altText)||void 0===m?void 0:m.thumbnailSrc)},setPlaying:c});var p,m},form:e=>{let{cardInstanceId:t,subviewId:n,attributes:{defaultValues:r},theme:i,isWorkflow:o,feedOrientation:a,children:s}=e;return(0,le.h)(Te.lj,{actions:tt,mapToProps:()=>{}},(e=>(0,le.h)(Rl,{theme:i,isWorkflow:o,feedOrientation:a,initializeFormStore:$l(e,t,r,n)},s)))},textInput:Os,numberInput:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{format:i,defaultValue:o,thumbnailSrc:a,thumbnailAltText:s,placeholder:l,name:d,label:c},theme:u,isFinalCardNode:h,validations:p,variableResolver:m}=e;const g=ye(null),v=ye(o&&Nh(o.toString())?o.toString():""),f=`number-input-${n}-${d}`,[b,S]=ve(v.current);be((()=>{const e=lt(n,d,r);if(e)v.current=e.toString(),S(e.toString());else{const e=Nh(b);st().handleFormChange(n,d,null!=e?e:void 0,r)}}),[]),be((()=>{const e=o&&Nh(o.toString())?o.toString():"";if(e!==v.current){if(b===v.current){const t=Nh(e);st().handleFormChange(n,d,null!=t?t:void 0,r),S(e)}v.current=e}}),[o]);const y=m(l);return(0,le.h)(Te.lj,{actions:tt,mapToProps:()=>{}},(e=>(0,le.h)(le.Fragment,null,(0,le.h)(Ia,{nodeKey:t,mode:i,label:m(c),labelFor:f,theme:u,isFinalCardNode:h,clickableLabel:!1,onClick:()=>{var e,t;null===(e=g.current)||void 0===e||null===(t=e.base)||void 0===t||t.focus()}},a&&(0,le.h)(Ma,{thumbnailUrl:m(a),altText:null!=s?s:"",theme:u}),(0,le.h)(Gu,{mode:i},c&&i===va&&(0,le.h)(wa,{theme:u,mode:i,name:f},m(c)),(0,le.h)(ks,{theme:u,mode:i,id:f,ref:g,placeholder:y,value:b,title:y,className:"input-number",inputmode:"decimal",onInput:t=>{const{value:i}=t.target,o=b;let a;S(i),a=Fh(i)?i.trim():o,S(a);const s=Nh(a);((e,t)=>{null!==Qu&&(clearTimeout(Qu),Qu=null),Qu=setTimeout((()=>{t(n,d,null!=e?e:void 0,p,r)}),200)})(s,e.validateField),e.handleFormChange(n,d,null!=s?s:void 0,r)}}))),(0,le.h)(Fa,{name:d,cardInstanceId:n,subviewId:r,theme:u,isFinalCardNode:h,variableResolver:m}))))},stepper:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{format:i,defaultValue:o,minimumValue:a,maximumValue:s,stepValue:l,thumbnailSrc:d,thumbnailAltText:c,label:u,name:h},validations:p,theme:m,isFinalCardNode:g,variableResolver:v}=e;const f=a||0,b=s||100,S=l&&l>0?l:1,y=ye(o&&o>=f&&o<=b?o:f),[w,k]=ve(y.current),[C,x]=ve(y.current),[I,O]=ve(!0),M=m.getCSSColor("icon.stepper"),N=m.getCSSColor("icon.stepperDisabled"),T=null==w||!Kd(w,b,S)||!I,F=null==w||!Yd(w,f,S)||!I;be((()=>{const e=lt(n,h,r);e?(y.current=e,k(e),x(e)):st().handleFormChange(n,h,w,r)}),[]),be((()=>{const e=o&&o>=f&&o<=b?o:f;e!==y.current&&(C===y.current&&(st().handleFormChange(n,h,e,r),k(e),x(e)),y.current=e)}),[o]);const A=v(u),L=(e,t)=>{null!==Zd&&(clearTimeout(Zd),Zd=null),Zd=setTimeout((()=>{t(n,h,null!=e?e:void 0,p,r)}),400)},E=`stepper-input-${n}-${h}`;return(0,le.h)(Te.lj,{actions:tt,mapToProps:e=>{let{}=e}},(e=>(0,le.h)(le.Fragment,null,(0,le.h)(Ia,{nodeKey:t,mode:null!=i?i:ga,theme:m,isFinalCardNode:g,cursor:"default"},d&&(0,le.h)(Ma,{thumbnailUrl:v(d),altText:null!=c?c:"",theme:m}),(0,le.h)(wa,{theme:m,mode:null!=i?i:ga,name:E},A),(0,le.h)(zd,{theme:m},(0,le.h)(Ud,{theme:m,disabled:F,tabIndex:"0","aria-label":`Decrease value by ${S}`,class:"stepper-decrement",onClick:()=>{if(null==w||!Yd(w,f,S)||!I)return;const t=((e,t,n)=>e-t<n?n:e-t)(w,S,f);x(t),k(t),e.handleFormChange(n,h,t,r),L(t,e.validateField)}},(0,le.h)(Bd,{fillColor:F?N:M})),(0,le.h)(qd,{type:"number",theme:m,tabIndex:"0",title:A,className:"stepper-value",onInput:t=>{const{value:i}=t.target,o=C;let a;x(i),a=Fh(i)?i.trim():o,O(((e,t,n)=>e>=t&&e<=n)(a,f,b)),x(a);const s=Nh(a);k(s),e.handleFormChange(n,h,null!=s?s:void 0,r),L(s,e.validateField)},onBlur:()=>{e.validateField(n,h,w,p,r)},value:C}),(0,le.h)(Ud,{theme:m,disabled:T,tabIndex:"0","aria-label":`Increase value by ${S}`,class:"stepper-increment",onClick:()=>{if(null==w||!Kd(w,b,S)||!I)return;const t=((e,t,n)=>e+t>n?n:e+t)(w,S,b);x(t),k(t),e.handleFormChange(n,h,t,r),L(t,e.validateField)}},(0,le.h)(Wd,{fillColor:T?N:M})))),(0,le.h)(Fa,{name:h,cardInstanceId:n,subviewId:r,theme:m,isFinalCardNode:g,variableResolver:v}))))},checkbox:e=>{let{nodeKey:t,children:n,cardInstanceId:r,subviewId:i,attributes:{name:o},theme:a,isFirstCardNode:s,isFinalCardNode:l,variableResolver:d}=e;return(0,le.h)(le.Fragment,null,(0,le.h)(vh,{theme:a,isFirstCardNode:s,isFinalCardNode:l,key:t,"data-element-key":t,role:"group"},(0,le.h)(fh,{"aria-label":"checkbox group"},n)),(0,le.h)(Fa,{name:o,cardInstanceId:r,subviewId:i,theme:a,isFinalCardNode:l,variableResolver:d}))},checkboxItem:e=>{var t,n;let{nodeKey:r,cardInstanceId:i,subviewId:o,attributes:{label:a,key:s,checked:l},theme:d,variableResolver:c,parentFieldName:u,parentValidations:h}=e;const p=ye(l),m=ye(`${i}-${s}`),[g,v]=ve(null!==(t=p.current)&&void 0!==t&&t),f=null!==(n=d.getCSSColor("icon.checkedCheckbox",{skipFallback:!0}))&&void 0!==n?n:"#FFF";let b;qh(b)||(b=d.getCSSFontProperties("labelInline",{skipFallback:!0})||d.getCSSFontProperties("primary"),parseInt(b.lineHeight)<20&&(b.lineHeight="20px"));const S=e=>{const t=lt(i,u,o)||{};return st().handleFormChange(i,u,Object.assign(Object.assign({},t),{[s]:e}),o),Object.assign(Object.assign({},t),{[s]:e})};return be((()=>{const e=lt(i,u,o);void 0!==e&&void 0!==e[s]?(p.current=e[s],v(e[s])):S(g)}),[]),be((()=>{void 0!==l&&l!==p.current&&(g===p.current&&(v(l),S(l)),p.current=l)}),[l]),(0,le.h)("li",null,(0,le.h)(bh,{key:r,"data-element-key":r,labelFontProperties:b,role:"checkbox","aria-labelledby":m.current,"aria-checked":g},(0,le.h)(Sh,{type:"checkbox",checked:g,theme:d,onChange:()=>{v(!g);const e=S(!g);st().validateField(i,u,e,h,o)},"aria-hidden":"true"}),(0,le.h)(yh,{theme:d,isChecked:g},g&&(0,le.h)(Aa,{fillColor:f,style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},ariaHidden:!0})),(0,le.h)(wh,{theme:d,id:m.current,"data-testid":"checkbox-label",labelFontProperties:b,"aria-hidden":"true"},c(a))))},switch:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{format:i,defaultValue:o,thumbnailSrc:a,thumbnailAltText:s,label:l,name:d},theme:c,isFinalCardNode:u,variableResolver:h}=e;const p=ye(o),[m,g]=ve(p.current);be((()=>{const e=lt(n,d,r);void 0!==e?(p.current=e,g(e)):st().handleFormChange(n,d,m,r)}),[]),be((()=>{o!==p.current&&(m===p.current&&(st().handleFormChange(n,d,o,r),g(o)),p.current=o)}),[o]);const v=`switch-input-${n}-${d}`;return(0,le.h)(Te.lj,{actions:tt,mapToProps:()=>{}},(e=>(0,le.h)(Ia,{nodeKey:t,mode:null!=i?i:ga,theme:c,isFinalCardNode:u},a&&(0,le.h)(Ma,{thumbnailUrl:h(a),altText:null!=s?s:"",theme:c}),(0,le.h)(wa,{theme:c,mode:null!=i?i:ga,name:v,truncateLabel:!i||i===ga},h(l)),(0,le.h)(Qd,{on:m,theme:c,tabIndex:"0",role:"switch","aria-checked":m,"aria-labelledby":v,className:"switch-toggle",onClick:()=>{g(!m),e.handleFormChange(n,d,!m,r)}},(0,le.h)(Gd,{on:m,theme:c})))))},dropdown:Va,datePicker:Ua,upload:hh},xh=["linkButton","submitButton","dismissButton","snoozeButton","voteUpButton","voteDownButton"],Ih=e=>{let{node:t,cardContext:n,cardInstanceId:r,cardMetadata:i,isWorkflow:o,theme:a,runtimeVariables:s,feedOrientation:l,subviewId:d,subviewTitle:c,embedMode:u,parentNodeType:h,parentFieldName:p,parentValidations:m,index:g,localIndex:v}=e;const f=Ch[t.type];if(f){let e=0===g,b=g===n.nodeCount-(1+(n.hasButtonFinalNode?1:0));return o&&(e="form"===h&&0===v,b="form"===h&&v===n.nodeCount-(1+(n.hasButtonFinalNode?1:0))),(0,le.h)(f,kh({},t.key&&{nodeKey:t.key},{isFirstCardNode:e,isFinalCardNode:b,cardInstanceId:r,cardMetadata:i,subviewId:d,subviewTitle:c,attributes:t.attributes,validations:t.validations,isWorkflow:o,theme:a,variableResolver:e=>_h(e,s),feedOrientation:l,embedMode:u,parentNodeType:h,parentFieldName:p,parentValidations:m,index:g,localIndex:null!=v?v:g}),t.children&&t.children.map(((e,l)=>{var h;return(0,le.h)(Ih,{cardInstanceId:r,cardMetadata:i,subviewId:d,subviewTitle:c,node:e,index:g,localIndex:l,isWorkflow:o,cardContext:n,theme:a,runtimeVariables:s,embedMode:u,parentNodeType:t.type,parentFieldName:null===(h=t.attributes)||void 0===h?void 0:h.name,parentValidations:t.validations})})))}return null},Oh={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Mh=/[&<>"'\/]/g,Nh=e=>{if(""===e)return null;const t=Number(e);return Number.isNaN(t)?null:t},Th=e=>{let t;return"string"!=typeof e&&"number"!=typeof e||("string"==typeof e&&(t=null!==Nh(e)?Nh(e):void 0),"number"==typeof e&&(t=e),void 0!==t&&(t=t>=0?Math.round(t):void 0)),t},Fh=e=>null!==Nh(e)||""===e||"-"===e,Ah=e=>{let t=Array();for(var n in e){const r=e[n];t.push(r),r.children&&(t=t.concat(Ah(r.children)))}return t},Lh=e=>{const t=[],n=(e,r)=>{const i=[];for(let r=0;r<e.length;r++){var o;const a=e[r];"actionButtonGroup"!==a.type&&a.children&&(null===(o=a.children)||void 0===o?void 0:o.length)>0&&(a.children=n(a.children,a)),xh.includes(a.type)?t.push(a):i.push(a)}if("form"===(null==r?void 0:r.type)){var a;let e=!1;null===(a=r.children)||void 0===a||a.forEach((t=>{"actionButtonGroup"===t.type&&(e=!0)})),!e&&i.push({type:"actionButtonGroup",attributes:{},children:t})}return i};return n(e)},Eh=(e,t)=>{const n=e=>{for(let r in e){const i=e[r];"string"==typeof i&&(e[r]=_h(i,t)),"object"==typeof i&&n(i)}},r=e=>{const t=[];for(let o=0;o<e.length;o++){var i;const a=e[o];a.children&&(null===(i=a.children)||void 0===i?void 0:i.length)>0&&(a.children=r(a.children)),a.attributes&&n(a.attributes),t.push(a)}return t};e.defaultView.nodes=r(e.defaultView.nodes);for(let n in e.subviews){const i=e.subviews[n];e.subviews[n].nodes=r(i.nodes),i.title&&(e.subviews[n].title=_h(i.title,t))}},jh=e=>e?e.replace(Mh,(e=>Oh[e]||e)):"",Dh=/!\{([\w\.]+?)\}/g,_h=(e,t)=>e&&t&&"string"==typeof e?e.replace(Dh,((e,n)=>t.get(n)||"")):e||"",Ph={years:p.addYears,months:p.addMonths,weeks:p.addWeeks,days:p.addDays,hours:p.addHours,minutes:p.addMinutes,seconds:p.addSeconds},Hh=e=>{if("string"!=typeof e)return null;const t=e.match(I);if(t){const[,,e,n,r,i,o,a,s]=t.map((e=>void 0!==e?Number(e):void 0));return{years:e,months:n,weeks:r,days:i,hours:o,minutes:a,seconds:s}}return null},Rh=(e,t)=>{const n=Hh(e);return n?Object.entries(Ph).reduce(((e,t)=>{let[r,i]=t;const o=n[r];return o?i(e,o):e}),t):t},$h=e=>{if("string"!=typeof e)return!1;const t=new Date(e);if(t instanceof Date)try{return t.toISOString()===e}catch(e){return!1}return!1},Vh=e=>{if(!Wh(e))throw new Error("JWT supplied has an incorrect format");try{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=atob(t);return JSON.parse(n)}catch(e){throw new Error("JWT payload could not be parsed")}},Wh=e=>!!e.match(/^[\w-]+\.[\w-]+\.[\w-]*$/),Bh=e=>{const t=k().getState().application.embedMode;return(null==e?void 0:e.enabled)&&"standalone"===t?"horizontal":"vertical"},zh=()=>{const e=sessionStorage.getItem(_),t=e?JSON.parse(e):void 0;return new Set(t)},Uh=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),qh=e=>e&&Uh(e)&&0===Object.keys(e).length,Yh=(e,t)=>e.length===t.length&&(e.sort(),t.sort(),e.every(((e,n)=>e===t[n]))),Kh=e=>{let{elementName:t,label:n,iconAltText:r,hasIcon:i}=e;const o=e=>e.charAt(0).toUpperCase()+e.slice(1),a=(Array.isArray(n)?n:[n]).filter(Boolean).join(", ");return o(a&&!i||i&&a&&!r?a:i&&a&&r?`${t} with an icon, ${r}, ${a}`:i&&!a&&r?`${t} with an icon, ${r}`:!i||a||r?`${t}.`:`${t} with an icon.`)};var Zh=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};function Qh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Gh=(e,t)=>{if(!e)return null;let n;try{n=Vh(e)}catch(e){return null}if(t)return n[t]&&["number","string"].includes(typeof n[t])?String(n[t]):null;const r=["atomic_sub","atomic_id","sub","id"];for(const e of r)if(n[e]&&["number","string"].includes(typeof n[e]))return String(n[e]);return null},Xh="AtomicAnalyticsQueue";var Jh=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};function ep(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tp={noInternet:"AACNoInternetError",missingApiHost:"AACMissingApiHostError",apiError:"AACApiError",invalidParameters:"AACInvalidParametersError",notPermitted:"AACOperationNotPermittedError",authTokenError:"AACAuthTokenError"},np="Device is not connected to the internet",rp="API host was not specified for the request.",ip="An API error occurred.",op="Failed to retrieve an authentication token for request.",ap={method:"GET",mode:"cors"},sp=e=>Jh(void 0,void 0,void 0,(function*(){const t=yield e.text();try{return{text:t,json:JSON.parse(t)}}catch(e){}return{text:t}})),lp=e=>e<400,dp=(e,t,n,r,i)=>{var o,a;const s=null!==(o=Gh(n,i))&&void 0!==o?o:void 0;h("request-failed",{request:{path:e,statusCode:t,streamContainerId:"string"==typeof(null==r?void 0:r.streamContainerId)?null==r?void 0:r.streamContainerId:void 0,streamContainerIds:null==r||null===(a=r.streamContainerIds)||void 0===a?void 0:a.filter((e=>"string"==typeof e)),cardInstanceId:"string"==typeof(null==r?void 0:r.cardInstanceId)?null==r?void 0:r.cardInstanceId:void 0,endUserId:s}})};class cp{static initialise(e,t,n){this.apiHost=e,this.apiKey=t,this.environmentId=n,this.instanceId=u()}static reset(){this.apiHost="https://client-api.atomic.io",this.apiKey=void 0,this.environmentId=void 0}static setTestHostHeader(e){this.testHost=e}static setTokenUserIdAttribute(e){this.tokenUserIdAttribute=e}static setClientAppVersion(e){this.clientAppVersion=e}static verifyInitialised(){if(!this.isInitialised())throw new Error("The Atomic SDK has not been initialised with an API host, API key and environment ID. Call `AtomicSDK.initialise(apiHost, apiKey, environmentId)` before attempting to use the SDK.")}static isInitialised(){return void 0!==this.apiKey&&void 0!==this.environmentId}static get(e,t,n,r){return Jh(this,void 0,void 0,(function*(){let i,o;if(this.verifyInitialised(),!navigator.onLine){const e=new Error(np);return e.name=tp.noInternet,{response:{error:e}}}{const a=pp(this.apiHost,e,this.environmentId);if(!a){const e=new Error(rp);return e.name=tp.missingApiHost,{response:{error:e}}}let s;if(t)try{s=yield t.requestToken()}catch(e){const t=new Error(`${op} ${e}`);return t.name=tp.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},ap),{headers:up({instanceId:this.instanceId,apiKey:this.apiKey,authToken:s,lastModified:n,testHost:this.testHost,clientAppVersion:this.clientAppVersion})});try{const t=yield fetch(a,l);o=t.status;const n=yield sp(t);if(n.json&&(i=n.json),!lp(t.status))throw dp(e,o,s,r,this.tokenUserIdAttribute),new Error(`GET request failed with status code ${t.status}.`);return{data:i,response:{status:t.status,etag:t.headers.get("etag")}}}catch(e){const t=new Error(`${ip} ${e}`);return t.name=tp.apiError,{data:i,response:{status:o,error:t}}}}}))}static post(e,t,n,r){return Jh(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(np);return e.name=tp.noInternet,{response:{error:e}}}{let i,o;const a=pp(this.apiHost,e,this.environmentId);if(!a){const e=new Error(rp);return e.name=tp.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${op} ${e}`);return t.name=tp.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},ap),{method:"POST",headers:up({instanceId:this.instanceId,apiKey:this.apiKey,authToken:s,testHost:this.testHost,clientAppVersion:this.clientAppVersion}),body:JSON.stringify(t)});try{const t=yield fetch(a,l);o=t.status;const n=yield sp(t);if(n.json&&(i=n.json),!lp(t.status))throw dp(e,o,s,r,this.tokenUserIdAttribute),new Error(`POST request failed with status code ${t.status}.`);return{data:i,response:{status:t.status}}}catch(e){const t=new Error(`${ip} ${e}`);return t.name=tp.apiError,{data:i,response:{status:o,error:t}}}}}))}static put(e,t,n,r){return Jh(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(np);return e.name=tp.noInternet,{response:{error:e}}}{let i,o;const a=pp(this.apiHost,e,this.environmentId);if(!a){const e=new Error(rp);return e.name=tp.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${op} ${e}`);return t.name=tp.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},ap),{method:"PUT",headers:up({instanceId:this.instanceId,apiKey:this.apiKey,authToken:s,testHost:this.testHost,clientAppVersion:this.clientAppVersion}),body:JSON.stringify(t)});try{const t=yield fetch(a,l);o=t.status;const n=yield sp(t);if(n.json&&(i=n.json),!lp(t.status))throw dp(e,o,s,r,this.tokenUserIdAttribute),new Error(`PUT request failed with status code ${t.status}.`);return{data:i,response:{status:t.status}}}catch(e){const t=new Error(`${ip} ${e}`);return t.name=tp.apiError,{data:i,response:{status:o,error:t}}}}}))}static delete(e,t,n,r){return Jh(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(np);return e.name=tp.noInternet,{response:{error:e}}}{let i,o;const a=pp(this.apiHost,e,this.environmentId);if(!a){const e=new Error(rp);return e.name=tp.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${op} ${e}`);return t.name=tp.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},ap),{method:"DELETE",headers:up({instanceId:this.instanceId,apiKey:this.apiKey,authToken:s,testHost:this.testHost,clientAppVersion:this.clientAppVersion}),body:JSON.stringify(t)});try{const t=yield fetch(a,l);o=t.status;const n=yield sp(t);if(n.json&&(i=n.json),!lp(t.status))throw dp(e,o,s,r,this.tokenUserIdAttribute),new Error(`DELETE request failed with status code ${t.status}.`);return{data:i,response:{status:t.status}}}catch(e){const t=new Error(`${ip} ${e}`);return t.name=tp.apiError,{data:i,response:{status:o,error:t}}}}}))}}ep(cp,"apiHost","https://client-api.atomic.io"),ep(cp,"apiKey",void 0),ep(cp,"environmentId",void 0),ep(cp,"instanceId",void 0),ep(cp,"testHost",void 0),ep(cp,"clientAppVersion","unknown"),ep(cp,"tokenUserIdAttribute",void 0);const up=e=>hp("header",Object.assign({},e)),hp=(e,t)=>{const n="header"===e;let r={"x-atomic-sdk-platform":"Web","x-atomic-sdk-version":"26.2.0","x-atomic-sdk-timezone":Intl.DateTimeFormat().resolvedOptions().timeZone,"x-atomic-sdk-device":navigator.userAgent};if(t.instanceId&&(r["x-atomic-sdk-instance-id"]=t.instanceId),n&&(r["Content-Type"]="application/json"),t.apiKey){r["ws"===t.scheme?"api-key":"x-atomic-sdk-api-key"]=t.apiKey}return t.authToken&&(n?r.Authorization=`Bearer ${t.authToken}`:r.Token=t.authToken),t.lastModified&&n&&(r["If-None-Match"]=t.lastModified),t.testHost&&(r["x-atomic-test-host"]=t.testHost),t.clientAppVersion&&(r["x-atomic-sdk-client-app-version"]=t.clientAppVersion),t.error&&(r.error=t.error),r},pp=(e,t,n)=>{if(!e||0==e.trim().length)return null;return`${e.endsWith("/")?e:`${e}/`}${n&&n.trim().length>0?`${n}/`:""}${t}`};function mp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gp=e=>{const t=new Error(e);return t.name="Stream filter error",v.error({level1:[t]}),t},vp=(e,t)=>{let n=!0;return!!e.length&&(e.reduce(((e,r)=>(t.includes(typeof r)||(n=!1),typeof e!=typeof r&&(n=!1),r))),n)};class fp{constructor(e,t){var n=this;mp(this,"filters",void 0),mp(this,"onApplyFilter",void 0),mp(this,"onClearFilter",void 0),mp(this,"addVariableFilter",(e=>this.genericFilter("variables",e,"addVariableFilter"))),mp(this,"addPayloadVariableFilter",(e=>this.genericFilter("eventPayload.detail",e,"addPayloadVariableFilter"))),mp(this,"addCardContentFilter",(e=>this.genericFilter("defaultView",e,"addCardContentFilter","card property"))),mp(this,"addSubviewContentFilter",(e=>this.genericFilter("subviews",e,"addSubviewContentFilter","subview property"))),mp(this,"addPayloadMetadataFilter",(e=>this.genericFilter("eventPayload.metadata",e,"addPayloadMetadataFilter","metadata"))),mp(this,"genericFilter",(function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"variable";if(!t)throw gp(`The name of the ${i} you are filtering by must be supplied to \`${r}\``);return bp(n.filters,e,t,(e=>{const t=Array.isArray(e);if(!t&&!["string","number","boolean","null"].includes(typeof e))throw gp(`Incorrect value provided for "${i}" filter. Must be a string, a number, a boolean or null.`);if(t&&!vp(e,["string","number"]))throw gp(`Incorrect value provided for "${i}" filter, for "in" or "notIn" must be either an array of numbers or an array of strings.`)}),["equals","greaterThan","greaterThanOrEqualTo","in","lessThan","lessThanOrEqualTo","notEqualTo","notIn","between","includes","excludes","isIncludedIn","isExcludedFrom"])})),mp(this,"addCardTemplateIdFilter",(()=>bp(this.filters,"metadata","cardTemplateId",(e=>{const t=Array.isArray(e);if(!t&&"string"!=typeof e)throw gp('Incorrect "card template id" filter value provided, must be a string.');if(t&&!vp(e,["string"]))throw gp('Incorrect "card template id" filter value provided, for "in" or "notIn" an array of strings must be supplied.')}),["equals","in","notEqualTo","notIn","includes","excludes","isIncludedIn","isExcludedFrom"]))),mp(this,"addCardTemplateNameFilter",(()=>bp(this.filters,"metadata","cardTemplateName",(e=>{const t=Array.isArray(e);if(!t&&"string"!=typeof e)throw gp('Incorrect "card template name" filter value provided, must be a string.');if(t&&!vp(e,["string"]))throw gp('Incorrect "card template name" filter value provided, for "in" or "notIn" an array of strings must be supplied.')}),["equals","in","notEqualTo","notIn","includes","excludes","isIncludedIn","isExcludedFrom"]))),mp(this,"addCardCreatedFilter",(()=>bp(this.filters,"metadata","created",(e=>{if("string"!=typeof e||!$h(e))throw gp('Incorrect "card created" filter value provided, must be a valid ISO date string')}),["equals","greaterThan","greaterThanOrEqualTo","lessThan","lessThanOrEqualTo","notEqualTo"]))),mp(this,"addCardPriorityFilter",(()=>bp(this.filters,"metadata","priority",(e=>{const t=typeof e,n=Array.isArray(e);if(n&&!vp(e,["number"]))throw gp('Incorrect "card priority" filter value provided. For "in" and "notIn" must be a number between 1 & 10 inclusive.');if(n){let t=!1;if(e.forEach((e=>{(e>10||e<1)&&(t=!0)})),t)throw gp('Incorrect "card priority" filter value provided. For "in" and "notIn" must be a number between 1 & 10 inclusive.')}else if(!n&&"number"!==t||isNaN(e)||e>10||e<1)throw gp('Incorrect "card priority" filter value provided, must be a number between 1 & 10 inclusive.')}),["equals","greaterThan","greaterThanOrEqualTo","in","lessThan","lessThanOrEqualTo","notEqualTo","notIn","between"]))),mp(this,"clearFilters",(()=>{this.filters={},this.onClearFilter()})),mp(this,"apply",(()=>{this.onApplyFilter()})),mp(this,"getFilterObject",(()=>this.filters)),this.filters={},this.onApplyFilter=e,this.onClearFilter=t}}const bp=(e,t,n,r,i)=>{const o=(i,o)=>a=>{r(a),((e,t,n)=>{const r=typeof t;switch(e){case"eq":case"ne":if(!["number","string","boolean","null"].includes(r))throw gp(`Operator "${n}" must be a number, string, boolean or null`);break;case"gt":case"gte":case"lt":case"lte":if(!["string","number"].includes(r))throw gp(`Operator "${n}" must be a number or ISO date string`);if("string"===r&&!$h(t))throw gp(`Operator "${n}" must be a number or ISO date string`);break;case"in":case"nin":if(!Array.isArray(t))throw gp(`Operator "${n}" must be either an array of numbers or an array of strings`);if(!vp(t,["string","number"]))throw gp(`Operator "${n}" must be either an array of numbers or an array of strings`);break;case"between":if(2!==t.length||!vp(t,["number"]))throw gp(`Operator "${n}" must be an array of 2 numbers: [minimumValue, maximumValue]`)}})(i,a,o),e[`${t}.${n}__${i}`]=a},a={equals:o("eq","equals"),greaterThan:o("gt","greaterThan"),greaterThanOrEqualTo:o("gte","greaterThanOrEqualTo"),in:o("in","in"),lessThan:o("lt","lessThan"),lessThanOrEqualTo:o("lte","lessThanOrEqualTo"),notEqualTo:o("ne","notEqualTo"),notIn:o("nin","notIn"),between:o("between","between"),includes:o("includes","includes"),excludes:o("excludes","excludes"),isIncludedIn:o("is_included_in","isIncludedIn"),isExcludedFrom:o("is_excluded_from","isExcludedFrom")};return Object.keys(a).forEach((e=>{i.includes(e)||delete a[e]})),a},Sp="custom-ping",yp="auth",wp="subscribe",kp="unsubscribe",Cp="events",xp="custom-pong",Ip="auth-success",Op="token-expiry",Mp="update-cards",Np="events-processed",Tp="error",Fp="invalid-token",Ap="expired-token",Lp="invalid-stream-container-id",Ep="invalid-filter",jp="invalid-message",Dp=()=>{const e=document.querySelector("script#atomic-frame-manager"),t=e?e.src:null;if(!t)return null;const n=new URL(t),r=n.protocol.toLowerCase();return("http:"===r||"https:"===r)&&"localhost"!==n.hostname?null:t};var _p=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};function Pp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Hp={name:"Invalid stream container id",message:"an invalid stream container id was provided with the subscription request"},Rp={name:"Invalid filter",message:"an invalid filter was provided with the subscription request"},$p={name:"Invalid token",message:'Atomic platform responded with an "invalid token" message'},Vp={name:"Expired token",message:'Atomic platform responded with an "expired token" message'};class Wp{static reset(){this.activeSubscriptions={},this.lastPongSuccess=void 0}static messageSubscribedContainer(e,t){if(void 0===Cm.streamContainers[e])return v.error({level3:["No stream container found for subscriptionId: ",e]});Cm.streamContainers[e].sendMessageToIframe(t)}static messageAllSubscribedContainers(e){Object.values(this.activeSubscriptions).forEach((t=>{this.messageSubscribedContainer(t.subscriptionId,e)}))}static handleWebSocketMessage(e){return _p(this,void 0,void 0,(function*(){switch(e.messageType){case xp:v.debug({level1:["pong received by WebSockets"],level2:[e]}),this.lastPongSuccess=(new Date).toISOString();break;case Ip:Zp.connectionAuthenticated||(Zp.connectionAuthenticated=!0,Cm.authMessageResolve()),v.debug({level1:["auth success received by WebSockets"],level2:[e]});break;case Op:v.debug({level1:["token expiry received by WebSockets"],level2:[e]}),Zp.connectionAuthenticated=!1;try{yield Cm.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){v.error({level1:["Token expired, new token request failed"],level2:[e]})}break;case Mp:{v.debug({level1:["update cards received by WebSockets"],level2:[e]});const t=e.data.updates,n={};null==t||t.forEach((e=>{const{subscriptionId:t}=e.data;n[t]||(n[t]=[]),n[t].push(e)}));Object.keys(n).forEach((e=>{this.messageSubscribedContainer(e,{action:F,values:{cardFeedUpdates:n[e]}})}));break}case Np:{var t;v.debug({level1:["analytics events processed received by WebSockets"],level2:[e]});const n=null===(t=e.data)||void 0===t?void 0:t.eventIds;n&&Array.isArray(n)&&Cm.analyticsQueue.removeProcessedEvents(n);break}case Tp:this.handleWebSocketErrorMessage(e);break;default:v.debug({level1:["unknown message received by WebSockets"],level2:[e]})}}))}static handleWebSocketErrorMessage(e){return _p(this,void 0,void 0,(function*(){var t;switch(e.data.errorType){case Fp:{const e=new Error($p.message);e.name=$p.name,v.error({level1:["Invalid token error received by WebSockets."],level2:[e]}),Zp.connectionAuthenticated||Cm.authMessageReject(e),Zp.connectionAuthenticated=!1;try{yield Cm.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){v.error({level1:["Token invalid, new token request failed"],level2:[e]}),this.messageAllSubscribedContainers({action:"io.atomic.events.invalidToken",values:e instanceof Error?e.message:String(e)})}break}case Ap:{const n=new Error(null!==(t=e.data.errorMessage)&&void 0!==t?t:Vp.message);n.name=Vp.name,v.error({level1:["Expired token error received by WebSockets"],level2:[n]}),Zp.connectionAuthenticated||Cm.authMessageReject(n),Zp.connectionAuthenticated=!1;try{yield Cm.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){v.error({level1:["Token expired, new token request failed"],level2:[e]}),this.messageAllSubscribedContainers({action:"io.atomic.events.expiredToken",values:e instanceof Error?e.message:String(e)})}break}case Lp:{var n;const t=e.data.subscriptionId,r=new Error(`${Hp.message} - ${null===(n=this.activeSubscriptions[t])||void 0===n?void 0:n.streamContainerId}`);r.name=Hp.name,v.error({level1:["Invalid stream container id error received by WebSockets"],level2:[r]}),this.messageSubscribedContainer(t,{action:"io.atomic.events.invalidStreamContainerId",values:r.message});break}case Ep:{const t=e.data.subscriptionId,n=new Error(Rp.message);n.name=Rp.name,n.message=Rp.message,v.error({level1:["Invalid filter error received by WebSockets"],level2:[n]}),this.messageSubscribedContainer(t,{action:"io.atomic.events.invalidFilter",values:n.message});break}case jp:v.error({level1:["Invalid message error received by WebSockets"],level2:[e]});break;default:v.debug({level1:["unknown error received by WebSockets"],level2:[e]})}}))}static subscribeToCardFeed(e){try{Zp.dispatchMessage({messageType:wp,data:{subscriptions:e}}),e.forEach((e=>this.activeSubscriptions[e.subscriptionId]=e))}catch(e){throw v.error({level1:["Error subscribing to card feed via WebSocket"],level2:[e]}),e}}static unsubscribeFromCardFeed(e){try{Zp.dispatchMessage({messageType:kp,data:{subscriptionIds:e}}),e.forEach((e=>delete this.activeSubscriptions[e]))}catch(e){v.error({level1:["Error unsubscribing from card feed via WebSocket"],level2:[e]})}}static resubscribeActiveSubscriptions(){const e=Object.values(this.activeSubscriptions);e.length&&(this.subscribeToCardFeed(e),e.forEach((e=>this.messageSubscribedContainer(e.subscriptionId,{action:L}))))}static unsubscribeActiveSubscriptions(){const e=Object.values(this.activeSubscriptions);e.length&&this.unsubscribeFromCardFeed(e.map((e=>e.subscriptionId)))}static sendAuthMessage(e){try{Zp.dispatchMessage({messageType:yp,authToken:e})}catch(e){v.error({level1:["Error sending auth message to WebSocket"],level2:[e]})}}static sendAnalyticsMessage(e,t){if(!Cm.webSocketDisabled&&Zp.isConnected())try{Zp.dispatchMessage({messageType:Cp,authToken:t,data:{events:e}})}catch(e){v.error({level1:["Error sending analytics message to WebSocket"],level2:[e]})}}}function Bp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let zp;Pp(Wp,"activeSubscriptions",{}),Pp(Wp,"lastPongSuccess",void 0),function(e){e[e.notPermitted=1013]="notPermitted",e[e.missingApi=1008]="missingApi",e[e.retryConnection=1011]="retryConnection",e[e.goingAway=1001]="goingAway",e[e.abnormalClosure=1006]="abnormalClosure",e[e.sdkClosedConnection=3e3]="sdkClosedConnection",e[e.sdkChangingProtocol=3001]="sdkChangingProtocol",e[e.sdkReinitialisedWebSocket=3002]="sdkReinitialisedWebSocket",e[e.sdkSessionEnding=3003]="sdkSessionEnding",e[e.sdkCordovaBackgrounded=3004]="sdkCordovaBackgrounded",e[e.sdkPersistedToBrowserCache=3005]="sdkPersistedToBrowserCache",e[e.unitTestConnectionClose=3006]="unitTestConnectionClose"}(zp||(zp={}));const Up={name:"Not initialised",message:"WebSocket client has not been initialised"},qp={name:"No connection",message:"WebSocket connection is not established"},Yp={name:"WebSocket not ready",message:"WebSocket connection is not ready to send message"},Kp={name:"Dispatch message error",message:"Unable to dispatch the client message on the WebSocket connection"};class Zp{static initialise(e,t,n){let r;try{r=new URL(e),r.protocol="https:"===r.protocol?"wss":"ws"}catch(e){throw v.error({level1:["error creating WebSocket URL from supplied API host"],level2:[e]}),e}this.apiHost===r.toString()&&this.apiKey===t&&this.environmentId===n||this.isConnected()&&this.close(zp.sdkReinitialisedWebSocket,"Connection closed by SDK, WebSocket has been reinitialised"),this.apiHost=r.toString(),this.apiKey=t,this.environmentId=n,window.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&(v.debug({level3:[`WebSocket client visibilitychange event triggered, page is ${document.visibilityState} checking connection health`]}),this.connectionHealthCheck())})),Dp()&&(document.addEventListener("pause",(()=>{v.debug({level3:["Cordova app pause event triggered"]}),this.close(zp.sdkCordovaBackgrounded,"Connection closed by SDK, clean up WebSocket connection as app has been backgrounded")}),!1),document.addEventListener("resume",(()=>{v.debug({level3:["Cordova app resume event triggered"]}),Cm.reinitialiseWebSocketConnection()}),!1))}static isInitialised(){return void 0!==this.apiKey&&void 0!==this.environmentId&&void 0!==this.apiHost}static reset(){this.apiHost=void 0,this.apiKey=void 0,this.environmentId=void 0,this.openingConnection=!1,this.connectionAuthenticated=!1,this.webSocketConnection=void 0,this.connectionTimeout=void 0,this.pingTimeout=void 0}static setTestHostParam(e){this.testHost=e}static setConnectionTimeout(){this.clearTimeouts(),this.connectionTimeout=setTimeout((()=>{try{this.dispatchMessage({messageType:Sp})}catch(e){v.error({level3:["Error sending custom ping message:",e]})}this.pingTimeout=setTimeout((()=>{v.debug({level3:["WebSocket client ping timeout reached, closing connection"]}),this.close(zp.sdkClosedConnection,"connection timed out")}),this.connectionTimer)}),this.connectionTimer)}static setClientAppVersion(e){this.clientAppVersion=e}static connectionHealthCheck(){Zp.isInitialised()&&Zp.isConnected()&&Wp.lastPongSuccess&&(0,p.differenceInMilliseconds)((new Date).toISOString(),Wp.lastPongSuccess)>this.staleConnectionTimer&&(v.debug({level3:["WebSocket connection has become stale, re-initialising"]}),Cm.reinitialiseWebSocketConnection())}static clearTimeouts(){this.connectionTimeout&&clearTimeout(this.connectionTimeout),this.pingTimeout&&clearTimeout(this.pingTimeout)}static isConnected(){return!this.openingConnection&&!!this.webSocketConnection&&this.webSocketConnection.readyState==this.webSocketConnection.OPEN}static close(e,t){var n;e===zp.sdkSessionEnding&&Wp.unsubscribeActiveSubscriptions(),null===(n=this.webSocketConnection)||void 0===n||n.close(e,t),this.connectionAuthenticated=!1,this.clearTimeouts()}static purgeMessageQueue(){this.messageQueue.length&&(this.messageQueue.forEach((e=>{let t;if(e.messageType===wp)t=e,t.data.subscriptions=t.data.subscriptions.filter((e=>Object.keys(Cm.streamContainers).includes(e.subscriptionId))),t.data.subscriptions.length||(t=null);else t=e;try{t&&this.dispatchMessage(t),v.debug({level3:["WebSocket client purging message queue, message sent by WebSockets: ",t]})}catch(e){v.error({level1:["purging message queue, error sending message"],level2:[e]})}})),this.messageQueue=[])}static dispatchMessage(e){var t;const n=u(),r=Object.assign(Object.assign({},e),{messageId:n}),i=JSON.stringify(r);try{const t=this.webSocketConnection;if(!t)throw new Error(qp.message);if(t.readyState===t.CLOSING||t.readyState===t.CLOSED)throw new Error(Yp.message);return t.readyState===t.CONNECTING?this.messageQueue.push(e):t.send(i)}catch(e){const n=new Error;throw n.name=Kp.name,n.message="object"==typeof e&&null!==e&&"message"in e&&null!==(t=e.message)&&void 0!==t?t:Kp.message,n}}static setEventListeners(e,t){e.onmessage=e=>{if(this.setConnectionTimeout(),e.data)try{const n=JSON.parse(e.data);t.onMessage(n)}catch(e){console.error(e)}},e.onopen=()=>{var e;this.setConnectionTimeout(),null===(e=t.onOpen)||void 0===e||e.call(t)},e.onclose=e=>{var n;null===(n=t.onClose)||void 0===n||n.call(t,e)},e.onerror=e=>{t.onError(e)}}static open(e,t,n){try{if(!this.isInitialised())throw new Error(Up.message);if(!navigator.onLine){const e=new Error(np);throw e.name=tp.noInternet,e}const r=pp(this.apiHost,e,this.environmentId);if(!r){const e=new Error(rp);throw e.name=tp.missingApiHost,e}if(this.webSocketConnection)switch(this.webSocketConnection.readyState){case this.webSocketConnection.OPEN:this.close(zp.sdkReinitialisedWebSocket,"Connection closed by SDK, request to open new connection received");break;case this.webSocketConnection.CLOSING:return setTimeout((()=>{this.open(e,t,n)}),500)}const i=((e,t)=>{let n=hp("query",Object.assign({},t));for(const t in n)e.searchParams.set(t.toLowerCase(),n[t]);return e})(new URL(r),Object.assign(Object.assign({apiKey:this.apiKey,scheme:"ws",clientAppVersion:this.clientAppVersion},this.testHost?{testHost:this.testHost}:{}),n?{error:n}:{}));this.openingConnection=!0,this.webSocketConnection=new WebSocket(i.toString()),this.setEventListeners(this.webSocketConnection,t),this.openingConnection=!1;const o=e=>{let t=zp.sdkSessionEnding;e.persisted&&(t=zp.sdkPersistedToBrowserCache),this.close(t,"Connection closed by SDK, clean up WebSocket connection as page has been closed"),Wp.lastPongSuccess=void 0,window.removeEventListener("pagehide",o)};return window.addEventListener("pagehide",o),this.webSocketConnection.readyState}catch(e){throw this.openingConnection=!1,e}}}Bp(Zp,"apiHost",void 0),Bp(Zp,"apiKey",void 0),Bp(Zp,"environmentId",void 0),Bp(Zp,"clientAppVersion","unknown"),Bp(Zp,"testHost",void 0),Bp(Zp,"openingConnection",!1),Bp(Zp,"authenticatingConnection",!1),Bp(Zp,"connectionAuthenticated",!1),Bp(Zp,"authenticationTimeout",7e3),Bp(Zp,"messageQueue",[]),Bp(Zp,"webSocketConnection",void 0),Bp(Zp,"connectionTimeout",void 0),Bp(Zp,"pingTimeout",void 0),Bp(Zp,"connectionTimer",3e4),Bp(Zp,"staleConnectionTimer",2*Zp.connectionTimer+5e3);const Qp={cardCompleted:"card-completed",cardDismissed:"card-dismissed",cardSnoozed:"card-snoozed",cardFeedUpdated:"card-feed-updated",cardDisplayed:"card-displayed",cardVotedUp:"card-voted-up",cardVotedDown:"card-voted-down",runtimeVarsUpdated:"runtime-vars-updated",streamDisplayed:"stream-displayed",userRedirected:"user-redirected",snoozeOptionsDisplayed:"snooze-options-displayed",snoozeOptionsCanceled:"snooze-options-canceled",cardSubviewDisplayed:"card-subview-displayed",cardSubviewExited:"card-subview-exited",videoPlayed:"video-played",videoCompleted:"video-completed",sdkInitialized:"sdk-initialized",requestFailed:"request-failed",notificationReceived:"notification-received",userFileUploadsStarted:"user-file-uploads-started",userFileUploadsCompleted:"user-file-uploads-completed",userFileUploadsFailed:"user-file-uploads-failed"},Gp=[Qp.cardFeedUpdated,Qp.cardCompleted,Qp.cardDismissed,Qp.cardSnoozed,Qp.streamDisplayed,Qp.sdkInitialized,Qp.cardDisplayed],Xp=e=>(!e.eventName&&e.analyticsEvent&&(e.eventName=e.analyticsEvent),e),Jp=e=>{const t=(new Date).toISOString();return{id:u(),analyticsEvent:Qp.cardFeedUpdated,eventName:Qp.cardFeedUpdated,endUserId:e.endUserId,timestamp:t,properties:{cardCount:e.cardCount},sdkContext:{containerId:e.streamContainerId},eventContext:{userLocalTimestamp:(0,p.format)(t,"YYYY-MM-DDTHH:mm:ss.SSSZ")}}};function em(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class tm{constructor(e){var t,n,r,i,o;em(this,"totals",void 0),em(this,"metricsByContainer",void 0);const a=zh();let s={active:0,unseen:0};(null==e||null===(t=e.aggregates)||void 0===t||null===(n=t.cards)||void 0===n?void 0:n.total)&&(s.active=e.aggregates.cards.total.active,s.unseen=e.aggregates.cards.total.unseenCardInstanceIds.filter((e=>!a.has(e))).length),this.totals=s,this.metricsByContainer=(null==e||null===(r=e.aggregates)||void 0===r||null===(i=r.cards)||void 0===i||null===(o=i.byContainer)||void 0===o?void 0:o.reduce(((e,t)=>(e[t.containerId]={unseen:t.unseenCardInstanceIds.filter((e=>!a.has(e))).length,active:t.active},e)),{}))||{}}unseenCards(){return this.totals.unseen||0}totalCards(){return this.totals.active||0}unseenCardsForStreamContainer(e){var t;return(null===(t=this.metricsByContainer[e])||void 0===t?void 0:t.unseen)||0}totalCardsForStreamContainer(e){var t;return(null===(t=this.metricsByContainer[e])||void 0===t?void 0:t.active)||0}}var nm=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};let rm;const im=(e,t,n)=>nm(void 0,void 0,void 0,(function*(){if(dm(),!e||!Array.isArray(e)||0===e.length||e.some((e=>"string"!=typeof e)))throw new Error("containerIds must be a non-empty array of strings");let r=Object.assign({deviceId:rm.deviceId,appId:rm.appId,streamContainerIds:e,platform:rm.platform},n?{notificationsEnabled:n}:{});const{data:i,response:o}=yield cp.put("register-containers",r,t,{streamContainerIds:e});if(cm(im.name,i),o.error)throw o.error;return 200===o.status})),om=(e,t)=>nm(void 0,void 0,void 0,(function*(){dm();let n={token:e,deviceId:rm.deviceId,appId:rm.appId,platform:rm.platform};const{data:r,response:i}=yield cp.put("register",n,t);if(cm(om.name,r),i.error)throw i.error;return 200===i.status})),am=e=>nm(void 0,void 0,void 0,(function*(){dm();let t={deviceId:rm.deviceId,appId:rm.appId};const{data:n,response:r}=yield cp.delete("deregister-token",t,e);if(cm(am.name,n),r.error)throw r.error;return 200===r.status})),sm=e=>{if(!Uh(e))return null;const t=e.atomic;if(!Uh(t))return null;const n=t,{source:r,cardInstanceId:i,streamContainerId:o,detail:a}=n;return"io.atomic"!==r||"string"!=typeof i||"number"!=typeof o&&"string"!=typeof o?null:{cardInstanceId:i,containerId:o.toString(),detail:Uh(a)?a:{}}},lm=e=>{const t=[];return e||t.push("deviceInfo should be a non-null object."),(null==e?void 0:e.platform)||t.push('platform should be either "iOS" or "Android".'),(null==e?void 0:e.deviceId)||t.push("deviceId should be a non-empty string."),(null==e?void 0:e.appId)||t.push("appId should be a non-empty string."),(null==e?void 0:e.platform)&&!["ios","android"].includes(e.platform.toLowerCase())&&t.push('platform is invalid: should be either "iOS" or "Android".'),t.length>0?{success:!1,errors:t}:{success:!0,errors:[]}},dm=()=>{if(!lm(rm).success)throw new Error("You must call setNativeDeviceInfo before registering for native notifications")},cm=(e,t)=>{var n;(null==t||null===(n=t.errors)||void 0===n?void 0:n.length)&&v.error({level1:[`Errors detected with ${e}`,...t.errors.map((e=>null==e?void 0:e.title))]})};var um=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const hm=e=>{var t;const n=[],r=["mon","tue","wed","thu","fri","sat","sun","default"];if(null===(t=e.preferences)||void 0===t?void 0:t.notifications){for(const[t,o]of Object.entries(null===(i=e.preferences)||void 0===i?void 0:i.notifications)){var i;if(!r.includes(t)){n.push(`Invalid key provided for "${t}", notification preferences can only be provided for the following keys: ${r.toString()}`);continue}if(!(null==o?void 0:o.length))continue;const a=o.map((e=>{const{from:r,to:i}=e,o=e=>`${e.hours.toString().padStart(2,"0")}:${e.minutes.toString().padStart(2,"0")}`;if(!r&&!i||r&&!i||!r&&i)n.push(`Invalid notification range provided for ${t}, both a "from" & "to" value are required`);else if(isNaN(r.hours)||isNaN(r.minutes)||isNaN(i.hours)||isNaN(i.minutes))n.push(`Invalid notification range provided for ${t}, non-numeric value provided for "from" or "to"`);else if(r.hours>23||r.hours<0||i.hours>23||i.hours<0)n.push(`Invalid notification range provided for ${t}, hours must be between 0 & 23 inclusive`);else if(r.minutes>59||r.minutes<0||i.minutes>59||i.minutes<0)n.push(`Invalid notification range provided for ${t}, minutes must be between 0 & 59 inclusive`);else{if(!(r.hours>i.hours))return{from:o(r),to:o(i)};n.push(`Invalid notification range provided for ${t}, end time must be earlier than start time`)}}));e.preferences.notifications[t]=a}n.length&&(v.warn({level1:n}),delete e.preferences.notifications)}};var pm=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};function mm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gm=n(5373),vm="atomic-sdk-modal-stream-embed",fm="atomic-sdk-text-observer",bm="authCallbackError",Sm="authRetryIntervalPending",ym="authTokenError",wm=(e,t)=>{t(e)},km=(e,t)=>{var n,r,i,o,a;const s=(null===(n=t.features)||void 0===n||null===(r=n.cordova)||void 0===r?void 0:r.enabled)||!1,l=s?Dp():"https://downloads.atomic.io/web-sdk/release/26.2.0/iframe-manager-cdn-icons.js";if(s&&!l)return void console.error("The Atomic SDK could not locate a required script (iframe-manager.js). Ensure you have included the script on your page and have added the ID `atomic-frame-manager` to the element.");const d=null===(i=t.enabledUiElements)||void 0===i||null===(o=i.customContainerHeader)||void 0===o?void 0:o.headerElement;(null===(a=t.enabledUiElements)||void 0===a?void 0:a.customContainerHeader)&&(t.enabledUiElements.customContainerHeader.headerElement="");const c=`\n <!doctype html>\n <head>\n <title>Atomic SDK</title>\n <style>\n html,body {margin: 0; height: 100%; width:100%; overflow: hidden;}\n * {box-sizing: border-box;}\n </style>\n </head>\n <body>\n <script src='${l}' data-config='${JSON.stringify(t).replace(/'/g,"'")}' type='application/javascript'><\/script>\n <div id='custom-container-header' style='display:none;'>${null!=d?d:""}</div>\n </body>\n </html>\n`;e.setAttribute("srcdoc",c)};class Cm{static setSessionDelegate(e,t){this.tokenRetryInterval=t||0,this.onAuthTokenRequested=e}static setTokenExpiryInterval(e){if(!("number"==typeof e&&e>0))return v.error({level1:["Could not set token expiry interval, invalid value provided. The value must be a number greater than 0."]});this.tokenExpiryInterval=e}static launch(e){Cm.init();const t=new xm(e,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:!1}),"launcher",this.analyticsQueue);return Cm.streamContainers[t.instanceId]={sendMessageToIframe:e=>t.sendMessageToIframe(e),logout:()=>{t.sendMessageToIframe({action:C})},embedMode:"launcher"},t}static embed(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Cm.init();const r=new xm(t,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:n}),"standalone",this.analyticsQueue,e);return Cm.streamContainers[r.instanceId]={sendMessageToIframe:e=>r.sendMessageToIframe(e),logout:()=>{r.sendMessageToIframe({action:C})},embedMode:"standalone"},r}static singleCard(e,t){Cm.init();const n=new xm(t,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:!0}),"single-card",this.analyticsQueue,e);return Cm.streamContainers[n.instanceId]={sendMessageToIframe:e=>n.sendMessageToIframe(e),logout:()=>{n.sendMessageToIframe({action:C})},embedMode:"single-card"},n}static modalStreamContainer(e){if(Object.values(Cm.streamContainers).find((e=>"modal-stream"===e.embedMode)))return console.warn("AtomicSDK Web - A modal stream container already exists, only one instance can be created.");Cm.init();let t=document.createElement("div");document.getElementById(vm)?t=document.getElementById(vm):t.id=vm,document.body.appendChild(t);const n=new xm(e,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:!0}),"modal-stream",this.analyticsQueue,t);return Cm.streamContainers[n.instanceId]={sendMessageToIframe:e=>n.sendMessageToIframe(e),logout:()=>{n.sendMessageToIframe({action:C})},embedMode:"modal-stream"},n}static observableStreamContainer(e){Cm.init();const t=new Im(e,Object.assign({},this.internalConfig),this.analyticsQueue);return Cm.streamContainers[t.instanceId]={sendMessageToIframe:e=>t.onMessageReceived(e),logout:()=>{t.onMessageReceived({action:C})},embedMode:"headless"},t}static init(){return pm(this,void 0,void 0,(function*(){if(!Cm.hasPerformedInitialisation){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(gm)),document.head.appendChild(e),window.addEventListener("request-failed",(e=>pm(this,void 0,void 0,(function*(){const t=e.detail,n=yield this.analyticsQueue.enqueue({timestamp:new Date,endUserId:t.request.endUserId||"",containerId:t.request.streamContainerId,containerIds:t.request.streamContainerIds,cardInstanceId:t.request.cardInstanceId,eventName:yt,properties:{path:t.request.path,statusCode:t.request.statusCode}},"standard","unauthenticated");if(n){var r;Wp.sendAnalyticsMessage([n]);const e=Xp(n);null===(r=Cm.sdkEventObserver)||void 0===r||r.call(Cm,e)}})))),Cm.hasPerformedInitialisation=!0}const e=Zp.webSocketConnection;e&&(null==e?void 0:e.readyState)!==(null==e?void 0:e.CLOSED)||this.internalConfig.webSocketDisabled||(yield this.createWebSocketConnection().catch((e=>{var t;v.debug({level3:[`SDK init, error creating WebSocket connection: ${e}`]}),null===(t=Cm.onError)||void 0===t||t.call(Cm,e)})))}))}static initialise(e,t,n){return pm(this,void 0,void 0,(function*(){const r={webSocketDisabled:this.internalConfig.webSocketDisabled,pollingFallbackDisabled:this.internalConfig.pollingFallbackDisabled,testHost:this.internalConfig.testHost,clientAppVersion:this.internalConfig.clientAppVersion,tokenUserIdAttribute:this.internalConfig.tokenUserIdAttribute};this.internalConfig=Object.assign({apiHost:e,apiKey:t,environmentId:n},r),e&&t&&n&&sessionStorage.setItem(D,JSON.stringify({initialiseCalled:!0,eventDispatched:!1})),Cm.cachedToken=void 0,cp.initialise(e,t,n),this.internalConfig.webSocketDisabled||(Zp.initialise(e,t,n),Wp.reset(),yield this.createWebSocketConnection().catch((e=>{var t;v.debug({level3:[`SDK initialise, error creating WebSocket connection: ${e}`]}),null===(t=Cm.onError)||void 0===t||t.call(Cm,e)}))),window.AtomicUploadService=Rt,window.addEventListener("pageshow",(r=>{r.persisted&&(cp.initialise(e,t,n),this.internalConfig.webSocketDisabled||(Zp.initialise(e,t,n),this.createWebSocketConnection().catch((e=>{var t;v.debug({level3:[`SDK network clients reinitialized after page loaded from cache, error creating WebSocket connection: ${e}`]}),null===(t=Cm.onError)||void 0===t||t.call(Cm,e)}))),this.initialiseSDKBroadcastChannel())}))}))}static initialiseSDKBroadcastChannel(){var e;(null===(e=Cm.containersBroadcastChannel)||void 0===e?void 0:e.isOpen)||(Cm.containersBroadcastChannel=new qs)}static setApiProtocol(e){const{apiHost:t,apiKey:n,environmentId:r}=this.internalConfig;if(t||n||r)throw new Error("You must set API protocol before initializing the SDK. This is because the SDK needs to know the protocol to use when creating a connection to the Atomic Platform.");this.internalConfig.webSocketDisabled="http"===e,this.webSocketDisabled="http"===e}static enableDebugMode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;v.logLevel=e,Object.values(Cm.streamContainers).forEach((t=>t.sendMessageToIframe({action:"io.atomic.events.logLevelUpdate",values:{logLevel:e}})))}static createWebSocketConnection(){var e=arguments;return pm(this,void 0,void 0,(function*(){let t=e.length>0&&void 0!==e[0]?e[0]:0,n=e.length>1?e[1]:void 0;const r={1:100,2:15e3,3:6e4};if(Zp.openingConnection)return;const i={onMessage:e=>{Wp.handleWebSocketMessage(e)},onError:e=>{v.error({level3:["WebSocket error handler received error message",e]})},onOpen:()=>pm(this,void 0,void 0,(function*(){try{yield this.handleTokenRequest({skipCache:!0,authWebSocket:!0}),Wp.lastPongSuccess=(new Date).toISOString(),Wp.resubscribeActiveSubscriptions()}catch(e){v.error({level1:["Error authenticating WebSocket."],level2:[e]}),Object.values(Cm.streamContainers).forEach((t=>{t.sendMessageToIframe({action:E,values:e instanceof Error?e.message:e})}))}})),onClose:e=>{switch(e.code){case zp.sdkChangingProtocol:case zp.sdkReinitialisedWebSocket:case zp.sdkSessionEnding:case zp.sdkCordovaBackgrounded:case zp.sdkPersistedToBrowserCache:case zp.unitTestConnectionClose:v.debug({level1:[`WebSocket closed with ${e.code} connection close code`],level2:[e]});break;case zp.retryConnection:if(v.debug({level1:[`WebSocket closed with ${e.code} connection close code`],level2:[e]}),t<3){const e=t+1;setTimeout((()=>{this.createWebSocketConnection(e).catch((e=>{var t;v.debug({level3:["Error on websocket connection retry",e]}),null===(t=Cm.onError)||void 0===t||t.call(Cm,e)}))}),r[e])}else this.triggerPollingFallback(n);break;case zp.sdkClosedConnection:case zp.notPermitted:case zp.abnormalClosure:default:Cm.internalConfig.pollingFallbackDisabled||this.triggerPollingFallback(n),v.debug({level1:[`WebSocket closed with ${e.code} connection close code`],level2:[e]})}}};try{Zp.open("socket",i,n)}catch(e){v.error({level1:["Error creating WebSocket connection"],level2:[e]});const t=new Error(`Error creating WebSocket connection: ${e}`);throw t.name="WebSocket connection error",t}}))}static reinitialiseWebSocketConnection(){Zp.close(zp.sdkReinitialisedWebSocket),this.createWebSocketConnection().catch((e=>{var t;v.debug({level3:["Error reinitializing websocket connection",e]}),null===(t=Cm.onError)||void 0===t||t.call(Cm,e)}))}static authenticateWebSocketConnection(e){return pm(this,void 0,void 0,(function*(){Wp.sendAuthMessage(e),Zp.connectionAuthenticated||(Zp.authenticatingConnection=!0,yield new Promise(((e,t)=>{const n=setTimeout((()=>{Cm.authMessageReject("WebSocket authentication timed out")}),Zp.authenticationTimeout);Cm.authMessageResolve=()=>{v.debug({level3:["WebSocket auth promise resolved."]}),e(),Zp.purgeMessageQueue(),clearTimeout(n),Zp.authenticatingConnection=!1},Cm.authMessageReject=e=>{v.error({level3:["WebSocket auth promise rejected.",e]}),Object.values(Cm.streamContainers).forEach((t=>{var n;t.sendMessageToIframe({action:E,values:null!==(n=e.message)&&void 0!==n?n:e})})),t(e),clearTimeout(n),Zp.authenticatingConnection=!1}})))}))}static simulateWebSocketError(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Zp.close(),t&&this.createWebSocketConnection(0,e).catch((e=>{v.debug({level3:["Error reconnecting websocket",e]})}))}static triggerPollingFallback(e){return pm(this,void 0,void 0,(function*(){var t;Cm.authMessageResolve=()=>null,Cm.authMessageReject=()=>null,e&&(Zp.close(),Zp.clearTimeouts()),Object.values(this.streamContainers).forEach((e=>{e.sendMessageToIframe({action:A})}));const n=yield this.analyticsQueue.enqueue({timestamp:new Date,eventName:yt,endUserId:null!==(t=Gh(Cm.cachedToken,Cm.internalConfig.tokenUserIdAttribute))&&void 0!==t?t:"",properties:Object.assign({path:`${this.internalConfig.environmentId}/socket`},e?{source:"user-simulate"}:{})},"standard","unauthenticated");if(n){var r;Wp.sendAnalyticsMessage([n]);const e=Xp(n);null===(r=Cm.sdkEventObserver)||void 0===r||r.call(Cm,e)}}))}static setTestHostHeader(e){this.internalConfig.testHost=e,cp.setTestHostHeader(e),Zp.setTestHostParam(e)}static setClientAppVersion(e){if(!("string"==typeof e))return v.error({level1:["Could not set client app version"],level2:[": Invalid value provided, must be a string."]});e.length>128&&v.warn({level1:["Client app version truncated"],level2:[": value provided was longer than 128 character maximum."]});const t=e.substring(0,128);cp.setClientAppVersion(t),Zp.setClientAppVersion(t),this.internalConfig.clientAppVersion=t}static setTokenUserIdAttribute(e){return"string"==typeof e?e.length>128?v.error({level1:["Could not set token user ID attribute"],level2:[": value provided was longer than 128 character maximum."]}):(cp.setTokenUserIdAttribute(e),void(this.internalConfig.tokenUserIdAttribute=e)):v.error({level1:["Could not set token user ID attribute"],level2:[": Invalid value provided, must be a string."]})}static setRetryTimer(){Cm.tokenRetryInterval&&!Cm.tokenRetryTimer&&(Cm.tokenRetryTimer=setTimeout((()=>{Cm.tokenRetryTimer=void 0}),Cm.tokenRetryInterval))}static handleTokenRequest(e){return pm(this,void 0,void 0,(function*(){var t;let n,r=new Error;if(!Cm.onAuthTokenRequested)throw r.message="Could not resolve an auth token. `AtomicSDK.setSessionDelegate` must be used to set a callback resolving to a promise that supplies an authentication token.",r.name=bm,r;if(Cm.tokenRetryTimer)throw r.message="Not ready to retry token request",r.name=Sm,r;if(Cm.cachedToken&&!(null==e?void 0:e.skipCache)){const e=Vh(Cm.cachedToken);if(!(e=>{const t=Math.floor((new Date).getTime()/1e3);return 1===(0,p.compareAsc)(t,e)})(e.exp-Cm.tokenExpiryInterval))return Cm.cachedToken;n=e}const i=yield Promise.race([new Promise((e=>{setTimeout((()=>{e(void 0)}),5e3)})),null===(t=Cm.onAuthTokenRequested)||void 0===t?void 0:t.call(Cm)]);if(!i||0===i.length)throw r.message="An authentication token was required for the request, however no token was returned.",r.name=ym,Cm.setRetryTimer(),r;if(!Wh(i))throw r.message="The auth token provided is not a valid JWT.",r.name=ym,Cm.setRetryTimer(),r;if(n&&n.exp-n.iat<3600){Gh(Cm.cachedToken,Cm.internalConfig.tokenUserIdAttribute)!==Gh(i,Cm.internalConfig.tokenUserIdAttribute)&&v.error({level1:["User ID has changed between authenticated requests without first calling `AtomicSDK.logout` be sure to call this when a user is logged out"]})}const o=Gh(i,Cm.internalConfig.tokenUserIdAttribute);o&&o!==Gh(Cm.cachedToken,Cm.internalConfig.tokenUserIdAttribute)&&Cm.analyticsQueue.initializeAuthenticatedQueue(o);const a=JSON.parse(sessionStorage.getItem(D)||"{}");if(o&&a.initialiseCalled&&!a.eventDispatched){const e={endUserId:o,eventName:dt,timestamp:new Date,properties:{}};Cm.analyticsQueue.enqueue(e,"sdk-initialized","authenticated").then((e=>{if(e){var t;Wp.sendAnalyticsMessage([e]);const n=Xp(e);null===(t=Cm.sdkEventObserver)||void 0===t||t.call(Cm,n)}})),sessionStorage.setItem(D,JSON.stringify(Object.assign(Object.assign({},a),{eventDispatched:!0})))}if((null==e?void 0:e.authWebSocket)&&Zp.isConnected()&&!Zp.authenticatingConnection)try{yield Cm.authenticateWebSocketConnection(i)}catch(r){throw v.error({level3:["Fresh auth token received, error authenticating WebSocket connection with new token.",r]}),r}return Cm.cachedToken=i}))}static getCurrentUserId(){var e;return null!==(e=Gh(Cm.cachedToken,Cm.internalConfig.tokenUserIdAttribute))&&void 0!==e?e:""}static requestCardCount(e){return pm(this,void 0,void 0,(function*(){if(!e)throw new Error("A stream container ID is required when requesting card count.");if(!cp.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to request card count.");try{const t=yield cp.get(`feed/${e}`,{requestToken:yield Cm.handleTokenRequest},void 0,{streamContainerId:e});if(t.response.error)throw t.response.error;if(200===t.response.status&&t.data&&t.data.cardInstances)return{totalCards:t.data.cardInstances.length};throw new Error("Unexpected response returned when fetching card count.")}catch(e){throw new Error(`Card count could not be retrieved. ${e instanceof Error?e.message:String(e)}`)}}))}static sendEvent(e){return pm(this,void 0,void 0,(function*(){var t,n,r;if(console.error(new Error("`AtomicSDK.sendEvent` is deprecated and will be removed in a future release.")),!e.name)throw new Error("An event name is required to send an event.");if(!cp.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to send an event.");let i={name:e.name,payload:{detail:(null===(t=e.payload)||void 0===t?void 0:t.detail)||{},metadata:(null===(n=e.payload)||void 0===n?void 0:n.metadata)||{},notificationDetail:(null===(r=e.payload)||void 0===r?void 0:r.notificationDetail)||{}}};e.lifecycleId&&(i.lifecycleId=e.lifecycleId);try{const e=yield cp.post("event",{data:i},{requestToken:yield Cm.handleTokenRequest});if(e.data&&e.data.errors){const t=e.data.errors.map((e=>e.title||"")).join("\n");throw new Error(`The following errors were returned: ${t}`)}if(e.response.error)throw e.response.error;if(200!==e.response.status)throw new Error("No error information was available.");return e.data}catch(e){throw new Error(`The event could not be sent. ${e instanceof Error?e.message:String(e)}`)}}))}static sendCustomEvent(e){return pm(this,void 0,void 0,(function*(){var t;if(!cp.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to send a custom event.");const n=Gh(yield Cm.handleTokenRequest(),Cm.internalConfig.tokenUserIdAttribute);if(!n)throw new Error("Could not send custom event, a valid user ID was not obtained from the auth token.");if("string"!=typeof e.eventName||!(null===(t=e.eventName)||void 0===t?void 0:t.length))throw new Error("Could not send custom event, an invalid event name was supplied. The `eventName` must be a string of non zero length.");if(void 0!==e.properties&&(Array.isArray(e.properties)||null===e.properties||"object"!=typeof e.properties))throw new Error("Could not send custom event, an invalid value was supplied for event properties.");this.analyticsQueue.enqueue(Object.assign({endUserId:n,eventName:e.eventName,timestamp:new Date},e.properties?{properties:e.properties}:{}),"custom","authenticated").then((e=>{e&&Wp.sendAnalyticsMessage([e])}))}))}static observeSDKEvents(e){this.sdkEventObserver=e}static requestUserMetrics(){return pm(this,void 0,void 0,(function*(){if(!cp.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to request user metrics.");try{const e=yield cp.get("user-metrics",{requestToken:yield Cm.handleTokenRequest},this.cachedUserMetrics.lastModified);if(e.response.error)throw e.response.error;switch(e.response.status){case 200:return this.cachedUserMetrics={lastModified:e.response.etag||void 0,userMetricsResponse:e.data,userMetrics:new tm(e.data)},this.cachedUserMetrics.userMetrics;case 304:if(this.cachedUserMetrics.userMetricsResponse)return new tm(this.cachedUserMetrics.userMetricsResponse);throw new Error("Response indicated that there were no new metrics, but no cached metrics could be returned.");default:throw new Error("No error information was available.")}}catch(e){throw new Error(`User metrics could not be retrieved. ${e instanceof Error?e.message:String(e)}`)}}))}static updateUser(e){return pm(this,void 0,void 0,(function*(){if(!cp.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to update a user profile.");try{const{ok:r,error:i}=yield(t=e,n={requestToken:yield Cm.handleTokenRequest},um(void 0,void 0,void 0,(function*(){var e,r;(null===(e=t.preferences)||void 0===e?void 0:e.notifications)&&hm(t);const{data:i,response:o}=yield cp.put("update-user",t,n);return(null==i||null===(r=i.errors)||void 0===r?void 0:r.length)&&v.error({level1:["Errors detected with user update:",...i.errors.map((e=>null==e?void 0:e.title))]}),o.error?{ok:!1,error:o.error}:{ok:200===o.status}})));if(i)throw i;return r}catch(e){throw new Error(`User update could not be completed. ${e instanceof Error?e.message:String(e)}`)}var t,n}))}static onCardAction(e,t){if(!cp.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to execute a card action.");if(!e||!t)throw new Error("You must provide a valid container ID and card ID to execute a card action.");return{dismiss:(n,r)=>pm(this,void 0,void 0,(function*(){const i=yield os(e,t,{requestToken:yield Cm.handleTokenRequest});i.ok?n():i.error&&r(i.error)})),snooze:(n,r,i)=>pm(this,void 0,void 0,(function*(){if(!i||"number"!=typeof i||i<0)throw new Error("Invalid snooze interval, interval must be a positive number");const o=yield as(e,t,i,{requestToken:yield Cm.handleTokenRequest});o.ok?n():o.error&&r(o.error)})),submit:(n,r,i,o)=>pm(this,void 0,void 0,(function*(){const a=null!=o?o:{};if(!i)throw new Error("Submit button name missing, a button name must be supplied to submit a card response");for(const[e,t]of Object.entries(a)){if("string"!=typeof e)throw new Error("Invalid card response supplied, response keys must be strings");if(!["string","number","boolean"].includes(typeof t))throw new Error("Invalid card response supplied, response values must be strings, numbers or booleans")}const s=yield is(e,t,Object.assign(Object.assign({},a),{[i]:null}),{requestToken:yield Cm.handleTokenRequest});s.ok?n():s.error&&r(s.error)}))}}static logout(){var e=arguments;return pm(this,void 0,void 0,(function*(){if(e.length>0&&void 0!==e[0]&&e[0])try{yield Cm.deregisterDeviceForNotifications()}catch(e){const t=e instanceof Error?e.message:String(e);t.includes("You must call setNativeDeviceInfo before registering for native notifications")||console.error(`Problem de-registering notifications when logging out: ${t}`)}Object.values(Cm.streamContainers).forEach((e=>{e.logout()})),Cm.streamContainers={},yield this.analyticsQueue.flush(),Cm.cachedUserMetrics={},Cm.cachedToken=void 0,Cm.tokenRetryTimer=void 0,Cm.sdkEventObserver=null,sessionStorage.removeItem(_),Zp.close(zp.sdkSessionEnding,"Connection closed by SDK, user logged out"),Zp.reset(),Cm.internalConfig=Object.assign(Object.assign({},Cm.internalConfig),{apiHost:void 0,apiKey:void 0,environmentId:void 0}),cp.reset()}))}static login(e,t,n,r,i){Cm.initialise(e,t,n),Cm.setSessionDelegate(r,i)}static setNativeDeviceInfo(e){try{return(e=>{const t=lm(e);if(t.success)return rm=e,!0;{const e=`Device info set with invalid parameters: ${t.errors.join("\n")}`;throw console.error(e),new Error(e)}})(e)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to setNativeDeviceInfo: ${t}`)}}static registerDeviceForNotifications(e){return pm(this,void 0,void 0,(function*(){if(!cp.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to register the device for push notifications");try{return yield om(e,{requestToken:yield Cm.handleTokenRequest})}catch(e){throw new Error(`${om.name} could not be completed. ${e instanceof Error?e.message:String(e)}`)}}))}static deregisterDeviceForNotifications(){return pm(this,void 0,void 0,(function*(){if(!cp.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to deregister the device for push notifications");try{return yield am({requestToken:yield Cm.handleTokenRequest})}catch(e){throw new Error(`${am.name} could not be completed. ${e instanceof Error?e.message:String(e)}`)}}))}static registerStreamContainersForNotifications(e,t){return pm(this,void 0,void 0,(function*(){if(!cp.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to register stream containers for notifications");try{return yield im(e,{requestToken:yield Cm.handleTokenRequest},t)}catch(e){throw new Error(`${im.name} could not be completed. ${e instanceof Error?e.message:String(e)}`)}}))}static notificationFromPushPayload(e){return sm(e)}static trackPushNotificationReceived(e){const t=sm(e);if(null==t)return!1;const n=Gh(Cm.cachedToken,Cm.internalConfig.tokenUserIdAttribute);if(!n)return v.warn({level1:["Atomic push notification received, no user ID found so could not log analytics event for notification received"]}),!0;let r={eventName:Ct,endUserId:n,containerId:t.containerId,cardInstanceId:t.cardInstanceId,timestamp:new Date};return Cm.analyticsQueue.enqueue(r,"standard","authenticated").then((e=>{if(e){var t;Wp.sendAnalyticsMessage([e]);const n=Xp(e);null===(t=Cm.sdkEventObserver)||void 0===t||t.call(Cm,n)}})),!0}}mm(Cm,"hasPerformedInitialisation",!1),mm(Cm,"webSocketDisabled",!1),mm(Cm,"cachedUserMetrics",{}),mm(Cm,"internalConfig",{}),mm(Cm,"cachedToken",void 0),mm(Cm,"onError",void 0),mm(Cm,"sdkEventObserver",null),mm(Cm,"SDKEvents",Qp),mm(Cm,"userMetricsTriggerEvents",new Set(Gp)),mm(Cm,"onAuthTokenRequested",void 0),mm(Cm,"tokenRetryInterval",0),mm(Cm,"tokenRetryTimer",void 0),mm(Cm,"tokenExpiryInterval",60),mm(Cm,"authMessageResolve",(()=>null)),mm(Cm,"authMessageReject",(()=>null)),mm(Cm,"streamContainers",{}),mm(Cm,"containersBroadcastChannel","BroadcastChannel"in window?new qs:void 0),mm(Cm,"analyticsQueue",new class{constructor(e){Qh(this,"authenticatedEventQueue",void 0),Qh(this,"unauthenticatedEventQueue",[]),Qh(this,"flushTimeout",null),Qh(this,"flushPromise",null),Qh(this,"authTokenProvider",void 0),Qh(this,"tokenUserIdAttribute",void 0),this.authTokenProvider=e;const t=localStorage.getItem(Xh);if(t)try{this.unauthenticatedEventQueue=JSON.parse(t)}catch(e){}this.scheduleFlush()}getKeyForAuthenticatedQueue(e){return`${e}_AuthenticatedAtomicAnalyticsQueue`}initializeAuthenticatedQueue(e,t){const n=localStorage.getItem(this.getKeyForAuthenticatedQueue(e));if(n)try{this.authenticatedEventQueue=JSON.parse(n)}catch(t){this.authenticatedEventQueue=[],v.error({level1:["Failed to parse existing authenticated analytics queue for user:",e]})}else this.authenticatedEventQueue=[],v.debug({level1:["No existing authenticated analytics queue found for user:",e]});this.tokenUserIdAttribute=t}createEventPayload(e,t){const n={id:u(),endUserId:e.endUserId,timestamp:e.timestamp.toISOString(),properties:e.properties||{},eventContext:{userLocalTimestamp:(0,p.format)(e.timestamp,"YYYY-MM-DDTHH:mm:ss.SSSZ")}};switch(t){case"standard":{const t=e;return Object.assign(Object.assign({},n),{analyticsEvent:t.eventName,hostContext:t.hostContext||{},sdkContext:Object.assign({containerId:t.containerId||""},t.containerIds?{containerIds:t.containerIds}:{}),streamContext:Object.assign({streamLength:t.streamLength||0,streamLengthVisible:t.streamLengthVisible||0,cardPositionInStream:t.streamCardPosition||0},t.displayMode?{displayMode:t.displayMode}:{}),cardContext:{cardInstanceId:t.cardInstanceId||"",cardInstanceStatus:t.cardInstanceStatus||"",cardViewState:t.cardViewState||"topview",cardPresentation:"individual"}})}case"custom":return Object.assign(Object.assign({},n),{eventType:"custom",eventName:e.eventName,sdkContext:{}});case"sdk-initialized":return Object.assign(Object.assign({},n),{analyticsEvent:e.eventName,hostContext:{},cardContext:{},streamContext:{},sdkContext:{}});default:return null}}enqueue(e){var t=arguments;return Zh(this,void 0,void 0,(function*(){let n=t.length>1&&void 0!==t[1]?t[1]:"standard",r=t.length>2&&void 0!==t[2]?t[2]:"authenticated";if(!cp.isInitialised())return null;const i=this.createEventPayload(e,n);if(i){let t;if("authenticated"===r){if(!this.authenticatedEventQueue)return v.warn({level1:["Attempt to send authenticated event but authenticated queue not initialized, dropping analytic event."],level2:[`${e.eventName}: `,e]}),null;t=this.authenticatedEventQueue}else t=this.unauthenticatedEventQueue;t.push(i),t.length>500&&t.splice(0,t.length-500)}return yield this.persistQueue(r),i}))}removeProcessedEvents(e){var t;(null===(t=this.authenticatedEventQueue)||void 0===t?void 0:t.length)&&(this.authenticatedEventQueue=this.authenticatedEventQueue.filter((t=>!e.includes(t.id))),this.persistQueue("authenticated")),this.unauthenticatedEventQueue.length&&(this.unauthenticatedEventQueue=this.unauthenticatedEventQueue.filter((t=>!e.includes(t.id))),this.persistQueue("unauthenticated"))}performFlush(){return Zh(this,void 0,void 0,(function*(){null!=this.flushTimeout&&(window.clearTimeout(this.flushTimeout),this.flushTimeout=null);const e={};let t=[...this.authenticatedEventQueue||[]],n=[...this.unauthenticatedEventQueue||[]];if(t.length&&cp.isInitialised()){const n=yield this.authTokenProvider.requestToken();t=t.filter((e=>e.endUserId===Gh(n,this.tokenUserIdAttribute))),e.authenticated=cp.put("sdk-events",{data:t},this.authTokenProvider)}n.length&&cp.isInitialised()&&(e.unauthenticated=cp.put("analytics",{data:n}));const r=Object.keys(e);if(0===r.length)return this.scheduleFlush();try{const i=Object.values(e).filter((e=>void 0!==e)),o=yield Promise.allSettled(i),a={};o.forEach(((e,t)=>{"fulfilled"===e.status?a[r[t]]=e.value:v.error({level1:[`Error flushing analytics events for ${r[t]}`],level2:[`Error: ${e.reason instanceof Error?e.reason.message:e.reason}`]})})),a.authenticated&&200===a.authenticated.response.status&&this.authenticatedEventQueue&&(this.authenticatedEventQueue=this.authenticatedEventQueue.filter((e=>!t.includes(e))),this.persistQueue("authenticated")),a.unauthenticated&&200===a.unauthenticated.response.status&&(this.unauthenticatedEventQueue=this.unauthenticatedEventQueue.filter((e=>!n.includes(e))),this.persistQueue("unauthenticated"))}catch(e){v.error({level1:["Error flushing analytics events"],level2:[`Error: ${e instanceof Error?e.message:String(e)}`]})}finally{this.scheduleFlush()}}))}flush(){return Zh(this,void 0,void 0,(function*(){return this.flushPromise=null===this.flushPromise?this.performFlush():this.flushPromise.then((()=>this.performFlush())),this.flushPromise}))}scheduleFlush(){this.flushTimeout=window.setTimeout(this.flush.bind(this),3e4)}persistQueue(){var e=arguments;return Zh(this,void 0,void 0,(function*(){if("unauthenticated"===(e.length>0&&void 0!==e[0]?e[0]:"authenticated"))return localStorage.setItem(Xh,JSON.stringify(this.unauthenticatedEventQueue));const t=yield this.authTokenProvider.requestToken();if(!t)return v.error({level1:["No auth token available for persisting authenticated analytics queue."]});const n=Gh(t,this.tokenUserIdAttribute);if(!n)return v.error({level1:["No user ID found in auth token for persisting authenticated analytics queue."]});localStorage.setItem(this.getKeyForAuthenticatedQueue(n),JSON.stringify(this.authenticatedEventQueue))}))}}({requestToken:Cm.handleTokenRequest}));class xm{constructor(e,t,n,r,i){mm(this,"iframe",void 0),mm(this,"modalIframe",void 0),mm(this,"toastIframe",void 0),mm(this,"outsideClickListener",void 0),mm(this,"queuedMessages",[]),mm(this,"iframeLoaded",!1),mm(this,"appOpen",!1),mm(this,"launchButtonIconContainer",void 0),mm(this,"launcher",void 0),mm(this,"resizeObserver",void 0),mm(this,"resolvedConfiguration",void 0),mm(this,"instanceId",void 0),mm(this,"streamFilters",new fp((()=>this.sendMessageToIframe({action:j,values:{filter:this.streamFilters.getFilterObject()}})),(()=>{this.sendMessageToIframe({action:j,values:{filter:void 0}})}))),mm(this,"config",void 0),mm(this,"analyticsQueue",void 0);const o=`${e.streamContainerId}`;if(null===e.streamContainerId||void 0===e.streamContainerId||"string"!=typeof e.streamContainerId&&"number"!=typeof e.streamContainerId||0===o.trim().length)throw new Error("The Atomic SDK failed to start. You must pass a `streamContainerId` when instantiating a stream container.");var a,s,l,d;if(!Cm.onAuthTokenRequested)throw new Error("You must use `AtomicSDK.setSessionDelegate` to set a callback resolving to a promise that supplies an authentication token before attempting to create a stream container.");if(void 0!==(null===(a=e.features)||void 0===a?void 0:a.cardVoting)&&console.warn("Stream container configuration for card voting is deprecated. Stream container feature configuration should not include `cardVoting` as it will be removed in a future release. Instead, use the card voting menu configuration in the Atomic workbench: https://documentation.atomic.io/guide/cards/behaviour#card-voting"),void 0!==(null===(s=e.features)||void 0===s?void 0:s.cardMinimumHeight)&&console.warn("Configuration in `features` is deprecated. Use the top level configuration property `cardMinimumHeight` instead."),void 0!==(null===(l=e.features)||void 0===l?void 0:l.horizontalContainerConfig)&&console.warn("Configuration in `features` is deprecated. Use the top level configuration property `horizontalContainerConfig` instead."),void 0!==(null===(d=e.features)||void 0===d?void 0:d.controlledContainerOpenState)&&console.warn("Configuration in `features` is deprecated. Use the top level configuration property `controlledContainerOpenState` instead."),!this.iframeLoaded){var c,h,p;let a=Object.assign(Object.assign(Object.assign({},e),{streamContainerId:o}),t),s=a.cardListRefreshInterval;a.cardListRefreshInterval=null!=s?0==s?0:Math.max(1e3,s):void 0;let l=a.runtimeVariableResolutionTimeout;if(a.runtimeVariableResolutionTimeout=null!=l?Math.max(0,l):void 0,"single-card"!==n&&((null===(c=e.horizontalContainerConfig)||void 0===c?void 0:c.enabled)&&!e.horizontalContainerConfig.cardWidth||(null===(h=e.features)||void 0===h||null===(p=h.horizontalContainerConfig)||void 0===p?void 0:p.enabled)&&!e.features.horizontalContainerConfig.cardWidth))throw new Error("The card width must be specified in the `horizontalContainerConfig` configuration object when attempting to create a stream container in horizontal mode.");this.resolvedConfiguration=a,this.instanceId=u(),this.analyticsQueue=r,this.initIframe(a,n,i)}}stop(){this.iframeLoaded=!1,this.iframe&&this.iframe.parentNode&&this.iframe.parentNode.removeChild(this.iframe),this.modalIframe&&this.modalIframe.parentNode&&this.modalIframe.parentNode.removeChild(this.modalIframe),this.toastIframe&&this.toastIframe.parentNode&&this.toastIframe.parentNode.removeChild(this.toastIframe),this.launcher&&this.launcher.parentNode&&this.launcher.parentNode.removeChild(this.launcher),Wp.activeSubscriptions[this.instanceId]&&(Wp.unsubscribeFromCardFeed([this.instanceId]),delete Cm.streamContainers[this.instanceId])}updateVariables(){this.sendMessageToIframe({action:"io.atomic.events.requestRuntimeVariables"})}setOpen(e){var t;if(void 0===e)return v.error({level1:["Open status not supplied to updateOpenStatus"]});if("launcher"===this.config.embedMode)document.removeEventListener("click",this.outsideClickListener);else if(!(null===(t=this.config.features)||void 0===t?void 0:t.controlledContainerOpenState)&&!this.config.controlledContainerOpenState)return v.error({level1:["To change the open status for this container you must enable `controlledContainerOpenState` in the features configuration"]});this.appOpen!==e&&(this.appOpen=e,this.updateAppOpen())}getIcon(e){var t;const{openIconSrc:n,closeIconSrc:r}=(null===(t=this.config.enabledUiElements)||void 0===t?void 0:t.launcherButton)||{};return n&&r?`<img src="${e?r:n}" style="max-height: 100%; max-width: 100%; margin: auto">`:e?'\n <svg width="12" height="12" viewBox="0 0 12 12">\n <path\n d="M1 1L6 6L11 11M1 11L11 1"\n stroke-width="2"\n stroke-linecap="round"\n stroke="white"\n style="pointer-events: none;"\n />\n </svg>\n ':'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="32"\n viewBox="0 0 28 32"\n fill="none"\n style="pointer-events: none;"\n >\n <path\n d="M18 22.8V26C18 28.2091 16.2091 30 14 30C11.7909 30 10 28.2091 10 26V22.8M18 22.8H10M18 22.8H26L22.8 19.6V17.2M10 22.8H2L5.2 19.6C5.2 19.6 5.2 15.5998 5.2 10.7998C5.2 5.9998 9.2 2 14 2C15.433 2 16.7947 2.3565 18 2.98436M11.6 11.6L15.6 15.6L26 5.2"\n stroke="white"\n stroke-width="3"\n stroke-linecap="round"\n stroke-linejoin="round"\n />\n </svg>\n '}toggleAppOpen(){this.appOpen=!this.appOpen,this.updateAppOpen()}updateAppOpen(){const e={action:"updateAppOpen",values:{open:this.appOpen}};this.sendMessageToIframe(e)}initLauncherButton(){var e;const{disabled:t,backgroundColor:n}=(null===(e=this.config.enabledUiElements)||void 0===e?void 0:e.launcherButton)||{};if(t)return;const r=document.createElement("div"),i=document.createElement("button");i.tabIndex=0,r.className="atomic-sdk-launcher-wrapper",i.className="atomic-sdk-launcher",i.setAttribute("data-testid","launcher-button"),this.launchButtonIconContainer=i,this.launcher=r,i.style.backgroundColor=n||"",i.innerHTML=this.getIcon(!1),r.appendChild(i),document.body.appendChild(r),r.addEventListener("click",(()=>{this.toggleAppOpen()})),this.outsideClickListener=e=>{e.target&&this.launcher&&this.launcher.contains(e.target)||this.toggleAppOpen()}}initIframe(e,t,n){var r,i,o,a,s,l,d;const c=Object.assign(Object.assign({},e),{windowOrigin:this.getWindowOrigin(),embedMode:t,instanceId:this.instanceId});if(this.config=c,this.iframe=document.createElement("iframe"),this.iframe.classList.add("atomic-sdk-frame"),this.iframe.classList.add(c.embedMode),this.iframe.setAttribute("frameBorder","0"),this.iframe.setAttribute("title",(null===(r=e.customStrings)||void 0===r?void 0:r.cardListTitle)||"Cards"),"modal-stream"===t&&(this.iframe.setAttribute("aria-hidden","true"),this.iframe.setAttribute("tabIndex","-1"),this.iframe.setAttribute("role","dialog"),this.iframe.setAttribute("aria-modal","true")),"ResizeObserver"in window){if(!document.querySelector(`#${fm}`)){const e=document.createElement("div");e.style.width="1rem",e.style.visibility="hidden",e.id=fm,document.body.appendChild(e)}this.resizeObserver=new ResizeObserver((e=>{var t,n;const r=null===(t=e[0])||void 0===t||null===(n=t.contentRect)||void 0===n?void 0:n.width;r&&this.iframe.contentWindow&&h("browser-font-changed",{fontSize:r},this.iframe.contentWindow)})),this.resizeObserver.observe(document.querySelector(`#${fm}`))}c.logLevel=v.logLevel,n?n.appendChild(this.iframe):document.body.appendChild(this.iframe),this.iframe.addEventListener("load",(()=>{this.iframeLoaded=!0,this.flushMessages()})),km(this.iframe,c),("single-card"===t&&!1!==(null===(i=e.enabledUiElements)||void 0===i?void 0:i.cardListToast)||"modal-stream"===t&&!1!==(null===(o=e.enabledUiElements)||void 0===o?void 0:o.cardListToast)||(null===(a=e.enabledUiElements)||void 0===a?void 0:a.customToastContainer)&&!1!==e.enabledUiElements.cardListToast)&&(this.toastIframe=document.createElement("iframe"),this.toastIframe.classList.add("atomic-sdk-frame"),this.toastIframe.classList.add("toast-container"),this.toastIframe.setAttribute("id","atomic-sdk-toast-container"),this.toastIframe.setAttribute("frameBorder","0"),"modal-stream"===t&&(this.toastIframe.style.zIndex=1e5.toString()),this.toastIframe.setAttribute("title","Toast messages"),this.toastIframe.setAttribute("role","presentation"),this.toastIframe.setAttribute("aria-hidden","true"),n?n.appendChild(this.toastIframe):document.body.appendChild(this.toastIframe),km(this.toastIframe,Object.assign(Object.assign({},c),{embedMode:"toast"}))),("single-card"===t||"standalone"===t&&((null===(s=e.horizontalContainerConfig)||void 0===s?void 0:s.enabled)||(null===(l=e.features)||void 0===l||null===(d=l.horizontalContainerConfig)||void 0===d?void 0:d.enabled)))&&(this.modalIframe=document.createElement("iframe"),this.modalIframe.classList.add("atomic-sdk-frame"),this.modalIframe.classList.add("modal-subview"),this.modalIframe.setAttribute("frameBorder","0"),this.modalIframe.setAttribute("role","presentation"),this.modalIframe.setAttribute("aria-hidden","true"),this.modalIframe.setAttribute("title","Empty Modal"),n?n.appendChild(this.modalIframe):document.body.appendChild(this.modalIframe),km(this.modalIframe,Object.assign(Object.assign({},c),{embedMode:"modal-subview"}))),window.addEventListener("message",this.onMessageReceived.bind(this))}onMessageReceived(e){return pm(this,void 0,void 0,(function*(){if(e.source===this.iframe.contentWindow||this.modalIframe&&e.source===this.modalIframe.contentWindow||this.toastIframe&&e.source===this.toastIframe.contentWindow)switch(e.data.action){case"io.atomic.events.cardCountChanged":{var t;this.config.onCardCountChanged&&this.config.onCardCountChanged(e.data.cardCount,e.data.totalCards);const n=Jp({cardCount:e.data.cardCount,streamContainerId:this.resolvedConfiguration.streamContainerId||"",endUserId:Cm.getCurrentUserId()});null===(t=Cm.sdkEventObserver)||void 0===t||t.call(Cm,n);break}case"io.atomic.events.ready":switch(this.config.embedMode){case"standalone":case"single-card":var n;this.appOpen=!(null===(n=this.config.features)||void 0===n?void 0:n.controlledContainerOpenState)&&!this.config.controlledContainerOpenState,this.updateAppOpen();break;case"modal-stream":this.appOpen=!1,this.updateAppOpen();break;case"launcher":this.iframe.tabIndex=-1,this.initLauncherButton()}break;case"io.atomic.events.resolveRuntimeVariables":this.handleRuntimeVariableResolution(e.data.requestId,e.data.cards,this.config.onRuntimeVariablesRequested||wm);break;case"io.atomic.events.linkButtonPressed":this.config.onLinkButtonPressed&&this.config.onLinkButtonPressed(e.data.payload);break;case"io.atomic.events.submitButtonPressed":this.config.onSubmitButtonPressed&&this.config.onSubmitButtonPressed(e.data.payload);break;case"io.atomic.events.didUpdateAppOpen":var r,i;if(this.appOpen=e.data.values.open,"launcher"===this.config.embedMode)this.updateVisibilityForLauncher(),null===(r=(i=this.resolvedConfiguration).onLauncherToggled)||void 0===r||r.call(i,this.appOpen);break;case"io.atomic.events.didUpdateModalStreamVisibility":const s=e=>{this.iframe.contains(e.target)||this.iframe.focus()};this.config.onModalStreamToggled&&this.config.onModalStreamToggled(e.data.visible),e.data.visible?(this.iframe.setAttribute("aria-hidden","false"),this.iframe.setAttribute("tabIndex","0"),this.iframe.focus(),document.addEventListener("focusin",s,!0)):(this.iframe.setAttribute("aria-hidden","true"),this.iframe.setAttribute("tabIndex","-1"),document.removeEventListener("focusin",s,!0));break;case"io.atomic.events.frameHeightChanged":this.config.onSizeChanged&&this.config.onSizeChanged(this.iframe.clientWidth,e.data.height);break;case"io.atomic.events.analyticsEventReceived":if(e.data.sdkOnlyEvent){var o;const t=this.analyticsQueue.createEventPayload(e.data.event,"standard");t&&(null===(o=Cm.sdkEventObserver)||void 0===o||o.call(Cm,Xp(t)))}else this.enqueueAnalyticsEvent(e.data.event);break;case"io.atomic.events.cardEventReceived":{this.config.onCardEvent&&this.config.onCardEvent(e.data.event);const t=((e,t)=>{const n=e.eventPayload?Object.assign({},e.eventPayload):null;if(!n)return null;switch(e.type){case"snoozed":n.eventName=Qp.cardSnoozed,n.analyticsEvent=Qp.cardSnoozed;break;case"dismissed":n.eventName=Qp.cardDismissed,n.analyticsEvent=Qp.cardDismissed;break;case"submitted":n.eventName=Qp.cardCompleted,n.analyticsEvent=Qp.cardCompleted;break;default:return null}return n.sdkContext={containerId:t},n})(e.data.event,e.data.streamContainerId);var a;if(t)Cm.cachedUserMetrics={},null===(a=Cm.sdkEventObserver)||void 0===a||a.call(Cm,t);break}case"io.atomic.events.errorReceived":Cm.onError&&Cm.onError(e.data.error);break;case"io.atomic.events.authTokenRequested":if(e.data.requestId&&Cm.onAuthTokenRequested){let t;try{t=yield Cm.handleTokenRequest(),this.sendMessageToIframe({action:"io.atomic.events.authTokenReceived",values:{requestId:e.data.requestId,authToken:t}},e.source)}catch(t){v.error({level3:["stream container requested auth token, error retrieving token",t]}),this.sendMessageToIframe({action:"io.atomic.events.authTokenError",values:{requestId:e.data.requestId,error:t instanceof Error?t.message:String(t)}})}}else console.error("The Atomic SDK requested an authentication token but no authentication callback has been set using `AtomicSDK.setSessionDelegate`. Use this method to set a callback resolving to a promise that supplies an authentication token");break;case"io.atomic.events.cardFeedSubscribeRequested":try{Zp.connectionAuthenticated||(yield Cm.handleTokenRequest({skipCache:!0,authWebSocket:!0})),Wp.subscribeToCardFeed([{subscriptionId:this.instanceId,streamContainerId:e.data.streamContainerId,filters:this.streamFilters.getFilterObject()}]),this.sendMessageToIframe({action:"io.atomic.events.cardFeedSubscriptionId",values:{subscriptionId:this.instanceId}})}catch(e){this.sendMessageToIframe({action:"io.atomic.events.feedSubscribeError",values:e instanceof Error?e.message:String(e)}),v.error({level1:["error sending card feed subscription request by WebSockets"],level2:[e]})}break;case"io.atomic.events.subscriptionRetryExceeded":Zp.close(zp.sdkClosedConnection,"Subscription retry exceeded"),Cm.authMessageResolve=()=>null,Cm.authMessageReject=()=>null;break;case"io.atomic.events.cardFeedUnsubscribeRequested":e.data.subscriptionId===this.instanceId&&(Wp.unsubscribeFromCardFeed([this.instanceId]),delete Cm.streamContainers[this.instanceId]);break;case"io.atomic.events.socketReconnectionRequested":Cm.createWebSocketConnection().catch((e=>{var t;this.sendMessageToIframe({action:E,values:null!==(t=e.message)&&void 0!==t?t:e})}));break;case"io.atomic.events.socketConnectionHealthcheck":Zp.connectionHealthCheck()}}))}enqueueAnalyticsEvent(e){return pm(this,void 0,void 0,(function*(){const t=yield this.analyticsQueue.enqueue(e,"standard","authenticated");if(t){var n;Wp.sendAnalyticsMessage([t]);const e=Xp(t);null===(n=Cm.sdkEventObserver)||void 0===n||n.call(Cm,e)}Cm.containersBroadcastChannel?Cm.containersBroadcastChannel.postMessage({type:Us.ANALYTICS_EVENT,eventQueued:e}):v.error({level1:["BroadcastChannel API unavailable"]})}))}updateVisibilityForLauncher(){var e;this.appOpen?(this.iframe.className+=" open",this.iframe.tabIndex=0,this.iframe.focus(),document.addEventListener("click",this.outsideClickListener)):(this.iframe.className=this.iframe.className.replace(" open",""),this.iframe.tabIndex=-1,null===(e=this.launchButtonIconContainer)||void 0===e||e.focus(),document.removeEventListener("click",this.outsideClickListener));this.launchButtonIconContainer&&(this.launchButtonIconContainer.innerHTML=this.getIcon(this.appOpen))}handleRuntimeVariableResolution(e,t,n){n(t.map((e=>Object.assign(Object.assign({},e),{runtimeVariables:new Map(e.runtimeVariables)}))),(n=>{let r=t;if(Array.isArray(n))if(n.length!==t.length)console.error(`The number of cards returned from the runtime variable resolver (${n.length}) is not equal to the cards provided (${t.length}).`);else{n.every((e=>{if(!(e.runtimeVariables instanceof Map))return!1;for(const t of e.runtimeVariables)if("string"!=typeof t[0]||"string"!=typeof t[1])return!1;return!0}))?r=n:console.error("One or more runtime variables have been resolved to non-string types. Runtime variables can only be resolved to strings currently.")}else console.error("Incorrect type returned when resolving runtime variables - an array of cards was expected.");const i={action:"didResolveRuntimeVariables",values:{cards:r.map((e=>Object.assign(Object.assign({},e),{runtimeVariables:Array.from(e.runtimeVariables.entries())}))),requestId:e}};this.sendMessageToIframe(i)}))}sendMessageToIframe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.iframe.contentWindow;t&&(this.iframeLoaded?t.postMessage(e,this.getWindowOrigin()):this.queuedMessages.push(e))}flushMessages(){const e=this.iframe.contentWindow;e&&(this.queuedMessages.forEach((t=>e.postMessage(t,this.getWindowOrigin()))),this.queuedMessages=[])}getWindowOrigin(){var e,t;return(null===(e=this.resolvedConfiguration.features)||void 0===e||null===(t=e.cordova)||void 0===t?void 0:t.enabled)?"*":`${window.location.protocol}//${window.location.host}`}}class Im{constructor(e,n,r){if(mm(this,"resolvedConfiguration",void 0),mm(this,"instanceId",void 0),mm(this,"streamFilters",new fp((()=>{v.debug({level1:[`applied stream filter for stream container: ${this.instanceId}`],level2:[this.streamFilters.getFilterObject()]}),this.sendWebSocketFeedSubscriptionMessage()}),(()=>{v.debug({level1:[`cleared stream filter for stream container: ${this.instanceId}`]}),this.sendWebSocketFeedSubscriptionMessage()}))),mm(this,"analyticsQueue",void 0),mm(this,"pollCounter",0),mm(this,"pollTimer",void 0),mm(this,"store",void 0),mm(this,"boundActions",void 0),mm(this,"tokenProvider",{requestToken:()=>pm(this,void 0,void 0,(function*(){return yield Cm.handleTokenRequest()}))}),"string"!=typeof e.streamContainerId||0===e.streamContainerId.trim().length)throw new Error("Failed to start stream container. You must pass a `streamContainerId` when instantiating a stream container.");{if(!Cm.onAuthTokenRequested)throw new Error("You must use `AtomicSDK.setSessionDelegate` to set a callback resolving to a promise that supplies an authentication token before attempting to create a stream container.");let i=Object.assign(Object.assign({},e),n),o=i.cardListRefreshInterval;i.cardListRefreshInterval=null!=o?0==o?0:Math.max(1e3,o):void 0;let a=i.runtimeVariableResolutionTimeout;i.runtimeVariableResolutionTimeout=null!=a?Math.max(0,a):void 0,this.resolvedConfiguration=i,this.instanceId=u(),this.store=((e,t)=>{var n,r,i;let{streamContainerId:o,instanceId:a,windowOrigin:s,subviewCardInstance:l,startingLayoutId:d,cardInstances:c,cardListRefreshInterval:u,runtimeVariableResolutionTimeout:h,embedMode:p,customStrings:m,cardListTutorialSeen:g,features:v,firstLoadStyles:f,enabledUiElements:k,interfaceStyle:C,horizontalContainerConfig:x,cardMinimumHeight:I,cardMaximumWidth:O,cardHorizontalAlignment:M,modalContainerPositioning:N,modalContainerVerticalPadding:T}=e;const F=t&&t.length?(0,S.m)(...t):null,A="preview"===p,L=null==v?void 0:v.runtimeVariableAnalytics;return w=b()(Object.assign(Object.assign({},y),{application:Object.assign(Object.assign({},y.application),{isPreview:A,streamContainerId:void 0!==o?o:y.application.streamContainerId,containerInstanceId:void 0!==a?a:y.application.containerInstanceId,windowOrigin:s||y.application.windowOrigin,cardListRefreshInterval:void 0!==u?u:y.application.cardListRefreshInterval,runtimeVariableResolutionTimeout:void 0!==h?h:y.application.runtimeVariableResolutionTimeout,embedMode:p,customStrings:m||y.application.customStrings,cardLimit:"single-card"===p||"modal-stream"===p?1:void 0,firstLoadStyles:{backgroundColor:(null==f?void 0:f.backgroundColor)||y.application.firstLoadStyles.backgroundColor,textColor:(null==f?void 0:f.textColor)||y.application.firstLoadStyles.textColor,loadingSpinnerColor:(null==f?void 0:f.loadingSpinnerColor)||y.application.firstLoadStyles.loadingSpinnerColor,buttonTextColor:(null==f?void 0:f.buttonTextColor)||y.application.firstLoadStyles.buttonTextColor},enabledUiElements:{cardListToast:null===(n=null==k?void 0:k.cardListToast)||void 0===n||n,customToastContainer:null!==(r=null==k?void 0:k.customToastContainer)&&void 0!==r&&r,toastConfig:null==k?void 0:k.toastConfig,cardListHeader:null===(i=null==k?void 0:k.cardListHeader)||void 0===i||i,customContainerHeader:null==k?void 0:k.customContainerHeader},interfaceStyle:void 0!==C?C:"automatic"}),navigationStack:{items:l&&d?[{cardInstance:l,cardInstanceId:l.instance.id,subviewId:d,kind:"subview"}]:y.navigationStack.items},cardFeed:Object.assign(Object.assign({},y.cardFeed),{cardInstances:c||y.cardFeed.cardInstances,tutorialSeen:void 0===g||g,runtimeVariableAnalyticsEnabled:void 0!==L&&L,cardVoting:null==v?void 0:v.cardVoting,cardMaximumWidth:Th(O),cardMinimumHeight:null!=I?I:null==v?void 0:v.cardMinimumHeight,cardHorizontalAlignment:M,horizontalContainerConfig:null!=x?x:null==v?void 0:v.horizontalContainerConfig,modalContainerPositioning:N,modalContainerVerticalPadding:Th(T)})}),F),w})(Object.assign(Object.assign({},i),{embedMode:"headless"})),this.boundActions=(0,t.kv)((0,t.Y2)(Zt,ls),this.store),this.analyticsQueue=r}}start(){if(!this.resolvedConfiguration.apiHost||!this.resolvedConfiguration.apiKey||!this.resolvedConfiguration.environmentId)return v.error({level1:["The Atomic SDK must be initialized before launching an observable stream container. Call `AtomicSDK.initialise` to configure the API host, API key and environment ID."]});v.debug({level3:[`Starting card feed updates for observable stream container: ${this.instanceId}`]}),Cm.streamContainers[this.instanceId]||(Cm.streamContainers[this.instanceId]={sendMessageToIframe:e=>this.onMessageReceived(e),logout:()=>{this.onMessageReceived({action:C})},embedMode:"headless"}),this.resolvedConfiguration.webSocketDisabled?this.pollCardFeed():Wp.activeSubscriptions[this.instanceId]||this.sendWebSocketFeedSubscriptionMessage()}stop(){v.debug({level3:[`Stopping card feed updates for observable stream container: ${this.instanceId}`]}),Wp.activeSubscriptions[this.instanceId]&&Wp.unsubscribeFromCardFeed([this.instanceId]),this.cancelCardListPolling(),delete Cm.streamContainers[this.instanceId]}pollCardFeed(){return pm(this,void 0,void 0,(function*(){var e,t;const n=this.store.getState(),r=n.cardFeed,i=yield rs(n.application.streamContainerId,this.tokenProvider,n.application.runtimeVariableResolutionTimeout,n.cardFeed.lastModified,this.runtimeVariableResolver.bind(this),void 0,this.streamFilters.getFilterObject());this.trackCardCountChange(r,i),this.boundActions.cardFeedLoaded(i),this.boundActions.runtimeVariableReplacement(),this.resolvedConfiguration.cardFeedHandler(null!==(e=this.store.getState().cardFeed.cardInstances)&&void 0!==e?e:[]),0!==this.resolvedConfiguration.cardListRefreshInterval&&(this.pollTimer=setTimeout((()=>{clearTimeout(this.pollTimer),this.resolvedConfiguration.webSocketDisabled?this.pollCardFeed():this.pollCounter<9?(this.pollCounter++,this.pollCardFeed()):(this.pollCounter=0,this.pollTimer=null,v.debug({level3:["Attempt to reconnect websocket initiated"]}),Cm.createWebSocketConnection().catch((e=>{var t;v.debug({level3:["Error reconnecting websocket",e]}),null===(t=Cm.onError)||void 0===t||t.call(Cm,e)})))}),null!==(t=this.resolvedConfiguration.cardListRefreshInterval)&&void 0!==t?t:y.application.cardListRefreshInterval))}))}cancelCardListPolling(){this.pollTimer&&(clearTimeout(this.pollTimer),v.debug({level3:[`Observable stream container ${this.instanceId}, card feed polling cancelled`]})),this.pollTimer=null,this.pollCounter=0}sendWebSocketFeedSubscriptionMessage(){try{Wp.subscribeToCardFeed([{subscriptionId:this.instanceId,streamContainerId:this.resolvedConfiguration.streamContainerId||"",filters:this.streamFilters.getFilterObject()}])}catch(e){v.error({level1:["Unable to subscribe observable stream container to card feed updates via WebSocket."],level2:[`Container instance: ${this.instanceId}.`]})}}handleCardFeedUpdate(e){return pm(this,void 0,void 0,(function*(){var t,n;const r=this.store.getState(),i=r.cardFeed;let o;const a=e.filter((e=>("replace-feed"===e.type&&(o=e),"replace-feed"!==e.type)));if(o){const{instances:e,totalCards:n}=o.data.cardInstances,a=yield ss(e,r.application.runtimeVariableResolutionTimeout,this.runtimeVariableResolver.bind(this)),s={cardInstances:e,unfilteredCardInstanceCount:e.length,runtimeVariables:a,metadata:{totalCards:n},lastModified:void 0};this.trackCardCountChange(i,s),this.boundActions.cardFeedLoaded(s),this.boundActions.runtimeVariableReplacement(),this.resolvedConfiguration.cardFeedHandler(null!==(t=this.store.getState().cardFeed.cardInstances)&&void 0!==t?t:[])}if(a.length){const e=e=>pm(this,void 0,void 0,(function*(){if(e){const e=yield(t=r.application.streamContainerId,n=this.tokenProvider,ts(void 0,void 0,void 0,(function*(){const e=yield cp.get(`feed/${t}`,n,void 0,{streamContainerId:t});var r,i;return 200===e.response.status&&e.data&&e.data.metadata?{cardCount:null===(r=e.data.cardInstances)||void 0===r?void 0:r.length,totalCards:null===(i=e.data.metadata)||void 0===i?void 0:i.totalCards,lastModified:e.response.etag}:{error:e.response.error}})));if(e.error)v.error({level1:["error retrieving total card count after card feed updated"],level2:[e.error]});else{const{totalCards:t,lastModified:n}=e;t&&this.boundActions.updateTotalCardCount(t,n),this.trackCardCountChange(i,this.store.getState().cardFeed)}}var t,n})),t=e=>pm(this,void 0,void 0,(function*(){return yield ss(e,r.application.runtimeVariableResolutionTimeout,this.runtimeVariableResolver.bind(this))}));yield this.boundActions.applyCardFeedDeltaUpdate(a,e,t),this.boundActions.runtimeVariableReplacement(),this.resolvedConfiguration.cardFeedHandler(null!==(n=this.store.getState().cardFeed.cardInstances)&&void 0!==n?n:[])}}))}trackCardCountChange(e,t){var n,r,i,o,a;const s=e.cardInstances.map((e=>e.instance.id)),l=(null==t||null===(i=t.cardInstances)||void 0===i?void 0:i.map((e=>e.instance.id)))||[],d=(null===(o=e.metadata)||void 0===o?void 0:o.totalCards)||0,c=(null===(a=t.metadata)||void 0===a?void 0:a.totalCards)||0;if(!Yh(s,l)||d!==c){var u,h,p;if(this.resolvedConfiguration.onCardCountChanged)this.resolvedConfiguration.onCardCountChanged(null!==(n=null===(p=t.cardInstances)||void 0===p?void 0:p.length)&&void 0!==n?n:0,c);const e=Jp({cardCount:null!==(r=null===(u=t.cardInstances)||void 0===u?void 0:u.length)&&void 0!==r?r:0,streamContainerId:this.resolvedConfiguration.streamContainerId||"",endUserId:Cm.getCurrentUserId()});null===(h=Cm.sdkEventObserver)||void 0===h||h.call(Cm,e)}}runtimeVariableResolver(e){const t=this.resolvedConfiguration.onRuntimeVariablesRequested||wm;return new Promise((n=>{t(e.map((e=>Object.assign(Object.assign({},e),{runtimeVariables:new Map(e.runtimeVariables)}))),(t=>{let r=e;if(Array.isArray(t))if(t.length!==e.length)console.error(`The number of cards returned from the runtime variable resolver (${t.length}) is not equal to the cards provided (${e.length}).`);else{t.every((e=>{if(!(e.runtimeVariables instanceof Map))return!1;for(const t of e.runtimeVariables)if("string"!=typeof t[0]||"string"!=typeof t[1])return!1;return!0}))?r=t:console.error("One or more runtime variables have been resolved to non-string types. Runtime variables can only be resolved to strings currently.")}else console.error("Incorrect type returned when resolving runtime variables - an array of cards was expected.");n(r)}))}))}sendAnalyticsEvent(e){var t=arguments;return pm(this,void 0,void 0,(function*(){let n=t.length>1&&void 0!==t[1]&&t[1];Zp.connectionHealthCheck();const r=this.store.getState(),i=r.cardFeed.cardInstances||[],o=i.filter((t=>t.instance.id===e.cardInstanceId)),a=o.length?o[0]:null,s=a?i.indexOf(a)+1:0;let l;try{l=yield this.tokenProvider.requestToken()}catch(e){v.error({level1:["Error requesting auth token to send analytics event"],level2:[e]})}const d=Object.assign(Object.assign({},e),{endUserId:Gh(l,cp.tokenUserIdAttribute)||"",cardInstanceStatus:a?a.instance.status:"",containerId:r.application.streamContainerId,timestamp:new Date,streamCardPosition:s,streamLength:r.cardFeed.unfilteredCardInstanceCount,streamLengthVisible:i.length});let c;if(n?c=this.analyticsQueue.createEventPayload(d,"standard"):(c=this.analyticsQueue.enqueue(d,"standard","authenticated"),Wp.sendAnalyticsMessage([c])),c){var u;const e=Xp(c);null===(u=Cm.sdkEventObserver)||void 0===u||u.call(Cm,e)}}))}updateVariables(){return pm(this,void 0,void 0,(function*(){var e,t;const n=this.store.getState(),r=yield rs(n.application.streamContainerId,this.tokenProvider,n.application.runtimeVariableResolutionTimeout,"",this.runtimeVariableResolver.bind(this),void 0,this.streamFilters.getFilterObject());r.error&&v.error({level1:["error retrieving card feed for runtime variable update"],level2:[r.error]});const i=yield ss(null!==(e=r.cardInstances)&&void 0!==e?e:[],n.application.runtimeVariableResolutionTimeout,this.runtimeVariableResolver.bind(this));this.boundActions.cardFeedLoaded(r),this.boundActions.runtimeVariableReplacement(i),this.resolvedConfiguration.cardFeedHandler(null!==(t=this.store.getState().cardFeed.cardInstances)&&void 0!==t?t:[]),n.cardFeed.cardInstances.forEach((e=>{var t;if(null===(t=e.runtimeVariables)||void 0===t?void 0:t.length){var r;const t=null===(r=n.cardFeed.runtimeVariables.values)||void 0===r?void 0:r.get(e.instance.id);this.sendAnalyticsEvent({cardInstanceId:e.instance.id,cardViewState:"topview",eventName:mt,properties:{resolvedVariables:e.runtimeVariables.reduce(((e,n)=>(e[n.name]=(null==t?void 0:t.get(n.name))||"",e)),{})}},!1===n.cardFeed.runtimeVariableAnalyticsEnabled)}}))}))}onMessageReceived(e){switch(e.action){case F:const t=e.values.cardFeedUpdates;this.handleCardFeedUpdate(t);break;case A:void 0===this.pollTimer&&this.pollCardFeed();break;case L:this.cancelCardListPolling();break;case C:this.stop();break;default:v.debug({level3:["Unknown message received by headless stream container: ",e.data]})}}}})(),r=r.default})()));
|