@atomic.io/action-cards-web-sdk-cdn-icons 25.2.2 → 25.2.3

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/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 25.2.2
4
+ * Atomic Web SDK 25.2.3
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/25.2.2/LICENSES.txt.
7
+ * see https://downloads.atomic.io/web-sdk/release/25.2.3/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),o=n(2337);e.exports=function(e){return function(t,n,a){var s,l=r(t),c=i(l.length),d=o(a,c);if(e&&n!=n){for(;c>d;)if((s=l[d++])!=s)return!0}else for(;c>d;d++)if((e||d in l)&&l[d]===n)return e||d||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",c=function(e,t,n){var d,u,h,p,m=e&c.F,g=e&c.G,v=e&c.S,f=e&c.P,b=e&c.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(d in g&&(n=t),n)h=((u=!m&&y&&void 0!==y[d])?y:n)[d],p=b&&u?s(h,r):f&&"function"==typeof h?s(Function.call,h):h,y&&a(y,d,h,e&c.U),w[d]!=h&&o(w,d,p),f&&S[d]!=h&&(S[d]=h)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},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),c=n(2943),d=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,k,C=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,M=T[u]||T["@@iterator"]||f&&T[f],F=M||C(f),j=f?I?C("entries"):F:void 0,D="Array"==t&&T.entries||M;if(D&&(k=d(D.call(new e)))!==Object.prototype&&k.next&&(c(k,x,!0),r||"function"==typeof k[u]||a(k,u,g)),I&&M&&M.name!==m&&(O=!0,F=function(){return M.call(this)}),r&&!y||!h&&!O&&T[u]||a(T,u,F),s[t]=F,s[x]=g,f)if(w={values:I?F:C(m),keys:b?F:C(p),entries:j},y)for(S in w)S in T||o(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),o=n(4430),a=n(9335)("IE_PROTO"),s=function(){},l="prototype",c=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(),c=e.F;r--;)delete c[l][o[r]];return c()};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=c(),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,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~o(c,n)||c.push(n));return c}},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",c=(""+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]:c.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),c=n(6314),d=c("iterator"),u=c("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=a[f],w=y&&y.prototype;if(w&&(w[d]||s(w,d,h),w[u]||s(w,u,f),l[f]=h,b))for(v in r)w[v]||o(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),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}",""]);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 c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},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),c=Math.abs(i(n,s));return n=a(n,l*c),l*(c-(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 c=n||{},d=r(e,t),u=c.locale,h=s.distanceInWords.localize;u&&u.distanceInWords&&u.distanceInWords.localize&&(h=u.distanceInWords.localize);var p,m,g={addSuffix:Boolean(c.addSuffix),comparison:d};d>0?(p=i(e),m=i(t)):(p=i(t),m=i(e));var v,f=o(m,p),b=m.getTimezoneOffset()-p.getTimezoneOffset(),y=Math.round(f/60)-b;if(y<2)return c.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=a(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),o=n(7977),a=n(7479),s=525600;e.exports=function(e,t,n){var l=n||{},c=r(e,t),d=l.locale,u=a.distanceInWords.localize;d&&d.distanceInWords&&d.distanceInWords.localize&&(u=d.distanceInWords.localize);var h,p,m,g={addSuffix:Boolean(l.addSuffix),comparison:c};c>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(),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),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 c={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(c.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 d(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]]||c[o[r]],o[r]=i||d(o[r]);return function(e){for(var t="",n=0;n<a;n++)o[n]instanceof Function?t+=o[n](e,c):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 c=(l>a?a:l)-(s<o?o:s);return Math.ceil(c/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."],c={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){c[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:c,formattingTokensRegExp:r(c)}}},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=/:/,c=/^(\d{2})$/,d=[/^([+-]\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+-].*)$/,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=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=d[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=c.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),M=T.year,F=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}(T.restDateString,M);if(F){var j,D=F.getTime(),A=0;if(O.time&&(A=function(e){var t,n,r;if(t=b.exec(e))return(n=parseFloat(t[1].replace(",",".")))%24*o;if(t=y.exec(e))return n=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),n%24*o+r*a;if(t=w.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)j=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 _=D+A,E=new Date(_);j=r(E);var L=new Date(_);L.setDate(E.getDate()+1);var H=r(L)-r(E);H>0&&(j+=H)}return new Date(D+A+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 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 c=i(l);return n.setMonth(o,Math.min(s,c)),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:()=>w,Fragment:()=>y,_unmount:()=>E,cloneElement:()=>R,createContext:()=>V,createElement:()=>v,createRef:()=>b,h:()=>v,hydrate:()=>P,isValidElement:()=>i,options:()=>r,render:()=>H,toChildArray:()=>O});var r,i,o,a,s,l,c,d,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 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 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=j(s,o,r,t.__n,void 0!==s.ownerSVGElement,null,n,null==a?S(o):a),D(n,o),i!=a&&k(o)))}))}function I(e,t,n,r,i,o,a,s,l){var c,d,p,m,v,f,b,y=n&&n.__k||h,w=y.length;if(s==u&&(s=null!=o?o[0]:w?S(n,0):null),c=0,t.__k=O(t.__k,(function(n){if(null!=n){if(n.__=t,n.__b=t.__b+1,null===(p=y[c])||p&&n.key==p.key&&n.type===p.type)y[c]=void 0;else for(d=0;d<w;d++){if((p=y[d])&&n.key==p.key&&n.type===p.type){y[d]=void 0;break}p=null}if(m=j(e,n,p=p||u,r,i,o,a,s,l),(d=n.ref)&&p.ref!=d&&(b||(b=[]),p.ref&&b.push(p.ref,null,n),b.push(d,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,d=0;(v=v.nextSibling)&&d<w;d+=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 c++,n})),t.__e=f,null!=o&&"function"!=typeof t.type)for(c=o.length;c--;)null!=o[c]&&g(o[c]);for(c=w;c--;)null!=y[c]&&E(y[c],y[c]);if(b)for(c=0;c<b.length;c++)_(b[c],b[++c],b[++c])}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 M(e,t,n,r,i){var o,a,s,l,c;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||T(o,l,"");if(n)for(c in n)r&&n[c]===r[c]||T(o,c,n[c])}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,F,a),(e.l||(e.l={}))[t]=n):e.removeEventListener(t,F,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 F(e){this.l[e.type](r.event?r.event(e):e)}function j(e,t,n,i,o,a,s,l,c){var d,u,h,p,g,v,f,b,S,k,C=t.type;if(void 0!==t.constructor)return null;(d=r.__b)&&d(t);try{e:if("function"==typeof C){if(b=t.props,S=(d=C.contextType)&&i[d.__c],k=d?S?S.props.value:d.__: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 w(b,k),u.constructor=C,u.render=L),S&&S.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),d=0;d<t.__k.length;d++)t.__k[d]&&(t.__k[d].__=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,(d=r.__r)&&d(t),u.__d=!1,u.__v=t,u.__P=e,d=u.render(u.props,u.state,u.context),t.__k=null!=d&&d.type==y&&null==d.key?d.props.children:Array.isArray(d)?d:[d],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,c),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=A(n.__e,t,n,i,o,a,s,c);(d=r.diffed)&&d(t)}catch(e){t.__v=null,r.__e(e,t,n)}return t.__e}function D(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 A(e,t,n,r,i,o,a,s){var l,c,d,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!=(c=o[l])&&((null===t.type?3===c.nodeType:c.localName===t.type)||e==c)){e=c,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)),d=(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||d)&&(p&&d&&p.__html==d.__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||M(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]||M(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&&M(e,"value",l,g.value,!1),"checked"in v&&void 0!==(l=v.checked)&&l!==e.checked&&M(e,"checked",l,g.checked,!1))}return e}function _(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){r.__e(e,n)}}function E(e,t,n){var i,o,a;if(r.unmount&&r.unmount(e),(i=e.ref)&&(i.current&&i.current!==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]&&E(i[a],t,n);null!=o&&g(o)}function L(e,t,n){return this.constructor(e,n)}function H(e,t,n){var i,o,a;r.__&&r.__(e,t),o=(i=n===c)?null:n&&n.__k||t.__k,e=v(y,null,[e]),a=[],j(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),D(a,e)}function P(e,t){H(e,t,c)}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 V(e){var t={},n={__c:"__cC"+d++,__: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},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),C(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},w.prototype.render=y,o=[],a=0,s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=u,d=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 c=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),d=c;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=c},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()},5877:(e,t,n)=>{var r=n(3570),i=n(1171),o=i;o.v1=r,o.v4=i,e.exports=o},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,o=n(5217),a=n(5327),s=0,l=0;e.exports=function(e,t,n){var c=t&&n||0,d=t||[],u=(e=e||{}).node||r,h=void 0!==e.clockseq?e.clockseq:i;if(null==u||null==h){var p=o();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;d[c++]=f>>>24&255,d[c++]=f>>>16&255,d[c++]=f>>>8&255,d[c++]=255&f;var b=m/4294967296*1e4&268435455;d[c++]=b>>>8&255,d[c++]=255&b,d[c++]=b>>>24&15|16,d[c++]=b>>>16&255,d[c++]=h>>>8|128,d[c++]=255&h;for(var y=0;y<6;++y)d[c+y]=u[y];return t||a(d)}},1171:(e,t,n)=>{var r=n(5217),i=n(5327);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[o+s]=a[s];return t||i(a)}},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:()=>Ru});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 o=n(7292),a=n(4798),s=n.n(a),l=n(1042);const c={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 d;const u=()=>{if(!d)throw new Error("You must initialise the store before accessing it.");return d},h="io.atomic.events.sdkLogout",p="YYYY-MM-DD[T]HH:mm:ssZZ",m=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,g="io.atomic.events.cardFeedUpdateReceived",v="io.atomic.events.pollingFallbackEnabled",f="io.atomic.events.pollingFallbackDisabled",b="io.atomic.events.socketAuthenticationError",y="io.atomic.events.streamFilterApplied",w="sdkInitialisation",S="displayedCards",k="cardDescription",C="headline",x="text",I="list",O="image",T="video",M="textInput",F="numberInput",j="datePicker",D="dropdown",A="checkbox",_="stepper",E="switch",L="upload",H="form",P="actionButtonGroup",R="submitButton",V="linkButton",$="dismissButton",N="snoozeButton",z="voteUpButton",W="voteDownButton";var U,q,B,Y=n(6400),K=0,Z=[],Q=Y.options.__r,G=Y.options.diffed,X=Y.options.__c,J=Y.options.unmount;function ee(e,t){Y.options.__h&&Y.options.__h(q,e,K||t),K=0;var n=q.__H||(q.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function te(e){return K=1,ne(pe,e)}function ne(e,t,n){var r=ee(U++,2);return r.__c||(r.__c=q,r.__=[n?n(t):pe(void 0,t),function(t){var n=e(r.__[0],t);r.__[0]!==n&&(r.__[0]=n,r.__c.setState({}))}]),r.__}function re(e,t){var n=ee(U++,3);!Y.options.__s&&he(n.__H,t)&&(n.__=e,n.__H=t,q.__H.__h.push(n))}function ie(e,t){var n=ee(U++,4);!Y.options.__s&&he(n.__H,t)&&(n.__=e,n.__H=t,q.__h.push(n))}function oe(e){return K=5,se((function(){return{current:e}}),[])}function ae(e,t,n){K=6,ie((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))}function se(e,t){var n=ee(U++,7);return he(n.__H,t)?(n.__H=t,n.__h=e,n.__=e()):n.__}function le(e){var t=q.context[e.__c],n=ee(U++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(q)),t.props.value):e.__}function ce(){Z.some((function(e){if(e.__P)try{e.__H.__h.forEach(de),e.__H.__h.forEach(ue),e.__H.__h=[]}catch(t){return e.__H.__h=[],Y.options.__e(t,e.__v),!0}})),Z=[]}function de(e){e.t&&e.t()}function ue(e){var t=e.__();"function"==typeof t&&(e.t=t)}function he(e,t){return!e||t.some((function(t,n){return t!==e[n]}))}function pe(e,t){return"function"==typeof t?t(e):t}Y.options.__r=function(e){Q&&Q(e),U=0,(q=e.__c).__H&&(q.__H.__h.forEach(de),q.__H.__h.forEach(ue),q.__H.__h=[])},Y.options.diffed=function(e){G&&G(e);var t=e.__c;if(t){var n=t.__H;n&&n.__h.length&&(1!==Z.push(t)&&B===Y.options.requestAnimationFrame||((B=Y.options.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);"undefined"!=typeof window&&(t=requestAnimationFrame(n))})(ce))}},Y.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(de),e.__h=e.__h.filter((function(e){return!e.__||ue(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Y.options.__e(n,e.__v)}})),X&&X(e,t)},Y.options.unmount=function(e){J&&J(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){Y.options.__e(e,t.__v)}}};var me=n(5576);const ge=()=>({handleSubviewLinkPress:(e,t,n)=>ve(e,t,n),finishSubview:e=>fe(e),viewMedia(e,t,n){if(e.application.isPreview)return e;if(!n||!n.url||0===n.url.trim().length)return e;return we(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({},Se(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 we(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 we(e,r)}}),ve=(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 we(e,t)}}return e},fe=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 be;const ye=()=>(be||(be=(0,e.kv)((0,e.Y2)(ge),u())),be),we=(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]}})},Se=e=>{const t=e.navigationStack.items.slice();return t.pop(),Object.assign(Object.assign({},e),{navigationStack:{items:t}})},ke=e=>e.navigationStack.items.length?e.navigationStack.items[e.navigationStack.items.length-1]:null;function Ce(e){return void 0!==e&&"subview"===e.kind}function xe(e){return void 0!==e&&"snooze"===e.kind}function Ie(e){return void 0!==e&&"feedback"===e.kind}function Oe(e){return void 0!==e&&"media"===e.kind}var Te=n(2807),Me=n.n(Te);const Fe=e=>Object.keys(e).filter((t=>e[t])).join(" "),je=(e,t)=>{const n=((e,t)=>Me()(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},De=(e,t)=>{let{isMax:n,isMin:r}=t;const i=new Date(e);return n?(0,o.endOfDay)((0,o.addMinutes)(i,i.getTimezoneOffset())):r?(0,o.addMinutes)(i,i.getTimezoneOffset()):i};var Ae=n(5616),_e=n.n(Ae),Ee=n(623),Le=n.n(Ee);const He={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`},Pe={required:(e,t)=>{const n=e.errorMessage||He.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=De(e.minimumDate,{isMin:!0}),r=e.errorMessage||He.minimumDate(_e()(n,"DD MMM YYYY"));if(null==t||null==t)return{type:"invalid",errorMessage:r};const i=new Date(t);return!Le()(i)||i<n?{type:"invalid",errorMessage:r}:{type:"valid"}},maximumDate:(e,t)=>{const n=De(e.maximumDate,{isMax:!0}),r=e.errorMessage||He.maximumDate(_e()(n,"DD MMM YYYY"));if(null==t||null==t)return{type:"invalid",errorMessage:r};const i=new Date(t);return!Le()(i)||i>n?{type:"invalid",errorMessage:r}:{type:"valid"}},regexp:(e,t)=>{const n=e.errorMessage||He.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||He.minimum(e.minimum);return null==t||null==t||t<e.minimum?{type:"invalid",errorMessage:n}:{type:"valid"}},maximum:(e,t)=>{const n=e.errorMessage||He.maximum(e.maximum);return null==t||null==t||t>e.maximum?{type:"invalid",errorMessage:n}:{type:"valid"}},minimumLength:(e,t)=>{const n=e.errorMessage||He.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||He.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||He.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||He.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"}}},Re=["required","minimumLength","maximumLength","minimum","maximum","minimumDate","maximumDate","minChecked","maxChecked","maxSizeBytes","regexp"],Ve=(e,t)=>{if(!t)return{type:"valid"};for(const n in Re){const r=Re[n],i=t[r];if(void 0===i)continue;const o=Pe[r];if(o){const t=o(i.attributes,e);if("invalid"===t.type)return t}}return{type:"valid"}},$e=()=>({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?ve(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 o=e.navigationStack.items.length?"subview":"topview";return r?ve(e,t,r):i&&!e.application.isPreview?ze(e,"payload","linkButton",t,o,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,o,a)=>(null==a?void 0:a.url)&&!e.application.isPreview?We(e,i,o,t,n,a,r):e,handleFormChange:(e,t,n,r,i)=>Ne(e,t,{[n]:r},i),createResponseWithDefaults:(e,t,n,r)=>Ne(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,c;let d=Ve(r,i);const u=d&&!o?{[n]:d}:{},h=d&&o?{[n]:d}:{},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===(c=p[t])||void 0===c?void 0:c.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 c=r&&!i?{[n]:r}:{},d=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),c),subviews:Object.assign(Object.assign({},p),d&&i?{[i]:Object.assign(Object.assign({},p[i]),d)}:{})}})})},validateCurrentSubview(e,t){const n=ke(e);if(n&&Ce(n)){const r=n.subviewId,i=n.cardInstance.subviews[r],o=Ue(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=Ue(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})})})}}),Ne=(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)}:{})}})})},ze=(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}}:{})}),We=(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}}),Ue=(e,t,n,r)=>{var i;const o=Zc(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]=Ve(a[t.attributes.name],t.validations))}return s};let qe;const Be=()=>(qe||(qe=(0,e.kv)((0,e.Y2)($e),u())),qe),Ye=(e,t,n)=>{var r,i;const o=u().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===(c=l[n])||void 0===c?void 0:c[t]:void 0;var s,l,c};function Ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ze;!function(e){e[e.DISABLED=0]="DISABLED",e[e.TRANSACTIONS=1]="TRANSACTIONS",e[e.PAYLOAD=2]="PAYLOAD",e[e.FULL_DETAIL=3]="FULL_DETAIL"}(Ze||(Ze={}));class Qe{static debug(e){Qe.logLevel!==Ze.DISABLED&&(e.level1||e.level2||e.level3)&&console.log(...this.constructLogPayload(e))}static warn(e){Qe.logLevel!==Ze.DISABLED&&(e.level1||e.level2||e.level3)&&console.warn(...this.constructLogPayload(e))}static error(e){Qe.logLevel!==Ze.DISABLED&&(e.level1||e.level2||e.level3)&&console.error(...this.constructLogPayload(e))}}Ke(Qe,"logLevel",Ze.DISABLED),Ke(Qe,"constructLogPayload",(e=>{const t=["AtomicSDK Web -"];return Qe.logLevel>=Ze.TRANSACTIONS&&e.level1&&t.push(...e.level1),Qe.logLevel>=Ze.PAYLOAD&&e.level2&&t.push(...e.level2),Qe.logLevel>=Ze.FULL_DETAIL&&e.level3&&t.push(...e.level3),t}));const Ge="sdk-initialized",Xe="card-displayed",Je="user-redirected",et="card-voted-up",tt="card-voted-down",nt="runtime-vars-updated",rt="stream-displayed",it="snooze-options-displayed",ot="snooze-options-canceled",at="card-subview-displayed",st="card-subview-exited",lt="request-failed",ct="video-played",dt="video-completed",ut="notification-received",ht="user-file-uploads-started",pt="user-file-uploads-completed",mt="user-file-uploads-failed";var gt=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())}))},vt=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 ft(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bt="AACUploadFailedError",yt="AACUploadSignedUrlFailedError",wt="AACNoFileToUploadError",St="AACUploadCancelledError",kt="Couldn't upload file(s)",Ct="Couldn't upload file(s)",xt="No files to upload",It="File upload cancelled";class Ot{constructor(){ft(this,"_fileStorage",void 0),ft(this,"_uploadQueue",void 0),this._fileStorage=new Map,this._uploadQueue=new Map,Ot._instance=this}static getInstance(){return Ot._instance||(Ot._instance=new Ot),Ot._instance}storeFile(e,t,n,r,i,o,a,s,l){var c,d,u,h;(this._fileStorage.get(i)||this._fileStorage.set(i,new Map),null===(c=this._fileStorage.get(i))||void 0===c?void 0:c.get(r))||(null===(h=this._fileStorage.get(i))||void 0===h||h.set(r,{topLevel:new Map,subviews:{}}));l&&!(null===(d=this._fileStorage.get(i))||void 0===d||null===(u=d.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,c;return r?(null===(s=this._fileStorage.get(e))||void 0===s||null===(l=s.get(t))||void 0===l||null===(c=l.subviews[r])||void 0===c?void 0:c.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,c,d,u;return r?null!==(i=null===(c=this._fileStorage.get(e))||void 0===c||null===(d=c.get(t))||void 0===d||null===(u=d.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 gt(this,void 0,void 0,(function*(){return new Promise(((o,a)=>gt(this,void 0,void 0,(function*(){var s;const{file:l,targetBucketId:c,destinationFilename:d}=n,u=null===(s=this._uploadQueue.get(t))||void 0===s?void 0:s.get(e);let h=!1;const p=new Error(It);p.name=St,u&&(u.uploadRequests[r]={abort:()=>{h=!0,Qe.debug({level1:[`File upload for card: ${e} in container instance: ${t} was cancelled`,d]}),a({error:p,fieldname:r,filename:d})}});let m=`get-file-upload-url?filename=${encodeURIComponent(d)}&targetBucketId=${c}&card_instance_id=${e}`;n.convertImage&&(m+="&jpeg_convert=1");const{data:{uploadUrl:g},response:v}=yield Td.get(m,i);if(h)return;if(v.error){Qe.error({level1:["Failed to get upload URL",v.error]});const e=new Error(Ct);return e.name=yt,a({error:e,fieldname:r,filename:d})}const f=new XMLHttpRequest,b=new Error(kt);b.name=bt,f.onload=()=>{f.status>=200&&f.status<300?(Qe.debug({level1:[`File upload for card: ${e} in container instance: ${t} was successful`,d]}),o(r)):(Qe.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,d]}),a({error:b,fieldname:r,filename:d}))},f.onerror=()=>{Qe.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,d]}),a({error:b,fieldname:r,filename:d})},f.onabort=()=>{Qe.debug({level1:[`File upload for card: ${e} in container instance: ${t} was cancelled`,d]});const n=new Error(It);n.name=St,a({error:n,fieldname:r,filename:d})},u&&(u.uploadRequests[r]=f);try{f.open("PUT",g,!0);const e=new FormData;e.append("file",l,d),f.send(e.get("file"))}catch(n){Qe.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,n]}),a({error:b,fieldname:r,filename:d})}}))))}))}uploadFilesForCard(e,t,n,r,i){return gt(this,void 0,void 0,(function*(){var o,a,s,l,c,d;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(xt);return e.name=wt,{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),v=p.map((r=>{const{fieldname:i}=r,o=vt(r,["fieldname"]);if(g[i]={filename:o.destinationFilename,targetBucketId:o.targetBucketId},"image"===o.type)return this.uploadFile(e,t,o,i,n)})),f={success:!1};return r.sendEvent({cardInstanceId:e,cardViewState:(null==u?void 0:u.subviewId)?"subview":"topview",eventName:ht,properties:g}),yield Promise.allSettled(v).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===St)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},f.error=e.error}}})),i.length||o.length||(Qe.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:pt,properties:a}),f.success=!0),i.length&&(Qe.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:mt,properties:s}),f.failedUploads=i),o.length&&(f.cancelledUploads=o)})),null===(c=this._uploadQueue.get(t))||void 0===c||c.delete(e),(null===(d=this._uploadQueue.get(t))||void 0===d?void 0:d.size)||this._uploadQueue.delete(t),f}))}cancelUploadForCard(e,t){return gt(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 gt(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))}))}}ft(Ot,"_instance",void 0);const Tt=Ot.getInstance();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())}))};const Ft=(e,t)=>e?Object.keys(e).reduce(((n,r)=>{const i=e[r];return t.includes(i||"")||(n[r]=e[r]),n}),{}):e,jt=e=>Ft(e,["submitted","dismissed","snoozed","submitted-subview","centering"]),Dt=(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})},At=(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]),_t=function(){let e=Number(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0);return""+ ++e},Et=(e,t,n)=>{var r;if(!n)return e;switch(n.name){case bd.noInternet:return"No internet connection";case bt:case wt:case yt:return(null==t||null===(r=t.toastMessages)||void 0===r?void 0:r.fileUploadFailed)||n.message;default:return e}},Lt=(e,t)=>{var n;return((null===(n=t.application.enabledUiElements.toastConfig)||void 0===n?void 0:n.toastMessages)||{})[e]},Ht=(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:_t(e.messages.lastMessageId),cardList:void 0,subview:void 0}}},Pt=()=>({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?Ht(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=Lt("submittedCard",e),i=_t(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=Ft(e.cardStates,["centering","fixed-position"]),s=_t(e.messages.lastMessageId),l=e.application.enabledUiElements.toastConfig,c=Object.assign({text:Et("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:c}:{cardList:c}),{lastMessageId:s})})},dismissingCard:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"dismissing"})}),dismissedCard(e,t){const n=Lt("dismissedCard",e),r=_t(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=Ft(e.cardStates,["centering","fixed-position"]),o=_t(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:Et("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=Lt("snoozedCard",e),i=_t(e.messages.lastMessageId);let a;return a=(0,o.isToday)(n)?(0,o.format)(n,"h:mm A"):(0,o.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 ${a}`,messageId:i,cardInstanceId:t,action:"snoozed"},lastMessageId:i})})},failedToSnoozeCard(e,t,n,r,i){const o=Ft(e.cardStates,["centering","fixed-position"]),a=_t(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:Et("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?Dt(e,t,"fixed-position"):Ft(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?Dt(e,t,"centering"):Ft(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 Mt(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=Ft(i.cardStates,["centering","fixed-position"]),l=jt(s),c=At(e.cardFeed.cardInstances,i.cardFeed.cardInstances,l);return i.cardFeed.cardInstances=c,{cardFeed:Object.assign(Object.assign({},e.cardFeed),{cardInstances:i.cardFeed.cardInstances,runtimeVariables:i.cardFeed.runtimeVariables,tutorialSeen:e.cardFeed.tutorialSeen||c.length>0,updateId:(new Date).getTime(),status:{loaded:!0}}),cardStates:s,navigationStack:i.navigationStack}}))},clearMessage:(e,t)=>Object.assign(Object.assign({},e),{messages:Ht(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===bd.noInternet)n="noInternet";else n="apiError";return Qe.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=Ft(e.cardStates,["centering","fixed-position"]),r=jt(n),i=At(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=>Gc(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===bd.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=Lt("feedbackReceived",e),r=_t(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 Rt;const Vt=()=>(Rt||(Rt=(0,e.kv)((0,e.Y2)(Pt),u())),Rt);var $t=0,Nt=document.head.appendChild(document.createElement("style")).sheet;function zt(e,t){var n="p"+$t++,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{Nt.insertRule(e,Nt.cssRules.length)}catch(e){}})),n}function Wt(e,t){return t+"{"+e+"}"}function Ut(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(Wt(Ut(i,!/^@/.test(r)).join(""),r))))}return t||(n[0]=Wt(n[0],"")),n}const qt=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=Ut(e),r=t.join("");return n[r]||(n[r]=zt(t,"."))}}(Y.h),Bt=function(e){return zt([Wt(Ut(e,1).join(""),"")],"@keyframes ")};function Yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Kt="rgba(0, 0, 0, 1)",Zt="rgba(255, 255, 255, 1)",Qt='-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',Gt={colors:{},typography:{},shape:{}},Xt={icon:{switchOff:Zt,switchOn:Zt},background:{switchOff:"rgba(128, 128, 128, 1)",switchOn:Kt}};class Jt{constructor(e,t,n,r){Yt(this,"theme",void 0),Yt(this,"themeName",void 0),Yt(this,"fontFamilies",void 0),Yt(this,"hasSecondaryButtonStyle",!1),Yt(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,c]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 c&&c.match(/\w+/g)&&e&&(this.hasSecondaryButtonStyle=!0);break}if(t.includes("equalShadowOffsets")||t.includes("equalPaddings"))break;r(c);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 c&&c.match(/\w+/g)&&t&&(this.hasSecondaryButtonStyle=!0);break}}if(!this.hasSecondaryButtonStyle&&null!==c&&"object"==typeof c&&!Array.isArray(c)){const e=t?t+"."+l:l;this.testSecondaryStyles(c,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]||Gt,this.fontFamilies=i.fontFamilies||[]}getShape(e,t){return tn(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),c=this.getShape(`shadowOffsetType.${e}`,t),d=this.getCSSColor(`shadow.${e}`,{skipFallback:!0}),u="inset"===c?"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(!d||d.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/))return"";return`${u} ${h} ${p} ${i||""} ${d}`.trim()}getPadding(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=tn(a,`${e}`,null),l=tn(o,`${e}Width`,null),c=tn(o,`${e}Top`,null),d=tn(o,`${e}Right`,null),u=tn(o,`${e}Bottom`,null),h=tn(o,`${e}Left`,null);return"true"===s&&l?`${l}`:c||d||u||h?`${c||0} ${d||0} ${u||0} ${h||0}`:""}getCSSColor(e,t){const n=tn(this.theme.colors,e,null);if(n&&(null==n?void 0:n.color)&&!(null==t?void 0:t.skipPrimaryStyle))return en(n.color,n.opacity);if(null==t?void 0:t.skipFallback)return null;const r=tn(Xt,e,null);return r||("workflow"===this.themeName?e.startsWith("background")?Kt:Zt:e.startsWith("background")?"rgba(0, 0, 0, 0)":Kt)}getFontFamilies(){return this.fontFamilies}getTypographyStyle(e){var t;let n=tn(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 o=i.transform?i.transform:(null==t?void 0:t.skipFontFallbacks)?null:"none",a=i.lineHeight||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,c=i.fontFamily?`"${i.fontFamily}", ${Qt}`:Qt,d=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:c,fontWeight:d,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 en=(e,t)=>{const n=e.replace("#",""),r=parseInt(n,16);return`rgba(${[r>>16&255,r>>8&255,255&r].join(",")},${t})`},tn=(e,t,n)=>(e=e[(t=Array.isArray(t)?t:t.split("."))[0]])&&t.length>1?tn(e,t.slice(1),n):void 0!==e?e:n,nn=(e,t)=>n=>{let{themeMethod:r,primaryAccessor:i,secondaryAccessor:o,fallbackStyle:a,skipThemeHelperFallbacks:s,skipDefaultStyle:l}=n;const c=i?e[r](i,{skipFallback:s}):void 0,d=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&&d?d:c&&("primary"===t||"secondary"===t&&!e.hasSecondaryButtonStyle)?c:a||u||""},rn=e=>"string"!=typeof e?(Qe.warn({level3:["Expected a string value for RGBA color, but received:",e]}),!1):null!==e.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/),on=Bt({from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}),an=qt("svg")((()=>({animation:`${on} 1s infinite linear`}))),sn=e=>{let{stopColor:t,size:n}=e;return(0,Y.h)(an,{width:n,height:n,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.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"}))},ln=()=>(0,Y.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.2.2/assets/fonts/font-awesome-5-15-4/fa-solid-900.woff');\n }\n "),cn={"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:""},dn=e=>{let{fillColor:t,ariaHidden:n=!1}=e;return(0,Y.h)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":n},(0,Y.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}))},un=qt("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)})),hn=qt("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`})})),pn=e=>{let{iconName:t,iconUrl:n,size:r,color:i,fallbackColor:o,styles:a={}}=e;const[s,l]=te(!1),c=oe(n);return re((()=>{n&&n!==c.current&&s&&(c.current=n,l(!1))}),[n,s]),n&&!s?(0,Y.h)(hn,{size:r,styles:a},(0,Y.h)("svg",{"aria-hidden":"true","data-src":n,"data-replacement-color":i,"data-container-size":r,oniconloaderror:()=>{Qe.error({level1:[`Error loading custom icon: ${n}`]}),l(!0)},style:Object.assign({maxWidth:`${r}px`,maxHeight:`${r}px`},i?{color:i}:{})})):t?(i&&(a.color=i),(0,Y.h)(un,{styles:a,size:r,"aria-hidden":"true"},cn[t]||"")):(0,Y.h)(hn,{size:r,styles:a},(0,Y.h)(dn,{ariaHidden:!0,fillColor:null!=i?i:o}))},mn=e=>{let{theme:t,appearance:n}=e;const r=nn(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())},gn=qt("button")((e=>Object.assign({},mn(e)))),vn=qt("a")((e=>Object.assign(Object.assign({},mn(e)),{textDecoration:"none"}))),fn=qt("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"}})),bn=qt("div")({display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}),yn=qt("span")({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),wn=e=>{let{nodeKey:t,clickHandler:n,text:r,icon:i,iconUrl:o,theme:a,appearance:s,loading:l,type:c,urlLink:d}=e;const u=d?vn:gn,h=nn(a,s),p=h({themeMethod:"getCSSFontProperties",primaryAccessor:"button",secondaryAccessor:"buttonSecondary",fallbackStyle:{}}),m=h({themeMethod:"getShape",primaryAccessor:"align.buttonIcon",secondaryAccessor:"align.buttonIconSecondary",fallbackStyle:"left",skipThemeHelperFallbacks:!0}),g=h({themeMethod:"getShape",primaryAccessor:"lineHeight.buttonIcon",secondaryAccessor:"lineHeight.buttonIconSecondary",fallbackStyle:"1",skipThemeHelperFallbacks:!0}),v=h({themeMethod:"getNumericFontSize",primaryAccessor:"button",secondaryAccessor:"buttonSecondary"}),f=Object.assign(Object.assign({},"left"===m?{marginRight:"10px"}:{marginLeft:"10px"}),{lineHeight:v*g+"px",color:h({themeMethod:"getCSSColor",primaryAccessor:"icon.button",secondaryAccessor:"icon.buttonSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),b=h({themeMethod:"getCSSColor",primaryAccessor:"icon.button",secondaryAccessor:"icon.buttonSecondary"});return(0,Y.h)(u,{key:t,"data-element-key":t,class:"submit-button",onClick:n,theme:a,appearance:s,tabIndex:"0",type:c,href:null==d?void 0:d.url,target:null==d?void 0:d.target},(0,Y.h)(Y.Fragment,null,l&&(0,Y.h)(bn,null,(0,Y.h)(sn,{stopColor:a.getCSSColor("text.button"),size:22})),(0,Y.h)(fn,{"data-testid":"button-content-wrapper",labelAlignment:null==p?void 0:p.textAlign,iconAlignment:m,visible:!l},(i||o)&&(0,Y.h)(pn,{iconName:i,iconUrl:o,size:v,color:f.color,fallbackColor:b,styles:Object.assign(Object.assign(Object.assign({},f),!r&&{marginLeft:0,marginRight:0}),{alignSelf:"center",justifySelf:"start"})}),(0,Y.h)(yn,null,r))))},Sn=e=>{let{theme:t,appearance:n}=e;const r=nn(t,n),i=(e,t)=>t?{[e]:t}:{},o=r({themeMethod:"getCSSFontProperties",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:{}}),a=t.getShape("buttonWidth.global"),s=t.getShape("buttonLayout.global"),l=r({themeMethod:"getCSSColor",primaryAccessor:"background.action",secondaryAccessor:"background.actionSecondary"}),c="transparent"===l||l.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/);let d="100%";return c&&(d="calc(100% + 40px)"),Object.assign(Object.assign(Object.assign({cursor:"pointer",padding:r({themeMethod:"getPadding",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:"10px 20px"}),margin:c&&"horizontal"!==s?"0 -20px":"0px",color:r({themeMethod:"getCSSColor",primaryAccessor:"text.action",secondaryAccessor:"text.actionSecondary"}),display:"flex",alignItems:"center",textAlign:"left"},o),{maxWidth:d,width:"hugsLabel"===a?"auto":d,backgroundColor:l,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"}),":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())},kn=qt("button")((e=>Object.assign({},Sn(e)))),Cn=qt("a")((e=>Object.assign(Object.assign({},Sn(e)),{textDecoration:"none"}))),xn=qt("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-start"):(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}})),In=qt("span")((()=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}))),On=e=>{let{nodeKey:t,clickHandler:n,text:r,icon:i,iconUrl:o,theme:a,appearance:s,type:l,urlLink:c}=e;const d=c?Cn:kn,u=nn(a,s),h=u({themeMethod:"getCSSFontProperties",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:{}}),p=u({themeMethod:"getShape",primaryAccessor:"align.actionIcon",secondaryAccessor:"align.actionIconSecondary",fallbackStyle:"left",skipThemeHelperFallbacks:!0}),m=u({themeMethod:"getShape",primaryAccessor:"lineHeight.actionIcon",secondaryAccessor:"lineHeight.actionIconSecondary",fallbackStyle:"1",skipThemeHelperFallbacks:!0}),g=u({themeMethod:"getNumericFontSize",primaryAccessor:"action",secondaryAccessor:"actionSecondary"}),v=Object.assign(Object.assign({},"left"===p?{marginRight:"10px"}:{marginLeft:"10px"}),{lineHeight:g*m+"px",color:u({themeMethod:"getCSSColor",primaryAccessor:"icon.action",secondaryAccessor:"icon.actionSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),f=u({themeMethod:"getCSSColor",primaryAccessor:"icon.action",secondaryAccessor:"icon.actionSecondary"});return(0,Y.h)(d,{key:t,"data-element-key":t,class:"action-button",onClick:n,theme:a,appearance:s,tabIndex:"0",type:l,href:null==c?void 0:c.url,target:null==c?void 0:c.target},(0,Y.h)(xn,{labelAlignment:null==h?void 0:h.textAlign,iconAlignment:p},(i||o)&&(0,Y.h)(pn,{iconName:i,iconUrl:o,size:g,color:v.color,fallbackColor:f,styles:Object.assign(Object.assign(Object.assign({},v),!r&&{marginLeft:0,marginRight:0}),{alignSelf:"center",justifySelf:"start"})}),(0,Y.h)(In,null,r)))},Tn=e=>e.isWorkflow?(0,Y.h)(wn,e):(0,Y.h)(On,e),Mn=e=>{let{fillColor:t,className:n,style:r,ariaHidden:i=!0}=e;return(0,Y.h)("svg",{width:"14",height:"10",viewBox:"0 0 14 10",class:n,style:r,focusable:"false","aria-hidden":i},(0,Y.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}))},Fn=e=>{let{style:t}=e;return(0,Y.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,Y.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"}))},jn=e=>{let{style:t}=e;return(0,Y.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,Y.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"}))},Dn=n(3054),An=n(6756),_n=n(1295),En=[];const Ln={},Hn=(e,t,n)=>{const{enableJs:r,disableUniqueIds:i,disableCssScoping:o,spriteIconId:a,replacementColor:s,containerSize:l}=t,c=!!a,d=(new DOMParser).parseFromString(n,"text/html"),u=c?d.getElementById(a):d.querySelector("svg"),h=(()=>{if(En.length)return En;for(const e in document.body)e.startsWith("on")&&En.push(e);return En.push("onbegin","onend","onrepeat"),En.push("onfocusin","onfocusout","onbounce","onfinish","onshow"),En})(),p=Ln[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:o}=t.attributes[e],a=An(g,o,i);o!==a&&t.setAttribute(i,a),!h.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=Dn(t.innerHTML,`[data-id="${m}"]`,g);e=An(g,e),e!==t.innerHTML&&(t.innerHTML=e)}})),e.innerHTML=a?u.outerHTML:u.innerHTML,!c)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))}Ln[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,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){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")}},Pn={},Rn={},Vn=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"),c=Hn.bind(self,e,{enableJs:i,disableUniqueIds:o,disableCssScoping:a,spriteIconId:r,replacementColor:s,containerSize:l});if(Rn[n]){const e=Rn[n];c(e)}else{if(Pn[n])return void setTimeout((()=>Vn(e)),20);Pn[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`);Rn[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 Pn[n]}))}};let $n;globalThis.IntersectionObserver&&($n=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(Vn(e.target),$n.unobserve(e.target))}))}),{rootMargin:"1200px"}));const Nn=[];function zn(){Array.from(document.querySelectorAll("svg[data-src]:not([data-id])")).forEach((e=>{-1===Nn.indexOf(e)&&(Nn.push(e),"lazy"===e.getAttribute("data-loading")?$n.observe(e):Vn(e))}))}let Wn=!1;if(globalThis.addEventListener){const Nu=setInterval((()=>{zn()}),100);function zu(){clearInterval(Nu),zn(),(()=>{if(Wn)return;Wn=!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])"))))))&&zn(),e.forEach((e=>{"attributes"===e.type&&Vn(e.target)}))})).observe(document.documentElement,{attributeFilter:["data-src"],attributes:!0,childList:!0,subtree:!0})})()}"interactive"===document.readyState||"complete"===document.readyState?zu():globalThis.addEventListener("DOMContentLoaded",(()=>{zu()}))}function Un(e,t){for(var n in t)e[n]=t[n];return e}function qn(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)=>{Rn[e]=t};var Bn=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 qn(this.props,e)||qn(this.state,t)},r}(Y.Component);function Yn(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:qn(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,Y.createElement)(e,Un({},t))}return r.prototype.isReactComponent=!0,r.displayName="Memo("+(e.displayName||e.name)+")",r.t=!0,r}var Kn=Y.options.__b;Y.options.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),Kn&&Kn(e)};var Zn=function(e,t){return e?(0,Y.toChildArray)(e).reduce((function(e,n,r){return e.concat(t(n,r))}),[]):null},Qn={map:Zn,forEach:Zn,count:function(e){return e?(0,Y.toChildArray)(e).length:0},only:function(e){if(1!==(e=(0,Y.toChildArray)(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:Y.toChildArray},Gn=Y.options.__e;function Xn(e){return e&&((e=Un({},e)).__c=null,e.__k=e.__k&&e.__k.map(Xn)),e}function Jn(){this.__u=0,this.o=null,this.__b=null}function er(e){var t=e.__.__c;return t&&t.u&&t.u(e)}function tr(){this.i=null,this.l=null}Y.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);Gn(e,t,n)},(Jn.prototype=new Y.Component).__c=function(e,t){var n=this;null==n.o&&(n.o=[]),n.o.push(t);var r=er(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)},Jn.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=Xn(this.__b),this.__b=null),[(0,Y.createElement)(Y.Component,null,t.u?null:e.children),t.u&&e.fallback]};var nr=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]}};(tr.prototype=new Y.Component).u=function(e){var t=this,n=er(t.__v),r=t.l.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),nr(t,e,r)):i()};n?n(o):o()}},tr.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,Y.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},tr.prototype.componentDidUpdate=tr.prototype.componentDidMount=function(){var e=this;e.l.forEach((function(t,n){nr(e,n,t)}))};var rr=function(){function e(){}var t=e.prototype;return t.getChildContext=function(){return this.props.context},t.render=function(e){return e.children},e}();function ir(e){var t=this,n=e.container,r=(0,Y.createElement)(rr,{context:t.context},e.vnode);return t.s&&t.s!==n&&(t.v.parentNode&&t.s.removeChild(t.v),(0,Y._unmount)(t.h),t.p=!1),e.vnode?t.p?(n.__k=t.__k,(0,Y.render)(r,n),t.__k=n.__k):(t.v=document.createTextNode(""),(0,Y.hydrate)("",n),n.appendChild(t.v),t.p=!0,t.s=n,(0,Y.render)(r,n,t.v),t.__k=t.v.__k):t.p&&(t.v.parentNode&&t.s.removeChild(t.v),(0,Y._unmount)(t.h)),t.h=r,t.componentWillUnmount=function(){t.v.parentNode&&t.s.removeChild(t.v),(0,Y._unmount)(t.h)},null}var or=/^(?: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]/;Y.Component.prototype.isReactComponent={};var ar="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;function sr(e,t,n){if(null==t.__k)for(;t.firstChild;)t.removeChild(t.firstChild);return(0,Y.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}var lr=Y.options.event;function cr(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}})}Y.options.event=function(e){lr&&(e=lr(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 dr={configurable:!0,get:function(){return this.class}},ur=Y.options.vnode;Y.options.vnode=function(e){e.$$typeof=ar;var t=e.type,n=e.props;if(t){if(n.class!=n.className&&(dr.enumerable="className"in n,null!=n.className&&(n.class=n.className),Object.defineProperty(n,"className",dr)),"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,Y.toChildArray)(n.children).forEach((function(e){-1!=n.value.indexOf(e.props.value)&&(e.props.selected=!0)})),delete n.value),n)if(r=or.test(o))break;if(r)for(o in i=e.props={},n)i[or.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&&(cr(t.prototype,"componentWillMount"),cr(t.prototype,"componentWillReceiveProps"),cr(t.prototype,"componentWillUpdate"),t.m=!0)}ur&&ur(e)};function hr(e){return!!e&&e.$$typeof===ar}const pr={useState:te,useReducer:ne,useEffect:re,useLayoutEffect:ie,useRef:oe,useImperativeHandle:ae,useMemo:se,useCallback:function(e,t){return K=8,se((function(){return e}),t)},useContext:le,useDebugValue:function(e,t){Y.options.useDebugValue&&Y.options.useDebugValue(t?t(e):e)},version:"16.8.0",Children:Qn,render:sr,hydrate:sr,unmountComponentAtNode:function(e){return!!e.__k&&((0,Y.render)(null,e),!0)},createPortal:function(e,t){return(0,Y.createElement)(ir,{vnode:e,container:t})},createElement:Y.createElement,createContext:Y.createContext,createFactory:function(e){return Y.createElement.bind(null,e)},cloneElement:function(e){return hr(e)?Y.cloneElement.apply(null,arguments):e},createRef:Y.createRef,Fragment:Y.Fragment,isValidElement:hr,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:Y.Component,PureComponent:Bn,memo:Yn,forwardRef:function(e){function t(t){var n=Un({},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:Jn,SuspenseList:tr,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,Y.createElement)(n,i)}return i.displayName="Lazy",i.t=!0,i}},mr=()=>(0,Y.h)("svg",{width:"3",height:"15",viewBox:"0 0 3 15",xmlns:"http://www.w3.org/2000/svg"},(0,Y.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,Y.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,Y.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"})),gr=e=>{let{style:t}=e;return(0,Y.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,Y.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"}))},vr=e=>{let{style:t}=e;return(0,Y.h)("svg",{width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t},(0,Y.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"}))},fr=e=>e&&e.current&&e.current.base,br={top:35,right:25},yr=qt("button")((e=>{let{open:t,theme:n}=e;return Object.assign({cursor:"pointer",position:"absolute",top:"10px",right:"10px",width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"center",border:"0px",borderRadius:"30px",zIndex:ws.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())})),wr=qt("button")((e=>{let{theme:t}=e;return Object.assign({cursor:"pointer",position:"absolute",top:"10px",right:"10px",width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"center",border:"0px",borderRadius:"30px",zIndex:ws.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())})),Sr=e=>{let{theme:t,open:n,feedOrientation:r,children:i,cardRef:o,ariaLabelledBy:a}=e;const s=oe(null);let l={direction:"down",maxHeight:0,maxWidth:0};return n&&(l=((e,t,n)=>{if(fr(t)&&fr(n)){const r=t.current.base.offsetParent,i=r.offsetParent,o=n.current.base,a=10,s=10;if("horizontal"===e){const e=r.offsetLeft+o.offsetLeft-i.scrollLeft,t=i.clientWidth-e,n=200,a=e>=n||t<n;return{direction:a?"left":"right",maxWidth:a?e:t}}const l=o.offsetTop,c=i.scrollHeight-r.offsetTop-a-l,d=r.offsetTop,u=o.scrollHeight,h=c>=u||d<u;return{direction:h?"down":"up",maxHeight:h?c:d,maxWidth:r.clientWidth-2*s}}return{direction:"down",maxHeight:0,maxWidth:0}})(r,o,s),setTimeout((()=>{if(fr(s)){const e=s.current.base.querySelector('[tabindex="0"]');if(e){e.focus()}}}),0)),(0,Y.h)(kr,{maxHeight:`${l.maxHeight}px`,maxWidth:`${l.maxWidth}px`,open:n,theme:t,ref:s,children:i,direction:l.direction,"aria-labelledBy":a})},kr=qt("ul")((e=>{var t;let n,{theme:r,open:i,maxHeight:o,maxWidth:a,direction:s}=e;switch(s){case"up":n="translateY(-100%) translateY(-50px)";break;case"down":case"left":n="translateY(0)";break;case"right":n="translateX(90%)"}return{position:"absolute",top:"50px",right:"10px",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!==(t=r.getShape("borderRadius.sheet",{skipFallback:!0}))&&void 0!==t?t:"5px",padding:"10px 0",overflow:"auto",listStyle:"none",margin:"0",zIndex:ws.OVERFLOW_MENU,maxHeight:i?`${o}`:"0px",maxWidth:i?`${a}`:"0px",visibility:i?"visible":"hidden",transform:n}})),Cr=qt("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())})),xr=qt("span")((()=>({maxWidth:"240px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}))),Ir=qt("li")((e=>{let{theme:t}=e;return{borderTop:`1px solid ${t.getCSSColor("border.sheetItemDivider")}`,height:"1px",margin:"10px 0"}})),Or=qt("li")((()=>({flexShrink:"0"}))),Tr=e=>{let{title:t,icon:n,onClick:r,theme:i,className:o}=e;const a={marginRight:"20px",minWidth:"20px"};return(0,Y.h)(Or,{role:"none"},(0,Y.h)(Cr,{theme:i,tabIndex:"-1",onClick:r,className:o},"bin"===n&&(0,Y.h)(Fn,{style:a}),"clock"===n&&(0,Y.h)(jn,{style:a}),"thumbs-up"===n&&(0,Y.h)(gr,{style:a}),"thumbs-down"===n&&(0,Y.h)(vr,{style:a}),(0,Y.h)(xr,null,t)))},Mr=32,Fr=38,jr=40,Dr=13,Ar=27,_r=-1,Er=e=>{switch(e){case"ArrowUp":case"Up":return Fr;case"ArrowDown":case"Down":return jr;case"Enter":return Dr;case"Spacebar":case" ":return Mr;case"Escape":return Ar;default:return _r}},Lr="ArrowUp",Hr="ArrowDown",Pr="ArrowLeft",Rr="ArrowRight",Vr="Enter",$r=" ",Nr="Escape",zr="PageUp",Wr="PageDown",Ur="Tab",qr=qt("div")((e=>{let{theme:t}=e;return Object.assign({width:"100%",border:"0"},t.getElementFocusCSSProperties())})),Br=(e,t)=>{try{const n=Yr(e)[t];return n&&"none"===n.getAttribute("role")&&n.childNodes.length>0?n.childNodes[0]:n}catch(e){return null}},Yr=e=>e&&e.current&&e.current.base&&e.current.base.childNodes?[...e.current.base.childNodes].filter((e=>"true"!==e.getAttribute("aria-hidden"))):[],Kr=e=>{let{defaultIndex:t,theme:n,children:r}=e;const[i,o]=te(t||0),a=(0,Y.createRef)(),s=oe(-1);re((()=>{s.current=i}));const l=s.current;return re((()=>{o(t||0)}),[t]),re((()=>{var e,t,n;-1!==l&&(null===(n=Br(a,l))||void 0===n||n.setAttribute("tabIndex","-1"));null===(e=Br(a,i))||void 0===e||e.setAttribute("tabIndex","0"),null===(t=Br(a,i))||void 0===t||t.focus()}),[i]),(0,Y.h)(qr,{theme:n,className:"supports-keyboard-navigation",ref:a,onKeyDown:e=>{var t;let n=null;switch(Er(e.key)){case jr:n=i+1;break;case Fr:n=i-1;break;case Dr:case Mr:null===(t=Br(a,i))||void 0===t||t.click(),e.stopPropagation(),e.preventDefault()}var r,s;null!==n&&(r=n,s=Yr(a).length,n=(r+s)%s,o(n),e.view.event.preventDefault())}},r)},Zr=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"12",height:"12",viewBox:"0 0 12 12"},(0,Y.h)("path",{d:"M1 1L6 6L11 11M1 11L11 1","stroke-width":"2","stroke-linecap":"round",stroke:t}))},Qr=qt("div")((e=>{let{feedOrientation:t,rendersButton:n,cardElements:r}=e;const i=((e,t)=>{var n,r;if(!t||!e||0===e.length)return{top:0,right:0};const i=(e,t)=>{var n;if(!e)return{top:0,right:0};const r=Array.isArray(e)?e[0]:e;switch(null==r?void 0:r.type){case O:case T:const e=null==r||null===(n=r.attributes)||void 0===n?void 0:n.format;return"banner"===e?null:"text"===e?{top:0,right:br.right}:{top:br.top,right:0};case M:case F:case j:case D:case A:case _:case E:case L:case R:case V:case $:case N:case z:case W:return{top:br.top,right:0};case k:case C:case x:case I:return{top:0,right:br.right};case H:case P:return i(null==r?void 0:r.children,t);default:return null}},o=null===(n=e[0])||void 0===n||null===(r=n.props)||void 0===r?void 0:r.node;return i(o,t)})(r,n);return Object.assign(Object.assign({},"horizontal"===t?{height:"100%",display:"flex",flexDirection:"column"}:{}),i?{"& > *:nth-child(2)":{marginRight:`${i.right}px`,marginTop:`${i.top}px`}}:{})})),Gr=qt("div")((e=>{let{theme:t,margin:n,minHeight:r,feedOrientation:i,cardWidth:o}=e;const a={width:`${o}px`,marginLeft:`${n}px`};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({backgroundColor:t.getCSSColor("background.card"),marginBottom:`${n}px`,borderRadius:t.getShape("borderRadius.card"),boxShadow:n>0?`0 ${t.getShape("offset.cardShadow")} ${t.getShape("blur.cardShadow")} ${t.getCSSColor("shadow.card")}`:"none",padding:"10px 20px",border:`${t.getShape("border.card")} solid ${t.getCSSColor("border.card")}`,position:"relative",minHeight:r?`${r}px`:"0px"},"horizontal"===i?a:{}),Us(i).cardCompletion),Us(i).dismissal),Us(i).snooze),{".submitting, .submitted, .submitted-subview":{border:"0"}})})),Xr=qt("div")((e=>{let{dimensions:t,centerAlign:n,leftPosition:r,feedOrientation:i}=e;const o=Object.assign({width:t.width,display:"flex",flexShrink:"0",scrollSnapAlign:"center",".fixed-position":{position:"unset",left:`${r?r/2+r:0}px`}},n&&{left:"50%",transform:"translateX(-50%)"});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({height:t.height},"horizontal"===i?o:{}),qs(i).cardCompletion),qs(i).dismissal),qs(i).snooze),qs(i).center)})),Jr=qt("div")((()=>({})));var ei;!function(e){e.menu="menu",e.dismiss="dismiss",e.hidden="hidden"}(ei||(ei={}));const ti=Yn((e=>{let{containerInstanceId:t,cardInstanceId:n,children:r,theme:i,animationState:o,cardFeedOverlayDisplayed:a,onDismiss:s,onSnooze:l,onFeedbackSelected:c,removeCard:d,customStrings:u,margin:h,centerAlign:p,accessibilityRole:m,actions:g,votingOptions:v,cardMinimumHeight:f,horizontalContainerConfig:b}=e;const[y,w]=te(!1),S=oe(y),k=e=>{S.current=e,w(e)},[C,x]=te({height:"auto",width:"auto"}),[I,O]=te(0),T=oe(null),M=oe(null),F=oe(null),j=`card-overflow-menu-${n}`,D=sd(b);ie((()=>{M.current&&M.current.base&&("submitted"===o||"submitted-subview"===o||"dismissed"===o||"snoozed"===o?(x({height:M.current.base.offsetHeight+h-1+"px",width:`${M.current.base.offsetWidth+h}px`}),"horizontal"===sd(b)&&"center"===(null==b?void 0:b.lastCardAlignment)?(Vt().fixPositionRemainingCard(n),O(F.current.base.offsetLeft),setTimeout((()=>{Vt().centerRemainingCard(n)}),200),setTimeout((()=>{d()}),Zs(o))):setTimeout((()=>{d()}),Zs(o))):x({height:"auto",width:"auto"})),F.current&&F.current.base&&(O("fixed-position"===o?F.current.base.offsetLeft:0),"centering"===o&&setTimeout((()=>{Vt().removeCardState(n)}),Zs(o)))}),[o,M.current,F.current]),re((()=>{const e=e=>{var t;(null===(t=T.current)||void 0===t?void 0:t.base)&&!T.current.base.contains(e.target)&&k(!1)};document.addEventListener("mousedown",e);const t=e=>{if(S.current&&("Tab"===e.key&&k(!1),"Escape"===e.key&&S.current)){const e=document.getElementById(j);k(!1),null==e||e.focus()}};return document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}}),[n]);const{dismiss:{overflow:A},snooze:{overflow:_},voteUp:{overflow:E,feedback:L,feedbackLabel:H},voteDown:{overflow:P,feedback:R,feedbackLabel:V}}=g,$={voteUp:!0===(null==v?void 0:v.canVoteUseful)||E,voteDown:!0===(null==v?void 0:v.canVoteNotUseful)||P};let N=ei.hidden;$.voteUp||$.voteDown||_?N=ei.menu:A&&(N=ei.dismiss);const z=($.voteUp||$.voteDown)&&(A||_);return(0,Y.h)(Xr,{ref:F,id:n,dimensions:C,feedOrientation:D,centerAlign:p,leftPosition:I,class:o,role:m},(0,Y.h)(Gr,{theme:i,class:`card-content ${o||""}`,ref:M,margin:h,minHeight:f,feedOrientation:D,cardWidth:null==b?void 0:b.cardWidth,inert:a},(0,Y.h)(Qr,{class:"card-nodes",feedOrientation:D,rendersButton:N!==ei.hidden,cardElements:r},N===ei.menu&&(0,Y.h)(Jr,{ref:T},(0,Y.h)(yr,{class:"overflow-action",theme:i,open:y,tabIndex:"0",ariaLabel:"Card overflow menu",id:j,ariaHasPopup:"true",ariaExpanded:y,onClick:e=>{e.target&&e.target.focus(),k(!y)}},(0,Y.h)(mr,null)),(0,Y.h)(Sr,{theme:i,ariaLabelledBy:j,open:y,feedOrientation:D,cardRef:M},(0,Y.h)(Kr,{theme:i},$.voteUp&&(0,Y.h)(Tr,{onClick:()=>{c({sentiment:"positive",textFeedback:L,textFeedbackLabel:H,source:"overflow-menu"}),k(!1)},theme:i,title:(null==u?void 0:u.votingUsefulTitle)||"This is useful",icon:"thumbs-up",className:"vote-up-action"}),$.voteDown&&(0,Y.h)(Tr,{onClick:()=>{c({sentiment:"negative",textFeedback:R,textFeedbackLabel:V,source:"overflow-menu"}),k(!1)},theme:i,title:(null==u?void 0:u.votingNotUsefulTitle)||"This isn't useful",icon:"thumbs-down",className:"vote-down-action"}),z&&(0,Y.h)(Ir,{theme:i,className:"card-overflow-divider","aria-hidden":"true"}),_&&(0,Y.h)(Tr,{onClick:()=>{l(),k(!1)},theme:i,title:(null==u?void 0:u.cardSnoozeTitle)||"Remind me",icon:"clock",className:"snooze-action"}),A&&(0,Y.h)(Tr,{onClick:()=>{s(),k(!1)},theme:i,title:"Dismiss",icon:"bin",className:"dismiss-action"})))),N===ei.dismiss&&(0,Y.h)(wr,{ariaLabel:"Dismiss card",theme:i,tabIndex:"0",onClick:s,className:"dismiss-button"},(0,Y.h)(Zr,null)),r),(0,Y.h)(Ls,{theme:i,animationState:o})),(0,Y.h)(zs,{viewState:"topview",onCancelUpload:()=>{window.AtomicUploadService.cancelUploadForCard(t,n),Vt().finishCardFileUpload(n),!window.AtomicUploadService.getIsUploadingStatus(t)&&Vt().setCardFeedOverlay(!1)},theme:i,renderOverlay:"uploading-files"===o}),(0,Y.h)(Hs,{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)),ni=qt("div")((e=>{let{feedOrientation:t,snapScroll:n}=e;const r={position:"relative",display:"flex",flexDirection:"row nowrap",alignItems:"stretch",flexShrink:"0",padding:"10px 10px 10px 0",overflowX:"auto",scrollSnapType:n?"x mandatory":"none"};return Object.assign({},"horizontal"===t?r:{})})),ri=pr.forwardRef(((e,t)=>{let{cardInstances:n,theme:r,isPreview:i,onDismiss:o,onSnooze:a,onFeedbackSelected:s,removeCard:l,cardStates:c,margin:d,runtimeVariables:h,customStrings:p,votingOptions:m,cardMinimumHeight:g,horizontalContainerConfig:v}=e;const f=u().getState();let b=n;f.application.cardLimit&&(b=b.slice(0,f.application.cardLimit));const y=sd(v);return(0,Y.h)(ni,{feedOrientation:y,snapScroll:"free"!==(null==v?void 0:v.scrollMode),class:"card-list",ref:t},b.map((e=>{if(e.defaultView){var t;let n=null==h||null===(t=h.values)||void 0===t?void 0:t.get(e.instance.id);n=n||new Map;const u=1===b.length&&"horizontal"===y&&"center"===(null==v?void 0:v.lastCardAlignment);return e.defaultView.nodes=Qc(e.defaultView.nodes),(0,Y.h)(ti,{key:e.instance.id,cardInstanceId:e.instance.id,containerInstanceId:f.application.containerInstanceId,theme:r,isPreview:i,animationState:c[e.instance.id],cardFeedOverlayDisplayed:f.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:n,customStrings:p,margin:d,centerAlign:u,accessibilityRole:"listitem",actions:e.actions,votingOptions:m,cardMinimumHeight:g,horizontalContainerConfig:v},e.defaultView.nodes.map((t=>(0,Y.h)(Uc,{cardInstanceId:e.instance.id,cardMetadata:e.metadata,node:t,isWorkflow:!1,theme:r,runtimeVariables:n,feedOrientation:y,embedMode:f.application.embedMode}))))}return null})))})),ii=qt("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())})),oi={settings:e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{fill:t,width:"18",height:"14",viewBox:"0 0 18 14"},(0,Y.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,Y.h)("svg",{stroke:t,width:"14",height:"12",viewBox:"0 0 14 12"},(0,Y.h)("path",{d:"M6 11L1 6M1 6L6 1M1 6L13 6","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},cross:Zr},ai=e=>{let{title:t,iconName:n,onClick:r,theme:i}=e;const o=oi[n];return(0,Y.h)(ii,{onClick:r,tabIndex:"0",ariaLabel:t,theme:i,className:`button-${n}`},(0,Y.h)(o,{fillColor:i.getCSSColor("text.navigationAction")}))},si=qt("div")((e=>{let{theme:t,feedOrientation:n}=e;return Object.assign({padding:"10px 20px 10px 15px",display:"flex",alignItems:"center",backgroundColor:t.getCSSColor("background.navigation"),zIndex:ws.HEADER,boxShadow:`0 ${t.getShape("offset.navigationShadow")} ${t.getShape("blur.navigationShadow")} ${t.getCSSColor("shadow.navigation")}`},"horizontal"===n?{padding:"10px"}:{})})),li=qt("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:{})})),ci=pr.forwardRef(((e,t)=>{let{theme:n,title:r,actionHandler:i,feedOrientation:o,alignment:a,inert:s}=e;return(0,Y.h)(si,{theme:n,feedOrientation:o,ref:t,inert:s},i&&(0,Y.h)(ai,{title:"Back",onClick:i,iconName:"arrowLeft",theme:n}),(0,Y.h)(li,{theme:n,feedOrientation:o,alignment:a},r))})),di=e=>{let{theme:t,title:n,actionHandler:r,inert:i}=e;return(0,Y.h)(si,{theme:t,inert:i},(0,Y.h)(li,{theme:t},n),r&&(0,Y.h)(ai,{title:"Close",onClick:r,iconName:"cross",theme:t}))},ui=qt("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:{})})),hi=qt("div")((e=>{let{feedOrientation:t}=e;return Object.assign({position:"absolute",bottom:"0",left:"0",right:"0",overflow:"hidden",pointerEvents:"none",zIndex:ws.TOAST},"horizontal"===t?{display:"flex",justifyContent:"center"}:{})})),pi=qt("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"))})),mi=qt("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"})})),gi=(e,t)=>new Promise((n=>{t(setTimeout((()=>{n()}),e))})),vi=e=>{var t;let{theme:n,feedOrientation:r,message:i,actionTitle:o,actionHandler:a,onDismiss:s,delay:l=0}=e;const[c,d]=te(!1),[h,p]=te(""),[m,g]=te(null),[v,f]=te(""),b=null==i?void 0:i.messageId,y="Try again"===o,w=(null===(t=u().getState().application.enabledUiElements.toastConfig)||void 0===t?void 0:t.timeout)||2e3;re((()=>{null!=(null==i?void 0:i.messageId)&&h!=i.messageId&&(p(i.messageId),i.text&&f(i.text),null!=m&&(clearTimeout(m),g(null)),gi(l,g).then((()=>(d(!0),gi(w+600,g)))).then((()=>(d(!1),gi(600,g)))).then((()=>{s&&(s(),f(""))})))}),[b]);const S=()=>{d(!1),a?a():f("")},k=e=>{const t=e.keyCode;13!==t&&32!==t||S()};return(0,Y.h)(hi,{id:"action-cards-sdk-toast-wrapper",class:"floating",feedOrientation:r},void 0!==i&&(0,Y.h)(ui,{id:"toast-body",theme:n,feedOrientation:r,hasRetry:y,onClick:y?void 0:S,onKeyUp:y?void 0:k,tabIndex:c&&!y?0:-1,class:c?"visible":"",role:c?"alert":void 0},(0,Y.h)(pi,{theme:n,class:"toast-message"},v||""),y&&(0,Y.h)(mi,{theme:n,class:"toast-action",hasRetry:y,onClick:y?S:void 0,onKeyUp:y?k:void 0,tabIndex:c&&y?0:-1},o)))},fi=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"79",height:"53",viewBox:"0 0 79 53",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.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,Y.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,Y.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,Y.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}))},bi=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"42",height:"42",viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.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,Y.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}))},yi=qt("div")((()=>({width:"100%",display:"flex",flexFlow:"column wrap",alignItems:"center",justifyContent:"center",minHeight:"250px"}))),wi=qt("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%"})})),Si=e=>{let{hasSeenTutorial:t,tutorialMessage:n,emptyMessage:r,theme:i}=e;return(0,Y.h)(yi,null,t?(0,Y.h)(Y.Fragment,null,(0,Y.h)(bi,{fillColor:i.getCSSColor("icon.listEmptyState")}),(0,Y.h)(wi,{theme:i},r||"All caught up")):(0,Y.h)(Y.Fragment,null,(0,Y.h)(fi,{fillColor:i.getCSSColor("icon.listEmptyState")}),(0,Y.h)(wi,{theme:i},n||"Cards will appear here when there’s something to action.")))},ki=e=>{let{title:t,textColor:n,buttonColor:r,theme:i,onRetry:o,tryAgainTitle:a}=e;return(0,Y.h)(Y.Fragment,null,(0,Y.h)(xi,{textColor:n,theme:i},t),(0,Y.h)(Ii,{textColor:r,theme:i,onClick:o},null!=a?a:"Try again"))},Ci=qt("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 ${Qt}`}})),xi=qt("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"})})),Ii=qt("button")((e=>{let{textColor:t,theme:n}=e;return Object.assign({color:(null==n?void 0:n.getCSSColor("text.errorOverlayAction"))||t,font:`16px ${Qt}`,background:"transparent",border:"0",outline:"none",fontWeight:"bold",cursor:"pointer"},(null==n?void 0:n.getCSSFontProperties("errorOverlayAction"))||{})})),Oi=e=>{let{embedMode:t,state:n,onRetry:r,loadingIconColor:i,textColor:o,buttonColor:a,backgroundColor:s,theme:l,noInternetConnectionMessage:c,dataLoadFailedMessage:d,tryAgainTitle:u}=e;return"single-card"===t||"preview"===t||"modal-subview"===t?null:(0,Y.h)(Ci,{background:s,className:"loading-wrapper",embedMode:t},!n&&(0,Y.h)(sn,{stopColor:(null==l?void 0:l.getCSSColor("icon.loadingSpinner"))||i||"#000000",size:32}),"apiError"===n&&(0,Y.h)(ki,{title:null!=d?d:"Couldn't load data",textColor:o,buttonColor:a,theme:l,onRetry:r,tryAgainTitle:u}),"noInternet"===n&&(0,Y.h)(ki,{title:null!=c?c:"No internet connection",textColor:o,buttonColor:a,theme:l,onRetry:r,tryAgainTitle:u}))};let Ti;!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"}(Ti||(Ti={}));const Mi=(0,Y.createContext)({cardEventDispatcher:{dispatchCardEvent:e=>{}},analyticsDispatcher:{sendEvent:e=>{}},authTokenProvider:{requestToken:()=>Promise.resolve(void 0)},runtimeVariableResolver:void 0});var Fi=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",Di=qt("div")((e=>{let{theme:t,rendersBackground:n}=e;return{display:"flex",flexDirection:"column",height:"100%",backgroundColor:n?t.getCSSColor("background.default"):"transparent"}})),Ai=qt("div")((e=>{let{embedMode:t}=e;return{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",zIndex:ws.FEED_OVERLAY,backgroundColor:"rgba(0, 0, 0, 0.4)",borderRadius:"launcher"===t?"20px":"0"}})),_i=qt("div")((e=>{let{embedMode:t}=e;return{width:"100%",position:"absolute",top:"0px",left:"0px",zIndex:ws.CUSTOM_HEADER,overflow:"hidden",borderRadius:"launcher"===t?"20px 20px 0 0":"0"}})),Ei=qt("div")((e=>{let{scrollPosition:t,scrollbarWidth:n,headerOffset:r}=e;return{width:"100%",marginTop:`${r}px`,paddingRight:`${n}px`,transform:`translateY(-${t}px)`}})),Li=qt("div")((e=>{let{embedMode:t,feedOrientation:n,headerPadding:r}=e;return Object.assign(Object.assign(Object.assign({padding:"single-card"===t?"0px":"10px 10px 0 10px"},r?{paddingTop:`${r+10}px`}:{}),{overflowX:"hidden",overflowY:"auto",maxHeight:"100%",height:"standalone"===t?"100%":"auto",position:"relative",overflowAnchor:"none"}),"horizontal"===n?{padding:"0",overflowY:"auto"}:{})})),Hi=qt("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:{})})),Pi={scrollTop:0,lastScrollTimeout:null,lastCardIds:[]},Ri=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},Vi=t=>{let{theme:n,onRetry:r}=t;const i=oe(null),o=oe(null),a=oe(null),s=oe(null),l=oe(null),[c,d]=te(0),[h,p]=te(0),m=le(Mi),g=m.analyticsDispatcher,v=m.cardEventDispatcher,f=m.authTokenProvider;return re((()=>(l.current=new IntersectionObserver(((e,t)=>{const n=ld();let r=[];e.forEach((e=>{if(e.isIntersecting){const t=e.target.id;n.add(t),Pi.lastCardIds.includes(t)||r.push(t)}})),r.forEach((e=>{const t=u().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:Xe},n?{properties:n}:{}))}));const i=JSON.stringify(Array.from(n));sessionStorage.setItem(S,i),Pi.lastCardIds=r}),{root:null,rootMargin:"0px",threshold:0}),()=>{var e;null===(e=l.current)||void 0===e||e.disconnect()})),[]),(0,Y.h)(me.lj,{actions:(0,e.Y2)($e,ge,Pt)},(e=>{var t,u,m,b,y,w,S,k,C,x;const I="preview"===e.application.embedMode,O="single-card"===e.application.embedMode,T="single-card"!==e.application.embedMode,M=("standalone"===e.application.embedMode||"launcher"===e.application.embedMode)&&e.cardFeed.displayingOverlay,F=e.application.enabledUiElements,j=e.cardFeed.horizontalContainerConfig,D=!("standalone"===e.application.embedMode&&(null==j?void 0:j.enabled)&&"shrink"===(null==j?void 0:j.emptyStyle)),A=sd(j),_=e.cardFeed.cardInstances.length,E="horizontal"===A&&F.cardListHeader&&"left"===(null==j?void 0:j.headerAlignment)&&(null!==(t=null===(u=o.current)||void 0===u||null===(m=u.base)||void 0===m?void 0:m.scrollHeight)&&void 0!==t?t:0)/2,L=()=>{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 re((()=>{e.application.open&&L()}),[e.cardFeed.updateId]),re((()=>{e.application.open&&(Pi.lastCardIds=[],L(),g.sendEvent({cardViewState:"topview",eventName:rt,properties:{displayMode:O?"single":"stream"}}))}),[e.application.open]),re((()=>{var e,t;p(null==o||null===(e=o.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.scrollHeight)}),[o]),re((()=>{const t=window.frameElement,r=n.getCSSColor("background.default");D||(t.style.backgroundColor=r);const i=()=>{"visible"===document.visibilityState&&e.application.open&&L()};return window.addEventListener("visibilitychange",i),()=>{window.removeEventListener("visibilitychange",i)}}),[]),re((()=>{Pi.lastCardIds=[];let e=e=>{let t=!1;t||(window.requestAnimationFrame((()=>{var n;const r=e.target;!1!==(null===(n=F.customContainerHeader)||void 0===n?void 0:n.scrollHeader)&&d(r.scrollTop),t=!1})),t=!0),Pi.scrollTop=e.target.scrollTop};return i.current&&i.current.base&&(i.current.base.scrollTop=Pi.scrollTop,i.current.base.addEventListener("scroll",e)),()=>{i.current&&i.current.base&&(Pi.scrollTop=i.current.base.scrollTop,i.current.base.removeEventListener("scroll",e))}}),[]),(0,Y.h)(Di,{theme:n,id:ji,rendersBackground:T},M&&(0,Y.h)(Ai,{class:"use-offset",embedMode:e.application.embedMode}),T&&F.cardListHeader&&(0,Y.h)(ci,{title:e.application.customStrings.cardListTitle||"Cards",theme:n,feedOrientation:A,ref:o,alignment:null==j?void 0:j.headerAlignment}),F.customContainerHeader&&("standalone"===e.application.embedMode||"launcher"===e.application.embedMode)&&(0,Y.h)(_i,{embedMode:e.application.embedMode},(0,Y.h)(Ei,{ref:a,headerOffset:h,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:c,dangerouslySetInnerHTML:{__html:null===(k=document.getElementById("custom-container-header"))||void 0===k?void 0:k.innerHTML}})),(0,Y.h)(Li,{embedMode:e.application.embedMode,feedOrientation:A,headerPadding:null==a||null===(C=a.current)||void 0===C||null===(x=C.base)||void 0===x?void 0:x.scrollHeight,ref:i,cardCount:_,id:"action-cards-sdk-card-container",class:"card-container",role:"list"},!e.cardFeed.status.loaded&&(0,Y.h)(Oi,{embedMode:e.application.embedMode,state:e.cardFeed.status.errorState,backgroundColor:"transparent",theme:n,onRetry:r,noInternetConnectionMessage:e.application.customStrings.noInternetConnectionMessage,dataLoadFailedMessage:e.application.customStrings.dataLoadFailedMessage,tryAgainTitle:e.application.customStrings.tryAgainTitle}),e.cardFeed.status.loaded&&_>0&&(0,Y.h)(ri,{cardInstances:e.cardFeed.cardInstances,theme:n,isPreview:I,onDismiss:t=>Fi(void 0,void 0,void 0,(function*(){Gs(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&&el(n,e,g,v,t.source)},removeCard:t=>{e.removeCard(t)},cardStates:e.cardStates,margin:O?0:10,runtimeVariables:e.cardFeed.runtimeVariables,customStrings:e.application.customStrings,votingOptions:e.cardFeed.cardVoting,cardMinimumHeight:e.cardFeed.cardMinimumHeight,horizontalContainerConfig:j,ref:s}),e.cardFeed.status.loaded&&0===_&&!O&&D&&(0,Y.h)(Hi,{embedMode:e.application.embedMode,feedOrientation:A,horizontalOffset:E,class:"empty-state-wrapper"},(0,Y.h)(Si,{theme:n,hasSeenTutorial:e.cardFeed.tutorialSeen,tutorialMessage:e.application.customStrings.awaitingFirstCard,emptyMessage:e.application.customStrings.allCardsCompleted}))),!e.application.isPreview&&!O&&!0===F.cardListToast&&!F.customToastContainer&&(0,Y.h)(vi,{theme:n,feedOrientation:A,message:e.messages.cardList,delay:Ri(e),actionTitle:e.messages.cardList&&["submit-failed","dismiss-failed","snooze-failed"].includes(e.messages.cardList.action)?"Try again":"Dismiss",actionHandler:()=>Fi(void 0,void 0,void 0,(function*(){var t,n,r,i,o,a,s,l,c,d;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":Xs(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===(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&&Gs(e,e,u,v,f,t);break;case"snooze-failed":const n=null===(c=e.messages.cardList)||void 0===c?void 0:c.snoozeDate,h=null===(d=e.messages.cardList)||void 0===d?void 0:d.source;n&&h&&Js(e,e,u,n,v,f,h)}})),onDismiss:()=>{e.clearMessage("cardList")}}))}))},$i=qt("div")((e=>{let{yOffset:t}=e;return{position:"absolute",top:`${t}px`,left:"0",right:"0",zIndex:ws.BANNER,overflow:"hidden"}})),Ni=qt("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"}}})),zi=qt("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"})})),Wi=e=>{let{theme:t,message:n,yOffset:r,onDismiss:i}=e;const[o,a]=te(null),[s,l]=te(null),[c,d]=te(!1);return re((()=>{null!=n&&null!=n.text?(null!=s&&(clearTimeout(s),l(null)),null!=o&&(clearTimeout(o),a(null)),d(!0),l(setTimeout((()=>{d(!1),l(null),a(setTimeout((()=>{i&&i(),a(null)}),300))}),3300))):d(!1)}),[n]),(0,Y.h)($i,{theme:t,yOffset:r},(0,Y.h)(Ni,{theme:t,class:`${c?"visible":""} ${o?"animating":""}`},(0,Y.h)(zi,{theme:t},n?n.text:"")))},Ui=qt("div")((e=>{let{theme:t,isPreview:n}=e;return{backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:n?"relative":"static"}})),qi=qt("div")((e=>{let{theme:t,isPreview:n}=e;return{background:t.getCSSColor("background.default"),position:"relative",bottom:n?"auto":"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"visible",padding:"0 20px",boxSizing:"border-box",display:"flex",flex:"1"}})),Bi=qt("div")({paddingTop:"10px"}),Yi={scrollTop:0,subviewId:""},Ki=t=>{let{theme:n}=t;const r=oe(null),i=le(Mi).analyticsDispatcher;return(0,Y.h)(me.lj,{actions:(0,e.Y2)(ge,Pt),mapToProps:e=>{const t=ke(e);return{containerInstanceId:e.application.containerInstanceId,cardStates:e.cardStates,customStrings:e.application.customStrings,subview:t&&Ce(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 s=t.subviews[o],{id:l}=t.instance,c=e.cardStates[l],d="modal-subview"===e.embedMode?di:ci;if(s){var a;let u=null===(a=e.runtimeVariables.values)||void 0===a?void 0:a.get(l);return u=u||new Map,re((()=>{var e;const t=()=>{let e=!1;e||(window.requestAnimationFrame((()=>{var t;const n=null==r||null===(t=r.current)||void 0===t?void 0:t.base;n&&(Yi.scrollTop=n.scrollTop,Yi.subviewId=o),e=!1})),e=!0)};return(null==r||null===(e=r.current)||void 0===e?void 0:e.base)&&(r.current.base.scrollTop=Yi.subviewId===o?Yi.scrollTop:0,r.current.base.addEventListener("scroll",t)),()=>{var e;(null==r||null===(e=r.current)||void 0===e?void 0:e.base)&&(r.current.base.scrollTop=Yi.subviewId===o?Yi.scrollTop:0,r.current.base.removeEventListener("scroll",t))}}),[]),re((()=>{i.sendEvent({cardInstanceId:l,cardViewState:"subview",eventName:at,properties:{subviewId:o,subviewTitle:ed(s.title,u),subviewLevel:1}})}),[o]),s.nodes=Qc(s.nodes),(0,Y.h)(Y.Fragment,null,(0,Y.h)(Ui,{theme:n,id:ji,isPreview:e.isPreview},(0,Y.h)(zs,{viewState:"subview",onCancelUpload:()=>{window.AtomicUploadService.cancelUploadForCard(e.containerInstanceId,l),Vt().finishCardFileUpload(l),!window.AtomicUploadService.getIsUploadingStatus(e.containerInstanceId)&&Vt().setCardFeedOverlay(!1)},theme:n,renderOverlay:"uploading-files"===c}),(0,Y.h)(d,{title:ed(s.title,u),theme:n,actionHandler:()=>{e.navigateBack(),i.sendEvent({cardInstanceId:l,cardViewState:"subview",eventName:st,properties:{subviewId:o,subviewTitle:ed(s.title,u),subviewLevel:1}})},inert:"uploading-files"===c}),(0,Y.h)(qi,{theme:n,ref:r,isPreview:e.isPreview,class:"use-offset",id:"action-cards-subview-container",inert:"uploading-files"===c},(0,Y.h)(Bi,{class:"offset-child"},s.nodes.map((r=>(0,Y.h)(Uc,{cardInstanceId:l,cardMetadata:t.metadata,node:r,isWorkflow:!0,theme:n,runtimeVariables:u,subviewId:o,subviewTitle:ed(s.title,u),embedMode:e.embedMode})))))),!e.isPreview&&(0,Y.h)(Wi,{theme:n,message:e.bannerMessage,yOffset:60,onDismiss:()=>{e.clearMessage("subview")}}))}}return null}))},Zi=e=>{let{fillColor:t,ariaHidden:n=!1}=e;return(0,Y.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,Y.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,Y.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 Qi extends Y.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 dn;case"video":case"videoWithoutSrc":return Zi;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===Mr&&this.props.onClickImage&&(this.props.onClickImage(),e.preventDefault())}}const Gi=qt("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column"}})),Xi=qt("div")({width:"100%",height:"100%",maxWidth:"100%",minHeight:"420px",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),Ji=qt("div")((e=>{let{autoSizes:t}=e;return{overflow:"auto",flexGrow:t?"0":"1",height:t?"auto":"100%",display:"flex",flexDirection:"column",width:"100%"}})),eo=qt("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"}})),to=qt("video")({maxWidth:"100%"}),no=qt("img")({maxWidth:"100%",flexShrink:"0"});class ro extends Qi{render(){const{theme:e,src:t,label:n,alt:r}=this.props,{imageLoaded:i}=this.state;return(0,Y.h)(Y.Fragment,null,!i&&(0,Y.h)(eo,{imageLoaded:i,theme:e},(0,Y.h)(dn,{fillColor:e.getCSSColor("icon.mediaBanner"),ariaHidden:!0})),i&&(0,Y.h)(no,{src:t,alt:r||n}))}}const io=e=>{var t,n;let{src:r,alt:i,cardInstanceId:o}=e;const a=oe(null),s=le(Mi).analyticsDispatcher,l="string"==typeof r&&null!==(t=null===(n=r.match(/[^\/]*$/))||void 0===n?void 0:n[0])&&void 0!==t?t:"";return re((()=>{var e,t,n,i;const c=()=>{s.sendEvent({eventName:ct,cardInstanceId:o,cardViewState:"subview",properties:{media:l,mediaURL:r}})},d=()=>{s.sendEvent({eventName:dt,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",c),null===(n=a.current)||void 0===n||null===(i=n.base)||void 0===i||i.addEventListener("ended",d),()=>{var e,t,n,r;null===(e=a.current)||void 0===e||null===(t=e.removeEventListener)||void 0===t||t.call(e,"play",c),null===(n=a.current)||void 0===n||null===(r=n.removeEventListener)||void 0===r||r.call(n,"ended",d)}}),[]),(0,Y.h)(to,{ref:a,src:r,alt:i||"video",autoplay:!0,controls:!0})},oo=e=>{let{theme:t}=e;return(0,Y.h)(me.lj,{actions:ge,mapToProps:e=>{const t=ke(e);return{embedMode:e.application.embedMode,cardInstanceId:null==t?void 0:t.cardInstanceId,currentMediaItem:t&&Oe(t)?t.item:void 0}}},(e=>{const n=e.currentMediaItem;if(!n)return null;const r="modal-subview"===e.embedMode?di:ci,i="launcher"===e.embedMode;return(0,Y.h)(Gi,{theme:t,id:ji},(0,Y.h)(r,{title:`View ${n.type}`,theme:t,actionHandler:e.navigateBack}),(0,Y.h)(Ji,{autoSizes:i},(0,Y.h)(Xi,{theme:t},"image"==n.type&&(0,Y.h)(ro,{mediaType:n.type,src:n.url,label:n.title,alt:n.alt,theme:t}),"video"==n.type&&(0,Y.h)(io,{src:n.url,alt:n.alt,cardInstanceId:e.cardInstanceId}))))}))};var ao=n(6083),so=n.n(ao),lo=n(9331),co=n.n(lo),uo=n(5932),ho=n.n(uo),po=n(4844),mo=n.n(po),go=n(4801),vo=n.n(go),fo=n(7754),bo=n.n(fo),yo=n(6254),wo=n.n(yo),So=n(5886),ko=n.n(So);const Co=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.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"}))},xo=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.h)("path",{d:"M6.16235 11L1.16235 6L6.16235 1",stroke:t,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},Io=qt("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())})),Oo=qt("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"}}})),To=qt("span")({fontSize:"15px"}),Mo=qt("span")({fontSize:"15px",fontWeight:"normal"}),Fo=e=>{var t,n;let{theme:r,month:i,year:o="",onBack:a,onForward:s,locale:l}=e;return(0,Y.h)(Oo,{theme:r},(0,Y.h)(Io,{theme:r,onClick:a,"aria-label":"previous month"},(0,Y.h)(xo,{fillColor:null!==(t=r.getCSSColor("background.datePickerCalendarMonthNavArrows",{skipFallback:!0}))&&void 0!==t?t:"rgba(0,0,0,0.5)"})),(0,Y.h)("h1",{className:"MonthDisplay","aria-live":"assertive"},(0,Y.h)(To,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,Y.h)(Mo,null,o)),(0,Y.h)(Io,{theme:r,onClick:s,"aria-label":"next month"},(0,Y.h)(Co,{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 Do=qt("button")((e=>{var t,n,r,i,o,a,s;let{isDisabled:l,isSelected:c,isToday:d,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";d&&!c?p=null!==(r=h.getCSSColor("text.datePickerCalendarCurrentDate",{skipFallback:!0}))&&void 0!==r?r:f:c?(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}})),Ao=e=>{let{theme:t,date:n,dateLabel:r,style:i,col:o,onSelect:a,onHover:s,onFocus:l}=e,c=jo(e,["theme","date","dateLabel","style","col","onSelect","onHover","onFocus"]);const d=oe(null);return(0,Y.h)(Do,{"data-testid":"calendar-day-button",ref:d,title:r,"aria-label":r,"aria-selected":c.isSelected?"true":"false","aria-disabled":c.isDisabled?"true":"false","aria-colindex":o,role:"gridcell",key:n,style:i,class:`CalendarDay ${Fe(c)}`,isToday:ko()(n),isDisabled:c.isDisabled,isSelected:c.isSelected,isFocused:c.isFocused,theme:t,tabIndex:"-1",onMouseDown:e=>{e.stopPropagation(),c.isDisabled||(d.current&&document.activeElement!==d.current&&d.current.base.focus(),a(n))},onMouseEnter:()=>{c.isDisabled||s(n)},onMouseLeave:()=>{c.isDisabled||s(null)},onFocus:()=>{c.isDisabled||l(n)}},n.getDate())},_o=qt("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`}}})),Eo=qt("div")({padding:"5px"}),Lo=qt("div")({}),Ho=qt("div")({display:"grid",gridTemplate:"auto / repeat(7, 1fr)"}),Po=qt("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"}})),Ro=qt("div")({display:"grid",gridTemplate:"auto / repeat(7, 1fr)","-ms-grid-rows":"auto","-ms-grid-columns":"(1fr)[7]",marginBottom:"5px"}),Vo=e=>{const{month:t,year:n,isDateHovered:r,isDateFocused:i,isDateSelected:o,isDateInRange:a,isDateEnabled:s,onDateFocused:l,onDateHovered:c,onDateSelected:d,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=je(t,n||0),y=e=>{let{date:t,style:n,col:u}=e;return(0,Y.h)(Ao,{key:t,theme:v,date:t,col:u,dateLabel:_e()(t,"dddd, MMMM D, YYYY"),style:n,isToday:ko()(t),isHovered:r(t),isFocused:i(t),isSelected:o(t),isInRange:a(t),isDisabled:m||!s(t),onSelect:d,onHover:c,onFocus:l})};return(0,Y.h)(_o,{theme:v},(0,Y.h)(Fo,{theme:v,month:t,year:n,onBack:u(-1),onForward:u(1),onChangeYear:h,locale:g,disabled:m}),(0,Y.h)(Eo,{className:"Calendar",role:"grid",ref:p,tabIndex:0,"aria-colcount":7,"aria-rowcount":6,"aria-label":"Calendar picker"},(0,Y.h)(Ro,{role:"row"},f.map((e=>{let{dayName:t,style:n,col:r}=e;return(0,Y.h)(Po,{key:t,theme:v,style:n,role:"columnheader","aria-colindex":r,"aria-label":t},(0,Y.h)("abbr",null,t.slice(0,1)))}))),(0,Y.h)(Lo,{role:"rowgroup"},(0,Y.h)(Ho,{role:"row","aria-rowIndex":1},b.week1.map(y)),(0,Y.h)(Ho,{role:"row","aria-rowIndex":2},b.week2.map(y)),(0,Y.h)(Ho,{role:"row","aria-rowIndex":3},b.week3.map(y)),(0,Y.h)(Ho,{role:"row","aria-rowIndex":4},b.week4.map(y)),(0,Y.h)(Ho,{role:"row","aria-rowIndex":5},b.week5.map(y)),(0,Y.h)(Ho,{role:"row","aria-rowIndex":6},b.week6.map(y)))))};function $o(){return $o=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},$o.apply(this,arguments)}const No="DatePicker",zo="DateRangePicker";class Wo extends Y.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,Y.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===Ur)return void(this.props.onCancel&&this.props.onCancel());e.preventDefault();const{shiftKey:r,key:i}=e,o=i===Vr,a=i===Nr,s=i===zr,l=i===Wr,c=i===Pr,d=i===Lr,u=i===Rr,h=i===Hr,p=i===$r,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=so()(g,-1);m(e)&&this.onDateFocused(e)}else if(r&&l){const e=so()(g,1);m(e)&&this.onDateFocused(e)}else if(s){const e=co()(g,-1);m(e)&&this.onDateFocused(e)}else if(l){const e=co()(g,1);m(e)&&this.onDateFocused(e)}else if(d){const e=ho()(g,-1);m(e)&&this.onDateFocused(e)}else if(h){const e=ho()(g,1);m(e)&&this.onDateFocused(e)}else if(c){const e=mo()(g,-1);m(e)&&this.onDateFocused(e)}else if(u){const e=mo()(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===No)n&&n(e);else if(t===zo){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 vo()(e,this.state.focused)}isDateHovered(e){return vo()(e,this.state.hovered)}isDateSelected(e){return(this.props.type===No?[this.props.date]:[this.props.startDate,this.props.endDate]).some((t=>!!t&&vo()(t,e)))}isDateInRange(e){if(this.props.type===No)return!1;const{startDate:t,endDate:n}=this.props,{focused:r,hovered:i}=this.state,o=n||(t&&r&&!vo()(t,r)?r:i);return!(!t||!o||bo()(o,t))&&wo()(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,Y.h)(Vo,{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 Uo=e=>(0,Y.h)(Wo,$o({type:No},e));function qo(){return qo=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},qo.apply(this,arguments)}const Bo=qt("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",marginBottom:"20px",padding:`10px ${void 0!==i?i:20}px`,flexGrow:"1",cursor:r||"pointer"})})),Yo=e=>{let{nodeKey:t,children:n,mode:r,cursor:i,ref:o,theme:a,onClick:s,tabFocusable:l,innerRef:c,hPadding:d,accessibleAttributes:u}=e;const h=l?e=>{e.charCode===Mr&&s&&(e.preventDefault(),s())}:void 0;return(0,Y.h)("div",{ref:o},(0,Y.h)(Bo,qo({key:t,"data-element-key":t,mode:r,theme:a,cursor:i,class:"component-field-wrapper",onClick:s,onKeyPress:h,tabIndex:l?0:void 0,ref:c,hPadding:d},u),n))},Ko=qt("div")((e=>{let{thumbnailUrl:t,theme:n}=e;return{backgroundColor:n.getCSSColor("background.media"),borderRadius:n.getShape("borderRadius.media"),width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",marginRight:"10px",backgroundImage:`url(${t})`,backgroundSize:"cover",backgroundPosition:"center",alignSelf:"start"}})),Zo=e=>{let{thumbnailUrl:t,theme:n}=e;return(0,Y.h)(Ko,{thumbnailUrl:t,theme:n})},Qo=qt("div")((e=>{let{theme:t,mode:n}=e;return 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"})})),Go=e=>{let{theme:t,children:n,mode:r,name:i}=e;return(0,Y.h)(Qo,{theme:t,mode:r,id:i,"aria-hidden":!n},n)},Xo=e=>{let{fillColor:t,ariaHidden:n}=e;return(0,Y.h)("svg",{width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":n},(0,Y.h)("path",{d:"M1 1L6 6L11 1",stroke:t,"stroke-opacity":"1","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},Jo=qt("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({color:t.getCSSColor("text.error")},t.getCSSFontProperties("error")),{margin:"-10px 0 30px 0"})})),ea=e=>{let{theme:t,cardInstanceId:n,subviewId:r,name:i,variableResolver:o}=e;return(0,Y.h)(me.lj,{mapToProps:e=>{let{validationStates:t}=e;return{validationStates:t}}},(e=>{let{validationStates:a}=e;const s=a[n]||{};let l;var c,d,u;r?l=null===(c=s.subviews)||void 0===c||null===(d=c[r])||void 0===d?void 0:d[i]:l=null===(u=s.validations)||void 0===u?void 0:u[i];return l&&l.errorMessage?(0,Y.h)(Jo,{theme:t,role:"alert","data-testid":"validation"},o(l.errorMessage)):null}))},ta=qt("div")((e=>{let{theme:t,mode:n}=e;return Object.assign(Object.assign({},t.getCSSFontProperties("stacked"===n?"pinned":"primary")),{display:"stacked"===n?"block":"inherit",flexGrow:"1",cursor:"pointer"})})),na=qt("div")((()=>({justifyContent:"space-between",alignItems:"center"}))),ra=qt("div")((()=>({"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none"}))),ia=qt("div")((e=>{let{open:t,openPosition:n,height:r,theme:i}=e;return Object.assign(Object.assign({position:"absolute",top:`${n}px`,left:t?"20px":"-999px",width:"calc(100% - 40px)",marginBottom:"20px",backgroundColor:"white",boxShadow:"0px 2px 10px 0px rgba(0, 0, 0, 0.2)",cursor:"pointer",height:`${r}px`,maxHeight:"335px",overflow:"auto",zIndex:ws.DROPDOWN,borderRadius:"5px",color:"black"},i.getCSSFontProperties("primary")),{visibility:t?"visible":"hidden"})})),oa=qt("div")((e=>{let{theme:t,disabled:n}=e;return Object.assign({padding:"20px",":hover":{backgroundColor:"rgba(0,0,0,0.05)"},":active":{backgroundColor:"rgba(0,0,0,0.1)"},border:"0px",color:n?"rgba(0,0,0,0.3)":"initial"},t.getElementFocusCSSProperties())})),aa=qt("div")((e=>{let{theme:t,mode:n}=e;return Object.assign(Object.assign({},t.getCSSFontProperties("stacked"===n?"primary":"secondary")),{marginRight:"10px",color:"stacked"===n?t.getCSSColor("text.primary"):t.getCSSColor("text.secondary"),paddingTop:"stacked"===n?"2px":"0px"})})),sa=e=>{let{onClick:t,children:n,ref:r,theme:i,disabled:o,isSelected:a}=e;return(0,Y.h)(oa,{onClick:t,ref:r,tabIndex:"-1",theme:i,disabled:o,"aria-disabled":o,"aria-selected":a,role:"option"},n)},la=e=>{let{children:t,mode:n,theme:r,ariaLabel:i}=e;return(0,Y.h)(aa,{theme:r,mode:n,class:"dropdown-selected-value","aria-label":i},t)},ca=(e,t,n,r)=>{var i,o,a,s,l,c;let d=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();d=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,d=r.top-n.top-p,u=d+t.offsetHeight,h=e.offsetHeight}}e.style.height="auto";const S=d-20+(m?m.scrollTop:0),k=h-u-20,C=S-(null!==(o=null===(l=m)||void 0===l?void 0:l.scrollTop)&&void 0!==o?o:0),x=(null!==(a=null===(c=m)||void 0===c?void 0:c.offsetHeight)&&void 0!==a?a:h)-C-20-t.offsetHeight,I=e.offsetHeight;e.style.height="";const O=t.offsetTop,T={openPosition:O+t.offsetHeight+10,height:I},M={openPosition:O-I-10,height:I};return I<=x?T:I<=C?M:I<=k?T:I<=S?M:{openPosition:O,height:Math.min(I,k+t.offsetHeight)}},da=pr.forwardRef(((e,t)=>{let{nodeKey:n,cardInstanceId:r,subviewId:i,embedMode:o,attributes:{format:a,defaultValue:s,thumbnailSrc:l,label:c,name:d,values:u,placeholder:h},validations:p,theme:m,variableResolver:g,onValueChanged:v}=e;const[f,b]=te(!1),[y,w]=te(0),[S,k]=te(0),[C,x]=te(s?g(s.toString()):null),[I,O]=te(-1),T=oe(null),M=oe(null),F=oe(null),j=oe(null),D=oe(s?g(s.toString()):null),A=u.find((e=>{let{value:t}=e;return C===t}));ae(t,(()=>({getCurrentValue:()=>C,setCurrentValue:e=>x(e)}))),re((()=>{const e=e=>{T.current&&!T.current.base.contains(e.target)&&(f&&Be().validateField(r,d,C,p),b(!1))},t=e=>{var t,n;(null==F||null===(t=F.current)||void 0===t||null===(n=t.base)||void 0===n?void 0:n.contains(document.activeElement))&&e.key===Nr&&(b(!1),M.current.base.focus())};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}})),re((()=>{if(v)v(C);else{const e=Ye(r,d,i);e?(D.current=e.toString(),x(e)):Be().handleFormChange(r,d,C,i)}F.current&&j.current&&(F.current.base.scrollTop=j.current.base.offsetTop)}),[]),re((()=>{const e=s?g(s.toString()):null;e!==D.current&&(C===D.current&&(v?v(e):Be().handleFormChange(r,d,e,i),x(e)),D.current=s?g(s.toString()):null)}),[s]),re((()=>{if(f){const e=u.findIndex((e=>C===e.value));O(Math.max(0,e))}else O(-1)}),[f]);const _=`dropdown-label-${d}`;return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(0,Y.h)(ra,null,(0,Y.h)(Yo,{nodeKey:n,ref:T,innerRef:M,mode:a,theme:m,tabFocusable:!0,accessibleAttributes:{role:"combobox","aria-haspopup":"listbox","aria-expanded":f,"aria-controls":`${d}-dropdown-body`,"aria-labelledby":_},onClick:()=>{if(T.current){const{openPosition:t,height:n}=ca(F.current.base,T.current.base,!!i,o);w(t),k(n),b((t=>(t&&e.validateField(r,d,C,p,i),!t)))}}},l&&(0,Y.h)(na,null,(0,Y.h)(Zo,{thumbnailUrl:g(l),theme:m})),(0,Y.h)(ta,{mode:a,theme:m},(0,Y.h)(Go,{theme:m,mode:a,name:_},g(c)),(0,Y.h)(la,{theme:m,mode:a},A?A.title:g(h))),(0,Y.h)(Xo,{fillColor:m.getCSSColor("icon.dropdown"),ariaHidden:!0}),(0,Y.h)(ia,{ref:F,open:f,openPosition:y,theme:m,height:S,className:"dropdown-body",id:`${d}-dropdown-body`,role:"listbox"},(0,Y.h)(Kr,{defaultIndex:I,theme:m},u.map(((t,n)=>(0,Y.h)(sa,{onClick:()=>{t.disabled||(x(t.value),v?v(t.value):e.handleFormChange(r,d,t.value,i),e.validateField(r,d,t.value,p,i),M&&M.current&&M.current.base&&M.current.base.focus(),O(n))},ref:t.value===C?j:null,theme:m,disabled:t.disabled,isSelected:t.value===C},t.title)))))),(0,Y.h)(ea,{name:d,cardInstanceId:r,subviewId:i,theme:m,variableResolver:g}))))})),ua=qt("div")((e=>{let{mode:t,theme:n}=e;return Object.assign(Object.assign({},n.getCSSFontProperties("stacked"===t?"pinned":"primary")),{display:"stacked"===t?"block":"inherit",flexGrow:"1",cursor:"pointer"})})),ha=qt("div")((()=>({justifyContent:"space-between",alignItems:"center"}))),pa=qt("div")((()=>({"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none"}))),ma=e=>{var t,n,r,i,a,s,l,c,d,u,h,m;let{nodeKey:g,cardInstanceId:v,subviewId:f,attributes:{format:b,defaultValue:y,thumbnailSrc:w,label:S,name:k,placeholder:C},controlledDateValidator:x,validations:I,theme:O,variableResolver:T,onValueChanged:M,embedMode:F}=e;const j=y?new Date(y):void 0,D=oe(j?(0,o.addMinutes)(j,j.getTimezoneOffset()):null),[A,_]=te(!1),[E,L]=te(0),[H,P]=te(0),[R,V]=te(D.current),$=oe(null),N=oe(null),z=oe(null),W=(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===(a=I.minimumDate)||void 0===a||null===(s=a.attributes)||void 0===s?void 0:s.minimumDate)?new Date(null==I||null===(l=I.minimumDate)||void 0===l||null===(c=l.attributes)||void 0===c?void 0:c.minimumDate):void 0,q=new Date;let B=new Date;if(W&&U){if(!(q<=W&&q>=U)){B=Math.abs((0,o.differenceInSeconds)(q,W))<Math.abs((0,o.differenceInSeconds)(q,U))?W:U}}else if(U){q>=U||(B=U)}else if(W){q<=W||(B=W)}const K=R?new Date(R):new Date(B);K.setHours(0,0,0,0);const Z=()=>{A&&Be().validateField(v,k,R,I,f),_(!1)};let Q;re((()=>{const e=e=>{z.current&&!z.current.base.contains(e.target)&&$.current&&!$.current.base.contains(e.target)&&Z()};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}})),re((()=>{const e=R?R.toISOString():void 0,t=R?_e()(R,p):null;if(M)M(e);else{const e=Ye(v,k,f);e?(D.current=new Date(e),V(e)):Be().handleFormChange(v,k,t,f)}}),[]),re((()=>{var e;const t=y?new Date(y):void 0,n=t?(0,o.addMinutes)(t,t.getTimezoneOffset()):null;if((null==n?void 0:n.toDateString())!==(null===(e=D.current)||void 0===e?void 0:e.toDateString())){if(R===D.current){const e=n?n.toISOString():void 0,t=n?_e()(n,p):null;M?M(e):Be().handleFormChange(v,k,t,f),V(n)}D.current=n}}),[y]),x?Q=x:((null==I||null===(d=I.maximumDate)||void 0===d||null===(u=d.attributes)||void 0===u?void 0:u.maximumDate)||(null==I||null===(h=I.minimumDate)||void 0===h||null===(m=h.attributes)||void 0===m?void 0:m.minimumDate))&&(Q=e=>{var t,n,r,i;const o=null===(t=I.maximumDate)||void 0===t||null===(n=t.attributes)||void 0===n?void 0:n.maximumDate,a=null===(r=I.minimumDate)||void 0===r||null===(i=r.attributes)||void 0===i?void 0:i.minimumDate,s=o?De(o,{isMax:!0}):void 0,l=a?De(a,{isMin:!0}):void 0;return(!s||e<=s)&&(!l||e>=l)});const G=`datepicker-label-${k}`,X=R?_e()(R,"DD MMM YYYY"):T(C),J=()=>{N&&N.current&&N.current.base&&N.current.base.focus()};return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(0,Y.h)(pa,null,(0,Y.h)(Yo,{nodeKey:g,ref:$,innerRef:N,mode:b,theme:O,tabFocusable:!0,accessibleAttributes:{role:"button","aria-haspopup":"dialog","aria-expanded":A,"aria-labelledby":G},onClick:()=>{if($.current){const{openPosition:t,height:n}=ca(z.current.base,$.current.base,!!f,F);L(t),P(n),_((t=>(t&&e.validateField(v,k,R,I,f),!t)))}}},w&&(0,Y.h)(ha,{mode:b},(0,Y.h)(Zo,{thumbnailUrl:T(w),theme:O})),(0,Y.h)(ua,{mode:b,theme:O},(0,Y.h)(Go,{theme:O,mode:b,name:G},T(S)),(0,Y.h)(la,{theme:O,mode:b,ariaLabel:X},X)),(0,Y.h)(Xo,{fillColor:O.getCSSColor("icon.dropdown"),ariaHidden:!0})),(0,Y.h)(ia,{ref:z,open:A,openPosition:E,theme:O,height:H},(0,Y.h)(Uo,{date:K,open:A,theme:O,onDateSelected:t=>{V(t);const n=t?_e()(t,p):void 0,r=t?t.toISOString():void 0;M?M(r):e.handleFormChange(v,k,n,f),e.validateField(v,k,r,I,f),_(!1),J()},onCancel:()=>{Z(),J()},isDateEnabled:Q})),(0,Y.h)(ea,{theme:O,name:k,cardInstanceId:v,subviewId:f,variableResolver:T}))))},ga=15,va=(0,o.startOfDay)(new Date),fa=e=>{let{cardInstanceId:t,attributes:{format:n,name:r,label:i,defaultValue:a},validations:s,theme:l,maxDateTime:c,selectedDate:d,selectedTime:u,isWorkflow:h,variableResolver:p,onValueChanged:m}=e;const g=new Date(a),[v,f]=te(""),b=oe(null),y=oe([...Array(96).keys()].map((e=>({title:(0,o.format)((0,o.addMinutes)(va,e*ga),"h:mm A"),value:""+e*ga,disabled:!1})))),w=e=>{let t="";return e.forEach((e=>{e.disabled||(t=e.value)})),t};re((()=>{if(d){const t=y.current.map(((e,t)=>{const n=(0,o.addMinutes)(d,t*ga);return e.disabled=!!(c&&n>=c),e}));if(y.current=t,u&&c){if((0,o.addMinutes)(d,u||0)>c){const t=w(y.current);var e;if(t)null==m||m(t),null===(e=b.current)||void 0===e||e.setCurrentValue(t)}}}}),[c,d]);return(0,Y.h)(da,{ref:b,attributes:{name:r,label:i,format:n,values:y.current,defaultValue:(()=>{const e=ba(g);if(c){var t;const n=(0,o.differenceInMinutes)(c,(0,o.startOfDay)(g)),r=w(y.current);if(g>c)return Number(r);if(e<n)return e;const i=(0,o.differenceInMinutes)(c,(0,o.startOfDay)(c));return f((0,o.format)((0,o.addMinutes)(va,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})},ba=e=>Math.ceil(((0,o.differenceInMinutes)(e,(0,o.startOfDay)(e))+5)/ga)*ga,ya=qt("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:"static"}})),wa=qt("div")((()=>({position:"static",top:"60px",bottom:"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"hidden",padding:"0 20px"}))),Sa=qt("div")({overflow:"auto",paddingTop:"10px","> button":{marginBottom:"20px"}}),ka=t=>{let{theme:n}=t;const r=le(Mi),i=r.analyticsDispatcher,a=r.cardEventDispatcher,s=r.authTokenProvider,[l,c]=te(void 0),[d,h]=te(0),p=new Date;return(0,Y.h)(me.lj,{actions:(0,e.Y2)(ge,Pt),mapToProps:e=>{const t=ke(e);let n,r,i;return t&&xe(t)&&(n=t.cardInstanceId,r=t.source,i=t.cardExpiry),{screenTitle:e.application.customStrings.cardSnoozeTitle||"Remind me",embedMode:e.application.embedMode,snoozeCardInstanceId:n,source:r,snoozeCardExpiry:i}}},(e=>{const[t,r]=te(p),[m,g]=te(0),v=e.snoozeCardInstanceId,f=e.snoozeCardExpiry,b=e.source;if(!v||!b)return null;const y=e.screenTitle,w="modal-subview"===e.embedMode?di:ci;re((()=>{i.sendEvent({eventName:it,cardInstanceId:v,cardViewState:"subview"})}),[]);return(0,Y.h)(ya,{theme:n,id:ji},(0,Y.h)(w,{title:y,theme:n,actionHandler:()=>{i.sendEvent({eventName:ot,cardInstanceId:v,cardViewState:"subview"}),e.navigateBack()}}),(0,Y.h)(wa,{class:"use-offset"},(0,Y.h)(Sa,{class:"offset-child"},(0,Y.h)(ma,{cardInstanceId:v,attributes:{name:"snoozeDate",label:"Date",defaultValue:_e()(p,"YYYY-MM-DD[T]00:00:00.000[Z]"),format:"inline"},isWorkflow:!0,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{r(new Date(e))},controlledDateValidator:f?e=>{if(f){return e<=new Date(f)}return!0}:void 0}),(0,Y.h)(fa,{attributes:{name:"snoozeTime",label:"Time",defaultValue:p.toISOString(),format:"inline"},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}),(0,Y.h)(il,{isWorkflow:!0,clickHandler:()=>()=>{const n=Ca(t,m);if((0,o.isPast)(n)){const e=d+1;h(e),c({text:"Date must be in the future",messageId:`${e}`,cardInstanceId:v,action:"other"})}else e.navigateBack(),Js(u().getState(),e,v,n,a,s,b)},text:"Done",theme:n,appearance:"primary"}))),(0,Y.h)(vi,{theme:n,message:l,actionTitle:"Dismiss",onDismiss:()=>{}}))}))},Ca=(e,t)=>(0,o.addMinutes)((0,o.startOfDay)(e),t);var xa=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 Ia=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,o.format)(t,e.defaultFormatterOption||"");default:return String(e.defaultValue)}},Oa=(e,t,n,r,i,o,a)=>xa(void 0,void 0,void 0,(function*(){const s=`feed/${e}${a?"?filters="+JSON.stringify(a):""}`,l=yield Td.get(s,t,r||"",{streamContainerId:e});if(304===l.response.status)return Qe.debug({level1:["Feed unchanged response received by HTTP"]}),{};if(200===l.response.status){Qe.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 ja(e,n,i);return{lastModified:l.response.etag,cardInstances:e,metadata:t,unfilteredCardInstanceCount:r,runtimeVariables:a}}return{error:l.response.error}})),Ta=(e,t,n,r)=>xa(void 0,void 0,void 0,(function*(){const i=yield Td.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}})),Ma=(e,t,n)=>xa(void 0,void 0,void 0,(function*(){const r=yield Td.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}})),Fa=(e,t,n,r)=>xa(void 0,void 0,void 0,(function*(){const i=yield Td.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}})),ja=(e,t,n)=>xa(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,Ia(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{}})),Da=()=>({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})}}),Aa=(e,t,n)=>({getTheme:r=>new Jt(e,r,t,n)});var _a=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 Ea="theme_cache",La=()=>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(Ea).createIndex("stream_container_id","stream_container_id",{unique:!0})}}));var Ha=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 Pa=(e,t)=>Ha(void 0,void 0,void 0,(function*(){const n=`theme/${e}`,{data:r,response:i}=yield Td.get(n,void 0,t,{streamContainerId:e});if(200===i.status){if(r&&r.theme){try{yield((e,t,n)=>_a(void 0,void 0,void 0,(function*(){const r=yield La();return new Promise(((i,o)=>{const a=r.transaction(Ea,"readwrite").objectStore(Ea).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}})),Ra=e=>Ha(void 0,void 0,void 0,(function*(){try{const t=yield(e=>_a(void 0,void 0,void 0,(function*(){const t=yield La();return new Promise(((n,r)=>{const i=t.transaction(Ea,"readonly").objectStore(Ea).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 Va extends Y.Component{componentDidCatch(e){this.props.onError?this.props.onError(e):console.error(e)}render(){return this.props.children}}const $a=e=>{let{fontFamilies:t}=e;return(0,Y.h)("style",{dangerouslySetInnerHTML:{__html:t.map((e=>za(e))).join("\n")}})},Na={ttf:"truetype",otf:"opentype",woff:"woff",woff2:"woff2"},za=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=Na[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 `},Wa=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"}),Ua=qt("textarea")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},Wa(t)),{resize:"none",boxSizing:"content-box",paddingLeft:"0px",paddingRight:"0px"})})),qa=qt("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({},Wa(n)),t?{lineHeight:`${t}px`}:{})})),Ba=(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 Ya=null;const Ka=pr.forwardRef(((e,t)=>{let{nodeKey:n,cardInstanceId:r,subviewId:i,attributes:{defaultValue:o,numberOfLines:a,name:s,thumbnailSrc:l,placeholder:c,maxLength:d},minimumLines:u,validations:h,theme:p,variableResolver:m,onValueChanged:g}=e;const v=oe(null),f=oe(o),[b,y]=te(m(o)),w=1===a?qa:Ua;re((()=>{const{current:{base:e}}=v;Ba(e,a,u)})),re((()=>{const e=Ye(r,s,i);e?(f.current=e,y(e)):Be().handleFormChange(r,s,b,i)}),[]),re((()=>{if(o!==f.current){if(b===m(f.current)){const e=m(o);y(e),Be().handleFormChange(r,s,e,i)}f.current=o}}),[o]);const S=m(c);return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(ae(t,(()=>({clearInput:()=>{y(""),v.current.base&&Ba(v.current.base,a),e.handleFormChange(r,s,"",i)}}))),(0,Y.h)(Y.Fragment,null,(0,Y.h)(Yo,{nodeKey:n,mode:"inline",theme:p},l&&(0,Y.h)(Zo,{thumbnailUrl:m(l),theme:p}),(0,Y.h)(w,{theme:p,ref:v,placeholder:S,value:b,maxlength:d,className:"input-text",onInput:t=>{const{current:{base:n}}=v,{value:o}=t.target;y(o),Ba(n,a),((e,t)=>{null!==Ya&&(clearTimeout(Ya),Ya=null),Ya=setTimeout((()=>{t(r,s,null!=e?e:void 0,h,i)}),200)})(o,e.validateField),e.handleFormChange(r,s,o,i),g&&g(o)},rows:"1"})),(0,Y.h)(ea,{name:s,cardInstanceId:r,subviewId:i,theme:p,variableResolver:m})))))})),Za=qt("div")((e=>{let{theme:t}=e;return Object.assign({padding:"10px 20px",display:"flex",width:"100%",alignItems:"center",border:"0px"},t.getElementFocusCSSProperties())})),Qa=qt("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"))})),Ga=qt("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%"}})),Xa=e=>{let{title:t,value:n,checked:r,onValueSelected:i,theme:o}=e;return(0,Y.h)(Za,{onClick:()=>{i(n)},role:"radio","aria-checked":r,theme:o,tabIndex:"-1"},(0,Y.h)(Qa,{theme:o},t),(0,Y.h)(Ga,{checked:r,theme:o}))},Ja=qt("div")((e=>{let{}=e;return{display:"flex",flexFlow:"column wrap",width:"100%"}})),es=qt("div")((e=>{let{}=e;return{display:"none"}})),ts=e=>{let{attributes:{items:t,title:n,name:r},theme:i,onValueChanged:o}=e;const[a,s]=te(null),l=`radio-group-${r}`;return(0,Y.h)(Yo,{mode:"inline",theme:i,hPadding:0},(0,Y.h)(es,{id:l},n),(0,Y.h)(Ja,{role:"radiogroup","aria-labelledby":l},(0,Y.h)(Kr,{theme:i},t.map((e=>(0,Y.h)(Xa,{title:e.title,value:e.value,theme:i,checked:a===e.value,onValueSelected:e=>{s(e),o&&o(e)}}))))))},ns=qt("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:"static"}})),rs=qt("div")((()=>({position:"static",top:"60px",bottom:"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"hidden",padding:"0 20px"}))),is=qt("div")({overflow:"auto",paddingTop:"10px","> button":{marginBottom:"20px"}}),os=qt("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({color:t.getCSSColor("text.error")},t.getCSSFontProperties("error")),{margin:"-10px 0 30px 0"})})),as=t=>{let{theme:n}=t;const r=le(Mi),i=r.analyticsDispatcher,o=r.cardEventDispatcher,a=oe(),[s,l]=te(null),[c,d]=te(null),[u,h]=te(!1);return(0,Y.h)(me.lj,{actions:(0,e.Y2)(ge,Pt),mapToProps:e=>{const t=ke(e),n=t&&Ie(t)?t:void 0;return{embedMode:e.application.embedMode,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?di:ci,r=e.screenTitle,p=e.feedbackCardInstanceId,m=e.feedbackSource,g="positive"===e.feedbackSentiment&&e.textFeedback,v=[{title:"It's not relevant",value:"not-relevant"},{title:"I see this too often",value:"too-often"}];if(e.textFeedback&&v.push({title:"Something else",value:"other"}),!p||!m)return null;const f="positive"===e.feedbackSentiment?"Add optional feedback...":"Add your feedback...";return(0,Y.h)(ns,{theme:n,id:ji},(0,Y.h)(t,{title:r,theme:n,actionHandler:()=>{var t;d(null),null===(t=a.current)||void 0===t||t.clearInput(),e.navigateBack()}}),(0,Y.h)(rs,{class:"use-offset"},(0,Y.h)(is,{class:"offset-child"},"negative"===e.feedbackSentiment&&(0,Y.h)(ts,{attributes:{title:r,name:"feedback-reason",items:v},isWorkflow:!0,cardInstanceId:p,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{l(e)}}),("other"===s||g)&&(0,Y.h)(Y.Fragment,null,(0,Y.h)(Ka,{ref:a,attributes:{name:"feedback-message",defaultValue:"",placeholder:e.textFeedbackLabel&&e.textFeedbackLabel.length>0?e.textFeedbackLabel:f,numberOfLines:0,maxLength:280},minimumLines:3,isWorkflow:!0,cardInstanceId:p,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{if(e.length>=280)return h(!0);h(!1),d(e)}}),u&&(0,Y.h)(os,{theme:n,"data-testid":"feedback-validation-error"},e.validationMessage)),(0,Y.h)(il,{isWorkflow:!0,clickHandler:()=>()=>{var t;if(!g&&null===s)return;if("other"===s&&(null===c||null==c||0===c.trim().length))return;const n="other"===s||g&&c?{message:c}:{};i.sendEvent({cardViewState:"topview",eventName:g?et:tt,cardInstanceId:p,properties:Object.assign(Object.assign({source:m},"negative"===e.feedbackSentiment||null!==c?{reason:g?"other":s}:{}),n)}),e.feedbackReceived(p),o.dispatchCardEvent({type:g?Ti.VOTED_USEFUL:Ti.VOTED_NOT_USEFUL}),d(null),null===(t=a.current)||void 0===t||t.clearInput(),e.navigateBack()},text:"Submit",theme:n,appearance:"primary"}))))}))};var ss=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 ls=()=>window.matchMedia("(prefers-color-scheme: dark)"),cs=qt("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.toast")}})),ds=t=>{let{store:n,onAnalyticsEvent:r,onCardEvent:i,onAuthTokenRequested:o,onError:a}=t;const s=se((()=>({analyticsDispatcher:{sendEvent:(e,t)=>ss(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:()=>ss(void 0,void 0,void 0,(function*(){return yield o()}))},runtimeVariableResolver:void 0})),[r,i,o]);return(0,Y.h)(Va,{onError:a},(0,Y.h)(Mi.Provider,{value:s},(0,Y.h)(me.zt,{store:n},(0,Y.h)(me.lj,{actions:(0,e.Y2)(ge,Pt,$e,ge)},us))))},us=e=>{const{cardFeed:t,messages:n,themeLoading:r,themeLoaded:i,clearMessage:o,application:{interfaceStyle:a,streamContainerId:s},theme:l}=e,[c,d]=te(ls().matches?"dark":"light");if(re((()=>{!function(){ss(this,void 0,void 0,(function*(){const e=yield Ra(s);if(e)i({theme:e.theme}),Pa(s,e.eTag);else{r();const e=yield Pa(s);i(e)}}))}()}),[]),re((()=>{const e=e=>{d(e.matches?"dark":"light")};return ls().addEventListener("change",e),()=>{ls().removeEventListener("change",e)}}),[]),!l.status||!1===l.status.loaded)return null;const u=l.themePayload?Aa(l.themePayload,c,a):void 0;if(!u)return null;const h=u.getTheme("feed"),p=le(Mi),m=p.cardEventDispatcher,g=p.analyticsDispatcher,v=p.authTokenProvider;return(0,Y.h)(cs,{theme:h},(0,Y.h)(vi,{theme:h,feedOrientation:sd(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,c,d,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":Xs(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===(c=e.messages.cardList)||void 0===c?void 0:c.source;t&&Gs(e,e,h,m,v,t);break;case"snooze-failed":const n=null===(d=e.messages.cardList)||void 0===d?void 0:d.snoozeDate,r=null===(u=e.messages.cardList)||void 0===u?void 0:u.source;n&&r&&Js(e,e,h,n,m,v,r)}},onDismiss:()=>{o("cardList")},delay:500}))};function hs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ps;!function(e){e.STATE="state-update",e.ANALYTICS_EVENT="analytics-event-dispatched"}(ps||(ps={}));class ms{constructor(){hs(this,"channel",void 0),hs(this,"isOpen",!1),hs(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 Qe.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 Qe.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 Qe.error({level1:["BroadcastChannel API not supported in this browser"]});this.channel.postMessage(e)}close(){this.channel.close(),this.isOpen=!1}}var gs=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())}))},vs=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 bs=()=>window.matchMedia("(prefers-color-scheme: dark)"),ys=()=>window.getComputedStyle(document.documentElement).getPropertyValue("font-size"),ws={FEED_OVERLAY:"100",CARD_OVERLAY:"110",DROPDOWN:"40",HEADER:"30",BANNER:"20",TOAST:"11",OVERFLOW_MENU:"11",OVERFLOW_MENU_BUTTON:"10",CUSTOM_HEADER:"2"},Ss=qt("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%"}})),ks={fontFamily:'-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',height:"100%",overflow:"hidden"},Cs=qt("div")((e=>{let{embedMode:t}=e;return"launcher"===t?Object.assign(Object.assign({},ks),{borderRadius:"20px",boxShadow:"0 2px 20px 0 rgba(0, 0, 0, 0.1)"}):Object.assign({},ks)})),xs=(pr.forwardRef(((t,n)=>{let{store:r,embedMode:i,applyCardFeedDeltaUpdates:o,cardCountChanged:a,onReady:s,runtimeVariableResolver:l,linkButtonPressed:c,submitButtonPressed:d,onCardListTutorialSeen:u,onAnalyticsEvent:h,onCardEvent:p,onError:m,onAuthTokenRequested:g,onCardFeedSubscribe:v,requestWebSocketReconnect:f,webSocketDisabled:b}=t;const[y,w]=te(bs().matches?"dark":"light"),[,S]=te(ys);re((()=>{const e=e=>{w(e.matches?"dark":"light")};bs().addEventListener("change",e);const t=()=>{S(ys)};return window.addEventListener("browser-font-changed",t),window.addEventListener("pageshow",(e=>{var t;e.persisted&&!(null===(t=k.containersBroadcastChannel)||void 0===t?void 0:t.isOpen)&&(k.containersBroadcastChannel=new ms)})),()=>{bs().removeEventListener("change",e),window.removeEventListener("browser-font-changed",t)}}),[]);const k=se((()=>({analyticsDispatcher:{sendEvent:(e,t)=>gs(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:()=>gs(void 0,void 0,void 0,(function*(){return yield g()}))},runtimeVariableResolver:l,containersBroadcastChannel:"BroadcastChannel"in window?new ms:void 0})),[h,p,g]),C=oe();return ae(n,(()=>({pollCardList:()=>{var e;Qe.debug({level3:["Card feed polling initiated"]}),null===(e=C.current)||void 0===e||e.loadCards(!1)},cancelCardListPolling:()=>{var e;null===(e=C.current)||void 0===e||e.cancelCardListPolling()}}))),"toast"===i?(0,Y.h)(ds,{store:r,onAuthTokenRequested:g}):(0,Y.h)(Va,{onError:m},(0,Y.h)(Mi.Provider,{value:k},(0,Y.h)(me.zt,{store:r},(0,Y.h)(me.lj,{actions:(0,e.Y2)(Pt,Da),mapToProps:e=>{const{cardResponses:t}=e;return vs(e,["cardResponses"])}},(e=>{let{cardFeed:t,pendingCardFeedUpdates:n,cardStates:r,navigationStack:i,cardFeedLoading:h,cardFeedLoaded:p,themeLoading:m,themeLoaded:g,finishExternalAction:w,application:{open:S,cardListRefreshInterval:k,streamContainerId:x,runtimeVariableResolutionTimeout:I,isPreview:O,embedMode:T,customStrings:M,cardLimit:F,firstLoadStyles:j,interfaceStyle:D},externalAction:A,theme:{themePayload:_}}=e;const E=i.items.length?i.items[i.items.length-1]:void 0;let L;switch(null==E?void 0:E.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,Y.h)(Ss,{embedMode:T,feedOrientation:sd(t.horizontalContainerConfig),id:"action-cards-sdk-app-root",class:"atomic-sdk-root","data-contentLabel":L},(0,Y.h)(Is,{ref:C,streamContainerId:x,runtimeVariableResolutionTimeout:I,runtimeVariablesResolver:l,themePayload:_,cardFeed:t,pendingCardFeedUpdates:n,cardStates:r,cardLimit:F,onThemeLoading:m,onThemeLoaded:g,onCardFeedLoading:h,onCardFeedLoaded:p,onCardFeedSubscribe:v,streamFilter:t.streamFilter,requestWebSocketReconnect:f,webSocketDisabled:b,currentNavigationItem:E,applicationOpen:S,onReady:s,onCardCountChanged:a,applyCardFeedDeltaUpdates:o,cardListRefreshInterval:k,isPreview:O,cardListTitle:M.cardListTitle,embedMode:T,externalAction:A,finishExternalAction:w,onLinkButtonPressed:c,onSubmitButtonPressed:d,cardListTutorialSeen:t.tutorialSeen,onCardListTutorialSeen:u,firstLoadStyles:j,colourScheme:y,interfaceStyle:D,noInternetConnectionMessage:M.noInternetConnectionMessage,dataLoadFailedMessage:M.dataLoadFailedMessage,tryAgainTitle:M.tryAgainTitle}))})))))})),e=>"modal-subview"!==e);class Is extends Y.Component{constructor(e){super(e),fs(this,"pollCounter",0),fs(this,"poll",void 0),this.poll=null}componentDidMount(){return gs(this,void 0,void 0,(function*(){this.props.onReady(),xs(this.props.embedMode)&&this.loadTheme()}))}componentWillUnmount(){this.cancelCardListPolling()}componentDidUpdate(t){var n,r;const{cardFeed:i,externalAction:o}=t,{cardFeed:a,pendingCardFeedUpdates:s,cardStates:l,onCardCountChanged:c,externalAction:d,embedMode:h}=this.props;if("modal-subview"===h||"toast"===h)return;const p=a.cardInstances.map((e=>e.instance.id)),m=i.cardInstances.map((e=>e.instance.id));var g;ud(p,m)&&(null===(n=i.metadata)||void 0===n?void 0:n.totalCards)===(null===(r=a.metadata)||void 0===r?void 0:r.totalCards)||this.poll&&c&&c(a.cardInstances.length,null===(g=a.metadata)||void 0===g?void 0:g.totalCards);if(!i.tutorialSeen&&a.tutorialSeen&&this.props.onCardListTutorialSeen&&this.props.onCardListTutorialSeen(),d&&d.actionId!==(null==o?void 0:o.actionId)&&this.handleExternalAction(d),i.runtimeVariables.updateId!==a.runtimeVariables.updateId&&this.trackRuntimeVariablesChanged(a),Object.values(l).every((e=>null===e))&&s&&s.length>0){const t=(0,e.kv)((0,e.Y2)(Pt,Da),u());this.props.applyCardFeedDeltaUpdates(t,s)}}trackRuntimeVariablesChanged(e){const t=this.context.analyticsDispatcher,n=!1===e.runtimeVariableAnalyticsEnabled;e.cardInstances.forEach((r=>{if(r.runtimeVariables&&r.runtimeVariables.values){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:nt,properties:{resolvedVariables:r.runtimeVariables.reduce(((e,t)=>(e[t.name]=(null==o?void 0:o.get(t.name))||"",e)),{})}},n)}}))}loadTheme(){return gs(this,void 0,void 0,(function*(){const{streamContainerId:e,onThemeLoading:t,onThemeLoaded:n}=this.props,r=yield Ra(e);if(r)n({theme:r.theme}),Pa(e,r.eTag);else{t();n(yield Pa(e))}const i=u().getState().theme.status;i&&i.loaded&&this.subscribeToCardFeedUpdates()}))}loadCards(e){return gs(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:c}=this.props;e||n();const d=yield Oa(i,t.authTokenProvider,o,a.lastModified,s,l,c);e&&d.error||r(d),u().getState().cardFeed.status.loaded&&this.pollForNewCards()}))}handleExternalAction(e){return gs(this,void 0,void 0,(function*(){const t=this.context,n=t.analyticsDispatcher,r=t.containersBroadcastChannel,i=()=>gs(this,void 0,void 0,(function*(){var t;return n.sendEvent({cardInstanceId:e.cardInstanceId,cardViewState:e.cardViewState,eventName:Je,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!==ps.ANALYTICS_EVENT)return;const a=null===(i=n.data)||void 0===i?void 0:i.eventQueued;a.eventName===Je&&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&&xs(n)&&(this.poll=setTimeout((()=>gs(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,Qe.debug({level3:["Attempt to reconnect websocket initiated"]}),this.props.requestWebSocketReconnect())}))),t))}cancelCardListPolling(){this.poll&&Qe.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:c,tryAgainTitle:d}=e;const h=u().getState(),p="modal-subview"===r;if(!h.theme.status)return p?null:(0,Y.h)(Cs,{embedMode:r,id:ji});if(!1===h.theme.status.loaded)return p?null:(0,Y.h)(Cs,{embedMode:r,id:ji},(0,Y.h)(Oi,{embedMode:r,textColor:o.textColor,loadingIconColor:o.loadingSpinnerColor,buttonColor:o.buttonTextColor,backgroundColor:o.backgroundColor,onRetry:()=>{this.loadTheme()},state:h.theme.status.errorState,noInternetConnectionMessage:l,dataLoadFailedMessage:c,tryAgainTitle:d}));const{applicationOpen:m,themePayload:g}=this.props;let v;v="standalone"===r&&(null===(t=i.horizontalContainerConfig)||void 0===t?void 0:t.enabled)||"single-card"===r?"feed":Oe(n)?"media":Ce(n)?"subview":xe(n)?"snooze":Ie(n)?"feedback":p?void 0:"feed";const f=g?Aa(g,a,s):void 0;if(!v||!f)return null;const b=f.getTheme("feed"),y=f.getTheme("workflow");return(0,Y.h)(Y.Fragment,null,(0,Y.h)(Cs,{theme:b,visible:m,embedMode:r,className:"feed-container",role:"main"},"subview"===v&&(0,Y.h)(Ki,{theme:y}),"media"===v&&(0,Y.h)(oo,{theme:y}),"feed"===v&&(0,Y.h)(Vi,{theme:b,onRetry:()=>(this.props.onCardFeedLoading(),this.subscribeToCardFeedUpdates())}),"snooze"===v&&(0,Y.h)(ka,{theme:y}),"feedback"===v&&(0,Y.h)(as,{theme:y})),(0,Y.h)($a,{fontFamilies:b.getFontFamilies()}),(0,Y.h)(ln,null))}}fs(Is,"contextType",Mi);const Os=Bt({to:{opacity:"0"}}),Ts=Bt({to:{opacity:"1"}}),Ms=Bt({to:{opacity:"1",width:"400%",paddingTop:"400%"}}),Fs=Bt({to:{opacity:"0",transform:"scale(0.9)"}}),js=Bt({from:{opacity:"1",transform:"scale(1)"},to:{opacity:"0",transform:"scale(0)"}}),Ds=Bt({to:{transform:"translateX(-120%)"}}),As=Bt({from:{left:"100%"},to:{left:"50%"}}),_s=Bt({from:{},to:{height:"0px"}}),Es=Bt({from:{},to:{width:"0px"}}),Ls=e=>{let{theme:t,animationState:n}=e;return(0,Y.h)(Y.Fragment,null,(0,Y.h)(Ws,{theme:t,class:n,"aria-hidden":"true"}),(0,Y.h)(Mn,{fillColor:t.getCSSColor("icon.cardCompletion"),className:"tick-icon",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},"aria-hidden":!0}))},Hs=e=>{let{animationState:t,theme:n}=e;return(0,Y.h)(Y.Fragment,null,(0,Y.h)("div",{class:`${t||""} dismiss-icon`,style:{background:n.getCSSColor("background.quickActionPrimary")},"aria-hidden":"true"},(0,Y.h)(Fn,{style:{fill:n.getCSSColor("icon.quickActionPrimary")}})),(0,Y.h)("div",{class:`${t||""} clock-icon`,style:{background:n.getCSSColor("background.quickActionSecondary")},"aria-hidden":"true"},(0,Y.h)(jn,{style:{fill:n.getCSSColor("icon.quickActionSecondary")}})))},Ps=qt("div")((e=>{let{theme:t,topAlign:n,viewState:r,useHorizontalStyles:i}=e,o="rgba(255,255,255,1)";"subview"===r?o=(rn(t.getCSSColor("background.default")),t.getCSSColor("background.default")):rn(t.getCSSColor("background.card"))&&!rn(t.getCSSColor("background.default"))?o=t.getCSSColor("background.default"):rn(t.getCSSColor("background.card"))||(o=t.getCSSColor("background.card")),o=(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 Qe.warn({level3:["Expected a valid RGBA color string, but received:",e,"Returning the original value."]}),e})(o);return Object.assign(Object.assign({position:"absolute",top:"0",left:"0",right:"0",bottom:"0",zIndex:ws.CARD_OVERLAY,padding:"15px 10px",backgroundColor:o,border:`${t.getShape("border.card")} solid ${t.getCSSColor("border.card")}`,borderRadius:t.getShape("borderRadius.card")},n?{}:{display:"flex"}),i?{marginLeft:"10px",marginBottom:"10px"}:{})})),Rs=qt("div")((e=>{let{topAlign:t}=e;return Object.assign({width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},t?{marginTop:"15vh"}:{})})),Vs=qt("div")({}),$s=qt("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})||{})})),Ns=qt("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})||{})})),zs=e=>{let{viewState:t,onCancelUpload:n,theme:r,renderOverlay:i}=e;return i?(0,Y.h)(me.lj,{mapToProps:e=>{var t;const n=ke(e),r=n&&Ce(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,o,a,s;const l=oe(null),c=oe(null),d=oe(null),u=oe(null),[h,p]=te(0),m=null!==(i=null===(a=e.customStrings)||void 0===a?void 0:a.processingStateMessage)&&void 0!==i?i:"Sending, please wait...",g=null!==(o=null===(s=e.customStrings)||void 0===s?void 0:s.processingStateCancelButtonTitle)&&void 0!==o?o:"Cancel process";if(re((()=>{var e,t,n,r,i,o,a,s;const h=null===(e=l.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.clientHeight,m=null===(n=c.current)||void 0===n||null===(r=n.base)||void 0===r?void 0:r.clientHeight,g=null===(i=d.current)||void 0===i||null===(o=i.base)||void 0===o?void 0:o.clientHeight,v=null===(a=u.current)||void 0===a||null===(s=a.base)||void 0===s?void 0:s.clientHeight;if(h&&m&&g&&v){const e=h-m-v-30-20-15,t=parseFloat(getComputedStyle(d.current.base).lineHeight),n=Math.floor(e/t);p(n)}}),[m,g]),"single-card"===e.embedMode&&e.presentingSubview)return null;if("standalone"===e.embedMode&&e.horizontalStreamContainer&&e.presentingSubview)return null;const v="subview"===t&&"standalone"===e.embedMode;return(0,Y.h)(Ps,{theme:r,class:"subview"===t?"use-offset":"",topAlign:v,viewState:t,useHorizontalStyles:e.horizontalStreamContainer&&!e.presentingSubview},(0,Y.h)(Rs,{ref:l,theme:r,topAlign:v},(0,Y.h)(Vs,{ref:c},(0,Y.h)(sn,{stopColor:r.getCSSColor("icon.processingStateSpinner"),size:30})),(0,Y.h)($s,{ref:d,theme:r,maxLines:Math.max(1,h)},m),(0,Y.h)(Ns,{ref:u,theme:r,onClick:n},g)))})):null},Ws=qt("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:`${Ms} 0.6s ease 0.2s forwards`},".submitted":{animation:`${Ms} 0s ease forwards`},".submitted-subview":{animation:`${Ms} 0.6s ease 0.2s forwards`}}})),Us=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"vertical";return{cardCompletion:{" .tick-icon":{opacity:"0"},".submitting":{overflow:"hidden",padding:"11px 21px"},".submitting .tick-icon":{animation:`${Ts} 0.2s ease 0.2s forwards`},".submitting .card-nodes":{animation:`${Os} 0.2s ease forwards`},".submitted":Object.assign(Object.assign(Object.assign({},"vertical"===e?{animation:`${Fs} 0.4s ease forwards`}:{}),{overflow:"hidden"}),"horizontal"===e?{transform:"translateX(-120%)",opacity:"0"}:{}),".submitted .tick-icon":{animation:`${Ts} 0.2s ease forwards`},".submitted .card-nodes":{opacity:"0"},".submitted-subview":Object.assign({animation:`${Fs} 0.4s ease 0.8s forwards`,overflow:"hidden"},"horizontal"===e?{transform:"translateX(-120%)",opacity:"0"}:{}),".submitted-subview .tick-icon":{animation:`${Ts} 0.2s ease 0.2s forwards`},".submitted-subview .card-nodes":{animation:`${Os} 0.2s ease forwards`}},dismissal:{".dismissing":{animation:"vertical"===e?`${Ds} 0.4s ease forwards`:`${Os} 0.3s ease forwards`},".dismissed":Object.assign({transform:"translateX(-120%)"},"horizontal"===e?{animation:`${_s}`,opacity:"0"}:{})},snooze:{".snoozing":{animation:"vertical"===e?`${Ds} 0.4s ease forwards`:`${Os} 0.3s ease forwards`},".snoozed":Object.assign({transform:"translateX(-120%)"},"horizontal"===e?{animation:`${_s}`,opacity:"0"}:{})}}},qs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"vertical";return{cardCompletion:{".submitted":{overflow:"hidden",animation:`${"vertical"===e?_s:Es} 0.4s ease 0.2s forwards`},".submitted .clock-icon":Object.assign({},"horizontal"===e?{width:"0"}:{}),".submitted .dismiss-icon":Object.assign({},"horizontal"===e?{width:"0"}:{}),".submitted-subview":{overflow:"hidden",animation:"vertical"===e?`${_s} 0.4s ease 1.0s forwards`:`${Es} 0.4s ease 0.2s forwards`}},dismissal:{position:"relative"," .dismiss-icon":Object.assign({position:"absolute",left:"vertical"===e?"120%":"50%",top:"50%",width:"50px",height:"50px",margin:"vertical"===e?"-25px 0 0 -25px":"-29px 0 0 -20px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50px"},"vertical"===e?{}:{opacity:"0"}),".dismissing .dismiss-icon":{animation:"vertical"===e?`${As} 0.4s ease forwards`:`${Ts} 0.3s ease 0.3s forwards`},".dismissed":{overflow:"hidden",animation:"vertical"===e?`${_s} 0.4s ease 0.4s forwards`:`${Es} 0.3s ease 0.3s forwards`},".dismissed .dismiss-icon":{left:"50%",animation:"vertical"===e?`${js} 0.4s ease forwards`:`${js} 0.3s ease forwards`},".dismissed .clock-icon":Object.assign({},"horizontal"===e?{width:"0"}:{})},snooze:{position:"relative"," .clock-icon":Object.assign({position:"absolute",left:"vertical"===e?"120%":"50%",top:"50%",width:"50px",height:"50px",margin:"vertical"===e?"-25px 0 0 -25px":"-29px 0 0 -20px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50px"},"vertical"===e?{}:{opacity:"0"}),".snoozing .clock-icon":{animation:"vertical"===e?`${As} 0.4s ease forwards`:`${Ts} 0.3s ease 0.3s forwards`},".snoozed":{overflow:"hidden",animation:"vertical"===e?`${_s} 0.4s ease 0.4s forwards`:`${Es} 0.3s ease 0.3s forwards`},".snoozed .clock-icon":{left:"50%",animation:"vertical"===e?`${js} 0.4s ease forwards`:`${js} 0.3s ease forwards`},".snoozed .dismiss-icon":Object.assign({},"horizontal"===e?{width:"0"}:{})},center:{position:"relative",".centering":{position:"relative",left:"50%",transform:"translateX(-50%)",transition:"left 0.4s ease-out"}}}},Bs=600,Ys=600,Ks=600,Zs=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 Qs=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 Gs=(e,t,n,r,i,o)=>Qs(void 0,void 0,void 0,(function*(){const{dismissingCard:a,dismissedCard:s,failedToDismissCard:l}=t;if(e.application.isPreview)return;a(n);const c=new Promise((e=>setTimeout(e,Ys)));Qe.debug({level1:["Dismiss card sent by HTTP"]});const d=yield Ma(e.application.streamContainerId,n,i);yield Promise.allSettled([c,d]),d.ok?(Qe.debug({level1:["Dismiss card sent by HTTP: success"]}),s(n),ye().clearSubviewsForCardInstance(n),window.AtomicUploadService.cancelUploadForCard(e.application.containerInstanceId,n),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),r.dispatchCardEvent({type:Ti.DISMISSED,eventPayload:d.event})):(Qe.error({level1:["Dismiss card sent by HTTP: failed"]}),l(n,o,d.error),r.dispatchCardEvent({type:Ti.DISMISS_FAILED}))})),Xs=function(e,t,n){return Qs(this,arguments,void 0,(function*(){var r,i,o;let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4?arguments[4]:void 0,l=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,d=arguments.length>7?arguments[7]:void 0,u=arguments.length>8?arguments[8]:void 0;const{submittingCard:h,submittedCard:p,failedToSubmitCard:m,finishSubview:g,openExternalUrl:v,handleSubmitButtonPayload:f}=t,{postSubmissionUrl:b,payload:y,subviewData:w,submitButtonName:S,cancelSubmitCallback:k}=u||{};if(e.application.isPreview)return;const C=e=>{m(n,a,d,e,{postSubmissionUrl:b,subviewData:w,payload:y,submitButtonName:S}),s.dispatchCardEvent({type:Ti.SUBMIT_FAILED})};let x=!1;const I=(null==w?void 0:w.subviewId)?null===(r=e.cardResponses[n])||void 0===r||null===(i=r.subviews)||void 0===i?void 0:i[null==w?void 0:w.subviewId]:null===(o=e.cardResponses[n])||void 0===o?void 0:o.responses,O=Object.assign(Object.assign({},d),I||{});for(const[e,t]of Object.entries(I||{}))t&&"object"==typeof t&&"image"===t.type&&"string"==typeof t.destinationFilename&&"string"==typeof t.targetBucketId&&(x=!0,O&&(O[e]={filename:t.destinationFilename,targetBucketId:t.targetBucketId}));if(x){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,l,{subviewData:w,cancelSubmitCallback:k});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:(Qe.error({level1:[`Submit of card ${n} failed due to file upload failure`]}),C(o.error))}h(n);const T=new Promise((e=>setTimeout(e,Bs)));Qe.debug({level1:["Submit card sent by HTTP"]});const M=yield Ta(e.application.streamContainerId,n,Object.assign(Object.assign({},O),S?{[S]:null}:{}),c);yield Promise.allSettled([T,M]),M.ok?(Qe.debug({level1:["Submit card sent by HTTP: success"]}),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),g(),(null==b?void 0:b.url)&&v(n,a?"subview":"topview",w||{},"url","submitButton",b),y&&f(n,w||{},y),p(n,a),ye().clearSubviewsForCardInstance(n),s.dispatchCardEvent({type:Ti.SUBMITTED,eventPayload:M.event})):(Qe.error({level1:["Submit card sent by HTTP: failed"]}),C(M.error))}))},Js=(e,t,n,r,i,a,s)=>Qs(void 0,void 0,void 0,(function*(){const l=(0,o.differenceInSeconds)(r,new Date),{snoozingCard:c,snoozedCard:d,failedToSnoozeCard:u}=t;if(e.application.isPreview)return;c(n);const h=new Promise((e=>setTimeout(e,Ks)));Qe.debug({level1:["Snooze card sent by HTTP"]});const p=yield Fa(e.application.streamContainerId,n,l,a);yield Promise.allSettled([h,p]),p.ok?(Qe.debug({level1:["Snooze card sent by HTTP: success"]}),d(n,r),ye().clearSubviewsForCardInstance(n),Be().clearCardForm(n),window.AtomicUploadService.cancelUploadForCard(e.application.containerInstanceId,n),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),i.dispatchCardEvent({type:Ti.SNOOZED,eventPayload:p.event})):(Qe.error({level1:["Snooze card sent by HTTP: failed"]}),u(n,r,s,p.error),i.dispatchCardEvent({type:Ti.SNOOZE_FAILED}))})),el=(e,t,n,r,i)=>{n.sendEvent({cardInstanceId:e,cardViewState:"topview",eventName:et,properties:{source:i}}),t.feedbackReceived(e),r.dispatchCardEvent({type:Ti.VOTED_USEFUL})};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())}))};function nl(){return nl=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},nl.apply(this,arguments)}const rl=(e,t,n,r)=>tl(void 0,void 0,void 0,(function*(){var i;const o=null===(i=(yield ja([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]=ed(s,o):cd(s)&&rl(e,t,n,s)}))})),il=t=>{let{nodeKey:n,isWorkflow:r,clickHandler:i,text:o,icon:a,iconUrl:s,theme:l,appearance:c,loading:d,type:u,urlLink:h}=t;return(0,Y.h)(me.lj,{actions:(0,e.Y2)($e,ge,Pt),mapToProps:()=>{}},(e=>(0,Y.h)(Tn,nl({},n&&{nodeKey:n},{isWorkflow:r,clickHandler:i(e),text:o,icon:a,iconUrl:s,theme:l,appearance:c,loading:d,type:u,urlLink:h}))))},ol=qt("div")((e=>{let{isWorkflow:t,feedOrientation:n}=e;return Object.assign({},t||"horizontal"!==n?{}:{display:"flex",flexDirection:"column",flexGrow:"1",justifyContent:"flex-end"})})),al=e=>{let{children:t,isWorkflow:n,feedOrientation:r,initializeFormStore:i}=e;return re((()=>{i()}),[]),(0,Y.h)(ol,{isWorkflow:n,feedOrientation:r},t)},sl=(e,t,n,r)=>()=>{e.createResponseWithDefaults(t,n,r)},ll=qt("div")((e=>{let{theme:t,headlineFontProperties:n}=e;return{color:t.getCSSColor("text.headline"),display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${n.lineHeight} 1fr`,padding:"10px 0"}})),cl=qt("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"})})),dl="22px",ul=e=>Object.assign(Object.assign({margin:"0",paddingLeft:"0",listStyleType:"none"},e.getCSSFontProperties("body")),{color:e.getCSSColor("text.body")}),hl=e=>{let t;return dd(t)||(t=e.getCSSFontProperties("bullet")),{"> li":{display:"flex",margin:"0 0 5px"},"> li.without-icon:before":Object.assign({content:'"•"',textAlign:"center",flexBasis:dl,minWidth:dl,marginRight:"10px",color:e.getCSSColor("icon.bullet")},t?{fontSize:t.fontSize,lineHeight:t.lineHeight}:{}),"> li.with-icon i":{flexBasis:dl,minWidth:dl,textAlign:"center"},"> li:last-child":{marginBottom:"10px"}}},pl=qt("ul")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},ul(t)),hl(t))})),ml=qt("ol")((e=>{let{theme:t}=e;return Object.assign(Object.assign(Object.assign({},ul(t)),hl(t)),{counterReset:"item","> li.without-icon:before":Object.assign(Object.assign(Object.assign({},ul(t)["> li.without-icon:before"]),hl(t)["> li.without-icon:before"]),{content:'counter(item) "."',counterIncrement:"item"})})})),gl=qt("ul")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},ul(t)),{margin:"5px 20px 5px 0"," li":{display:"inline"}," li:before":{content:'", "'}," li:first-child:before":{content:'""'}})}));class vl{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 fl={"":["<em>","</em>"],_:["<strong>","</strong>"],"\n":["</p><p>"]," ":["<br />"]};function bl(e){return(e+"").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function yl(e){return("<p>"+wl(e)+"</p>").replace(/<p><\/p>/g,"")}function wl(e,t){const n=new vl;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,c=[],d="",u=t||{},h=0;function p(e){var t=fl[e.replace(/\*/g,"_")[1]||""],n=c[c.length-1]==e;return t?t[1]?(c[n?"pop":"push"](e),t[0|n]):t[0]:e}function m(){let e="";for(;c.length;)e+=p(c[c.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=wl((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:"";d=d.replace("<a>",`<a tabindex="0" class="md-subview-link" data-subview-id="${t}">`)}else d=d.replace("<a>",'<a tabindex="0" target="_blank" class="md-web-link" href="'+bl(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=fl[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];r=e?p(e):r}else o[4]&&(r="<p>"+o[4]+"</p>",t=!0);d+=i,d+=t?"</p>"+r+"<p>":r}var f;return n.tagState.forEach(((e,t)=>{if(n.tagState.get(t).open){const e=fl[t.replace(/\*/g,"_")[1]||""][0],n=d.lastIndexOf(e);-1!==n&&(d=d.slice(0,n)+t+d.slice(n+e.length))}})),(g(d)+g(e.substring(h))+m()).trim()}const Sl=qt("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"}})),kl=qt("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"}}})),Cl=qt("a")((e=>{let{isLinkEnabled:t,theme:n,url:r}=e;return{border:`1px solid ${n.getCSSColor("border.mediaThumb")}`,borderRadius:n.getShape("borderRadius.mediaThumb"),overflow:"hidden",display:"flex",margin:"10px 0",backgroundColor:n.getCSSColor("background.mediaThumbnail"),cursor:t||r?"pointer":"default"}})),xl=qt("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"}})),Il=qt("div")((()=>({padding:"12px 15px 10px 15px",display:"flex",flexFlow:"row wrap",minWidth:"0px"}))),Ol=qt("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%"})})),Tl=qt("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%"})})),Ml=qt("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 Fl extends Qi{render(){const{nodeKey:e,children:t,mediaType:n,src:r,theme:i,label:o,description:a,customStrings:s,onClickImage:l,url:c,alt:d}=this.props,{imageLoaded:u,imageLoadFailed:h}=this.state,p=u?r:"",m=this.getPreviewIcon(n),g=n.includes("video"),v=g&&h,f="image"===n||"video"===n,b=this.getElementRole(n),y=g?(null==s?void 0:s.thumbnailVideoActionLinkTitle)||"Watch":(null==s?void 0:s.thumbnailImageActionLinkTitle)||"View",w=g?"A video":"An image";let S="";return f&&(S=(g?"Plays a video":"Displays an image")+": "),S=`${S}${d?d+".":""}`,(0,Y.h)(Cl,{key:e,"data-element-key":e,theme:i,onClick:l,isLinkEnabled:f,url:c},(0,Y.h)(xl,{thumbnail:p,theme:i,role:b,"aria-label":S||w},!u&&!v&&m&&(0,Y.h)(m,{fillColor:i.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(u||h)&&t),(0,Y.h)(Il,null,(0,Y.h)(Ol,{theme:i,class:"thumbnail-header","aria-label":`${o}.`},o),(0,Y.h)(Tl,{theme:i,class:"thumbnail-format","aria-label":`${a}.`},a),(0,Y.h)(Ml,{theme:i,isLinkEnabled:"image"===n||"video"===n,tabIndex:"0",class:"thumbnail-link",onKeyPress:this.handleKeyPress.bind(this)},y)))}}const jl=qt("div")((e=>{let{backgroundImage:t,theme:n,dimensions:r,loadedDimensions:i,url:o,isLinkEnabled:a}=e;const s=`calc(${n.getShape("borderRadius.card")} - ${n.getShape("border.card")})`;return Object.assign(Object.assign({width:"calc(100% + 40px)",border:"0px",borderRadius:`${s} ${s} 0 0`,backgroundImage:`url(${t})`,backgroundSize:"cover",backgroundPosition:"center",backgroundColor:n.getCSSColor("background.media"),display:"flex",alignItems:"center",justifyContent:"center",margin:"-10px -20px 10px -20px",overflow:"hidden",cursor:a||o?"pointer":"default"},Pl({dimensions:r,naturalDimensions:i})),n.getElementFocusCSSProperties())}));class Dl extends Qi{onImageLoad(e){super.onImageLoad(e),this.props.onLoad&&this.props.onLoad({width:e.naturalWidth,height:e.naturalHeight})}render(){const{nodeKey:e,children:t,mediaType:n,src:r,theme:i,onClickImage:o,dimensions:a,url:s,alt:l}=this.props,{imageLoaded:c,imageLoadFailed:d}=this.state,u=c?r:"",h=this.getPreviewIcon(n),p=n.includes("video")&&d,m="image"===n||"video"===n,g=this.getElementRole(n),v=n.includes("video")?"A banner video":"A banner image";let f="";return m&&(f=(n.includes("video")?"Plays a video":"Displays an image")+": "),f+=l,(0,Y.h)(jl,{key:e,"data-element-key":e,backgroundImage:u,theme:i,mediaType:n,url:s,dimensions:a,loadedDimensions:this.state.loadedDimensions,onClick:o,onKeyPress:this.handleKeyPress.bind(this),tabIndex:"0",className:"image-banner",role:g,isLinkEnabled:m,"aria-label":f||v},!c&&!p&&h&&(0,Y.h)(h,{fillColor:i.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(c||d)&&t)}}const Al=qt("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({},rn(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"),margin:"10px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:a||o?"pointer":"default",overflow:"hidden"}),Pl({dimensions:r,naturalDimensions:i})),n.getElementFocusCSSProperties())}));class _l extends Qi{onImageLoad(e){super.onImageLoad(e),this.props.onLoad&&this.props.onLoad({width:e.naturalWidth,height:e.naturalHeight})}render(){const{nodeKey:e,children:t,mediaType:n,src:r,dimensions:i,url:o,onClickImage:a,theme:s,alt:l}=this.props,{imageLoaded:c,imageLoadFailed:d}=this.state,u=c?r:"",h=this.getPreviewIcon(n),p=n.includes("video")&&d,m="image"===n||"video"===n,g=this.getElementRole(n),v=n.includes("video")?"A video":"An image";let f="";return m&&(f=(n.includes("video")?"Plays a video":"Displays an image")+": "),f+=l,(0,Y.h)(Al,{key:e,"data-element-key":e,backgroundImage:u,dimensions:i,loadedDimensions:this.state.loadedDimensions,mediaType:n,url:o,onClick:a,onKeyPress:this.handleKeyPress.bind(this),theme:s,tabIndex:"0",className:"image-inline",role:g,isLinkEnabled:m,ariaLabel:f||v},!c&&!p&&h&&(0,Y.h)(h,{fillColor:s.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(c||d)&&t)}}const El=qt("p")({padding:"10px 0",margin:"0",overflow:"hidden",textOverflow:"ellipsis"}),Ll=qt("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 Hl extends Qi{preloadsImage(){return!1}render(){const{nodeKey:e,theme:t,label:n,onClickImage:r,mediaType:i,url:o}=this.props;return(0,Y.h)(El,{key:e,"data-element-key":e},(0,Y.h)(Ll,{theme:t,onClick:r,onKeyPress:this.handleKeyPress.bind(this),tabIndex:"0",className:"image-text",mediaType:i,url:o},n))}}const Pl=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"}},Rl=e=>{let{fillColor:t,ariaHidden:n=!1}=e;return(0,Y.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,Y.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"}))},Vl=qt("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")}})),$l=e=>{let{onClick:t,theme:n}=e;return(0,Y.h)(Vl,{onClick:t,theme:n},(0,Y.h)(Rl,{fillColor:n.getCSSColor("icon.mediaControl"),ariaHidden:!0}))},Nl={objectFit:"contain",width:"100%",height:"100%",background:"black"},zl=qt("video")(Object.assign({},Nl)),Wl=qt("video")((()=>Object.assign({},Nl))),Ul=qt("div")((e=>{let{maskRadius:t,dimensions:n,loadedDimensions:r,format:i}=e;return Object.assign({borderRadius:"banner"===i?`${t} ${t} 0 0`:t,overflow:"hidden",margin:"banner"===i?"-10px -20px 10px -20px":"10px 0"},n?Pl({dimensions:n,naturalDimensions:r}):{height:"200px"})})),ql=qt("div")((e=>{let{theme:t}=e;return{background:t.getCSSColor("overlay.mediaBanner"),display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"}})),Bl=e=>{let t,{nodeKey:n,cardInstanceId:r,label:i,description:o,format:a,src:s,altText:l,theme:c,thumbnailSrc:d,dimensions:u,setPlaying:h,onLoad:p}=e,m=!1,g=!1;switch(a){case"banner":t=Dl,m=!0,g=!0;break;case"inline":t=_l,m=!0,g=!0;break;case"thumbnail":t=Fl,m=!0;break;case"text":t=Hl}return(0,Y.h)(me.lj,{actions:ge,mapToProps:e=>({customStrings:e.application.customStrings})},(e=>(0,Y.h)(t,{nodeKey:n,theme:c,customStrings:e.customStrings,src:d,dimensions:u,onLoad:p,alt:null==l?void 0:l.src,label:i,description:o,mediaType:null!==s&&s.length>0?"video":"videoWithoutSrc",onClickImage:()=>{g?h(!0):e.viewMedia(r,{type:"video",url:s,title:i,alt:null==l?void 0:l.src})}},m&&(0,Y.h)(ql,{theme:c},(0,Y.h)($l,{onClick:()=>g&&h(!0),theme:c})))))},Yl=e=>{var t,n;let{format:r,theme:i,src:o,cardInstanceId:a,dimensions:s,loadedDimensions:l,isWorkflow:c}=e;const d=oe(null),u=le(Mi).analyticsDispatcher,h="string"==typeof o&&null!==(t=null===(n=o.match(/[^\/]*$/))||void 0===n?void 0:n[0])&&void 0!==t?t:"";switch(re((()=>{var e,t,n,r;const i=()=>{u.sendEvent({eventName:ct,cardInstanceId:a,cardViewState:c?"subview":"topview",properties:{media:h,mediaURL:o}})},s=()=>{u.sendEvent({eventName:dt,cardInstanceId:a,cardViewState:c?"subview":"topview",properties:{media:h,mediaURL:o}})};return null===(e=d.current)||void 0===e||null===(t=e.base)||void 0===t||t.addEventListener("play",i),null===(n=d.current)||void 0===n||null===(r=n.base)||void 0===r||r.addEventListener("ended",s),()=>{var e,t,n,r;null===(e=d.current)||void 0===e||null===(t=e.removeEventListener)||void 0===t||t.call(e,"play",i),null===(n=d.current)||void 0===n||null===(r=n.removeEventListener)||void 0===r||r.call(n,"ended",s)}}),[]),r){case"banner":return(0,Y.h)(me.lj,{mapToProps:e=>({applicationOpen:e.application.open})},(e=>{var t;let{applicationOpen:n}=e;return!n&&(null==d||null===(t=d.current)||void 0===t?void 0:t.base)&&d.current.base.pause(),(0,Y.h)(Ul,{format:r,dimensions:s,loadedDimensions:l,maskRadius:i.getShape("borderRadius.card")},(0,Y.h)(zl,{ref:d,src:o,playsInline:!0,autoplay:!0,controls:!0}))}));case"inline":return(0,Y.h)(me.lj,{mapToProps:e=>({applicationOpen:e.application.open})},(e=>{var t;let{applicationOpen:n}=e;return!n&&(null==d||null===(t=d.current)||void 0===t?void 0:t.base)&&d.current.base.pause(),(0,Y.h)(Ul,{format:r,dimensions:s,loadedDimensions:l,maskRadius:i.getShape("borderRadius.media")},(0,Y.h)(Wl,{ref:d,src:o,playsInline:!0,autoplay:!0,controls:!0}))}));default:return null}},Kl=(e,t)=>{let n;return dd(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:"22px",minWidth:"22px",color:e.getCSSColor("icon.bullet")},n?{fontSize:n.fontSize,lineHeight:n.lineHeight}:{}),[`>${t} > li:last-child`]:{marginBottom:"10px"}}},Zl=(e,t)=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.getCSSColor("text.body"),gridColumnStart:"2",gridRowStart:"span 2"},e.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",whiteSpace:"pre-wrap",listStyleType:"none"})}),Kl(e,"ul")),{"> ol":Object.assign(Object.assign({},{paddingLeft:"0",margin:"0",whiteSpace:"pre-wrap",listStyleType:"none"}),{counterReset:"count"})}),Kl(e,"ol")),{" a":{color:e.getCSSColor("text.link")}," p":Object.assign(Object.assign({margin:"10px 0 0 0",whiteSpace:"pre-wrap","overflow-wrap":"break-word","word-wrap":"break-word","word-break":"break-word"},e.getCSSFontProperties("body")),{overflow:"hidden"})," p:first-child":{marginTop:"0"}," .md-subview-link":{textDecoration:"underline",cursor:"pointer"}}),t),Ql=qt("div")((e=>{let{theme:t}=e;return Zl(t)})),Gl=qt("div")({position:"absolute",top:"-1000px",left:"-1000px",width:"1px",height:"1px",overflow:"hidden"}),Xl=qt("div")((e=>{let{bodyFontProperties:t}=e;return{position:"fixed",visibility:"hidden",pointerEvents:"none",display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${t.lineHeight} 1fr`}})),Jl=qt("div")((e=>{let{theme:t}=e;return Zl(t,{"& *":{marginTop:"0!important",marginBottom:"0!important"}})})),ec=qt("div")((e=>{let{theme:t,bodyFontProperties:n,isWorkflow:r}=e;return{display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${n.lineHeight} 1fr`,color:t.getCSSColor("text.body"),padding:r?"0 0 20px 0":"10px 0px"}})),tc=()=>window.matchMedia("(prefers-color-scheme: dark)");function nc(){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 rc(e,t,n,r,i){var o,a,s,l,c,d,u,h,p,m,g,v;const f=document.createElement("button"),b=document.createElement("span"),y=document.createElement("span");y.innerHTML="&#8230; ";const w=t.getCSSFontProperties("expandCollapse",{skipFallback:!0,skipFontFallbacks:!0}),S=t.getCSSFontProperties("body"),k=t.getShape("padding.expandCollapseLeft")||"0px",C="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?k:"0px",b.style.color=null!==(o=t.getCSSColor("text.expandCollapse",{skipFallback:!0}))&&void 0!==o?o:t.getCSSColor("text.body"),f.style.color=null!==(a=t.getCSSColor("text.expandCollapse",{skipFallback:!0}))&&void 0!==a?a: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!==(c=null==w?void 0:w.fontStyle)&&void 0!==c?c:null==S?void 0:S.fontStyle,f.style.fontStyle=null!==(d=null==w?void 0:w.fontStyle)&&void 0!==d?d: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:C,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 ic(e,t,n,r,i,o){var a,s;n.innerHTML="";const l=e.cloneNode(!0);n.appendChild(l);const c=document.createTreeWalker(l,NodeFilter.SHOW_TEXT),d=[];let u=null;for(;u=c.nextNode();){var h;u&&(null===(h=u.textContent)||void 0===h?void 0:h.trim())&&d.push(u)}let p=null,m=0,g=!1;for(let s=d.length;s>0;s--){const l=d[s-1],c=null!==(a=l.textContent)&&void 0!==a?a:"";let u=0,h=c.length,S=0;if(l.parentElement){for(;u<=h;){var v,f;let e=Math.floor((u+h)/2);l.textContent=c.slice(0,e);const a=rc(null!=o?o:"Show more",i,"expand",`expand-text-${r}`,n.getBoundingClientRect().width+"px");a.style.marginRight=nc()+"px",null===(v=l.parentElement)||void 0===v||v.appendChild(a);Math.ceil(n.getBoundingClientRect().height)<=t?(S=e,u=e+1):h=e-1,null===(f=l.parentElement)||void 0===f||f.removeChild(a)}var b,y;if("ol"===e.tagName.toLowerCase()||"ul"===e.tagName.toLowerCase())if(0===S&&"li"===(null===(b=l.parentElement)||void 0===b||null===(y=b.parentElement)||void 0===y?void 0:y.tagName.toLowerCase())){var w;null===(w=l.parentElement)||void 0===w||w.parentElement.remove();continue}if(1===s||S>0){p=l,p.textContent=c,m=S,g=S<4;break}}}if(p){const e=null!==(s=p.textContent)&&void 0!==s?s:"";let t=0;if(p.textContent=e.slice(0,g?4:m).trimEnd(),g){var S,k;const n=document.createElement("span");n.textContent=e.slice(0,4).trimEnd(),null===(S=p.parentElement)||void 0===S||S.appendChild(n),t=n.getBoundingClientRect().width,null===(k=p.parentElement)||void 0===k||k.removeChild(n)}const a=rc(null!=o?o:"Show more",i,"expand",`expand-text-${r}`,n.getBoundingClientRect().width-t-nc()+"px"),l=p.parentElement;"p"!==(null==l?void 0:l.tagName.toLowerCase())||(null==l?void 0:l.textContent)||(l.style.marginTop="0px"),"a"===(null==l?void 0:l.tagName.toLowerCase())&&l.parentElement?l.parentElement.insertBefore(a,l.nextSibling):null==l||l.appendChild(a)}return l.outerHTML}const oc=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.h)("path",{d:"M15 10V20M20 15H15H10",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))},ac=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.h)("path",{d:"M20 15H10",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))},sc=qt("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"}})),lc=qt("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%"}})})),cc=qt("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"}})})),dc=qt("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},t.getCSSFontProperties("primary")),{color:t.getCSSColor("text.primary"),flexGrow:"1",whiteSpace:"pre-wrap"})})),uc=(e,t,n)=>e-n>=t,hc=(e,t,n)=>e+n<=t;let pc=null;const mc=qt("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())})),gc=qt("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"}})),vc=qt("p")((e=>{let{theme:t}=e;return Object.assign(Object.assign({display:"grid",gridTemplateColumns:"auto minmax(0,1fr)",color:t.getCSSColor("text.category")},t.getCSSFontProperties("category")),{padding:"10px 0px 8px 0px",margin:"0"})})),fc=qt("span")({whiteSpace:"pre-wrap",overflow:"hidden",overflowWrap:"break-word",wordWrap:"break-word",wordBreak:"break-word"});let bc=null;const yc=e=>{let{fillColor:t,ariaHidden:n}=e;return(0,Y.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,Y.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"}))},wc=e=>{let{fillColor:t,ariaHidden:n}=e;return(0,Y.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,Y.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 Sc=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 kc={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}},Cc={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 xc=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 Ic=qt("label")((()=>({position:"relative",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",display:"flex",alignItems:"center",width:"100%",cursor:"pointer"}))),Oc=qt("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"),backgroundColor:t.getCSSColor("background.uploadPlaceholder")},(null==r?void 0:r.url)&&r.webCompatible?o:{})})),Tc=qt("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"})})),Mc=qt("input")({position:"absolute",visibility:"hidden",width:"100%",height:"100%"}),Fc=qt("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"}))),jc=qt("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"}))),Dc=e=>{let{theme:n,cardInstanceId:r,subviewId:i,name:o,label:a,validations:s,enabledThumbnailIcon:l,targetBucketId:c,variableResolver:d}=e;const h=oe(null),p=oe(null),m=Ye(r,o,i),[g,v]=te(null),[f,b]=te(null),[y,w]=te(0),S=u().getState();re((()=>{if(S.application.isPreview)return;const e=window.AtomicUploadService.getFile(S.application.containerInstanceId,r,o);m&&e?(C(e),b(m.filename)):Be().handleFormChange(r,o,void 0,i)}),[]),re((()=>{if(h.current&&p.current&&!y){var e,t,n,r;const i=(null===(e=h.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.offsetHeight)||0,o=(null===(n=p.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)}}}),[h]);const k=(e,t)=>{v({url:URL.createObjectURL(e),webCompatible:!t})},C=e=>{const t=h.current.base;if(t){k(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,o,i),Be().handleFormChange(r,o,void 0,i),Be().validateField(r,o,void 0,s,i),h.current&&(v(null),b(null),h.current.base.value=null))},I=`upload-label=${r}-${o}`;return(0,Y.h)(Y.Fragment,null,(0,Y.h)(Oc,{theme:n,enabledThumbnailIcon:l,preview:g},!g&&l&&(0,Y.h)(dn,{fillColor:n.getCSSColor("icon.uploadPlaceholder"),ariaHidden:!0}),g&&!g.webCompatible&&(0,Y.h)(Mn,{fillColor:n.getCSSColor("icon.uploadPlaceholder"),ariaHidden:!0})),(0,Y.h)(Ic,{htmlFor:I},(0,Y.h)(Tc,{ref:p,theme:n,placeholder:!f,yPadding:y},f||d(a.length?a:"")),(0,Y.h)(Mc,{id:I,ref:h,type:"file",accept:"image/jpeg, image/png, image/webp, image/avif",onChange:e=>xc(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),a=yield(e=>Sc(void 0,void 0,void 0,(function*(){const t=yield e.slice(0,(()=>{const e=Object.assign(Object.assign({},kc),Cc);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(kc))for(const n of e)if(r(n,t))return{requiresConversion:!1,isValidImage:!0};for(const{signatures:e,offset:t}of Object.values(Cc))for(const n of e)if(r(n,t))return{requiresConversion:!0,isValidImage:!0};return{requiresConversion:!1,isValidImage:!1}})))(e);if(!a.isValidImage)return x(),void Be().validateFieldCustomResult(r,o,{type:"invalid",errorMessage:"Invalid file or unsupported image format selected"},i);const l=`${(0,t.v4)()}_${e.name}`,d={filename:e.name,destinationFilename:l,size:e.size,type:"image",targetBucketId:c};window.AtomicUploadService.storeFile(e,"image",c,r,S.application.containerInstanceId,l,a.requiresConversion,o,i),Be().handleFormChange(r,o,d,i),k(e,a.requiresConversion),b(e.name),Be().validateField(r,o,d,s,i)}}))})),f?(0,Y.h)(jc,{onClick:x,"aria-label":"remove image"},(0,Y.h)(yc,{fillColor:n.getCSSColor("icon.inputButton"),ariaHidden:!0})):(0,Y.h)(Fc,{onClick:()=>{var e,t;return null==h||null===(e=h.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.click()},"aria-label":"attach image"},(0,Y.h)(wc,{fillColor:n.getCSSColor("icon.inputButton"),ariaHidden:!0})))},Ac=Yn((e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{label:i,name:o,type:a,enabledThumbnailIcon:s,targetBucketId:l},theme:c,validations:d,variableResolver:u}=e;const h="image"===a?(0,Y.h)(Dc,{theme:c,cardInstanceId:n,subviewId:r,name:o,validations:d,label:i,enabledThumbnailIcon:s,targetBucketId:l||"DEFAULT",variableResolver:u}):null;return(0,Y.h)(Y.Fragment,null,(0,Y.h)(Yo,{nodeKey:t,theme:c,cursor:"default",mode:"inline"},h),(0,Y.h)(ea,{name:o,cardInstanceId:n,subviewId:r,theme:c,variableResolver:u}))}),((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)),_c=qt("div")((e=>{var t,n,r,i,o;let{theme:a,feedOrientation:s,isWorkflow:l,transparencies:c}=e;const d=a.getShape("buttonLayout.global"),u=a.getShape("buttonAlignment.global"),h=c.finalButtonTransparent?"0":l?"20px":"10px",p=c.primaryButtonTransparent||c.secondaryButtonTransparent?"0px":"10px",m=!1===c.primaryButtonTransparent,g=!1===c.secondaryButtonTransparent;let v,f;m||g?(v="10px",f="20px"):(v="0px",f="10px");const b=Object.assign({flexGrow:"1",flexDirection:"column"},"horizontal"===d?{alignItems:"flex-end"}:{justifyContent:"flex-end"}),y={paddingBottom:l?f:v,flexDirection:"row",overflowX:"scroll",margin:"0 -20px",paddingLeft:"20px",paddingRight:"20px",marginRight:"-20px","::-webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none",scrollbarWidth:"none","> button:not(:last-child)":{marginRight:null!==(t=a.getShape("buttonSpacingAfter.global",{skipFallback:!0}))&&void 0!==t?t:p},"> a:not(:last-child)":{marginRight:null!==(n=a.getShape("buttonSpacingAfter.global",{skipFallback:!0}))&&void 0!==n?n:p}},w={flexDirection:"column",alignItems:null!==(r={left:"flex-start",center:"center",right:"flex-end"}[u])&&void 0!==r?r:"flex-start","> button:not(:last-child)":{marginBottom:null!==(i=a.getShape("buttonSpacingAfter.global",{skipFallback:!0}))&&void 0!==i?i:p},"> button:last-child":{marginBottom:h},"> a:not(:last-child)":{marginBottom:null!==(o=a.getShape("buttonSpacingAfter.global",{skipFallback:!0}))&&void 0!==o?o:p},"> a:last-child":{marginBottom:h}};return Object.assign(Object.assign({paddingTop:c.firstButtonTransparent?"0px":"10px",display:"flex",alignItems:"center"},"horizontal"===s?b:{}),"horizontal"===d?y:w)})),Ec=qt("div")({marginBottom:"20px"}),Lc=qt("ul")({listStyle:"none",padding:"0",margin:"0","> li":{marginBottom:"10px"},"> :last-child":{marginBottom:"0"}}),Hc=e=>{let{fillColor:t,style:n,ariaHidden:r}=e;return(0,Y.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,Y.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"}))},Pc=qt("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"}})),Rc=qt("input")((e=>{let{theme:t}=e;return{position:"absolute",appearance:"none","&:focus-visible + span":{boxShadow:`0 0 0 2px ${t.getCSSColor("border.focus")} inset`}}})),Vc=qt("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)})),$c=qt("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 zc={linkButton:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,subviewTitle:i,isWorkflow:o,theme:a,attributes:s,variableResolver:l}=e;const{text:c,icon:d,iconUrl:h,appearance:p}=s,m=s.url,g=s.target,v=Object.assign(Object.assign({},r&&{subviewId:r}),i&&{subviewTitle:i}),f=le(Mi),b=f.runtimeVariableResolver,y=f.containersBroadcastChannel;return(0,Y.h)(il,{nodeKey:t,theme:a,appearance:p,isWorkflow:o,text:l(c),icon:d,iconUrl:h,clickHandler:e=>{const r=u().getState();return i=>tl(void 0,void 0,void 0,(function*(){let o,a,c;if(s.action){c=s.action;const e=r.cardFeed.cardInstances.find((e=>e.instance.id===n));c&&b&&e&&(yield rl(b,r.application.runtimeVariableResolutionTimeout,e,c))}else if(s.layoutId)o=s.layoutId;else if(s.url){if(i.preventDefault(),a={url:l(m),target:i.ctrlKey||i.metaKey?"_blank":null!=g?g:"_blank"},f.analyticsDispatcher.sendEvent({cardInstanceId:n,cardViewState:r.navigationStack.items.length?"subview":"topview",eventName:Je,properties:Object.assign({linkMethod:"url",url:a.url,trigger:"linkButton"},v.subviewId?Object.assign(Object.assign({},v),{subviewLevel:1}):{})}),"_top"===a.target&&y){const e=`${t}-link-button`;return y.addEventListener("message",(t=>{if(t.data.type===ps.ANALYTICS_EVENT){var r;const i=null===(r=t.data)||void 0===r?void 0:r.eventQueued;i.eventName===Je&&i.cardInstanceId===n&&y&&a&&(y.removeEventListener(e),window.open(a.url,a.target))}}),e)}return window.open(a.url,a.target)}return e.handleLinkButtonPress(n,v,o,c)}))},urlLink:m?{url:l(m),target:g}:void 0})},submitButton:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,subviewTitle:i,isWorkflow:o,theme:a,attributes:{name:s,text:l,appearance:c,icon:d,iconUrl:h,values:p,url:m,action:g,target:v},variableResolver:f}=e;const[b,y]=te(!1),w=le(Mi),S=w.cardEventDispatcher,k=w.authTokenProvider,C=w.analyticsDispatcher,x=w.runtimeVariableResolver;return(0,Y.h)(il,{nodeKey:t,theme:a,appearance:c,isWorkflow:o,text:f(l),icon:d,iconUrl:h,clickHandler:e=>{const t=u().getState();return()=>tl(void 0,void 0,void 0,(function*(){var a,l;if(t.application.isPreview)return void e.finishSubview();if(b)return;y(!0);const c=t.cardFeed.cardInstances.find((e=>e.instance.id===n));g&&x&&c&&(yield rl(x,t.application.runtimeVariableResolutionTimeout,c,g));let d={};var h,w;o?(e.validateCurrentSubview(n),d=r&&null!==(a=null===(h=u().getState().validationStates[n])||void 0===h||null===(w=h.subviews)||void 0===w?void 0:w[r])&&void 0!==a?a:{}):(e.validateCardTopLevel(n),d=null!==(l=u().getState().validationStates[n].validations)&&void 0!==l?l:{});const I=u().getState(),O=(e=>!!e.navigationStack.items.length)(t);(e=>{for(var t in e)if("invalid"===e[t].type)return!1;return!0})(d)&&(yield Xs(I,e,n,O,S,C,k,p,{postSubmissionUrl:m?{url:f(m),target:v}:void 0,payload:g,subviewData:{subviewId:r,subviewTitle:i},submitButtonName:s,cancelSubmitCallback:()=>y(!1)}),o&&C.sendEvent({cardInstanceId:n,cardViewState:"subview",eventName:st,properties:{subviewId:r,subviewTitle:i,subviewLevel:1}})),y(!1)}))},loading:b,type:"submit"})},dismissButton:e=>{let{nodeKey:t,isWorkflow:n,attributes:r,theme:i,cardInstanceId:o,variableResolver:a}=e;const{text:s,icon:l,iconUrl:c,appearance:d}=r,h=le(Mi);return(0,Y.h)(il,{nodeKey:t,theme:i,appearance:d,isWorkflow:n,text:a(s),icon:l,iconUrl:c,clickHandler:e=>()=>{Gs(u().getState(),e,o,h.cardEventDispatcher,h.authTokenProvider,"card-button")}})},snoozeButton:e=>{let{nodeKey:t,isWorkflow:n,attributes:r,theme:i,cardInstanceId:a,cardMetadata:s,variableResolver:l}=e;const{text:c,icon:d,iconUrl:h,snoozePeriod:p,appearance:m}=r,g=le(Mi);return(0,Y.h)(il,{nodeKey:t,theme:i,appearance:m,isWorkflow:n,text:l(c),icon:d,iconUrl:h,clickHandler:e=>()=>{if(void 0===p||null===nd(p))e.requestSnooze(a,"card-button",null==s?void 0:s.expires);else{const t=rd(p,new Date);(0,o.isPast)(t)||Js(u().getState(),e,a,t,g.cardEventDispatcher,g.authTokenProvider,"card-button")}}})},voteUpButton:e=>{let{nodeKey:t,isWorkflow:n,attributes:r,theme:i,cardInstanceId:o,variableResolver:a}=e;const{text:s,icon:l,iconUrl:c,appearance:d}=r,u=le(Mi);return(0,Y.h)(il,{nodeKey:t,theme:i,appearance:d,isWorkflow:n,text:a(s),icon:l,iconUrl:c,clickHandler:e=>()=>{el(o,e,u.analyticsDispatcher,u.cardEventDispatcher,"card-button")}})},voteDownButton:e=>{let{nodeKey:t,isWorkflow:n,attributes:r,theme:i,cardInstanceId:o,variableResolver:a}=e;const{text:s,icon:l,iconUrl:c,appearance:d}=r;return(0,Y.h)(il,{nodeKey:t,theme:i,appearance:d,isWorkflow:n,text:a(s),icon:l,iconUrl:c,clickHandler:e=>()=>{e.requestFeedback(o,{sentiment:"negative",source:"card-button",textFeedback:!0})}})},actionButtonGroup:e=>{let{children:t,theme:n,feedOrientation:r,isWorkflow:i}=e;const o=oe(null),[a,s]=te({primaryButtonTransparent:void 0,secondaryButtonTransparent:void 0,firstButtonTransparent:!1,finalButtonTransparent:!1});return re((()=>{var e,t,n;const r=null===(t=o.current)||void 0===t||null===(n=t.base)||void 0===n?void 0:n.childNodes;if(r)for(let t=0;t<r.length;t++){var i;const n=r[t],o=n.getAttribute("appearance"),l=null!==(e=null===(i=window.getComputedStyle(n).backgroundColor.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/))||void 0===i?void 0:i.length)&&void 0!==e?e:0;"primary"!==o||a.primaryButtonTransparent?"secondary"!==o||a.secondaryButtonTransparent||s((e=>Object.assign(Object.assign({},e),{secondaryButtonTransparent:l>0}))):s((e=>Object.assign(Object.assign({},e),{primaryButtonTransparent:l>0}))),0===t&&s((e=>Object.assign(Object.assign({},e),{firstButtonTransparent:l>0}))),t===r.length-1&&s((e=>Object.assign(Object.assign({},e),{finalButtonTransparent:l>0})))}}),[o]),(0,Y.h)(_c,{ref:o,theme:n,feedOrientation:r,isWorkflow:i,transparencies:a},t)},cardDescription:e=>{var t;let{attributes:{text:n,icon:r,iconUrl:i},theme:o,variableResolver:a}=e;const s=o.getCSSFontProperties("category"),l=o.getNumericFontSize("category"),c=o.getCSSColor("icon.category",{skipFallback:!0}),d=o.getCSSColor("icon.category");return(0,Y.h)(vc,{theme:o,"data-testid":"card-category"},(r||i)&&(0,Y.h)(pn,{iconName:r,iconUrl:i,size:null!=l?l:20,color:null!==c?c:void 0,fallbackColor:d,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(t=null==s?void 0:s.lineHeight)&&void 0!==t?t:"initial",marginRight:"10px",width:`${l}px`,minWidth:`${l}px`,textAlign:"center"}}),(0,Y.h)(fc,null,a(n)))},headline:e=>{var t;let{nodeKey:n,attributes:{text:r,icon:i,iconUrl:o},theme:a,variableResolver:s}=e;const l=a.getCSSFontProperties("headline"),c=a.getNumericFontSize("headline"),d=a.getCSSColor("icon.headline",{skipFallback:!0}),u=a.getCSSColor("icon.headline");return(0,Y.h)(ll,{theme:a,headlineFontProperties:l},(i||o)&&(0,Y.h)(pn,{iconName:i,iconUrl:o,size:null!=c?c:20,color:null!==d?d:void 0,fallbackColor:u,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(t=null==l?void 0:l.lineHeight)&&void 0!==t?t:"initial",marginRight:"10px",width:`${c}px`,minWidth:`${c}px`,textAlign:"center"}}),(0,Y.h)(cl,{key:n,theme:a,"data-testid":"card-headline","data-element-key":n},s(r)))},text:e=>{var n,r,i,o,a,s;let{nodeKey:l,theme:c,attributes:{icon:d,iconUrl:u,text:h,clickToExpandEnabled:p,maxDisplayLines:m,showTextLabel:g,hideTextLabel:v},isWorkflow:f,variableResolver:b,cardInstanceId:y,subviewId:w,subviewTitle:S}=e;const k=oe(null),C=oe(null),[x,I]=te(!1),[O,T]=te(null),[M,F]=te(null),[j,D]=te(tc().matches?"dark":"light"),A=oe((0,t.v4)()),_=null===(i=k.current)||void 0===i?void 0:i.base.querySelector(`#expand-text-${A.current}`),E=null===(o=k.current)||void 0===o?void 0:o.base.querySelector(`#collapse-text-${A.current}`),L=yl(Xc(b(h))),H=le(Mi).analyticsDispatcher;let P;dd(c.getCSSFontProperties("body"))||(P=c.getCSSFontProperties("body"));const R=c.getNumericFontSize("body"),V=Object.assign(Object.assign(Object.assign({},w&&{subviewId:w}),S&&{subviewTitle:S}),w&&{subviewLevel:1}),$=c.getCSSColor("icon.body",{skipFallback:!0}),N=c.getCSSColor("icon.body"),z=()=>{if(!(k.current&&C.current&&m&&p))return T(null),I(!1),F(!1);const e=C.current.base;e.style.width=getComputedStyle(k.current.base).width;const t=getComputedStyle(k.current.base).lineHeight,n=getComputedStyle(k.current.base).fontSize;let r;r=isNaN(parseFloat(t))?Math.ceil((parseFloat(n)+1)*m):Math.ceil((parseFloat(t)+1)*m);let i=0,o="",a=!1;const s=document.createElement("div");s.innerHTML=L;const l=Array.from(s.children);for(let t=0;t<l.length;t++){const n=l[t].cloneNode(!0);e.innerHTML="",e.appendChild(n);const s=e.getBoundingClientRect().height;if(!(Math.ceil(i+s)<r)){if(Math.ceil(i+s)===r){i+=s,o+=n.outerHTML;if(t<l.length-1){const t=ic(n,Math.ceil(s),e,A.current,c,g);o=o.replace(n.outerHTML,t),a=!0}break}if(t<l.length-1||n.textContent.length>0){o+=ic(n,Math.ceil(r-i),e,A.current,c,g),a=!0}else o+=n.outerHTML;break}i+=s,o+=n.outerHTML}a?(T(o),F(!0)):F(!1)};re((()=>{let e;if(p){const t=()=>{z()};document.fonts.onloadingdone=t,"ResizeObserver"in window&&(e=new ResizeObserver(z),e.observe(document.body))}const t=e=>{D(e.matches?"dark":"light")};return tc().addEventListener("change",t),()=>{var n;null===(n=e)||void 0===n||n.disconnect(),document.fonts.onloadingdone=null,tc().removeEventListener("change",t)}}),[L]),re(z,[L,m,p,j,g,v]),re((()=>{const e=()=>I(!0),t=()=>I(!1),n=k.current.base;if(!n)return;const r=n.querySelector(`#expand-text-${A.current}`),i=n.querySelector(`#collapse-text-${A.current}`);return r&&r.addEventListener("click",e),i&&i.addEventListener("click",t),()=>{r&&r.removeEventListener("click",e),i&&i.removeEventListener("click",t)}}),[_,E,O,x,M]),re((()=>{const e=document.querySelector(`#markdown-${A.current}`);if(e){Array.from(e.querySelectorAll(".md-subview-link")).forEach((e=>{e.addEventListener("click",(()=>{var t;I(!1),F(!1),T(null),ye().handleSubviewLinkPress(y,null==e||null===(t=e.dataset)||void 0===t?void 0:t.subviewId)})),e.addEventListener("keydown",(t=>{var n;Er(t.key)===Dr&&(I(!1),F(!1),T(null),ye().handleSubviewLinkPress(y,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;H.sendEvent({cardInstanceId:y,cardViewState:f?"subview":"topview",eventName:Je,properties:Object.assign({linkMethod:"url",url:null!=n?n:"",detail:"textLink"},V)})}))}))}}),[L,M,x]);return(0,Y.h)(Y.Fragment,null,(0,Y.h)(ec,{key:l,theme:c,bodyFontProperties:P,isWorkflow:f,"data-element-key":l,"data-testid":"text-block"},(d||u)&&(0,Y.h)(pn,{iconName:d,iconUrl:u,size:null!=R?R:20,color:null!==$?$:void 0,fallbackColor:N,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(n=null===(a=P)||void 0===a?void 0:a.lineHeight)&&void 0!==n?n:"initial",marginRight:"10px",width:`${R}px`,minWidth:`${R}px`,textAlign:"center"}}),(0,Y.h)(Ql,{id:`markdown-${A.current}`,"data-testid":"text-markdown",theme:c,ref:k,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:L&&0!==L.length&&null!==M?x||!O?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}(L,M,null===(W=C.current)||void 0===W?void 0:W.base,rc(null!=v?v:"Show less",c,"collapse",`collapse-text-${A.current}`,(null===(U=k.current)||void 0===U?void 0:U.base.getBoundingClientRect().width)+"px")):O:"<p></p>"}}),(0,Y.h)(Gl,{dangerouslySetInnerHTML:{__html:L}})),(0,Y.h)(Xl,{bodyFontProperties:P,isWorkflow:f,"aria-hidden":"true"},(d||u)&&(0,Y.h)(pn,{iconName:d,iconUrl:u,size:null!=R?R:20,color:null!==$?$:void 0,fallbackColor:N,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(r=null===(s=P)||void 0===s?void 0:s.lineHeight)&&void 0!==r?r:"initial",marginRight:"10px",width:`${R}px`,minWidth:`${R}px`,textAlign:"center"}}),(0,Y.h)(Jl,{theme:c,ref:C})));var W,U},list:e=>{let t,{nodeKey:n,attributes:{type:r},children:i,theme:o}=e;switch(r){case"bullet":t=pl;break;case"number":t=ml;break;case"comma":t=gl}return t?(0,Y.h)(t,{key:n,"data-element-key":n,theme:o},i):null},listItem:e=>{let{nodeKey:n,attributes:{text:r,icon:i},theme:o,isWorkflow:a,variableResolver:s,cardInstanceId:l,subviewId:c,subviewTitle:d}=e;const u=oe((0,t.v4)()),h=le(Mi).analyticsDispatcher,p=yl(Xc(s(r))),m=Object.assign(Object.assign(Object.assign({},c&&{subviewId:c}),d&&{subviewTitle:s(d)}),c&&{subviewLevel:1});let g;re((()=>{const e=document.querySelector(`#markdown-${u.current}`);if(e){Array.from(e.querySelectorAll(".md-subview-link")).forEach((e=>{const t=()=>{var t,n;ye().handleSubviewLinkPress(l,null==e||null===(t=e.dataset)||void 0===t?void 0:t.subviewId),c&&(null==e||null===(n=e.dataset)||void 0===n?void 0:n.subviewId)!==c&&h.sendEvent({cardInstanceId:l,cardViewState:"subview",eventName:st,properties:m})};e.addEventListener("click",t),e.addEventListener("keydown",(e=>{Er(e.key)===Dr&&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:a?"subview":"topview",eventName:Je,properties:Object.assign({linkMethod:"url",url:null!=n?n:"",detail:"textLink"},m)})}))}))}}),[p]),dd(g)||(g=o.getCSSFontProperties("bullet"));const v=o.getCSSColor("icon.bullet",{skipFallback:!0}),f=o.getCSSColor("icon.bullet");return(0,Y.h)(Sl,{key:n,"data-element-key":n,theme:o,class:i?"with-icon":"without-icon"},i&&(0,Y.h)(pn,{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,Y.h)(kl,{id:`markdown-${u.current}`,theme:o,"data-testid":"list-item-text",dangerouslySetInnerHTML:{__html:p}}))},image:t=>{let n,{nodeKey:r,cardInstanceId:i,subviewId:o,subviewTitle:a,theme:s,attributes:{format:l,thumbnailSrc:c,description:d,label:u,src:h,dimensions:p,altText:m,behaviour:g,url:v,target:f,layoutId:b,payload:y},variableResolver:w}=t;const S=le(Mi),k=S.containersBroadcastChannel;switch(l){case"inline":n=_l;break;case"banner":n=Dl;break;case"thumbnail":n=Fl;break;case"text":n=Hl}const C=h&&h.length>0?"image":"imageWithoutSrc";return n?(0,Y.h)(me.lj,{actions:(0,e.Y2)(ge,$e),mapToProps:e=>({customStrings:e.application.customStrings})},(e=>{const t=se((()=>{switch(g){case"url":return v?e=>{e.preventDefault();const t={url:w(v),target:e.ctrlKey||e.metaKey?"_blank":null!=f?f:"_blank"};if(S.analyticsDispatcher.sendEvent({cardInstanceId:i,cardViewState:o?"subview":"topview",eventName:Je,properties:Object.assign({linkMethod:"url",url:t.url,trigger:"image"},o?{subviewId:o,subviewTitle:a,subviewLevel:1}:{})}),"_top"===t.target&&k){const e=`${r}-image-link`;return k.addEventListener("message",(n=>{if(n.data.type===ps.ANALYTICS_EVENT){var r;const o=null===(r=n.data)||void 0===r?void 0:r.eventQueued;o.eventName===Je&&o.cardInstanceId===i&&k&&t&&(k.removeEventListener(e),window.open(t.url,t.target))}}),e)}return window.open(t.url,t.target)}:()=>{Qe.error({level2:[`url type image link for card: ${i} has no url`]})};case"subview":return b?()=>{e.handleImageLinkPress(i,{layoutId:b,currentSubviewId:o,currentSubviewTitle:a})}:()=>{Qe.error({level2:[`subview type image link for card: ${i} has no subview id`]})};case"payload":return y?()=>{e.handleImageLinkPress(i,{payload:y,currentSubviewId:o,currentSubviewTitle:a})}:()=>{Qe.error({level2:[`payload type image link for card: ${i} has no payload`]})};case"none":return;default:return()=>{e.viewMedia(i,Object.assign({type:C,url:w(h),title:w(u)},(null==m?void 0:m.src)?{alt:w(m.src)}:{}))}}}),[g,i,k]);return(0,Y.h)(n,{nodeKey:r,mediaType:C,theme:s,customStrings:e.customStrings,src:w(c),dimensions:p,url:v,label:w(u),description:w(d),alt:w(null==m?void 0:m.thumbnailSrc),onClickImage:t})})):null},video:e=>{let{nodeKey:t,cardInstanceId:n,attributes:r,theme:i,isWorkflow:o,variableResolver:a}=e;const[s,l]=te(!1),[c,d]=te(void 0);return s?(0,Y.h)(Yl,{nodeKey:t,cardInstanceId:n,isWorkflow:o,format:r.format,src:a(r.src),thumbnailSrc:a(r.thumbnailSrc),dimensions:r.dimensions,loadedDimensions:c,theme:i,label:a(r.label),description:a(r.description)}):(0,Y.h)(Bl,{nodeKey:t,cardInstanceId:n,isWorkflow:o,format:r.format,src:a(r.src),thumbnailSrc:a(r.thumbnailSrc),dimensions:r.dimensions,onLoad:d,theme:i,label:a(r.label),description:a(r.description),altText:{src:a(null===(u=r.altText)||void 0===u?void 0:u.src),thumbnailSrc:a(null===(h=r.altText)||void 0===h?void 0:h.thumbnailSrc)},setPlaying:l});var u,h},form:e=>{let{cardInstanceId:t,subviewId:n,attributes:{defaultValues:r},isWorkflow:i,feedOrientation:o,children:a}=e;return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(0,Y.h)(al,{isWorkflow:i,feedOrientation:o,initializeFormStore:sl(e,t,r,n)},a)))},textInput:Ka,numberInput:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{defaultValue:i,thumbnailSrc:o,placeholder:a,name:s},theme:l,validations:c,variableResolver:d}=e;const u=oe(null),h=oe(i&&Yc(i.toString())?i.toString():""),[p,m]=te(h.current);re((()=>{const e=Ye(n,s,r);if(e)h.current=e.toString(),m(e.toString());else{const e=Yc(p);Be().handleFormChange(n,s,null!=e?e:void 0,r)}}),[]),re((()=>{const e=i&&Yc(i.toString())?i.toString():"";if(e!==h.current){if(p===h.current){const t=Yc(e);Be().handleFormChange(n,s,null!=t?t:void 0,r),m(e)}h.current=e}}),[i]);const g=d(a);return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(0,Y.h)(Y.Fragment,null,(0,Y.h)(Yo,{nodeKey:t,mode:"inline",theme:l},o&&(0,Y.h)(Zo,{thumbnailUrl:d(o),theme:l}),(0,Y.h)(qa,{theme:l,ref:u,placeholder:g,value:p,title:g,className:"input-number",inputmode:"decimal",onInput:t=>{const{value:i}=t.target,o=p;let a;m(i),a=Kc(i)?i.trim():o,m(a);const l=Yc(a);((e,t)=>{null!==bc&&(clearTimeout(bc),bc=null),bc=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,Y.h)(ea,{name:s,cardInstanceId:n,subviewId:r,theme:l,variableResolver:d}))))},stepper:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{defaultValue:i,minimumValue:o,maximumValue:a,stepValue:s,thumbnailSrc:l,label:c,name:d},validations:u,theme:h,variableResolver:p}=e;const m=o||0,g=a||100,v=s&&s>0?s:1,f=oe(i&&i>=m&&i<=g?i:m),[b,y]=te(f.current),[w,S]=te(f.current),[k,C]=te(!0),x=h.getCSSColor("icon.stepper"),I=h.getCSSColor("icon.stepperDisabled"),O=null==b||!hc(b,g,v)||!k,T=null==b||!uc(b,m,v)||!k;re((()=>{const e=Ye(n,d,r);e?(f.current=e,y(e),S(e)):Be().handleFormChange(n,d,b,r)}),[]),re((()=>{const e=i&&i>=m&&i<=g?i:m;e!==f.current&&(w===f.current&&(Be().handleFormChange(n,d,e,r),y(e),S(e)),f.current=e)}),[i]);const M=p(c),F=(e,t)=>{null!==pc&&(clearTimeout(pc),pc=null),pc=setTimeout((()=>{t(n,d,null!=e?e:void 0,u,r)}),400)};return(0,Y.h)(me.lj,{actions:$e,mapToProps:e=>{let{}=e}},(e=>(0,Y.h)(Y.Fragment,null,(0,Y.h)(Yo,{nodeKey:t,mode:"inline",theme:h,cursor:"default"},l&&(0,Y.h)(Zo,{thumbnailUrl:p(l),theme:h}),(0,Y.h)(dc,{theme:h},M),(0,Y.h)(sc,{theme:h},(0,Y.h)(lc,{theme:h,disabled:T,tabIndex:"0","aria-label":`Decrease value by ${v}`,class:"stepper-decrement",onClick:()=>{if(null==b||!uc(b,m,v)||!k)return;const t=((e,t,n)=>e-t<n?n:e-t)(b,v,m);S(t),y(t),e.handleFormChange(n,d,t,r),F(t,e.validateField)}},(0,Y.h)(ac,{fillColor:T?I:x})),(0,Y.h)(cc,{type:"number",theme:h,tabIndex:"0",title:M,className:"stepper-value",onInput:t=>{const{value:i}=t.target,o=w;let a;S(i),a=Kc(i)?i.trim():o,C(((e,t,n)=>e>=t&&e<=n)(a,m,g)),S(a);const s=Yc(a);y(s),e.handleFormChange(n,d,null!=s?s:void 0,r),F(s,e.validateField)},onBlur:()=>{e.validateField(n,d,b,u,r)},value:w}),(0,Y.h)(lc,{theme:h,disabled:O,tabIndex:"0","aria-label":`Increase value by ${v}`,class:"stepper-increment",onClick:()=>{if(null==b||!hc(b,g,v)||!k)return;const t=((e,t,n)=>e+t>n?n:e+t)(b,v,g);S(t),y(t),e.handleFormChange(n,d,t,r),F(t,e.validateField)}},(0,Y.h)(oc,{fillColor:O?I:x})))),(0,Y.h)(ea,{name:d,cardInstanceId:n,subviewId:r,theme:h,variableResolver:p}))))},checkbox:e=>{let{nodeKey:t,children:n,cardInstanceId:r,subviewId:i,attributes:{name:o},theme:a,variableResolver:s}=e;return(0,Y.h)(Y.Fragment,null,(0,Y.h)(Ec,{key:t,"data-element-key":t,role:"group"},(0,Y.h)(Lc,{"aria-label":"checkbox group"},n)),(0,Y.h)(ea,{name:o,cardInstanceId:r,subviewId:i,theme:a,variableResolver:s}))},checkboxItem:e=>{var t,n;let{nodeKey:r,cardInstanceId:i,subviewId:o,attributes:{label:a,key:s,checked:l},theme:c,variableResolver:d,parentFieldName:u,parentValidations:h}=e;const p=oe(l),m=oe(`${i}-${s}`),[g,v]=te(null!==(t=p.current)&&void 0!==t&&t),f=null!==(n=c.getCSSColor("icon.checkedCheckbox",{skipFallback:!0}))&&void 0!==n?n:"#FFF";let b;dd(b)||(b=c.getCSSFontProperties("primary"),parseInt(b.lineHeight)<20&&(b.lineHeight="20px"));const y=e=>{const t=Ye(i,u,o)||{};return Be().handleFormChange(i,u,Object.assign(Object.assign({},t),{[s]:e}),o),Object.assign(Object.assign({},t),{[s]:e})};return re((()=>{const e=Ye(i,u,o);void 0!==e&&void 0!==e[s]?(p.current=e[s],v(e[s])):y(g)}),[]),re((()=>{void 0!==l&&l!==p.current&&(g===p.current&&(v(l),y(l)),p.current=l)}),[l]),(0,Y.h)("li",null,(0,Y.h)(Pc,{key:r,"data-element-key":r,labelFontProperties:b,role:"checkbox","aria-labelledby":m.current,"aria-checked":g},(0,Y.h)(Rc,{type:"checkbox",checked:g,theme:c,onChange:()=>{v(!g);const e=y(!g);Be().validateField(i,u,e,h,o)},"aria-hidden":"true"}),(0,Y.h)(Vc,{theme:c,isChecked:g},g&&(0,Y.h)(Hc,{fillColor:f,style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},ariaHidden:!0})),(0,Y.h)($c,{theme:c,id:m.current,"data-testid":"checkbox-label",labelFontProperties:b,"aria-hidden":"true"},d(a))))},switch:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{defaultValue:i,thumbnailSrc:o,label:a,name:s},theme:l,variableResolver:c}=e;const d=oe(i),[u,h]=te(d.current);re((()=>{const e=Ye(n,s,r);void 0!==e?(d.current=e,h(e)):Be().handleFormChange(n,s,u,r)}),[]),re((()=>{i!==d.current&&(u===d.current&&(Be().handleFormChange(n,s,i,r),h(i)),d.current=i)}),[i]);const p=`switch-label-${s}`;return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(0,Y.h)(Yo,{nodeKey:t,mode:"inline",theme:l},o&&(0,Y.h)(Zo,{thumbnailUrl:c(o),theme:l}),(0,Y.h)(Go,{theme:l,name:p},c(a)),(0,Y.h)(mc,{on:u,theme:l,tabIndex:"0",role:"switch","aria-checked":u,"aria-labelledby":p,className:"switch-toggle",onClick:()=>{h(!u),e.handleFormChange(n,s,!u,r)}},(0,Y.h)(gc,{on:u,theme:l})))))},dropdown:da,datePicker:ma,upload:Ac},Wc=["linkButton","submitButton","dismissButton","snoozeButton","voteUpButton","voteDownButton"],Uc=e=>{let{node:t,cardInstanceId:n,cardMetadata:r,isWorkflow:i,theme:o,runtimeVariables:a,feedOrientation:s,subviewId:l,subviewTitle:c,embedMode:d,parentFieldName:u,parentValidations:h}=e;const p=zc[t.type];return p?(0,Y.h)(p,Nc({},t.key&&{nodeKey:t.key},{cardInstanceId:n,cardMetadata:r,subviewId:l,subviewTitle:c,attributes:t.attributes,validations:t.validations,isWorkflow:i,theme:o,variableResolver:e=>ed(e,a),feedOrientation:s,embedMode:d,parentFieldName:u,parentValidations:h}),t.children&&t.children.map((e=>{var s;return(0,Y.h)(Uc,{cardInstanceId:n,cardMetadata:r,subviewId:l,subviewTitle:c,node:e,isWorkflow:i,theme:o,runtimeVariables:a,embedMode:d,parentFieldName:null===(s=t.attributes)||void 0===s?void 0:s.name,parentValidations:t.validations})}))):null},qc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"},Bc=/[&<>"'\/]/g,Yc=e=>{if(""===e)return null;const t=Number(e);return Number.isNaN(t)?null:t},Kc=e=>null!==Yc(e)||""===e||"-"===e,Zc=e=>{let t=Array();for(var n in e){const r=e[n];t.push(r),r.children&&(t=t.concat(Zc(r.children)))}return t},Qc=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)),Wc.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)},Gc=(e,t)=>{const n=e=>{for(let r in e){const i=e[r];"string"==typeof i&&(e[r]=ed(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=ed(i.title,t))}},Xc=e=>e?e.replace(Bc,(e=>qc[e]||e)):"",Jc=/!\{([\w\.]+?)\}/g,ed=(e,t)=>e&&t&&"string"==typeof e?e.replace(Jc,((e,n)=>t.get(n)||"")):e||"",td={years:o.addYears,months:o.addMonths,weeks:o.addWeeks,days:o.addDays,hours:o.addHours,minutes:o.addMinutes,seconds:o.addSeconds},nd=e=>{if("string"!=typeof e)return null;const t=e.match(m);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},rd=(e,t)=>{const n=nd(e);return n?Object.entries(td).reduce(((e,t)=>{let[r,i]=t;const o=n[r];return o?i(e,o):e}),t):t},id=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},od=e=>{if(!ad(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")}},ad=e=>!!e.match(/^[\w-]+\.[\w-]+\.[\w-]*$/),sd=e=>{const t=u().getState().application.embedMode;return(null==e?void 0:e.enabled)&&"standalone"===t?"horizontal":"vertical"},ld=()=>{const e=sessionStorage.getItem(S),t=e?JSON.parse(e):void 0;return new Set(t)},cd=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),dd=e=>e&&cd(e)&&0===Object.keys(e).length,ud=(e,t)=>e.length===t.length&&(e.sort(),t.sort(),e.every(((e,n)=>e===t[n])));var hd=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 pd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const md=(e,t)=>{if(!e)return null;let n;try{n=od(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},gd="AtomicAnalyticsQueue";var vd=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 fd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bd={noInternet:"AACNoInternetError",missingApiHost:"AACMissingApiHostError",apiError:"AACApiError",invalidParameters:"AACInvalidParametersError",notPermitted:"AACOperationNotPermittedError",authTokenError:"AACAuthTokenError"},yd="Device is not connected to the internet",wd="API host was not specified for the request.",Sd="An API error occurred.",kd="Failed to retrieve an authentication token for request.",Cd={method:"GET",mode:"cors"},xd=e=>vd(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}})),Id=e=>e<400,Od=(e,t,n,r,o)=>{var a,s;const l=null!==(a=md(n,o))&&void 0!==a?a: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 Td{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 vd(this,void 0,void 0,(function*(){let i,o;if(this.verifyInitialised(),!navigator.onLine){const e=new Error(yd);return e.name=bd.noInternet,{response:{error:e}}}{const a=jd(this.apiHost,e,this.environmentId);if(!a){const e=new Error(wd);return e.name=bd.missingApiHost,{response:{error:e}}}let s;if(t)try{s=yield t.requestToken()}catch(e){const t=new Error(`${kd} ${e}`);return t.name=bd.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},Cd),{headers:Md({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 xd(t);if(n.json&&(i=n.json),!Id(t.status))throw Od(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(`${Sd} ${e}`);return t.name=bd.apiError,{data:i,response:{status:o,error:t}}}}}))}static post(e,t,n,r){return vd(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(yd);return e.name=bd.noInternet,{response:{error:e}}}{let i,o;const a=jd(this.apiHost,e,this.environmentId);if(!a){const e=new Error(wd);return e.name=bd.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${kd} ${e}`);return t.name=bd.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},Cd),{method:"POST",headers:Md({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 xd(t);if(n.json&&(i=n.json),!Id(t.status))throw Od(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(`${Sd} ${e}`);return t.name=bd.apiError,{data:i,response:{status:o,error:t}}}}}))}static put(e,t,n,r){return vd(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(yd);return e.name=bd.noInternet,{response:{error:e}}}{let i,o;const a=jd(this.apiHost,e,this.environmentId);if(!a){const e=new Error(wd);return e.name=bd.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${kd} ${e}`);return t.name=bd.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},Cd),{method:"PUT",headers:Md({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 xd(t);if(n.json&&(i=n.json),!Id(t.status))throw Od(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(`${Sd} ${e}`);return t.name=bd.apiError,{data:i,response:{status:o,error:t}}}}}))}static delete(e,t,n,r){return vd(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(yd);return e.name=bd.noInternet,{response:{error:e}}}{let i,o;const a=jd(this.apiHost,e,this.environmentId);if(!a){const e=new Error(wd);return e.name=bd.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${kd} ${e}`);return t.name=bd.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},Cd),{method:"DELETE",headers:Md({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 xd(t);if(n.json&&(i=n.json),!Id(t.status))throw Od(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(`${Sd} ${e}`);return t.name=bd.apiError,{data:i,response:{status:o,error:t}}}}}))}}fd(Td,"apiHost","https://client-api.atomic.io"),fd(Td,"apiKey",void 0),fd(Td,"environmentId",void 0),fd(Td,"instanceId",void 0),fd(Td,"testHost",void 0),fd(Td,"clientAppVersion","unknown"),fd(Td,"tokenUserIdAttribute",void 0);const Md=e=>Fd("header",Object.assign({},e)),Fd=(e,t)=>{const n="header"===e;let r={"x-atomic-sdk-platform":"Web","x-atomic-sdk-version":"25.2.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},jd=(e,t,n)=>{if(!e||0==e.trim().length)return null;return`${e.endsWith("/")?e:`${e}/`}${n&&n.trim().length>0?`${n}/`:""}${t}`};function Dd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ad=e=>{const t=new Error(e);return t.name="Stream filter error",Qe.error({level1:[t]}),t},_d=(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 Ed{constructor(e,t){var n=this;Dd(this,"filters",void 0),Dd(this,"onApplyFilter",void 0),Dd(this,"onClearFilter",void 0),Dd(this,"addVariableFilter",(e=>this.variableFilter("variables",e,"addVariableFilter"))),Dd(this,"addPayloadVariableFilter",(e=>this.variableFilter("eventPayload.detail",e,"addPayloadVariableFilter"))),Dd(this,"addPayloadMetadataFilter",(e=>this.variableFilter("eventPayload.metadata",e,"addPayloadMetadataFilter","metadata"))),Dd(this,"variableFilter",(function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"variable";if(!t)throw Ad(`The name of the ${i} you are filtering by must be supplied to \`${r}\``);return Ld(n.filters,e,t,(e=>{const t=Array.isArray(e);if(!t&&!["string","number","boolean","null"].includes(typeof e))throw Ad(`Incorrect value provided for "${i}" filter. Must be a string, a number, a boolean or null.`);if(t&&!_d(e,["string","number"]))throw Ad(`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"])})),Dd(this,"addCardTemplateIdFilter",(()=>Ld(this.filters,"metadata","cardTemplateId",(e=>{const t=Array.isArray(e);if(!t&&"string"!=typeof e)throw Ad('Incorrect "card template id" filter value provided, must be a string.');if(t&&!_d(e,["string"]))throw Ad('Incorrect "card template id" filter value provided, for "in" or "notIn" an array of strings must be supplied.')}),["equals","in","notEqualTo","notIn"]))),Dd(this,"addCardTemplateNameFilter",(()=>Ld(this.filters,"metadata","cardTemplateName",(e=>{const t=Array.isArray(e);if(!t&&"string"!=typeof e)throw Ad('Incorrect "card template name" filter value provided, must be a string.');if(t&&!_d(e,["string"]))throw Ad('Incorrect "card template name" filter value provided, for "in" or "notIn" an array of strings must be supplied.')}),["equals","in","notEqualTo","notIn"]))),Dd(this,"addCardCreatedFilter",(()=>Ld(this.filters,"metadata","created",(e=>{if("string"!=typeof e||!id(e))throw Ad('Incorrect "card created" filter value provided, must be a valid ISO date string')}),["equals","greaterThan","greaterThanOrEqualTo","lessThan","lessThanOrEqualTo","notEqualTo"]))),Dd(this,"addCardPriorityFilter",(()=>Ld(this.filters,"metadata","priority",(e=>{const t=typeof e,n=Array.isArray(e);if(n&&!_d(e,["number"]))throw Ad('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 Ad('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 Ad('Incorrect "card priority" filter value provided, must be a number between 1 & 10 inclusive.')}),["equals","greaterThan","greaterThanOrEqualTo","in","lessThan","lessThanOrEqualTo","notEqualTo","notIn","between"]))),Dd(this,"clearFilters",(()=>{this.filters={},this.onClearFilter()})),Dd(this,"apply",(()=>{this.onApplyFilter()})),Dd(this,"getFilterObject",(()=>this.filters)),this.filters={},this.onApplyFilter=e,this.onClearFilter=t}}const Ld=(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 Ad(`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 Ad(`Operator "${n}" must be a number or ISO date string`);if("string"===r&&!id(t))throw Ad(`Operator "${n}" must be a number or ISO date string`);break;case"in":case"nin":if(!Array.isArray(t))throw Ad(`Operator "${n}" must be either an array of numbers or an array of strings`);if(!_d(t,["string","number"]))throw Ad(`Operator "${n}" must be either an array of numbers or an array of strings`);break;case"between":if(2!==t.length||!_d(t,["number"]))throw Ad(`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")};return Object.keys(a).forEach((e=>{i.includes(e)||delete a[e]})),a},Hd="custom-ping",Pd="auth",Rd="subscribe",Vd="unsubscribe",$d="events",Nd="custom-pong",zd="auth-success",Wd="token-expiry",Ud="update-cards",qd="events-processed",Bd="error",Yd="invalid-token",Kd="expired-token",Zd="invalid-stream-container-id",Qd="invalid-filter",Gd="invalid-message",Xd=()=>{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 Jd=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 eu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tu={name:"Invalid stream container id",message:"an invalid stream container id was provided with the subscription request"},nu={name:"Invalid filter",message:"an invalid filter was provided with the subscription request"},ru={name:"Invalid token",message:'Atomic platform responded with an "invalid token" message'},iu={name:"Expired token",message:'Atomic platform responded with an "expired token" message'};class ou{static reset(){this.activeSubscriptions={},this.lastPongSuccess=void 0}static messageSubscribedContainer(e,t){if(void 0===Ru.streamContainers[e])return Qe.error({level3:["No stream container found for subscriptionId: ",e]});Ru.streamContainers[e].sendMessageToIframe(t)}static messageAllSubscribedContainers(e){Object.values(this.activeSubscriptions).forEach((t=>{this.messageSubscribedContainer(t.subscriptionId,e)}))}static handleWebSocketMessage(e){return Jd(this,void 0,void 0,(function*(){switch(e.messageType){case Nd:Qe.debug({level1:["pong received by WebSockets"],level2:[e]}),this.lastPongSuccess=(new Date).toISOString();break;case zd:hu.connectionAuthenticated||(hu.connectionAuthenticated=!0,Ru.authMessageResolve()),Qe.debug({level1:["auth success received by WebSockets"],level2:[e]});break;case Wd:Qe.debug({level1:["token expiry received by WebSockets"],level2:[e]}),hu.connectionAuthenticated=!1;try{yield Ru.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){Qe.error({level1:["Token expired, new token request failed"],level2:[e]})}break;case Ud:{Qe.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:g,values:{cardFeedUpdates:n[e]}})}));break}case qd:{var t;Qe.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)&&Ru.analyticsQueue.removeProcessedEvents(n);break}case Bd:this.handleWebSocketErrorMessage(e);break;default:Qe.debug({level1:["unknown message received by WebSockets"],level2:[e]})}}))}static handleWebSocketErrorMessage(e){var t,n,r;return Jd(this,void 0,void 0,(function*(){switch(e.data.errorType){case Yd:{const e=new Error(ru.message);e.name=ru.name,Qe.error({level1:["Invalid token error received by WebSockets."],level2:[e]}),hu.connectionAuthenticated||Ru.authMessageReject(e),hu.connectionAuthenticated=!1;try{yield Ru.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){Qe.error({level1:["Token invalid, new token request failed"],level2:[e]}),this.messageAllSubscribedContainers({action:"io.atomic.events.invalidToken",values:null!==(t=e.message)&&void 0!==t?t:e})}break}case Kd:{const t=new Error(null!==(n=e.data.errorMessage)&&void 0!==n?n:iu.message);t.name=iu.name,Qe.error({level1:["Expired token error received by WebSockets"],level2:[t]}),hu.connectionAuthenticated||Ru.authMessageReject(t),hu.connectionAuthenticated=!1;try{yield Ru.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){Qe.error({level1:["Token expired, new token request failed"],level2:[e]}),this.messageAllSubscribedContainers({action:"io.atomic.events.expiredToken",values:null!==(r=e.message)&&void 0!==r?r:e})}break}case Zd:{var i;const t=e.data.subscriptionId,n=new Error(`${tu.message} - ${null===(i=this.activeSubscriptions[t])||void 0===i?void 0:i.streamContainerId}`);n.name=tu.name,Qe.error({level1:["Invalid stream container id error received by WebSockets"],level2:[n]}),this.messageSubscribedContainer(t,{action:"io.atomic.events.invalidStreamContainerId",values:n.message});break}case Qd:{const t=e.data.subscriptionId,n=new Error(nu.message);n.name=nu.name,n.message=nu.message,Qe.error({level1:["Invalid filter error received by WebSockets"],level2:[n]}),this.messageSubscribedContainer(t,{action:"io.atomic.events.invalidFilter",values:n.message});break}case Gd:Qe.error({level1:["Invalid message error received by WebSockets"],level2:[e]});break;default:Qe.debug({level1:["unknown error received by WebSockets"],level2:[e]})}}))}static subscribeToCardFeed(e){try{hu.dispatchMessage({messageType:Rd,data:{subscriptions:e}}),e.forEach((e=>this.activeSubscriptions[e.subscriptionId]=e))}catch(e){throw Qe.error({level1:["Error subscribing to card feed via WebSocket"],level2:[e]}),e}}static unsubscribeFromCardFeed(e){try{hu.dispatchMessage({messageType:Vd,data:{subscriptionIds:e}}),e.forEach((e=>delete this.activeSubscriptions[e]))}catch(e){Qe.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:f}))))}static unsubscribeActiveSubscriptions(){const e=Object.values(this.activeSubscriptions);e.length&&this.unsubscribeFromCardFeed(e.map((e=>e.subscriptionId)))}static sendAuthMessage(e){try{hu.dispatchMessage({messageType:Pd,authToken:e})}catch(e){Qe.error({level1:["Error sending auth message to WebSocket"],level2:[e]})}}static sendAnalyticsMessage(e,t){if(!Ru.webSocketDisabled&&hu.isConnected())try{hu.dispatchMessage({messageType:$d,authToken:t,data:{events:e}})}catch(e){Qe.error({level1:["Error sending analytics message to WebSocket"],level2:[e]})}}}function au(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let su;eu(ou,"activeSubscriptions",{}),eu(ou,"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"}(su||(su={}));const lu={name:"Not initialised",message:"WebSocket client has not been initialised"},cu={name:"No connection",message:"WebSocket connection is not established"},du={name:"WebSocket not ready",message:"WebSocket connection is not ready to send message"},uu={name:"Dispatch message error",message:"Unable to dispatch the client message on the WebSocket connection"};class hu{static initialise(e,t,n){let r;try{r=new URL(e),r.protocol="https:"===r.protocol?"wss":"ws"}catch(e){throw Qe.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(su.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&&(Qe.debug({level3:[`WebSocket client visibilitychange event triggered, page is ${document.visibilityState} checking connection health`]}),this.connectionHealthCheck())})),Xd()&&(document.addEventListener("pause",(()=>{Qe.debug({level3:["Cordova app pause event triggered"]}),this.close(su.sdkCordovaBackgrounded,"Connection closed by SDK, clean up WebSocket connection as app has been backgrounded")}),!1),document.addEventListener("resume",(()=>{Qe.debug({level3:["Cordova app resume event triggered"]}),Ru.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:Hd})}catch(e){Qe.error({level3:["Error sending custom ping message:",e]})}this.pingTimeout=setTimeout((()=>{Qe.debug({level3:["WebSocket client ping timeout reached, closing connection"]}),this.close(su.sdkClosedConnection,"connection timed out")}),this.connectionTimer)}),this.connectionTimer)}static setClientAppVersion(e){this.clientAppVersion=e}static connectionHealthCheck(){hu.isInitialised()&&hu.isConnected()&&ou.lastPongSuccess&&(0,o.differenceInMilliseconds)((new Date).toISOString(),ou.lastPongSuccess)>this.staleConnectionTimer&&(Qe.debug({level3:["WebSocket connection has become stale, re-initialising"]}),Ru.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===su.sdkSessionEnding&&ou.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===Rd)t=e,t.data.subscriptions=t.data.subscriptions.filter((e=>Object.keys(Ru.streamContainers).includes(e.subscriptionId))),t.data.subscriptions.length||(t=null);else t=e;try{t&&this.dispatchMessage(t),Qe.debug({level3:["WebSocket client purging message queue, message sent by WebSockets: ",t]})}catch(e){Qe.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}),o=JSON.stringify(i);try{const t=this.webSocketConnection;if(!t)throw new Error(cu.message);if(t.readyState===t.CLOSING||t.readyState===t.CLOSED)throw new Error(du.message);return t.readyState===t.CONNECTING?this.messageQueue.push(e):t.send(o)}catch(e){const t=new Error;throw t.name=uu.name,t.message=null!==(n=e.message)&&void 0!==n?n:uu.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(lu.message);if(!navigator.onLine){const e=new Error(yd);throw e.name=bd.noInternet,e}const r=jd(this.apiHost,e,this.environmentId);if(!r){const e=new Error(wd);throw e.name=bd.missingApiHost,e}if(this.webSocketConnection)switch(this.webSocketConnection.readyState){case this.webSocketConnection.OPEN:this.close(su.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=Fd("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=su.sdkSessionEnding;e.persisted&&(t=su.sdkPersistedToBrowserCache),this.close(t,"Connection closed by SDK, clean up WebSocket connection as page has been closed"),ou.lastPongSuccess=void 0,window.removeEventListener("pagehide",o)};return window.addEventListener("pagehide",o),this.webSocketConnection.readyState}catch(e){throw this.openingConnection=!1,e}}}au(hu,"apiHost",void 0),au(hu,"apiKey",void 0),au(hu,"environmentId",void 0),au(hu,"clientAppVersion","unknown"),au(hu,"testHost",void 0),au(hu,"openingConnection",!1),au(hu,"authenticatingConnection",!1),au(hu,"connectionAuthenticated",!1),au(hu,"authenticationTimeout",7e3),au(hu,"messageQueue",[]),au(hu,"webSocketConnection",void 0),au(hu,"connectionTimeout",void 0),au(hu,"pingTimeout",void 0),au(hu,"connectionTimer",3e4),au(hu,"staleConnectionTimer",2*hu.connectionTimer+5e3);const pu={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"},mu=[pu.cardFeedUpdated,pu.cardCompleted,pu.cardDismissed,pu.cardSnoozed,pu.streamDisplayed,pu.sdkInitialized,pu.cardDisplayed],gu=e=>(!e.eventName&&e.analyticsEvent&&(e.eventName=e.analyticsEvent),e),vu=e=>{const n=(new Date).toISOString();return{id:(0,t.v4)(),analyticsEvent:pu.cardFeedUpdated,eventName:pu.cardFeedUpdated,endUserId:e.endUserId,timestamp:n,properties:{cardCount:e.cardCount},sdkContext:{containerId:e.streamContainerId},eventContext:{userLocalTimestamp:(0,o.format)(n,"YYYY-MM-DDTHH:mm:ss.SSSZ")}}};function fu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class bu{constructor(e){var t,n,r,i,o;fu(this,"totals",void 0),fu(this,"metricsByContainer",void 0);const a=ld();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 yu=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 wu;const Su=(e,t,n)=>yu(void 0,void 0,void 0,(function*(){if(Ou(),!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:wu.deviceId,appId:wu.appId,streamContainerIds:e,platform:wu.platform},n?{notificationsEnabled:n}:{});const{data:i,response:o}=yield Td.put("register-containers",r,t,{streamContainerIds:e});if(Tu(Su.name,i),o.error)throw o.error;return 200===o.status})),ku=(e,t)=>yu(void 0,void 0,void 0,(function*(){Ou();let n={token:e,deviceId:wu.deviceId,appId:wu.appId,platform:wu.platform};const{data:r,response:i}=yield Td.put("register",n,t);if(Tu(ku.name,r),i.error)throw i.error;return 200===i.status})),Cu=e=>yu(void 0,void 0,void 0,(function*(){Ou();let t={deviceId:wu.deviceId,appId:wu.appId};const{data:n,response:r}=yield Td.delete("deregister-token",t,e);if(Tu(Cu.name,n),r.error)throw r.error;return 200===r.status})),xu=e=>{if(!cd(e))return null;const t=e.atomic;if(!cd(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:cd(a)?a:{}}},Iu=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:[]}},Ou=()=>{if(!Iu(wu).success)throw new Error("You must call setNativeDeviceInfo before registering for native notifications")},Tu=(e,t)=>{var n;(null==t||null===(n=t.errors)||void 0===n?void 0:n.length)&&Qe.error({level1:[`Errors detected with ${e}`,...t.errors.map((e=>null==e?void 0:e.title))]})};var Mu=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 Fu=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&&(Qe.warn({level1:n}),delete e.preferences.notifications)}};var ju=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 Du(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Au=n(5373),_u="authCallbackError",Eu="authRetryIntervalPending",Lu="authTokenError",Hu=(e,t)=>{t(e)},Pu=(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?Xd():"https://downloads.atomic.io/web-sdk/release/25.2.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 c=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 d=`\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,"&apos;")}' type='application/javascript'><\/script>\n <div id='custom-container-header' style='display:none;'>${null!=c?c:""}</div>\n </body>\n </html>\n`;e.setAttribute("srcdoc",d)};class Ru{static setSessionDelegate(e,t){this.tokenRetryInterval=t||0,this.onAuthTokenRequested=e}static setTokenExpiryInterval(e){if(!("number"==typeof e&&e>0))return Qe.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){Ru.init();const t=new Vu(e,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:!1}),"launcher",this.analyticsQueue);return Ru.streamContainers[t.instanceId]={sendMessageToIframe:e=>t.sendMessageToIframe(e),logout:()=>{t.sendMessageToIframe({action:h})}},t}static embed(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Ru.init();const r=new Vu(t,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:n}),"standalone",this.analyticsQueue,e);return Ru.streamContainers[r.instanceId]={sendMessageToIframe:e=>r.sendMessageToIframe(e),logout:()=>{r.sendMessageToIframe({action:h})}},r}static singleCard(e,t){Ru.init();const n=new Vu(t,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:!0}),"single-card",this.analyticsQueue,e);return Ru.streamContainers[n.instanceId]={sendMessageToIframe:e=>n.sendMessageToIframe(e),logout:()=>{n.sendMessageToIframe({action:h})}},n}static observableStreamContainer(e){Ru.init();const t=new $u(e,Object.assign({},this.internalConfig),this.analyticsQueue);return Ru.streamContainers[t.instanceId]={sendMessageToIframe:e=>t.onMessageReceived(e),logout:()=>{t.onMessageReceived({action:h})}},t}static init(){return ju(this,void 0,void 0,(function*(){if(!Ru.hasPerformedInitialisation){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Au)),document.head.appendChild(e),window.addEventListener("request-failed",(e=>{const t=e.detail,n=this.analyticsQueue.enqueue({timestamp:new Date,endUserId:t.request.endUserId||"",containerId:t.request.streamContainerId,containerIds:t.request.streamContainerIds,cardInstanceId:t.request.cardInstanceId,eventName:lt,properties:{path:t.request.path,statusCode:t.request.statusCode}});if(n){var r;ou.sendAnalyticsMessage([n]);const e=gu(n);null===(r=Ru.sdkEventObserver)||void 0===r||r.call(Ru,e)}})),Ru.hasPerformedInitialisation=!0}const e=hu.webSocketConnection;e&&(null==e?void 0:e.readyState)!==(null==e?void 0:e.CLOSED)||this.internalConfig.webSocketDisabled||(yield this.createWebSocketConnection().catch((e=>{var t;Qe.debug({level3:[`SDK init, error creating WebSocket connection: ${e}`]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)})))}))}static initialise(e,t,n){return ju(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(w,JSON.stringify({initialiseCalled:!0,eventDispatched:!1})),Ru.cachedToken=void 0,Td.initialise(e,t,n),this.internalConfig.webSocketDisabled||(hu.initialise(e,t,n),ou.reset(),yield this.createWebSocketConnection().catch((e=>{var t;Qe.debug({level3:[`SDK initialise, error creating WebSocket connection: ${e}`]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)}))),window.AtomicUploadService=Tt,window.addEventListener("pageshow",(r=>{r.persisted&&(Td.initialise(e,t,n),this.internalConfig.webSocketDisabled||(hu.initialise(e,t,n),this.createWebSocketConnection().catch((e=>{var t;Qe.debug({level3:[`SDK network clients reinitialized after page loaded from cache, error creating WebSocket connection: ${e}`]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)}))),this.initialiseSDKBroadcastChannel())}))}))}static initialiseSDKBroadcastChannel(){var e;(null===(e=Ru.containersBroadcastChannel)||void 0===e?void 0:e.isOpen)||(Ru.containersBroadcastChannel=new ms)}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;Qe.logLevel=e,Object.values(Ru.streamContainers).forEach((t=>t.sendMessageToIframe({action:"io.atomic.events.logLevelUpdate",values:{logLevel:e}})))}static createWebSocketConnection(){return ju(this,arguments,void 0,(function*(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;const n={1:100,2:15e3,3:6e4};if(hu.openingConnection)return;const r={onMessage:e=>{ou.handleWebSocketMessage(e)},onError:e=>{Qe.error({level3:["WebSocket error handler received error message",e]})},onOpen:()=>ju(this,void 0,void 0,(function*(){try{yield this.handleTokenRequest({skipCache:!0,authWebSocket:!0}),ou.lastPongSuccess=(new Date).toISOString(),ou.resubscribeActiveSubscriptions()}catch(e){Qe.error({level1:["Error authenticating WebSocket."],level2:[e]}),Object.values(Ru.streamContainers).forEach((t=>{t.sendMessageToIframe({action:b,values:e instanceof Error?e.message:e})}))}})),onClose:r=>{switch(r.code){case su.sdkChangingProtocol:case su.sdkReinitialisedWebSocket:case su.sdkSessionEnding:case su.sdkCordovaBackgrounded:case su.sdkPersistedToBrowserCache:case su.unitTestConnectionClose:Qe.debug({level1:[`WebSocket closed with ${r.code} connection close code`],level2:[r]});break;case su.retryConnection:if(Qe.debug({level1:[`WebSocket closed with ${r.code} connection close code`],level2:[r]}),e<3){const t=e+1;setTimeout((()=>{this.createWebSocketConnection(t).catch((e=>{var t;Qe.debug({level3:["Error on websocket connection retry",e]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)}))}),n[t])}else this.triggerPollingFallback(t);break;case su.sdkClosedConnection:case su.notPermitted:case su.abnormalClosure:default:Ru.internalConfig.pollingFallbackDisabled||this.triggerPollingFallback(t),Qe.debug({level1:[`WebSocket closed with ${r.code} connection close code`],level2:[r]})}}};try{hu.open("socket",r,t)}catch(e){Qe.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(){hu.close(su.sdkReinitialisedWebSocket),this.createWebSocketConnection().catch((e=>{var t;Qe.debug({level3:["Error reinitializing websocket connection",e]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)}))}static authenticateWebSocketConnection(e){return ju(this,void 0,void 0,(function*(){ou.sendAuthMessage(e),hu.connectionAuthenticated||(hu.authenticatingConnection=!0,yield new Promise(((e,t)=>{const n=setTimeout((()=>{Ru.authMessageReject("WebSocket authentication timed out")}),hu.authenticationTimeout);Ru.authMessageResolve=()=>{Qe.debug({level3:["WebSocket auth promise resolved."]}),e(),hu.purgeMessageQueue(),clearTimeout(n),hu.authenticatingConnection=!1},Ru.authMessageReject=e=>{Qe.error({level3:["WebSocket auth promise rejected.",e]}),Object.values(Ru.streamContainers).forEach((t=>{var n;t.sendMessageToIframe({action:b,values:null!==(n=e.message)&&void 0!==n?n:e})})),t(e),clearTimeout(n),hu.authenticatingConnection=!1}})))}))}static simulateWebSocketError(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];hu.close(),t&&this.createWebSocketConnection(0,e).catch((e=>{Qe.debug({level3:["Error reconnecting websocket",e]})}))}static triggerPollingFallback(e){var t;Ru.authMessageResolve=()=>null,Ru.authMessageReject=()=>null,e&&(hu.close(),hu.clearTimeouts()),Object.values(this.streamContainers).forEach((e=>{e.sendMessageToIframe({action:v})}));const n=this.analyticsQueue.enqueue({timestamp:new Date,eventName:lt,endUserId:null!==(t=md(Ru.cachedToken,Ru.internalConfig.tokenUserIdAttribute))&&void 0!==t?t:"",properties:Object.assign({path:`${this.internalConfig.environmentId}/socket`},e?{source:"user-simulate"}:{})});if(n){var r;ou.sendAnalyticsMessage([n]);const e=gu(n);null===(r=Ru.sdkEventObserver)||void 0===r||r.call(Ru,e)}}static setTestHostHeader(e){this.internalConfig.testHost=e,Td.setTestHostHeader(e),hu.setTestHostParam(e)}static setClientAppVersion(e){if(!("string"==typeof e))return Qe.error({level1:["Could not set client app version"],level2:[": Invalid value provided, must be a string."]});e.length>128&&Qe.warn({level1:["Client app version truncated"],level2:[": value provided was longer than 128 character maximum."]});const t=e.substring(0,128);Td.setClientAppVersion(t),hu.setClientAppVersion(t),this.internalConfig.clientAppVersion=t}static setTokenUserIdAttribute(e){return"string"==typeof e?e.length>128?Qe.error({level1:["Could not set token user ID attribute"],level2:[": value provided was longer than 128 character maximum."]}):(Td.setTokenUserIdAttribute(e),void(this.internalConfig.tokenUserIdAttribute=e)):Qe.error({level1:["Could not set token user ID attribute"],level2:[": Invalid value provided, must be a string."]})}static setRetryTimer(){Ru.tokenRetryInterval&&!Ru.tokenRetryTimer&&(Ru.tokenRetryTimer=setTimeout((()=>{Ru.tokenRetryTimer=void 0}),Ru.tokenRetryInterval))}static handleTokenRequest(e){var t,n;return ju(this,void 0,void 0,(function*(){var r;let i,a=new Error;if(!Ru.onAuthTokenRequested)throw a.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.",a.name=_u,a;if(Ru.tokenRetryTimer)throw a.message="Not ready to retry token request",a.name=Eu,a;if(Ru.cachedToken&&!(null==e?void 0:e.skipCache)){const e=od(Ru.cachedToken);if(!(e=>{const t=Math.floor((new Date).getTime()/1e3);return 1===(0,o.compareAsc)(t,e)})(e.exp-Ru.tokenExpiryInterval))return Ru.cachedToken;i=e}const s=yield Promise.race([new Promise((e=>{setTimeout((()=>{e(void 0)}),5e3)})),null===(r=Ru.onAuthTokenRequested)||void 0===r?void 0:r.call(Ru)]);if(!s||0===s.length)throw a.message="An authentication token was required for the request, however no token was returned.",a.name=Lu,Ru.setRetryTimer(),a;if(!ad(s))throw a.message="The auth token provided is not a valid JWT.",a.name=Lu,Ru.setRetryTimer(),a;if(i&&i.exp-i.iat<3600){const e=od(s);(null!==(t=i.atomic_sub)&&void 0!==t?t:i.sub)!==(null!==(n=e.atomic_sub)&&void 0!==n?n:e.sub)&&Qe.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 l=md(s,Ru.internalConfig.tokenUserIdAttribute),c=JSON.parse(sessionStorage.getItem(w)||"{}");if(l&&c.initialiseCalled&&!c.eventDispatched){const e={endUserId:l,eventName:Ge,timestamp:new Date,properties:{}},t=Ru.analyticsQueue.enqueue(e,"sdk-initialized");if(t){var d;ou.sendAnalyticsMessage([t]);const e=gu(t);null===(d=Ru.sdkEventObserver)||void 0===d||d.call(Ru,e)}sessionStorage.setItem(w,JSON.stringify(Object.assign(Object.assign({},c),{eventDispatched:!0})))}if((null==e?void 0:e.authWebSocket)&&hu.isConnected()&&!hu.authenticatingConnection)try{yield Ru.authenticateWebSocketConnection(s)}catch(a){throw Qe.error({level3:["Fresh auth token received, error authenticating WebSocket connection with new token.",a]}),a}return Ru.cachedToken=s}))}static getCurrentUserId(){var e;return null!==(e=md(Ru.cachedToken,Ru.internalConfig.tokenUserIdAttribute))&&void 0!==e?e:""}static requestCardCount(e){return ju(this,void 0,void 0,(function*(){if(!e)throw new Error("A stream container ID is required when requesting card count.");if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to request card count.");try{const t=yield Td.get(`feed/${e}`,{requestToken:yield Ru.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.message}`)}}))}static sendEvent(e){return ju(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(!Td.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 Td.post("event",{data:i},{requestToken:yield Ru.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.message}`)}}))}static sendCustomEvent(e){return ju(this,void 0,void 0,(function*(){var t;if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to send a custom event.");const n=md(yield Ru.handleTokenRequest(),Ru.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.");const r=this.analyticsQueue.enqueue(Object.assign({endUserId:n,eventName:e.eventName,timestamp:new Date},e.properties?{properties:e.properties}:{}),"custom");r&&ou.sendAnalyticsMessage([r])}))}static observeSDKEvents(e){this.sdkEventObserver=e}static requestUserMetrics(){return ju(this,void 0,void 0,(function*(){if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to request user metrics.");try{const e=yield Td.get("user-metrics",{requestToken:yield Ru.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 bu(e.data)},this.cachedUserMetrics.userMetrics;case 304:if(this.cachedUserMetrics.userMetricsResponse)return new bu(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 ju(this,void 0,void 0,(function*(){if(!Td.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 Ru.handleTokenRequest},Mu(void 0,void 0,void 0,(function*(){var e,r;(null===(e=t.preferences)||void 0===e?void 0:e.notifications)&&Fu(t);const{data:i,response:o}=yield Td.put("update-user",t,n);return(null==i||null===(r=i.errors)||void 0===r?void 0:r.length)&&Qe.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.message}`)}var t,n}))}static onCardAction(e,t){if(!Td.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)=>ju(this,void 0,void 0,(function*(){const i=yield Ma(e,t,{requestToken:yield Ru.handleTokenRequest});i.ok?n():i.error&&r(i.error)})),snooze:(n,r,i)=>ju(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 Fa(e,t,i,{requestToken:yield Ru.handleTokenRequest});o.ok?n():o.error&&r(o.error)})),submit:(n,r,i,o)=>ju(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 Ta(e,t,Object.assign(Object.assign({},a),{[i]:null}),{requestToken:yield Ru.handleTokenRequest});s.ok?n():s.error&&r(s.error)}))}}static logout(){return ju(this,arguments,void 0,(function*(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0])try{yield Ru.deregisterDeviceForNotifications()}catch(e){e.message.includes("You must call setNativeDeviceInfo before registering for native notifications")||console.error(`Problem de-registering notifications when logging out: ${e instanceof Error?e.message:String(e)}`)}Object.values(Ru.streamContainers).forEach((e=>{e.logout()})),Ru.streamContainers={},yield this.analyticsQueue.flush(),Ru.cachedUserMetrics={},Ru.cachedToken=void 0,Ru.tokenRetryTimer=void 0,Ru.sdkEventObserver=null,sessionStorage.removeItem(S),hu.close(su.sdkSessionEnding,"Connection closed by SDK, user logged out"),hu.reset(),Ru.internalConfig=Object.assign(Object.assign({},Ru.internalConfig),{apiHost:void 0,apiKey:void 0,environmentId:void 0}),Td.reset()}))}static login(e,t,n,r,i){Ru.initialise(e,t,n),Ru.setSessionDelegate(r,i)}static setNativeDeviceInfo(e){try{return(e=>{const t=Iu(e);if(t.success)return wu=e,!0;{const e=`Device info set with invalid parameters: ${t.errors.join("\n")}`;throw console.error(e),new Error(e)}})(e)}catch(e){throw new Error(`Failed to setNativeDeviceInfo: ${e.message}`)}}static registerDeviceForNotifications(e){return ju(this,void 0,void 0,(function*(){if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to register the device for push notifications");try{return yield ku(e,{requestToken:yield Ru.handleTokenRequest})}catch(e){throw new Error(`${ku.name} could not be completed. ${e.message}`)}}))}static deregisterDeviceForNotifications(){return ju(this,void 0,void 0,(function*(){if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to deregister the device for push notifications");try{return yield Cu({requestToken:yield Ru.handleTokenRequest})}catch(e){throw new Error(`${Cu.name} could not be completed. ${e instanceof Error?e.message:String(e)}`)}}))}static registerStreamContainersForNotifications(e,t){return ju(this,void 0,void 0,(function*(){if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to register stream containers for notifications");try{return yield Su(e,{requestToken:yield Ru.handleTokenRequest},t)}catch(e){throw new Error(`${Su.name} could not be completed. ${e instanceof Error?e.message:String(e)}`)}}))}static notificationFromPushPayload(e){return xu(e)}static trackPushNotificationReceived(e){var t;const n=xu(e);if(null==n)return!1;const r=null!==(t=md(Ru.cachedToken,Ru.internalConfig.tokenUserIdAttribute))&&void 0!==t?t:"";let i={eventName:ut,endUserId:r,containerId:n.containerId,cardInstanceId:n.cardInstanceId,timestamp:new Date};const o=Ru.analyticsQueue.enqueue(i);if(o){var a;ou.sendAnalyticsMessage([o]);const e=gu(o);null===(a=Ru.sdkEventObserver)||void 0===a||a.call(Ru,e)}return!0}}Du(Ru,"hasPerformedInitialisation",!1),Du(Ru,"webSocketDisabled",!1),Du(Ru,"cachedUserMetrics",{}),Du(Ru,"internalConfig",{}),Du(Ru,"cachedToken",void 0),Du(Ru,"onError",void 0),Du(Ru,"sdkEventObserver",null),Du(Ru,"SDKEvents",pu),Du(Ru,"userMetricsTriggerEvents",new Set(mu)),Du(Ru,"onAuthTokenRequested",void 0),Du(Ru,"tokenRetryInterval",0),Du(Ru,"tokenRetryTimer",void 0),Du(Ru,"tokenExpiryInterval",60),Du(Ru,"authMessageResolve",(()=>null)),Du(Ru,"authMessageReject",(()=>null)),Du(Ru,"streamContainers",{}),Du(Ru,"containersBroadcastChannel","BroadcastChannel"in window?new ms:void 0),Du(Ru,"analyticsQueue",new class{constructor(){pd(this,"eventQueue",[]),pd(this,"flushTimeout",null),pd(this,"flushPromise",null);const e=localStorage.getItem(gd);if(e)try{this.eventQueue=JSON.parse(e)}catch(e){}this.scheduleFlush()}createEventPayload(e,n){const r={id:(0,t.v4)(),endUserId:e.endUserId,timestamp:e.timestamp.toISOString(),properties:e.properties||{},eventContext:{userLocalTimestamp:(0,o.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:{streamLength:t.streamLength||0,streamLengthVisible:t.streamLengthVisible||0,cardPositionInStream:t.streamCardPosition||0},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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"standard";if(!Td.isInitialised())return null;const n=this.createEventPayload(e,t);return n&&(this.eventQueue.push(n),this.eventQueue.length>500&&this.eventQueue.splice(0,this.eventQueue.length-500)),this.persistQueue(),n}removeProcessedEvents(e){this.eventQueue.length&&(this.eventQueue=this.eventQueue.filter((t=>!e.includes(t.id))),this.persistQueue())}performFlush(){return hd(this,void 0,void 0,(function*(){if(null!=this.flushTimeout&&(window.clearTimeout(this.flushTimeout),this.flushTimeout=null),this.eventQueue.length&&Td.isInitialised()){const e=[...this.eventQueue];200===(yield Td.put("analytics",{data:e})).response.status&&(this.eventQueue=this.eventQueue.filter((t=>!e.includes(t))),this.persistQueue())}this.scheduleFlush()}))}flush(){return hd(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(){localStorage.setItem(gd,JSON.stringify(this.eventQueue))}});class Vu{constructor(e,n,r,i,o){Du(this,"iframe",void 0),Du(this,"modalIframe",void 0),Du(this,"toastIframe",void 0),Du(this,"outsideClickListener",void 0),Du(this,"queuedMessages",[]),Du(this,"iframeLoaded",!1),Du(this,"appOpen",!1),Du(this,"launchButtonIconContainer",void 0),Du(this,"launcher",void 0),Du(this,"resizeObserver",void 0),Du(this,"resolvedConfiguration",void 0),Du(this,"instanceId",void 0),Du(this,"streamFilters",new Ed((()=>this.sendMessageToIframe({action:y,values:{filter:this.streamFilters.getFilterObject()}})),(()=>{this.sendMessageToIframe({action:y,values:{filter:void 0}})}))),Du(this,"config",void 0),Du(this,"analyticsQueue",void 0);const a=`${e.streamContainerId}`;if(null===e.streamContainerId||void 0===e.streamContainerId||"string"!=typeof e.streamContainerId&&"number"!=typeof e.streamContainerId||0===a.trim().length)throw new Error("The Atomic SDK failed to start. You must pass a `streamContainerId` when instantiating a stream container.");var s;if(!Ru.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"),!this.iframeLoaded){var l,c;let s=Object.assign(Object.assign(Object.assign({},e),{streamContainerId:a}),n),d=s.cardListRefreshInterval;s.cardListRefreshInterval=null!=d?0==d?0:Math.max(1e3,d):void 0;let u=s.runtimeVariableResolutionTimeout;if(s.runtimeVariableResolutionTimeout=null!=u?Math.max(0,u):void 0,"single-card"!==r&&(null===(l=e.features)||void 0===l||null===(c=l.horizontalContainerConfig)||void 0===c?void 0:c.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,o)}}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),ou.activeSubscriptions[this.instanceId]&&(ou.unsubscribeFromCardFeed([this.instanceId]),delete Ru.streamContainers[this.instanceId])}updateVariables(){this.sendMessageToIframe({action:"io.atomic.events.requestRuntimeVariables"})}setOpen(e){var t;if(void 0===e)return Qe.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))return Qe.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,o,a,s,l;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"),"ResizeObserver"in window){const e=document.createElement("div");e.style.width="1rem",e.style.visibility="hidden",e.id="text-size-observer",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("#text-size-observer"))}c.logLevel=Qe.logLevel,n?n.appendChild(this.iframe):document.body.appendChild(this.iframe),this.iframe.addEventListener("load",(()=>{this.iframeLoaded=!0,this.flushMessages()})),Pu(this.iframe,c),("single-card"===t&&(null===(o=e.enabledUiElements)||void 0===o?void 0:o.cardListToast)||(null===(a=e.enabledUiElements)||void 0===a?void 0:a.customToastContainer))&&(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"),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),Pu(this.toastIframe,Object.assign(Object.assign({},c),{embedMode:"toast"}))),("single-card"===t||"standalone"===t&&(null===(s=e.features)||void 0===s||null===(l=s.horizontalContainerConfig)||void 0===l?void 0:l.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),Pu(this.modalIframe,Object.assign(Object.assign({},c),{embedMode:"modal-subview"}))),window.addEventListener("message",this.onMessageReceived.bind(this))}onMessageReceived(e){return ju(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=vu({cardCount:e.data.cardCount,streamContainerId:this.resolvedConfiguration.streamContainerId||"",endUserId:Ru.getCurrentUserId()});null===(t=Ru.sdkEventObserver)||void 0===t||t.call(Ru,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.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||Hu);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.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=Ru.sdkEventObserver)||void 0===o||o.call(Ru,gu(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=pu.cardSnoozed,n.analyticsEvent=pu.cardSnoozed;break;case"dismissed":n.eventName=pu.cardDismissed,n.analyticsEvent=pu.cardDismissed;break;case"submitted":n.eventName=pu.cardCompleted,n.analyticsEvent=pu.cardCompleted;break;default:return null}return n.sdkContext={containerId:t},n})(e.data.event,e.data.streamContainerId);var a;if(t)Ru.cachedUserMetrics={},null===(a=Ru.sdkEventObserver)||void 0===a||a.call(Ru,t);break}case"io.atomic.events.errorReceived":Ru.onError&&Ru.onError(e.data.error);break;case"io.atomic.events.authTokenRequested":if(e.data.requestId&&Ru.onAuthTokenRequested){let t;try{t=yield Ru.handleTokenRequest(),this.sendMessageToIframe({action:"io.atomic.events.authTokenReceived",values:{requestId:e.data.requestId,authToken:t}},e.source)}catch(t){Qe.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{hu.connectionAuthenticated||(yield Ru.handleTokenRequest({skipCache:!0,authWebSocket:!0})),ou.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)}),Qe.error({level1:["error sending card feed subscription request by WebSockets"],level2:[e]})}break;case"io.atomic.events.subscriptionRetryExceeded":hu.close(su.sdkClosedConnection,"Subscription retry exceeded"),Ru.authMessageResolve=()=>null,Ru.authMessageReject=()=>null;break;case"io.atomic.events.cardFeedUnsubscribeRequested":e.data.subscriptionId===this.instanceId&&(ou.unsubscribeFromCardFeed([this.instanceId]),delete Ru.streamContainers[this.instanceId]);break;case"io.atomic.events.socketReconnectionRequested":Ru.createWebSocketConnection().catch((e=>{var t;this.sendMessageToIframe({action:b,values:null!==(t=e.message)&&void 0!==t?t:e})}));break;case"io.atomic.events.socketConnectionHealthcheck":hu.connectionHealthCheck()}}))}enqueueAnalyticsEvent(e){const t=this.analyticsQueue.enqueue(e);if(t){var n;ou.sendAnalyticsMessage([t]);const e=gu(t);null===(n=Ru.sdkEventObserver)||void 0===n||n.call(Ru,e)}Ru.containersBroadcastChannel?Ru.containersBroadcastChannel.postMessage({type:ps.ANALYTICS_EVENT,eventQueued:e}):Qe.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 $u{constructor(n,r,i){if(Du(this,"resolvedConfiguration",void 0),Du(this,"instanceId",void 0),Du(this,"streamFilters",new Ed((()=>{Qe.debug({level1:[`applied stream filter for stream container: ${this.instanceId}`],level2:[this.streamFilters.getFilterObject()]}),this.sendWebSocketFeedSubscriptionMessage()}),(()=>{Qe.debug({level1:[`cleared stream filter for stream container: ${this.instanceId}`]}),this.sendWebSocketFeedSubscriptionMessage()}))),Du(this,"analyticsQueue",void 0),Du(this,"pollCounter",0),Du(this,"pollTimer",void 0),Du(this,"store",void 0),Du(this,"boundActions",void 0),Du(this,"tokenProvider",{requestToken:()=>ju(this,void 0,void 0,(function*(){return yield Ru.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(!Ru.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 o=Object.assign(Object.assign({},n),r),a=o.cardListRefreshInterval;o.cardListRefreshInterval=null!=a?0==a?0:Math.max(1e3,a):void 0;let u=o.runtimeVariableResolutionTimeout;o.runtimeVariableResolutionTimeout=null!=u?Math.max(0,u):void 0,this.resolvedConfiguration=o,this.instanceId=(0,t.v4)(),this.store=((e,t)=>{var n,r,i;let{streamContainerId:o,instanceId:a,windowOrigin:u,subviewCardInstance:h,startingLayoutId:p,cardInstances:m,cardListRefreshInterval:g,runtimeVariableResolutionTimeout:v,embedMode:f,customStrings:b,cardListTutorialSeen:y,features:w,firstLoadStyles:S,enabledUiElements:k,interfaceStyle:C}=e;const x=t&&t.length?(0,l.m)(...t):null,I="preview"===f,O=null==w?void 0:w.runtimeVariableAnalytics;return d=s()(Object.assign(Object.assign({},c),{application:Object.assign(Object.assign({},c.application),{isPreview:I,streamContainerId:void 0!==o?o:c.application.streamContainerId,containerInstanceId:void 0!==a?a:c.application.containerInstanceId,windowOrigin:u||c.application.windowOrigin,cardListRefreshInterval:void 0!==g?g:c.application.cardListRefreshInterval,runtimeVariableResolutionTimeout:void 0!==v?v:c.application.runtimeVariableResolutionTimeout,embedMode:f,customStrings:b||c.application.customStrings,cardLimit:"single-card"===f?1:void 0,firstLoadStyles:{backgroundColor:(null==S?void 0:S.backgroundColor)||c.application.firstLoadStyles.backgroundColor,textColor:(null==S?void 0:S.textColor)||c.application.firstLoadStyles.textColor,loadingSpinnerColor:(null==S?void 0:S.loadingSpinnerColor)||c.application.firstLoadStyles.loadingSpinnerColor,buttonTextColor:(null==S?void 0:S.buttonTextColor)||c.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:h&&p?[{cardInstance:h,cardInstanceId:h.instance.id,subviewId:p,kind:"subview"}]:c.navigationStack.items},cardFeed:Object.assign(Object.assign({},c.cardFeed),{cardInstances:m||c.cardFeed.cardInstances,tutorialSeen:void 0===y||y,runtimeVariableAnalyticsEnabled:void 0!==O&&O,cardVoting:null==w?void 0:w.cardVoting,cardMinimumHeight:null==w?void 0:w.cardMinimumHeight,horizontalContainerConfig:null==w?void 0:w.horizontalContainerConfig})}),x),d})(Object.assign(Object.assign({},o),{embedMode:"headless"})),this.boundActions=(0,e.kv)((0,e.Y2)(Pt,Da),this.store),this.analyticsQueue=i}}start(){if(!this.resolvedConfiguration.apiHost||!this.resolvedConfiguration.apiKey||!this.resolvedConfiguration.environmentId)return Qe.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."]});Qe.debug({level3:[`Starting card feed updates for observable stream container: ${this.instanceId}`]}),Ru.streamContainers[this.instanceId]||(Ru.streamContainers[this.instanceId]={sendMessageToIframe:e=>this.onMessageReceived(e),logout:()=>{this.onMessageReceived({action:h})}}),this.resolvedConfiguration.webSocketDisabled?this.pollCardFeed():ou.activeSubscriptions[this.instanceId]||this.sendWebSocketFeedSubscriptionMessage()}stop(){Qe.debug({level3:[`Stopping card feed updates for observable stream container: ${this.instanceId}`]}),ou.activeSubscriptions[this.instanceId]&&ou.unsubscribeFromCardFeed([this.instanceId]),this.cancelCardListPolling(),delete Ru.streamContainers[this.instanceId]}pollCardFeed(){var e,t;return ju(this,void 0,void 0,(function*(){const n=this.store.getState(),r=n.cardFeed,i=yield Oa(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,Qe.debug({level3:["Attempt to reconnect websocket initiated"]}),Ru.createWebSocketConnection().catch((e=>{var t;Qe.debug({level3:["Error reconnecting websocket",e]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)})))}),null!==(t=this.resolvedConfiguration.cardListRefreshInterval)&&void 0!==t?t:c.application.cardListRefreshInterval))}))}cancelCardListPolling(){this.pollTimer&&(clearTimeout(this.pollTimer),Qe.debug({level3:[`Observable stream container ${this.instanceId}, card feed polling cancelled`]})),this.pollTimer=null,this.pollCounter=0}sendWebSocketFeedSubscriptionMessage(){try{ou.subscribeToCardFeed([{subscriptionId:this.instanceId,streamContainerId:this.resolvedConfiguration.streamContainerId||"",filters:this.streamFilters.getFilterObject()}])}catch(e){Qe.error({level1:["Unable to subscribe observable stream container to card feed updates via WebSocket."],level2:[`Container instance: ${this.instanceId}.`]})}}handleCardFeedUpdate(e){var t,n;return ju(this,void 0,void 0,(function*(){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 ja(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=>ju(this,void 0,void 0,(function*(){if(e){const e=yield(t=r.application.streamContainerId,n=this.tokenProvider,xa(void 0,void 0,void 0,(function*(){const e=yield Td.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)Qe.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=>ju(this,void 0,void 0,(function*(){return yield ja(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)))||[],c=(null===(o=e.metadata)||void 0===o?void 0:o.totalCards)||0,d=(null===(a=t.metadata)||void 0===a?void 0:a.totalCards)||0;if(!ud(s,l)||c!==d){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,d);const e=vu({cardCount:null!==(r=null===(u=t.cardInstances)||void 0===u?void 0:u.length)&&void 0!==r?r:0,streamContainerId:this.resolvedConfiguration.streamContainerId||"",endUserId:Ru.getCurrentUserId()});null===(h=Ru.sdkEventObserver)||void 0===h||h.call(Ru,e)}}runtimeVariableResolver(e){const t=this.resolvedConfiguration.onRuntimeVariablesRequested||Hu;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){return ju(this,arguments,void 0,(function*(){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];hu.connectionHealthCheck();const n=this.store.getState(),r=n.cardFeed.cardInstances||[],i=r.filter((t=>t.instance.id===e.cardInstanceId)),o=i.length?i[0]:null,a=o?r.indexOf(o)+1:0;let s;try{s=yield this.tokenProvider.requestToken()}catch(e){Qe.error({level1:["Error requesting auth token to send analytics event"],level2:[e]})}const l=Object.assign(Object.assign({},e),{endUserId:md(s,Td.tokenUserIdAttribute)||"",cardInstanceStatus:o?o.instance.status:"",containerId:n.application.streamContainerId,timestamp:new Date,streamCardPosition:a,streamLength:n.cardFeed.unfilteredCardInstanceCount,streamLengthVisible:r.length});let c;if(t?c=this.analyticsQueue.createEventPayload(l,"standard"):(c=this.analyticsQueue.enqueue(l),ou.sendAnalyticsMessage([c])),c){var d;const e=gu(c);null===(d=Ru.sdkEventObserver)||void 0===d||d.call(Ru,e)}}))}updateVariables(){var e,t;return ju(this,void 0,void 0,(function*(){const n=this.store.getState(),r=yield Oa(n.application.streamContainerId,this.tokenProvider,n.application.runtimeVariableResolutionTimeout,"",this.runtimeVariableResolver.bind(this),void 0,this.streamFilters.getFilterObject());r.error&&Qe.error({level1:["error retrieving card feed for runtime variable update"],level2:[r.error]});const i=yield ja(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:nt,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 g:const t=e.values.cardFeedUpdates;this.handleCardFeedUpdate(t);break;case v:void 0===this.pollTimer&&this.pollCardFeed();break;case f:this.cancelCardListPolling();break;case h:this.stop();break;default:Qe.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),c=i(l.length),d=o(a,c);if(e&&n!=n){for(;c>d;)if((s=l[d++])!=s)return!0}else for(;c>d;d++)if((e||d in l)&&l[d]===n)return e||d||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",c=function(e,t,n){var d,u,h,p,m=e&c.F,g=e&c.G,v=e&c.S,f=e&c.P,b=e&c.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(d in g&&(n=t),n)h=((u=!m&&y&&void 0!==y[d])?y:n)[d],p=b&&u?s(h,r):f&&"function"==typeof h?s(Function.call,h):h,y&&a(y,d,h,e&c.U),w[d]!=h&&o(w,d,p),f&&S[d]!=h&&(S[d]=h)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},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),c=n(2943),d=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,k,C=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,M=T[u]||T["@@iterator"]||f&&T[f],F=M||C(f),j=f?I?C("entries"):F:void 0,D="Array"==t&&T.entries||M;if(D&&(k=d(D.call(new e)))!==Object.prototype&&k.next&&(c(k,x,!0),r||"function"==typeof k[u]||a(k,u,g)),I&&M&&M.name!==m&&(O=!0,F=function(){return M.call(this)}),r&&!y||!h&&!O&&T[u]||a(T,u,F),s[t]=F,s[x]=g,f)if(w={values:I?F:C(m),keys:b?F:C(p),entries:j},y)for(S in w)S in T||o(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),o=n(4430),a=n(9335)("IE_PROTO"),s=function(){},l="prototype",c=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(),c=e.F;r--;)delete c[l][o[r]];return c()};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=c(),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,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~o(c,n)||c.push(n));return c}},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",c=(""+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]:c.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),c=n(6314),d=c("iterator"),u=c("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=a[f],w=y&&y.prototype;if(w&&(w[d]||s(w,d,h),w[u]||s(w,u,f),l[f]=h,b))for(v in r)w[v]||o(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),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}",""]);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 c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},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),c=Math.abs(i(n,s));return n=a(n,l*c),l*(c-(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 c=n||{},d=r(e,t),u=c.locale,h=s.distanceInWords.localize;u&&u.distanceInWords&&u.distanceInWords.localize&&(h=u.distanceInWords.localize);var p,m,g={addSuffix:Boolean(c.addSuffix),comparison:d};d>0?(p=i(e),m=i(t)):(p=i(t),m=i(e));var v,f=o(m,p),b=m.getTimezoneOffset()-p.getTimezoneOffset(),y=Math.round(f/60)-b;if(y<2)return c.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=a(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),o=n(7977),a=n(7479),s=525600;e.exports=function(e,t,n){var l=n||{},c=r(e,t),d=l.locale,u=a.distanceInWords.localize;d&&d.distanceInWords&&d.distanceInWords.localize&&(u=d.distanceInWords.localize);var h,p,m,g={addSuffix:Boolean(l.addSuffix),comparison:c};c>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(),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),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 c={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(c.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 d(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]]||c[o[r]],o[r]=i||d(o[r]);return function(e){for(var t="",n=0;n<a;n++)o[n]instanceof Function?t+=o[n](e,c):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 c=(l>a?a:l)-(s<o?o:s);return Math.ceil(c/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."],c={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){c[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:c,formattingTokensRegExp:r(c)}}},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=/:/,c=/^(\d{2})$/,d=[/^([+-]\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+-].*)$/,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=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=d[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=c.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),M=T.year,F=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}(T.restDateString,M);if(F){var j,D=F.getTime(),A=0;if(O.time&&(A=function(e){var t,n,r;if(t=b.exec(e))return(n=parseFloat(t[1].replace(",",".")))%24*o;if(t=y.exec(e))return n=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),n%24*o+r*a;if(t=w.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)j=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 _=D+A,E=new Date(_);j=r(E);var L=new Date(_);L.setDate(E.getDate()+1);var H=r(L)-r(E);H>0&&(j+=H)}return new Date(D+A+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 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 c=i(l);return n.setMonth(o,Math.min(s,c)),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:()=>w,Fragment:()=>y,_unmount:()=>E,cloneElement:()=>R,createContext:()=>V,createElement:()=>v,createRef:()=>b,h:()=>v,hydrate:()=>P,isValidElement:()=>i,options:()=>r,render:()=>H,toChildArray:()=>O});var r,i,o,a,s,l,c,d,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 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 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=j(s,o,r,t.__n,void 0!==s.ownerSVGElement,null,n,null==a?S(o):a),D(n,o),i!=a&&k(o)))}))}function I(e,t,n,r,i,o,a,s,l){var c,d,p,m,v,f,b,y=n&&n.__k||h,w=y.length;if(s==u&&(s=null!=o?o[0]:w?S(n,0):null),c=0,t.__k=O(t.__k,(function(n){if(null!=n){if(n.__=t,n.__b=t.__b+1,null===(p=y[c])||p&&n.key==p.key&&n.type===p.type)y[c]=void 0;else for(d=0;d<w;d++){if((p=y[d])&&n.key==p.key&&n.type===p.type){y[d]=void 0;break}p=null}if(m=j(e,n,p=p||u,r,i,o,a,s,l),(d=n.ref)&&p.ref!=d&&(b||(b=[]),p.ref&&b.push(p.ref,null,n),b.push(d,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,d=0;(v=v.nextSibling)&&d<w;d+=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 c++,n})),t.__e=f,null!=o&&"function"!=typeof t.type)for(c=o.length;c--;)null!=o[c]&&g(o[c]);for(c=w;c--;)null!=y[c]&&E(y[c],y[c]);if(b)for(c=0;c<b.length;c++)_(b[c],b[++c],b[++c])}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 M(e,t,n,r,i){var o,a,s,l,c;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||T(o,l,"");if(n)for(c in n)r&&n[c]===r[c]||T(o,c,n[c])}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,F,a),(e.l||(e.l={}))[t]=n):e.removeEventListener(t,F,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 F(e){this.l[e.type](r.event?r.event(e):e)}function j(e,t,n,i,o,a,s,l,c){var d,u,h,p,g,v,f,b,S,k,C=t.type;if(void 0!==t.constructor)return null;(d=r.__b)&&d(t);try{e:if("function"==typeof C){if(b=t.props,S=(d=C.contextType)&&i[d.__c],k=d?S?S.props.value:d.__: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 w(b,k),u.constructor=C,u.render=L),S&&S.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),d=0;d<t.__k.length;d++)t.__k[d]&&(t.__k[d].__=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,(d=r.__r)&&d(t),u.__d=!1,u.__v=t,u.__P=e,d=u.render(u.props,u.state,u.context),t.__k=null!=d&&d.type==y&&null==d.key?d.props.children:Array.isArray(d)?d:[d],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,c),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=A(n.__e,t,n,i,o,a,s,c);(d=r.diffed)&&d(t)}catch(e){t.__v=null,r.__e(e,t,n)}return t.__e}function D(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 A(e,t,n,r,i,o,a,s){var l,c,d,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!=(c=o[l])&&((null===t.type?3===c.nodeType:c.localName===t.type)||e==c)){e=c,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)),d=(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||d)&&(p&&d&&p.__html==d.__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||M(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]||M(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&&M(e,"value",l,g.value,!1),"checked"in v&&void 0!==(l=v.checked)&&l!==e.checked&&M(e,"checked",l,g.checked,!1))}return e}function _(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){r.__e(e,n)}}function E(e,t,n){var i,o,a;if(r.unmount&&r.unmount(e),(i=e.ref)&&(i.current&&i.current!==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]&&E(i[a],t,n);null!=o&&g(o)}function L(e,t,n){return this.constructor(e,n)}function H(e,t,n){var i,o,a;r.__&&r.__(e,t),o=(i=n===c)?null:n&&n.__k||t.__k,e=v(y,null,[e]),a=[],j(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),D(a,e)}function P(e,t){H(e,t,c)}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 V(e){var t={},n={__c:"__cC"+d++,__: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},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),C(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},w.prototype.render=y,o=[],a=0,s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=u,d=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 c=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),d=c;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=c},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()},5877:(e,t,n)=>{var r=n(3570),i=n(1171),o=i;o.v1=r,o.v4=i,e.exports=o},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,o=n(5217),a=n(5327),s=0,l=0;e.exports=function(e,t,n){var c=t&&n||0,d=t||[],u=(e=e||{}).node||r,h=void 0!==e.clockseq?e.clockseq:i;if(null==u||null==h){var p=o();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;d[c++]=f>>>24&255,d[c++]=f>>>16&255,d[c++]=f>>>8&255,d[c++]=255&f;var b=m/4294967296*1e4&268435455;d[c++]=b>>>8&255,d[c++]=255&b,d[c++]=b>>>24&15|16,d[c++]=b>>>16&255,d[c++]=h>>>8|128,d[c++]=255&h;for(var y=0;y<6;++y)d[c+y]=u[y];return t||a(d)}},1171:(e,t,n)=>{var r=n(5217),i=n(5327);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[o+s]=a[s];return t||i(a)}},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:()=>Ru});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 o=n(7292),a=n(4798),s=n.n(a),l=n(1042);const c={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 d;const u=()=>{if(!d)throw new Error("You must initialise the store before accessing it.");return d},h="io.atomic.events.sdkLogout",p="YYYY-MM-DD[T]HH:mm:ssZZ",m=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,g="io.atomic.events.cardFeedUpdateReceived",v="io.atomic.events.pollingFallbackEnabled",f="io.atomic.events.pollingFallbackDisabled",b="io.atomic.events.socketAuthenticationError",y="io.atomic.events.streamFilterApplied",w="sdkInitialisation",S="displayedCards",k="cardDescription",C="headline",x="text",I="list",O="image",T="video",M="textInput",F="numberInput",j="datePicker",D="dropdown",A="checkbox",_="stepper",E="switch",L="upload",H="form",P="actionButtonGroup",R="submitButton",V="linkButton",$="dismissButton",N="snoozeButton",W="voteUpButton",z="voteDownButton";var U,q,B,Y=n(6400),K=0,Z=[],Q=Y.options.__r,G=Y.options.diffed,X=Y.options.__c,J=Y.options.unmount;function ee(e,t){Y.options.__h&&Y.options.__h(q,e,K||t),K=0;var n=q.__H||(q.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function te(e){return K=1,ne(pe,e)}function ne(e,t,n){var r=ee(U++,2);return r.__c||(r.__c=q,r.__=[n?n(t):pe(void 0,t),function(t){var n=e(r.__[0],t);r.__[0]!==n&&(r.__[0]=n,r.__c.setState({}))}]),r.__}function re(e,t){var n=ee(U++,3);!Y.options.__s&&he(n.__H,t)&&(n.__=e,n.__H=t,q.__H.__h.push(n))}function ie(e,t){var n=ee(U++,4);!Y.options.__s&&he(n.__H,t)&&(n.__=e,n.__H=t,q.__h.push(n))}function oe(e){return K=5,se((function(){return{current:e}}),[])}function ae(e,t,n){K=6,ie((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))}function se(e,t){var n=ee(U++,7);return he(n.__H,t)?(n.__H=t,n.__h=e,n.__=e()):n.__}function le(e){var t=q.context[e.__c],n=ee(U++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(q)),t.props.value):e.__}function ce(){Z.some((function(e){if(e.__P)try{e.__H.__h.forEach(de),e.__H.__h.forEach(ue),e.__H.__h=[]}catch(t){return e.__H.__h=[],Y.options.__e(t,e.__v),!0}})),Z=[]}function de(e){e.t&&e.t()}function ue(e){var t=e.__();"function"==typeof t&&(e.t=t)}function he(e,t){return!e||t.some((function(t,n){return t!==e[n]}))}function pe(e,t){return"function"==typeof t?t(e):t}Y.options.__r=function(e){Q&&Q(e),U=0,(q=e.__c).__H&&(q.__H.__h.forEach(de),q.__H.__h.forEach(ue),q.__H.__h=[])},Y.options.diffed=function(e){G&&G(e);var t=e.__c;if(t){var n=t.__H;n&&n.__h.length&&(1!==Z.push(t)&&B===Y.options.requestAnimationFrame||((B=Y.options.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);"undefined"!=typeof window&&(t=requestAnimationFrame(n))})(ce))}},Y.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(de),e.__h=e.__h.filter((function(e){return!e.__||ue(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Y.options.__e(n,e.__v)}})),X&&X(e,t)},Y.options.unmount=function(e){J&&J(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){Y.options.__e(e,t.__v)}}};var me=n(5576);const ge=()=>({handleSubviewLinkPress:(e,t,n)=>ve(e,t,n),finishSubview:e=>fe(e),viewMedia(e,t,n){if(e.application.isPreview)return e;if(!n||!n.url||0===n.url.trim().length)return e;return we(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({},Se(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 we(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 we(e,r)}}),ve=(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 we(e,t)}}return e},fe=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 be;const ye=()=>(be||(be=(0,e.kv)((0,e.Y2)(ge),u())),be),we=(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]}})},Se=e=>{const t=e.navigationStack.items.slice();return t.pop(),Object.assign(Object.assign({},e),{navigationStack:{items:t}})},ke=e=>e.navigationStack.items.length?e.navigationStack.items[e.navigationStack.items.length-1]:null;function Ce(e){return void 0!==e&&"subview"===e.kind}function xe(e){return void 0!==e&&"snooze"===e.kind}function Ie(e){return void 0!==e&&"feedback"===e.kind}function Oe(e){return void 0!==e&&"media"===e.kind}var Te=n(2807),Me=n.n(Te);const Fe=e=>Object.keys(e).filter((t=>e[t])).join(" "),je=(e,t)=>{const n=((e,t)=>Me()(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},De=(e,t)=>{let{isMax:n,isMin:r}=t;const i=new Date(e);return n?(0,o.endOfDay)((0,o.addMinutes)(i,i.getTimezoneOffset())):r?(0,o.addMinutes)(i,i.getTimezoneOffset()):i};var Ae=n(5616),_e=n.n(Ae),Ee=n(623),Le=n.n(Ee);const He={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`},Pe={required:(e,t)=>{const n=e.errorMessage||He.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=De(e.minimumDate,{isMin:!0}),r=e.errorMessage||He.minimumDate(_e()(n,"DD MMM YYYY"));if(null==t||null==t)return{type:"invalid",errorMessage:r};const i=new Date(t);return!Le()(i)||i<n?{type:"invalid",errorMessage:r}:{type:"valid"}},maximumDate:(e,t)=>{const n=De(e.maximumDate,{isMax:!0}),r=e.errorMessage||He.maximumDate(_e()(n,"DD MMM YYYY"));if(null==t||null==t)return{type:"invalid",errorMessage:r};const i=new Date(t);return!Le()(i)||i>n?{type:"invalid",errorMessage:r}:{type:"valid"}},regexp:(e,t)=>{const n=e.errorMessage||He.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||He.minimum(e.minimum);return null==t||null==t||t<e.minimum?{type:"invalid",errorMessage:n}:{type:"valid"}},maximum:(e,t)=>{const n=e.errorMessage||He.maximum(e.maximum);return null==t||null==t||t>e.maximum?{type:"invalid",errorMessage:n}:{type:"valid"}},minimumLength:(e,t)=>{const n=e.errorMessage||He.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||He.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||He.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||He.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"}}},Re=["required","minimumLength","maximumLength","minimum","maximum","minimumDate","maximumDate","minChecked","maxChecked","maxSizeBytes","regexp"],Ve=(e,t)=>{if(!t)return{type:"valid"};for(const n in Re){const r=Re[n],i=t[r];if(void 0===i)continue;const o=Pe[r];if(o){const t=o(i.attributes,e);if("invalid"===t.type)return t}}return{type:"valid"}},$e=()=>({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?ve(e,t,n.layoutId):n.payload&&!e.application.isPreview?We(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?ve(e,t,r):i&&!e.application.isPreview?We(e,"payload","linkButton",t,o,i,n):e},handleSubmitButtonPayload(e,t,n,r){const i=e.navigationStack.items.length?"subview":"topview";return We(e,"payload","submitButton",t,i,r,n)},openExternalUrl:(e,t,n,r,i,o,a)=>(null==a?void 0:a.url)&&!e.application.isPreview?ze(e,i,o,t,n,a,r):e,handleFormChange:(e,t,n,r,i)=>Ne(e,t,{[n]:r},i),createResponseWithDefaults:(e,t,n,r)=>Ne(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,c;let d=Ve(r,i);const u=d&&!o?{[n]:d}:{},h=d&&o?{[n]:d}:{},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===(c=p[t])||void 0===c?void 0:c.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 c=r&&!i?{[n]:r}:{},d=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),c),subviews:Object.assign(Object.assign({},p),d&&i?{[i]:Object.assign(Object.assign({},p[i]),d)}:{})}})})},validateCurrentSubview(e,t){const n=ke(e);if(n&&Ce(n)){const r=n.subviewId,i=n.cardInstance.subviews[r],o=Ue(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=Ue(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})})})}}),Ne=(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)}:{})}})})},We=(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}}:{})}),ze=(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}}),Ue=(e,t,n,r)=>{var i;const o=Zc(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]=Ve(a[t.attributes.name],t.validations))}return s};let qe;const Be=()=>(qe||(qe=(0,e.kv)((0,e.Y2)($e),u())),qe),Ye=(e,t,n)=>{var r,i;const o=u().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===(c=l[n])||void 0===c?void 0:c[t]:void 0;var s,l,c};function Ke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ze;!function(e){e[e.DISABLED=0]="DISABLED",e[e.TRANSACTIONS=1]="TRANSACTIONS",e[e.PAYLOAD=2]="PAYLOAD",e[e.FULL_DETAIL=3]="FULL_DETAIL"}(Ze||(Ze={}));class Qe{static debug(e){Qe.logLevel!==Ze.DISABLED&&(e.level1||e.level2||e.level3)&&console.log(...this.constructLogPayload(e))}static warn(e){Qe.logLevel!==Ze.DISABLED&&(e.level1||e.level2||e.level3)&&console.warn(...this.constructLogPayload(e))}static error(e){Qe.logLevel!==Ze.DISABLED&&(e.level1||e.level2||e.level3)&&console.error(...this.constructLogPayload(e))}}Ke(Qe,"logLevel",Ze.DISABLED),Ke(Qe,"constructLogPayload",(e=>{const t=["AtomicSDK Web -"];return Qe.logLevel>=Ze.TRANSACTIONS&&e.level1&&t.push(...e.level1),Qe.logLevel>=Ze.PAYLOAD&&e.level2&&t.push(...e.level2),Qe.logLevel>=Ze.FULL_DETAIL&&e.level3&&t.push(...e.level3),t}));const Ge="sdk-initialized",Xe="card-displayed",Je="user-redirected",et="card-voted-up",tt="card-voted-down",nt="runtime-vars-updated",rt="stream-displayed",it="snooze-options-displayed",ot="snooze-options-canceled",at="card-subview-displayed",st="card-subview-exited",lt="request-failed",ct="video-played",dt="video-completed",ut="notification-received",ht="user-file-uploads-started",pt="user-file-uploads-completed",mt="user-file-uploads-failed";var gt=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())}))},vt=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 ft(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bt="AACUploadFailedError",yt="AACUploadSignedUrlFailedError",wt="AACNoFileToUploadError",St="AACUploadCancelledError",kt="Couldn't upload file(s)",Ct="Couldn't upload file(s)",xt="No files to upload",It="File upload cancelled";class Ot{constructor(){ft(this,"_fileStorage",void 0),ft(this,"_uploadQueue",void 0),this._fileStorage=new Map,this._uploadQueue=new Map,Ot._instance=this}static getInstance(){return Ot._instance||(Ot._instance=new Ot),Ot._instance}storeFile(e,t,n,r,i,o,a,s,l){var c,d,u,h;(this._fileStorage.get(i)||this._fileStorage.set(i,new Map),null===(c=this._fileStorage.get(i))||void 0===c?void 0:c.get(r))||(null===(h=this._fileStorage.get(i))||void 0===h||h.set(r,{topLevel:new Map,subviews:{}}));l&&!(null===(d=this._fileStorage.get(i))||void 0===d||null===(u=d.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,c;return r?(null===(s=this._fileStorage.get(e))||void 0===s||null===(l=s.get(t))||void 0===l||null===(c=l.subviews[r])||void 0===c?void 0:c.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,c,d,u;return r?null!==(i=null===(c=this._fileStorage.get(e))||void 0===c||null===(d=c.get(t))||void 0===d||null===(u=d.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 gt(this,void 0,void 0,(function*(){return new Promise(((o,a)=>gt(this,void 0,void 0,(function*(){var s;const{file:l,targetBucketId:c,destinationFilename:d}=n,u=null===(s=this._uploadQueue.get(t))||void 0===s?void 0:s.get(e);let h=!1;const p=new Error(It);p.name=St,u&&(u.uploadRequests[r]={abort:()=>{h=!0,Qe.debug({level1:[`File upload for card: ${e} in container instance: ${t} was cancelled`,d]}),a({error:p,fieldname:r,filename:d})}});let m=`get-file-upload-url?filename=${encodeURIComponent(d)}&targetBucketId=${c}&card_instance_id=${e}`;n.convertImage&&(m+="&jpeg_convert=1");const{data:{uploadUrl:g},response:v}=yield Td.get(m,i);if(h)return;if(v.error){Qe.error({level1:["Failed to get upload URL",v.error]});const e=new Error(Ct);return e.name=yt,a({error:e,fieldname:r,filename:d})}const f=new XMLHttpRequest,b=new Error(kt);b.name=bt,f.onload=()=>{f.status>=200&&f.status<300?(Qe.debug({level1:[`File upload for card: ${e} in container instance: ${t} was successful`,d]}),o(r)):(Qe.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,d]}),a({error:b,fieldname:r,filename:d}))},f.onerror=()=>{Qe.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,d]}),a({error:b,fieldname:r,filename:d})},f.onabort=()=>{Qe.debug({level1:[`File upload for card: ${e} in container instance: ${t} was cancelled`,d]});const n=new Error(It);n.name=St,a({error:n,fieldname:r,filename:d})},u&&(u.uploadRequests[r]=f);try{f.open("PUT",g,!0);const e=new FormData;e.append("file",l,d),f.send(e.get("file"))}catch(n){Qe.error({level1:[`File upload for card: ${e} in container instance: ${t} has failed`,n]}),a({error:b,fieldname:r,filename:d})}}))))}))}uploadFilesForCard(e,t,n,r,i){return gt(this,void 0,void 0,(function*(){var o,a,s,l,c,d;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(xt);return e.name=wt,{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),v=p.map((r=>{const{fieldname:i}=r,o=vt(r,["fieldname"]);if(g[i]={filename:o.destinationFilename,targetBucketId:o.targetBucketId},"image"===o.type)return this.uploadFile(e,t,o,i,n)})),f={success:!1};return r.sendEvent({cardInstanceId:e,cardViewState:(null==u?void 0:u.subviewId)?"subview":"topview",eventName:ht,properties:g}),yield Promise.allSettled(v).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===St)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},f.error=e.error}}})),i.length||o.length||(Qe.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:pt,properties:a}),f.success=!0),i.length&&(Qe.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:mt,properties:s}),f.failedUploads=i),o.length&&(f.cancelledUploads=o)})),null===(c=this._uploadQueue.get(t))||void 0===c||c.delete(e),(null===(d=this._uploadQueue.get(t))||void 0===d?void 0:d.size)||this._uploadQueue.delete(t),f}))}cancelUploadForCard(e,t){return gt(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 gt(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))}))}}ft(Ot,"_instance",void 0);const Tt=Ot.getInstance();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())}))};const Ft=(e,t)=>e?Object.keys(e).reduce(((n,r)=>{const i=e[r];return t.includes(i||"")||(n[r]=e[r]),n}),{}):e,jt=e=>Ft(e,["submitted","dismissed","snoozed","submitted-subview","centering"]),Dt=(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})},At=(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]),_t=function(){let e=Number(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0);return""+ ++e},Et=(e,t,n)=>{var r;if(!n)return e;switch(n.name){case bd.noInternet:return"No internet connection";case bt:case wt:case yt:return(null==t||null===(r=t.toastMessages)||void 0===r?void 0:r.fileUploadFailed)||n.message;default:return e}},Lt=(e,t)=>{var n;return((null===(n=t.application.enabledUiElements.toastConfig)||void 0===n?void 0:n.toastMessages)||{})[e]},Ht=(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:_t(e.messages.lastMessageId),cardList:void 0,subview:void 0}}},Pt=()=>({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?Ht(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=Lt("submittedCard",e),i=_t(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=Ft(e.cardStates,["centering","fixed-position"]),s=_t(e.messages.lastMessageId),l=e.application.enabledUiElements.toastConfig,c=Object.assign({text:Et("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:c}:{cardList:c}),{lastMessageId:s})})},dismissingCard:(e,t)=>Object.assign(Object.assign({},e),{cardStates:Object.assign(Object.assign({},e.cardStates),{[t]:"dismissing"})}),dismissedCard(e,t){const n=Lt("dismissedCard",e),r=_t(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=Ft(e.cardStates,["centering","fixed-position"]),o=_t(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:Et("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=Lt("snoozedCard",e),i=_t(e.messages.lastMessageId);let a;return a=(0,o.isToday)(n)?(0,o.format)(n,"h:mm A"):(0,o.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 ${a}`,messageId:i,cardInstanceId:t,action:"snoozed"},lastMessageId:i})})},failedToSnoozeCard(e,t,n,r,i){const o=Ft(e.cardStates,["centering","fixed-position"]),a=_t(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:Et("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?Dt(e,t,"fixed-position"):Ft(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?Dt(e,t,"centering"):Ft(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 Mt(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=Ft(i.cardStates,["centering","fixed-position"]),l=jt(s),c=At(e.cardFeed.cardInstances,i.cardFeed.cardInstances,l);return i.cardFeed.cardInstances=c,{cardFeed:Object.assign(Object.assign({},e.cardFeed),{cardInstances:i.cardFeed.cardInstances,runtimeVariables:i.cardFeed.runtimeVariables,tutorialSeen:e.cardFeed.tutorialSeen||c.length>0,updateId:(new Date).getTime(),status:{loaded:!0}}),cardStates:s,navigationStack:i.navigationStack}}))},clearMessage:(e,t)=>Object.assign(Object.assign({},e),{messages:Ht(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===bd.noInternet)n="noInternet";else n="apiError";return Qe.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=Ft(e.cardStates,["centering","fixed-position"]),r=jt(n),i=At(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=>Gc(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===bd.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=Lt("feedbackReceived",e),r=_t(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 Rt;const Vt=()=>(Rt||(Rt=(0,e.kv)((0,e.Y2)(Pt),u())),Rt);var $t=0,Nt=document.head.appendChild(document.createElement("style")).sheet;function Wt(e,t){var n="p"+$t++,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{Nt.insertRule(e,Nt.cssRules.length)}catch(e){}})),n}function zt(e,t){return t+"{"+e+"}"}function Ut(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(zt(Ut(i,!/^@/.test(r)).join(""),r))))}return t||(n[0]=zt(n[0],"")),n}const qt=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=Ut(e),r=t.join("");return n[r]||(n[r]=Wt(t,"."))}}(Y.h),Bt=function(e){return Wt([zt(Ut(e,1).join(""),"")],"@keyframes ")};function Yt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Kt="rgba(0, 0, 0, 1)",Zt="rgba(255, 255, 255, 1)",Qt='-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',Gt={colors:{},typography:{},shape:{}},Xt={icon:{switchOff:Zt,switchOn:Zt},background:{switchOff:"rgba(128, 128, 128, 1)",switchOn:Kt}};class Jt{constructor(e,t,n,r){Yt(this,"theme",void 0),Yt(this,"themeName",void 0),Yt(this,"fontFamilies",void 0),Yt(this,"hasSecondaryButtonStyle",!1),Yt(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,c]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 c&&c.match(/\w+/g)&&e&&(this.hasSecondaryButtonStyle=!0);break}if(t.includes("equalShadowOffsets")||t.includes("equalPaddings"))break;r(c);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 c&&c.match(/\w+/g)&&t&&(this.hasSecondaryButtonStyle=!0);break}}if(!this.hasSecondaryButtonStyle&&null!==c&&"object"==typeof c&&!Array.isArray(c)){const e=t?t+"."+l:l;this.testSecondaryStyles(c,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]||Gt,this.fontFamilies=i.fontFamilies||[]}getShape(e,t){return tn(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),c=this.getShape(`shadowOffsetType.${e}`,t),d=this.getCSSColor(`shadow.${e}`,{skipFallback:!0}),u="inset"===c?"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(!d||d.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/))return"";return`${u} ${h} ${p} ${i||""} ${d}`.trim()}getPadding(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=tn(a,`${e}`,null),l=tn(o,`${e}Width`,null),c=tn(o,`${e}Top`,null),d=tn(o,`${e}Right`,null),u=tn(o,`${e}Bottom`,null),h=tn(o,`${e}Left`,null);return"true"===s&&l?`${l}`:c||d||u||h?`${c||0} ${d||0} ${u||0} ${h||0}`:""}getCSSColor(e,t){const n=tn(this.theme.colors,e,null);if(n&&(null==n?void 0:n.color)&&!(null==t?void 0:t.skipPrimaryStyle))return en(n.color,n.opacity);if(null==t?void 0:t.skipFallback)return null;const r=tn(Xt,e,null);return r||("workflow"===this.themeName?e.startsWith("background")?Kt:Zt:e.startsWith("background")?"rgba(0, 0, 0, 0)":Kt)}getFontFamilies(){return this.fontFamilies}getTypographyStyle(e){var t;let n=tn(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 o=i.transform?i.transform:(null==t?void 0:t.skipFontFallbacks)?null:"none",a=i.lineHeight||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,c=i.fontFamily?`"${i.fontFamily}", ${Qt}`:Qt,d=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:c,fontWeight:d,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 en=(e,t)=>{const n=e.replace("#",""),r=parseInt(n,16);return`rgba(${[r>>16&255,r>>8&255,255&r].join(",")},${t})`},tn=(e,t,n)=>(e=e[(t=Array.isArray(t)?t:t.split("."))[0]])&&t.length>1?tn(e,t.slice(1),n):void 0!==e?e:n,nn=(e,t)=>n=>{let{themeMethod:r,primaryAccessor:i,secondaryAccessor:o,fallbackStyle:a,skipThemeHelperFallbacks:s,skipDefaultStyle:l}=n;const c=i?e[r](i,{skipFallback:s}):void 0,d=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&&d?d:c&&("primary"===t||"secondary"===t&&!e.hasSecondaryButtonStyle)?c:a||u||""},rn=e=>"string"!=typeof e?(Qe.warn({level3:["Expected a string value for RGBA color, but received:",e]}),!1):null!==e.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/),on=Bt({from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}),an=qt("svg")((()=>({animation:`${on} 1s infinite linear`}))),sn=e=>{let{stopColor:t,size:n}=e;return(0,Y.h)(an,{width:n,height:n,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.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"}))},ln=()=>(0,Y.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.2.3/assets/fonts/font-awesome-5-15-4/fa-solid-900.woff');\n }\n "),cn={"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:""},dn=e=>{let{fillColor:t,ariaHidden:n=!1}=e;return(0,Y.h)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":n},(0,Y.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}))},un=qt("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)})),hn=qt("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`})})),pn=e=>{let{iconName:t,iconUrl:n,size:r,color:i,fallbackColor:o,styles:a={}}=e;const[s,l]=te(!1),c=oe(n);return re((()=>{n&&n!==c.current&&s&&(c.current=n,l(!1))}),[n,s]),n&&!s?(0,Y.h)(hn,{size:r,styles:a},(0,Y.h)("svg",{"aria-hidden":"true","data-src":n,"data-replacement-color":i,"data-container-size":r,oniconloaderror:()=>{Qe.error({level1:[`Error loading custom icon: ${n}`]}),l(!0)},style:Object.assign({maxWidth:`${r}px`,maxHeight:`${r}px`},i?{color:i}:{})})):t?(i&&(a.color=i),(0,Y.h)(un,{styles:a,size:r,"aria-hidden":"true"},cn[t]||"")):(0,Y.h)(hn,{size:r,styles:a},(0,Y.h)(dn,{ariaHidden:!0,fillColor:null!=i?i:o}))},mn=e=>{let{theme:t,appearance:n}=e;const r=nn(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())},gn=qt("button")((e=>Object.assign({},mn(e)))),vn=qt("a")((e=>Object.assign(Object.assign({},mn(e)),{textDecoration:"none"}))),fn=qt("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"}})),bn=qt("div")({display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}),yn=qt("span")({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),wn=e=>{let{nodeKey:t,clickHandler:n,text:r,icon:i,iconUrl:o,theme:a,appearance:s,loading:l,type:c,urlLink:d}=e;const u=d?vn:gn,h=nn(a,s),p=h({themeMethod:"getCSSFontProperties",primaryAccessor:"button",secondaryAccessor:"buttonSecondary",fallbackStyle:{}}),m=h({themeMethod:"getShape",primaryAccessor:"align.buttonIcon",secondaryAccessor:"align.buttonIconSecondary",fallbackStyle:"left",skipThemeHelperFallbacks:!0}),g=h({themeMethod:"getShape",primaryAccessor:"lineHeight.buttonIcon",secondaryAccessor:"lineHeight.buttonIconSecondary",fallbackStyle:"1",skipThemeHelperFallbacks:!0}),v=h({themeMethod:"getNumericFontSize",primaryAccessor:"button",secondaryAccessor:"buttonSecondary"}),f=Object.assign(Object.assign({},"left"===m?{marginRight:"10px"}:{marginLeft:"10px"}),{lineHeight:v*g+"px",color:h({themeMethod:"getCSSColor",primaryAccessor:"icon.button",secondaryAccessor:"icon.buttonSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),b=h({themeMethod:"getCSSColor",primaryAccessor:"icon.button",secondaryAccessor:"icon.buttonSecondary"});return(0,Y.h)(u,{key:t,"data-element-key":t,class:"submit-button",onClick:n,theme:a,appearance:s,tabIndex:"0",type:c,href:null==d?void 0:d.url,target:null==d?void 0:d.target},(0,Y.h)(Y.Fragment,null,l&&(0,Y.h)(bn,null,(0,Y.h)(sn,{stopColor:a.getCSSColor("text.button"),size:22})),(0,Y.h)(fn,{"data-testid":"button-content-wrapper",labelAlignment:null==p?void 0:p.textAlign,iconAlignment:m,visible:!l},(i||o)&&(0,Y.h)(pn,{iconName:i,iconUrl:o,size:v,color:f.color,fallbackColor:b,styles:Object.assign(Object.assign(Object.assign({},f),!r&&{marginLeft:0,marginRight:0}),{alignSelf:"center",justifySelf:"start"})}),(0,Y.h)(yn,null,r))))},Sn=e=>{let{theme:t,appearance:n}=e;const r=nn(t,n),i=(e,t)=>t?{[e]:t}:{},o=r({themeMethod:"getCSSFontProperties",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:{}}),a=t.getShape("buttonWidth.global"),s=t.getShape("buttonLayout.global"),l=r({themeMethod:"getCSSColor",primaryAccessor:"background.action",secondaryAccessor:"background.actionSecondary"}),c="transparent"===l||l.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/);let d="100%";return c&&(d="calc(100% + 40px)"),Object.assign(Object.assign(Object.assign({cursor:"pointer",padding:r({themeMethod:"getPadding",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:"10px 20px"}),margin:c&&"horizontal"!==s?"0 -20px":"0px",color:r({themeMethod:"getCSSColor",primaryAccessor:"text.action",secondaryAccessor:"text.actionSecondary"}),display:"flex",alignItems:"center",textAlign:"left"},o),{maxWidth:d,width:"hugsLabel"===a?"auto":d,backgroundColor:l,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"}),":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())},kn=qt("button")((e=>Object.assign({},Sn(e)))),Cn=qt("a")((e=>Object.assign(Object.assign({},Sn(e)),{textDecoration:"none"}))),xn=qt("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-start"):(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}})),In=qt("span")((()=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}))),On=e=>{let{nodeKey:t,clickHandler:n,text:r,icon:i,iconUrl:o,theme:a,appearance:s,type:l,urlLink:c}=e;const d=c?Cn:kn,u=nn(a,s),h=u({themeMethod:"getCSSFontProperties",primaryAccessor:"action",secondaryAccessor:"actionSecondary",fallbackStyle:{}}),p=u({themeMethod:"getShape",primaryAccessor:"align.actionIcon",secondaryAccessor:"align.actionIconSecondary",fallbackStyle:"left",skipThemeHelperFallbacks:!0}),m=u({themeMethod:"getShape",primaryAccessor:"lineHeight.actionIcon",secondaryAccessor:"lineHeight.actionIconSecondary",fallbackStyle:"1",skipThemeHelperFallbacks:!0}),g=u({themeMethod:"getNumericFontSize",primaryAccessor:"action",secondaryAccessor:"actionSecondary"}),v=Object.assign(Object.assign({},"left"===p?{marginRight:"10px"}:{marginLeft:"10px"}),{lineHeight:g*m+"px",color:u({themeMethod:"getCSSColor",primaryAccessor:"icon.action",secondaryAccessor:"icon.actionSecondary",skipThemeHelperFallbacks:!0,skipDefaultStyle:!0})}),f=u({themeMethod:"getCSSColor",primaryAccessor:"icon.action",secondaryAccessor:"icon.actionSecondary"});return(0,Y.h)(d,{key:t,"data-element-key":t,class:"action-button",onClick:n,theme:a,appearance:s,tabIndex:"0",type:l,href:null==c?void 0:c.url,target:null==c?void 0:c.target},(0,Y.h)(xn,{labelAlignment:null==h?void 0:h.textAlign,iconAlignment:p},(i||o)&&(0,Y.h)(pn,{iconName:i,iconUrl:o,size:g,color:v.color,fallbackColor:f,styles:Object.assign(Object.assign(Object.assign({},v),!r&&{marginLeft:0,marginRight:0}),{alignSelf:"center",justifySelf:"start"})}),(0,Y.h)(In,null,r)))},Tn=e=>e.isWorkflow?(0,Y.h)(wn,e):(0,Y.h)(On,e),Mn=e=>{let{fillColor:t,className:n,style:r,ariaHidden:i=!0}=e;return(0,Y.h)("svg",{width:"14",height:"10",viewBox:"0 0 14 10",class:n,style:r,focusable:"false","aria-hidden":i},(0,Y.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}))},Fn=e=>{let{style:t}=e;return(0,Y.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,Y.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"}))},jn=e=>{let{style:t}=e;return(0,Y.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,Y.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"}))},Dn=n(3054),An=n(6756),_n=n(1295),En=[];const Ln={},Hn=(e,t,n)=>{const{enableJs:r,disableUniqueIds:i,disableCssScoping:o,spriteIconId:a,replacementColor:s,containerSize:l}=t,c=!!a,d=(new DOMParser).parseFromString(n,"text/html"),u=c?d.getElementById(a):d.querySelector("svg"),h=(()=>{if(En.length)return En;for(const e in document.body)e.startsWith("on")&&En.push(e);return En.push("onbegin","onend","onrepeat"),En.push("onfocusin","onfocusout","onbounce","onfinish","onshow"),En})(),p=Ln[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:o}=t.attributes[e],a=An(g,o,i);o!==a&&t.setAttribute(i,a),!h.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=Dn(t.innerHTML,`[data-id="${m}"]`,g);e=An(g,e),e!==t.innerHTML&&(t.innerHTML=e)}})),e.innerHTML=a?u.outerHTML:u.innerHTML,!c)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))}Ln[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,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){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")}},Pn={},Rn={},Vn=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"),c=Hn.bind(self,e,{enableJs:i,disableUniqueIds:o,disableCssScoping:a,spriteIconId:r,replacementColor:s,containerSize:l});if(Rn[n]){const e=Rn[n];c(e)}else{if(Pn[n])return void setTimeout((()=>Vn(e)),20);Pn[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`);Rn[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 Pn[n]}))}};let $n;globalThis.IntersectionObserver&&($n=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(Vn(e.target),$n.unobserve(e.target))}))}),{rootMargin:"1200px"}));const Nn=[];function Wn(){Array.from(document.querySelectorAll("svg[data-src]:not([data-id])")).forEach((e=>{-1===Nn.indexOf(e)&&(Nn.push(e),"lazy"===e.getAttribute("data-loading")?$n.observe(e):Vn(e))}))}let zn=!1;if(globalThis.addEventListener){const Nu=setInterval((()=>{Wn()}),100);function Wu(){clearInterval(Nu),Wn(),(()=>{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])"))))))&&Wn(),e.forEach((e=>{"attributes"===e.type&&Vn(e.target)}))})).observe(document.documentElement,{attributeFilter:["data-src"],attributes:!0,childList:!0,subtree:!0})})()}"interactive"===document.readyState||"complete"===document.readyState?Wu():globalThis.addEventListener("DOMContentLoaded",(()=>{Wu()}))}function Un(e,t){for(var n in t)e[n]=t[n];return e}function qn(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)=>{Rn[e]=t};var Bn=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 qn(this.props,e)||qn(this.state,t)},r}(Y.Component);function Yn(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:qn(this.props,e)}function r(t){return this.shouldComponentUpdate=n,(0,Y.createElement)(e,Un({},t))}return r.prototype.isReactComponent=!0,r.displayName="Memo("+(e.displayName||e.name)+")",r.t=!0,r}var Kn=Y.options.__b;Y.options.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),Kn&&Kn(e)};var Zn=function(e,t){return e?(0,Y.toChildArray)(e).reduce((function(e,n,r){return e.concat(t(n,r))}),[]):null},Qn={map:Zn,forEach:Zn,count:function(e){return e?(0,Y.toChildArray)(e).length:0},only:function(e){if(1!==(e=(0,Y.toChildArray)(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:Y.toChildArray},Gn=Y.options.__e;function Xn(e){return e&&((e=Un({},e)).__c=null,e.__k=e.__k&&e.__k.map(Xn)),e}function Jn(){this.__u=0,this.o=null,this.__b=null}function er(e){var t=e.__.__c;return t&&t.u&&t.u(e)}function tr(){this.i=null,this.l=null}Y.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);Gn(e,t,n)},(Jn.prototype=new Y.Component).__c=function(e,t){var n=this;null==n.o&&(n.o=[]),n.o.push(t);var r=er(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)},Jn.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=Xn(this.__b),this.__b=null),[(0,Y.createElement)(Y.Component,null,t.u?null:e.children),t.u&&e.fallback]};var nr=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]}};(tr.prototype=new Y.Component).u=function(e){var t=this,n=er(t.__v),r=t.l.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),nr(t,e,r)):i()};n?n(o):o()}},tr.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,Y.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},tr.prototype.componentDidUpdate=tr.prototype.componentDidMount=function(){var e=this;e.l.forEach((function(t,n){nr(e,n,t)}))};var rr=function(){function e(){}var t=e.prototype;return t.getChildContext=function(){return this.props.context},t.render=function(e){return e.children},e}();function ir(e){var t=this,n=e.container,r=(0,Y.createElement)(rr,{context:t.context},e.vnode);return t.s&&t.s!==n&&(t.v.parentNode&&t.s.removeChild(t.v),(0,Y._unmount)(t.h),t.p=!1),e.vnode?t.p?(n.__k=t.__k,(0,Y.render)(r,n),t.__k=n.__k):(t.v=document.createTextNode(""),(0,Y.hydrate)("",n),n.appendChild(t.v),t.p=!0,t.s=n,(0,Y.render)(r,n,t.v),t.__k=t.v.__k):t.p&&(t.v.parentNode&&t.s.removeChild(t.v),(0,Y._unmount)(t.h)),t.h=r,t.componentWillUnmount=function(){t.v.parentNode&&t.s.removeChild(t.v),(0,Y._unmount)(t.h)},null}var or=/^(?: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]/;Y.Component.prototype.isReactComponent={};var ar="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;function sr(e,t,n){if(null==t.__k)for(;t.firstChild;)t.removeChild(t.firstChild);return(0,Y.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}var lr=Y.options.event;function cr(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}})}Y.options.event=function(e){lr&&(e=lr(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 dr={configurable:!0,get:function(){return this.class}},ur=Y.options.vnode;Y.options.vnode=function(e){e.$$typeof=ar;var t=e.type,n=e.props;if(t){if(n.class!=n.className&&(dr.enumerable="className"in n,null!=n.className&&(n.class=n.className),Object.defineProperty(n,"className",dr)),"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,Y.toChildArray)(n.children).forEach((function(e){-1!=n.value.indexOf(e.props.value)&&(e.props.selected=!0)})),delete n.value),n)if(r=or.test(o))break;if(r)for(o in i=e.props={},n)i[or.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&&(cr(t.prototype,"componentWillMount"),cr(t.prototype,"componentWillReceiveProps"),cr(t.prototype,"componentWillUpdate"),t.m=!0)}ur&&ur(e)};function hr(e){return!!e&&e.$$typeof===ar}const pr={useState:te,useReducer:ne,useEffect:re,useLayoutEffect:ie,useRef:oe,useImperativeHandle:ae,useMemo:se,useCallback:function(e,t){return K=8,se((function(){return e}),t)},useContext:le,useDebugValue:function(e,t){Y.options.useDebugValue&&Y.options.useDebugValue(t?t(e):e)},version:"16.8.0",Children:Qn,render:sr,hydrate:sr,unmountComponentAtNode:function(e){return!!e.__k&&((0,Y.render)(null,e),!0)},createPortal:function(e,t){return(0,Y.createElement)(ir,{vnode:e,container:t})},createElement:Y.createElement,createContext:Y.createContext,createFactory:function(e){return Y.createElement.bind(null,e)},cloneElement:function(e){return hr(e)?Y.cloneElement.apply(null,arguments):e},createRef:Y.createRef,Fragment:Y.Fragment,isValidElement:hr,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:Y.Component,PureComponent:Bn,memo:Yn,forwardRef:function(e){function t(t){var n=Un({},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:Jn,SuspenseList:tr,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,Y.createElement)(n,i)}return i.displayName="Lazy",i.t=!0,i}},mr=()=>(0,Y.h)("svg",{width:"3",height:"15",viewBox:"0 0 3 15",xmlns:"http://www.w3.org/2000/svg"},(0,Y.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,Y.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,Y.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"})),gr=e=>{let{style:t}=e;return(0,Y.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,Y.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"}))},vr=e=>{let{style:t}=e;return(0,Y.h)("svg",{width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t},(0,Y.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"}))},fr=e=>e&&e.current&&e.current.base,br={top:35,right:25},yr=qt("button")((e=>{let{open:t,theme:n}=e;return Object.assign({cursor:"pointer",position:"absolute",top:"10px",right:"10px",width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"center",border:"0px",borderRadius:"30px",zIndex:ws.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())})),wr=qt("button")((e=>{let{theme:t}=e;return Object.assign({cursor:"pointer",position:"absolute",top:"10px",right:"10px",width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"center",border:"0px",borderRadius:"30px",zIndex:ws.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())})),Sr=e=>{let{theme:t,open:n,feedOrientation:r,children:i,cardRef:o,ariaLabelledBy:a}=e;const s=oe(null);let l={direction:"down",maxHeight:0,maxWidth:0};return n&&(l=((e,t,n)=>{if(fr(t)&&fr(n)){const r=t.current.base.offsetParent,i=r.offsetParent,o=n.current.base,a=10,s=10;if("horizontal"===e){const e=r.offsetLeft+o.offsetLeft-i.scrollLeft,t=i.clientWidth-e,n=200,a=e>=n||t<n;return{direction:a?"left":"right",maxWidth:a?e:t}}const l=o.offsetTop,c=i.scrollHeight-r.offsetTop-a-l,d=r.offsetTop,u=o.scrollHeight,h=c>=u||d<u;return{direction:h?"down":"up",maxHeight:h?c:d,maxWidth:r.clientWidth-2*s}}return{direction:"down",maxHeight:0,maxWidth:0}})(r,o,s),setTimeout((()=>{if(fr(s)){const e=s.current.base.querySelector('[tabindex="0"]');if(e){e.focus()}}}),0)),(0,Y.h)(kr,{maxHeight:`${l.maxHeight}px`,maxWidth:`${l.maxWidth}px`,open:n,theme:t,ref:s,children:i,direction:l.direction,"aria-labelledBy":a})},kr=qt("ul")((e=>{var t;let n,{theme:r,open:i,maxHeight:o,maxWidth:a,direction:s}=e;switch(s){case"up":n="translateY(-100%) translateY(-50px)";break;case"down":case"left":n="translateY(0)";break;case"right":n="translateX(90%)"}return{position:"absolute",top:"50px",right:"10px",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!==(t=r.getShape("borderRadius.sheet",{skipFallback:!0}))&&void 0!==t?t:"5px",padding:"10px 0",overflow:"auto",listStyle:"none",margin:"0",zIndex:ws.OVERFLOW_MENU,maxHeight:i?`${o}`:"0px",maxWidth:i?`${a}`:"0px",visibility:i?"visible":"hidden",transform:n}})),Cr=qt("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())})),xr=qt("span")((()=>({maxWidth:"240px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}))),Ir=qt("li")((e=>{let{theme:t}=e;return{borderTop:`1px solid ${t.getCSSColor("border.sheetItemDivider")}`,height:"1px",margin:"10px 0"}})),Or=qt("li")((()=>({flexShrink:"0"}))),Tr=e=>{let{title:t,icon:n,onClick:r,theme:i,className:o}=e;const a={marginRight:"20px",minWidth:"20px"};return(0,Y.h)(Or,{role:"none"},(0,Y.h)(Cr,{theme:i,tabIndex:"-1",onClick:r,className:o},"bin"===n&&(0,Y.h)(Fn,{style:a}),"clock"===n&&(0,Y.h)(jn,{style:a}),"thumbs-up"===n&&(0,Y.h)(gr,{style:a}),"thumbs-down"===n&&(0,Y.h)(vr,{style:a}),(0,Y.h)(xr,null,t)))},Mr=32,Fr=38,jr=40,Dr=13,Ar=27,_r=-1,Er=e=>{switch(e){case"ArrowUp":case"Up":return Fr;case"ArrowDown":case"Down":return jr;case"Enter":return Dr;case"Spacebar":case" ":return Mr;case"Escape":return Ar;default:return _r}},Lr="ArrowUp",Hr="ArrowDown",Pr="ArrowLeft",Rr="ArrowRight",Vr="Enter",$r=" ",Nr="Escape",Wr="PageUp",zr="PageDown",Ur="Tab",qr=qt("div")((e=>{let{theme:t}=e;return Object.assign({width:"100%",border:"0"},t.getElementFocusCSSProperties())})),Br=(e,t)=>{try{const n=Yr(e)[t];return n&&"none"===n.getAttribute("role")&&n.childNodes.length>0?n.childNodes[0]:n}catch(e){return null}},Yr=e=>e&&e.current&&e.current.base&&e.current.base.childNodes?[...e.current.base.childNodes].filter((e=>"true"!==e.getAttribute("aria-hidden"))):[],Kr=e=>{let{defaultIndex:t,theme:n,children:r}=e;const[i,o]=te(t||0),a=(0,Y.createRef)(),s=oe(-1);re((()=>{s.current=i}));const l=s.current;return re((()=>{o(t||0)}),[t]),re((()=>{var e,t,n;-1!==l&&(null===(n=Br(a,l))||void 0===n||n.setAttribute("tabIndex","-1"));null===(e=Br(a,i))||void 0===e||e.setAttribute("tabIndex","0"),null===(t=Br(a,i))||void 0===t||t.focus()}),[i]),(0,Y.h)(qr,{theme:n,className:"supports-keyboard-navigation",ref:a,onKeyDown:e=>{var t;let n=null;switch(Er(e.key)){case jr:n=i+1;break;case Fr:n=i-1;break;case Dr:case Mr:null===(t=Br(a,i))||void 0===t||t.click(),e.stopPropagation(),e.preventDefault()}var r,s;null!==n&&(r=n,s=Yr(a).length,n=(r+s)%s,o(n),e.view.event.preventDefault())}},r)},Zr=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"12",height:"12",viewBox:"0 0 12 12"},(0,Y.h)("path",{d:"M1 1L6 6L11 11M1 11L11 1","stroke-width":"2","stroke-linecap":"round",stroke:t}))},Qr=qt("div")((e=>{let{feedOrientation:t,rendersButton:n,cardElements:r}=e;const i=((e,t)=>{var n,r;if(!t||!e||0===e.length)return{top:0,right:0};const i=(e,t)=>{var n;if(!e)return{top:0,right:0};const r=Array.isArray(e)?e[0]:e;switch(null==r?void 0:r.type){case O:case T:const e=null==r||null===(n=r.attributes)||void 0===n?void 0:n.format;return"banner"===e?null:"text"===e?{top:0,right:br.right}:{top:br.top,right:0};case M:case F:case j:case D:case A:case _:case E:case L:case R:case V:case $:case N:case W:case z:return{top:br.top,right:0};case k:case C:case x:case I:return{top:0,right:br.right};case H:case P:return i(null==r?void 0:r.children,t);default:return null}},o=null===(n=e[0])||void 0===n||null===(r=n.props)||void 0===r?void 0:r.node;return i(o,t)})(r,n);return Object.assign(Object.assign({},"horizontal"===t?{height:"100%",display:"flex",flexDirection:"column"}:{}),i?{"& > *:nth-child(2)":{marginRight:`${i.right}px`,marginTop:`${i.top}px`}}:{})})),Gr=qt("div")((e=>{let{theme:t,margin:n,minHeight:r,feedOrientation:i,cardWidth:o}=e;const a={width:`${o}px`,marginLeft:`${n}px`};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({backgroundColor:t.getCSSColor("background.card"),marginBottom:`${n}px`,borderRadius:t.getShape("borderRadius.card"),boxShadow:n>0?`0 ${t.getShape("offset.cardShadow")} ${t.getShape("blur.cardShadow")} ${t.getCSSColor("shadow.card")}`:"none",padding:"10px 20px",border:`${t.getShape("border.card")} solid ${t.getCSSColor("border.card")}`,position:"relative",minHeight:r?`${r}px`:"0px"},"horizontal"===i?a:{}),Us(i).cardCompletion),Us(i).dismissal),Us(i).snooze),{".submitting, .submitted, .submitted-subview":{border:"0"}})})),Xr=qt("div")((e=>{let{dimensions:t,centerAlign:n,leftPosition:r,feedOrientation:i}=e;const o=Object.assign({width:t.width,display:"flex",flexShrink:"0",scrollSnapAlign:"center",".fixed-position":{position:"unset",left:`${r?r/2+r:0}px`}},n&&{left:"50%",transform:"translateX(-50%)"});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({height:t.height},"horizontal"===i?o:{}),qs(i).cardCompletion),qs(i).dismissal),qs(i).snooze),qs(i).center)})),Jr=qt("div")((()=>({})));var ei;!function(e){e.menu="menu",e.dismiss="dismiss",e.hidden="hidden"}(ei||(ei={}));const ti=Yn((e=>{let{containerInstanceId:t,cardInstanceId:n,children:r,theme:i,animationState:o,cardFeedOverlayDisplayed:a,onDismiss:s,onSnooze:l,onFeedbackSelected:c,removeCard:d,customStrings:u,margin:h,centerAlign:p,accessibilityRole:m,actions:g,votingOptions:v,cardMinimumHeight:f,horizontalContainerConfig:b}=e;const[y,w]=te(!1),S=oe(y),k=e=>{S.current=e,w(e)},[C,x]=te({height:"auto",width:"auto"}),[I,O]=te(0),T=oe(null),M=oe(null),F=oe(null),j=`card-overflow-menu-${n}`,D=sd(b);ie((()=>{M.current&&M.current.base&&("submitted"===o||"submitted-subview"===o||"dismissed"===o||"snoozed"===o?(x({height:M.current.base.offsetHeight+h-1+"px",width:`${M.current.base.offsetWidth+h}px`}),"horizontal"===sd(b)&&"center"===(null==b?void 0:b.lastCardAlignment)?(Vt().fixPositionRemainingCard(n),O(F.current.base.offsetLeft),setTimeout((()=>{Vt().centerRemainingCard(n)}),200),setTimeout((()=>{d()}),Zs(o))):setTimeout((()=>{d()}),Zs(o))):x({height:"auto",width:"auto"})),F.current&&F.current.base&&(O("fixed-position"===o?F.current.base.offsetLeft:0),"centering"===o&&setTimeout((()=>{Vt().removeCardState(n)}),Zs(o)))}),[o,M.current,F.current]),re((()=>{const e=e=>{var t;(null===(t=T.current)||void 0===t?void 0:t.base)&&!T.current.base.contains(e.target)&&k(!1)};document.addEventListener("mousedown",e);const t=e=>{if(S.current&&("Tab"===e.key&&k(!1),"Escape"===e.key&&S.current)){const e=document.getElementById(j);k(!1),null==e||e.focus()}};return document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}}),[n]);const{dismiss:{overflow:A},snooze:{overflow:_},voteUp:{overflow:E,feedback:L,feedbackLabel:H},voteDown:{overflow:P,feedback:R,feedbackLabel:V}}=g,$={voteUp:!0===(null==v?void 0:v.canVoteUseful)||E,voteDown:!0===(null==v?void 0:v.canVoteNotUseful)||P};let N=ei.hidden;$.voteUp||$.voteDown||_?N=ei.menu:A&&(N=ei.dismiss);const W=($.voteUp||$.voteDown)&&(A||_);return(0,Y.h)(Xr,{ref:F,id:n,dimensions:C,feedOrientation:D,centerAlign:p,leftPosition:I,class:o,role:m},(0,Y.h)(Gr,{theme:i,class:`card-content ${o||""}`,ref:M,margin:h,minHeight:f,feedOrientation:D,cardWidth:null==b?void 0:b.cardWidth,inert:a},(0,Y.h)(Qr,{class:"card-nodes",feedOrientation:D,rendersButton:N!==ei.hidden,cardElements:r},N===ei.menu&&(0,Y.h)(Jr,{ref:T},(0,Y.h)(yr,{class:"overflow-action",theme:i,open:y,tabIndex:"0",ariaLabel:"Card overflow menu",id:j,ariaHasPopup:"true",ariaExpanded:y,onClick:e=>{e.target&&e.target.focus(),k(!y)}},(0,Y.h)(mr,null)),(0,Y.h)(Sr,{theme:i,ariaLabelledBy:j,open:y,feedOrientation:D,cardRef:M},(0,Y.h)(Kr,{theme:i},$.voteUp&&(0,Y.h)(Tr,{onClick:()=>{c({sentiment:"positive",textFeedback:L,textFeedbackLabel:H,source:"overflow-menu"}),k(!1)},theme:i,title:(null==u?void 0:u.votingUsefulTitle)||"This is useful",icon:"thumbs-up",className:"vote-up-action"}),$.voteDown&&(0,Y.h)(Tr,{onClick:()=>{c({sentiment:"negative",textFeedback:R,textFeedbackLabel:V,source:"overflow-menu"}),k(!1)},theme:i,title:(null==u?void 0:u.votingNotUsefulTitle)||"This isn't useful",icon:"thumbs-down",className:"vote-down-action"}),W&&(0,Y.h)(Ir,{theme:i,className:"card-overflow-divider","aria-hidden":"true"}),_&&(0,Y.h)(Tr,{onClick:()=>{l(),k(!1)},theme:i,title:(null==u?void 0:u.cardSnoozeTitle)||"Remind me",icon:"clock",className:"snooze-action"}),A&&(0,Y.h)(Tr,{onClick:()=>{s(),k(!1)},theme:i,title:"Dismiss",icon:"bin",className:"dismiss-action"})))),N===ei.dismiss&&(0,Y.h)(wr,{ariaLabel:"Dismiss card",theme:i,tabIndex:"0",onClick:s,className:"dismiss-button"},(0,Y.h)(Zr,null)),r),(0,Y.h)(Ls,{theme:i,animationState:o})),(0,Y.h)(Ws,{viewState:"topview",onCancelUpload:()=>{window.AtomicUploadService.cancelUploadForCard(t,n),Vt().finishCardFileUpload(n),!window.AtomicUploadService.getIsUploadingStatus(t)&&Vt().setCardFeedOverlay(!1)},theme:i,renderOverlay:"uploading-files"===o}),(0,Y.h)(Hs,{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)),ni=qt("div")((e=>{let{feedOrientation:t,snapScroll:n}=e;const r={position:"relative",display:"flex",flexDirection:"row nowrap",alignItems:"stretch",flexShrink:"0",padding:"10px 10px 10px 0",overflowX:"auto",scrollSnapType:n?"x mandatory":"none"};return Object.assign({},"horizontal"===t?r:{})})),ri=pr.forwardRef(((e,t)=>{let{cardInstances:n,theme:r,isPreview:i,onDismiss:o,onSnooze:a,onFeedbackSelected:s,removeCard:l,cardStates:c,margin:d,runtimeVariables:h,customStrings:p,votingOptions:m,cardMinimumHeight:g,horizontalContainerConfig:v}=e;const f=u().getState();let b=n;f.application.cardLimit&&(b=b.slice(0,f.application.cardLimit));const y=sd(v);return(0,Y.h)(ni,{feedOrientation:y,snapScroll:"free"!==(null==v?void 0:v.scrollMode),class:"card-list",ref:t},b.map((e=>{if(e.defaultView){var t;let n=null==h||null===(t=h.values)||void 0===t?void 0:t.get(e.instance.id);n=n||new Map;const u=1===b.length&&"horizontal"===y&&"center"===(null==v?void 0:v.lastCardAlignment);return e.defaultView.nodes=Qc(e.defaultView.nodes),(0,Y.h)(ti,{key:e.instance.id,cardInstanceId:e.instance.id,containerInstanceId:f.application.containerInstanceId,theme:r,isPreview:i,animationState:c[e.instance.id],cardFeedOverlayDisplayed:f.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:n,customStrings:p,margin:d,centerAlign:u,accessibilityRole:"listitem",actions:e.actions,votingOptions:m,cardMinimumHeight:g,horizontalContainerConfig:v},e.defaultView.nodes.map((t=>(0,Y.h)(Uc,{cardInstanceId:e.instance.id,cardMetadata:e.metadata,node:t,isWorkflow:!1,theme:r,runtimeVariables:n,feedOrientation:y,embedMode:f.application.embedMode}))))}return null})))})),ii=qt("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())})),oi={settings:e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{fill:t,width:"18",height:"14",viewBox:"0 0 18 14"},(0,Y.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,Y.h)("svg",{stroke:t,width:"14",height:"12",viewBox:"0 0 14 12"},(0,Y.h)("path",{d:"M6 11L1 6M1 6L6 1M1 6L13 6","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},cross:Zr},ai=e=>{let{title:t,iconName:n,onClick:r,theme:i}=e;const o=oi[n];return(0,Y.h)(ii,{onClick:r,tabIndex:"0",ariaLabel:t,theme:i,className:`button-${n}`},(0,Y.h)(o,{fillColor:i.getCSSColor("text.navigationAction")}))},si=qt("div")((e=>{let{theme:t,feedOrientation:n}=e;return Object.assign({padding:"10px 20px 10px 15px",display:"flex",alignItems:"center",backgroundColor:t.getCSSColor("background.navigation"),zIndex:ws.HEADER,boxShadow:`0 ${t.getShape("offset.navigationShadow")} ${t.getShape("blur.navigationShadow")} ${t.getCSSColor("shadow.navigation")}`},"horizontal"===n?{padding:"10px"}:{})})),li=qt("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:{})})),ci=pr.forwardRef(((e,t)=>{let{theme:n,title:r,actionHandler:i,feedOrientation:o,alignment:a,inert:s}=e;return(0,Y.h)(si,{theme:n,feedOrientation:o,ref:t,inert:s},i&&(0,Y.h)(ai,{title:"Back",onClick:i,iconName:"arrowLeft",theme:n}),(0,Y.h)(li,{theme:n,feedOrientation:o,alignment:a},r))})),di=e=>{let{theme:t,title:n,actionHandler:r,inert:i}=e;return(0,Y.h)(si,{theme:t,inert:i},(0,Y.h)(li,{theme:t},n),r&&(0,Y.h)(ai,{title:"Close",onClick:r,iconName:"cross",theme:t}))},ui=qt("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:{})})),hi=qt("div")((e=>{let{feedOrientation:t}=e;return Object.assign({position:"absolute",bottom:"0",left:"0",right:"0",overflow:"hidden",pointerEvents:"none",zIndex:ws.TOAST},"horizontal"===t?{display:"flex",justifyContent:"center"}:{})})),pi=qt("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"))})),mi=qt("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"})})),gi=(e,t)=>new Promise((n=>{t(setTimeout((()=>{n()}),e))})),vi=e=>{var t;let{theme:n,feedOrientation:r,message:i,actionTitle:o,actionHandler:a,onDismiss:s,delay:l=0}=e;const[c,d]=te(!1),[h,p]=te(""),[m,g]=te(null),[v,f]=te(""),b=null==i?void 0:i.messageId,y="Try again"===o,w=(null===(t=u().getState().application.enabledUiElements.toastConfig)||void 0===t?void 0:t.timeout)||2e3;re((()=>{null!=(null==i?void 0:i.messageId)&&h!=i.messageId&&(p(i.messageId),i.text&&f(i.text),null!=m&&(clearTimeout(m),g(null)),gi(l,g).then((()=>(d(!0),gi(w+600,g)))).then((()=>(d(!1),gi(600,g)))).then((()=>{s&&(s(),f(""))})))}),[b]);const S=()=>{d(!1),a?a():f("")},k=e=>{const t=e.keyCode;13!==t&&32!==t||S()};return(0,Y.h)(hi,{id:"action-cards-sdk-toast-wrapper",class:"floating",feedOrientation:r},void 0!==i&&(0,Y.h)(ui,{id:"toast-body",theme:n,feedOrientation:r,hasRetry:y,onClick:y?void 0:S,onKeyUp:y?void 0:k,tabIndex:c&&!y?0:-1,class:c?"visible":"",role:c?"alert":void 0},(0,Y.h)(pi,{theme:n,class:"toast-message"},v||""),y&&(0,Y.h)(mi,{theme:n,class:"toast-action",hasRetry:y,onClick:y?S:void 0,onKeyUp:y?k:void 0,tabIndex:c&&y?0:-1},o)))},fi=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"79",height:"53",viewBox:"0 0 79 53",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.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,Y.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,Y.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,Y.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}))},bi=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"42",height:"42",viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.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,Y.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}))},yi=qt("div")((()=>({width:"100%",display:"flex",flexFlow:"column wrap",alignItems:"center",justifyContent:"center",minHeight:"250px"}))),wi=qt("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%"})})),Si=e=>{let{hasSeenTutorial:t,tutorialMessage:n,emptyMessage:r,theme:i}=e;return(0,Y.h)(yi,null,t?(0,Y.h)(Y.Fragment,null,(0,Y.h)(bi,{fillColor:i.getCSSColor("icon.listEmptyState")}),(0,Y.h)(wi,{theme:i},r||"All caught up")):(0,Y.h)(Y.Fragment,null,(0,Y.h)(fi,{fillColor:i.getCSSColor("icon.listEmptyState")}),(0,Y.h)(wi,{theme:i},n||"Cards will appear here when there’s something to action.")))},ki=e=>{let{title:t,textColor:n,buttonColor:r,theme:i,onRetry:o,tryAgainTitle:a}=e;return(0,Y.h)(Y.Fragment,null,(0,Y.h)(xi,{textColor:n,theme:i},t),(0,Y.h)(Ii,{textColor:r,theme:i,onClick:o},null!=a?a:"Try again"))},Ci=qt("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 ${Qt}`}})),xi=qt("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"})})),Ii=qt("button")((e=>{let{textColor:t,theme:n}=e;return Object.assign({color:(null==n?void 0:n.getCSSColor("text.errorOverlayAction"))||t,font:`16px ${Qt}`,background:"transparent",border:"0",outline:"none",fontWeight:"bold",cursor:"pointer"},(null==n?void 0:n.getCSSFontProperties("errorOverlayAction"))||{})})),Oi=e=>{let{embedMode:t,state:n,onRetry:r,loadingIconColor:i,textColor:o,buttonColor:a,backgroundColor:s,theme:l,noInternetConnectionMessage:c,dataLoadFailedMessage:d,tryAgainTitle:u}=e;return"single-card"===t||"preview"===t||"modal-subview"===t?null:(0,Y.h)(Ci,{background:s,className:"loading-wrapper",embedMode:t},!n&&(0,Y.h)(sn,{stopColor:(null==l?void 0:l.getCSSColor("icon.loadingSpinner"))||i||"#000000",size:32}),"apiError"===n&&(0,Y.h)(ki,{title:null!=d?d:"Couldn't load data",textColor:o,buttonColor:a,theme:l,onRetry:r,tryAgainTitle:u}),"noInternet"===n&&(0,Y.h)(ki,{title:null!=c?c:"No internet connection",textColor:o,buttonColor:a,theme:l,onRetry:r,tryAgainTitle:u}))};let Ti;!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"}(Ti||(Ti={}));const Mi=(0,Y.createContext)({cardEventDispatcher:{dispatchCardEvent:e=>{}},analyticsDispatcher:{sendEvent:e=>{}},authTokenProvider:{requestToken:()=>Promise.resolve(void 0)},runtimeVariableResolver:void 0});var Fi=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",Di=qt("div")((e=>{let{theme:t,rendersBackground:n}=e;return{display:"flex",flexDirection:"column",height:"100%",backgroundColor:n?t.getCSSColor("background.default"):"transparent"}})),Ai=qt("div")((e=>{let{embedMode:t}=e;return{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",zIndex:ws.FEED_OVERLAY,backgroundColor:"rgba(0, 0, 0, 0.4)",borderRadius:"launcher"===t?"20px":"0"}})),_i=qt("div")((e=>{let{embedMode:t}=e;return{width:"100%",position:"absolute",top:"0px",left:"0px",zIndex:ws.CUSTOM_HEADER,overflow:"hidden",borderRadius:"launcher"===t?"20px 20px 0 0":"0"}})),Ei=qt("div")((e=>{let{scrollPosition:t,scrollbarWidth:n,headerOffset:r}=e;return{width:"100%",marginTop:`${r}px`,paddingRight:`${n}px`,transform:`translateY(-${t}px)`}})),Li=qt("div")((e=>{let{embedMode:t,feedOrientation:n,headerPadding:r}=e;return Object.assign(Object.assign(Object.assign({padding:"single-card"===t?"0px":"10px 10px 0 10px"},r?{paddingTop:`${r+10}px`}:{}),{overflowX:"hidden",overflowY:"auto",maxHeight:"100%",height:"standalone"===t?"100%":"auto",position:"relative",overflowAnchor:"none"}),"horizontal"===n?{padding:"0",overflowY:"auto"}:{})})),Hi=qt("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:{})})),Pi={scrollTop:0,lastScrollTimeout:null,lastCardIds:[]},Ri=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},Vi=t=>{let{theme:n,onRetry:r}=t;const i=oe(null),o=oe(null),a=oe(null),s=oe(null),l=oe(null),[c,d]=te(0),[h,p]=te(0),m=le(Mi),g=m.analyticsDispatcher,v=m.cardEventDispatcher,f=m.authTokenProvider;return re((()=>(l.current=new IntersectionObserver(((e,t)=>{const n=ld();let r=[];e.forEach((e=>{if(e.isIntersecting){const t=e.target.id;n.add(t),Pi.lastCardIds.includes(t)||r.push(t)}})),r.forEach((e=>{const t=u().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:Xe},n?{properties:n}:{}))}));const i=JSON.stringify(Array.from(n));sessionStorage.setItem(S,i),Pi.lastCardIds=r}),{root:null,rootMargin:"0px",threshold:0}),()=>{var e;null===(e=l.current)||void 0===e||e.disconnect()})),[]),(0,Y.h)(me.lj,{actions:(0,e.Y2)($e,ge,Pt)},(e=>{var t,u,m,b,y,w,S,k,C,x;const I="preview"===e.application.embedMode,O="single-card"===e.application.embedMode,T="single-card"!==e.application.embedMode,M=("standalone"===e.application.embedMode||"launcher"===e.application.embedMode)&&e.cardFeed.displayingOverlay,F=e.application.enabledUiElements,j=e.cardFeed.horizontalContainerConfig,D=!("standalone"===e.application.embedMode&&(null==j?void 0:j.enabled)&&"shrink"===(null==j?void 0:j.emptyStyle)),A=sd(j),_=e.cardFeed.cardInstances.length,E="horizontal"===A&&F.cardListHeader&&"left"===(null==j?void 0:j.headerAlignment)&&(null!==(t=null===(u=o.current)||void 0===u||null===(m=u.base)||void 0===m?void 0:m.scrollHeight)&&void 0!==t?t:0)/2,L=()=>{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 re((()=>{e.application.open&&L()}),[e.cardFeed.updateId]),re((()=>{e.application.open&&(Pi.lastCardIds=[],L(),g.sendEvent({cardViewState:"topview",eventName:rt,properties:{displayMode:O?"single":"stream"}}))}),[e.application.open]),re((()=>{var e,t;p(null==o||null===(e=o.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.scrollHeight)}),[o]),re((()=>{const t=window.frameElement,r=n.getCSSColor("background.default");D||(t.style.backgroundColor=r);const i=()=>{"visible"===document.visibilityState&&e.application.open&&L()};return window.addEventListener("visibilitychange",i),()=>{window.removeEventListener("visibilitychange",i)}}),[]),re((()=>{Pi.lastCardIds=[];let e=e=>{let t=!1;t||(window.requestAnimationFrame((()=>{var n;const r=e.target;!1!==(null===(n=F.customContainerHeader)||void 0===n?void 0:n.scrollHeader)&&d(r.scrollTop),t=!1})),t=!0),Pi.scrollTop=e.target.scrollTop};return i.current&&i.current.base&&(i.current.base.scrollTop=Pi.scrollTop,i.current.base.addEventListener("scroll",e)),()=>{i.current&&i.current.base&&(Pi.scrollTop=i.current.base.scrollTop,i.current.base.removeEventListener("scroll",e))}}),[]),(0,Y.h)(Di,{theme:n,id:ji,rendersBackground:T},M&&(0,Y.h)(Ai,{class:"use-offset",embedMode:e.application.embedMode}),T&&F.cardListHeader&&(0,Y.h)(ci,{title:e.application.customStrings.cardListTitle||"Cards",theme:n,feedOrientation:A,ref:o,alignment:null==j?void 0:j.headerAlignment}),F.customContainerHeader&&("standalone"===e.application.embedMode||"launcher"===e.application.embedMode)&&(0,Y.h)(_i,{embedMode:e.application.embedMode},(0,Y.h)(Ei,{ref:a,headerOffset:h,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:c,dangerouslySetInnerHTML:{__html:null===(k=document.getElementById("custom-container-header"))||void 0===k?void 0:k.innerHTML}})),(0,Y.h)(Li,{embedMode:e.application.embedMode,feedOrientation:A,headerPadding:null==a||null===(C=a.current)||void 0===C||null===(x=C.base)||void 0===x?void 0:x.scrollHeight,ref:i,cardCount:_,id:"action-cards-sdk-card-container",class:"card-container",role:"list"},!e.cardFeed.status.loaded&&(0,Y.h)(Oi,{embedMode:e.application.embedMode,state:e.cardFeed.status.errorState,backgroundColor:"transparent",theme:n,onRetry:r,noInternetConnectionMessage:e.application.customStrings.noInternetConnectionMessage,dataLoadFailedMessage:e.application.customStrings.dataLoadFailedMessage,tryAgainTitle:e.application.customStrings.tryAgainTitle}),e.cardFeed.status.loaded&&_>0&&(0,Y.h)(ri,{cardInstances:e.cardFeed.cardInstances,theme:n,isPreview:I,onDismiss:t=>Fi(void 0,void 0,void 0,(function*(){Gs(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&&el(n,e,g,v,t.source)},removeCard:t=>{e.removeCard(t)},cardStates:e.cardStates,margin:O?0:10,runtimeVariables:e.cardFeed.runtimeVariables,customStrings:e.application.customStrings,votingOptions:e.cardFeed.cardVoting,cardMinimumHeight:e.cardFeed.cardMinimumHeight,horizontalContainerConfig:j,ref:s}),e.cardFeed.status.loaded&&0===_&&!O&&D&&(0,Y.h)(Hi,{embedMode:e.application.embedMode,feedOrientation:A,horizontalOffset:E,class:"empty-state-wrapper"},(0,Y.h)(Si,{theme:n,hasSeenTutorial:e.cardFeed.tutorialSeen,tutorialMessage:e.application.customStrings.awaitingFirstCard,emptyMessage:e.application.customStrings.allCardsCompleted}))),!e.application.isPreview&&!O&&!0===F.cardListToast&&!F.customToastContainer&&(0,Y.h)(vi,{theme:n,feedOrientation:A,message:e.messages.cardList,delay:Ri(e),actionTitle:e.messages.cardList&&["submit-failed","dismiss-failed","snooze-failed"].includes(e.messages.cardList.action)?"Try again":"Dismiss",actionHandler:()=>Fi(void 0,void 0,void 0,(function*(){var t,n,r,i,o,a,s,l,c,d;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":Xs(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===(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&&Gs(e,e,u,v,f,t);break;case"snooze-failed":const n=null===(c=e.messages.cardList)||void 0===c?void 0:c.snoozeDate,h=null===(d=e.messages.cardList)||void 0===d?void 0:d.source;n&&h&&Js(e,e,u,n,v,f,h)}})),onDismiss:()=>{e.clearMessage("cardList")}}))}))},$i=qt("div")((e=>{let{yOffset:t}=e;return{position:"absolute",top:`${t}px`,left:"0",right:"0",zIndex:ws.BANNER,overflow:"hidden"}})),Ni=qt("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"}}})),Wi=qt("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"})})),zi=e=>{let{theme:t,message:n,yOffset:r,onDismiss:i}=e;const[o,a]=te(null),[s,l]=te(null),[c,d]=te(!1);return re((()=>{null!=n&&null!=n.text?(null!=s&&(clearTimeout(s),l(null)),null!=o&&(clearTimeout(o),a(null)),d(!0),l(setTimeout((()=>{d(!1),l(null),a(setTimeout((()=>{i&&i(),a(null)}),300))}),3300))):d(!1)}),[n]),(0,Y.h)($i,{theme:t,yOffset:r},(0,Y.h)(Ni,{theme:t,class:`${c?"visible":""} ${o?"animating":""}`},(0,Y.h)(Wi,{theme:t},n?n.text:"")))},Ui=qt("div")((e=>{let{theme:t,isPreview:n}=e;return{backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:n?"relative":"static"}})),qi=qt("div")((e=>{let{theme:t,isPreview:n}=e;return{background:t.getCSSColor("background.default"),position:"relative",bottom:n?"auto":"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"visible",padding:"0 20px",boxSizing:"border-box",display:"flex",flex:"1"}})),Bi=qt("div")({paddingTop:"10px"}),Yi={scrollTop:0,subviewId:""},Ki=t=>{let{theme:n}=t;const r=oe(null),i=le(Mi).analyticsDispatcher;return(0,Y.h)(me.lj,{actions:(0,e.Y2)(ge,Pt),mapToProps:e=>{const t=ke(e);return{containerInstanceId:e.application.containerInstanceId,cardStates:e.cardStates,customStrings:e.application.customStrings,subview:t&&Ce(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 s=t.subviews[o],{id:l}=t.instance,c=e.cardStates[l],d="modal-subview"===e.embedMode?di:ci;if(s){var a;let u=null===(a=e.runtimeVariables.values)||void 0===a?void 0:a.get(l);return u=u||new Map,re((()=>{var e;const t=()=>{let e=!1;e||(window.requestAnimationFrame((()=>{var t;const n=null==r||null===(t=r.current)||void 0===t?void 0:t.base;n&&(Yi.scrollTop=n.scrollTop,Yi.subviewId=o),e=!1})),e=!0)};return(null==r||null===(e=r.current)||void 0===e?void 0:e.base)&&(r.current.base.scrollTop=Yi.subviewId===o?Yi.scrollTop:0,r.current.base.addEventListener("scroll",t)),()=>{var e;(null==r||null===(e=r.current)||void 0===e?void 0:e.base)&&(r.current.base.scrollTop=Yi.subviewId===o?Yi.scrollTop:0,r.current.base.removeEventListener("scroll",t))}}),[]),re((()=>{i.sendEvent({cardInstanceId:l,cardViewState:"subview",eventName:at,properties:{subviewId:o,subviewTitle:ed(s.title,u),subviewLevel:1}})}),[o]),s.nodes=Qc(s.nodes),(0,Y.h)(Y.Fragment,null,(0,Y.h)(Ui,{theme:n,id:ji,isPreview:e.isPreview},(0,Y.h)(Ws,{viewState:"subview",onCancelUpload:()=>{window.AtomicUploadService.cancelUploadForCard(e.containerInstanceId,l),Vt().finishCardFileUpload(l),!window.AtomicUploadService.getIsUploadingStatus(e.containerInstanceId)&&Vt().setCardFeedOverlay(!1)},theme:n,renderOverlay:"uploading-files"===c}),(0,Y.h)(d,{title:ed(s.title,u),theme:n,actionHandler:()=>{e.navigateBack(),i.sendEvent({cardInstanceId:l,cardViewState:"subview",eventName:st,properties:{subviewId:o,subviewTitle:ed(s.title,u),subviewLevel:1}})},inert:"uploading-files"===c}),(0,Y.h)(qi,{theme:n,ref:r,isPreview:e.isPreview,class:"use-offset",id:"action-cards-subview-container",inert:"uploading-files"===c},(0,Y.h)(Bi,{class:"offset-child"},s.nodes.map((r=>(0,Y.h)(Uc,{cardInstanceId:l,cardMetadata:t.metadata,node:r,isWorkflow:!0,theme:n,runtimeVariables:u,subviewId:o,subviewTitle:ed(s.title,u),embedMode:e.embedMode})))))),!e.isPreview&&(0,Y.h)(zi,{theme:n,message:e.bannerMessage,yOffset:60,onDismiss:()=>{e.clearMessage("subview")}}))}}return null}))},Zi=e=>{let{fillColor:t,ariaHidden:n=!1}=e;return(0,Y.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,Y.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,Y.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 Qi extends Y.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 dn;case"video":case"videoWithoutSrc":return Zi;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===Mr&&this.props.onClickImage&&(this.props.onClickImage(),e.preventDefault())}}const Gi=qt("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column"}})),Xi=qt("div")({width:"100%",height:"100%",maxWidth:"100%",minHeight:"420px",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}),Ji=qt("div")((e=>{let{autoSizes:t}=e;return{overflow:"auto",flexGrow:t?"0":"1",height:t?"auto":"100%",display:"flex",flexDirection:"column",width:"100%"}})),eo=qt("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"}})),to=qt("video")({maxWidth:"100%"}),no=qt("img")({maxWidth:"100%",flexShrink:"0"});class ro extends Qi{render(){const{theme:e,src:t,label:n,alt:r}=this.props,{imageLoaded:i}=this.state;return(0,Y.h)(Y.Fragment,null,!i&&(0,Y.h)(eo,{imageLoaded:i,theme:e},(0,Y.h)(dn,{fillColor:e.getCSSColor("icon.mediaBanner"),ariaHidden:!0})),i&&(0,Y.h)(no,{src:t,alt:r||n}))}}const io=e=>{var t,n;let{src:r,alt:i,cardInstanceId:o}=e;const a=oe(null),s=le(Mi).analyticsDispatcher,l="string"==typeof r&&null!==(t=null===(n=r.match(/[^\/]*$/))||void 0===n?void 0:n[0])&&void 0!==t?t:"";return re((()=>{var e,t,n,i;const c=()=>{s.sendEvent({eventName:ct,cardInstanceId:o,cardViewState:"subview",properties:{media:l,mediaURL:r}})},d=()=>{s.sendEvent({eventName:dt,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",c),null===(n=a.current)||void 0===n||null===(i=n.base)||void 0===i||i.addEventListener("ended",d),()=>{var e,t,n,r;null===(e=a.current)||void 0===e||null===(t=e.removeEventListener)||void 0===t||t.call(e,"play",c),null===(n=a.current)||void 0===n||null===(r=n.removeEventListener)||void 0===r||r.call(n,"ended",d)}}),[]),(0,Y.h)(to,{ref:a,src:r,alt:i||"video",autoplay:!0,controls:!0})},oo=e=>{let{theme:t}=e;return(0,Y.h)(me.lj,{actions:ge,mapToProps:e=>{const t=ke(e);return{embedMode:e.application.embedMode,cardInstanceId:null==t?void 0:t.cardInstanceId,currentMediaItem:t&&Oe(t)?t.item:void 0}}},(e=>{const n=e.currentMediaItem;if(!n)return null;const r="modal-subview"===e.embedMode?di:ci,i="launcher"===e.embedMode;return(0,Y.h)(Gi,{theme:t,id:ji},(0,Y.h)(r,{title:`View ${n.type}`,theme:t,actionHandler:e.navigateBack}),(0,Y.h)(Ji,{autoSizes:i},(0,Y.h)(Xi,{theme:t},"image"==n.type&&(0,Y.h)(ro,{mediaType:n.type,src:n.url,label:n.title,alt:n.alt,theme:t}),"video"==n.type&&(0,Y.h)(io,{src:n.url,alt:n.alt,cardInstanceId:e.cardInstanceId}))))}))};var ao=n(6083),so=n.n(ao),lo=n(9331),co=n.n(lo),uo=n(5932),ho=n.n(uo),po=n(4844),mo=n.n(po),go=n(4801),vo=n.n(go),fo=n(7754),bo=n.n(fo),yo=n(6254),wo=n.n(yo),So=n(5886),ko=n.n(So);const Co=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.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"}))},xo=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.h)("path",{d:"M6.16235 11L1.16235 6L6.16235 1",stroke:t,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},Io=qt("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())})),Oo=qt("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"}}})),To=qt("span")({fontSize:"15px"}),Mo=qt("span")({fontSize:"15px",fontWeight:"normal"}),Fo=e=>{var t,n;let{theme:r,month:i,year:o="",onBack:a,onForward:s,locale:l}=e;return(0,Y.h)(Oo,{theme:r},(0,Y.h)(Io,{theme:r,onClick:a,"aria-label":"previous month"},(0,Y.h)(xo,{fillColor:null!==(t=r.getCSSColor("background.datePickerCalendarMonthNavArrows",{skipFallback:!0}))&&void 0!==t?t:"rgba(0,0,0,0.5)"})),(0,Y.h)("h1",{className:"MonthDisplay","aria-live":"assertive"},(0,Y.h)(To,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,Y.h)(Mo,null,o)),(0,Y.h)(Io,{theme:r,onClick:s,"aria-label":"next month"},(0,Y.h)(Co,{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 Do=qt("button")((e=>{var t,n,r,i,o,a,s;let{isDisabled:l,isSelected:c,isToday:d,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";d&&!c?p=null!==(r=h.getCSSColor("text.datePickerCalendarCurrentDate",{skipFallback:!0}))&&void 0!==r?r:f:c?(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}})),Ao=e=>{let{theme:t,date:n,dateLabel:r,style:i,col:o,onSelect:a,onHover:s,onFocus:l}=e,c=jo(e,["theme","date","dateLabel","style","col","onSelect","onHover","onFocus"]);const d=oe(null);return(0,Y.h)(Do,{"data-testid":"calendar-day-button",ref:d,title:r,"aria-label":r,"aria-selected":c.isSelected?"true":"false","aria-disabled":c.isDisabled?"true":"false","aria-colindex":o,role:"gridcell",key:n,style:i,class:`CalendarDay ${Fe(c)}`,isToday:ko()(n),isDisabled:c.isDisabled,isSelected:c.isSelected,isFocused:c.isFocused,theme:t,tabIndex:"-1",onMouseDown:e=>{e.stopPropagation(),c.isDisabled||(d.current&&document.activeElement!==d.current&&d.current.base.focus(),a(n))},onMouseEnter:()=>{c.isDisabled||s(n)},onMouseLeave:()=>{c.isDisabled||s(null)},onFocus:()=>{c.isDisabled||l(n)}},n.getDate())},_o=qt("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`}}})),Eo=qt("div")({padding:"5px"}),Lo=qt("div")({}),Ho=qt("div")({display:"grid",gridTemplate:"auto / repeat(7, 1fr)"}),Po=qt("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"}})),Ro=qt("div")({display:"grid",gridTemplate:"auto / repeat(7, 1fr)","-ms-grid-rows":"auto","-ms-grid-columns":"(1fr)[7]",marginBottom:"5px"}),Vo=e=>{const{month:t,year:n,isDateHovered:r,isDateFocused:i,isDateSelected:o,isDateInRange:a,isDateEnabled:s,onDateFocused:l,onDateHovered:c,onDateSelected:d,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=je(t,n||0),y=e=>{let{date:t,style:n,col:u}=e;return(0,Y.h)(Ao,{key:t,theme:v,date:t,col:u,dateLabel:_e()(t,"dddd, MMMM D, YYYY"),style:n,isToday:ko()(t),isHovered:r(t),isFocused:i(t),isSelected:o(t),isInRange:a(t),isDisabled:m||!s(t),onSelect:d,onHover:c,onFocus:l})};return(0,Y.h)(_o,{theme:v},(0,Y.h)(Fo,{theme:v,month:t,year:n,onBack:u(-1),onForward:u(1),onChangeYear:h,locale:g,disabled:m}),(0,Y.h)(Eo,{className:"Calendar",role:"grid",ref:p,tabIndex:0,"aria-colcount":7,"aria-rowcount":6,"aria-label":"Calendar picker"},(0,Y.h)(Ro,{role:"row"},f.map((e=>{let{dayName:t,style:n,col:r}=e;return(0,Y.h)(Po,{key:t,theme:v,style:n,role:"columnheader","aria-colindex":r,"aria-label":t},(0,Y.h)("abbr",null,t.slice(0,1)))}))),(0,Y.h)(Lo,{role:"rowgroup"},(0,Y.h)(Ho,{role:"row","aria-rowIndex":1},b.week1.map(y)),(0,Y.h)(Ho,{role:"row","aria-rowIndex":2},b.week2.map(y)),(0,Y.h)(Ho,{role:"row","aria-rowIndex":3},b.week3.map(y)),(0,Y.h)(Ho,{role:"row","aria-rowIndex":4},b.week4.map(y)),(0,Y.h)(Ho,{role:"row","aria-rowIndex":5},b.week5.map(y)),(0,Y.h)(Ho,{role:"row","aria-rowIndex":6},b.week6.map(y)))))};function $o(){return $o=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},$o.apply(this,arguments)}const No="DatePicker",Wo="DateRangePicker";class zo extends Y.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,Y.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===Ur)return void(this.props.onCancel&&this.props.onCancel());e.preventDefault();const{shiftKey:r,key:i}=e,o=i===Vr,a=i===Nr,s=i===Wr,l=i===zr,c=i===Pr,d=i===Lr,u=i===Rr,h=i===Hr,p=i===$r,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=so()(g,-1);m(e)&&this.onDateFocused(e)}else if(r&&l){const e=so()(g,1);m(e)&&this.onDateFocused(e)}else if(s){const e=co()(g,-1);m(e)&&this.onDateFocused(e)}else if(l){const e=co()(g,1);m(e)&&this.onDateFocused(e)}else if(d){const e=ho()(g,-1);m(e)&&this.onDateFocused(e)}else if(h){const e=ho()(g,1);m(e)&&this.onDateFocused(e)}else if(c){const e=mo()(g,-1);m(e)&&this.onDateFocused(e)}else if(u){const e=mo()(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===No)n&&n(e);else if(t===Wo){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 vo()(e,this.state.focused)}isDateHovered(e){return vo()(e,this.state.hovered)}isDateSelected(e){return(this.props.type===No?[this.props.date]:[this.props.startDate,this.props.endDate]).some((t=>!!t&&vo()(t,e)))}isDateInRange(e){if(this.props.type===No)return!1;const{startDate:t,endDate:n}=this.props,{focused:r,hovered:i}=this.state,o=n||(t&&r&&!vo()(t,r)?r:i);return!(!t||!o||bo()(o,t))&&wo()(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,Y.h)(Vo,{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 Uo=e=>(0,Y.h)(zo,$o({type:No},e));function qo(){return qo=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},qo.apply(this,arguments)}const Bo=qt("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",marginBottom:"20px",overflow:"hidden",minWidth:"0",padding:`10px ${void 0!==i?i:20}px`,flexGrow:"1",cursor:r||"pointer"})})),Yo=e=>{let{nodeKey:t,children:n,mode:r,cursor:i,ref:o,theme:a,onClick:s,tabFocusable:l,innerRef:c,hPadding:d,accessibleAttributes:u}=e;const h=l?e=>{e.charCode===Mr&&s&&(e.preventDefault(),s())}:void 0;return(0,Y.h)("div",{ref:o},(0,Y.h)(Bo,qo({key:t,"data-element-key":t,mode:r,theme:a,cursor:i,class:"component-field-wrapper",onClick:s,onKeyPress:h,tabIndex:l?0:void 0,ref:c,hPadding:d},u),n))},Ko=qt("div")((e=>{let{thumbnailUrl:t,theme:n}=e;return{backgroundColor:n.getCSSColor("background.media"),borderRadius:n.getShape("borderRadius.media"),width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",marginRight:"10px",backgroundImage:`url(${t})`,backgroundSize:"cover",backgroundPosition:"center",alignSelf:"start"}})),Zo=e=>{let{thumbnailUrl:t,theme:n}=e;return(0,Y.h)(Ko,{thumbnailUrl:t,theme:n})},Qo=qt("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"}:{})})),Go=e=>{let{theme:t,children:n,mode:r,name:i,truncateLabel:o,inputHasValue:a}=e;return(0,Y.h)(Qo,{theme:t,mode:r,id:i,"aria-hidden":!n,truncateLabel:o,inputHasValue:a},n)},Xo=e=>{let{fillColor:t,ariaHidden:n,styles:r}=e;return(0,Y.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,Y.h)("path",{d:"M1 1L6 6L11 1",stroke:t,"stroke-opacity":"1","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))},Jo=qt("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({color:t.getCSSColor("text.error")},t.getCSSFontProperties("error")),{margin:"-10px 0 30px 0"})})),ea=e=>{let{theme:t,cardInstanceId:n,subviewId:r,name:i,variableResolver:o}=e;return(0,Y.h)(me.lj,{mapToProps:e=>{let{validationStates:t}=e;return{validationStates:t}}},(e=>{let{validationStates:a}=e;const s=a[n]||{};let l;var c,d,u;r?l=null===(c=s.subviews)||void 0===c||null===(d=c[r])||void 0===d?void 0:d[i]:l=null===(u=s.validations)||void 0===u?void 0:u[i];return l&&l.errorMessage?(0,Y.h)(Jo,{theme:t,role:"alert","data-testid":"validation"},o(l.errorMessage)):null}))},ta=qt("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"}:{})})),na=qt("div")((()=>({flex:"0 0 auto",alignItems:"center"}))),ra=qt("div")((()=>({"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none"}))),ia=qt("div")((e=>{let{open:t,openPosition:n,height:r,theme:i}=e;return Object.assign(Object.assign({position:"absolute",top:`${n}px`,left:t?"20px":"-999px",width:"calc(100% - 40px)",marginBottom:"20px",backgroundColor:"white",boxShadow:"0px 2px 10px 0px rgba(0, 0, 0, 0.2)",cursor:"pointer",height:`${r}px`,maxHeight:"335px",overflow:"auto",zIndex:ws.DROPDOWN,borderRadius:"5px",color:"black"},i.getCSSFontProperties("primary")),{visibility:t?"visible":"hidden"})})),oa=qt("div")((e=>{let{theme:t,disabled:n}=e;return Object.assign({padding:"20px",":hover":{backgroundColor:"rgba(0,0,0,0.05)"},":active":{backgroundColor:"rgba(0,0,0,0.1)"},border:"0px",color:n?"rgba(0,0,0,0.3)":"initial"},t.getElementFocusCSSProperties())})),aa=qt("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"}:{})})),sa=e=>{let{onClick:t,children:n,ref:r,theme:i,disabled:o,isSelected:a}=e;return(0,Y.h)(oa,{onClick:t,ref:r,tabIndex:"-1",theme:i,disabled:o,"aria-disabled":o,"aria-selected":a,role:"option"},n)},la=e=>{let{children:t,mode:n,theme:r,ariaLabel:i,placeholder:o}=e;return(0,Y.h)(aa,{theme:r,mode:n,class:"dropdown-selected-value",placeholder:o,"aria-label":i},t)},ca=(e,t,n,r)=>{var i,o,a,s,l,c;let d=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();d=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,d=r.top-n.top-p,u=d+t.offsetHeight,h=e.offsetHeight}}e.style.height="auto";const S=d-20+(m?m.scrollTop:0),k=h-u-20,C=S-(null!==(o=null===(l=m)||void 0===l?void 0:l.scrollTop)&&void 0!==o?o:0),x=(null!==(a=null===(c=m)||void 0===c?void 0:c.offsetHeight)&&void 0!==a?a:h)-C-20-t.offsetHeight,I=e.offsetHeight;e.style.height="";const O=t.offsetTop,T={openPosition:O+t.offsetHeight+10,height:I},M={openPosition:O-I-10,height:I};return I<=x?T:I<=C?M:I<=k?T:I<=S?M:{openPosition:O,height:Math.min(I,k+t.offsetHeight)}},da=pr.forwardRef(((e,t)=>{let{nodeKey:n,cardInstanceId:r,subviewId:i,embedMode:o,attributes:{format:a,defaultValue:s,thumbnailSrc:l,label:c,name:d,values:u,placeholder:h},validations:p,theme:m,variableResolver:g,onValueChanged:v}=e;const[f,b]=te(!1),[y,w]=te(0),[S,k]=te(0),[C,x]=te(s?g(s.toString()):null),[I,O]=te(-1),T=oe(null),M=oe(null),F=oe(null),j=oe(null),D=oe(s?g(s.toString()):null),A=u.find((e=>{let{value:t}=e;return C===t}));ae(t,(()=>({getCurrentValue:()=>C,setCurrentValue:e=>x(e)}))),re((()=>{const e=e=>{T.current&&!T.current.base.contains(e.target)&&(f&&Be().validateField(r,d,C,p),b(!1))},t=e=>{var t,n;(null==F||null===(t=F.current)||void 0===t||null===(n=t.base)||void 0===n?void 0:n.contains(document.activeElement))&&e.key===Nr&&(b(!1),M.current.base.focus())};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}})),re((()=>{if(v)v(C);else{const e=Ye(r,d,i);e?(D.current=e.toString(),x(e)):Be().handleFormChange(r,d,C,i)}F.current&&j.current&&(F.current.base.scrollTop=j.current.base.offsetTop)}),[]),re((()=>{const e=s?g(s.toString()):null;e!==D.current&&(C===D.current&&(v?v(e):Be().handleFormChange(r,d,e,i),x(e)),D.current=s?g(s.toString()):null)}),[s]),re((()=>{if(f){const e=u.findIndex((e=>C===e.value));O(Math.max(0,e))}else O(-1)}),[f]);const _=`dropdown-label-${d}`;return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(0,Y.h)(ra,null,(0,Y.h)(Yo,{nodeKey:n,ref:T,innerRef:M,mode:a,theme:m,tabFocusable:!0,accessibleAttributes:{role:"combobox","aria-haspopup":"listbox","aria-expanded":f,"aria-controls":`${d}-dropdown-body`,"aria-labelledby":_},onClick:()=>{if(T.current){const{openPosition:t,height:n}=ca(F.current.base,T.current.base,!!i,o);w(t),k(n),b((t=>(t&&e.validateField(r,d,C,p,i),!t)))}}},l&&(0,Y.h)(na,null,(0,Y.h)(Zo,{thumbnailUrl:g(l),theme:m})),(0,Y.h)(ta,{mode:a,theme:m},(0,Y.h)(Go,{theme:m,mode:a,name:_,truncateLabel:"inline"===a,inputHasValue:!!C},g(c)),(0,Y.h)(la,{theme:m,mode:a,placeholder:!A},A?A.title:g(h))),(0,Y.h)(Xo,{fillColor:m.getCSSColor("icon.dropdown"),styles:{flex:"0 0 auto"},ariaHidden:!0}),(0,Y.h)(ia,{ref:F,open:f,openPosition:y,theme:m,height:S,className:"dropdown-body",id:`${d}-dropdown-body`,role:"listbox"},(0,Y.h)(Kr,{defaultIndex:I,theme:m},u.map(((t,n)=>(0,Y.h)(sa,{onClick:()=>{t.disabled||(x(t.value),v?v(t.value):e.handleFormChange(r,d,t.value,i),e.validateField(r,d,t.value,p,i),M&&M.current&&M.current.base&&M.current.base.focus(),O(n))},ref:t.value===C?j:null,theme:m,disabled:t.disabled,isSelected:t.value===C},t.title)))))),(0,Y.h)(ea,{name:d,cardInstanceId:r,subviewId:i,theme:m,variableResolver:g}))))})),ua=qt("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"})})),ha=qt("div")((()=>({flex:"0 0 auto",alignItems:"center"}))),pa=qt("div")((()=>({"-webkit-user-select":"none","-moz-user-select":"none",userSelect:"none"}))),ma=e=>{var t,n,r,i,a,s,l,c,d,u,h,m;let{nodeKey:g,cardInstanceId:v,subviewId:f,attributes:{format:b,defaultValue:y,thumbnailSrc:w,label:S,name:k,placeholder:C},controlledDateValidator:x,validations:I,theme:O,variableResolver:T,onValueChanged:M,embedMode:F}=e;const j=y?new Date(y):void 0,D=oe(j?(0,o.addMinutes)(j,j.getTimezoneOffset()):null),[A,_]=te(!1),[E,L]=te(0),[H,P]=te(0),[R,V]=te(D.current),$=oe(null),N=oe(null),W=oe(null),z=(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===(a=I.minimumDate)||void 0===a||null===(s=a.attributes)||void 0===s?void 0:s.minimumDate)?new Date(null==I||null===(l=I.minimumDate)||void 0===l||null===(c=l.attributes)||void 0===c?void 0:c.minimumDate):void 0,q=new Date;let B=new Date;if(z&&U){if(!(q<=z&&q>=U)){B=Math.abs((0,o.differenceInSeconds)(q,z))<Math.abs((0,o.differenceInSeconds)(q,U))?z:U}}else if(U){q>=U||(B=U)}else if(z){q<=z||(B=z)}const K=R?new Date(R):new Date(B);K.setHours(0,0,0,0);const Z=()=>{A&&Be().validateField(v,k,R,I,f),_(!1)};let Q;re((()=>{const e=e=>{W.current&&!W.current.base.contains(e.target)&&$.current&&!$.current.base.contains(e.target)&&Z()};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}})),re((()=>{const e=R?R.toISOString():void 0,t=R?_e()(R,p):null;if(M)M(e);else{const e=Ye(v,k,f);e?(D.current=new Date(e),V(e)):Be().handleFormChange(v,k,t,f)}}),[]),re((()=>{var e;const t=y?new Date(y):void 0,n=t?(0,o.addMinutes)(t,t.getTimezoneOffset()):null;if((null==n?void 0:n.toDateString())!==(null===(e=D.current)||void 0===e?void 0:e.toDateString())){if(R===D.current){const e=n?n.toISOString():void 0,t=n?_e()(n,p):null;M?M(e):Be().handleFormChange(v,k,t,f),V(n)}D.current=n}}),[y]),x?Q=x:((null==I||null===(d=I.maximumDate)||void 0===d||null===(u=d.attributes)||void 0===u?void 0:u.maximumDate)||(null==I||null===(h=I.minimumDate)||void 0===h||null===(m=h.attributes)||void 0===m?void 0:m.minimumDate))&&(Q=e=>{var t,n,r,i;const o=null===(t=I.maximumDate)||void 0===t||null===(n=t.attributes)||void 0===n?void 0:n.maximumDate,a=null===(r=I.minimumDate)||void 0===r||null===(i=r.attributes)||void 0===i?void 0:i.minimumDate,s=o?De(o,{isMax:!0}):void 0,l=a?De(a,{isMin:!0}):void 0;return(!s||e<=s)&&(!l||e>=l)});const G=`datepicker-label-${k}`,X=R?_e()(R,"DD MMM YYYY"):T(C),J=()=>{N&&N.current&&N.current.base&&N.current.base.focus()};return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(0,Y.h)(pa,null,(0,Y.h)(Yo,{nodeKey:g,ref:$,innerRef:N,mode:b,theme:O,tabFocusable:!0,accessibleAttributes:{role:"button","aria-haspopup":"dialog","aria-expanded":A,"aria-labelledby":G},onClick:()=>{if($.current){const{openPosition:t,height:n}=ca(W.current.base,$.current.base,!!f,F);L(t),P(n),_((t=>(t&&e.validateField(v,k,R,I,f),!t)))}}},w&&(0,Y.h)(ha,{mode:b},(0,Y.h)(Zo,{thumbnailUrl:T(w),theme:O})),(0,Y.h)(ua,{mode:b,theme:O},(0,Y.h)(Go,{theme:O,mode:b,name:G,truncateLabel:"inline"===b,inputHasValue:!!R},T(S)),(0,Y.h)(la,{theme:O,mode:b,placeholder:!R,ariaLabel:X},X)),(0,Y.h)(Xo,{fillColor:O.getCSSColor("icon.dropdown"),styles:{flex:"0 0 auto"},ariaHidden:!0})),(0,Y.h)(ia,{ref:W,open:A,openPosition:E,theme:O,height:H},(0,Y.h)(Uo,{date:K,open:A,theme:O,onDateSelected:t=>{V(t);const n=t?_e()(t,p):void 0,r=t?t.toISOString():void 0;M?M(r):e.handleFormChange(v,k,n,f),e.validateField(v,k,r,I,f),_(!1),J()},onCancel:()=>{Z(),J()},isDateEnabled:Q})),(0,Y.h)(ea,{theme:O,name:k,cardInstanceId:v,subviewId:f,variableResolver:T}))))},ga=15,va=(0,o.startOfDay)(new Date),fa=e=>{let{cardInstanceId:t,attributes:{format:n,name:r,label:i,defaultValue:a},validations:s,theme:l,maxDateTime:c,selectedDate:d,selectedTime:u,isWorkflow:h,variableResolver:p,onValueChanged:m}=e;const g=new Date(a),[v,f]=te(""),b=oe(null),y=oe([...Array(96).keys()].map((e=>({title:(0,o.format)((0,o.addMinutes)(va,e*ga),"h:mm A"),value:""+e*ga,disabled:!1})))),w=e=>{let t="";return e.forEach((e=>{e.disabled||(t=e.value)})),t};re((()=>{if(d){const t=y.current.map(((e,t)=>{const n=(0,o.addMinutes)(d,t*ga);return e.disabled=!!(c&&n>=c),e}));if(y.current=t,u&&c){if((0,o.addMinutes)(d,u||0)>c){const t=w(y.current);var e;if(t)null==m||m(t),null===(e=b.current)||void 0===e||e.setCurrentValue(t)}}}}),[c,d]);return(0,Y.h)(da,{ref:b,attributes:{name:r,label:i,format:n,values:y.current,defaultValue:(()=>{const e=ba(g);if(c){var t;const n=(0,o.differenceInMinutes)(c,(0,o.startOfDay)(g)),r=w(y.current);if(g>c)return Number(r);if(e<n)return e;const i=(0,o.differenceInMinutes)(c,(0,o.startOfDay)(c));return f((0,o.format)((0,o.addMinutes)(va,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})},ba=e=>Math.ceil(((0,o.differenceInMinutes)(e,(0,o.startOfDay)(e))+5)/ga)*ga,ya=qt("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:"static"}})),wa=qt("div")((()=>({position:"static",top:"60px",bottom:"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"hidden",padding:"0 20px"}))),Sa=qt("div")({overflow:"auto",paddingTop:"10px","> button":{marginBottom:"20px"}}),ka=t=>{let{theme:n}=t;const r=le(Mi),i=r.analyticsDispatcher,a=r.cardEventDispatcher,s=r.authTokenProvider,[l,c]=te(void 0),[d,h]=te(0),p=new Date;return(0,Y.h)(me.lj,{actions:(0,e.Y2)(ge,Pt),mapToProps:e=>{const t=ke(e);let n,r,i;return t&&xe(t)&&(n=t.cardInstanceId,r=t.source,i=t.cardExpiry),{screenTitle:e.application.customStrings.cardSnoozeTitle||"Remind me",embedMode:e.application.embedMode,snoozeCardInstanceId:n,source:r,snoozeCardExpiry:i}}},(e=>{const[t,r]=te(p),[m,g]=te(0),v=e.snoozeCardInstanceId,f=e.snoozeCardExpiry,b=e.source;if(!v||!b)return null;const y=e.screenTitle,w="modal-subview"===e.embedMode?di:ci;re((()=>{i.sendEvent({eventName:it,cardInstanceId:v,cardViewState:"subview"})}),[]);return(0,Y.h)(ya,{theme:n,id:ji},(0,Y.h)(w,{title:y,theme:n,actionHandler:()=>{i.sendEvent({eventName:ot,cardInstanceId:v,cardViewState:"subview"}),e.navigateBack()}}),(0,Y.h)(wa,{class:"use-offset"},(0,Y.h)(Sa,{class:"offset-child"},(0,Y.h)(ma,{cardInstanceId:v,attributes:{name:"snoozeDate",label:"Date",defaultValue:_e()(p,"YYYY-MM-DD[T]00:00:00.000[Z]"),format:"inline"},isWorkflow:!0,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{r(new Date(e))},controlledDateValidator:f?e=>{if(f){return e<=new Date(f)}return!0}:void 0}),(0,Y.h)(fa,{attributes:{name:"snoozeTime",label:"Time",defaultValue:p.toISOString(),format:"inline"},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}),(0,Y.h)(il,{isWorkflow:!0,clickHandler:()=>()=>{const n=Ca(t,m);if((0,o.isPast)(n)){const e=d+1;h(e),c({text:"Date must be in the future",messageId:`${e}`,cardInstanceId:v,action:"other"})}else e.navigateBack(),Js(u().getState(),e,v,n,a,s,b)},text:"Done",theme:n,appearance:"primary"}))),(0,Y.h)(vi,{theme:n,message:l,actionTitle:"Dismiss",onDismiss:()=>{}}))}))},Ca=(e,t)=>(0,o.addMinutes)((0,o.startOfDay)(e),t);var xa=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 Ia=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,o.format)(t,e.defaultFormatterOption||"");default:return String(e.defaultValue)}},Oa=(e,t,n,r,i,o,a)=>xa(void 0,void 0,void 0,(function*(){const s=`feed/${e}${a?"?filters="+JSON.stringify(a):""}`,l=yield Td.get(s,t,r||"",{streamContainerId:e});if(304===l.response.status)return Qe.debug({level1:["Feed unchanged response received by HTTP"]}),{};if(200===l.response.status){Qe.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 ja(e,n,i);return{lastModified:l.response.etag,cardInstances:e,metadata:t,unfilteredCardInstanceCount:r,runtimeVariables:a}}return{error:l.response.error}})),Ta=(e,t,n,r)=>xa(void 0,void 0,void 0,(function*(){const i=yield Td.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}})),Ma=(e,t,n)=>xa(void 0,void 0,void 0,(function*(){const r=yield Td.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}})),Fa=(e,t,n,r)=>xa(void 0,void 0,void 0,(function*(){const i=yield Td.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}})),ja=(e,t,n)=>xa(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,Ia(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{}})),Da=()=>({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})}}),Aa=(e,t,n)=>({getTheme:r=>new Jt(e,r,t,n)});var _a=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 Ea="theme_cache",La=()=>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(Ea).createIndex("stream_container_id","stream_container_id",{unique:!0})}}));var Ha=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 Pa=(e,t)=>Ha(void 0,void 0,void 0,(function*(){const n=`theme/${e}`,{data:r,response:i}=yield Td.get(n,void 0,t,{streamContainerId:e});if(200===i.status){if(r&&r.theme){try{yield((e,t,n)=>_a(void 0,void 0,void 0,(function*(){const r=yield La();return new Promise(((i,o)=>{const a=r.transaction(Ea,"readwrite").objectStore(Ea).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}})),Ra=e=>Ha(void 0,void 0,void 0,(function*(){try{const t=yield(e=>_a(void 0,void 0,void 0,(function*(){const t=yield La();return new Promise(((n,r)=>{const i=t.transaction(Ea,"readonly").objectStore(Ea).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 Va extends Y.Component{componentDidCatch(e){this.props.onError?this.props.onError(e):console.error(e)}render(){return this.props.children}}const $a=e=>{let{fontFamilies:t}=e;return(0,Y.h)("style",{dangerouslySetInnerHTML:{__html:t.map((e=>Wa(e))).join("\n")}})},Na={ttf:"truetype",otf:"opentype",woff:"woff",woff2:"woff2"},Wa=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=Na[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 `},za=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"}),Ua=qt("textarea")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},za(t)),{resize:"none",boxSizing:"content-box",paddingLeft:"0px",paddingRight:"0px"})})),qa=qt("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({},za(n)),t?{lineHeight:`${t}px`}:{})})),Ba=(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 Ya=null;const Ka=pr.forwardRef(((e,t)=>{let{nodeKey:n,cardInstanceId:r,subviewId:i,attributes:{defaultValue:o,numberOfLines:a,name:s,thumbnailSrc:l,placeholder:c,maxLength:d},minimumLines:u,validations:h,theme:p,variableResolver:m,onValueChanged:g}=e;const v=oe(null),f=oe(o),[b,y]=te(m(o)),w=1===a?qa:Ua;re((()=>{const{current:{base:e}}=v;Ba(e,a,u)})),re((()=>{const e=Ye(r,s,i);e?(f.current=e,y(e)):Be().handleFormChange(r,s,b,i)}),[]),re((()=>{if(o!==f.current){if(b===m(f.current)){const e=m(o);y(e),Be().handleFormChange(r,s,e,i)}f.current=o}}),[o]);const S=m(c);return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(ae(t,(()=>({clearInput:()=>{y(""),v.current.base&&Ba(v.current.base,a),e.handleFormChange(r,s,"",i)}}))),(0,Y.h)(Y.Fragment,null,(0,Y.h)(Yo,{nodeKey:n,mode:"inline",theme:p},l&&(0,Y.h)(Zo,{thumbnailUrl:m(l),theme:p}),(0,Y.h)(w,{theme:p,ref:v,placeholder:S,value:b,maxlength:d,className:"input-text",onInput:t=>{const{current:{base:n}}=v,{value:o}=t.target;y(o),Ba(n,a),((e,t)=>{null!==Ya&&(clearTimeout(Ya),Ya=null),Ya=setTimeout((()=>{t(r,s,null!=e?e:void 0,h,i)}),200)})(o,e.validateField),e.handleFormChange(r,s,o,i),g&&g(o)},rows:"1"})),(0,Y.h)(ea,{name:s,cardInstanceId:r,subviewId:i,theme:p,variableResolver:m})))))})),Za=qt("div")((e=>{let{theme:t}=e;return Object.assign({padding:"10px 20px",display:"flex",width:"100%",alignItems:"center",border:"0px"},t.getElementFocusCSSProperties())})),Qa=qt("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"))})),Ga=qt("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%"}})),Xa=e=>{let{title:t,value:n,checked:r,onValueSelected:i,theme:o}=e;return(0,Y.h)(Za,{onClick:()=>{i(n)},role:"radio","aria-checked":r,theme:o,tabIndex:"-1"},(0,Y.h)(Qa,{theme:o},t),(0,Y.h)(Ga,{checked:r,theme:o}))},Ja=qt("div")((e=>{let{}=e;return{display:"flex",flexFlow:"column wrap",width:"100%"}})),es=qt("div")((e=>{let{}=e;return{display:"none"}})),ts=e=>{let{attributes:{items:t,title:n,name:r},theme:i,onValueChanged:o}=e;const[a,s]=te(null),l=`radio-group-${r}`;return(0,Y.h)(Yo,{mode:"inline",theme:i,hPadding:0},(0,Y.h)(es,{id:l},n),(0,Y.h)(Ja,{role:"radiogroup","aria-labelledby":l},(0,Y.h)(Kr,{theme:i},t.map((e=>(0,Y.h)(Xa,{title:e.title,value:e.value,theme:i,checked:a===e.value,onValueSelected:e=>{s(e),o&&o(e)}}))))))},ns=qt("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.default"),height:"100%",display:"flex",flexDirection:"column",position:"static"}})),rs=qt("div")((()=>({position:"static",top:"60px",bottom:"0px",width:"100%",flexDirection:"column",overflowY:"auto",overflowX:"hidden",padding:"0 20px"}))),is=qt("div")({overflow:"auto",paddingTop:"10px","> button":{marginBottom:"20px"}}),os=qt("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({color:t.getCSSColor("text.error")},t.getCSSFontProperties("error")),{margin:"-10px 0 30px 0"})})),as=t=>{let{theme:n}=t;const r=le(Mi),i=r.analyticsDispatcher,o=r.cardEventDispatcher,a=oe(),[s,l]=te(null),[c,d]=te(null),[u,h]=te(!1);return(0,Y.h)(me.lj,{actions:(0,e.Y2)(ge,Pt),mapToProps:e=>{const t=ke(e),n=t&&Ie(t)?t:void 0;return{embedMode:e.application.embedMode,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?di:ci,r=e.screenTitle,p=e.feedbackCardInstanceId,m=e.feedbackSource,g="positive"===e.feedbackSentiment&&e.textFeedback,v=[{title:"It's not relevant",value:"not-relevant"},{title:"I see this too often",value:"too-often"}];if(e.textFeedback&&v.push({title:"Something else",value:"other"}),!p||!m)return null;const f="positive"===e.feedbackSentiment?"Add optional feedback...":"Add your feedback...";return(0,Y.h)(ns,{theme:n,id:ji},(0,Y.h)(t,{title:r,theme:n,actionHandler:()=>{var t;d(null),null===(t=a.current)||void 0===t||t.clearInput(),e.navigateBack()}}),(0,Y.h)(rs,{class:"use-offset"},(0,Y.h)(is,{class:"offset-child"},"negative"===e.feedbackSentiment&&(0,Y.h)(ts,{attributes:{title:r,name:"feedback-reason",items:v},isWorkflow:!0,cardInstanceId:p,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{l(e)}}),("other"===s||g)&&(0,Y.h)(Y.Fragment,null,(0,Y.h)(Ka,{ref:a,attributes:{name:"feedback-message",defaultValue:"",placeholder:e.textFeedbackLabel&&e.textFeedbackLabel.length>0?e.textFeedbackLabel:f,numberOfLines:0,maxLength:280},minimumLines:3,isWorkflow:!0,cardInstanceId:p,theme:n,variableResolver:e=>e||"",onValueChanged:e=>{if(e.length>=280)return h(!0);h(!1),d(e)}}),u&&(0,Y.h)(os,{theme:n,"data-testid":"feedback-validation-error"},e.validationMessage)),(0,Y.h)(il,{isWorkflow:!0,clickHandler:()=>()=>{var t;if(!g&&null===s)return;if("other"===s&&(null===c||null==c||0===c.trim().length))return;const n="other"===s||g&&c?{message:c}:{};i.sendEvent({cardViewState:"topview",eventName:g?et:tt,cardInstanceId:p,properties:Object.assign(Object.assign({source:m},"negative"===e.feedbackSentiment||null!==c?{reason:g?"other":s}:{}),n)}),e.feedbackReceived(p),o.dispatchCardEvent({type:g?Ti.VOTED_USEFUL:Ti.VOTED_NOT_USEFUL}),d(null),null===(t=a.current)||void 0===t||t.clearInput(),e.navigateBack()},text:"Submit",theme:n,appearance:"primary"}))))}))};var ss=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 ls=()=>window.matchMedia("(prefers-color-scheme: dark)"),cs=qt("div")((e=>{let{theme:t}=e;return{backgroundColor:t.getCSSColor("background.toast")}})),ds=t=>{let{store:n,onAnalyticsEvent:r,onCardEvent:i,onAuthTokenRequested:o,onError:a}=t;const s=se((()=>({analyticsDispatcher:{sendEvent:(e,t)=>ss(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:()=>ss(void 0,void 0,void 0,(function*(){return yield o()}))},runtimeVariableResolver:void 0})),[r,i,o]);return(0,Y.h)(Va,{onError:a},(0,Y.h)(Mi.Provider,{value:s},(0,Y.h)(me.zt,{store:n},(0,Y.h)(me.lj,{actions:(0,e.Y2)(ge,Pt,$e,ge)},us))))},us=e=>{const{cardFeed:t,messages:n,themeLoading:r,themeLoaded:i,clearMessage:o,application:{interfaceStyle:a,streamContainerId:s},theme:l}=e,[c,d]=te(ls().matches?"dark":"light");if(re((()=>{!function(){ss(this,void 0,void 0,(function*(){const e=yield Ra(s);if(e)i({theme:e.theme}),Pa(s,e.eTag);else{r();const e=yield Pa(s);i(e)}}))}()}),[]),re((()=>{const e=e=>{d(e.matches?"dark":"light")};return ls().addEventListener("change",e),()=>{ls().removeEventListener("change",e)}}),[]),!l.status||!1===l.status.loaded)return null;const u=l.themePayload?Aa(l.themePayload,c,a):void 0;if(!u)return null;const h=u.getTheme("feed"),p=le(Mi),m=p.cardEventDispatcher,g=p.analyticsDispatcher,v=p.authTokenProvider;return(0,Y.h)(cs,{theme:h},(0,Y.h)(vi,{theme:h,feedOrientation:sd(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,c,d,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":Xs(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===(c=e.messages.cardList)||void 0===c?void 0:c.source;t&&Gs(e,e,h,m,v,t);break;case"snooze-failed":const n=null===(d=e.messages.cardList)||void 0===d?void 0:d.snoozeDate,r=null===(u=e.messages.cardList)||void 0===u?void 0:u.source;n&&r&&Js(e,e,h,n,m,v,r)}},onDismiss:()=>{o("cardList")},delay:500}))};function hs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ps;!function(e){e.STATE="state-update",e.ANALYTICS_EVENT="analytics-event-dispatched"}(ps||(ps={}));class ms{constructor(){hs(this,"channel",void 0),hs(this,"isOpen",!1),hs(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 Qe.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 Qe.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 Qe.error({level1:["BroadcastChannel API not supported in this browser"]});this.channel.postMessage(e)}close(){this.channel.close(),this.isOpen=!1}}var gs=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())}))},vs=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 bs=()=>window.matchMedia("(prefers-color-scheme: dark)"),ys=()=>window.getComputedStyle(document.documentElement).getPropertyValue("font-size"),ws={FEED_OVERLAY:"100",CARD_OVERLAY:"110",DROPDOWN:"40",HEADER:"30",BANNER:"20",TOAST:"11",OVERFLOW_MENU:"11",OVERFLOW_MENU_BUTTON:"10",CUSTOM_HEADER:"2"},Ss=qt("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%"}})),ks={fontFamily:'-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif',height:"100%",overflow:"hidden"},Cs=qt("div")((e=>{let{embedMode:t}=e;return"launcher"===t?Object.assign(Object.assign({},ks),{borderRadius:"20px",boxShadow:"0 2px 20px 0 rgba(0, 0, 0, 0.1)"}):Object.assign({},ks)})),xs=(pr.forwardRef(((t,n)=>{let{store:r,embedMode:i,applyCardFeedDeltaUpdates:o,cardCountChanged:a,onReady:s,runtimeVariableResolver:l,linkButtonPressed:c,submitButtonPressed:d,onCardListTutorialSeen:u,onAnalyticsEvent:h,onCardEvent:p,onError:m,onAuthTokenRequested:g,onCardFeedSubscribe:v,requestWebSocketReconnect:f,webSocketDisabled:b}=t;const[y,w]=te(bs().matches?"dark":"light"),[,S]=te(ys);re((()=>{const e=e=>{w(e.matches?"dark":"light")};bs().addEventListener("change",e);const t=()=>{S(ys)};return window.addEventListener("browser-font-changed",t),window.addEventListener("pageshow",(e=>{var t;e.persisted&&!(null===(t=k.containersBroadcastChannel)||void 0===t?void 0:t.isOpen)&&(k.containersBroadcastChannel=new ms)})),()=>{bs().removeEventListener("change",e),window.removeEventListener("browser-font-changed",t)}}),[]);const k=se((()=>({analyticsDispatcher:{sendEvent:(e,t)=>gs(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:()=>gs(void 0,void 0,void 0,(function*(){return yield g()}))},runtimeVariableResolver:l,containersBroadcastChannel:"BroadcastChannel"in window?new ms:void 0})),[h,p,g]),C=oe();return ae(n,(()=>({pollCardList:()=>{var e;Qe.debug({level3:["Card feed polling initiated"]}),null===(e=C.current)||void 0===e||e.loadCards(!1)},cancelCardListPolling:()=>{var e;null===(e=C.current)||void 0===e||e.cancelCardListPolling()}}))),"toast"===i?(0,Y.h)(ds,{store:r,onAuthTokenRequested:g}):(0,Y.h)(Va,{onError:m},(0,Y.h)(Mi.Provider,{value:k},(0,Y.h)(me.zt,{store:r},(0,Y.h)(me.lj,{actions:(0,e.Y2)(Pt,Da),mapToProps:e=>{const{cardResponses:t}=e;return vs(e,["cardResponses"])}},(e=>{let{cardFeed:t,pendingCardFeedUpdates:n,cardStates:r,navigationStack:i,cardFeedLoading:h,cardFeedLoaded:p,themeLoading:m,themeLoaded:g,finishExternalAction:w,application:{open:S,cardListRefreshInterval:k,streamContainerId:x,runtimeVariableResolutionTimeout:I,isPreview:O,embedMode:T,customStrings:M,cardLimit:F,firstLoadStyles:j,interfaceStyle:D},externalAction:A,theme:{themePayload:_}}=e;const E=i.items.length?i.items[i.items.length-1]:void 0;let L;switch(null==E?void 0:E.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,Y.h)(Ss,{embedMode:T,feedOrientation:sd(t.horizontalContainerConfig),id:"action-cards-sdk-app-root",class:"atomic-sdk-root","data-contentLabel":L},(0,Y.h)(Is,{ref:C,streamContainerId:x,runtimeVariableResolutionTimeout:I,runtimeVariablesResolver:l,themePayload:_,cardFeed:t,pendingCardFeedUpdates:n,cardStates:r,cardLimit:F,onThemeLoading:m,onThemeLoaded:g,onCardFeedLoading:h,onCardFeedLoaded:p,onCardFeedSubscribe:v,streamFilter:t.streamFilter,requestWebSocketReconnect:f,webSocketDisabled:b,currentNavigationItem:E,applicationOpen:S,onReady:s,onCardCountChanged:a,applyCardFeedDeltaUpdates:o,cardListRefreshInterval:k,isPreview:O,cardListTitle:M.cardListTitle,embedMode:T,externalAction:A,finishExternalAction:w,onLinkButtonPressed:c,onSubmitButtonPressed:d,cardListTutorialSeen:t.tutorialSeen,onCardListTutorialSeen:u,firstLoadStyles:j,colourScheme:y,interfaceStyle:D,noInternetConnectionMessage:M.noInternetConnectionMessage,dataLoadFailedMessage:M.dataLoadFailedMessage,tryAgainTitle:M.tryAgainTitle}))})))))})),e=>"modal-subview"!==e);class Is extends Y.Component{constructor(e){super(e),fs(this,"pollCounter",0),fs(this,"poll",void 0),this.poll=null}componentDidMount(){return gs(this,void 0,void 0,(function*(){this.props.onReady(),xs(this.props.embedMode)&&this.loadTheme()}))}componentWillUnmount(){this.cancelCardListPolling()}componentDidUpdate(t){var n,r;const{cardFeed:i,externalAction:o}=t,{cardFeed:a,pendingCardFeedUpdates:s,cardStates:l,onCardCountChanged:c,externalAction:d,embedMode:h}=this.props;if("modal-subview"===h||"toast"===h)return;const p=a.cardInstances.map((e=>e.instance.id)),m=i.cardInstances.map((e=>e.instance.id));var g;ud(p,m)&&(null===(n=i.metadata)||void 0===n?void 0:n.totalCards)===(null===(r=a.metadata)||void 0===r?void 0:r.totalCards)||this.poll&&c&&c(a.cardInstances.length,null===(g=a.metadata)||void 0===g?void 0:g.totalCards);if(!i.tutorialSeen&&a.tutorialSeen&&this.props.onCardListTutorialSeen&&this.props.onCardListTutorialSeen(),d&&d.actionId!==(null==o?void 0:o.actionId)&&this.handleExternalAction(d),i.runtimeVariables.updateId!==a.runtimeVariables.updateId&&this.trackRuntimeVariablesChanged(a),Object.values(l).every((e=>null===e))&&s&&s.length>0){const t=(0,e.kv)((0,e.Y2)(Pt,Da),u());this.props.applyCardFeedDeltaUpdates(t,s)}}trackRuntimeVariablesChanged(e){const t=this.context.analyticsDispatcher,n=!1===e.runtimeVariableAnalyticsEnabled;e.cardInstances.forEach((r=>{if(r.runtimeVariables&&r.runtimeVariables.values){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:nt,properties:{resolvedVariables:r.runtimeVariables.reduce(((e,t)=>(e[t.name]=(null==o?void 0:o.get(t.name))||"",e)),{})}},n)}}))}loadTheme(){return gs(this,void 0,void 0,(function*(){const{streamContainerId:e,onThemeLoading:t,onThemeLoaded:n}=this.props,r=yield Ra(e);if(r)n({theme:r.theme}),Pa(e,r.eTag);else{t();n(yield Pa(e))}const i=u().getState().theme.status;i&&i.loaded&&this.subscribeToCardFeedUpdates()}))}loadCards(e){return gs(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:c}=this.props;e||n();const d=yield Oa(i,t.authTokenProvider,o,a.lastModified,s,l,c);e&&d.error||r(d),u().getState().cardFeed.status.loaded&&this.pollForNewCards()}))}handleExternalAction(e){return gs(this,void 0,void 0,(function*(){const t=this.context,n=t.analyticsDispatcher,r=t.containersBroadcastChannel,i=()=>gs(this,void 0,void 0,(function*(){var t;return n.sendEvent({cardInstanceId:e.cardInstanceId,cardViewState:e.cardViewState,eventName:Je,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!==ps.ANALYTICS_EVENT)return;const a=null===(i=n.data)||void 0===i?void 0:i.eventQueued;a.eventName===Je&&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&&xs(n)&&(this.poll=setTimeout((()=>gs(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,Qe.debug({level3:["Attempt to reconnect websocket initiated"]}),this.props.requestWebSocketReconnect())}))),t))}cancelCardListPolling(){this.poll&&Qe.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:c,tryAgainTitle:d}=e;const h=u().getState(),p="modal-subview"===r;if(!h.theme.status)return p?null:(0,Y.h)(Cs,{embedMode:r,id:ji});if(!1===h.theme.status.loaded)return p?null:(0,Y.h)(Cs,{embedMode:r,id:ji},(0,Y.h)(Oi,{embedMode:r,textColor:o.textColor,loadingIconColor:o.loadingSpinnerColor,buttonColor:o.buttonTextColor,backgroundColor:o.backgroundColor,onRetry:()=>{this.loadTheme()},state:h.theme.status.errorState,noInternetConnectionMessage:l,dataLoadFailedMessage:c,tryAgainTitle:d}));const{applicationOpen:m,themePayload:g}=this.props;let v;v="standalone"===r&&(null===(t=i.horizontalContainerConfig)||void 0===t?void 0:t.enabled)||"single-card"===r?"feed":Oe(n)?"media":Ce(n)?"subview":xe(n)?"snooze":Ie(n)?"feedback":p?void 0:"feed";const f=g?Aa(g,a,s):void 0;if(!v||!f)return null;const b=f.getTheme("feed"),y=f.getTheme("workflow");return(0,Y.h)(Y.Fragment,null,(0,Y.h)(Cs,{theme:b,visible:m,embedMode:r,className:"feed-container",role:"main"},"subview"===v&&(0,Y.h)(Ki,{theme:y}),"media"===v&&(0,Y.h)(oo,{theme:y}),"feed"===v&&(0,Y.h)(Vi,{theme:b,onRetry:()=>(this.props.onCardFeedLoading(),this.subscribeToCardFeedUpdates())}),"snooze"===v&&(0,Y.h)(ka,{theme:y}),"feedback"===v&&(0,Y.h)(as,{theme:y})),(0,Y.h)($a,{fontFamilies:b.getFontFamilies()}),(0,Y.h)(ln,null))}}fs(Is,"contextType",Mi);const Os=Bt({to:{opacity:"0"}}),Ts=Bt({to:{opacity:"1"}}),Ms=Bt({to:{opacity:"1",width:"400%",paddingTop:"400%"}}),Fs=Bt({to:{opacity:"0",transform:"scale(0.9)"}}),js=Bt({from:{opacity:"1",transform:"scale(1)"},to:{opacity:"0",transform:"scale(0)"}}),Ds=Bt({to:{transform:"translateX(-120%)"}}),As=Bt({from:{left:"100%"},to:{left:"50%"}}),_s=Bt({from:{},to:{height:"0px"}}),Es=Bt({from:{},to:{width:"0px"}}),Ls=e=>{let{theme:t,animationState:n}=e;return(0,Y.h)(Y.Fragment,null,(0,Y.h)(zs,{theme:t,class:n,"aria-hidden":"true"}),(0,Y.h)(Mn,{fillColor:t.getCSSColor("icon.cardCompletion"),className:"tick-icon",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},"aria-hidden":!0}))},Hs=e=>{let{animationState:t,theme:n}=e;return(0,Y.h)(Y.Fragment,null,(0,Y.h)("div",{class:`${t||""} dismiss-icon`,style:{background:n.getCSSColor("background.quickActionPrimary")},"aria-hidden":"true"},(0,Y.h)(Fn,{style:{fill:n.getCSSColor("icon.quickActionPrimary")}})),(0,Y.h)("div",{class:`${t||""} clock-icon`,style:{background:n.getCSSColor("background.quickActionSecondary")},"aria-hidden":"true"},(0,Y.h)(jn,{style:{fill:n.getCSSColor("icon.quickActionSecondary")}})))},Ps=qt("div")((e=>{let{theme:t,topAlign:n,viewState:r,useHorizontalStyles:i}=e,o="rgba(255,255,255,1)";"subview"===r?o=(rn(t.getCSSColor("background.default")),t.getCSSColor("background.default")):rn(t.getCSSColor("background.card"))&&!rn(t.getCSSColor("background.default"))?o=t.getCSSColor("background.default"):rn(t.getCSSColor("background.card"))||(o=t.getCSSColor("background.card")),o=(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 Qe.warn({level3:["Expected a valid RGBA color string, but received:",e,"Returning the original value."]}),e})(o);return Object.assign(Object.assign({position:"absolute",top:"0",left:"0",right:"0",bottom:"0",zIndex:ws.CARD_OVERLAY,padding:"15px 10px",backgroundColor:o,border:`${t.getShape("border.card")} solid ${t.getCSSColor("border.card")}`,borderRadius:t.getShape("borderRadius.card")},n?{}:{display:"flex"}),i?{marginLeft:"10px",marginBottom:"10px"}:{})})),Rs=qt("div")((e=>{let{topAlign:t}=e;return Object.assign({width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden"},t?{marginTop:"15vh"}:{})})),Vs=qt("div")({}),$s=qt("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})||{})})),Ns=qt("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})||{})})),Ws=e=>{let{viewState:t,onCancelUpload:n,theme:r,renderOverlay:i}=e;return i?(0,Y.h)(me.lj,{mapToProps:e=>{var t;const n=ke(e),r=n&&Ce(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,o,a,s;const l=oe(null),c=oe(null),d=oe(null),u=oe(null),[h,p]=te(0),m=null!==(i=null===(a=e.customStrings)||void 0===a?void 0:a.processingStateMessage)&&void 0!==i?i:"Sending, please wait...",g=null!==(o=null===(s=e.customStrings)||void 0===s?void 0:s.processingStateCancelButtonTitle)&&void 0!==o?o:"Cancel process";if(re((()=>{var e,t,n,r,i,o,a,s;const h=null===(e=l.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.clientHeight,m=null===(n=c.current)||void 0===n||null===(r=n.base)||void 0===r?void 0:r.clientHeight,g=null===(i=d.current)||void 0===i||null===(o=i.base)||void 0===o?void 0:o.clientHeight,v=null===(a=u.current)||void 0===a||null===(s=a.base)||void 0===s?void 0:s.clientHeight;if(h&&m&&g&&v){const e=h-m-v-30-20-15,t=parseFloat(getComputedStyle(d.current.base).lineHeight),n=Math.floor(e/t);p(n)}}),[m,g]),"single-card"===e.embedMode&&e.presentingSubview)return null;if("standalone"===e.embedMode&&e.horizontalStreamContainer&&e.presentingSubview)return null;const v="subview"===t&&"standalone"===e.embedMode;return(0,Y.h)(Ps,{theme:r,class:"subview"===t?"use-offset":"",topAlign:v,viewState:t,useHorizontalStyles:e.horizontalStreamContainer&&!e.presentingSubview},(0,Y.h)(Rs,{ref:l,theme:r,topAlign:v},(0,Y.h)(Vs,{ref:c},(0,Y.h)(sn,{stopColor:r.getCSSColor("icon.processingStateSpinner"),size:30})),(0,Y.h)($s,{ref:d,theme:r,maxLines:Math.max(1,h)},m),(0,Y.h)(Ns,{ref:u,theme:r,onClick:n},g)))})):null},zs=qt("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:`${Ms} 0.6s ease 0.2s forwards`},".submitted":{animation:`${Ms} 0s ease forwards`},".submitted-subview":{animation:`${Ms} 0.6s ease 0.2s forwards`}}})),Us=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"vertical";return{cardCompletion:{" .tick-icon":{opacity:"0"},".submitting":{overflow:"hidden",padding:"11px 21px"},".submitting .tick-icon":{animation:`${Ts} 0.2s ease 0.2s forwards`},".submitting .card-nodes":{animation:`${Os} 0.2s ease forwards`},".submitted":Object.assign(Object.assign(Object.assign({},"vertical"===e?{animation:`${Fs} 0.4s ease forwards`}:{}),{overflow:"hidden"}),"horizontal"===e?{transform:"translateX(-120%)",opacity:"0"}:{}),".submitted .tick-icon":{animation:`${Ts} 0.2s ease forwards`},".submitted .card-nodes":{opacity:"0"},".submitted-subview":Object.assign({animation:`${Fs} 0.4s ease 0.8s forwards`,overflow:"hidden"},"horizontal"===e?{transform:"translateX(-120%)",opacity:"0"}:{}),".submitted-subview .tick-icon":{animation:`${Ts} 0.2s ease 0.2s forwards`},".submitted-subview .card-nodes":{animation:`${Os} 0.2s ease forwards`}},dismissal:{".dismissing":{animation:"vertical"===e?`${Ds} 0.4s ease forwards`:`${Os} 0.3s ease forwards`},".dismissed":Object.assign({transform:"translateX(-120%)"},"horizontal"===e?{animation:`${_s}`,opacity:"0"}:{})},snooze:{".snoozing":{animation:"vertical"===e?`${Ds} 0.4s ease forwards`:`${Os} 0.3s ease forwards`},".snoozed":Object.assign({transform:"translateX(-120%)"},"horizontal"===e?{animation:`${_s}`,opacity:"0"}:{})}}},qs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"vertical";return{cardCompletion:{".submitted":{overflow:"hidden",animation:`${"vertical"===e?_s:Es} 0.4s ease 0.2s forwards`},".submitted .clock-icon":Object.assign({},"horizontal"===e?{width:"0"}:{}),".submitted .dismiss-icon":Object.assign({},"horizontal"===e?{width:"0"}:{}),".submitted-subview":{overflow:"hidden",animation:"vertical"===e?`${_s} 0.4s ease 1.0s forwards`:`${Es} 0.4s ease 0.2s forwards`}},dismissal:{position:"relative"," .dismiss-icon":Object.assign({position:"absolute",left:"vertical"===e?"120%":"50%",top:"50%",width:"50px",height:"50px",margin:"vertical"===e?"-25px 0 0 -25px":"-29px 0 0 -20px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50px"},"vertical"===e?{}:{opacity:"0"}),".dismissing .dismiss-icon":{animation:"vertical"===e?`${As} 0.4s ease forwards`:`${Ts} 0.3s ease 0.3s forwards`},".dismissed":{overflow:"hidden",animation:"vertical"===e?`${_s} 0.4s ease 0.4s forwards`:`${Es} 0.3s ease 0.3s forwards`},".dismissed .dismiss-icon":{left:"50%",animation:"vertical"===e?`${js} 0.4s ease forwards`:`${js} 0.3s ease forwards`},".dismissed .clock-icon":Object.assign({},"horizontal"===e?{width:"0"}:{})},snooze:{position:"relative"," .clock-icon":Object.assign({position:"absolute",left:"vertical"===e?"120%":"50%",top:"50%",width:"50px",height:"50px",margin:"vertical"===e?"-25px 0 0 -25px":"-29px 0 0 -20px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50px"},"vertical"===e?{}:{opacity:"0"}),".snoozing .clock-icon":{animation:"vertical"===e?`${As} 0.4s ease forwards`:`${Ts} 0.3s ease 0.3s forwards`},".snoozed":{overflow:"hidden",animation:"vertical"===e?`${_s} 0.4s ease 0.4s forwards`:`${Es} 0.3s ease 0.3s forwards`},".snoozed .clock-icon":{left:"50%",animation:"vertical"===e?`${js} 0.4s ease forwards`:`${js} 0.3s ease forwards`},".snoozed .dismiss-icon":Object.assign({},"horizontal"===e?{width:"0"}:{})},center:{position:"relative",".centering":{position:"relative",left:"50%",transform:"translateX(-50%)",transition:"left 0.4s ease-out"}}}},Bs=600,Ys=600,Ks=600,Zs=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 Qs=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 Gs=(e,t,n,r,i,o)=>Qs(void 0,void 0,void 0,(function*(){const{dismissingCard:a,dismissedCard:s,failedToDismissCard:l}=t;if(e.application.isPreview)return;a(n);const c=new Promise((e=>setTimeout(e,Ys)));Qe.debug({level1:["Dismiss card sent by HTTP"]});const d=yield Ma(e.application.streamContainerId,n,i);yield Promise.allSettled([c,d]),d.ok?(Qe.debug({level1:["Dismiss card sent by HTTP: success"]}),s(n),ye().clearSubviewsForCardInstance(n),window.AtomicUploadService.cancelUploadForCard(e.application.containerInstanceId,n),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),r.dispatchCardEvent({type:Ti.DISMISSED,eventPayload:d.event})):(Qe.error({level1:["Dismiss card sent by HTTP: failed"]}),l(n,o,d.error),r.dispatchCardEvent({type:Ti.DISMISS_FAILED}))})),Xs=function(e,t,n){return Qs(this,arguments,void 0,(function*(){var r,i,o;let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4?arguments[4]:void 0,l=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,d=arguments.length>7?arguments[7]:void 0,u=arguments.length>8?arguments[8]:void 0;const{submittingCard:h,submittedCard:p,failedToSubmitCard:m,finishSubview:g,openExternalUrl:v,handleSubmitButtonPayload:f}=t,{postSubmissionUrl:b,payload:y,subviewData:w,submitButtonName:S,cancelSubmitCallback:k}=u||{};if(e.application.isPreview)return;const C=e=>{m(n,a,d,e,{postSubmissionUrl:b,subviewData:w,payload:y,submitButtonName:S}),s.dispatchCardEvent({type:Ti.SUBMIT_FAILED})};let x=!1;const I=(null==w?void 0:w.subviewId)?null===(r=e.cardResponses[n])||void 0===r||null===(i=r.subviews)||void 0===i?void 0:i[null==w?void 0:w.subviewId]:null===(o=e.cardResponses[n])||void 0===o?void 0:o.responses,O=Object.assign(Object.assign({},d),I||{});for(const[e,t]of Object.entries(I||{}))t&&"object"==typeof t&&"image"===t.type&&"string"==typeof t.destinationFilename&&"string"==typeof t.targetBucketId&&(x=!0,O&&(O[e]={filename:t.destinationFilename,targetBucketId:t.targetBucketId}));if(x){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,l,{subviewData:w,cancelSubmitCallback:k});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:(Qe.error({level1:[`Submit of card ${n} failed due to file upload failure`]}),C(o.error))}h(n);const T=new Promise((e=>setTimeout(e,Bs)));Qe.debug({level1:["Submit card sent by HTTP"]});const M=yield Ta(e.application.streamContainerId,n,Object.assign(Object.assign({},O),S?{[S]:null}:{}),c);yield Promise.allSettled([T,M]),M.ok?(Qe.debug({level1:["Submit card sent by HTTP: success"]}),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),g(),(null==b?void 0:b.url)&&v(n,a?"subview":"topview",w||{},"url","submitButton",b),y&&f(n,w||{},y),p(n,a),ye().clearSubviewsForCardInstance(n),s.dispatchCardEvent({type:Ti.SUBMITTED,eventPayload:M.event})):(Qe.error({level1:["Submit card sent by HTTP: failed"]}),C(M.error))}))},Js=(e,t,n,r,i,a,s)=>Qs(void 0,void 0,void 0,(function*(){const l=(0,o.differenceInSeconds)(r,new Date),{snoozingCard:c,snoozedCard:d,failedToSnoozeCard:u}=t;if(e.application.isPreview)return;c(n);const h=new Promise((e=>setTimeout(e,Ks)));Qe.debug({level1:["Snooze card sent by HTTP"]});const p=yield Fa(e.application.streamContainerId,n,l,a);yield Promise.allSettled([h,p]),p.ok?(Qe.debug({level1:["Snooze card sent by HTTP: success"]}),d(n,r),ye().clearSubviewsForCardInstance(n),Be().clearCardForm(n),window.AtomicUploadService.cancelUploadForCard(e.application.containerInstanceId,n),window.AtomicUploadService.removeAllFilesForCard(e.application.containerInstanceId,n),i.dispatchCardEvent({type:Ti.SNOOZED,eventPayload:p.event})):(Qe.error({level1:["Snooze card sent by HTTP: failed"]}),u(n,r,s,p.error),i.dispatchCardEvent({type:Ti.SNOOZE_FAILED}))})),el=(e,t,n,r,i)=>{n.sendEvent({cardInstanceId:e,cardViewState:"topview",eventName:et,properties:{source:i}}),t.feedbackReceived(e),r.dispatchCardEvent({type:Ti.VOTED_USEFUL})};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())}))};function nl(){return nl=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},nl.apply(this,arguments)}const rl=(e,t,n,r)=>tl(void 0,void 0,void 0,(function*(){var i;const o=null===(i=(yield ja([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]=ed(s,o):cd(s)&&rl(e,t,n,s)}))})),il=t=>{let{nodeKey:n,isWorkflow:r,clickHandler:i,text:o,icon:a,iconUrl:s,theme:l,appearance:c,loading:d,type:u,urlLink:h}=t;return(0,Y.h)(me.lj,{actions:(0,e.Y2)($e,ge,Pt),mapToProps:()=>{}},(e=>(0,Y.h)(Tn,nl({},n&&{nodeKey:n},{isWorkflow:r,clickHandler:i(e),text:o,icon:a,iconUrl:s,theme:l,appearance:c,loading:d,type:u,urlLink:h}))))},ol=qt("div")((e=>{let{isWorkflow:t,feedOrientation:n}=e;return Object.assign({},t||"horizontal"!==n?{}:{display:"flex",flexDirection:"column",flexGrow:"1",justifyContent:"flex-end"})})),al=e=>{let{children:t,isWorkflow:n,feedOrientation:r,initializeFormStore:i}=e;return re((()=>{i()}),[]),(0,Y.h)(ol,{isWorkflow:n,feedOrientation:r},t)},sl=(e,t,n,r)=>()=>{e.createResponseWithDefaults(t,n,r)},ll=qt("div")((e=>{let{theme:t,headlineFontProperties:n}=e;return{color:t.getCSSColor("text.headline"),display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${n.lineHeight} 1fr`,padding:"10px 0"}})),cl=qt("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"})})),dl="22px",ul=e=>Object.assign(Object.assign({margin:"0",paddingLeft:"0",listStyleType:"none"},e.getCSSFontProperties("body")),{color:e.getCSSColor("text.body")}),hl=e=>{let t;return dd(t)||(t=e.getCSSFontProperties("bullet")),{"> li":{display:"flex",margin:"0 0 5px"},"> li.without-icon:before":Object.assign({content:'"•"',textAlign:"center",flexBasis:dl,minWidth:dl,marginRight:"10px",color:e.getCSSColor("icon.bullet")},t?{fontSize:t.fontSize,lineHeight:t.lineHeight}:{}),"> li.with-icon i":{flexBasis:dl,minWidth:dl,textAlign:"center"},"> li:last-child":{marginBottom:"10px"}}},pl=qt("ul")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},ul(t)),hl(t))})),ml=qt("ol")((e=>{let{theme:t}=e;return Object.assign(Object.assign(Object.assign({},ul(t)),hl(t)),{counterReset:"item","> li.without-icon:before":Object.assign(Object.assign(Object.assign({},ul(t)["> li.without-icon:before"]),hl(t)["> li.without-icon:before"]),{content:'counter(item) "."',counterIncrement:"item"})})})),gl=qt("ul")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},ul(t)),{margin:"5px 20px 5px 0"," li":{display:"inline"}," li:before":{content:'", "'}," li:first-child:before":{content:'""'}})}));class vl{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 fl={"":["<em>","</em>"],_:["<strong>","</strong>"],"\n":["</p><p>"]," ":["<br />"]};function bl(e){return(e+"").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function yl(e){return("<p>"+wl(e)+"</p>").replace(/<p><\/p>/g,"")}function wl(e,t){const n=new vl;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,c=[],d="",u=t||{},h=0;function p(e){var t=fl[e.replace(/\*/g,"_")[1]||""],n=c[c.length-1]==e;return t?t[1]?(c[n?"pop":"push"](e),t[0|n]):t[0]:e}function m(){let e="";for(;c.length;)e+=p(c[c.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=wl((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:"";d=d.replace("<a>",`<a tabindex="0" class="md-subview-link" data-subview-id="${t}">`)}else d=d.replace("<a>",'<a tabindex="0" target="_blank" class="md-web-link" href="'+bl(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=fl[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];r=e?p(e):r}else o[4]&&(r="<p>"+o[4]+"</p>",t=!0);d+=i,d+=t?"</p>"+r+"<p>":r}var f;return n.tagState.forEach(((e,t)=>{if(n.tagState.get(t).open){const e=fl[t.replace(/\*/g,"_")[1]||""][0],n=d.lastIndexOf(e);-1!==n&&(d=d.slice(0,n)+t+d.slice(n+e.length))}})),(g(d)+g(e.substring(h))+m()).trim()}const Sl=qt("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"}})),kl=qt("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"}}})),Cl=qt("a")((e=>{let{isLinkEnabled:t,theme:n,url:r}=e;return{border:`1px solid ${n.getCSSColor("border.mediaThumb")}`,borderRadius:n.getShape("borderRadius.mediaThumb"),overflow:"hidden",display:"flex",margin:"10px 0",backgroundColor:n.getCSSColor("background.mediaThumbnail"),cursor:t||r?"pointer":"default"}})),xl=qt("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"}})),Il=qt("div")((()=>({padding:"12px 15px 10px 15px",display:"flex",flexFlow:"row wrap",minWidth:"0px"}))),Ol=qt("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%"})})),Tl=qt("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%"})})),Ml=qt("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 Fl extends Qi{render(){const{nodeKey:e,children:t,mediaType:n,src:r,theme:i,label:o,description:a,customStrings:s,onClickImage:l,url:c,alt:d}=this.props,{imageLoaded:u,imageLoadFailed:h}=this.state,p=u?r:"",m=this.getPreviewIcon(n),g=n.includes("video"),v=g&&h,f="image"===n||"video"===n,b=this.getElementRole(n),y=g?(null==s?void 0:s.thumbnailVideoActionLinkTitle)||"Watch":(null==s?void 0:s.thumbnailImageActionLinkTitle)||"View",w=g?"A video":"An image";let S="";return f&&(S=(g?"Plays a video":"Displays an image")+": "),S=`${S}${d?d+".":""}`,(0,Y.h)(Cl,{key:e,"data-element-key":e,theme:i,onClick:l,isLinkEnabled:f,url:c},(0,Y.h)(xl,{thumbnail:p,theme:i,role:b,"aria-label":S||w},!u&&!v&&m&&(0,Y.h)(m,{fillColor:i.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(u||h)&&t),(0,Y.h)(Il,null,(0,Y.h)(Ol,{theme:i,class:"thumbnail-header","aria-label":`${o}.`},o),(0,Y.h)(Tl,{theme:i,class:"thumbnail-format","aria-label":`${a}.`},a),(0,Y.h)(Ml,{theme:i,isLinkEnabled:"image"===n||"video"===n,tabIndex:"0",class:"thumbnail-link",onKeyPress:this.handleKeyPress.bind(this)},y)))}}const jl=qt("div")((e=>{let{backgroundImage:t,theme:n,dimensions:r,loadedDimensions:i,url:o,isLinkEnabled:a}=e;const s=`calc(${n.getShape("borderRadius.card")} - ${n.getShape("border.card")})`;return Object.assign(Object.assign({width:"calc(100% + 40px)",border:"0px",borderRadius:`${s} ${s} 0 0`,backgroundImage:`url(${t})`,backgroundSize:"cover",backgroundPosition:"center",backgroundColor:n.getCSSColor("background.media"),display:"flex",alignItems:"center",justifyContent:"center",margin:"-10px -20px 10px -20px",overflow:"hidden",cursor:a||o?"pointer":"default"},Pl({dimensions:r,naturalDimensions:i})),n.getElementFocusCSSProperties())}));class Dl extends Qi{onImageLoad(e){super.onImageLoad(e),this.props.onLoad&&this.props.onLoad({width:e.naturalWidth,height:e.naturalHeight})}render(){const{nodeKey:e,children:t,mediaType:n,src:r,theme:i,onClickImage:o,dimensions:a,url:s,alt:l}=this.props,{imageLoaded:c,imageLoadFailed:d}=this.state,u=c?r:"",h=this.getPreviewIcon(n),p=n.includes("video")&&d,m="image"===n||"video"===n,g=this.getElementRole(n),v=n.includes("video")?"A banner video":"A banner image";let f="";return m&&(f=(n.includes("video")?"Plays a video":"Displays an image")+": "),f+=l,(0,Y.h)(jl,{key:e,"data-element-key":e,backgroundImage:u,theme:i,mediaType:n,url:s,dimensions:a,loadedDimensions:this.state.loadedDimensions,onClick:o,onKeyPress:this.handleKeyPress.bind(this),tabIndex:"0",className:"image-banner",role:g,isLinkEnabled:m,"aria-label":f||v},!c&&!p&&h&&(0,Y.h)(h,{fillColor:i.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(c||d)&&t)}}const Al=qt("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({},rn(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"),margin:"10px 0",display:"flex",alignItems:"center",justifyContent:"center",cursor:a||o?"pointer":"default",overflow:"hidden"}),Pl({dimensions:r,naturalDimensions:i})),n.getElementFocusCSSProperties())}));class _l extends Qi{onImageLoad(e){super.onImageLoad(e),this.props.onLoad&&this.props.onLoad({width:e.naturalWidth,height:e.naturalHeight})}render(){const{nodeKey:e,children:t,mediaType:n,src:r,dimensions:i,url:o,onClickImage:a,theme:s,alt:l}=this.props,{imageLoaded:c,imageLoadFailed:d}=this.state,u=c?r:"",h=this.getPreviewIcon(n),p=n.includes("video")&&d,m="image"===n||"video"===n,g=this.getElementRole(n),v=n.includes("video")?"A video":"An image";let f="";return m&&(f=(n.includes("video")?"Plays a video":"Displays an image")+": "),f+=l,(0,Y.h)(Al,{key:e,"data-element-key":e,backgroundImage:u,dimensions:i,loadedDimensions:this.state.loadedDimensions,mediaType:n,url:o,onClick:a,onKeyPress:this.handleKeyPress.bind(this),theme:s,tabIndex:"0",className:"image-inline",role:g,isLinkEnabled:m,ariaLabel:f||v},!c&&!p&&h&&(0,Y.h)(h,{fillColor:s.getCSSColor("icon.mediaBanner"),ariaHidden:!0}),(c||d)&&t)}}const El=qt("p")({padding:"10px 0",margin:"0",overflow:"hidden",textOverflow:"ellipsis"}),Ll=qt("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 Hl extends Qi{preloadsImage(){return!1}render(){const{nodeKey:e,theme:t,label:n,onClickImage:r,mediaType:i,url:o}=this.props;return(0,Y.h)(El,{key:e,"data-element-key":e},(0,Y.h)(Ll,{theme:t,onClick:r,onKeyPress:this.handleKeyPress.bind(this),tabIndex:"0",className:"image-text",mediaType:i,url:o},n))}}const Pl=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"}},Rl=e=>{let{fillColor:t,ariaHidden:n=!1}=e;return(0,Y.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,Y.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"}))},Vl=qt("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")}})),$l=e=>{let{onClick:t,theme:n}=e;return(0,Y.h)(Vl,{onClick:t,theme:n},(0,Y.h)(Rl,{fillColor:n.getCSSColor("icon.mediaControl"),ariaHidden:!0}))},Nl={objectFit:"contain",width:"100%",height:"100%",background:"black"},Wl=qt("video")(Object.assign({},Nl)),zl=qt("video")((()=>Object.assign({},Nl))),Ul=qt("div")((e=>{let{maskRadius:t,dimensions:n,loadedDimensions:r,format:i}=e;return Object.assign({borderRadius:"banner"===i?`${t} ${t} 0 0`:t,overflow:"hidden",margin:"banner"===i?"-10px -20px 10px -20px":"10px 0"},n?Pl({dimensions:n,naturalDimensions:r}):{height:"200px"})})),ql=qt("div")((e=>{let{theme:t}=e;return{background:t.getCSSColor("overlay.mediaBanner"),display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"}})),Bl=e=>{let t,{nodeKey:n,cardInstanceId:r,label:i,description:o,format:a,src:s,altText:l,theme:c,thumbnailSrc:d,dimensions:u,setPlaying:h,onLoad:p}=e,m=!1,g=!1;switch(a){case"banner":t=Dl,m=!0,g=!0;break;case"inline":t=_l,m=!0,g=!0;break;case"thumbnail":t=Fl,m=!0;break;case"text":t=Hl}return(0,Y.h)(me.lj,{actions:ge,mapToProps:e=>({customStrings:e.application.customStrings})},(e=>(0,Y.h)(t,{nodeKey:n,theme:c,customStrings:e.customStrings,src:d,dimensions:u,onLoad:p,alt:null==l?void 0:l.src,label:i,description:o,mediaType:null!==s&&s.length>0?"video":"videoWithoutSrc",onClickImage:()=>{g?h(!0):e.viewMedia(r,{type:"video",url:s,title:i,alt:null==l?void 0:l.src})}},m&&(0,Y.h)(ql,{theme:c},(0,Y.h)($l,{onClick:()=>g&&h(!0),theme:c})))))},Yl=e=>{var t,n;let{format:r,theme:i,src:o,cardInstanceId:a,dimensions:s,loadedDimensions:l,isWorkflow:c}=e;const d=oe(null),u=le(Mi).analyticsDispatcher,h="string"==typeof o&&null!==(t=null===(n=o.match(/[^\/]*$/))||void 0===n?void 0:n[0])&&void 0!==t?t:"";switch(re((()=>{var e,t,n,r;const i=()=>{u.sendEvent({eventName:ct,cardInstanceId:a,cardViewState:c?"subview":"topview",properties:{media:h,mediaURL:o}})},s=()=>{u.sendEvent({eventName:dt,cardInstanceId:a,cardViewState:c?"subview":"topview",properties:{media:h,mediaURL:o}})};return null===(e=d.current)||void 0===e||null===(t=e.base)||void 0===t||t.addEventListener("play",i),null===(n=d.current)||void 0===n||null===(r=n.base)||void 0===r||r.addEventListener("ended",s),()=>{var e,t,n,r;null===(e=d.current)||void 0===e||null===(t=e.removeEventListener)||void 0===t||t.call(e,"play",i),null===(n=d.current)||void 0===n||null===(r=n.removeEventListener)||void 0===r||r.call(n,"ended",s)}}),[]),r){case"banner":return(0,Y.h)(me.lj,{mapToProps:e=>({applicationOpen:e.application.open})},(e=>{var t;let{applicationOpen:n}=e;return!n&&(null==d||null===(t=d.current)||void 0===t?void 0:t.base)&&d.current.base.pause(),(0,Y.h)(Ul,{format:r,dimensions:s,loadedDimensions:l,maskRadius:i.getShape("borderRadius.card")},(0,Y.h)(Wl,{ref:d,src:o,playsInline:!0,autoplay:!0,controls:!0}))}));case"inline":return(0,Y.h)(me.lj,{mapToProps:e=>({applicationOpen:e.application.open})},(e=>{var t;let{applicationOpen:n}=e;return!n&&(null==d||null===(t=d.current)||void 0===t?void 0:t.base)&&d.current.base.pause(),(0,Y.h)(Ul,{format:r,dimensions:s,loadedDimensions:l,maskRadius:i.getShape("borderRadius.media")},(0,Y.h)(zl,{ref:d,src:o,playsInline:!0,autoplay:!0,controls:!0}))}));default:return null}},Kl=(e,t)=>{let n;return dd(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:"22px",minWidth:"22px",color:e.getCSSColor("icon.bullet")},n?{fontSize:n.fontSize,lineHeight:n.lineHeight}:{}),[`>${t} > li:last-child`]:{marginBottom:"10px"}}},Zl=(e,t)=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.getCSSColor("text.body"),gridColumnStart:"2",gridRowStart:"span 2"},e.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",whiteSpace:"pre-wrap",listStyleType:"none"})}),Kl(e,"ul")),{"> ol":Object.assign(Object.assign({},{paddingLeft:"0",margin:"0",whiteSpace:"pre-wrap",listStyleType:"none"}),{counterReset:"count"})}),Kl(e,"ol")),{" a":{color:e.getCSSColor("text.link")}," p":Object.assign(Object.assign({margin:"10px 0 0 0",whiteSpace:"pre-wrap","overflow-wrap":"break-word","word-wrap":"break-word","word-break":"break-word"},e.getCSSFontProperties("body")),{overflow:"hidden"})," p:first-child":{marginTop:"0"}," .md-subview-link":{textDecoration:"underline",cursor:"pointer"}}),t),Ql=qt("div")((e=>{let{theme:t}=e;return Zl(t)})),Gl=qt("div")({position:"absolute",top:"-1000px",left:"-1000px",width:"1px",height:"1px",overflow:"hidden"}),Xl=qt("div")((e=>{let{bodyFontProperties:t}=e;return{position:"fixed",visibility:"hidden",pointerEvents:"none",display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${t.lineHeight} 1fr`}})),Jl=qt("div")((e=>{let{theme:t}=e;return Zl(t,{"& *":{marginTop:"0!important",marginBottom:"0!important"}})})),ec=qt("div")((e=>{let{theme:t,bodyFontProperties:n,isWorkflow:r}=e;return{display:"grid",gridTemplateColumns:"auto 1fr",gridTemplateRows:`${n.lineHeight} 1fr`,color:t.getCSSColor("text.body"),padding:r?"0 0 20px 0":"10px 0px"}})),tc=()=>window.matchMedia("(prefers-color-scheme: dark)");function nc(){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 rc(e,t,n,r,i){var o,a,s,l,c,d,u,h,p,m,g,v;const f=document.createElement("button"),b=document.createElement("span"),y=document.createElement("span");y.innerHTML="&#8230; ";const w=t.getCSSFontProperties("expandCollapse",{skipFallback:!0,skipFontFallbacks:!0}),S=t.getCSSFontProperties("body"),k=t.getShape("padding.expandCollapseLeft")||"0px",C="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?k:"0px",b.style.color=null!==(o=t.getCSSColor("text.expandCollapse",{skipFallback:!0}))&&void 0!==o?o:t.getCSSColor("text.body"),f.style.color=null!==(a=t.getCSSColor("text.expandCollapse",{skipFallback:!0}))&&void 0!==a?a: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!==(c=null==w?void 0:w.fontStyle)&&void 0!==c?c:null==S?void 0:S.fontStyle,f.style.fontStyle=null!==(d=null==w?void 0:w.fontStyle)&&void 0!==d?d: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:C,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 ic(e,t,n,r,i,o){var a,s;n.innerHTML="";const l=e.cloneNode(!0);n.appendChild(l);const c=document.createTreeWalker(l,NodeFilter.SHOW_TEXT),d=[];let u=null;for(;u=c.nextNode();){var h;u&&(null===(h=u.textContent)||void 0===h?void 0:h.trim())&&d.push(u)}let p=null,m=0,g=!1;for(let s=d.length;s>0;s--){const l=d[s-1],c=null!==(a=l.textContent)&&void 0!==a?a:"";let u=0,h=c.length,S=0;if(l.parentElement){for(;u<=h;){var v,f;let e=Math.floor((u+h)/2);l.textContent=c.slice(0,e);const a=rc(null!=o?o:"Show more",i,"expand",`expand-text-${r}`,n.getBoundingClientRect().width+"px");a.style.marginRight=nc()+"px",null===(v=l.parentElement)||void 0===v||v.appendChild(a);Math.ceil(n.getBoundingClientRect().height)<=t?(S=e,u=e+1):h=e-1,null===(f=l.parentElement)||void 0===f||f.removeChild(a)}var b,y;if("ol"===e.tagName.toLowerCase()||"ul"===e.tagName.toLowerCase())if(0===S&&"li"===(null===(b=l.parentElement)||void 0===b||null===(y=b.parentElement)||void 0===y?void 0:y.tagName.toLowerCase())){var w;null===(w=l.parentElement)||void 0===w||w.parentElement.remove();continue}if(1===s||S>0){p=l,p.textContent=c,m=S,g=S<4;break}}}if(p){const e=null!==(s=p.textContent)&&void 0!==s?s:"";let t=0;if(p.textContent=e.slice(0,g?4:m).trimEnd(),g){var S,k;const n=document.createElement("span");n.textContent=e.slice(0,4).trimEnd(),null===(S=p.parentElement)||void 0===S||S.appendChild(n),t=n.getBoundingClientRect().width,null===(k=p.parentElement)||void 0===k||k.removeChild(n)}const a=rc(null!=o?o:"Show more",i,"expand",`expand-text-${r}`,n.getBoundingClientRect().width-t-nc()+"px"),l=p.parentElement;"p"!==(null==l?void 0:l.tagName.toLowerCase())||(null==l?void 0:l.textContent)||(l.style.marginTop="0px"),"a"===(null==l?void 0:l.tagName.toLowerCase())&&l.parentElement?l.parentElement.insertBefore(a,l.nextSibling):null==l||l.appendChild(a)}return l.outerHTML}const oc=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.h)("path",{d:"M15 10V20M20 15H15H10",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))},ac=e=>{let{fillColor:t}=e;return(0,Y.h)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Y.h)("path",{d:"M20 15H10",stroke:t,"stroke-width":"2","stroke-linecap":"round"}))},sc=qt("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"}})),lc=qt("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%"}})})),cc=qt("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"}})})),dc=qt("div")((e=>{let{theme:t}=e;return Object.assign(Object.assign({},t.getCSSFontProperties("primary")),{color:t.getCSSColor("text.primary"),flexGrow:"1",whiteSpace:"pre-wrap"})})),uc=(e,t,n)=>e-n>=t,hc=(e,t,n)=>e+n<=t;let pc=null;const mc=qt("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())})),gc=qt("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"}})),vc=qt("p")((e=>{let{theme:t}=e;return Object.assign(Object.assign({display:"grid",gridTemplateColumns:"auto minmax(0,1fr)",color:t.getCSSColor("text.category")},t.getCSSFontProperties("category")),{padding:"10px 0px 8px 0px",margin:"0"})})),fc=qt("span")({whiteSpace:"pre-wrap",overflow:"hidden",overflowWrap:"break-word",wordWrap:"break-word",wordBreak:"break-word"});let bc=null;const yc=e=>{let{fillColor:t,ariaHidden:n}=e;return(0,Y.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,Y.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"}))},wc=e=>{let{fillColor:t,ariaHidden:n}=e;return(0,Y.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,Y.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 Sc=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 kc={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}},Cc={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 xc=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 Ic=qt("label")((()=>({position:"relative",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",display:"flex",alignItems:"center",width:"100%",cursor:"pointer"}))),Oc=qt("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"),backgroundColor:t.getCSSColor("background.uploadPlaceholder")},(null==r?void 0:r.url)&&r.webCompatible?o:{})})),Tc=qt("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"})})),Mc=qt("input")({position:"absolute",visibility:"hidden",width:"100%",height:"100%"}),Fc=qt("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"}))),jc=qt("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"}))),Dc=e=>{let{theme:n,cardInstanceId:r,subviewId:i,name:o,label:a,validations:s,enabledThumbnailIcon:l,targetBucketId:c,variableResolver:d}=e;const h=oe(null),p=oe(null),m=Ye(r,o,i),[g,v]=te(null),[f,b]=te(null),[y,w]=te(0),S=u().getState();re((()=>{if(S.application.isPreview)return;const e=window.AtomicUploadService.getFile(S.application.containerInstanceId,r,o);m&&e?(C(e),b(m.filename)):Be().handleFormChange(r,o,void 0,i)}),[]),re((()=>{if(h.current&&p.current&&!y){var e,t,n,r;const i=(null===(e=h.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.offsetHeight)||0,o=(null===(n=p.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)}}}),[h]);const k=(e,t)=>{v({url:URL.createObjectURL(e),webCompatible:!t})},C=e=>{const t=h.current.base;if(t){k(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,o,i),Be().handleFormChange(r,o,void 0,i),Be().validateField(r,o,void 0,s,i),h.current&&(v(null),b(null),h.current.base.value=null))},I=`upload-label=${r}-${o}`;return(0,Y.h)(Y.Fragment,null,(0,Y.h)(Oc,{theme:n,enabledThumbnailIcon:l,preview:g},!g&&l&&(0,Y.h)(dn,{fillColor:n.getCSSColor("icon.uploadPlaceholder"),ariaHidden:!0}),g&&!g.webCompatible&&(0,Y.h)(Mn,{fillColor:n.getCSSColor("icon.uploadPlaceholder"),ariaHidden:!0})),(0,Y.h)(Ic,{htmlFor:I},(0,Y.h)(Tc,{ref:p,theme:n,placeholder:!f,yPadding:y},f||d(a.length?a:"")),(0,Y.h)(Mc,{id:I,ref:h,type:"file",accept:"image/jpeg, image/png, image/webp, image/avif",onChange:e=>xc(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),a=yield(e=>Sc(void 0,void 0,void 0,(function*(){const t=yield e.slice(0,(()=>{const e=Object.assign(Object.assign({},kc),Cc);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(kc))for(const n of e)if(r(n,t))return{requiresConversion:!1,isValidImage:!0};for(const{signatures:e,offset:t}of Object.values(Cc))for(const n of e)if(r(n,t))return{requiresConversion:!0,isValidImage:!0};return{requiresConversion:!1,isValidImage:!1}})))(e);if(!a.isValidImage)return x(),void Be().validateFieldCustomResult(r,o,{type:"invalid",errorMessage:"Invalid file or unsupported image format selected"},i);const l=`${(0,t.v4)()}_${e.name}`,d={filename:e.name,destinationFilename:l,size:e.size,type:"image",targetBucketId:c};window.AtomicUploadService.storeFile(e,"image",c,r,S.application.containerInstanceId,l,a.requiresConversion,o,i),Be().handleFormChange(r,o,d,i),k(e,a.requiresConversion),b(e.name),Be().validateField(r,o,d,s,i)}}))})),f?(0,Y.h)(jc,{onClick:x,"aria-label":"remove image"},(0,Y.h)(yc,{fillColor:n.getCSSColor("icon.inputButton"),ariaHidden:!0})):(0,Y.h)(Fc,{onClick:()=>{var e,t;return null==h||null===(e=h.current)||void 0===e||null===(t=e.base)||void 0===t?void 0:t.click()},"aria-label":"attach image"},(0,Y.h)(wc,{fillColor:n.getCSSColor("icon.inputButton"),ariaHidden:!0})))},Ac=Yn((e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{label:i,name:o,type:a,enabledThumbnailIcon:s,targetBucketId:l},theme:c,validations:d,variableResolver:u}=e;const h="image"===a?(0,Y.h)(Dc,{theme:c,cardInstanceId:n,subviewId:r,name:o,validations:d,label:i,enabledThumbnailIcon:s,targetBucketId:l||"DEFAULT",variableResolver:u}):null;return(0,Y.h)(Y.Fragment,null,(0,Y.h)(Yo,{nodeKey:t,theme:c,cursor:"default",mode:"inline"},h),(0,Y.h)(ea,{name:o,cardInstanceId:n,subviewId:r,theme:c,variableResolver:u}))}),((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)),_c=qt("div")((e=>{var t,n,r,i,o;let{theme:a,feedOrientation:s,isWorkflow:l,transparencies:c}=e;const d=a.getShape("buttonLayout.global"),u=a.getShape("buttonAlignment.global"),h=c.finalButtonTransparent?"0":l?"20px":"10px",p=c.primaryButtonTransparent||c.secondaryButtonTransparent?"0px":"10px",m=!1===c.primaryButtonTransparent,g=!1===c.secondaryButtonTransparent;let v,f;m||g?(v="10px",f="20px"):(v="0px",f="10px");const b=Object.assign({flexGrow:"1",flexDirection:"column"},"horizontal"===d?{alignItems:"flex-end"}:{justifyContent:"flex-end"}),y={paddingBottom:l?f:v,flexDirection:"row",overflowX:"scroll",margin:"0 -20px",paddingLeft:"20px",paddingRight:"20px",marginRight:"-20px","::-webkit-scrollbar":{display:"none"},"-ms-overflow-style":"none",scrollbarWidth:"none","> button:not(:last-child)":{marginRight:null!==(t=a.getShape("buttonSpacingAfter.global",{skipFallback:!0}))&&void 0!==t?t:p},"> a:not(:last-child)":{marginRight:null!==(n=a.getShape("buttonSpacingAfter.global",{skipFallback:!0}))&&void 0!==n?n:p}},w={flexDirection:"column",alignItems:null!==(r={left:"flex-start",center:"center",right:"flex-end"}[u])&&void 0!==r?r:"flex-start","> button:not(:last-child)":{marginBottom:null!==(i=a.getShape("buttonSpacingAfter.global",{skipFallback:!0}))&&void 0!==i?i:p},"> button:last-child":{marginBottom:h},"> a:not(:last-child)":{marginBottom:null!==(o=a.getShape("buttonSpacingAfter.global",{skipFallback:!0}))&&void 0!==o?o:p},"> a:last-child":{marginBottom:h}};return Object.assign(Object.assign({paddingTop:c.firstButtonTransparent?"0px":"10px",display:"flex",alignItems:"center"},"horizontal"===s?b:{}),"horizontal"===d?y:w)})),Ec=qt("div")({marginBottom:"20px"}),Lc=qt("ul")({listStyle:"none",padding:"0",margin:"0","> li":{marginBottom:"10px"},"> :last-child":{marginBottom:"0"}}),Hc=e=>{let{fillColor:t,style:n,ariaHidden:r}=e;return(0,Y.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,Y.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"}))},Pc=qt("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"}})),Rc=qt("input")((e=>{let{theme:t}=e;return{position:"absolute",appearance:"none","&:focus-visible + span":{boxShadow:`0 0 0 2px ${t.getCSSColor("border.focus")} inset`}}})),Vc=qt("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)})),$c=qt("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 Wc={linkButton:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,subviewTitle:i,isWorkflow:o,theme:a,attributes:s,variableResolver:l}=e;const{text:c,icon:d,iconUrl:h,appearance:p}=s,m=s.url,g=s.target,v=Object.assign(Object.assign({},r&&{subviewId:r}),i&&{subviewTitle:i}),f=le(Mi),b=f.runtimeVariableResolver,y=f.containersBroadcastChannel;return(0,Y.h)(il,{nodeKey:t,theme:a,appearance:p,isWorkflow:o,text:l(c),icon:d,iconUrl:h,clickHandler:e=>{const r=u().getState();return i=>tl(void 0,void 0,void 0,(function*(){let o,a,c;if(s.action){c=s.action;const e=r.cardFeed.cardInstances.find((e=>e.instance.id===n));c&&b&&e&&(yield rl(b,r.application.runtimeVariableResolutionTimeout,e,c))}else if(s.layoutId)o=s.layoutId;else if(s.url){if(i.preventDefault(),a={url:l(m),target:i.ctrlKey||i.metaKey?"_blank":null!=g?g:"_blank"},f.analyticsDispatcher.sendEvent({cardInstanceId:n,cardViewState:r.navigationStack.items.length?"subview":"topview",eventName:Je,properties:Object.assign({linkMethod:"url",url:a.url,trigger:"linkButton"},v.subviewId?Object.assign(Object.assign({},v),{subviewLevel:1}):{})}),"_top"===a.target&&y){const e=`${t}-link-button`;return y.addEventListener("message",(t=>{if(t.data.type===ps.ANALYTICS_EVENT){var r;const i=null===(r=t.data)||void 0===r?void 0:r.eventQueued;i.eventName===Je&&i.cardInstanceId===n&&y&&a&&(y.removeEventListener(e),window.open(a.url,a.target))}}),e)}return window.open(a.url,a.target)}return e.handleLinkButtonPress(n,v,o,c)}))},urlLink:m?{url:l(m),target:g}:void 0})},submitButton:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,subviewTitle:i,isWorkflow:o,theme:a,attributes:{name:s,text:l,appearance:c,icon:d,iconUrl:h,values:p,url:m,action:g,target:v},variableResolver:f}=e;const[b,y]=te(!1),w=le(Mi),S=w.cardEventDispatcher,k=w.authTokenProvider,C=w.analyticsDispatcher,x=w.runtimeVariableResolver;return(0,Y.h)(il,{nodeKey:t,theme:a,appearance:c,isWorkflow:o,text:f(l),icon:d,iconUrl:h,clickHandler:e=>{const t=u().getState();return()=>tl(void 0,void 0,void 0,(function*(){var a,l;if(t.application.isPreview)return void e.finishSubview();if(b)return;y(!0);const c=t.cardFeed.cardInstances.find((e=>e.instance.id===n));g&&x&&c&&(yield rl(x,t.application.runtimeVariableResolutionTimeout,c,g));let d={};var h,w;o?(e.validateCurrentSubview(n),d=r&&null!==(a=null===(h=u().getState().validationStates[n])||void 0===h||null===(w=h.subviews)||void 0===w?void 0:w[r])&&void 0!==a?a:{}):(e.validateCardTopLevel(n),d=null!==(l=u().getState().validationStates[n].validations)&&void 0!==l?l:{});const I=u().getState(),O=(e=>!!e.navigationStack.items.length)(t);(e=>{for(var t in e)if("invalid"===e[t].type)return!1;return!0})(d)&&(yield Xs(I,e,n,O,S,C,k,p,{postSubmissionUrl:m?{url:f(m),target:v}:void 0,payload:g,subviewData:{subviewId:r,subviewTitle:i},submitButtonName:s,cancelSubmitCallback:()=>y(!1)}),o&&C.sendEvent({cardInstanceId:n,cardViewState:"subview",eventName:st,properties:{subviewId:r,subviewTitle:i,subviewLevel:1}})),y(!1)}))},loading:b,type:"submit"})},dismissButton:e=>{let{nodeKey:t,isWorkflow:n,attributes:r,theme:i,cardInstanceId:o,variableResolver:a}=e;const{text:s,icon:l,iconUrl:c,appearance:d}=r,h=le(Mi);return(0,Y.h)(il,{nodeKey:t,theme:i,appearance:d,isWorkflow:n,text:a(s),icon:l,iconUrl:c,clickHandler:e=>()=>{Gs(u().getState(),e,o,h.cardEventDispatcher,h.authTokenProvider,"card-button")}})},snoozeButton:e=>{let{nodeKey:t,isWorkflow:n,attributes:r,theme:i,cardInstanceId:a,cardMetadata:s,variableResolver:l}=e;const{text:c,icon:d,iconUrl:h,snoozePeriod:p,appearance:m}=r,g=le(Mi);return(0,Y.h)(il,{nodeKey:t,theme:i,appearance:m,isWorkflow:n,text:l(c),icon:d,iconUrl:h,clickHandler:e=>()=>{if(void 0===p||null===nd(p))e.requestSnooze(a,"card-button",null==s?void 0:s.expires);else{const t=rd(p,new Date);(0,o.isPast)(t)||Js(u().getState(),e,a,t,g.cardEventDispatcher,g.authTokenProvider,"card-button")}}})},voteUpButton:e=>{let{nodeKey:t,isWorkflow:n,attributes:r,theme:i,cardInstanceId:o,variableResolver:a}=e;const{text:s,icon:l,iconUrl:c,appearance:d}=r,u=le(Mi);return(0,Y.h)(il,{nodeKey:t,theme:i,appearance:d,isWorkflow:n,text:a(s),icon:l,iconUrl:c,clickHandler:e=>()=>{el(o,e,u.analyticsDispatcher,u.cardEventDispatcher,"card-button")}})},voteDownButton:e=>{let{nodeKey:t,isWorkflow:n,attributes:r,theme:i,cardInstanceId:o,variableResolver:a}=e;const{text:s,icon:l,iconUrl:c,appearance:d}=r;return(0,Y.h)(il,{nodeKey:t,theme:i,appearance:d,isWorkflow:n,text:a(s),icon:l,iconUrl:c,clickHandler:e=>()=>{e.requestFeedback(o,{sentiment:"negative",source:"card-button",textFeedback:!0})}})},actionButtonGroup:e=>{let{children:t,theme:n,feedOrientation:r,isWorkflow:i}=e;const o=oe(null),[a,s]=te({primaryButtonTransparent:void 0,secondaryButtonTransparent:void 0,firstButtonTransparent:!1,finalButtonTransparent:!1});return re((()=>{var e,t,n;const r=null===(t=o.current)||void 0===t||null===(n=t.base)||void 0===n?void 0:n.childNodes;if(r)for(let t=0;t<r.length;t++){var i;const n=r[t],o=n.getAttribute("appearance"),l=null!==(e=null===(i=window.getComputedStyle(n).backgroundColor.replace(/\s/g,"").match(/rgba\(\d+,\d+,\d+,0\)/))||void 0===i?void 0:i.length)&&void 0!==e?e:0;"primary"!==o||a.primaryButtonTransparent?"secondary"!==o||a.secondaryButtonTransparent||s((e=>Object.assign(Object.assign({},e),{secondaryButtonTransparent:l>0}))):s((e=>Object.assign(Object.assign({},e),{primaryButtonTransparent:l>0}))),0===t&&s((e=>Object.assign(Object.assign({},e),{firstButtonTransparent:l>0}))),t===r.length-1&&s((e=>Object.assign(Object.assign({},e),{finalButtonTransparent:l>0})))}}),[o]),(0,Y.h)(_c,{ref:o,theme:n,feedOrientation:r,isWorkflow:i,transparencies:a},t)},cardDescription:e=>{var t;let{attributes:{text:n,icon:r,iconUrl:i},theme:o,variableResolver:a}=e;const s=o.getCSSFontProperties("category"),l=o.getNumericFontSize("category"),c=o.getCSSColor("icon.category",{skipFallback:!0}),d=o.getCSSColor("icon.category");return(0,Y.h)(vc,{theme:o,"data-testid":"card-category"},(r||i)&&(0,Y.h)(pn,{iconName:r,iconUrl:i,size:null!=l?l:20,color:null!==c?c:void 0,fallbackColor:d,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(t=null==s?void 0:s.lineHeight)&&void 0!==t?t:"initial",marginRight:"10px",width:`${l}px`,minWidth:`${l}px`,textAlign:"center"}}),(0,Y.h)(fc,null,a(n)))},headline:e=>{var t;let{nodeKey:n,attributes:{text:r,icon:i,iconUrl:o},theme:a,variableResolver:s}=e;const l=a.getCSSFontProperties("headline"),c=a.getNumericFontSize("headline"),d=a.getCSSColor("icon.headline",{skipFallback:!0}),u=a.getCSSColor("icon.headline");return(0,Y.h)(ll,{theme:a,headlineFontProperties:l},(i||o)&&(0,Y.h)(pn,{iconName:i,iconUrl:o,size:null!=c?c:20,color:null!==d?d:void 0,fallbackColor:u,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(t=null==l?void 0:l.lineHeight)&&void 0!==t?t:"initial",marginRight:"10px",width:`${c}px`,minWidth:`${c}px`,textAlign:"center"}}),(0,Y.h)(cl,{key:n,theme:a,"data-testid":"card-headline","data-element-key":n},s(r)))},text:e=>{var n,r,i,o,a,s;let{nodeKey:l,theme:c,attributes:{icon:d,iconUrl:u,text:h,clickToExpandEnabled:p,maxDisplayLines:m,showTextLabel:g,hideTextLabel:v},isWorkflow:f,variableResolver:b,cardInstanceId:y,subviewId:w,subviewTitle:S}=e;const k=oe(null),C=oe(null),[x,I]=te(!1),[O,T]=te(null),[M,F]=te(null),[j,D]=te(tc().matches?"dark":"light"),A=oe((0,t.v4)()),_=null===(i=k.current)||void 0===i?void 0:i.base.querySelector(`#expand-text-${A.current}`),E=null===(o=k.current)||void 0===o?void 0:o.base.querySelector(`#collapse-text-${A.current}`),L=yl(Xc(b(h))),H=le(Mi).analyticsDispatcher;let P;dd(c.getCSSFontProperties("body"))||(P=c.getCSSFontProperties("body"));const R=c.getNumericFontSize("body"),V=Object.assign(Object.assign(Object.assign({},w&&{subviewId:w}),S&&{subviewTitle:S}),w&&{subviewLevel:1}),$=c.getCSSColor("icon.body",{skipFallback:!0}),N=c.getCSSColor("icon.body"),W=()=>{if(!(k.current&&C.current&&m&&p))return T(null),I(!1),F(!1);const e=C.current.base;e.style.width=getComputedStyle(k.current.base).width;const t=getComputedStyle(k.current.base).lineHeight,n=getComputedStyle(k.current.base).fontSize;let r;r=isNaN(parseFloat(t))?Math.ceil((parseFloat(n)+1)*m):Math.ceil((parseFloat(t)+1)*m);let i=0,o="",a=!1;const s=document.createElement("div");s.innerHTML=L;const l=Array.from(s.children);for(let t=0;t<l.length;t++){const n=l[t].cloneNode(!0);e.innerHTML="",e.appendChild(n);const s=e.getBoundingClientRect().height;if(!(Math.ceil(i+s)<r)){if(Math.ceil(i+s)===r){i+=s,o+=n.outerHTML;if(t<l.length-1){const t=ic(n,Math.ceil(s),e,A.current,c,g);o=o.replace(n.outerHTML,t),a=!0}break}if(t<l.length-1||n.textContent.length>0){o+=ic(n,Math.ceil(r-i),e,A.current,c,g),a=!0}else o+=n.outerHTML;break}i+=s,o+=n.outerHTML}a?(T(o),F(!0)):F(!1)};re((()=>{let e;if(p){const t=()=>{W()};document.fonts.onloadingdone=t,"ResizeObserver"in window&&(e=new ResizeObserver(W),e.observe(document.body))}const t=e=>{D(e.matches?"dark":"light")};return tc().addEventListener("change",t),()=>{var n;null===(n=e)||void 0===n||n.disconnect(),document.fonts.onloadingdone=null,tc().removeEventListener("change",t)}}),[L]),re(W,[L,m,p,j,g,v]),re((()=>{const e=()=>I(!0),t=()=>I(!1),n=k.current.base;if(!n)return;const r=n.querySelector(`#expand-text-${A.current}`),i=n.querySelector(`#collapse-text-${A.current}`);return r&&r.addEventListener("click",e),i&&i.addEventListener("click",t),()=>{r&&r.removeEventListener("click",e),i&&i.removeEventListener("click",t)}}),[_,E,O,x,M]),re((()=>{const e=document.querySelector(`#markdown-${A.current}`);if(e){Array.from(e.querySelectorAll(".md-subview-link")).forEach((e=>{e.addEventListener("click",(()=>{var t;I(!1),F(!1),T(null),ye().handleSubviewLinkPress(y,null==e||null===(t=e.dataset)||void 0===t?void 0:t.subviewId)})),e.addEventListener("keydown",(t=>{var n;Er(t.key)===Dr&&(I(!1),F(!1),T(null),ye().handleSubviewLinkPress(y,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;H.sendEvent({cardInstanceId:y,cardViewState:f?"subview":"topview",eventName:Je,properties:Object.assign({linkMethod:"url",url:null!=n?n:"",detail:"textLink"},V)})}))}))}}),[L,M,x]);return(0,Y.h)(Y.Fragment,null,(0,Y.h)(ec,{key:l,theme:c,bodyFontProperties:P,isWorkflow:f,"data-element-key":l,"data-testid":"text-block"},(d||u)&&(0,Y.h)(pn,{iconName:d,iconUrl:u,size:null!=R?R:20,color:null!==$?$:void 0,fallbackColor:N,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(n=null===(a=P)||void 0===a?void 0:a.lineHeight)&&void 0!==n?n:"initial",marginRight:"10px",width:`${R}px`,minWidth:`${R}px`,textAlign:"center"}}),(0,Y.h)(Ql,{id:`markdown-${A.current}`,"data-testid":"text-markdown",theme:c,ref:k,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:L&&0!==L.length&&null!==M?x||!O?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}(L,M,null===(z=C.current)||void 0===z?void 0:z.base,rc(null!=v?v:"Show less",c,"collapse",`collapse-text-${A.current}`,(null===(U=k.current)||void 0===U?void 0:U.base.getBoundingClientRect().width)+"px")):O:"<p></p>"}}),(0,Y.h)(Gl,{dangerouslySetInnerHTML:{__html:L}})),(0,Y.h)(Xl,{bodyFontProperties:P,isWorkflow:f,"aria-hidden":"true"},(d||u)&&(0,Y.h)(pn,{iconName:d,iconUrl:u,size:null!=R?R:20,color:null!==$?$:void 0,fallbackColor:N,styles:{gridArea:"1",alignSelf:"center",lineHeight:null!==(r=null===(s=P)||void 0===s?void 0:s.lineHeight)&&void 0!==r?r:"initial",marginRight:"10px",width:`${R}px`,minWidth:`${R}px`,textAlign:"center"}}),(0,Y.h)(Jl,{theme:c,ref:C})));var z,U},list:e=>{let t,{nodeKey:n,attributes:{type:r},children:i,theme:o}=e;switch(r){case"bullet":t=pl;break;case"number":t=ml;break;case"comma":t=gl}return t?(0,Y.h)(t,{key:n,"data-element-key":n,theme:o},i):null},listItem:e=>{let{nodeKey:n,attributes:{text:r,icon:i},theme:o,isWorkflow:a,variableResolver:s,cardInstanceId:l,subviewId:c,subviewTitle:d}=e;const u=oe((0,t.v4)()),h=le(Mi).analyticsDispatcher,p=yl(Xc(s(r))),m=Object.assign(Object.assign(Object.assign({},c&&{subviewId:c}),d&&{subviewTitle:s(d)}),c&&{subviewLevel:1});let g;re((()=>{const e=document.querySelector(`#markdown-${u.current}`);if(e){Array.from(e.querySelectorAll(".md-subview-link")).forEach((e=>{const t=()=>{var t,n;ye().handleSubviewLinkPress(l,null==e||null===(t=e.dataset)||void 0===t?void 0:t.subviewId),c&&(null==e||null===(n=e.dataset)||void 0===n?void 0:n.subviewId)!==c&&h.sendEvent({cardInstanceId:l,cardViewState:"subview",eventName:st,properties:m})};e.addEventListener("click",t),e.addEventListener("keydown",(e=>{Er(e.key)===Dr&&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:a?"subview":"topview",eventName:Je,properties:Object.assign({linkMethod:"url",url:null!=n?n:"",detail:"textLink"},m)})}))}))}}),[p]),dd(g)||(g=o.getCSSFontProperties("bullet"));const v=o.getCSSColor("icon.bullet",{skipFallback:!0}),f=o.getCSSColor("icon.bullet");return(0,Y.h)(Sl,{key:n,"data-element-key":n,theme:o,class:i?"with-icon":"without-icon"},i&&(0,Y.h)(pn,{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,Y.h)(kl,{id:`markdown-${u.current}`,theme:o,"data-testid":"list-item-text",dangerouslySetInnerHTML:{__html:p}}))},image:t=>{let n,{nodeKey:r,cardInstanceId:i,subviewId:o,subviewTitle:a,theme:s,attributes:{format:l,thumbnailSrc:c,description:d,label:u,src:h,dimensions:p,altText:m,behaviour:g,url:v,target:f,layoutId:b,payload:y},variableResolver:w}=t;const S=le(Mi),k=S.containersBroadcastChannel;switch(l){case"inline":n=_l;break;case"banner":n=Dl;break;case"thumbnail":n=Fl;break;case"text":n=Hl}const C=h&&h.length>0?"image":"imageWithoutSrc";return n?(0,Y.h)(me.lj,{actions:(0,e.Y2)(ge,$e),mapToProps:e=>({customStrings:e.application.customStrings})},(e=>{const t=se((()=>{switch(g){case"url":return v?e=>{e.preventDefault();const t={url:w(v),target:e.ctrlKey||e.metaKey?"_blank":null!=f?f:"_blank"};if(S.analyticsDispatcher.sendEvent({cardInstanceId:i,cardViewState:o?"subview":"topview",eventName:Je,properties:Object.assign({linkMethod:"url",url:t.url,trigger:"image"},o?{subviewId:o,subviewTitle:a,subviewLevel:1}:{})}),"_top"===t.target&&k){const e=`${r}-image-link`;return k.addEventListener("message",(n=>{if(n.data.type===ps.ANALYTICS_EVENT){var r;const o=null===(r=n.data)||void 0===r?void 0:r.eventQueued;o.eventName===Je&&o.cardInstanceId===i&&k&&t&&(k.removeEventListener(e),window.open(t.url,t.target))}}),e)}return window.open(t.url,t.target)}:()=>{Qe.error({level2:[`url type image link for card: ${i} has no url`]})};case"subview":return b?()=>{e.handleImageLinkPress(i,{layoutId:b,currentSubviewId:o,currentSubviewTitle:a})}:()=>{Qe.error({level2:[`subview type image link for card: ${i} has no subview id`]})};case"payload":return y?()=>{e.handleImageLinkPress(i,{payload:y,currentSubviewId:o,currentSubviewTitle:a})}:()=>{Qe.error({level2:[`payload type image link for card: ${i} has no payload`]})};case"none":return;default:return()=>{e.viewMedia(i,Object.assign({type:C,url:w(h),title:w(u)},(null==m?void 0:m.src)?{alt:w(m.src)}:{}))}}}),[g,i,k]);return(0,Y.h)(n,{nodeKey:r,mediaType:C,theme:s,customStrings:e.customStrings,src:w(c),dimensions:p,url:v,label:w(u),description:w(d),alt:w(null==m?void 0:m.thumbnailSrc),onClickImage:t})})):null},video:e=>{let{nodeKey:t,cardInstanceId:n,attributes:r,theme:i,isWorkflow:o,variableResolver:a}=e;const[s,l]=te(!1),[c,d]=te(void 0);return s?(0,Y.h)(Yl,{nodeKey:t,cardInstanceId:n,isWorkflow:o,format:r.format,src:a(r.src),thumbnailSrc:a(r.thumbnailSrc),dimensions:r.dimensions,loadedDimensions:c,theme:i,label:a(r.label),description:a(r.description)}):(0,Y.h)(Bl,{nodeKey:t,cardInstanceId:n,isWorkflow:o,format:r.format,src:a(r.src),thumbnailSrc:a(r.thumbnailSrc),dimensions:r.dimensions,onLoad:d,theme:i,label:a(r.label),description:a(r.description),altText:{src:a(null===(u=r.altText)||void 0===u?void 0:u.src),thumbnailSrc:a(null===(h=r.altText)||void 0===h?void 0:h.thumbnailSrc)},setPlaying:l});var u,h},form:e=>{let{cardInstanceId:t,subviewId:n,attributes:{defaultValues:r},isWorkflow:i,feedOrientation:o,children:a}=e;return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(0,Y.h)(al,{isWorkflow:i,feedOrientation:o,initializeFormStore:sl(e,t,r,n)},a)))},textInput:Ka,numberInput:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{defaultValue:i,thumbnailSrc:o,placeholder:a,name:s},theme:l,validations:c,variableResolver:d}=e;const u=oe(null),h=oe(i&&Yc(i.toString())?i.toString():""),[p,m]=te(h.current);re((()=>{const e=Ye(n,s,r);if(e)h.current=e.toString(),m(e.toString());else{const e=Yc(p);Be().handleFormChange(n,s,null!=e?e:void 0,r)}}),[]),re((()=>{const e=i&&Yc(i.toString())?i.toString():"";if(e!==h.current){if(p===h.current){const t=Yc(e);Be().handleFormChange(n,s,null!=t?t:void 0,r),m(e)}h.current=e}}),[i]);const g=d(a);return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(0,Y.h)(Y.Fragment,null,(0,Y.h)(Yo,{nodeKey:t,mode:"inline",theme:l},o&&(0,Y.h)(Zo,{thumbnailUrl:d(o),theme:l}),(0,Y.h)(qa,{theme:l,ref:u,placeholder:g,value:p,title:g,className:"input-number",inputmode:"decimal",onInput:t=>{const{value:i}=t.target,o=p;let a;m(i),a=Kc(i)?i.trim():o,m(a);const l=Yc(a);((e,t)=>{null!==bc&&(clearTimeout(bc),bc=null),bc=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,Y.h)(ea,{name:s,cardInstanceId:n,subviewId:r,theme:l,variableResolver:d}))))},stepper:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{defaultValue:i,minimumValue:o,maximumValue:a,stepValue:s,thumbnailSrc:l,label:c,name:d},validations:u,theme:h,variableResolver:p}=e;const m=o||0,g=a||100,v=s&&s>0?s:1,f=oe(i&&i>=m&&i<=g?i:m),[b,y]=te(f.current),[w,S]=te(f.current),[k,C]=te(!0),x=h.getCSSColor("icon.stepper"),I=h.getCSSColor("icon.stepperDisabled"),O=null==b||!hc(b,g,v)||!k,T=null==b||!uc(b,m,v)||!k;re((()=>{const e=Ye(n,d,r);e?(f.current=e,y(e),S(e)):Be().handleFormChange(n,d,b,r)}),[]),re((()=>{const e=i&&i>=m&&i<=g?i:m;e!==f.current&&(w===f.current&&(Be().handleFormChange(n,d,e,r),y(e),S(e)),f.current=e)}),[i]);const M=p(c),F=(e,t)=>{null!==pc&&(clearTimeout(pc),pc=null),pc=setTimeout((()=>{t(n,d,null!=e?e:void 0,u,r)}),400)};return(0,Y.h)(me.lj,{actions:$e,mapToProps:e=>{let{}=e}},(e=>(0,Y.h)(Y.Fragment,null,(0,Y.h)(Yo,{nodeKey:t,mode:"inline",theme:h,cursor:"default"},l&&(0,Y.h)(Zo,{thumbnailUrl:p(l),theme:h}),(0,Y.h)(dc,{theme:h},M),(0,Y.h)(sc,{theme:h},(0,Y.h)(lc,{theme:h,disabled:T,tabIndex:"0","aria-label":`Decrease value by ${v}`,class:"stepper-decrement",onClick:()=>{if(null==b||!uc(b,m,v)||!k)return;const t=((e,t,n)=>e-t<n?n:e-t)(b,v,m);S(t),y(t),e.handleFormChange(n,d,t,r),F(t,e.validateField)}},(0,Y.h)(ac,{fillColor:T?I:x})),(0,Y.h)(cc,{type:"number",theme:h,tabIndex:"0",title:M,className:"stepper-value",onInput:t=>{const{value:i}=t.target,o=w;let a;S(i),a=Kc(i)?i.trim():o,C(((e,t,n)=>e>=t&&e<=n)(a,m,g)),S(a);const s=Yc(a);y(s),e.handleFormChange(n,d,null!=s?s:void 0,r),F(s,e.validateField)},onBlur:()=>{e.validateField(n,d,b,u,r)},value:w}),(0,Y.h)(lc,{theme:h,disabled:O,tabIndex:"0","aria-label":`Increase value by ${v}`,class:"stepper-increment",onClick:()=>{if(null==b||!hc(b,g,v)||!k)return;const t=((e,t,n)=>e+t>n?n:e+t)(b,v,g);S(t),y(t),e.handleFormChange(n,d,t,r),F(t,e.validateField)}},(0,Y.h)(oc,{fillColor:O?I:x})))),(0,Y.h)(ea,{name:d,cardInstanceId:n,subviewId:r,theme:h,variableResolver:p}))))},checkbox:e=>{let{nodeKey:t,children:n,cardInstanceId:r,subviewId:i,attributes:{name:o},theme:a,variableResolver:s}=e;return(0,Y.h)(Y.Fragment,null,(0,Y.h)(Ec,{key:t,"data-element-key":t,role:"group"},(0,Y.h)(Lc,{"aria-label":"checkbox group"},n)),(0,Y.h)(ea,{name:o,cardInstanceId:r,subviewId:i,theme:a,variableResolver:s}))},checkboxItem:e=>{var t,n;let{nodeKey:r,cardInstanceId:i,subviewId:o,attributes:{label:a,key:s,checked:l},theme:c,variableResolver:d,parentFieldName:u,parentValidations:h}=e;const p=oe(l),m=oe(`${i}-${s}`),[g,v]=te(null!==(t=p.current)&&void 0!==t&&t),f=null!==(n=c.getCSSColor("icon.checkedCheckbox",{skipFallback:!0}))&&void 0!==n?n:"#FFF";let b;dd(b)||(b=c.getCSSFontProperties("primary"),parseInt(b.lineHeight)<20&&(b.lineHeight="20px"));const y=e=>{const t=Ye(i,u,o)||{};return Be().handleFormChange(i,u,Object.assign(Object.assign({},t),{[s]:e}),o),Object.assign(Object.assign({},t),{[s]:e})};return re((()=>{const e=Ye(i,u,o);void 0!==e&&void 0!==e[s]?(p.current=e[s],v(e[s])):y(g)}),[]),re((()=>{void 0!==l&&l!==p.current&&(g===p.current&&(v(l),y(l)),p.current=l)}),[l]),(0,Y.h)("li",null,(0,Y.h)(Pc,{key:r,"data-element-key":r,labelFontProperties:b,role:"checkbox","aria-labelledby":m.current,"aria-checked":g},(0,Y.h)(Rc,{type:"checkbox",checked:g,theme:c,onChange:()=>{v(!g);const e=y(!g);Be().validateField(i,u,e,h,o)},"aria-hidden":"true"}),(0,Y.h)(Vc,{theme:c,isChecked:g},g&&(0,Y.h)(Hc,{fillColor:f,style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},ariaHidden:!0})),(0,Y.h)($c,{theme:c,id:m.current,"data-testid":"checkbox-label",labelFontProperties:b,"aria-hidden":"true"},d(a))))},switch:e=>{let{nodeKey:t,cardInstanceId:n,subviewId:r,attributes:{defaultValue:i,thumbnailSrc:o,label:a,name:s},theme:l,variableResolver:c}=e;const d=oe(i),[u,h]=te(d.current);re((()=>{const e=Ye(n,s,r);void 0!==e?(d.current=e,h(e)):Be().handleFormChange(n,s,u,r)}),[]),re((()=>{i!==d.current&&(u===d.current&&(Be().handleFormChange(n,s,i,r),h(i)),d.current=i)}),[i]);const p=`switch-label-${s}`;return(0,Y.h)(me.lj,{actions:$e,mapToProps:()=>{}},(e=>(0,Y.h)(Yo,{nodeKey:t,mode:"inline",theme:l},o&&(0,Y.h)(Zo,{thumbnailUrl:c(o),theme:l}),(0,Y.h)(Go,{theme:l,name:p,mode:"inline",truncateLabel:!0},c(a)),(0,Y.h)(mc,{on:u,theme:l,tabIndex:"0",role:"switch","aria-checked":u,"aria-labelledby":p,className:"switch-toggle",onClick:()=>{h(!u),e.handleFormChange(n,s,!u,r)}},(0,Y.h)(gc,{on:u,theme:l})))))},dropdown:da,datePicker:ma,upload:Ac},zc=["linkButton","submitButton","dismissButton","snoozeButton","voteUpButton","voteDownButton"],Uc=e=>{let{node:t,cardInstanceId:n,cardMetadata:r,isWorkflow:i,theme:o,runtimeVariables:a,feedOrientation:s,subviewId:l,subviewTitle:c,embedMode:d,parentFieldName:u,parentValidations:h}=e;const p=Wc[t.type];return p?(0,Y.h)(p,Nc({},t.key&&{nodeKey:t.key},{cardInstanceId:n,cardMetadata:r,subviewId:l,subviewTitle:c,attributes:t.attributes,validations:t.validations,isWorkflow:i,theme:o,variableResolver:e=>ed(e,a),feedOrientation:s,embedMode:d,parentFieldName:u,parentValidations:h}),t.children&&t.children.map((e=>{var s;return(0,Y.h)(Uc,{cardInstanceId:n,cardMetadata:r,subviewId:l,subviewTitle:c,node:e,isWorkflow:i,theme:o,runtimeVariables:a,embedMode:d,parentFieldName:null===(s=t.attributes)||void 0===s?void 0:s.name,parentValidations:t.validations})}))):null},qc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"},Bc=/[&<>"'\/]/g,Yc=e=>{if(""===e)return null;const t=Number(e);return Number.isNaN(t)?null:t},Kc=e=>null!==Yc(e)||""===e||"-"===e,Zc=e=>{let t=Array();for(var n in e){const r=e[n];t.push(r),r.children&&(t=t.concat(Zc(r.children)))}return t},Qc=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)),zc.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)},Gc=(e,t)=>{const n=e=>{for(let r in e){const i=e[r];"string"==typeof i&&(e[r]=ed(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=ed(i.title,t))}},Xc=e=>e?e.replace(Bc,(e=>qc[e]||e)):"",Jc=/!\{([\w\.]+?)\}/g,ed=(e,t)=>e&&t&&"string"==typeof e?e.replace(Jc,((e,n)=>t.get(n)||"")):e||"",td={years:o.addYears,months:o.addMonths,weeks:o.addWeeks,days:o.addDays,hours:o.addHours,minutes:o.addMinutes,seconds:o.addSeconds},nd=e=>{if("string"!=typeof e)return null;const t=e.match(m);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},rd=(e,t)=>{const n=nd(e);return n?Object.entries(td).reduce(((e,t)=>{let[r,i]=t;const o=n[r];return o?i(e,o):e}),t):t},id=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},od=e=>{if(!ad(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")}},ad=e=>!!e.match(/^[\w-]+\.[\w-]+\.[\w-]*$/),sd=e=>{const t=u().getState().application.embedMode;return(null==e?void 0:e.enabled)&&"standalone"===t?"horizontal":"vertical"},ld=()=>{const e=sessionStorage.getItem(S),t=e?JSON.parse(e):void 0;return new Set(t)},cd=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),dd=e=>e&&cd(e)&&0===Object.keys(e).length,ud=(e,t)=>e.length===t.length&&(e.sort(),t.sort(),e.every(((e,n)=>e===t[n])));var hd=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 pd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const md=(e,t)=>{if(!e)return null;let n;try{n=od(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},gd="AtomicAnalyticsQueue";var vd=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 fd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bd={noInternet:"AACNoInternetError",missingApiHost:"AACMissingApiHostError",apiError:"AACApiError",invalidParameters:"AACInvalidParametersError",notPermitted:"AACOperationNotPermittedError",authTokenError:"AACAuthTokenError"},yd="Device is not connected to the internet",wd="API host was not specified for the request.",Sd="An API error occurred.",kd="Failed to retrieve an authentication token for request.",Cd={method:"GET",mode:"cors"},xd=e=>vd(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}})),Id=e=>e<400,Od=(e,t,n,r,o)=>{var a,s;const l=null!==(a=md(n,o))&&void 0!==a?a: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 Td{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 vd(this,void 0,void 0,(function*(){let i,o;if(this.verifyInitialised(),!navigator.onLine){const e=new Error(yd);return e.name=bd.noInternet,{response:{error:e}}}{const a=jd(this.apiHost,e,this.environmentId);if(!a){const e=new Error(wd);return e.name=bd.missingApiHost,{response:{error:e}}}let s;if(t)try{s=yield t.requestToken()}catch(e){const t=new Error(`${kd} ${e}`);return t.name=bd.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},Cd),{headers:Md({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 xd(t);if(n.json&&(i=n.json),!Id(t.status))throw Od(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(`${Sd} ${e}`);return t.name=bd.apiError,{data:i,response:{status:o,error:t}}}}}))}static post(e,t,n,r){return vd(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(yd);return e.name=bd.noInternet,{response:{error:e}}}{let i,o;const a=jd(this.apiHost,e,this.environmentId);if(!a){const e=new Error(wd);return e.name=bd.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${kd} ${e}`);return t.name=bd.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},Cd),{method:"POST",headers:Md({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 xd(t);if(n.json&&(i=n.json),!Id(t.status))throw Od(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(`${Sd} ${e}`);return t.name=bd.apiError,{data:i,response:{status:o,error:t}}}}}))}static put(e,t,n,r){return vd(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(yd);return e.name=bd.noInternet,{response:{error:e}}}{let i,o;const a=jd(this.apiHost,e,this.environmentId);if(!a){const e=new Error(wd);return e.name=bd.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${kd} ${e}`);return t.name=bd.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},Cd),{method:"PUT",headers:Md({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 xd(t);if(n.json&&(i=n.json),!Id(t.status))throw Od(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(`${Sd} ${e}`);return t.name=bd.apiError,{data:i,response:{status:o,error:t}}}}}))}static delete(e,t,n,r){return vd(this,void 0,void 0,(function*(){if(this.verifyInitialised(),!navigator.onLine){const e=new Error(yd);return e.name=bd.noInternet,{response:{error:e}}}{let i,o;const a=jd(this.apiHost,e,this.environmentId);if(!a){const e=new Error(wd);return e.name=bd.missingApiHost,{response:{error:e}}}let s;if(n)try{s=yield n.requestToken()}catch(e){const t=new Error(`${kd} ${e}`);return t.name=bd.authTokenError,{response:{error:t}}}const l=Object.assign(Object.assign({},Cd),{method:"DELETE",headers:Md({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 xd(t);if(n.json&&(i=n.json),!Id(t.status))throw Od(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(`${Sd} ${e}`);return t.name=bd.apiError,{data:i,response:{status:o,error:t}}}}}))}}fd(Td,"apiHost","https://client-api.atomic.io"),fd(Td,"apiKey",void 0),fd(Td,"environmentId",void 0),fd(Td,"instanceId",void 0),fd(Td,"testHost",void 0),fd(Td,"clientAppVersion","unknown"),fd(Td,"tokenUserIdAttribute",void 0);const Md=e=>Fd("header",Object.assign({},e)),Fd=(e,t)=>{const n="header"===e;let r={"x-atomic-sdk-platform":"Web","x-atomic-sdk-version":"25.2.3","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},jd=(e,t,n)=>{if(!e||0==e.trim().length)return null;return`${e.endsWith("/")?e:`${e}/`}${n&&n.trim().length>0?`${n}/`:""}${t}`};function Dd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ad=e=>{const t=new Error(e);return t.name="Stream filter error",Qe.error({level1:[t]}),t},_d=(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 Ed{constructor(e,t){var n=this;Dd(this,"filters",void 0),Dd(this,"onApplyFilter",void 0),Dd(this,"onClearFilter",void 0),Dd(this,"addVariableFilter",(e=>this.variableFilter("variables",e,"addVariableFilter"))),Dd(this,"addPayloadVariableFilter",(e=>this.variableFilter("eventPayload.detail",e,"addPayloadVariableFilter"))),Dd(this,"addPayloadMetadataFilter",(e=>this.variableFilter("eventPayload.metadata",e,"addPayloadMetadataFilter","metadata"))),Dd(this,"variableFilter",(function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"variable";if(!t)throw Ad(`The name of the ${i} you are filtering by must be supplied to \`${r}\``);return Ld(n.filters,e,t,(e=>{const t=Array.isArray(e);if(!t&&!["string","number","boolean","null"].includes(typeof e))throw Ad(`Incorrect value provided for "${i}" filter. Must be a string, a number, a boolean or null.`);if(t&&!_d(e,["string","number"]))throw Ad(`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"])})),Dd(this,"addCardTemplateIdFilter",(()=>Ld(this.filters,"metadata","cardTemplateId",(e=>{const t=Array.isArray(e);if(!t&&"string"!=typeof e)throw Ad('Incorrect "card template id" filter value provided, must be a string.');if(t&&!_d(e,["string"]))throw Ad('Incorrect "card template id" filter value provided, for "in" or "notIn" an array of strings must be supplied.')}),["equals","in","notEqualTo","notIn"]))),Dd(this,"addCardTemplateNameFilter",(()=>Ld(this.filters,"metadata","cardTemplateName",(e=>{const t=Array.isArray(e);if(!t&&"string"!=typeof e)throw Ad('Incorrect "card template name" filter value provided, must be a string.');if(t&&!_d(e,["string"]))throw Ad('Incorrect "card template name" filter value provided, for "in" or "notIn" an array of strings must be supplied.')}),["equals","in","notEqualTo","notIn"]))),Dd(this,"addCardCreatedFilter",(()=>Ld(this.filters,"metadata","created",(e=>{if("string"!=typeof e||!id(e))throw Ad('Incorrect "card created" filter value provided, must be a valid ISO date string')}),["equals","greaterThan","greaterThanOrEqualTo","lessThan","lessThanOrEqualTo","notEqualTo"]))),Dd(this,"addCardPriorityFilter",(()=>Ld(this.filters,"metadata","priority",(e=>{const t=typeof e,n=Array.isArray(e);if(n&&!_d(e,["number"]))throw Ad('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 Ad('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 Ad('Incorrect "card priority" filter value provided, must be a number between 1 & 10 inclusive.')}),["equals","greaterThan","greaterThanOrEqualTo","in","lessThan","lessThanOrEqualTo","notEqualTo","notIn","between"]))),Dd(this,"clearFilters",(()=>{this.filters={},this.onClearFilter()})),Dd(this,"apply",(()=>{this.onApplyFilter()})),Dd(this,"getFilterObject",(()=>this.filters)),this.filters={},this.onApplyFilter=e,this.onClearFilter=t}}const Ld=(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 Ad(`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 Ad(`Operator "${n}" must be a number or ISO date string`);if("string"===r&&!id(t))throw Ad(`Operator "${n}" must be a number or ISO date string`);break;case"in":case"nin":if(!Array.isArray(t))throw Ad(`Operator "${n}" must be either an array of numbers or an array of strings`);if(!_d(t,["string","number"]))throw Ad(`Operator "${n}" must be either an array of numbers or an array of strings`);break;case"between":if(2!==t.length||!_d(t,["number"]))throw Ad(`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")};return Object.keys(a).forEach((e=>{i.includes(e)||delete a[e]})),a},Hd="custom-ping",Pd="auth",Rd="subscribe",Vd="unsubscribe",$d="events",Nd="custom-pong",Wd="auth-success",zd="token-expiry",Ud="update-cards",qd="events-processed",Bd="error",Yd="invalid-token",Kd="expired-token",Zd="invalid-stream-container-id",Qd="invalid-filter",Gd="invalid-message",Xd=()=>{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 Jd=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 eu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tu={name:"Invalid stream container id",message:"an invalid stream container id was provided with the subscription request"},nu={name:"Invalid filter",message:"an invalid filter was provided with the subscription request"},ru={name:"Invalid token",message:'Atomic platform responded with an "invalid token" message'},iu={name:"Expired token",message:'Atomic platform responded with an "expired token" message'};class ou{static reset(){this.activeSubscriptions={},this.lastPongSuccess=void 0}static messageSubscribedContainer(e,t){if(void 0===Ru.streamContainers[e])return Qe.error({level3:["No stream container found for subscriptionId: ",e]});Ru.streamContainers[e].sendMessageToIframe(t)}static messageAllSubscribedContainers(e){Object.values(this.activeSubscriptions).forEach((t=>{this.messageSubscribedContainer(t.subscriptionId,e)}))}static handleWebSocketMessage(e){return Jd(this,void 0,void 0,(function*(){switch(e.messageType){case Nd:Qe.debug({level1:["pong received by WebSockets"],level2:[e]}),this.lastPongSuccess=(new Date).toISOString();break;case Wd:hu.connectionAuthenticated||(hu.connectionAuthenticated=!0,Ru.authMessageResolve()),Qe.debug({level1:["auth success received by WebSockets"],level2:[e]});break;case zd:Qe.debug({level1:["token expiry received by WebSockets"],level2:[e]}),hu.connectionAuthenticated=!1;try{yield Ru.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){Qe.error({level1:["Token expired, new token request failed"],level2:[e]})}break;case Ud:{Qe.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:g,values:{cardFeedUpdates:n[e]}})}));break}case qd:{var t;Qe.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)&&Ru.analyticsQueue.removeProcessedEvents(n);break}case Bd:this.handleWebSocketErrorMessage(e);break;default:Qe.debug({level1:["unknown message received by WebSockets"],level2:[e]})}}))}static handleWebSocketErrorMessage(e){var t,n,r;return Jd(this,void 0,void 0,(function*(){switch(e.data.errorType){case Yd:{const e=new Error(ru.message);e.name=ru.name,Qe.error({level1:["Invalid token error received by WebSockets."],level2:[e]}),hu.connectionAuthenticated||Ru.authMessageReject(e),hu.connectionAuthenticated=!1;try{yield Ru.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){Qe.error({level1:["Token invalid, new token request failed"],level2:[e]}),this.messageAllSubscribedContainers({action:"io.atomic.events.invalidToken",values:null!==(t=e.message)&&void 0!==t?t:e})}break}case Kd:{const t=new Error(null!==(n=e.data.errorMessage)&&void 0!==n?n:iu.message);t.name=iu.name,Qe.error({level1:["Expired token error received by WebSockets"],level2:[t]}),hu.connectionAuthenticated||Ru.authMessageReject(t),hu.connectionAuthenticated=!1;try{yield Ru.handleTokenRequest({skipCache:!0,authWebSocket:!0}),this.resubscribeActiveSubscriptions()}catch(e){Qe.error({level1:["Token expired, new token request failed"],level2:[e]}),this.messageAllSubscribedContainers({action:"io.atomic.events.expiredToken",values:null!==(r=e.message)&&void 0!==r?r:e})}break}case Zd:{var i;const t=e.data.subscriptionId,n=new Error(`${tu.message} - ${null===(i=this.activeSubscriptions[t])||void 0===i?void 0:i.streamContainerId}`);n.name=tu.name,Qe.error({level1:["Invalid stream container id error received by WebSockets"],level2:[n]}),this.messageSubscribedContainer(t,{action:"io.atomic.events.invalidStreamContainerId",values:n.message});break}case Qd:{const t=e.data.subscriptionId,n=new Error(nu.message);n.name=nu.name,n.message=nu.message,Qe.error({level1:["Invalid filter error received by WebSockets"],level2:[n]}),this.messageSubscribedContainer(t,{action:"io.atomic.events.invalidFilter",values:n.message});break}case Gd:Qe.error({level1:["Invalid message error received by WebSockets"],level2:[e]});break;default:Qe.debug({level1:["unknown error received by WebSockets"],level2:[e]})}}))}static subscribeToCardFeed(e){try{hu.dispatchMessage({messageType:Rd,data:{subscriptions:e}}),e.forEach((e=>this.activeSubscriptions[e.subscriptionId]=e))}catch(e){throw Qe.error({level1:["Error subscribing to card feed via WebSocket"],level2:[e]}),e}}static unsubscribeFromCardFeed(e){try{hu.dispatchMessage({messageType:Vd,data:{subscriptionIds:e}}),e.forEach((e=>delete this.activeSubscriptions[e]))}catch(e){Qe.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:f}))))}static unsubscribeActiveSubscriptions(){const e=Object.values(this.activeSubscriptions);e.length&&this.unsubscribeFromCardFeed(e.map((e=>e.subscriptionId)))}static sendAuthMessage(e){try{hu.dispatchMessage({messageType:Pd,authToken:e})}catch(e){Qe.error({level1:["Error sending auth message to WebSocket"],level2:[e]})}}static sendAnalyticsMessage(e,t){if(!Ru.webSocketDisabled&&hu.isConnected())try{hu.dispatchMessage({messageType:$d,authToken:t,data:{events:e}})}catch(e){Qe.error({level1:["Error sending analytics message to WebSocket"],level2:[e]})}}}function au(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let su;eu(ou,"activeSubscriptions",{}),eu(ou,"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"}(su||(su={}));const lu={name:"Not initialised",message:"WebSocket client has not been initialised"},cu={name:"No connection",message:"WebSocket connection is not established"},du={name:"WebSocket not ready",message:"WebSocket connection is not ready to send message"},uu={name:"Dispatch message error",message:"Unable to dispatch the client message on the WebSocket connection"};class hu{static initialise(e,t,n){let r;try{r=new URL(e),r.protocol="https:"===r.protocol?"wss":"ws"}catch(e){throw Qe.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(su.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&&(Qe.debug({level3:[`WebSocket client visibilitychange event triggered, page is ${document.visibilityState} checking connection health`]}),this.connectionHealthCheck())})),Xd()&&(document.addEventListener("pause",(()=>{Qe.debug({level3:["Cordova app pause event triggered"]}),this.close(su.sdkCordovaBackgrounded,"Connection closed by SDK, clean up WebSocket connection as app has been backgrounded")}),!1),document.addEventListener("resume",(()=>{Qe.debug({level3:["Cordova app resume event triggered"]}),Ru.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:Hd})}catch(e){Qe.error({level3:["Error sending custom ping message:",e]})}this.pingTimeout=setTimeout((()=>{Qe.debug({level3:["WebSocket client ping timeout reached, closing connection"]}),this.close(su.sdkClosedConnection,"connection timed out")}),this.connectionTimer)}),this.connectionTimer)}static setClientAppVersion(e){this.clientAppVersion=e}static connectionHealthCheck(){hu.isInitialised()&&hu.isConnected()&&ou.lastPongSuccess&&(0,o.differenceInMilliseconds)((new Date).toISOString(),ou.lastPongSuccess)>this.staleConnectionTimer&&(Qe.debug({level3:["WebSocket connection has become stale, re-initialising"]}),Ru.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===su.sdkSessionEnding&&ou.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===Rd)t=e,t.data.subscriptions=t.data.subscriptions.filter((e=>Object.keys(Ru.streamContainers).includes(e.subscriptionId))),t.data.subscriptions.length||(t=null);else t=e;try{t&&this.dispatchMessage(t),Qe.debug({level3:["WebSocket client purging message queue, message sent by WebSockets: ",t]})}catch(e){Qe.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}),o=JSON.stringify(i);try{const t=this.webSocketConnection;if(!t)throw new Error(cu.message);if(t.readyState===t.CLOSING||t.readyState===t.CLOSED)throw new Error(du.message);return t.readyState===t.CONNECTING?this.messageQueue.push(e):t.send(o)}catch(e){const t=new Error;throw t.name=uu.name,t.message=null!==(n=e.message)&&void 0!==n?n:uu.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(lu.message);if(!navigator.onLine){const e=new Error(yd);throw e.name=bd.noInternet,e}const r=jd(this.apiHost,e,this.environmentId);if(!r){const e=new Error(wd);throw e.name=bd.missingApiHost,e}if(this.webSocketConnection)switch(this.webSocketConnection.readyState){case this.webSocketConnection.OPEN:this.close(su.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=Fd("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=su.sdkSessionEnding;e.persisted&&(t=su.sdkPersistedToBrowserCache),this.close(t,"Connection closed by SDK, clean up WebSocket connection as page has been closed"),ou.lastPongSuccess=void 0,window.removeEventListener("pagehide",o)};return window.addEventListener("pagehide",o),this.webSocketConnection.readyState}catch(e){throw this.openingConnection=!1,e}}}au(hu,"apiHost",void 0),au(hu,"apiKey",void 0),au(hu,"environmentId",void 0),au(hu,"clientAppVersion","unknown"),au(hu,"testHost",void 0),au(hu,"openingConnection",!1),au(hu,"authenticatingConnection",!1),au(hu,"connectionAuthenticated",!1),au(hu,"authenticationTimeout",7e3),au(hu,"messageQueue",[]),au(hu,"webSocketConnection",void 0),au(hu,"connectionTimeout",void 0),au(hu,"pingTimeout",void 0),au(hu,"connectionTimer",3e4),au(hu,"staleConnectionTimer",2*hu.connectionTimer+5e3);const pu={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"},mu=[pu.cardFeedUpdated,pu.cardCompleted,pu.cardDismissed,pu.cardSnoozed,pu.streamDisplayed,pu.sdkInitialized,pu.cardDisplayed],gu=e=>(!e.eventName&&e.analyticsEvent&&(e.eventName=e.analyticsEvent),e),vu=e=>{const n=(new Date).toISOString();return{id:(0,t.v4)(),analyticsEvent:pu.cardFeedUpdated,eventName:pu.cardFeedUpdated,endUserId:e.endUserId,timestamp:n,properties:{cardCount:e.cardCount},sdkContext:{containerId:e.streamContainerId},eventContext:{userLocalTimestamp:(0,o.format)(n,"YYYY-MM-DDTHH:mm:ss.SSSZ")}}};function fu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class bu{constructor(e){var t,n,r,i,o;fu(this,"totals",void 0),fu(this,"metricsByContainer",void 0);const a=ld();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 yu=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 wu;const Su=(e,t,n)=>yu(void 0,void 0,void 0,(function*(){if(Ou(),!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:wu.deviceId,appId:wu.appId,streamContainerIds:e,platform:wu.platform},n?{notificationsEnabled:n}:{});const{data:i,response:o}=yield Td.put("register-containers",r,t,{streamContainerIds:e});if(Tu(Su.name,i),o.error)throw o.error;return 200===o.status})),ku=(e,t)=>yu(void 0,void 0,void 0,(function*(){Ou();let n={token:e,deviceId:wu.deviceId,appId:wu.appId,platform:wu.platform};const{data:r,response:i}=yield Td.put("register",n,t);if(Tu(ku.name,r),i.error)throw i.error;return 200===i.status})),Cu=e=>yu(void 0,void 0,void 0,(function*(){Ou();let t={deviceId:wu.deviceId,appId:wu.appId};const{data:n,response:r}=yield Td.delete("deregister-token",t,e);if(Tu(Cu.name,n),r.error)throw r.error;return 200===r.status})),xu=e=>{if(!cd(e))return null;const t=e.atomic;if(!cd(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:cd(a)?a:{}}},Iu=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:[]}},Ou=()=>{if(!Iu(wu).success)throw new Error("You must call setNativeDeviceInfo before registering for native notifications")},Tu=(e,t)=>{var n;(null==t||null===(n=t.errors)||void 0===n?void 0:n.length)&&Qe.error({level1:[`Errors detected with ${e}`,...t.errors.map((e=>null==e?void 0:e.title))]})};var Mu=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 Fu=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&&(Qe.warn({level1:n}),delete e.preferences.notifications)}};var ju=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 Du(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Au=n(5373),_u="authCallbackError",Eu="authRetryIntervalPending",Lu="authTokenError",Hu=(e,t)=>{t(e)},Pu=(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?Xd():"https://downloads.atomic.io/web-sdk/release/25.2.3/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 c=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 d=`\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,"&apos;")}' type='application/javascript'><\/script>\n <div id='custom-container-header' style='display:none;'>${null!=c?c:""}</div>\n </body>\n </html>\n`;e.setAttribute("srcdoc",d)};class Ru{static setSessionDelegate(e,t){this.tokenRetryInterval=t||0,this.onAuthTokenRequested=e}static setTokenExpiryInterval(e){if(!("number"==typeof e&&e>0))return Qe.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){Ru.init();const t=new Vu(e,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:!1}),"launcher",this.analyticsQueue);return Ru.streamContainers[t.instanceId]={sendMessageToIframe:e=>t.sendMessageToIframe(e),logout:()=>{t.sendMessageToIframe({action:h})}},t}static embed(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Ru.init();const r=new Vu(t,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:n}),"standalone",this.analyticsQueue,e);return Ru.streamContainers[r.instanceId]={sendMessageToIframe:e=>r.sendMessageToIframe(e),logout:()=>{r.sendMessageToIframe({action:h})}},r}static singleCard(e,t){Ru.init();const n=new Vu(t,Object.assign(Object.assign({},this.internalConfig),{autosizeFrame:!0}),"single-card",this.analyticsQueue,e);return Ru.streamContainers[n.instanceId]={sendMessageToIframe:e=>n.sendMessageToIframe(e),logout:()=>{n.sendMessageToIframe({action:h})}},n}static observableStreamContainer(e){Ru.init();const t=new $u(e,Object.assign({},this.internalConfig),this.analyticsQueue);return Ru.streamContainers[t.instanceId]={sendMessageToIframe:e=>t.onMessageReceived(e),logout:()=>{t.onMessageReceived({action:h})}},t}static init(){return ju(this,void 0,void 0,(function*(){if(!Ru.hasPerformedInitialisation){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Au)),document.head.appendChild(e),window.addEventListener("request-failed",(e=>{const t=e.detail,n=this.analyticsQueue.enqueue({timestamp:new Date,endUserId:t.request.endUserId||"",containerId:t.request.streamContainerId,containerIds:t.request.streamContainerIds,cardInstanceId:t.request.cardInstanceId,eventName:lt,properties:{path:t.request.path,statusCode:t.request.statusCode}});if(n){var r;ou.sendAnalyticsMessage([n]);const e=gu(n);null===(r=Ru.sdkEventObserver)||void 0===r||r.call(Ru,e)}})),Ru.hasPerformedInitialisation=!0}const e=hu.webSocketConnection;e&&(null==e?void 0:e.readyState)!==(null==e?void 0:e.CLOSED)||this.internalConfig.webSocketDisabled||(yield this.createWebSocketConnection().catch((e=>{var t;Qe.debug({level3:[`SDK init, error creating WebSocket connection: ${e}`]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)})))}))}static initialise(e,t,n){return ju(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(w,JSON.stringify({initialiseCalled:!0,eventDispatched:!1})),Ru.cachedToken=void 0,Td.initialise(e,t,n),this.internalConfig.webSocketDisabled||(hu.initialise(e,t,n),ou.reset(),yield this.createWebSocketConnection().catch((e=>{var t;Qe.debug({level3:[`SDK initialise, error creating WebSocket connection: ${e}`]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)}))),window.AtomicUploadService=Tt,window.addEventListener("pageshow",(r=>{r.persisted&&(Td.initialise(e,t,n),this.internalConfig.webSocketDisabled||(hu.initialise(e,t,n),this.createWebSocketConnection().catch((e=>{var t;Qe.debug({level3:[`SDK network clients reinitialized after page loaded from cache, error creating WebSocket connection: ${e}`]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)}))),this.initialiseSDKBroadcastChannel())}))}))}static initialiseSDKBroadcastChannel(){var e;(null===(e=Ru.containersBroadcastChannel)||void 0===e?void 0:e.isOpen)||(Ru.containersBroadcastChannel=new ms)}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;Qe.logLevel=e,Object.values(Ru.streamContainers).forEach((t=>t.sendMessageToIframe({action:"io.atomic.events.logLevelUpdate",values:{logLevel:e}})))}static createWebSocketConnection(){return ju(this,arguments,void 0,(function*(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;const n={1:100,2:15e3,3:6e4};if(hu.openingConnection)return;const r={onMessage:e=>{ou.handleWebSocketMessage(e)},onError:e=>{Qe.error({level3:["WebSocket error handler received error message",e]})},onOpen:()=>ju(this,void 0,void 0,(function*(){try{yield this.handleTokenRequest({skipCache:!0,authWebSocket:!0}),ou.lastPongSuccess=(new Date).toISOString(),ou.resubscribeActiveSubscriptions()}catch(e){Qe.error({level1:["Error authenticating WebSocket."],level2:[e]}),Object.values(Ru.streamContainers).forEach((t=>{t.sendMessageToIframe({action:b,values:e instanceof Error?e.message:e})}))}})),onClose:r=>{switch(r.code){case su.sdkChangingProtocol:case su.sdkReinitialisedWebSocket:case su.sdkSessionEnding:case su.sdkCordovaBackgrounded:case su.sdkPersistedToBrowserCache:case su.unitTestConnectionClose:Qe.debug({level1:[`WebSocket closed with ${r.code} connection close code`],level2:[r]});break;case su.retryConnection:if(Qe.debug({level1:[`WebSocket closed with ${r.code} connection close code`],level2:[r]}),e<3){const t=e+1;setTimeout((()=>{this.createWebSocketConnection(t).catch((e=>{var t;Qe.debug({level3:["Error on websocket connection retry",e]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)}))}),n[t])}else this.triggerPollingFallback(t);break;case su.sdkClosedConnection:case su.notPermitted:case su.abnormalClosure:default:Ru.internalConfig.pollingFallbackDisabled||this.triggerPollingFallback(t),Qe.debug({level1:[`WebSocket closed with ${r.code} connection close code`],level2:[r]})}}};try{hu.open("socket",r,t)}catch(e){Qe.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(){hu.close(su.sdkReinitialisedWebSocket),this.createWebSocketConnection().catch((e=>{var t;Qe.debug({level3:["Error reinitializing websocket connection",e]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)}))}static authenticateWebSocketConnection(e){return ju(this,void 0,void 0,(function*(){ou.sendAuthMessage(e),hu.connectionAuthenticated||(hu.authenticatingConnection=!0,yield new Promise(((e,t)=>{const n=setTimeout((()=>{Ru.authMessageReject("WebSocket authentication timed out")}),hu.authenticationTimeout);Ru.authMessageResolve=()=>{Qe.debug({level3:["WebSocket auth promise resolved."]}),e(),hu.purgeMessageQueue(),clearTimeout(n),hu.authenticatingConnection=!1},Ru.authMessageReject=e=>{Qe.error({level3:["WebSocket auth promise rejected.",e]}),Object.values(Ru.streamContainers).forEach((t=>{var n;t.sendMessageToIframe({action:b,values:null!==(n=e.message)&&void 0!==n?n:e})})),t(e),clearTimeout(n),hu.authenticatingConnection=!1}})))}))}static simulateWebSocketError(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];hu.close(),t&&this.createWebSocketConnection(0,e).catch((e=>{Qe.debug({level3:["Error reconnecting websocket",e]})}))}static triggerPollingFallback(e){var t;Ru.authMessageResolve=()=>null,Ru.authMessageReject=()=>null,e&&(hu.close(),hu.clearTimeouts()),Object.values(this.streamContainers).forEach((e=>{e.sendMessageToIframe({action:v})}));const n=this.analyticsQueue.enqueue({timestamp:new Date,eventName:lt,endUserId:null!==(t=md(Ru.cachedToken,Ru.internalConfig.tokenUserIdAttribute))&&void 0!==t?t:"",properties:Object.assign({path:`${this.internalConfig.environmentId}/socket`},e?{source:"user-simulate"}:{})});if(n){var r;ou.sendAnalyticsMessage([n]);const e=gu(n);null===(r=Ru.sdkEventObserver)||void 0===r||r.call(Ru,e)}}static setTestHostHeader(e){this.internalConfig.testHost=e,Td.setTestHostHeader(e),hu.setTestHostParam(e)}static setClientAppVersion(e){if(!("string"==typeof e))return Qe.error({level1:["Could not set client app version"],level2:[": Invalid value provided, must be a string."]});e.length>128&&Qe.warn({level1:["Client app version truncated"],level2:[": value provided was longer than 128 character maximum."]});const t=e.substring(0,128);Td.setClientAppVersion(t),hu.setClientAppVersion(t),this.internalConfig.clientAppVersion=t}static setTokenUserIdAttribute(e){return"string"==typeof e?e.length>128?Qe.error({level1:["Could not set token user ID attribute"],level2:[": value provided was longer than 128 character maximum."]}):(Td.setTokenUserIdAttribute(e),void(this.internalConfig.tokenUserIdAttribute=e)):Qe.error({level1:["Could not set token user ID attribute"],level2:[": Invalid value provided, must be a string."]})}static setRetryTimer(){Ru.tokenRetryInterval&&!Ru.tokenRetryTimer&&(Ru.tokenRetryTimer=setTimeout((()=>{Ru.tokenRetryTimer=void 0}),Ru.tokenRetryInterval))}static handleTokenRequest(e){var t,n;return ju(this,void 0,void 0,(function*(){var r;let i,a=new Error;if(!Ru.onAuthTokenRequested)throw a.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.",a.name=_u,a;if(Ru.tokenRetryTimer)throw a.message="Not ready to retry token request",a.name=Eu,a;if(Ru.cachedToken&&!(null==e?void 0:e.skipCache)){const e=od(Ru.cachedToken);if(!(e=>{const t=Math.floor((new Date).getTime()/1e3);return 1===(0,o.compareAsc)(t,e)})(e.exp-Ru.tokenExpiryInterval))return Ru.cachedToken;i=e}const s=yield Promise.race([new Promise((e=>{setTimeout((()=>{e(void 0)}),5e3)})),null===(r=Ru.onAuthTokenRequested)||void 0===r?void 0:r.call(Ru)]);if(!s||0===s.length)throw a.message="An authentication token was required for the request, however no token was returned.",a.name=Lu,Ru.setRetryTimer(),a;if(!ad(s))throw a.message="The auth token provided is not a valid JWT.",a.name=Lu,Ru.setRetryTimer(),a;if(i&&i.exp-i.iat<3600){const e=od(s);(null!==(t=i.atomic_sub)&&void 0!==t?t:i.sub)!==(null!==(n=e.atomic_sub)&&void 0!==n?n:e.sub)&&Qe.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 l=md(s,Ru.internalConfig.tokenUserIdAttribute),c=JSON.parse(sessionStorage.getItem(w)||"{}");if(l&&c.initialiseCalled&&!c.eventDispatched){const e={endUserId:l,eventName:Ge,timestamp:new Date,properties:{}},t=Ru.analyticsQueue.enqueue(e,"sdk-initialized");if(t){var d;ou.sendAnalyticsMessage([t]);const e=gu(t);null===(d=Ru.sdkEventObserver)||void 0===d||d.call(Ru,e)}sessionStorage.setItem(w,JSON.stringify(Object.assign(Object.assign({},c),{eventDispatched:!0})))}if((null==e?void 0:e.authWebSocket)&&hu.isConnected()&&!hu.authenticatingConnection)try{yield Ru.authenticateWebSocketConnection(s)}catch(a){throw Qe.error({level3:["Fresh auth token received, error authenticating WebSocket connection with new token.",a]}),a}return Ru.cachedToken=s}))}static getCurrentUserId(){var e;return null!==(e=md(Ru.cachedToken,Ru.internalConfig.tokenUserIdAttribute))&&void 0!==e?e:""}static requestCardCount(e){return ju(this,void 0,void 0,(function*(){if(!e)throw new Error("A stream container ID is required when requesting card count.");if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to request card count.");try{const t=yield Td.get(`feed/${e}`,{requestToken:yield Ru.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.message}`)}}))}static sendEvent(e){return ju(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(!Td.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 Td.post("event",{data:i},{requestToken:yield Ru.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.message}`)}}))}static sendCustomEvent(e){return ju(this,void 0,void 0,(function*(){var t;if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to send a custom event.");const n=md(yield Ru.handleTokenRequest(),Ru.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.");const r=this.analyticsQueue.enqueue(Object.assign({endUserId:n,eventName:e.eventName,timestamp:new Date},e.properties?{properties:e.properties}:{}),"custom");r&&ou.sendAnalyticsMessage([r])}))}static observeSDKEvents(e){this.sdkEventObserver=e}static requestUserMetrics(){return ju(this,void 0,void 0,(function*(){if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to request user metrics.");try{const e=yield Td.get("user-metrics",{requestToken:yield Ru.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 bu(e.data)},this.cachedUserMetrics.userMetrics;case 304:if(this.cachedUserMetrics.userMetricsResponse)return new bu(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 ju(this,void 0,void 0,(function*(){if(!Td.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 Ru.handleTokenRequest},Mu(void 0,void 0,void 0,(function*(){var e,r;(null===(e=t.preferences)||void 0===e?void 0:e.notifications)&&Fu(t);const{data:i,response:o}=yield Td.put("update-user",t,n);return(null==i||null===(r=i.errors)||void 0===r?void 0:r.length)&&Qe.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.message}`)}var t,n}))}static onCardAction(e,t){if(!Td.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)=>ju(this,void 0,void 0,(function*(){const i=yield Ma(e,t,{requestToken:yield Ru.handleTokenRequest});i.ok?n():i.error&&r(i.error)})),snooze:(n,r,i)=>ju(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 Fa(e,t,i,{requestToken:yield Ru.handleTokenRequest});o.ok?n():o.error&&r(o.error)})),submit:(n,r,i,o)=>ju(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 Ta(e,t,Object.assign(Object.assign({},a),{[i]:null}),{requestToken:yield Ru.handleTokenRequest});s.ok?n():s.error&&r(s.error)}))}}static logout(){return ju(this,arguments,void 0,(function*(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0])try{yield Ru.deregisterDeviceForNotifications()}catch(e){e.message.includes("You must call setNativeDeviceInfo before registering for native notifications")||console.error(`Problem de-registering notifications when logging out: ${e instanceof Error?e.message:String(e)}`)}Object.values(Ru.streamContainers).forEach((e=>{e.logout()})),Ru.streamContainers={},yield this.analyticsQueue.flush(),Ru.cachedUserMetrics={},Ru.cachedToken=void 0,Ru.tokenRetryTimer=void 0,Ru.sdkEventObserver=null,sessionStorage.removeItem(S),hu.close(su.sdkSessionEnding,"Connection closed by SDK, user logged out"),hu.reset(),Ru.internalConfig=Object.assign(Object.assign({},Ru.internalConfig),{apiHost:void 0,apiKey:void 0,environmentId:void 0}),Td.reset()}))}static login(e,t,n,r,i){Ru.initialise(e,t,n),Ru.setSessionDelegate(r,i)}static setNativeDeviceInfo(e){try{return(e=>{const t=Iu(e);if(t.success)return wu=e,!0;{const e=`Device info set with invalid parameters: ${t.errors.join("\n")}`;throw console.error(e),new Error(e)}})(e)}catch(e){throw new Error(`Failed to setNativeDeviceInfo: ${e.message}`)}}static registerDeviceForNotifications(e){return ju(this,void 0,void 0,(function*(){if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to register the device for push notifications");try{return yield ku(e,{requestToken:yield Ru.handleTokenRequest})}catch(e){throw new Error(`${ku.name} could not be completed. ${e.message}`)}}))}static deregisterDeviceForNotifications(){return ju(this,void 0,void 0,(function*(){if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to deregister the device for push notifications");try{return yield Cu({requestToken:yield Ru.handleTokenRequest})}catch(e){throw new Error(`${Cu.name} could not be completed. ${e instanceof Error?e.message:String(e)}`)}}))}static registerStreamContainersForNotifications(e,t){return ju(this,void 0,void 0,(function*(){if(!Td.isInitialised())throw new Error("You must call `AtomicSDK.initialise` before attempting to register stream containers for notifications");try{return yield Su(e,{requestToken:yield Ru.handleTokenRequest},t)}catch(e){throw new Error(`${Su.name} could not be completed. ${e instanceof Error?e.message:String(e)}`)}}))}static notificationFromPushPayload(e){return xu(e)}static trackPushNotificationReceived(e){var t;const n=xu(e);if(null==n)return!1;const r=null!==(t=md(Ru.cachedToken,Ru.internalConfig.tokenUserIdAttribute))&&void 0!==t?t:"";let i={eventName:ut,endUserId:r,containerId:n.containerId,cardInstanceId:n.cardInstanceId,timestamp:new Date};const o=Ru.analyticsQueue.enqueue(i);if(o){var a;ou.sendAnalyticsMessage([o]);const e=gu(o);null===(a=Ru.sdkEventObserver)||void 0===a||a.call(Ru,e)}return!0}}Du(Ru,"hasPerformedInitialisation",!1),Du(Ru,"webSocketDisabled",!1),Du(Ru,"cachedUserMetrics",{}),Du(Ru,"internalConfig",{}),Du(Ru,"cachedToken",void 0),Du(Ru,"onError",void 0),Du(Ru,"sdkEventObserver",null),Du(Ru,"SDKEvents",pu),Du(Ru,"userMetricsTriggerEvents",new Set(mu)),Du(Ru,"onAuthTokenRequested",void 0),Du(Ru,"tokenRetryInterval",0),Du(Ru,"tokenRetryTimer",void 0),Du(Ru,"tokenExpiryInterval",60),Du(Ru,"authMessageResolve",(()=>null)),Du(Ru,"authMessageReject",(()=>null)),Du(Ru,"streamContainers",{}),Du(Ru,"containersBroadcastChannel","BroadcastChannel"in window?new ms:void 0),Du(Ru,"analyticsQueue",new class{constructor(){pd(this,"eventQueue",[]),pd(this,"flushTimeout",null),pd(this,"flushPromise",null);const e=localStorage.getItem(gd);if(e)try{this.eventQueue=JSON.parse(e)}catch(e){}this.scheduleFlush()}createEventPayload(e,n){const r={id:(0,t.v4)(),endUserId:e.endUserId,timestamp:e.timestamp.toISOString(),properties:e.properties||{},eventContext:{userLocalTimestamp:(0,o.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:{streamLength:t.streamLength||0,streamLengthVisible:t.streamLengthVisible||0,cardPositionInStream:t.streamCardPosition||0},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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"standard";if(!Td.isInitialised())return null;const n=this.createEventPayload(e,t);return n&&(this.eventQueue.push(n),this.eventQueue.length>500&&this.eventQueue.splice(0,this.eventQueue.length-500)),this.persistQueue(),n}removeProcessedEvents(e){this.eventQueue.length&&(this.eventQueue=this.eventQueue.filter((t=>!e.includes(t.id))),this.persistQueue())}performFlush(){return hd(this,void 0,void 0,(function*(){if(null!=this.flushTimeout&&(window.clearTimeout(this.flushTimeout),this.flushTimeout=null),this.eventQueue.length&&Td.isInitialised()){const e=[...this.eventQueue];200===(yield Td.put("analytics",{data:e})).response.status&&(this.eventQueue=this.eventQueue.filter((t=>!e.includes(t))),this.persistQueue())}this.scheduleFlush()}))}flush(){return hd(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(){localStorage.setItem(gd,JSON.stringify(this.eventQueue))}});class Vu{constructor(e,n,r,i,o){Du(this,"iframe",void 0),Du(this,"modalIframe",void 0),Du(this,"toastIframe",void 0),Du(this,"outsideClickListener",void 0),Du(this,"queuedMessages",[]),Du(this,"iframeLoaded",!1),Du(this,"appOpen",!1),Du(this,"launchButtonIconContainer",void 0),Du(this,"launcher",void 0),Du(this,"resizeObserver",void 0),Du(this,"resolvedConfiguration",void 0),Du(this,"instanceId",void 0),Du(this,"streamFilters",new Ed((()=>this.sendMessageToIframe({action:y,values:{filter:this.streamFilters.getFilterObject()}})),(()=>{this.sendMessageToIframe({action:y,values:{filter:void 0}})}))),Du(this,"config",void 0),Du(this,"analyticsQueue",void 0);const a=`${e.streamContainerId}`;if(null===e.streamContainerId||void 0===e.streamContainerId||"string"!=typeof e.streamContainerId&&"number"!=typeof e.streamContainerId||0===a.trim().length)throw new Error("The Atomic SDK failed to start. You must pass a `streamContainerId` when instantiating a stream container.");var s;if(!Ru.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"),!this.iframeLoaded){var l,c;let s=Object.assign(Object.assign(Object.assign({},e),{streamContainerId:a}),n),d=s.cardListRefreshInterval;s.cardListRefreshInterval=null!=d?0==d?0:Math.max(1e3,d):void 0;let u=s.runtimeVariableResolutionTimeout;if(s.runtimeVariableResolutionTimeout=null!=u?Math.max(0,u):void 0,"single-card"!==r&&(null===(l=e.features)||void 0===l||null===(c=l.horizontalContainerConfig)||void 0===c?void 0:c.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,o)}}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),ou.activeSubscriptions[this.instanceId]&&(ou.unsubscribeFromCardFeed([this.instanceId]),delete Ru.streamContainers[this.instanceId])}updateVariables(){this.sendMessageToIframe({action:"io.atomic.events.requestRuntimeVariables"})}setOpen(e){var t;if(void 0===e)return Qe.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))return Qe.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,o,a,s,l;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"),"ResizeObserver"in window){const e=document.createElement("div");e.style.width="1rem",e.style.visibility="hidden",e.id="text-size-observer",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("#text-size-observer"))}c.logLevel=Qe.logLevel,n?n.appendChild(this.iframe):document.body.appendChild(this.iframe),this.iframe.addEventListener("load",(()=>{this.iframeLoaded=!0,this.flushMessages()})),Pu(this.iframe,c),("single-card"===t&&(null===(o=e.enabledUiElements)||void 0===o?void 0:o.cardListToast)||(null===(a=e.enabledUiElements)||void 0===a?void 0:a.customToastContainer))&&(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"),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),Pu(this.toastIframe,Object.assign(Object.assign({},c),{embedMode:"toast"}))),("single-card"===t||"standalone"===t&&(null===(s=e.features)||void 0===s||null===(l=s.horizontalContainerConfig)||void 0===l?void 0:l.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),Pu(this.modalIframe,Object.assign(Object.assign({},c),{embedMode:"modal-subview"}))),window.addEventListener("message",this.onMessageReceived.bind(this))}onMessageReceived(e){return ju(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=vu({cardCount:e.data.cardCount,streamContainerId:this.resolvedConfiguration.streamContainerId||"",endUserId:Ru.getCurrentUserId()});null===(t=Ru.sdkEventObserver)||void 0===t||t.call(Ru,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.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||Hu);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.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=Ru.sdkEventObserver)||void 0===o||o.call(Ru,gu(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=pu.cardSnoozed,n.analyticsEvent=pu.cardSnoozed;break;case"dismissed":n.eventName=pu.cardDismissed,n.analyticsEvent=pu.cardDismissed;break;case"submitted":n.eventName=pu.cardCompleted,n.analyticsEvent=pu.cardCompleted;break;default:return null}return n.sdkContext={containerId:t},n})(e.data.event,e.data.streamContainerId);var a;if(t)Ru.cachedUserMetrics={},null===(a=Ru.sdkEventObserver)||void 0===a||a.call(Ru,t);break}case"io.atomic.events.errorReceived":Ru.onError&&Ru.onError(e.data.error);break;case"io.atomic.events.authTokenRequested":if(e.data.requestId&&Ru.onAuthTokenRequested){let t;try{t=yield Ru.handleTokenRequest(),this.sendMessageToIframe({action:"io.atomic.events.authTokenReceived",values:{requestId:e.data.requestId,authToken:t}},e.source)}catch(t){Qe.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{hu.connectionAuthenticated||(yield Ru.handleTokenRequest({skipCache:!0,authWebSocket:!0})),ou.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)}),Qe.error({level1:["error sending card feed subscription request by WebSockets"],level2:[e]})}break;case"io.atomic.events.subscriptionRetryExceeded":hu.close(su.sdkClosedConnection,"Subscription retry exceeded"),Ru.authMessageResolve=()=>null,Ru.authMessageReject=()=>null;break;case"io.atomic.events.cardFeedUnsubscribeRequested":e.data.subscriptionId===this.instanceId&&(ou.unsubscribeFromCardFeed([this.instanceId]),delete Ru.streamContainers[this.instanceId]);break;case"io.atomic.events.socketReconnectionRequested":Ru.createWebSocketConnection().catch((e=>{var t;this.sendMessageToIframe({action:b,values:null!==(t=e.message)&&void 0!==t?t:e})}));break;case"io.atomic.events.socketConnectionHealthcheck":hu.connectionHealthCheck()}}))}enqueueAnalyticsEvent(e){const t=this.analyticsQueue.enqueue(e);if(t){var n;ou.sendAnalyticsMessage([t]);const e=gu(t);null===(n=Ru.sdkEventObserver)||void 0===n||n.call(Ru,e)}Ru.containersBroadcastChannel?Ru.containersBroadcastChannel.postMessage({type:ps.ANALYTICS_EVENT,eventQueued:e}):Qe.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 $u{constructor(n,r,i){if(Du(this,"resolvedConfiguration",void 0),Du(this,"instanceId",void 0),Du(this,"streamFilters",new Ed((()=>{Qe.debug({level1:[`applied stream filter for stream container: ${this.instanceId}`],level2:[this.streamFilters.getFilterObject()]}),this.sendWebSocketFeedSubscriptionMessage()}),(()=>{Qe.debug({level1:[`cleared stream filter for stream container: ${this.instanceId}`]}),this.sendWebSocketFeedSubscriptionMessage()}))),Du(this,"analyticsQueue",void 0),Du(this,"pollCounter",0),Du(this,"pollTimer",void 0),Du(this,"store",void 0),Du(this,"boundActions",void 0),Du(this,"tokenProvider",{requestToken:()=>ju(this,void 0,void 0,(function*(){return yield Ru.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(!Ru.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 o=Object.assign(Object.assign({},n),r),a=o.cardListRefreshInterval;o.cardListRefreshInterval=null!=a?0==a?0:Math.max(1e3,a):void 0;let u=o.runtimeVariableResolutionTimeout;o.runtimeVariableResolutionTimeout=null!=u?Math.max(0,u):void 0,this.resolvedConfiguration=o,this.instanceId=(0,t.v4)(),this.store=((e,t)=>{var n,r,i;let{streamContainerId:o,instanceId:a,windowOrigin:u,subviewCardInstance:h,startingLayoutId:p,cardInstances:m,cardListRefreshInterval:g,runtimeVariableResolutionTimeout:v,embedMode:f,customStrings:b,cardListTutorialSeen:y,features:w,firstLoadStyles:S,enabledUiElements:k,interfaceStyle:C}=e;const x=t&&t.length?(0,l.m)(...t):null,I="preview"===f,O=null==w?void 0:w.runtimeVariableAnalytics;return d=s()(Object.assign(Object.assign({},c),{application:Object.assign(Object.assign({},c.application),{isPreview:I,streamContainerId:void 0!==o?o:c.application.streamContainerId,containerInstanceId:void 0!==a?a:c.application.containerInstanceId,windowOrigin:u||c.application.windowOrigin,cardListRefreshInterval:void 0!==g?g:c.application.cardListRefreshInterval,runtimeVariableResolutionTimeout:void 0!==v?v:c.application.runtimeVariableResolutionTimeout,embedMode:f,customStrings:b||c.application.customStrings,cardLimit:"single-card"===f?1:void 0,firstLoadStyles:{backgroundColor:(null==S?void 0:S.backgroundColor)||c.application.firstLoadStyles.backgroundColor,textColor:(null==S?void 0:S.textColor)||c.application.firstLoadStyles.textColor,loadingSpinnerColor:(null==S?void 0:S.loadingSpinnerColor)||c.application.firstLoadStyles.loadingSpinnerColor,buttonTextColor:(null==S?void 0:S.buttonTextColor)||c.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:h&&p?[{cardInstance:h,cardInstanceId:h.instance.id,subviewId:p,kind:"subview"}]:c.navigationStack.items},cardFeed:Object.assign(Object.assign({},c.cardFeed),{cardInstances:m||c.cardFeed.cardInstances,tutorialSeen:void 0===y||y,runtimeVariableAnalyticsEnabled:void 0!==O&&O,cardVoting:null==w?void 0:w.cardVoting,cardMinimumHeight:null==w?void 0:w.cardMinimumHeight,horizontalContainerConfig:null==w?void 0:w.horizontalContainerConfig})}),x),d})(Object.assign(Object.assign({},o),{embedMode:"headless"})),this.boundActions=(0,e.kv)((0,e.Y2)(Pt,Da),this.store),this.analyticsQueue=i}}start(){if(!this.resolvedConfiguration.apiHost||!this.resolvedConfiguration.apiKey||!this.resolvedConfiguration.environmentId)return Qe.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."]});Qe.debug({level3:[`Starting card feed updates for observable stream container: ${this.instanceId}`]}),Ru.streamContainers[this.instanceId]||(Ru.streamContainers[this.instanceId]={sendMessageToIframe:e=>this.onMessageReceived(e),logout:()=>{this.onMessageReceived({action:h})}}),this.resolvedConfiguration.webSocketDisabled?this.pollCardFeed():ou.activeSubscriptions[this.instanceId]||this.sendWebSocketFeedSubscriptionMessage()}stop(){Qe.debug({level3:[`Stopping card feed updates for observable stream container: ${this.instanceId}`]}),ou.activeSubscriptions[this.instanceId]&&ou.unsubscribeFromCardFeed([this.instanceId]),this.cancelCardListPolling(),delete Ru.streamContainers[this.instanceId]}pollCardFeed(){var e,t;return ju(this,void 0,void 0,(function*(){const n=this.store.getState(),r=n.cardFeed,i=yield Oa(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,Qe.debug({level3:["Attempt to reconnect websocket initiated"]}),Ru.createWebSocketConnection().catch((e=>{var t;Qe.debug({level3:["Error reconnecting websocket",e]}),null===(t=Ru.onError)||void 0===t||t.call(Ru,e)})))}),null!==(t=this.resolvedConfiguration.cardListRefreshInterval)&&void 0!==t?t:c.application.cardListRefreshInterval))}))}cancelCardListPolling(){this.pollTimer&&(clearTimeout(this.pollTimer),Qe.debug({level3:[`Observable stream container ${this.instanceId}, card feed polling cancelled`]})),this.pollTimer=null,this.pollCounter=0}sendWebSocketFeedSubscriptionMessage(){try{ou.subscribeToCardFeed([{subscriptionId:this.instanceId,streamContainerId:this.resolvedConfiguration.streamContainerId||"",filters:this.streamFilters.getFilterObject()}])}catch(e){Qe.error({level1:["Unable to subscribe observable stream container to card feed updates via WebSocket."],level2:[`Container instance: ${this.instanceId}.`]})}}handleCardFeedUpdate(e){var t,n;return ju(this,void 0,void 0,(function*(){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 ja(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=>ju(this,void 0,void 0,(function*(){if(e){const e=yield(t=r.application.streamContainerId,n=this.tokenProvider,xa(void 0,void 0,void 0,(function*(){const e=yield Td.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)Qe.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=>ju(this,void 0,void 0,(function*(){return yield ja(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)))||[],c=(null===(o=e.metadata)||void 0===o?void 0:o.totalCards)||0,d=(null===(a=t.metadata)||void 0===a?void 0:a.totalCards)||0;if(!ud(s,l)||c!==d){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,d);const e=vu({cardCount:null!==(r=null===(u=t.cardInstances)||void 0===u?void 0:u.length)&&void 0!==r?r:0,streamContainerId:this.resolvedConfiguration.streamContainerId||"",endUserId:Ru.getCurrentUserId()});null===(h=Ru.sdkEventObserver)||void 0===h||h.call(Ru,e)}}runtimeVariableResolver(e){const t=this.resolvedConfiguration.onRuntimeVariablesRequested||Hu;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){return ju(this,arguments,void 0,(function*(){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];hu.connectionHealthCheck();const n=this.store.getState(),r=n.cardFeed.cardInstances||[],i=r.filter((t=>t.instance.id===e.cardInstanceId)),o=i.length?i[0]:null,a=o?r.indexOf(o)+1:0;let s;try{s=yield this.tokenProvider.requestToken()}catch(e){Qe.error({level1:["Error requesting auth token to send analytics event"],level2:[e]})}const l=Object.assign(Object.assign({},e),{endUserId:md(s,Td.tokenUserIdAttribute)||"",cardInstanceStatus:o?o.instance.status:"",containerId:n.application.streamContainerId,timestamp:new Date,streamCardPosition:a,streamLength:n.cardFeed.unfilteredCardInstanceCount,streamLengthVisible:r.length});let c;if(t?c=this.analyticsQueue.createEventPayload(l,"standard"):(c=this.analyticsQueue.enqueue(l),ou.sendAnalyticsMessage([c])),c){var d;const e=gu(c);null===(d=Ru.sdkEventObserver)||void 0===d||d.call(Ru,e)}}))}updateVariables(){var e,t;return ju(this,void 0,void 0,(function*(){const n=this.store.getState(),r=yield Oa(n.application.streamContainerId,this.tokenProvider,n.application.runtimeVariableResolutionTimeout,"",this.runtimeVariableResolver.bind(this),void 0,this.streamFilters.getFilterObject());r.error&&Qe.error({level1:["error retrieving card feed for runtime variable update"],level2:[r.error]});const i=yield ja(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:nt,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 g:const t=e.values.cardFeedUpdates;this.handleCardFeedUpdate(t);break;case v:void 0===this.pollTimer&&this.pollCardFeed();break;case f:this.cancelCardListPolling();break;case h:this.stop();break;default:Qe.debug({level3:["Unknown message received by headless stream container: ",e.data]})}}}})(),r=r.default})()));