@flarehr/apollo-super-selection 5.84.52699 → 5.85.53162

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
  2. package/dist/lib/apollo-super-selection/{p-6dfc46fa.entry.js → p-03211c1e.entry.js} +4 -4
  3. package/dist/lib/apollo-super-selection/p-bd6e6a8f.system.js +1 -1
  4. package/dist/lib/apollo-super-selection/{p-4874e7a2.system.entry.js → p-ead1bc07.system.entry.js} +11 -11
  5. package/dist/lib/cjs/sss-button_32.cjs.entry.js +18 -10
  6. package/dist/lib/collection/components/super-campaign/fund-tile-clicked.handler.js +7 -3
  7. package/dist/lib/collection/components/super-campaign/promoted-fund-joined.handler.js +4 -4
  8. package/dist/lib/collection/components/super-campaign/super-campaign.js +3 -1
  9. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/featured-funds/super-campaign-featured-funds.js +3 -1
  10. package/dist/lib/esm/sss-button_32.entry.js +18 -10
  11. package/dist/lib/esm-es5/sss-button_32.entry.js +5 -5
  12. package/dist/lib/types/components/super-campaign/fund-tile-clicked.handler.d.ts +3 -1
  13. package/dist/lib/types/components/super-campaign/super-campaign-types.d.ts +10 -0
  14. package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +4 -0
  15. package/dist/lib/types/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.dto.d.ts +2 -0
  16. package/dist/lib/types/components/super-selection-app/funds/custom-fund/featured-funds/super-campaign-featured-funds.types.d.ts +2 -0
  17. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.dto.d.ts +2 -0
  18. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- var __extends=this&&this.__extends||function(){var e=function(t,n){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]};return e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function s(e){try{u(r.next(e))}catch(e){a(e)}}function o(e){try{u(r["throw"](e))}catch(e){a(e)}}function u(e){e.done?n(e.value):i(e.value).then(s,o)}u((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return u([e,t])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(a=s[0]&2?i["return"]:s[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;if(i=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1];a=s;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(s);break}if(a[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,h,F as Fragment,g as getAssetPath,H as Host,c as createEvent,s as setErrorHandler,a as getElement,d as getContext}from"./index-107d7c24.js";import{f as from,m as map,S as SimpleOuterSubscriber,a as SimpleInnerSubscriber,i as innerSubscribe,b as isArray,O as Observable,c as isFunction,d as async,g as Subscriber,h as distinctUntilChanged,j as filter,k as StoreConfig,l as Store,Q as Query}from"./datorama-akita-127aea91.js";import{n as none,i as isSome,s as some,a as superSelectionAppService,b as navigationService,S as SuperSelectionAppRoutes,c as injectHistory,C as CustomFundTypes,d as superSelectionApi,O as Option,E as EventTrackingService,e as customFundChoiceApi,f as isNone,g as getPromotedFundId,h as buildBackendApiClient,j as getSuperChoiceUsi,k as getSuperChoiceMemberNumber,l as state,m as state$1,t as toUndefined,o as slate,p as SuperCampaignComponentStatus,q as iframe,r as superSelectionAppStencilRoutes,u as factory,v as fromNullable}from"./custom-fund-choice.api-42801d64.js";import{A as ActiveRouter}from"./active-router-d18b36fb.js";function noop(){}function mergeMap(e,t,n){if(n===void 0){n=Number.POSITIVE_INFINITY}if(typeof t==="function"){return function(r){return r.pipe(mergeMap((function(n,r){return from(e(n,r)).pipe(map((function(e,i){return t(n,e,r,i)})))}),n))}}else if(typeof t==="number"){n=t}return function(t){return t.lift(new MergeMapOperator(e,n))}}var MergeMapOperator=function(){function e(e,t){if(t===void 0){t=Number.POSITIVE_INFINITY}this.project=e;this.concurrent=t}e.prototype.call=function(e,t){return t.subscribe(new MergeMapSubscriber(e,this.project,this.concurrent))};return e}();var MergeMapSubscriber=function(e){__extends(t,e);function t(t,n,r){if(r===void 0){r=Number.POSITIVE_INFINITY}var i=e.call(this,t)||this;i.project=n;i.concurrent=r;i.hasCompleted=false;i.buffer=[];i.active=0;i.index=0;return i}t.prototype._next=function(e){if(this.active<this.concurrent){this._tryNext(e)}else{this.buffer.push(e)}};t.prototype._tryNext=function(e){var t;var n=this.index++;try{t=this.project(e,n)}catch(e){this.destination.error(e);return}this.active++;this._innerSub(t)};t.prototype._innerSub=function(e){var t=new SimpleInnerSubscriber(this);var n=this.destination;n.add(t);var r=innerSubscribe(e,t);if(r!==t){n.add(r)}};t.prototype._complete=function(){this.hasCompleted=true;if(this.active===0&&this.buffer.length===0){this.destination.complete()}this.unsubscribe()};t.prototype.notifyNext=function(e){this.destination.next(e)};t.prototype.notifyComplete=function(){var e=this.buffer;this.active--;if(e.length>0){this._next(e.shift())}else if(this.active===0&&this.hasCompleted){this.destination.complete()}};return t}(SimpleOuterSubscriber);function fromEvent(e,t,n,r){if(isFunction(n)){r=n;n=undefined}if(r){return fromEvent(e,t,n).pipe(map((function(e){return isArray(e)?r.apply(void 0,e):r(e)})))}return new Observable((function(r){function i(e){if(arguments.length>1){r.next(Array.prototype.slice.call(arguments))}else{r.next(e)}}setupSubscription(e,t,i,r,n)}))}function setupSubscription(e,t,n,r,i){var a;if(isEventTarget(e)){var s=e;e.addEventListener(t,n,i);a=function(){return s.removeEventListener(t,n,i)}}else if(isJQueryStyleEventEmitter(e)){var o=e;e.on(t,n);a=function(){return o.off(t,n)}}else if(isNodeStyleEventEmitter(e)){var u=e;e.addListener(t,n);a=function(){return u.removeListener(t,n)}}else if(e&&e.length){for(var l=0,c=e.length;l<c;l++){setupSubscription(e[l],t,n,r,i)}}else{throw new TypeError("Invalid event target")}r.add(a)}function isNodeStyleEventEmitter(e){return e&&typeof e.addListener==="function"&&typeof e.removeListener==="function"}function isJQueryStyleEventEmitter(e){return e&&typeof e.on==="function"&&typeof e.off==="function"}function isEventTarget(e){return e&&typeof e.addEventListener==="function"&&typeof e.removeEventListener==="function"}function debounceTime(e,t){if(t===void 0){t=async}return function(n){return n.lift(new DebounceTimeOperator(e,t))}}var DebounceTimeOperator=function(){function e(e,t){this.dueTime=e;this.scheduler=t}e.prototype.call=function(e,t){return t.subscribe(new DebounceTimeSubscriber(e,this.dueTime,this.scheduler))};return e}();var DebounceTimeSubscriber=function(e){__extends(t,e);function t(t,n,r){var i=e.call(this,t)||this;i.dueTime=n;i.scheduler=r;i.debouncedSubscription=null;i.lastValue=null;i.hasValue=false;return i}t.prototype._next=function(e){this.clearDebounce();this.lastValue=e;this.hasValue=true;this.add(this.debouncedSubscription=this.scheduler.schedule(dispatchNext,this.dueTime,this))};t.prototype._complete=function(){this.debouncedNext();this.destination.complete()};t.prototype.debouncedNext=function(){this.clearDebounce();if(this.hasValue){var e=this.lastValue;this.lastValue=null;this.hasValue=false;this.destination.next(e)}};t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;if(e!==null){this.remove(e);e.unsubscribe();this.debouncedSubscription=null}};return t}(Subscriber);function dispatchNext(e){e.debouncedNext()}function tap(e,t,n){return function r(i){return i.lift(new DoOperator(e,t,n))}}var DoOperator=function(){function e(e,t,n){this.nextOrObserver=e;this.error=t;this.complete=n}e.prototype.call=function(e,t){return t.subscribe(new TapSubscriber(e,this.nextOrObserver,this.error,this.complete))};return e}();var TapSubscriber=function(e){__extends(t,e);function t(t,n,r,i){var a=e.call(this,t)||this;a._tapNext=noop;a._tapError=noop;a._tapComplete=noop;a._tapError=r||noop;a._tapComplete=i||noop;if(isFunction(n)){a._context=a;a._tapNext=n}else if(n){a._context=n;a._tapNext=n.next||noop;a._tapError=n.error||noop;a._tapComplete=n.complete||noop}return a}t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.next(e)};t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.error(e)};t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){this.destination.error(e);return}return this.destination.complete()};return t}(Subscriber);var AppVersion="5.84.52699";var Lazy=function(){function e(e){this.factory=e;this._value=none}Object.defineProperty(e.prototype,"value",{get:function(){if(isSome(this._value)){return this._value.value}var e=this.factory();this._value=some(e);return e},enumerable:false,configurable:true});return e}();function addSlashToUrl(){if(!window.location.pathname.endsWith("/")){var e=window.location.pathname+"/"+window.location.search+window.location.hash;history.pushState(history.state,"",e)}}var DEFAULT_DELIMITER="/";var DEFAULT_DELIMITERS="./";var PATH_REGEXP=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g");var parse=function(e,t){var n=[];var r=0;var i=0;var a="";var s=t&&t.delimiter||DEFAULT_DELIMITER;var o=t&&t.delimiters||DEFAULT_DELIMITERS;var u=false;var l;while((l=PATH_REGEXP.exec(e))!==null){var c=l[0];var d=l[1];var f=l.index;a+=e.slice(i,f);i=f+c.length;if(d){a+=d[1];u=true;continue}var p="";var h=e[i];var m=l[2];var v=l[3];var g=l[4];var y=l[5];if(!u&&a.length){var S=a.length-1;if(o.indexOf(a[S])>-1){p=a[S];a=a.slice(0,S)}}if(a){n.push(a);a="";u=false}var b=p!==""&&h!==undefined&&h!==p;var C=y==="+"||y==="*";var x=y==="?"||y==="*";var w=p||s;var _=v||g;n.push({name:m||r++,prefix:p,delimiter:w,optional:x,repeat:C,partial:b,pattern:_?escapeGroup(_):"[^"+escapeString(w)+"]+?"})}if(a||i<e.length){n.push(a+e.substr(i))}return n};var escapeString=function(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")};var escapeGroup=function(e){return e.replace(/([=!:$/()])/g,"\\$1")};var flags=function(e){return e&&e.sensitive?"":"i"};var regexpToRegexp=function(e,t){if(!t)return e;var n=e.source.match(/\((?!\?)/g);if(n){for(var r=0;r<n.length;r++){t.push({name:r,prefix:null,delimiter:null,optional:false,repeat:false,partial:false,pattern:null})}}return e};var arrayToRegexp=function(e,t,n){var r=[];for(var i=0;i<e.length;i++){r.push(pathToRegexp(e[i],t,n).source)}return new RegExp("(?:"+r.join("|")+")",flags(n))};var stringToRegexp=function(e,t,n){return tokensToRegExp(parse(e,n),t,n)};var tokensToRegExp=function(e,t,n){n=n||{};var r=n.strict;var i=n.end!==false;var a=escapeString(n.delimiter||DEFAULT_DELIMITER);var s=n.delimiters||DEFAULT_DELIMITERS;var o=[].concat(n.endsWith||[]).map(escapeString).concat("$").join("|");var u="";var l=false;for(var c=0;c<e.length;c++){var d=e[c];if(typeof d==="string"){u+=escapeString(d);l=c===e.length-1&&s.indexOf(d[d.length-1])>-1}else{var f=escapeString(d.prefix||"");var p=d.repeat?"(?:"+d.pattern+")(?:"+f+"(?:"+d.pattern+"))*":d.pattern;if(t)t.push(d);if(d.optional){if(d.partial){u+=f+"("+p+")?"}else{u+="(?:"+f+"("+p+"))?"}}else{u+=f+"("+p+")"}}}if(i){if(!r)u+="(?:"+a+")?";u+=o==="$"?"$":"(?="+o+")"}else{if(!r)u+="(?:"+a+"(?="+o+"))?";if(!l)u+="(?="+a+"|"+o+")"}return new RegExp("^"+u,flags(n))};var pathToRegexp=function(e,t,n){if(e instanceof RegExp){return regexpToRegexp(e,t)}if(Array.isArray(e)){return arrayToRegexp(e,t,n)}return stringToRegexp(e,t,n)};var hasBasename=function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)};var stripBasename=function(e,t){return hasBasename(e,t)?e.substr(t.length):e};var stripTrailingSlash=function(e){return e.charAt(e.length-1)==="/"?e.slice(0,-1):e};var addLeadingSlash=function(e){return e.charAt(0)==="/"?e:"/"+e};var stripLeadingSlash=function(e){return e.charAt(0)==="/"?e.substr(1):e};var parsePath=function(e){var t=e||"/";var n="";var r="";var i=t.indexOf("#");if(i!==-1){r=t.substr(i);t=t.substr(0,i)}var a=t.indexOf("?");if(a!==-1){n=t.substr(a);t=t.substr(0,a)}return{pathname:t,search:n==="?"?"":n,hash:r==="#"?"":r,query:{},key:""}};var createPath=function(e){var t=e.pathname,n=e.search,r=e.hash;var i=t||"/";if(n&&n!=="?"){i+=n.charAt(0)==="?"?n:"?"+n}if(r&&r!=="#"){i+=r.charAt(0)==="#"?r:"#"+r}return i};var parseQueryString=function(e){if(!e){return{}}return(/^[?#]/.test(e)?e.slice(1):e).split("&").reduce((function(e,t){var n=t.split("="),r=n[0],i=n[1];e[r]=i?decodeURIComponent(i.replace(/\+/g," ")):"";return e}),{})};var isAbsolute=function(e){return e.charAt(0)==="/"};var createKey=function(e){return Math.random().toString(36).substr(2,e)};var spliceOne=function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1){e[n]=e[r]}e.pop()};var resolvePathname=function(e,t){if(t===void 0){t=""}var n=t&&t.split("/")||[];var r;var i=0;var a=e&&e.split("/")||[];var s=e&&isAbsolute(e);var o=t&&isAbsolute(t);var u=s||o;if(e&&isAbsolute(e)){n=a}else if(a.length){n.pop();n=n.concat(a)}if(!n.length){return"/"}if(n.length){var l=n[n.length-1];r=l==="."||l===".."||l===""}else{r=false}for(var c=n.length;c>=0;c--){var d=n[c];if(d==="."){spliceOne(n,c)}else if(d===".."){spliceOne(n,c);i++}else if(i){spliceOne(n,c);i--}}if(!u){for(;i--;i){n.unshift("..")}}if(u&&n[0]!==""&&(!n[0]||!isAbsolute(n[0]))){n.unshift("")}var f=n.join("/");if(r&&f.substr(-1)!=="/"){f+="/"}return f};var valueEqual=function(e,t){if(e===t){return true}if(e==null||t==null){return false}if(Array.isArray(e)){return Array.isArray(t)&&e.length===t.length&&e.every((function(e,n){return valueEqual(e,t[n])}))}var n=typeof e;var r=typeof t;if(n!==r){return false}if(n==="object"){var i=e.valueOf();var a=t.valueOf();if(i!==e||a!==t){return valueEqual(i,a)}var s=Object.keys(e);var o=Object.keys(t);if(s.length!==o.length){return false}return s.every((function(n){return valueEqual(e[n],t[n])}))}return false};var locationsAreEqual=function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&valueEqual(e.state,t.state)};var createLocation=function(e,t,n,r){var i;if(typeof e==="string"){i=parsePath(e);if(t!==undefined){i.state=t}}else{i=Object.assign({pathname:""},e);if(i.search&&i.search.charAt(0)!=="?"){i.search="?"+i.search}if(i.hash&&i.hash.charAt(0)!=="#"){i.hash="#"+i.hash}if(t!==undefined&&i.state===undefined){i.state=t}}try{i.pathname=decodeURI(i.pathname)}catch(e){if(e instanceof URIError){throw new URIError('Pathname "'+i.pathname+'" could not be decoded. '+"This is likely caused by an invalid percent-encoding.")}else{throw e}}i.key=n;if(r){if(!i.pathname){i.pathname=r.pathname}else if(i.pathname.charAt(0)!=="/"){i.pathname=resolvePathname(i.pathname,r.pathname)}}else{if(!i.pathname){i.pathname="/"}}i.query=parseQueryString(i.search||"");return i};var cacheCount=0;var patternCache={};var cacheLimit=1e4;var compilePath=function(e,t){var n=""+t.end+t.strict;var r=patternCache[n]||(patternCache[n]={});var i=JSON.stringify(e);if(r[i]){return r[i]}var a=[];var s=pathToRegexp(e,a,t);var o={re:s,keys:a};if(cacheCount<cacheLimit){r[i]=o;cacheCount+=1}return o};var matchPath=function(e,t){if(t===void 0){t={}}if(typeof t==="string"){t={path:t}}var n=t.path,r=n===void 0?"/":n,i=t.exact,a=i===void 0?false:i,s=t.strict,o=s===void 0?false:s;var u=compilePath(r,{end:a,strict:o}),l=u.re,c=u.keys;var d=l.exec(e);if(!d){return null}var f=d[0],p=d.slice(1);var h=e===f;if(a&&!h){return null}return{path:r,url:r==="/"&&f===""?"/":f,isExact:h,params:c.reduce((function(e,t,n){e[t.name]=p[n];return e}),{})}};var matchesAreEqual=function(e,t){if(e==null&&t==null){return true}if(t==null){return false}return e&&t&&e.path===t.path&&e.url===t.url&&valueEqual(e.params,t.params)};var PromiseButtonState;(function(e){e[e["Available"]=0]="Available";e[e["Pending"]=1]="Pending";e[e["Error"]=2]="Error"})(PromiseButtonState||(PromiseButtonState={}));var Button=function(){function e(e){registerInstance(this,e);this.fillWidth=false;this.fillWidthOnMobile=false;this.disabled=false;this.variant="primary";this.size="base";this.promiseFn=function(){return Promise.resolve()};this.state=PromiseButtonState.Available}e.prototype.render=function(){var e;var t=this;var n={xs:"px-2.5 py-1.5 text-xs",base:"px-4 py-2 text-base",xl:"px-6 py-3 text-base"};return h("button",{"data-testid":this.testid,class:(e={},e[n[this.size]]=true,e["inline-flex items-center justify-center border font-medium"]=true,e["rounded-md shadow-sm focus:outline-none focus:ring-2"]=true,e["focus:ring-offset-2 focus:ring-primary-focus pointer-events-auto"]=true,e["disabled:pointer-events-none disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400"]=true,e["border-transparent text-white bg-primary-base hover:bg-primary-hover"]=this.variant==="primary",e["border-gray-300 text-gray-700 bg-white hover:bg-gray-50"]=this.variant==="secondary",e["border-transparent bg-primary-light hover:bg-primary-base text-primary-dark hover:text-white"]=this.variant==="light",e["w-full"]=this.fillWidth||this.fillWidthOnMobile,e["sm:w-auto"]=this.fillWidthOnMobile,e),disabled:this.disabled,onClick:function(){return t.clicked()}},this.state===PromiseButtonState.Pending&&h("sss-loading-indicator",{theme:this.variant==="primary"?"light":"primary",size:16}),h("div",{class:{hidden:this.state===PromiseButtonState.Pending}},h("slot",null)))};e.prototype.clicked=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!this.promiseFn||this.state===PromiseButtonState.Pending)return[2];t.label=1;case 1:t.trys.push([1,3,,4]);this.state=PromiseButtonState.Pending;return[4,this.promiseFn()];case 2:t.sent();this.state=PromiseButtonState.Available;return[3,4];case 3:e=t.sent();this.state=PromiseButtonState.Error;throw e;case 4:return[2]}}))}))};return e}();var ChoiceRouter=function(){function e(e){registerInstance(this,e)}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(superSelectionAppService.superCampaignCanNotBeActivated){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.SuperCampaign)}return[2]}))}))};e.prototype.render=function(){return h(Fragment,null)};return e}();injectHistory(ChoiceRouter);var myOwnFundCustomOption={label:CustomFundTypes.MyOwnFund,value:SuperSelectionAppRoutes.MyOwnFund};var CustomFund=function(){function e(e){registerInstance(this,e);this.currentCustomFund=myOwnFundCustomOption;this.showFundOptionsSelection=false}e.prototype.componentWillLoad=function(){var e=SuperSelectionAppRoutes.MyOwnFund;if(window.location.pathname.includes(SuperSelectionAppRoutes.MyOwnFund))e=SuperSelectionAppRoutes.MyOwnFund;if(window.location.pathname.includes(SuperSelectionAppRoutes.DefaultFund))e=SuperSelectionAppRoutes.DefaultFund;if(window.location.pathname.includes(SuperSelectionAppRoutes.SelfManagedFund))e=SuperSelectionAppRoutes.SelfManagedFund;if(window.location.pathname.includes(SuperSelectionAppRoutes.FeaturedFunds))e=SuperSelectionAppRoutes.FeaturedFunds;this.fundOptionsList=[myOwnFundCustomOption,{label:CustomFundTypes.SelfManagedFund,value:SuperSelectionAppRoutes.SelfManagedFund}];if(superSelectionAppService.isFeaturedFundsEnabled&&superSelectionAppService.isUsingSuperCampaign){this.fundOptionsList.push({label:CustomFundTypes.FeaturedFunds,value:SuperSelectionAppRoutes.FeaturedFunds})}this.fundOptionsList.push({label:CustomFundTypes.DefaultFund,value:SuperSelectionAppRoutes.DefaultFund});this.currentCustomFund=this.fundOptionsList.find((function(t){return t.value===e}))||this.currentCustomFund;navigationService.navigateInternally(this.history,e)};e.prototype.render=function(){var e=this;var t=function(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500",viewBox:"0 0 20 20"},h("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"}))};var n=function(){return h("svg",{class:"h-5 w-5 fill-primary-base group-hover:fill-white",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},h("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"}))};return h("div",{class:"max-w-560 sm:w-560 relative"},h("label",{class:"font-medium text-gray-700 text-sm"},"Which fund would you like to nominate?"),h("div",{class:"mt-1 mb-4"},h("button",{type:"button",class:"bg-white relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-primary-focus focus:border-primary-base text-base sm:text-sm",onClick:function(){return e.showFundOptionsSelection=!e.showFundOptionsSelection}},h("span",{class:{"block truncate":true,"text-gray-500":this.showFundOptionsSelection}},this.showFundOptionsSelection?"Select":this.currentCustomFund.label),h("span",{class:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},h(t,null))),this.showFundOptionsSelection&&h("ul",{class:"absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none text-base sm:text-sm"},this.fundOptionsList.map((function(t){return h("li",{class:"text-gray-900 cursor-default select-none relative py-2 pl-3 pr-9 group hover:bg-primary-base hover:text-white",onClick:function(){e.showFundOptionsSelection=!e.showFundOptionsSelection;navigationService.navigateInternally(e.history,t.value)}},h("span",{class:{"block truncate":true,"font-semibold":e.currentCustomFund===t}},t.label),e.currentCustomFund===t&&h("span",{class:"absolute inset-y-0 right-0 flex items-center pr-4"},h(n,null)))})))),h("div",{onClick:function(){return e.showFundOptionsSelection=false}},h("slot",null)))};return e}();injectHistory(CustomFund);var AustralianFundLookupService=function(){function e(){}e.prototype.searchFundsAsync=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,superSelectionApi.getAustralianFundsAsync({searchString:e,maxRecordCount:t})]}))}))};e.prototype.getFundAsync=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(r){switch(r.label){case 0:return[4,superSelectionApi.getAustralianFundAsync(e,t)];case 1:n=r.sent();return[2,Option.some(n)]}}))}))};return e}();var australianFundLookupService=new AustralianFundLookupService;var DefaultFund=function(){function e(e){registerInstance(this,e);this.defaultFundProductName="Loading fund...";this.eventTrackingService=EventTrackingService.Instance}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:e=superSelectionAppService.defaultFundUsi;if(Option.isNone(e)){return[2]}this.isDefaultFundExists=true;return[4,australianFundLookupService.getFundAsync(e.value,true)];case 1:t=n.sent();if(Option.isNone(t)){this.isInvalidDefaultFund=true;return[2]}this.defaultFund=t.value;this.defaultFundProductName=t.value.productName;return[2]}}))}))};e.prototype.componentDidLoad=function(){var e,t,n,r;return this.eventTrackingService.TrackDefaultSuperFundDetailViewedAsync({fundUsi:(t=(e=this.defaultFund)===null||e===void 0?void 0:e.usi)!==null&&t!==void 0?t:"",fundName:(r=(n=this.defaultFund)===null||n===void 0?void 0:n.productName)!==null&&r!==void 0?r:"",promotedFundsShown:superSelectionAppService.promotedFunds,defaultFundUsiSet:Option.toUndefined(superSelectionAppService.defaultFundUsi)})};e.prototype.render=function(){var e=this;return h(Host,null,h("sss-header-section",null),h("div",{class:"flex justify-center mt-11"},h("sss-custom-fund",null,h("div",{class:"p-4 sm:p-6 pb-6 sm:pb-8 border shadow-sm rounded-lg"},h("p",{class:"sm:text-lg font-bold mb-3"},"Fund details"),(!this.isDefaultFundExists||this.isInvalidDefaultFund)&&h("div",{class:"bg-yellow-50 border-l-4 border-yellow-400 p-4 my-3"},h("div",{class:"flex"},h("div",{class:"flex-shrink-0"},h("img",{class:"h-5 w-5",src:getAssetPath("assets/icon-exclamation.svg")})),h("div",{class:"ml-3 text-sm text-yellow-700 leading-5"},h("span",null,"It looks like your employer has not specified a default fund, please contact them if you’d like to use your company’s default fund.")))),this.isDefaultFundExists&&!this.isInvalidDefaultFund&&h("div",null,h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Fund Name"),h("div",{class:"mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm"},this.defaultFundProductName)),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Fund USI"),h("div",{class:"mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm"},this.defaultFund.usi)),h("div",{class:"mt-8 mb-8 h-px w-full bg-gray-200"}),h("div",{class:"text-sm text-gray-700"},h("label",{class:"font-semibold text-gray-900"},"By clicking “Continue”, you acknowledge that:"),h("ul",{class:"list-disc list-outside pl-5"},h("li",{class:"mt-2"},"you are choosing to join your employer’s default super fund;"),h("li",{class:"mt-2"},"your employer will open a new account for you with their default super fund; and"),h("li",{class:"mt-2"},"your application to join is subject to Trustee approval."))))),h("div",{class:"flex justify-center mt-8"},h("div",{class:"sm:max-w-320 w-full"},this.isDefaultFundExists&&!this.isInvalidDefaultFund&&h("div",{class:"mb-4"},h("sss-button",{testid:"continue-button",fillWidth:true,promiseFn:function(){return e.handleSubmitForm()}},"Continue")),h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("sss-button",{testid:"back-button",fillWidth:true,variant:"secondary"},"Back")))))))};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){if(this.isInvalidDefaultFund){return[2]}navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:"Employer’s default fund",fundDetails:{type:"default",fundName:this.defaultFundProductName,fundUsi:this.defaultFund.usi},handleSubmitFn:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,customFundChoiceApi.submitDefaultFundChoiceAsync(Object.assign({standardChoiceFormSignature:t},superSelectionAppService.promotedFundsConfig))];case 1:e.sent();return[2]}}))}))}});return[2]}))}))};return e}();var dropdownAsyncCss="html{scroll-behavior:smooth}.sss-dropdown-menu{max-height:min(20rem, 50vh)}";var DEFAULT_SEARCH_LENGTH=3;var SelectInputAsync=function(){function e(e){var t=this;registerInstance(this,e);this.valueChanged=createEvent(this,"valueChanged",7);this.required=false;this.disabled=false;this.minSearchStringLength=DEFAULT_SEARCH_LENGTH;this.isMouseOver=false;this.searchState="pristine";this.inputValue="";this.isDropdownVisible=false;this.filteredOptions=[];this.shouldExecuteSearch=function(e){var n;return t.isDropdownVisible&&(e===null||e===void 0?void 0:e.length)>=t.minSearchStringLength&&((n=t.selectedOption)===null||n===void 0?void 0:n.label)!==e};this.onBeginSearch=function(e){t.inputValue=e;t.searchState="in progress"};this.onCompleteSearch=function(e){t.highlightedOptionIndex=undefined;switch(e.kind){case"too-many-results":t.searchState="too many results";t.filteredOptions=[];break;case"success":t.searchState="done";t.filteredOptions=e.value;break;default:t.searchState="done";t.filteredOptions=[];break}};this.renderFilteredResults=function(){if(t.searchState==="pristine"){return h("span",{class:"cursor-pointer text-gray-500 py-1.5 pl-4"},"Start typing to find the results")}if(t.searchState==="in progress"){return h("span",{class:"cursor-pointer text-gray-500 py-1.5 pl-4"},"Searching...")}if(t.searchState==="too many results"){return h("span",{class:"cursor-pointer text-gray-500 py-1.5 pl-4"},"Keep typing to narrow down your search.")}if(t.filteredOptions.length===0){return h("span",{class:"cursor-pointer text-gray-500 py-1.5 pl-4"},"No items match your search")}return t.filteredOptions.map((function(e,n){return h("div",{class:{"cursor-pointer text-wrap hover:bg-primary-base py-1.5 pl-4":true,"bg-primary-base":t.isOptionSelected(e)},onClick:function(r){t.highlightedOptionIndex=n;t.toggleDropdown(false);t.selectOption(e)}},e.label)}))};this.resetInput=function(){var e,n;t.inputValue=(n=(e=t.selectedOption)===null||e===void 0?void 0:e.label)!==null&&n!==void 0?n:""};this.toggleDropdown=function(e){t.isDropdownVisible=e};this.processKeyboardNavigation=function(e){var n="Enter";var r="ArrowDown";var i="ArrowUp";var a="Escape";switch(e.key){case r:t.toggleDropdown(true);t.highlightItem("Next");return true;case i:t.highlightItem("Prev");return true;case n:if(t.highlightedOptionIndex!==undefined){t.toggleDropdown(false);t.selectOption(t.filteredOptions[t.highlightedOptionIndex])}return true;case a:t.inputElement.blur();return true}return false};this.highlightItem=function(e){var n=e==="Next"?1:-1;if(t.filteredOptions.length===0){return}t.highlightedOptionIndex=t.highlightedOptionIndex===undefined?0:Math.min(Math.max(0,t.highlightedOptionIndex+n),t.filteredOptions.length-1);if(t.highlightedOptionIndex!==undefined)t.selectOption(t.filteredOptions[t.highlightedOptionIndex])};this.selectOption=function(e){t.selectedOption=e;t.inputValue=e.label;t.valueChanged.emit(e)};this.isOptionSelected=function(e){var n;return((n=t.selectedOption)===null||n===void 0?void 0:n.label)===e.label}}e.prototype.componentWillLoad=function(){this.selectedOption=this.value};e.prototype.componentDidLoad=function(){var e=this;this.searchResultsSubscription=fromEvent(this.inputElement,"keyup").pipe(debounceTime(500),map((function(t){return e.inputElement.value})),distinctUntilChanged(),filter(this.shouldExecuteSearch),tap(this.onBeginSearch),mergeMap(this._searchFunction),tap(this.onCompleteSearch)).subscribe();this.resetInput()};e.prototype.disconnectedCallback=function(){this.searchResultsSubscription.unsubscribe()};e.prototype.handleFocus=function(){this.toggleDropdown(true)};e.prototype.handleBlur=function(){if(this.isMouseOver){return}this.toggleDropdown(false);this.resetInput()};e.prototype.handleKeyDown=function(e){if(this.processKeyboardNavigation(e)){e.preventDefault()}};e.prototype.render=function(){var e=this;var t;return h(Host,null,h("div",{class:"relative"},h("input",{"data-testid":this.testId,type:"text",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md":true,"invalid:border-red-300 invalid:text-red-900 invalid:placeholder-red-300 invalid:focus:ring-red-500 invalid:focus:border-red-500":this.showValidationErrors},placeholder:this.placeholder,required:this.required,disabled:this.disabled,value:this.inputValue,ref:function(t){return e.inputElement=t}}),h("div",{class:{"invalid-feedback mt-2 text-sm text-red-600":true,hidden:!this.isDropdownVisible}},(t=this.requiredValidationMessage)!==null&&t!==void 0?t:"Required."),h("div",{class:{"sss-dropdown-menu absolute shadow rounded-md border mt-0.5 w-full overflow-auto bg-white z-50 py-2 text-sm":true,hidden:!this.isDropdownVisible},onMouseEnter:function(t){return e.isMouseOver=true},onMouseLeave:function(t){return e.isMouseOver=false}},this.renderFilteredResults())))};Object.defineProperty(e.prototype,"_searchFunction",{get:function(){if(this.searchFunction===undefined){throw new Error("Can't render <sss-dropdown-async/> component with no searchFunction")}return this.searchFunction},enumerable:false,configurable:true});return e}();SelectInputAsync.style=dropdownAsyncCss;var ExistingFundService=function(){function e(){}e.prototype.GetExistingFundAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,r,i,a,s,o,u,o,l,c,l,c,l,o,l,c;return __generator(this,(function(d){switch(d.label){case 0:t=superSelectionAppService.superBuyer.superChoice;n=(e=superSelectionAppService.superBuyer.superChoice)===null||e===void 0?void 0:e.choiceDetails;if(!t)return[2,none];if(!n)return[2,none];r=t.dateSubmitted==undefined?none:some(new Date(t.dateSubmitted));i=getSuperChoiceUsi(n);a=getSuperChoiceMemberNumber(n);s=n.kind;switch(s){case"Promoted":return[3,1];case"MyOwnFund":return[3,3];case"SMSF":return[3,5];case"Default":return[3,6];case"PromotedDefault":return[3,8];case"DefinedBenefits":return[3,10];case"PromotedDefaultWithJoin":return[3,12]}return[3,14];case 1:if(isNone(i))return[2,none];return[4,this.getFundByUsiAsync(i.value)];case 2:o=d.sent();return[2,some({type:"Promoted Fund",id:getPromotedFundId(n.promoted),name:isSome(o)?o.value.productName:i.value,usi:i,valid:"Active",memberNumber:a,lastNominatedAt:r})];case 3:u=n.myOwnFund.usi;return[4,this.getFundByUsiAsync(u)];case 4:o=d.sent();return[2,some({type:"My Own Fund",name:isSome(o)?o.value.productName:u,usi:i,valid:this.toFundValidState(o),memberNumber:a,lastNominatedAt:r})];case 5:return[2,some({type:"Self Managed Fund",name:n.smsf.fundName,valid:"Unknown",lastNominatedAt:r})];case 6:l=n.default.usi;return[4,this.getFundByUsiAsync(l)];case 7:c=d.sent();return[2,some({type:"Default Fund",name:isSome(c)?c.value.productName:l,usi:i,valid:this.toFundValidState(c),lastNominatedAt:r})];case 8:l=n.promotedDefault.usi;return[4,this.getFundByUsiAsync(l)];case 9:c=d.sent();return[2,some({type:"Promoted Default Fund",id:n.promotedDefault.fundId,name:isSome(c)?c.value.productName:l,usi:i,valid:this.toFundValidState(c),lastNominatedAt:r})];case 10:l=n.definedBenefits.usi;return[4,this.getFundByUsiAsync(l)];case 11:o=d.sent();return[2,some({type:"Defined Benefits Fund",name:isSome(o)?o.value.productName:l,usi:i,valid:this.toFundValidState(o),lastNominatedAt:r})];case 12:l=n.promotedDefaultWithJoin.usi;return[4,this.getFundByUsiAsync(l)];case 13:c=d.sent();return[2,some({type:"Promoted Default Fund With Join",id:n.promotedDefaultWithJoin.fundId,name:isSome(c)?c.value.productName:l,usi:i,valid:this.toFundValidState(c),memberNumber:a,lastNominatedAt:r})];case 14:return[2,none]}}))}))};e.prototype.submitRetainSuperFundAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/retain-super-fund").post(e).badRequest((function(){throw new Error("Failed to process default fund join request")})).text()]}))}))};e.prototype.getFundByUsiAsync=function(e){return australianFundLookupService.getFundAsync(e,true)};e.prototype.toFundValidState=function(e){if(isSome(e)){return e.value.isActive?"Active":"Inactive"}else{return"Unknown"}};return e}();var existingFundService=new ExistingFundService;var ExistingChoice=function(){function e(e){registerInstance(this,e);this.eventTrackingService=EventTrackingService.Instance;this.createSuperFundNominationDetail=function(e){function t(e){return isSome(e)?e.value:undefined}function n(e){return"usi"in e?t(e.usi):undefined}function r(e){return"memberNumber"in e?t(e.memberNumber):undefined}return{fundType:e.type.toString(),fundName:e.name,fundUsi:n(e),memberNumber:r(e),fundStatus:e.valid.toString(),lastNominatedAt:isSome(e.lastNominatedAt)?e.lastNominatedAt.value.toISOString():""}}}e.prototype.componentDidLoad=function(){var e=this.createSuperFundNominationDetail(this.existingFund);return this.eventTrackingService.TrackSuperFundNominationViewedAsync(e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,existingFundService.GetExistingFundAsync()];case 1:e=t.sent();if(isSome(e)&&e.value.valid!=="Inactive"){this.existingFund=e.value}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)}return[2]}}))}))};e.prototype.render=function(){var e=this;var t=function(e){return h("div",{class:"flex justify-center"})};var n=function(){return h("div",{class:"flex h-20 justify-center items-center relative"},h("div",{class:"h-20 w-20 rounded-full bg-primary-base opacity-10"}),h("div",{class:"h-10 w-10 absolute"},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",class:"fill-primary-base"},h("path",{d:"M174.7 111.8C165.1 110.3 160.1 102.1 161.5 93.35C170.4 40.37 216.5 0 272 0C320.8 0 362.3 31.19 377.6 74.67C380.6 82.1 376.2 92.14 367.9 95.09C359.5 98.03 350.4 93.66 347.5 85.33C336.5 54.24 306.8 32 272 32C232.4 32 199.5 60.82 193.1 98.65C191.6 107.4 183.4 113.2 174.7 111.8V111.8zM400 264C400 250.7 410.7 240 424 240C437.3 240 448 250.7 448 264C448 277.3 437.3 288 424 288C410.7 288 400 277.3 400 264zM488.5 125.8L480 159.1C501.1 176.5 519.6 198.5 530.7 224H544C561.7 224 576 238.3 576 256V352C576 369.7 561.7 384 544 384H512C495.5 405.1 473.5 423.6 448 434.7V464C448 490.5 426.5 512 400 512H368C341.5 512 320 490.5 320 464V448H256V464C256 490.5 234.5 512 208 512H176C149.5 512 128 490.5 128 464V416C89.14 386.8 64 340.3 64 288C28.52 287.2 0 258.2 0 222.6C0 197.8 14 175.1 36.18 164L40.84 161.7C48.75 157.7 58.36 160.9 62.31 168.8C66.26 176.7 63.06 186.4 55.16 190.3L50.49 192.6C39.16 198.3 31.1 209.9 31.1 222.6C31.1 241 46.97 256 65.44 256H67.2C82.02 182.1 146.6 128 223.1 128H376.4C394 108.4 419.6 96 448 96H465.3C480.9 96 492.3 110.7 488.5 125.8H488.5zM224 160C153.3 160 96 217.3 96 288C96 329.9 116.1 367 147.2 390.4L160 400V464C160 472.8 167.2 480 176 480H208C216.8 480 224 472.8 224 464V416H352V464C352 472.8 359.2 480 368 480H400C408.8 480 416 472.8 416 464V413.7L435.2 405.4C455.6 396.5 473.2 382.4 486.4 364.8L496 352H544V256H509.7L501.4 236.8C492.5 216.4 478.4 198.8 460.8 185.6L443.8 172.8L455 128H448C429 128 412.1 136.2 400.3 149.3L390.7 160H224z"}))))};var r=function(){return h("div",{class:"flex h-20 justify-center items-center relative"},h("div",{class:"h-20 w-20 rounded-full bg-primary-base opacity-10"}),h("div",{class:"h-10 w-10 absolute"},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",class:"fill-primary-base"},h("path",{d:"M248.9 192H272v48C272 248.8 279.2 256 288 256C296.8 256 304 248.8 304 240V192h23.12C411.4 192 480 113 480 16C480 7.164 472.8 0 464 0h-39.13C364.9 0 313 40.13 288 98.13C263 40.13 211.1 0 151.1 0H112C103.2 0 96 7.164 96 16C96 113 164.6 192 248.9 192zM424.9 32h22.38c-6.625 71.88-58 128-120 128h-22.5C311.4 88.13 362.8 32 424.9 32zM151.1 32C213.3 32 264.5 88.13 271.3 160h-22.5c-62 0-113.4-56.13-120-128H151.1zM558.2 333.6c-9.5-8.619-22-13.37-35.12-13.37c-12.5 0-24.88 4.248-34.62 12.12l-61.45 49.21c-1.928 1.545-4.324 2.385-6.795 2.385h-41.62c4.625-9.619 6.5-20.74 4.75-32.23C379.4 323.7 353.7 304 325.6 304H181.2c-20.75 0-40.1 6.746-57.5 19.24l-38.5 28.73H16c-8.801 0-16 7.195-16 15.99S7.198 383.1 15.1 383.1l80.01-.0238l46.86-35.25c11.12-8.244 24.62-12.74 38.37-12.74h146.7c13.25 0 24 10.74 24 23.99s-10.75 23.98-24 23.98H239.1c-8.75 0-16 7.246-16 15.99c0 8.746 7.25 15.99 16 15.99h180.2c9.625 0 19-3.248 26.62-9.246l61.62-49.22c4.25-3.373 9.5-5.248 14.62-5.248c5 0 9.875 1.75 13.75 5.248c10.12 9.119 9.375 24.48-.875 32.61l-100.7 80.58c-7.584 6.064-17.01 9.369-26.72 9.369H16c-8.801 0-15.1 7.189-15.1 15.98S7.198 512 15.1 512h392.5c17 0 33.38-5.871 46.62-16.37l100.9-80.7c12.25-9.744 19.5-24.36 19.1-39.98C576.5 359.3 569.1 344.2 558.2 333.6z"}))))};var i=function(){return h("div",{class:"flex h-20 justify-center items-center relative"},h("div",{class:"h-20 w-20 rounded-full bg-primary-base opacity-10"}),h("div",{class:"h-10 w-10 absolute"},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:"fill-primary-base"},h("path",{d:"M448 96h-64V48C384 21.53 362.5 0 336 0h-160C149.5 0 128 21.53 128 48V96H64C28.65 96 0 124.7 0 160v256c0 35.35 28.65 64 64 64h384c35.35 0 64-28.65 64-64V160C512 124.7 483.3 96 448 96zM160 48C160 39.17 167.2 32 176 32h160C344.8 32 352 39.17 352 48V96H160V48zM480 416c0 17.64-14.36 32-32 32H64c-17.64 0-32-14.36-32-32V288h144v64c0 8.844 7.156 16 16 16h128c8.844 0 16-7.156 16-16V288H480V416zM208 336V288h96v48H208zM480 256H32V160c0-17.64 14.36-32 32-32h384c17.64 0 32 14.36 32 32V256z"}))))};var a=function(){return h("div",{class:"flex h-20 justify-center items-center relative"},h("div",{class:"h-20 w-20 rounded-full bg-primary-base opacity-10"}),h("div",{class:"h-10 w-10 absolute"},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",class:"fill-primary-base"},h("path",{d:"M174.7 111.8C165.1 110.3 160.1 102.1 161.5 93.35C170.4 40.37 216.5 0 272 0C320.8 0 362.3 31.19 377.6 74.67C380.6 82.1 376.2 92.14 367.9 95.09C359.5 98.03 350.4 93.66 347.5 85.33C336.5 54.24 306.8 32 272 32C232.4 32 199.5 60.82 193.1 98.65C191.6 107.4 183.4 113.2 174.7 111.8V111.8zM400 264C400 250.7 410.7 240 424 240C437.3 240 448 250.7 448 264C448 277.3 437.3 288 424 288C410.7 288 400 277.3 400 264zM488.5 125.8L480 159.1C501.1 176.5 519.6 198.5 530.7 224H544C561.7 224 576 238.3 576 256V352C576 369.7 561.7 384 544 384H512C495.5 405.1 473.5 423.6 448 434.7V464C448 490.5 426.5 512 400 512H368C341.5 512 320 490.5 320 464V448H256V464C256 490.5 234.5 512 208 512H176C149.5 512 128 490.5 128 464V416C89.14 386.8 64 340.3 64 288C28.52 287.2 0 258.2 0 222.6C0 197.8 14 175.1 36.18 164L40.84 161.7C48.75 157.7 58.36 160.9 62.31 168.8C66.26 176.7 63.06 186.4 55.16 190.3L50.49 192.6C39.16 198.3 31.1 209.9 31.1 222.6C31.1 241 46.97 256 65.44 256H67.2C82.02 182.1 146.6 128 223.1 128H376.4C394 108.4 419.6 96 448 96H465.3C480.9 96 492.3 110.7 488.5 125.8H488.5zM224 160C153.3 160 96 217.3 96 288C96 329.9 116.1 367 147.2 390.4L160 400V464C160 472.8 167.2 480 176 480H208C216.8 480 224 472.8 224 464V416H352V464C352 472.8 359.2 480 368 480H400C408.8 480 416 472.8 416 464V413.7L435.2 405.4C455.6 396.5 473.2 382.4 486.4 364.8L496 352H544V256H509.7L501.4 236.8C492.5 216.4 478.4 198.8 460.8 185.6L443.8 172.8L455 128H448C429 128 412.1 136.2 400.3 149.3L390.7 160H224z"}))))};var s=function(){return e.existingFund.type=="Defined Benefits Fund"?null:h("div",{class:"mt-4"},h("sss-button",{testid:"choose-another-fund-button",fillWidth:true,variant:"secondary",promiseFn:function(){return e.handleFundNominationDeclined()}},"Choose another fund"))};return h("div",null,h("div",{class:"text-2xl sm:text-3xl font-bold text-center"},"Your super nomination"),this.existingFund.type=="Defined Benefits Fund"?null:h("div",{class:"sm:text-lg text-gray-600 mt-3 sm:mt-4 max-w-800 text-center leading-7"},"Continue with your chosen fund or choose another fund below."),h("div",{class:"flex justify-center mt-8 sm:mt-12"},h("div",{class:"max-w-400 w-full"},h("div",{class:"flex-col border shadow-sm p-6 pt-8 rounded-lg text-center"},h("div",{class:"space-y-4"},function(){switch(e.existingFund.type){case"Promoted Fund":case"Promoted Default Fund":return h(t,{name:e.existingFund.name});case"Self Managed Fund":return h(r,null);case"My Own Fund":case"Promoted Default Fund With Join":return h(n,null);case"Default Fund":return h(i,null);case"Defined Benefits Fund":return h(a,null);default:return h("div",null)}}(),h("div",{class:"sm:text-lg font-bold leading-6 break-words"},function(){switch(e.existingFund.type){case"Default Fund":return"Employer's default fund";case"My Own Fund":case"Promoted Fund":case"Self Managed Fund":case"Promoted Default Fund":case"Defined Benefits Fund":case"Promoted Default Fund With Join":return e.existingFund.name;default:return""}}())),h("div",{class:"mt-6"},h("sss-button",{testid:"continue-with-this-fund-button",fillWidth:true,promiseFn:function(){return e.handleFundNominationAccepted()}},"Continue with this fund"))),h(s,null))))};e.prototype.handleFundNominationAccepted=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundNominationDetail(this.existingFund);return[4,existingFundService.submitRetainSuperFundAsync(e)];case 1:t.sent();superSelectionAppService.markSuperSelectionAsSubmitted();return[2]}}))}))};e.prototype.handleFundNominationDeclined=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundNominationDetail(this.existingFund);return[4,this.eventTrackingService.TrackSuperFundNominationDeclinedAsync(e)];case 1:t.sent();navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage);return[2]}}))}))};return e}();var DefaultFooterText="Powered by Flare";var FooterSection=function(){function e(e){var t=this;registerInstance(this,e);this.footerText=function(){return t.textOverride!==undefined?t.textOverride:DefaultFooterText}}e.prototype.render=function(){return h("div",{class:{"text-center text-gray-500 text-xs w-full max-w-960 mx-auto":true,"mt-8 sm:mt-20":!superSelectionAppService.hideFooterSection}},!superSelectionAppService.hideFooterSection&&h("span",null,this.footerText()),h("p",{class:"block text-transparent"},"v",AppVersion))};return e}();var RouteLink=function(e,t){return h("stencil-route-link",{exact:true,url:e.route},h("div",{class:{"block focus:outline-none focus:ring-2 ring-offset-1 focus:ring-primary-focus focus:z-10 rounded-md py-2 text-sm font-medium w-auto px-3 sm:px-8 h-full":true,"bg-white shadow-sm text-primary-base":e.isActive,"hover:bg-primary-hover text-white":!e.isActive}},t))};var ChooseAnotherFundLink=function(e){var t=SuperSelectionAppRoutes.MyOwnFund;if(window.location.href.includes(SuperSelectionAppRoutes.SelfManagedFund)){t=SuperSelectionAppRoutes.SelfManagedFund}else if(window.location.href.includes(SuperSelectionAppRoutes.DefaultFund)){t=SuperSelectionAppRoutes.DefaultFund}else if(window.location.href.includes(SuperSelectionAppRoutes.FeaturedFunds)){t=SuperSelectionAppRoutes.FeaturedFunds}return h(RouteLink,{route:t,isActive:e.isActive},"Choose another fund")};var HeaderSection=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h("div",{class:"flex justify-center"},h("div",{class:"text-center max-w-800"},h("h3",{class:"font-bold mb-3 sm:mb-4 text-2xl sm:text-3xl"},"Nominate a super fund"),h(Fragment,null,h("div",{class:"text-gray-600 sm:text-lg leading-7 sm:leading-8"},superSelectionAppService.superCampaignCanNotBeActivated?h(Fragment,null,"You can choose any super fund, including your current fund/SMSF or your employer’s default fund."):h(Fragment,null,"You can choose any super fund, including your current fund/SMSF, your employer’s default fund, or alternatively, you can select from one of the featured funds.")),!superSelectionAppService.superCampaignCanNotBeActivated&&h("div",{class:"inline-flex mt-8 sm:mt-12 bg-primary-base rounded-lg p-0.5 whitespace-normal"},h(RouteLink,{route:SuperSelectionAppRoutes.ChoicePage,isActive:false},"Featured super funds"),h(ChooseAnotherFundLink,{isActive:true})))))};return e}();var LoadingIndicator=function(){function e(e){registerInstance(this,e);this.theme="primary";this.size=48}e.prototype.render=function(){return h("div",{class:"inline-block animate-spin"},h("svg",{width:this.size,height:this.size,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM1.99743 8C1.99743 11.3151 4.68487 14.0026 8 14.0026C11.3151 14.0026 14.0026 11.3151 14.0026 8C14.0026 4.68487 11.3151 1.99743 8 1.99743C4.68487 1.99743 1.99743 4.68487 1.99743 8Z",fill:"white","fill-opacity":"0.3"}),h("path",{d:"M8 1C8 0.447715 8.44943 -0.00643769 8.99741 0.0624193C9.70527 0.151368 10.3996 0.334798 11.0615 0.608964C12.0321 1.011 12.914 1.60028 13.6569 2.34315C14.3997 3.08602 14.989 3.96793 15.391 4.93853C15.6652 5.60043 15.8486 6.29473 15.9376 7.0026C16.0064 7.55057 15.5523 8 15 8C14.4477 8 14.0085 7.54925 13.9169 7.00462C13.842 6.55939 13.7169 6.12298 13.5433 5.7039C13.2417 4.97595 12.7998 4.31451 12.2426 3.75736C11.6855 3.20021 11.0241 2.75825 10.2961 2.45672C9.87702 2.28313 9.44061 2.15804 8.99538 2.08314C8.45075 1.99152 8 1.55228 8 1Z",class:this.theme==="primary"?"fill-primary-base":"fill-white"})))};return e}();var LoadingPage=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h(Host,{class:"flex flex-col justify-center items-center"},h("h5",{class:"text-lg"},"Loading your superannuation step"),h("sss-loading-indicator",null))};return e}();var MyOwnFundEngagementStep=function(){function e(e){var t=this;registerInstance(this,e);this.stepContinued=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender=="byof-engagement"))return[3,2];return[4,EventTrackingService.Instance.TrackSuperMyOwnFundEngagementStepContinued(this.fundUsi,e.detail.reason)];case 1:t.sent();this.navigateToStandardChoice();t.label=2;case 2:return[2]}}))}))};this.subscribeToStepEvents=function(){for(var e in t.stepEventHandlers){document.addEventListener(e,t.stepEventHandlers[e])}};this.unSubscribeFromStepEvents=function(){for(var e in t.stepEventHandlers){document.removeEventListener(e,t.stepEventHandlers[e])}};this.stepEventHandlers={continue:this.stepContinued.bind(this)}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!(superSelectionAppService.isBringYourOwnFundCustomStepEnabled&&superSelectionAppService.isUsingSuperCampaign&&Option.isSome(state.myOwnFundForm.fundUsi)&&Option.isSome(state.myOwnFundForm.fundName)&&Option.isSome(state.myOwnFundForm.memberNumber)&&Option.isSome(state.myOwnFundForm.memberFirstName)&&Option.isSome(state.myOwnFundForm.memberFamilyName)&&Option.isSome(superSelectionAppService.backendUrl)&&Option.isSome(superSelectionAppService.state.jwt)))return[3,2];this.backendUrl=superSelectionAppService.backendUrl.value;this.accessToken=superSelectionAppService.state.jwt.value;this.fundUsi=state.myOwnFundForm.fundUsi.value;this.fundName=state.myOwnFundForm.fundName.value;this.memberNumber=state.myOwnFundForm.memberNumber.value;this.memberFirstName=state.myOwnFundForm.memberFirstName.value;this.memberFamilyName=state.myOwnFundForm.memberFamilyName.value;this.unSubscribeFromStepEvents();this.subscribeToStepEvents();superSelectionAppService.hideFooterSection=true;return[4,EventTrackingService.Instance.TrackSuperMyOwnFundEngagementStepActivationSucceeded(this.fundUsi)];case 1:e.sent();return[3,3];case 2:navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund);e.label=3;case 3:return[2]}}))}))};e.prototype.disconnectedCallback=function(){this.unSubscribeFromStepEvents();superSelectionAppService.hideFooterSection=false};e.prototype.render=function(){return h(Host,null,h("apollo-super-byof-engagement",{"backend-url":this.backendUrl,"access-token":this.accessToken,"fund-usi":this.fundUsi}))};e.prototype.navigateToStandardChoice=function(){var e=this;navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:this.fundName,fundDetails:{type:"myOwnFund",fundName:this.fundName,fundUsi:this.fundUsi,memberNumber:this.memberNumber},handleSubmitFn:function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:e=Object.assign({fundUsi:this.fundUsi,memberNumber:this.memberNumber,memberFirstName:this.memberFirstName,memberFamilyName:this.memberFamilyName,standardChoiceFormSignature:t},superSelectionAppService.promotedFundsConfig);return[4,customFundChoiceApi.submitCustomFundChoiceAsync(e)];case 1:n.sent();return[2]}}))}))}})};return e}();injectHistory(MyOwnFundEngagementStep);var MemberNameInput=function(){function e(e){registerInstance(this,e);this.myInputChange=createEvent(this,"myInputChange",7);this.value="";this.name="";this.readableName="";this.showValidationErrors=false;this.errorMessage="";this.NAME_PATTERN="^[A-Za-z](?:[A-Za-z]||'[A-Za-z]||-[A-Za-z]|| [A-Za-z])*\\s*$"}e.prototype.render=function(){var e=this;return h(Host,null,h("input",{"data-testid":this.testId,type:"text",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md":true,"invalid:border-red-300 invalid:text-red-900 invalid:focus:ring-red-500 invalid:focus:border-red-500":this.showValidationErrors},required:true,pattern:this.NAME_PATTERN,name:this.name,value:this.value,onInput:function(t){return e.handleInput(t)}}),this.errorMessage&&h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},this.errorMessage))};e.prototype.handleInput=function(e){var t=e.target;t.value=t.value.replace(/\s+/g," ");this.validateInput(t);this.myInputChange.emit(t.value.trim())};e.prototype.validateInput=function(e){if(!e.checkValidity()){if(e.validity.valueMissing){this.errorMessage=this.readableName+" is required."}else if(e.validity.patternMismatch){if(e.value.startsWith("-")||e.value.startsWith("'")){this.errorMessage=this.readableName+" must start with a letter."}else if(e.value.includes("--")){this.errorMessage=this.readableName+" must not have a double hypen."}else{this.errorMessage=this.readableName+" contains unsupported characters."}}else{this.errorMessage="Invalid input."}}else{this.errorMessage=""}};return e}();var Prefill=function(){function e(e){registerInstance(this,e);this.prefill=undefined;this.ignorePopState=function(){return window.history.pushState(null,"",null)}}e.prototype.connectedCallback=function(){this.ignorePopState();window.addEventListener("popstate",this.ignorePopState)};e.prototype.disconnectedCallback=function(){window.removeEventListener("popstate",this.ignorePopState)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.prefill=isSome(superSelectionAppService.state.superChoicePrefill)?superSelectionAppService.state.superChoicePrefill.value:undefined;return[2]}))}))};e.prototype.render=function(){if(this.prefill&&this.prefill.type==="myOwnFund"){if(this.prefill.data.fundDetail.type==="Valid"){return this.renderMyOwnFund(this.prefill.data)}else{return this.renderInvalidMyOwnFund(this.prefill.data)}}if(this.prefill&&this.prefill.type==="smsf"){if(this.prefill.data.fundAbn.valid){return this.renderSMSF(this.prefill.data)}else{return this.renderInvalidSMSF(this.prefill.data)}}navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage);return null};e.prototype.renderMyOwnFund=function(e){return h("sss-prefill-my-own-fund",{history:this.history,prefill:e})};e.prototype.renderInvalidMyOwnFund=function(e){return h("sss-prefill-invalid-my-own-fund",{history:this.history,prefill:e})};e.prototype.renderSMSF=function(e){return h("sss-prefill-smsf",{history:this.history,prefill:e})};e.prototype.renderInvalidSMSF=function(e){return h("sss-prefill-invalid-smsf",{history:this.history,prefill:e})};return e}();var DisplayField=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h("div",{class:"flex w-full flex-col sm:flex-row sm:min-h-5 justify-center items-start gap-0.5 sm:gap-4 self-stretch"},h("div",{class:{"sm:w-2/5 sm:max-w-40 self-stretch text-gray-500 text-xs sm:text-sm not-italic font-medium leading-4 sm:leading-5":true,"text-red-600":!this.field.isValid}},this.field.name),h("div",{"data-testid":this.field.testId,class:{"sm:w-3/5 max-w-[300px] self-stretch text-gray-900 text-sm not-italic font-normal leading-5 break-words":true,"h-5 sm:h-auto":this.field.isEmpty,"text-red-600":!this.field.isValid}},this.field.value))};return e}();var PrefillErrorBox=function(){function e(e){registerInstance(this,e);this.withHeader=false}e.prototype.render=function(){var e=function(){return h("div",{class:"w-5 h-5"},h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},h("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18ZM8.70711 7.29289C8.31658 6.90237 7.68342 6.90237 7.29289 7.29289C6.90237 7.68342 6.90237 8.31658 7.29289 8.70711L8.58579 10L7.29289 11.2929C6.90237 11.6834 6.90237 12.3166 7.29289 12.7071C7.68342 13.0976 8.31658 13.0976 8.70711 12.7071L10 11.4142L11.2929 12.7071C11.6834 13.0976 12.3166 13.0976 12.7071 12.7071C13.0976 12.3166 13.0976 11.6834 12.7071 11.2929L11.4142 10L12.7071 8.70711C13.0976 8.31658 13.0976 7.68342 12.7071 7.29289C12.3166 6.90237 11.6834 6.90237 11.2929 7.29289L10 8.58579L8.70711 7.29289Z",fill:"#F87171"})))};return h("div",{class:"flex items-start self-stretch rounded-md bg-red-50"},h("div",{class:"w-1 self-stretch bg-red-400"}),h("div",{class:"flex items-start gap-3 flex-[1_0_0] p-4"},h(e,null),h("div",{class:"flex-col justify-start items-start gap-2 inline-flex"},this.withHeader&&h("div",{class:"self-stretch text-red-800 text-sm font-medium leading-tight"},"Please correct ",this.notificationList.length," issues with your fund details"),this.withHeader&&this.notificationList.map((function(e){return h("div",{class:"self-stretch h-5 flex-col justify-start items-start gap-1 flex"},h("div",{class:"self-stretch pl-1.5 justify-start items-start gap-[7px] inline-flex"},h("div",{class:"pt-1.5 justify-center items-center flex"},h("div",{class:"w-1.5 h-1.5 bg-red-700 rounded-full"})),h("div",{class:"grow shrink basis-0 text-red-700 text-sm font-normal leading-tight"},e)))})),!this.withHeader&&this.notificationList.map((function(e){return h("div",{class:"text-sm font-medium leading-tight text-red-800"},e)})))))};return e}();function isNullOrWhitespace(e){return e==null||e.trim()===""}var DisabledField=function(e,t,n){return h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},e),h("div",{"data-testid":t,class:"mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm"},n))};var Header=function(){return h("div",null,h("div",{class:"text-2xl sm:text-3xl font-bold text-center"},"Your super nomination"),h("div",{class:"sm:text-lg text-gray-600 mt-3 sm:mt-4 max-w-800 text-center leading-7"},"Review or update the below super fund nomination details provided by your employer."))};var Style=function(){function e(){}e.Input=function(e){return{"relative shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md focus:z-10":true,"invalid:border-red-300 invalid:text-red-900 invalid:placeholder-red-300 invalid:focus:ring-red-500 invalid:focus:border-red-500":e}};return e}();var NAME_PATTERN="[A-Za-z][A-Za-z']+(( |-)[A-Za-z][A-Za-z']+)*\\s*$";var FormField=function(){function e(e,t,n){this.name=e;this.testId=t;this._value=n!==null&&n!==void 0?n:"";this._errorMessage=this.validateAndReturnErrorMessage(this._value)}Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._errorMessage=this.validateAndReturnErrorMessage(e);this._value=e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isValid",{get:function(){return this._errorMessage===null},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isEmpty",{get:function(){return isNullOrWhitespace(this._value)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:false,configurable:true});return e}();var StaticFormField=function(){function e(e,t,n,r){this.name=e;this.testId=t;this._value=n!==null&&n!==void 0?n:"";this._isValid=r}Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isValid",{get:function(){return this._isValid},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isEmpty",{get:function(){return isNullOrWhitespace(this._value)},enumerable:false,configurable:true});return e}();var FundUsi=function(e){__extends(t,e);function t(t,n){return e.call(this,"Fund USI","fund-usi",t,n)||this}return t}(StaticFormField);var FundName=function(e){__extends(t,e);function t(t,n){return e.call(this,"Fund name","fund-name",t,n)||this}return t}(StaticFormField);var SmsfFundName=function(e){__extends(t,e);function t(t){return e.call(this,"Fund name","smsf-fund-name",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"Fund name is required."}else if(e.length<2){return"Enter a valid Fund name."}else{return null}};return t}(FormField);var MemberNumber=function(e){__extends(t,e);function t(t){return e.call(this,"Member number","member-number",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=/^[A-Za-z0-9]{4,16}$/;if(isNullOrWhitespace(e)){return"Member number is required."}else if(!t.test(e)){return"Enter a valid member number (only numbers and / or letters)"}else{return null}};return t}(FormField);var MemberLastName=function(e){__extends(t,e);function t(t){return e.call(this,"Member last name","member-last-name",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=new RegExp(NAME_PATTERN);if(isNullOrWhitespace(e)){return"Member last name is required."}else if(!t.test(e)){return"Member last name contains unsupported characters."}else{return null}};return t}(FormField);var MemberGivenNames=function(e){__extends(t,e);function t(t){return e.call(this,"Member given name(s)","member-given-names",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=new RegExp(NAME_PATTERN);if(isNullOrWhitespace(e)){return"Member given name(s) is required."}else if(!t.test(e)){return"Member given name(s) contains unsupported characters."}else{return null}};return t}(FormField);var FundAbn=function(e){__extends(t,e);function t(t,n){return e.call(this,"Fund ABN","fund-abn",t,n)||this}return t}(StaticFormField);var FundEsa=function(e){__extends(t,e);function t(t){return e.call(this,"Fund ESA","fund-esa",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"Fund ESA is required."}else if(e.length<2){return"Enter a valid Fund ESA."}else{return null}};return t}(FormField);var FundAddressLine1=function(e){__extends(t,e);function t(t){return e.call(this,"Address line 1","address-line-one",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"Address line 1 is required."}else if(e.length<2){return"Enter a valid Address line 1."}else{return null}};return t}(FormField);var FundAddressLine2=function(e){__extends(t,e);function t(t){return e.call(this,"Address line 2","address-line-two",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){return null};return t}(FormField);var FundAddressCity=function(e){__extends(t,e);function t(t){return e.call(this,"City/suburb","city-suburb",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"City/suburb is required."}else{return null}};return t}(FormField);var FundAddressPostcode=function(e){__extends(t,e);function t(t){return e.call(this,"Postcode","postcode",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=/^[0-9]{4}$/;if(isNullOrWhitespace(e)){return"Postcode is required."}else if(!t.test(e)){return"Enter a valid postcode."}else{return null}};return t}(FormField);var FundAddressState=function(e){__extends(t,e);function t(t){return e.call(this,"State","state",t)||this}Object.defineProperty(t.prototype,"options",{get:function(){return[{value:"NSW",label:"NSW"},{value:"QLD",label:"QLD"},{value:"ACT",label:"ACT"},{value:"VIC",label:"VIC"},{value:"TAS",label:"TAS"},{value:"WA",label:"WA"},{value:"SA",label:"SA"},{value:"NT",label:"NT"}]},enumerable:false,configurable:true});t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"State is required."}else if(this.options.find((function(t){return t.value=e}))===undefined){return"Enter a valid state."}else{return null}};return t}(FormField);var FundAddress=function(e){__extends(t,e);function t(t,n,r,i,a){var s=this;var o=[t,n,r,i,a].map((function(e){return e.value})).filter((function(e){return e})).join(", ");var u=t.isValid&&n.isValid&&r.isValid&&i.isValid&&a.isValid;s=e.call(this,"Fund address","fund-address",o,u)||this;return s}return t}(StaticFormField);var BankAccountName=function(e){__extends(t,e);function t(t){return e.call(this,"Account name","account-name",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"Account name is required."}else if(e.length<2){return"Enter a valid Account name."}else{return null}};return t}(FormField);var BankName=function(e){__extends(t,e);function t(t,n){return e.call(this,"Bank name","bank-name",t,n)||this}return t}(StaticFormField);var BankAccountBsb=function(e){__extends(t,e);function t(t){return e.call(this,"BSB","bsb",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=/^[0-9]{6,7}$/;if(isNullOrWhitespace(e)){return"BSB is required."}else if(!t.test(e)){return"Enter a valid BSB."}else{return null}};return t}(FormField);var BankAccountNumber=function(e){__extends(t,e);function t(t){return e.call(this,"Account number","account-number",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=/^[0-9]{2,11}$/;if(isNullOrWhitespace(e)){return"Account number is required."}else if(!t.test(e)){return"Enter a valid Account number."}else{return null}};return t}(FormField);var PrefillInvalidMyOwnFund=function(){function e(e){registerInstance(this,e);this.eventTrackingService=EventTrackingService.Instance;this.createSuperFundPrefillDeclinedDetail=function(e){return{fundType:"My Own Fund",isUsiValid:e.fundDetail.type==="Valid",isMemberNumberPresent:!isNullOrWhitespace(e.memberNumber),isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}};this.createSuperFundPrefillViewedDetail=function(e){return{fundType:"My Own Fund",isUsiValid:e.fundDetail.type==="Valid",isMemberNumberPresent:!isNullOrWhitespace(e.memberNumber),isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}}}e.prototype.componentDidLoad=function(){var e=this.createSuperFundPrefillViewedDetail(this.prefill);return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.prefill&&this.prefill.fundDetail.type==="Invalid"){this.fundUsi=new FundUsi(this.prefill.fundDetail.fundUsi,false);this.fundName=new FundName("",false);this.memberNumber=new MemberNumber(this.prefill.memberNumber);this.memberGivenNames=new MemberGivenNames(this.prefill.memberFirstName);this.memberLastName=new MemberLastName(this.prefill.memberFamilyName)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)}return[2]}))}))};e.prototype.render=function(){var e=this;return h("div",null,h(Header,null),h("div",{class:"flex flex-col items-center gap-8 mt-8 sm:mt-12"},h("div",{class:"flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg"},h("div",{class:"flex flex-col items-start gap-3 self-stretch"},h("div",{class:"self-stretch text-grey-900 text-lg not-italic font-bold leading-7"},"Your fund details"),h("sss-prefill-error-box",{class:"self-stretch",notificationList:["The fund USI is invalid, or no longer in use. You are required to choose another fund to continue with your super nomination."]}),h("div",{class:"flex flex-col gap-3 self-stretch mt-4"},h("sss-prefill-display-field",{field:this.fundUsi}),h("sss-prefill-display-field",{field:this.fundName}),h("sss-prefill-display-field",{field:this.memberNumber}),h("sss-prefill-display-field",{field:this.memberLastName}),h("sss-prefill-display-field",{field:this.memberGivenNames})))),h("div",{class:"flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4"},h("sss-button",{testid:"choose-another-fund-button",class:"self-stretch",fillWidth:true,variant:"primary",promiseFn:function(){return e.handleChooseAnotherFund()}},"Choose another fund"))))};e.prototype.handleChooseAnotherFund=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundPrefillDeclinedDetail(this.prefill);return[4,this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(e)];case 1:t.sent();return[2,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)]}}))}))};return e}();var PrefillInvalidSMSF=function(){function e(e){registerInstance(this,e);this.eventTrackingService=EventTrackingService.Instance;this.createSuperFundPrefillDeclinedDetail=function(e){return{fundType:"SMSF",isAbnValid:e.fundAbn.valid,isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}};this.createSuperFundPrefillViewedDetail=function(e){return{fundType:"SMSF",isAbnValid:e.fundAbn.valid,isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}}}e.prototype.componentDidLoad=function(){var e=this.createSuperFundPrefillViewedDetail(this.prefill);return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.prefill&&!this.prefill.fundAbn.valid){this.initialiseComponent(this.prefill)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.PrefillInvalidMyOwnFundPage)}return[2]}))}))};e.prototype.render=function(){var e=this;return h("div",null,h(Header,null),h("div",{class:"flex flex-col items-center gap-8 mt-8 sm:mt-12"},h("div",{class:"flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg"},h("div",{class:"flex flex-col items-start gap-3 self-stretch"},h("div",{class:"self-stretch text-grey-900 text-lg not-italic font-bold leading-7"},"Your self-managed super fund (SMSF) details"),h("sss-prefill-error-box",{class:"self-stretch",notificationList:["The fund ABN is invalid. You are required to choose another fund to continue with your super nomination."]}),h("div",{class:"flex flex-col gap-3 self-stretch mt-4"},h("sss-prefill-display-field",{field:this.fundName}),h("sss-prefill-display-field",{field:this.fundAbn}),h("sss-prefill-display-field",{field:this.fundEsa}),h("sss-prefill-display-field",{field:this.fundAddress}),h("sss-prefill-display-field",{field:this.memberLastName}),h("sss-prefill-display-field",{field:this.memberGivenNames}),h("div",{class:"mt-4 mb-2 text-gray-900 text-lg font-bold leading-7"},"Fund bank details"),h("sss-prefill-display-field",{field:this.bankAccountName}),h("sss-prefill-display-field",{field:this.bankAccountBsb}),h("sss-prefill-display-field",{field:this.bankAccountNumber})))),h("div",{class:"flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4"},h("sss-button",{testid:"make-another-nomination-button",class:"self-stretch",fillWidth:true,variant:"primary",promiseFn:function(){return e.handleFundNominationDeclined()}},"Make another nomination"))))};e.prototype.initialiseComponent=function(e){this.fundName=new SmsfFundName(e.fundName);this.fundAbn=new FundAbn(e.fundAbn.value,e.fundAbn.valid);this.fundEsa=new FundEsa(e.electronicServiceAddress);this.fundAddressLine1=new FundAddressLine1(e.addressLine1);this.fundAddressLine2=new FundAddressLine2(e.addressLine2);this.fundAddressCity=new FundAddressCity(e.addressCity);this.fundAddressPostcode=new FundAddressPostcode(e.addressPostcode);this.fundAddressState=new FundAddressState(e.addressState);this.fundAddress=new FundAddress(this.fundAddressLine1,this.fundAddressLine2,this.fundAddressCity,this.fundAddressState,this.fundAddressPostcode);this.memberGivenNames=new MemberGivenNames(e.memberFirstName);this.memberLastName=new MemberLastName(e.memberFamilyName);this.bankAccountName=new BankAccountName(e.bankAccountName);this.bankAccountBsb=new BankAccountBsb(e.bankAccountBsb);this.bankAccountNumber=new BankAccountNumber(e.bankAccountNumber)};e.prototype.handleFundNominationDeclined=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundPrefillDeclinedDetail(this.prefill);return[4,this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(e)];case 1:t.sent();return[2,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)]}}))}))};return e}();var PrefillMyOwnFund=function(){function e(e){registerInstance(this,e);this.mode="review";this.formState="pristine";this.isSubmitDisabled=true;this.eventTrackingService=EventTrackingService.Instance;this.createSuperFundPrefillDeclinedDetail=function(e){return{fundType:"My Own Fund",isUsiValid:e.fundDetail.type==="Valid",isMemberNumberPresent:!isNullOrWhitespace(e.memberNumber),isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}};this.createSuperFundPrefillViewedDetail=function(e){return{fundType:"My Own Fund",isUsiValid:e.fundDetail.type==="Valid",isMemberNumberPresent:!isNullOrWhitespace(e.memberNumber),isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}}}e.prototype.componentDidLoad=function(){var e=this.createSuperFundPrefillViewedDetail(this.prefill);return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.prefill&&this.prefill.fundDetail.type==="Valid"){this.initialiseComponent(this.prefill.fundDetail.fundName,this.prefill)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)}return[2]}))}))};e.prototype.render=function(){var e=this;var t=[this.memberNumber.errorMessage,this.memberLastName.errorMessage,this.memberGivenNames.errorMessage].filter((function(e){return e!==null}));return h("div",null,h(Header,null),h("div",{class:"flex flex-col items-center gap-8 mt-8 sm:mt-12"},h("div",{class:"flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg"},h("div",{class:"flex flex-col items-start gap-3.5 self-stretch"},h("div",{class:"self-stretch text-grey-900 text-lg not-italic font-bold leading-7"},"Your fund details"),h("sss-prefill-warning-box",{class:"self-stretch",notificationList:["Make sure you are a current member of the fund before completing this step.","Please check that the fund USI is correct as some funds have similar names."]}),this.mode==="review"&&t.length>0&&h("sss-prefill-error-box",{class:"self-stretch",notificationList:t,withHeader:true}),this.mode==="review"&&h("div",{class:"flex flex-col gap-3 self-stretch mt-4"},h("sss-prefill-display-field",{field:this.fundUsi}),h("sss-prefill-display-field",{field:this.fundName}),h("sss-prefill-display-field",{field:this.memberNumber}),h("sss-prefill-display-field",{field:this.memberLastName}),h("sss-prefill-display-field",{field:this.memberGivenNames})),this.mode==="review"&&h("sss-button",{testid:"edit-details-button",class:"self-stretch mt-3",fillWidth:true,variant:"secondary",promiseFn:function(){return e.setModeToEdit()}},h("div",{class:"flex flex-row gap-2"},h("div",{class:"text-sm not-italic font-medium leading-4"},"Edit details"),h("div",{class:"w-4 h-4 relative"},h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"currentColor"},h("path",{d:"M11.369 2.86865C11.9939 2.24381 13.0069 2.24381 13.6318 2.86865C14.2566 3.49349 14.2566 4.50656 13.6318 5.1314L12.9974 5.76571L10.7347 3.50297L11.369 2.86865Z"}),h("path",{d:"M9.60334 4.63434L2.90039 11.3373V13.6H5.16313L11.8661 6.89708L9.60334 4.63434Z"}))))),this.mode==="edit"&&h("form",{noValidate:true,onSubmit:function(e){return e.preventDefault()},class:{"was-validated":this.formState==="validated"},ref:function(t){return e.formElement=t},onInput:function(t){return e.isSubmitDisabled=e.formHasMissingData()}},DisabledField(this.fundName.name,this.fundName.testId,this.fundName.value),DisabledField(this.fundUsi.name,this.fundUsi.testId,this.fundUsi.value),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.memberNumber.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,pattern:"[A-Za-z0-9]{4,16}","data-testid":this.memberNumber.testId,value:this.memberNumber.value,onInput:function(t){e.updateMemberNumber(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.memberNumber.errorMessage))),h("div",{class:"flex mt-3 gap-x-4 flex-col sm:flex-row"},h("div",{class:"w-full sm:w-1/2"},h("label",{class:"text-sm font-medium text-gray-700"},this.memberGivenNames.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,pattern:NAME_PATTERN,"data-testid":this.memberGivenNames.testId,value:this.memberGivenNames.value,onInput:function(t){e.updateMemberGivenNames(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.memberGivenNames.errorMessage))),h("div",{class:"w-full sm:w-1/2"},h("label",{class:"text-sm font-medium text-gray-700"},this.memberLastName.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,pattern:NAME_PATTERN,"data-testid":this.memberLastName.testId,value:this.memberLastName.value,onInput:function(t){e.updateMemberLastName(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.memberLastName.errorMessage))))))),h("div",{class:"flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4"},h("sss-button",{testid:"continue-button",class:"self-stretch",fillWidth:true,variant:"primary",disabled:this.isSubmitDisabled,promiseFn:function(){return e.handleSubmitForm()}},"Continue"),h("sss-button",{testid:"choose-another-fund-button",class:"self-stretch",fillWidth:true,variant:"secondary",promiseFn:function(){return e.handleFundNominationDeclined()}},"Choose another fund"))))};e.prototype.initialiseComponent=function(e,t){this.fundUsi=new FundUsi(t.fundDetail.fundUsi,true);this.fundName=new FundName(e,true);this.memberNumber=new MemberNumber(t.memberNumber);this.memberGivenNames=new MemberGivenNames(t.memberFirstName);this.memberLastName=new MemberLastName(t.memberFamilyName);this.isSubmitDisabled=this.formHasMissingData()};e.prototype.isFormValid=function(){return this.fundUsi.isValid&&this.fundName.isValid&&this.memberNumber.isValid&&this.memberGivenNames.isValid&&this.memberLastName.isValid};e.prototype.formHasMissingData=function(){return this.fundUsi.isEmpty||this.fundName.isEmpty||this.memberNumber.isEmpty||this.memberGivenNames.isEmpty||this.memberLastName.isEmpty};e.prototype.setModeToEdit=function(){this.mode="edit";return Promise.resolve()};e.prototype.updateMemberNumber=function(e){this.memberNumber=new MemberNumber(e.trim())};e.prototype.updateMemberGivenNames=function(e){this.memberGivenNames=new MemberGivenNames(e.trimStart())};e.prototype.updateMemberLastName=function(e){this.memberLastName=new MemberLastName(e.trim())};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.formState="validated";if(!this.isFormValid()){return[2]}if(this.mode==="edit"&&!this.formElement.checkValidity()){return[2]}navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:this.fundName.value,fundDetails:{type:"myOwnFund",fundName:this.fundName.value,fundUsi:this.fundUsi.value,memberNumber:this.memberNumber.value},handleSubmitFn:function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:e=Object.assign({fundUsi:this.fundUsi.value,memberNumber:this.memberNumber.value,memberFirstName:this.memberGivenNames.value,memberFamilyName:this.memberLastName.value,standardChoiceFormSignature:t},superSelectionAppService.promotedFundsConfig);return[4,customFundChoiceApi.submitCustomFundChoiceAsync(e)];case 1:n.sent();return[2]}}))}))}});return[2]}))}))};e.prototype.handleFundNominationDeclined=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundPrefillDeclinedDetail(this.prefill);return[4,this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(e)];case 1:t.sent();return[2,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)]}}))}))};return e}();var bsbNumbers={"01":"Australia and New Zealand Banking Group","03":"Westpac Banking Corporation",73:"Westpac Banking Corporation","06":"Commonwealth Bank of Australia",76:"Commonwealth Bank of Australia","08":"National Australia Bank",78:"National Australia Bank","09":"Reserve Bank of Australia",10:"BankSA (division of Westpac Bank)",11:"St George Bank (division of Westpac Bank)",33:"St George Bank (division of Westpac Bank)",12:"Bank of Queensland",14:"Rabobank",15:"Town & Country Bank",18:"Macquarie Bank",19:"Bank of Melbourne (division of Westpac Bank)",55:"Bank of Melbourne (division of Westpac Bank)",21:"JP Morgan Chase Bank",22:"BNP Paribas",23:"Bank of America",24:"Citibank & Citibank NA",510:"Citibank & Citibank NA",25:"BNP Paribas Securities",26:"Bankers Trust Australia (division of Westpac Bank)",29:"MUFG Bank",30:"Bankwest (division of Commonwealth Bank)",31:"Bank Australia",325:"Beyond Bank",34:"HSBC Bank Australia",985:"HSBC Bank Australia",35:"Bank of China",980:"Bank of China",40:"Commonwealth Bank of Australia",41:"Deutsche Bank",42:"Commonwealth Bank of Australia",52:"Commonwealth Bank of Australia",45:"OCBC Bank",46:"Advance Bank (division of Westpac Bank)",47:"Challenge Bank (division of Westpac Bank)",48:"Suncorp-Metway",664:"Suncorp-Metway",512:"Community First Credit Union",514:"RACQ Bank",517:"Volt Bank",533:"Bananacoast Community Credit Union",57:"Australian Settlements",61:"Adelaide Bank (division of Bendigo and Adelaide Bank)",611:"Endeavour Mutual Bank",823:"Endeavour Mutual Bank",630:"Greater Bank",637:"Greater Bank",632:"B&E",633:"Bendigo Bank",634:"Uniting Financial Services",638:"Heritage Bank",880:"Heritage Bank",639:"Home Building Society (division of Bank of Queensland)",640:"Hume Bank",641:"IMB",647:"IMB",642:"Australian Military Bank",645:"Auswide Bank",656:"Auswide Bank",646:"Maitland Mutual Building Society",650:"Newcastle Permanent Building Society",653:"Pioneer Permanent Building Society (division of Bank of Queensland)",654:"Queensland Country Credit Union",655:"The Rock",659:"G&C Mutual Bank",676:"Gateway Bank",70:"Indue",721:"Holiday Coast Credit Union",722:"Southern Cross Credit Union",723:"Bank of Heritage Isle",724:"MOVE",728:"Summerland Credit Union",777:"Police & Nurse",80:"Cuscal",670:"Cuscal",812:"Teachers Mutual Bank",813:"Capricornian",814:"Credit Union Australia",815:"Police Bank",817:"Warwick Credit Union",818:"Bank of Communications",819:"Industrial & Commercial Bank of China",824:"Sutherland Credit Union",825:"Big Sky Building Society",833:"Defence Bank",882:"Unity Bank",888:"China Construction Bank",90:"Australia Post",911:"Sumitomo Mitsui Banking Corporation",913:"State Street Bank & Trust Company",917:"Arab Bank Australia",918:"Mizuho Bank",922:"United Overseas Bank",923:"ING Bank",936:"ING Bank",931:"Mega International Commercial Bank",932:"Regional Australia Bank",939:"AMP Bank",941:"Delphi Bank (division of Bendigo and Adelaide Bank)",942:"Bank of Sydney",943:"Taiwan Business Bank",944:"Members Equity Bank",946:"UBS AG",951:"BOQ Specialist",969:"Tyro Payments"};var PrefillSMSF=function(){function e(e){registerInstance(this,e);this.mode="review";this.formState="pristine";this.isSubmitDisabled=true;this.eventTrackingService=EventTrackingService.Instance;this.createSuperFundPrefillDeclinedDetail=function(e){return{fundType:"SMSF",isAbnValid:e.fundAbn.valid,isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}};this.createSuperFundPrefillViewedDetail=function(e){return{fundType:"SMSF",isAbnValid:e.fundAbn.valid,isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}}}e.prototype.componentDidLoad=function(){var e=this.createSuperFundPrefillViewedDetail(this.prefill);return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.prefill&&this.prefill.fundAbn.valid){this.initialiseComponent(this.prefill)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.PrefillInvalidSMSFPage)}return[2]}))}))};e.prototype.render=function(){var e=this;var t=[this.fundName.errorMessage,this.fundEsa.errorMessage,this.fundAddressLine1.errorMessage,this.fundAddressLine2.errorMessage,this.fundAddressCity.errorMessage,this.fundAddressPostcode.errorMessage,this.fundAddressState.errorMessage,this.memberLastName.errorMessage,this.memberGivenNames.errorMessage,this.bankAccountName.errorMessage,this.bankAccountBsb.errorMessage,this.bankAccountNumber.errorMessage].filter((function(e){return e!==null}));return h("div",null,h(Header,null),h("div",{class:"flex flex-col items-center gap-8 mt-8 sm:mt-12"},h("div",{class:"flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg"},h("div",{class:"flex flex-col items-start gap-3 self-stretch"},h("div",{class:"self-stretch text-grey-900 text-lg not-italic font-bold leading-7"},"Your self-managed super fund (SMSF) details"),h("sss-prefill-warning-box",{class:"self-stretch",notificationList:["Make sure your Self-managed super fund (SMSF) is a registered fund before completing this step."]}),this.mode==="review"&&t.length>0&&h("sss-prefill-error-box",{class:"self-stretch",notificationList:t,withHeader:true}),this.mode==="review"&&h("div",{class:"flex flex-col gap-3 self-stretch mt-4"},h("sss-prefill-display-field",{field:this.fundName}),h("sss-prefill-display-field",{field:this.fundAbn}),h("sss-prefill-display-field",{field:this.fundEsa}),h("sss-prefill-display-field",{field:this.fundAddress}),h("sss-prefill-display-field",{field:this.memberLastName}),h("sss-prefill-display-field",{field:this.memberGivenNames}),h("div",{class:"mt-4 mb-2 text-gray-900 text-lg font-bold leading-7"},"Fund bank details"),h("sss-prefill-display-field",{field:this.bankAccountName}),h("sss-prefill-display-field",{field:this.bankAccountBsb}),this.bankName.isValid&&h("sss-prefill-display-field",{field:this.bankName}),h("sss-prefill-display-field",{field:this.bankAccountNumber})),this.mode==="review"&&h("sss-button",{testid:"edit-details-button",class:"self-stretch mt-3",fillWidth:true,variant:"secondary",promiseFn:function(){return e.setModeToEdit()}},h("div",{class:"flex flex-row gap-2"},h("div",{class:"text-sm not-italic font-medium leading-4"},"Edit details"),h("div",{class:"w-4 h-4 relative"},h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"currentColor"},h("path",{d:"M11.369 2.86865C11.9939 2.24381 13.0069 2.24381 13.6318 2.86865C14.2566 3.49349 14.2566 4.50656 13.6318 5.1314L12.9974 5.76571L10.7347 3.50297L11.369 2.86865Z"}),h("path",{d:"M9.60334 4.63434L2.90039 11.3373V13.6H5.16313L11.8661 6.89708L9.60334 4.63434Z"}))))),this.mode==="edit"&&h("form",{noValidate:true,onSubmit:function(e){return e.preventDefault()},class:{"w-full":true,"was-validated":this.formState==="validated"},ref:function(t){return e.formElement=t},onInput:function(t){return e.isSubmitDisabled=e.formHasMissingData()}},h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.fundName.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.fundName.testId,value:this.fundName.value,onInput:function(t){e.updateFundName(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.fundName.errorMessage))),DisabledField(this.fundAbn.name,this.fundAbn.testId,this.fundAbn.value),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.fundEsa.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,minlength:"2","data-testid":this.fundEsa.testId,value:this.fundEsa.value,onInput:function(t){e.updateFundEsa(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.fundEsa.errorMessage))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Fund address"),h("div",{class:"mt-1 rounded-md shadow-sm -space-y-px"},h("input",{placeholder:"Address line 1",type:"text",class:Object.assign(Object.assign({},Style.Input(this.formState==="validated")),{"rounded-none rounded-t-md shadow-none border-b-0":true}),required:true,minlength:"2",name:"addressLine1",id:"addressLine1","data-testid":this.fundAddressLine1.testId,value:this.fundAddressLine1.value,onInput:function(t){e.updateAddressLine1(t.target.value)}}),h("input",{placeholder:"Address line 2 (optional)",type:"text",class:Object.assign(Object.assign({},Style.Input(this.formState==="validated")),{"rounded-none shadow-none border-b-0":true}),"data-testid":this.fundAddressLine2.testId,value:this.fundAddressLine2.value,onInput:function(t){return e.updateAddressLine2(t.target.value)}}),h("input",{placeholder:"City/suburb",type:"text",class:Object.assign(Object.assign({},Style.Input(this.formState==="validated")),{"rounded-none shadow-none border-b-0":true}),required:true,"data-testid":this.fundAddressCity.testId,value:this.fundAddressCity.value,onInput:function(t){e.updateAddressCity(t.target.value)}}),h("div",{class:"flex -space-x-px"},h("div",{class:"w-1/2 flex-1 min-w-0"},h("input",{placeholder:"Postcode",type:"text",required:true,class:Object.assign(Object.assign({},Style.Input(this.formState==="validated")),{"rounded-none rounded-bl-md shadow-none border-r-0":true}),name:"postcode",minlength:"4",maxlength:"4",pattern:"[0-9]{4}",id:"postcode","data-testid":this.fundAddressPostcode.testId,value:this.fundAddressPostcode.value,inputmode:"numeric",onInput:function(t){e.updateAddressPostcode(t.target.value)}})),h("div",{class:"flex-1 min-w-0"},h("select",{class:Object.assign(Object.assign({},Style.Input(this.formState==="validated")),{"rounded-none rounded-br-md shadow-none":true,"text-gray-500":this.formState!=="validated"}),name:"state",required:true,"data-testid":this.fundAddressState.testId,id:"state",onInput:function(t){e.updateAddressState(t.target.value)}},h("option",{disabled:true,selected:this.fundAddressState.value!==undefined,value:""},"State"),this.fundAddressState.options.map((function(t){return h("option",{value:t.value,selected:e.fundAddressState.value===t.value},t.label)})))))),this.formState==="validated"&&h("div",{class:"mt-2 text-sm text-red-600"},this.fundAddressLine1.errorMessage||this.fundAddressLine1.errorMessage||this.fundAddressCity.errorMessage||this.fundAddressPostcode.errorMessage||this.fundAddressState.errorMessage)),h("div",{class:"flex gap-x-4 flex-col sm:flex-row"},h("div",{class:"mt-3 w-full sm:w-1/2"},h("label",{class:"text-sm font-medium text-gray-700"},this.memberGivenNames.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.memberGivenNames.testId,value:this.memberGivenNames.value,onInput:function(t){e.updateMemberGivenNames(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.memberGivenNames.errorMessage))),h("div",{class:"mt-3 w-full sm:w-1/2"},h("label",{class:"text-sm font-medium text-gray-700"},this.memberLastName.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.memberLastName.testId,value:this.memberLastName.value,onInput:function(t){e.updateMemberLastName(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.memberLastName.errorMessage)))),h("div",{class:"mt-6 text-gray-900 text-lg font-bold leading-7"},"Fund bank details"),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.bankAccountName.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.bankAccountName.testId,value:this.bankAccountName.value,onInput:function(t){e.updateBankAccountName(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.bankAccountName.errorMessage))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.bankAccountBsb.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.bankAccountBsb.testId,value:this.bankAccountBsb.value,onInput:function(t){var n=t.target.value;e.updateBankName(n);e.updateBankAccountBsb(n)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.bankAccountBsb.errorMessage))),this.bankName.isValid&&DisabledField(this.bankName.name,this.bankName.testId,this.bankName.value),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.bankAccountNumber.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.bankAccountNumber.testId,value:this.bankAccountNumber.value,onInput:function(t){e.updateBankAccountNumber(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.bankAccountNumber.errorMessage)))))),h("div",{class:"flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4"},h("sss-button",{testid:"continue-button",class:"self-stretch",fillWidth:true,variant:"primary",disabled:this.isSubmitDisabled,promiseFn:function(){return e.handleSubmitForm()}},"Continue"),h("sss-button",{testid:"make-another-nomination-button",class:"self-stretch",fillWidth:true,variant:"secondary",promiseFn:function(){return e.handleFundNominationDeclined()}},"Make another nomination"))))};e.prototype.isFormValid=function(){return this.fundName.isValid&&this.fundAbn.isValid&&this.fundEsa.isValid&&this.fundAddressLine1.isValid&&this.fundAddressLine2.isValid&&this.fundAddressCity.isValid&&this.fundAddressPostcode.isValid&&this.fundAddressState.isValid&&this.memberGivenNames.isValid&&this.memberLastName.isValid&&this.bankAccountName.isValid&&this.bankAccountBsb.isValid&&this.bankAccountNumber.isValid};e.prototype.formHasMissingData=function(){return this.fundName.isEmpty||this.fundAbn.isEmpty||this.fundEsa.isEmpty||this.fundAddressLine1.isEmpty||this.fundAddressCity.isEmpty||this.fundAddressPostcode.isEmpty||this.fundAddressState.isEmpty||this.memberGivenNames.isEmpty||this.memberLastName.isEmpty||this.bankAccountName.isEmpty||this.bankAccountBsb.isEmpty||this.bankAccountNumber.isEmpty};e.prototype.setModeToEdit=function(){this.mode="edit";return Promise.resolve()};e.prototype.updateFundName=function(e){this.fundName=new SmsfFundName(e.trim())};e.prototype.updateFundEsa=function(e){this.fundEsa=new FundEsa(e.trim())};e.prototype.updateAddressLine1=function(e){this.fundAddressLine1=new FundAddressLine1(e.trim())};e.prototype.updateAddressLine2=function(e){this.fundAddressLine2=new FundAddressLine2(e.trim())};e.prototype.updateAddressCity=function(e){this.fundAddressCity=new FundAddressCity(e.trim())};e.prototype.updateAddressPostcode=function(e){this.fundAddressPostcode=new FundAddressPostcode(e.trim())};e.prototype.updateAddressState=function(e){this.fundAddressState=new FundAddressState(e.trim())};e.prototype.updateBankAccountName=function(e){this.bankAccountName=new BankAccountName(e.trim())};e.prototype.updateBankAccountBsb=function(e){this.bankAccountBsb=new BankAccountBsb(e.trim())};e.prototype.updateBankAccountNumber=function(e){this.bankAccountNumber=new BankAccountNumber(e.trim())};e.prototype.updateMemberGivenNames=function(e){this.memberGivenNames=new MemberGivenNames(e)};e.prototype.updateMemberLastName=function(e){this.memberLastName=new MemberLastName(e.trim())};e.prototype.filterDigits=function(e){return e.replace(/[^0-9]/g,"")};e.prototype.tryGetBankName=function(e){if(e==null)return null;var t=this.filterDigits(e);var n=t.substring(0,2);var r=t.substring(0,3);var i=bsbNumbers[n];var a=bsbNumbers[r];if(i)return i;if(a)return a;return null};e.prototype.updateBankName=function(e){var t=this.tryGetBankName(e);this.bankName=new BankName(t,t!=null)};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.formState="validated";if(!this.isFormValid()){return[2]}if(this.mode==="edit"&&!this.formElement.checkValidity()){return[2]}navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:"Self-managed super fund",fundDetails:{type:"smsf",fundName:this.fundName.value,fundEsa:this.fundEsa.value},handleSubmitFn:function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:e=Object.assign({smsfChoice:{abn:this.fundAbn.value,fundName:this.fundName.value,fundAddress:{addressLine1:this.fundAddressLine1.value,addressLine2:this.fundAddressLine2.value.trim()===""?null:this.fundAddressLine2.value.trim(),city:this.fundAddressCity.value,state:this.fundAddressState.value,postcode:this.fundAddressPostcode.value},bsb:this.bankAccountBsb.value,bankAccountName:this.bankAccountName.value,bankAccountNumber:this.bankAccountNumber.value,electronicServiceAddress:this.fundEsa.value,memberFirstName:this.memberGivenNames.value,memberFamilyName:this.memberLastName.value},standardChoiceFormSignature:t},superSelectionAppService.promotedFundsConfig);return[4,customFundChoiceApi.submitSelfManagedFundChoiceAsync(e)];case 1:n.sent();return[2]}}))}))}});return[2]}))}))};e.prototype.initialiseComponent=function(e){this.fundName=new SmsfFundName(e.fundName);this.fundAbn=new FundAbn(e.fundAbn.value,e.fundAbn.valid);this.fundEsa=new FundEsa(e.electronicServiceAddress);this.fundAddressLine1=new FundAddressLine1(e.addressLine1);this.fundAddressLine2=new FundAddressLine2(e.addressLine2);this.fundAddressCity=new FundAddressCity(e.addressCity);this.fundAddressPostcode=new FundAddressPostcode(e.addressPostcode);this.fundAddressState=new FundAddressState(e.addressState);this.fundAddress=new FundAddress(this.fundAddressLine1,this.fundAddressLine2,this.fundAddressCity,this.fundAddressState,this.fundAddressPostcode);this.memberGivenNames=new MemberGivenNames(e.memberFirstName);this.memberLastName=new MemberLastName(e.memberFamilyName);this.bankAccountName=new BankAccountName(e.bankAccountName);var t=this.tryGetBankName(e.bankAccountBsb);this.bankName=new BankName(t,t!=null);this.bankAccountBsb=new BankAccountBsb(e.bankAccountBsb);this.bankAccountNumber=new BankAccountNumber(e.bankAccountNumber);this.isSubmitDisabled=this.formHasMissingData()};e.prototype.handleFundNominationDeclined=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundPrefillDeclinedDetail(this.prefill);return[4,this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(e)];case 1:t.sent();return[2,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)]}}))}))};return e}();var PrefillWarningBox=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){var e=this;var t=function(){return h("div",{class:"w-5 h-5"},h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},h("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.25706 3.09882C9.02167 1.73952 10.9788 1.73952 11.7434 3.09882L17.3237 13.0194C18.0736 14.3526 17.1102 15.9999 15.5805 15.9999H4.4199C2.89025 15.9999 1.92682 14.3526 2.67675 13.0194L8.25706 3.09882ZM11.0001 13C11.0001 13.5523 10.5524 14 10.0001 14C9.44784 14 9.00012 13.5523 9.00012 13C9.00012 12.4477 9.44784 12 10.0001 12C10.5524 12 11.0001 12.4477 11.0001 13ZM10.0001 5C9.44784 5 9.00012 5.44772 9.00012 6V9C9.00012 9.55228 9.44784 10 10.0001 10C10.5524 10 11.0001 9.55228 11.0001 9V6C11.0001 5.44772 10.5524 5 10.0001 5Z",fill:"#FBBF24"})))};return h("div",{class:"flex items-start self-stretch rounded-md bg-yellow-50"},h("div",{class:"w-1 self-stretch bg-yellow-400"}),h("div",{class:"flex items-start gap-3 flex-[1_0_0] p-4"},h(t,null),h("div",{class:"flex flex-col items-start gap-2 flex-[1_0_0]"},h("div",{class:"flex flex-col items-start gap-1 self-stretch"},this.notificationList.map((function(t){return h("div",{class:"flex items-start gap-[7px] self-stretch pl-0"},e.notificationList.length>1&&h("div",{class:"pt-1.5 justify-center items-center flex"},h("div",{class:"w-1.5 h-1.5 bg-yellow-700 rounded-full"})),h("div",{class:"flex-[1_0_0] text-sm not-italic font-normal leading-5 text-yellow-700"},t))}))))))};return e}();var SmsfEngagementStep=function(){function e(e){var t=this;registerInstance(this,e);this.allFormFieldsAreFilled=function(e){return e.fundName!=null&&e.fundAbn!=null&&e.fundEsa!=null&&e.addressLine1!=null&&e.city!=null&&e.state!=null&&e.postcode!=null&&e.bsb!=null&&e.bankAccountName!=null&&e.bankAccountNumber!=null&&e.memberFirstName!=null&&e.memberFamilyName!=null};this.stepContinued=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender=="smsf-engagement"))return[3,2];return[4,EventTrackingService.Instance.TrackSuperSmsfEngagementStepContinued(e.detail.reason)];case 1:t.sent();this.navigateToStandardChoice();t.label=2;case 2:return[2]}}))}))};this.subscribeToStepEvents=function(){for(var e in t.stepEventHandlers){document.addEventListener(e,t.stepEventHandlers[e])}};this.unSubscribeFromStepEvents=function(){for(var e in t.stepEventHandlers){document.removeEventListener(e,t.stepEventHandlers[e])}};this.stepEventHandlers={continue:this.stepContinued.bind(this)}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!(superSelectionAppService.isSmsfCustomStepEnabled&&superSelectionAppService.isUsingSuperCampaign&&this.allFormFieldsAreFilled(state.selfManagedFundForm)&&Option.isSome(superSelectionAppService.backendUrl)&&Option.isSome(superSelectionAppService.state.jwt)))return[3,2];this.backendUrl=superSelectionAppService.backendUrl.value;this.accessToken=superSelectionAppService.state.jwt.value;this.accountId=superSelectionAppService.accountIdOrDefault;this.partnerId=superSelectionAppService.partnerIdOrDefault;this.initialiseFormState(state.selfManagedFundForm);this.unSubscribeFromStepEvents();this.subscribeToStepEvents();superSelectionAppService.hideFooterSection=true;return[4,EventTrackingService.Instance.TrackSuperSmsfEngagementStepActivationSucceeded()];case 1:e.sent();return[3,3];case 2:navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.SelfManagedFund);e.label=3;case 3:return[2]}}))}))};e.prototype.disconnectedCallback=function(){this.unSubscribeFromStepEvents();superSelectionAppService.hideFooterSection=false};e.prototype.render=function(){return h(Host,null,h("apollo-super-smsf-engagement",{"backend-url":this.backendUrl,"access-token":this.accessToken,"account-id":this.accountId,"partner-id":this.partnerId}))};e.prototype.navigateToStandardChoice=function(){var e=this;navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:"Self-managed super fund",fundDetails:{type:"smsf",fundName:this.fundName,fundEsa:this.fundEsa},handleSubmitFn:function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:e=Object.assign({smsfChoice:{abn:this.fundAbn,fundName:this.fundName,fundAddress:{addressLine1:this.fundAddress.addressLine1,addressLine2:this.fundAddress.addressLine2,city:this.fundAddress.city,state:this.fundAddress.state,postcode:this.fundAddress.postcode},bsb:this.bsb,bankAccountName:this.bankAccountName,bankAccountNumber:this.bankAccountNumber,electronicServiceAddress:this.fundEsa,memberFirstName:this.memberFirstName,memberFamilyName:this.memberFamilyName},standardChoiceFormSignature:t},superSelectionAppService.promotedFundsConfig);return[4,customFundChoiceApi.submitSelfManagedFundChoiceAsync(e)];case 1:n.sent();return[2]}}))}))}})};e.prototype.initialiseFormState=function(e){this.fundName=e.fundName;this.fundAbn=e.fundAbn;this.fundEsa=e.fundEsa;this.fundAddress={addressLine1:e.addressLine1,addressLine2:e.addressLine2,city:e.city,state:e.state,postcode:e.postcode};this.bsb=e.bsb;this.bankAccountName=e.bankAccountName;this.bankAccountNumber=e.bankAccountNumber;this.memberFirstName=e.memberFirstName;this.memberFamilyName=e.memberFamilyName};return e}();injectHistory(SmsfEngagementStep);var StandardChoiceFormInputDefaultFund=function(){function e(e){registerInstance(this,e);this.standardChoiceFormSignature="";this.isSubmitDisabled=true;this.eventTrackingService=EventTrackingService.Instance;this.ignorePopState=function(){return window.history.pushState(null,"",null)}}e.prototype.connectedCallback=function(){this.ignorePopState();window.addEventListener("popstate",this.ignorePopState)};e.prototype.disconnectedCallback=function(){window.removeEventListener("popstate",this.ignorePopState)};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"text-2xl sm:text-3xl font-bold text-center"},"Confirm your super choice"),h("div",{class:"sm:text-lg text-gray-600 max-w-800 mt-4 text-center leading-7 sm:leading-8"},"Your authorisation is required to complete your super choice by signing the standard choice form, which informs your employer of your choice of fund."),h("div",{class:"flex justify-center mt-8 sm:mt-12"},h("div",{class:"max-w-560"},h("div",{class:"p-4 sm:p-6 border shadow-sm rounded-lg flex flex-col sm:flex-row"},this.renderLogo(),h("div",{class:"flex justify-between w-full"},h("div",null,h("div",{class:"text-xs font-semibold text-gray-500 uppercase"},"Nominated fund"),h("div",{class:"text-sm mt-2"},state$1.fundName)),h("div",{class:"grid content-center ml-4"},h("sss-button",{testid:"change-fund-button",size:"xs",variant:"secondary",promiseFn:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.trackChangeRequestedAsync()];case 1:e.sent();navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage);return[2]}}))}))}},"Change")))),h("div",{class:"mt-4 p-4 sm:p-6 border shadow-sm rounded-lg"},h("div",{class:"sm:text-lg font-bold"},"Superannuation Standard Choice Form"),h("div",{class:"bg-blue-50 border-l-4 border-blue-400 p-4 mt-3"},h("div",{class:"flex"},h("div",{class:"flex-shrink-0"},h("img",{class:"h-5 w-5",src:getAssetPath("assets/icon-information-circle.svg")})),h("div",{class:"ml-2"},h("p",{class:"text-sm text-blue-800 leading-5"},"Applying your full name in the text field below is the same as applying your written signature and is legally binding.")))),h("form",{noValidate:true,onSubmit:function(e){return e.preventDefault()},class:{"mt-3":true,"was-validated":this.formState==="validated"},ref:function(t){return e.formElement=t},onInput:function(t){return e.isSubmitDisabled=!e.formElement.checkValidity()}},h("label",{class:"text-sm font-medium text-gray-700"},"Type your full name"),h("input",{"data-testid":"standard-choice-form-signature-input",type:"text",autocomplete:"off",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-focus w-full text-base sm:text-sm border-gray-300 rounded-md mt-1":true,"invalid:border-red-300 invalid:text-red-900 invalid:focus:ring-red-500 invalid:focus:border-red-500":this.formState==="validated"},required:true,minlength:"2",name:"standardChoiceFormSignature",id:"standardChoiceFormSignature",value:this.standardChoiceFormSignature,onInput:function(t){return e.standardChoiceFormSignature=t.target.value}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Type your full name"),h("div",{class:"mt-6"},h("sss-button",{testid:"confirm-and-continue-button",fillWidth:true,promiseFn:function(){return e.handleSubmitForm()},disabled:this.isSubmitDisabled},"Confirm and continue")))))))};e.prototype.renderLogo=function(){return};e.prototype.trackChangeRequestedAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:e={promotedFundsShown:superSelectionAppService.promotedFunds,defaultFundUsiSet:toUndefined(superSelectionAppService.defaultFundUsi)};t=state$1.fundDetails.type;switch(t){case"default":return[3,1];case"myOwnFund":return[3,3];case"smsf":return[3,5];case"promoted":return[3,7];case"promotedDefault":return[3,9];case"promotedDefaultWithJoin":return[3,11];case"null":return[3,13]}return[3,14];case 1:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({DefaultFund:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 2:n.sent();return[3,14];case 3:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({MyOwnFund:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 4:n.sent();return[3,14];case 5:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({Smsf:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 6:n.sent();return[3,14];case 7:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({PromotedFund:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 8:n.sent();return[3,14];case 9:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({PromotedDefaultFund:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 10:n.sent();return[3,14];case 11:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({PromotedDefaultFundWithJoin:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 12:n.sent();return[3,14];case 13:throw"standardChoiceFormState.fundDetails was not set";case 14:return[2]}}))}))};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.formState="validated";if(!this.formElement.checkValidity())return[3,2];return[4,state$1.handleSubmitFn(this.standardChoiceFormSignature.trim())];case 1:e.sent();superSelectionAppService.markSuperSelectionAsSubmitted();e.label=2;case 2:return[2]}}))}))};return e}();var Success=function(){function e(e){registerInstance(this,e);this.ignorePopState=function(){return window.history.pushState(null,"",null)}}e.prototype.connectedCallback=function(){this.ignorePopState();window.addEventListener("popstate",this.ignorePopState)};e.prototype.disconnectedCallback=function(){window.removeEventListener("popstate",this.ignorePopState)};e.prototype.render=function(){var e=function(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:"fill-primary-base"},h("path",{d:"M443.3 100.7C449.6 106.9 449.6 117.1 443.3 123.3L171.3 395.3C165.1 401.6 154.9 401.6 148.7 395.3L4.686 251.3C-1.562 245.1-1.562 234.9 4.686 228.7C10.93 222.4 21.06 222.4 27.31 228.7L160 361.4L420.7 100.7C426.9 94.44 437.1 94.44 443.3 100.7H443.3z"}))};return h(Host,{class:"text-center"},h("div",{class:"flex justify-center"},h("div",{class:"relative"},h("div",{class:"h-20 w-20 rounded-full bg-primary-base opacity-10"}),h("div",{class:"h-8 w-8 absolute top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2"},h(e,null)))),h("h3",{class:"text-2xl leading-8 font-bold mt-4"},"Your super choice has been submitted"),h("p",{class:"mt-4 text-center text-gray-600 leading-7 max-w-560 mx-auto"},"Your superannuation details have been updated successfully and will be submitted to your employer."),h("div",{class:"flex justify-center mt-8"},h("div",{class:"max-w-[200px] w-full"},h("sss-button",{testid:"continue-button",size:"xl",fillWidth:true,onClick:this.handleContinueButtonClick},h("span",null,"Continue")))))};e.prototype.handleContinueButtonClick=function(e){superSelectionAppService.completeSuperSelectionFlow()};return e}();var MiscService=function(){function e(){}e.prototype.trackClickPromotedTileAsync=function(e){return superSelectionApi.clickPromotedTileAsync(e)};return e}();var miscService=new MiscService;var getSuperCampaignState=function(){if(superSelectionAppService.superCampaignState!=undefined)return superSelectionAppService.superCampaignState;throw new Error("Super campaign state has not been initialized")};var fundTileClicked=function(e){var t=e.sender,n=e.placementId,r=e.fundId,i=e.fundUsi,a=e.fundName,s=e.fundType;return __awaiter(void 0,void 0,void 0,(function(){var e,o,u,l,c;return __generator(this,(function(d){switch(d.label){case 0:if(!(t==="super-campaign"||t==="featured-funds"))return[3,6];e=getSuperCampaignState().PromotedFundIds;o=Option.toUndefined(superSelectionAppService.defaultFundUsi);l=(u=Promise).all;if(!(s==="promoted-default"))return[3,2];return[4,EventTrackingService.Instance.TrackPromotedDefaultSuperFundDetailViewedAsync({fundUsi:i!==null&&i!==void 0?i:"",fundName:a,promotedFundId:r,promotedFundsShown:e,defaultFundUsiSet:o,superCampaignEnabled:true,placementId:n})];case 1:c=d.sent();return[3,4];case 2:return[4,EventTrackingService.Instance.TrackPromotedSuperFundDetailViewedAsync({fundUsi:i!==null&&i!==void 0?i:undefined,fundName:a,promotedFundId:r,promotedFundsShown:e,defaultFundUsiSet:o,superCampaignEnabled:true,placementId:n})];case 3:c=d.sent();d.label=4;case 4:return[4,l.apply(u,[[c,miscService.trackClickPromotedTileAsync(s==="promoted-default"?{promotedDefault:{fundId:r,placementId:n}}:{promoted:{fundId:r,placementId:n}})]])];case 5:d.sent();d.label=6;case 6:return[2]}}))}))};var strShimFunction="function";var strShimObject="object";var strShimUndefined="undefined";var strShimPrototype="prototype";var strShimHasOwnProperty="hasOwnProperty";function getGlobal(){if(typeof globalThis!==strShimUndefined&&globalThis){return globalThis}if(typeof self!==strShimUndefined&&self){return self}if(typeof window!==strShimUndefined&&window){return window}if(typeof global!==strShimUndefined&&global){return global}return null}function objCreateFn(e){var t=Object["create"];if(t){return t(e)}if(e==null){return{}}var n=typeof e;if(n!==strShimObject&&n!==strShimFunction){throw new TypeError("Object prototype may only be an Object:"+e)}function r(){}r[strShimPrototype]=e;return new r}function __assignFn(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t){if(Object[strShimPrototype][strShimHasOwnProperty].call(t,i)){e[i]=t[i]}}}return e}var __extendStaticsFn=function(e,t){__extendStaticsFn=Object["setPrototypeOf"]||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t){if(t[strShimHasOwnProperty](n)){e[n]=t[n]}}};return __extendStaticsFn(e,t)};function __extendsFn(e,t){__extendStaticsFn(e,t);function n(){this.constructor=e}e[strShimPrototype]=t===null?objCreateFn(t):(n[strShimPrototype]=t[strShimPrototype],new n)}var globalObj=getGlobal()||{};(function(e,t,n){if(!e.__assign){e.__assign=Object.assign||t}if(!e.__extends){e.__extends=n}})(globalObj,__assignFn,__extendsFn);if(!__assign){__assign=globalObj.__assign}if(!__extends){__extends=globalObj.__extends}var EventsDiscardedReason={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5};var strUndefined=strShimUndefined;var strObject=strShimObject;var strPrototype=strShimPrototype;var strFunction=strShimFunction;var strWindow="window";var strDocument="document";var strNavigator="navigator";var strHistory="history";var strLocation="location";var strConsole="console";var strPerformance="performance";var strJSON="JSON";var strCrypto="crypto";var strMsCrypto="msCrypto";var strReactNative="ReactNative";var getGlobal$1=getGlobal;function getGlobalInst(e){var t=getGlobal$1();if(t&&t[e]){return t[e]}if(e===strWindow&&hasWindow()){return window}return null}function hasWindow(){return Boolean(typeof window===strObject&&window)}function getWindow(){if(hasWindow()){return window}return getGlobalInst(strWindow)}function hasDocument(){return Boolean(typeof document===strObject&&document)}function getDocument(){if(hasDocument()){return document}return getGlobalInst(strDocument)}function hasNavigator(){return Boolean(typeof navigator===strObject&&navigator)}function getNavigator(){if(hasNavigator()){return navigator}return getGlobalInst(strNavigator)}function hasHistory(){return Boolean(typeof history===strObject&&history)}function getHistory(){if(hasHistory()){return history}return getGlobalInst(strHistory)}function getLocation(){if(typeof location===strObject&&location){return location}return getGlobalInst(strLocation)}function getConsole(){if(typeof console!==strUndefined){return console}return getGlobalInst(strConsole)}function getPerformance(){return getGlobalInst(strPerformance)}function hasJSON(){return Boolean(typeof JSON===strObject&&JSON||getGlobalInst(strJSON)!==null)}function getJSON(){if(hasJSON()){return JSON||getGlobalInst(strJSON)}return null}function getCrypto(){return getGlobalInst(strCrypto)}function getMsCrypto(){return getGlobalInst(strMsCrypto)}function isReactNative(){var e=getNavigator();if(e&&e.product){return e.product===strReactNative}return false}var strOnPrefix="on";var strAttachEvent="attachEvent";var strAddEventHelper="addEventListener";var strDetachEvent="detachEvent";var strRemoveEventListener="removeEventListener";var UInt32Mask=4294967296;var MaxUInt32=4294967295;var _isTrident=null;var _mwcSeeded=false;var _mwcW=123456789;var _mwcZ=987654321;function _mwcSeed(e){if(e<0){e>>>=0}_mwcW=123456789+e&MaxUInt32;_mwcZ=987654321-e&MaxUInt32;_mwcSeeded=true}function _autoSeedMwc(){_mwcSeed(Math.random()*UInt32Mask^(new Date).getTime())}function _isTypeof(e,t){return typeof e===t}function _isUndefined(e){return _isTypeof(e,strShimUndefined)||e===undefined}function _isNullOrUndefined(e){return _isUndefined(e)||e===null}function _hasOwnProperty(e,t){return e&&Object[strShimPrototype].hasOwnProperty.call(e,t)}function _isObject(e){return _isTypeof(e,strShimObject)}function _isFunction(e){return _isTypeof(e,strShimFunction)}function _attachEvent(e,t,n,r){if(r===void 0){r=false}var i=false;if(!_isNullOrUndefined(e)){try{if(!_isNullOrUndefined(e[strAddEventHelper])){e[strAddEventHelper](t,n,r);i=true}else if(!_isNullOrUndefined(e[strAttachEvent])){e[strAttachEvent](strOnPrefix+t,n);i=true}}catch(e){}}return i}function _detachEvent(e,t,n,r){if(r===void 0){r=false}if(!_isNullOrUndefined(e)){try{if(!_isNullOrUndefined(e[strRemoveEventListener])){e[strRemoveEventListener](t,n,r)}else if(!_isNullOrUndefined(e[strDetachEvent])){e[strDetachEvent](strOnPrefix+t,n)}}catch(e){}}}function normalizeJsName(e){var t=e;var n=/([^\w\d_$])/g;if(n.test(e)){t=e.replace(n,"_")}return t}function objForEachKey(e,t){if(e&&_isObject(e)){for(var n in e){if(_hasOwnProperty(e,n)){t.call(e,n,e[n])}}}}var CoreUtils=function(){function e(){}e.isDate=function(e){return Object[strShimPrototype].toString.call(e)==="[object Date]"};e.isArray=function(e){return Object[strShimPrototype].toString.call(e)==="[object Array]"};e.isError=function(e){return Object[strShimPrototype].toString.call(e)==="[object Error]"};e.isString=function(e){return _isTypeof(e,"string")};e.isNumber=function(e){return _isTypeof(e,"number")};e.isBoolean=function(e){return _isTypeof(e,"boolean")};e.disableCookies=function(){e._canUseCookies=false};e.newGuid=function(){function t(){return e.randomValue(15)}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(GuidRegex,(function(e){var n=t()|0,r=e==="x"?n:n&3|8;return r.toString(16)}))};e.toISOString=function(t){if(e.isDate(t)){var n=function(e){var t=String(e);if(t.length===1){t="0"+t}return t};return t.getUTCFullYear()+"-"+n(t.getUTCMonth()+1)+"-"+n(t.getUTCDate())+"T"+n(t.getUTCHours())+":"+n(t.getUTCMinutes())+":"+n(t.getUTCSeconds())+"."+String((t.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}};e.arrForEach=function(e,t,n){var r=e.length;for(var i=0;i<r;i++){if(i in e){t.call(n||e,e[i],i,e)}}};e.arrIndexOf=function(e,t,n){var r=e.length;var i=n||0;for(var a=Math.max(i>=0?i:r-Math.abs(i),0);a<r;a++){if(a in e&&e[a]===t){return a}}return-1};e.arrMap=function(e,t,n){var r=e.length;var i=n||e;var a=new Array(r);for(var s=0;s<r;s++){if(s in e){a[s]=t.call(i,e[s],e)}}return a};e.arrReduce=function(e,t,n){var r=e.length;var i=0;var a;if(arguments.length>=3){a=arguments[2]}else{while(i<r&&!(i in e)){i++}a=e[i++]}while(i<r){if(i in e){a=t(a,e[i],i,e)}i++}return a};e.strTrim=function(t){if(!e.isString(t)){return t}return t.replace(/^\s+|\s+$/g,"")};e.objKeys=function(e){var t=!{toString:null}.propertyIsEnumerable("toString");if(!_isFunction(e)&&(!_isObject(e)||e===null)){throw new TypeError("objKeys called on non-object")}var n=[];for(var r in e){if(_hasOwnProperty(e,r)){n.push(r)}}if(t){var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var a=i.length;for(var s=0;s<a;s++){if(_hasOwnProperty(e,i[s])){n.push(i[s])}}}return n};e.objDefineAccessors=function(e,t,n,r){var i=Object["defineProperty"];if(i){try{var a={enumerable:true,configurable:true};if(n){a.get=n}if(r){a.set=r}i(e,t,a);return true}catch(e){}}return false};e.addEventHandler=function(e,t){var n=false;var r=getWindow();if(r){n=_attachEvent(r,e,t);n=_attachEvent(r["body"],e,t)||n}var i=getDocument();if(i){n=EventHelper.Attach(i,e,t)||n}return n};e.dateNow=function(){var e=Date;if(e.now){return e.now()}return(new e).getTime()};e.perfNow=function(){var t=getPerformance();if(t&&t.now){return t.now()}return e.dateNow()};e.newId=function(t){if(t===void 0){t=22}var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var r=e.random32()>>>0;var i=0;var a="";while(a.length<t){i++;a+=n.charAt(r&63);r>>>=6;if(i===5){r=(e.random32()<<2&4294967295|r&3)>>>0;i=0}}return a};e.isIE=function(){if(_isTrident===null){var e=getNavigator()||{};var t=(e.userAgent||"").toLowerCase();_isTrident=t.indexOf("msie")!==-1||t.indexOf("trident/")!==-1}return _isTrident};e.randomValue=function(t){if(t>0){return Math.floor(e.random32()/MaxUInt32*(t+1))>>>0}return 0};e.random32=function(t){var n;var r=getCrypto()||getMsCrypto();if(r&&r.getRandomValues){n=r.getRandomValues(new Uint32Array(1))[0]&MaxUInt32}else if(e.isIE()){if(!_mwcSeeded){_autoSeedMwc()}n=e.mwcRandom32()&MaxUInt32}else{n=Math.floor(UInt32Mask*Math.random()|0)}if(!t){n>>>=0}return n};e.mwcRandomSeed=function(e){if(!e){_autoSeedMwc()}else{_mwcSeed(e)}};e.mwcRandom32=function(e){_mwcZ=36969*(_mwcZ&65535)+(_mwcZ>>16)&MaxUInt32;_mwcW=18e3*(_mwcW&65535)+(_mwcW>>16)&MaxUInt32;var t=(_mwcZ<<16)+(_mwcW&65535)>>>0&MaxUInt32|0;if(!e){t>>>=0}return t};e.generateW3CId=function(){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];var n="",r;for(var i=0;i<4;i++){r=e.random32();n+=t[r&15]+t[r>>4&15]+t[r>>8&15]+t[r>>12&15]+t[r>>16&15]+t[r>>20&15]+t[r>>24&15]+t[r>>28&15]}var a=t[8+(e.random32()&3)|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+a+n.substr(16,3)+n.substr(19,12)};e.isTypeof=_isTypeof;e.isUndefined=_isUndefined;e.isNullOrUndefined=_isNullOrUndefined;e.hasOwnProperty=_hasOwnProperty;e.isFunction=_isFunction;e.isObject=_isObject;e.objCreate=objCreateFn;return e}();var GuidRegex=/[xy]/g;var EventHelper=function(){function e(){}e.Attach=_attachEvent;e.AttachEvent=_attachEvent;e.Detach=_detachEvent;e.DetachEvent=_detachEvent;return e}();var LoggingSeverity;(function(e){e[e["CRITICAL"]=1]="CRITICAL";e[e["WARNING"]=2]="WARNING"})(LoggingSeverity||(LoggingSeverity={}));var _InternalMessageId={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103};
1
+ var __extends=this&&this.__extends||function(){var e=function(t,n){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]};return e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function s(e){try{u(r.next(e))}catch(e){a(e)}}function o(e){try{u(r["throw"](e))}catch(e){a(e)}}function u(e){e.done?n(e.value):i(e.value).then(s,o)}u((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return u([e,t])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(a=s[0]&2?i["return"]:s[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;if(i=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1];a=s;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(s);break}if(a[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,h,F as Fragment,g as getAssetPath,H as Host,c as createEvent,s as setErrorHandler,a as getElement,d as getContext}from"./index-107d7c24.js";import{f as from,m as map,S as SimpleOuterSubscriber,a as SimpleInnerSubscriber,i as innerSubscribe,b as isArray,O as Observable,c as isFunction,d as async,g as Subscriber,h as distinctUntilChanged,j as filter,k as StoreConfig,l as Store,Q as Query}from"./datorama-akita-127aea91.js";import{n as none,i as isSome,s as some,a as superSelectionAppService,b as navigationService,S as SuperSelectionAppRoutes,c as injectHistory,C as CustomFundTypes,d as superSelectionApi,O as Option,E as EventTrackingService,e as customFundChoiceApi,f as isNone,g as getPromotedFundId,h as buildBackendApiClient,j as getSuperChoiceUsi,k as getSuperChoiceMemberNumber,l as state,m as state$1,t as toUndefined,o as slate,p as SuperCampaignComponentStatus,q as iframe,r as superSelectionAppStencilRoutes,u as factory,v as fromNullable}from"./custom-fund-choice.api-42801d64.js";import{A as ActiveRouter}from"./active-router-d18b36fb.js";function noop(){}function mergeMap(e,t,n){if(n===void 0){n=Number.POSITIVE_INFINITY}if(typeof t==="function"){return function(r){return r.pipe(mergeMap((function(n,r){return from(e(n,r)).pipe(map((function(e,i){return t(n,e,r,i)})))}),n))}}else if(typeof t==="number"){n=t}return function(t){return t.lift(new MergeMapOperator(e,n))}}var MergeMapOperator=function(){function e(e,t){if(t===void 0){t=Number.POSITIVE_INFINITY}this.project=e;this.concurrent=t}e.prototype.call=function(e,t){return t.subscribe(new MergeMapSubscriber(e,this.project,this.concurrent))};return e}();var MergeMapSubscriber=function(e){__extends(t,e);function t(t,n,r){if(r===void 0){r=Number.POSITIVE_INFINITY}var i=e.call(this,t)||this;i.project=n;i.concurrent=r;i.hasCompleted=false;i.buffer=[];i.active=0;i.index=0;return i}t.prototype._next=function(e){if(this.active<this.concurrent){this._tryNext(e)}else{this.buffer.push(e)}};t.prototype._tryNext=function(e){var t;var n=this.index++;try{t=this.project(e,n)}catch(e){this.destination.error(e);return}this.active++;this._innerSub(t)};t.prototype._innerSub=function(e){var t=new SimpleInnerSubscriber(this);var n=this.destination;n.add(t);var r=innerSubscribe(e,t);if(r!==t){n.add(r)}};t.prototype._complete=function(){this.hasCompleted=true;if(this.active===0&&this.buffer.length===0){this.destination.complete()}this.unsubscribe()};t.prototype.notifyNext=function(e){this.destination.next(e)};t.prototype.notifyComplete=function(){var e=this.buffer;this.active--;if(e.length>0){this._next(e.shift())}else if(this.active===0&&this.hasCompleted){this.destination.complete()}};return t}(SimpleOuterSubscriber);function fromEvent(e,t,n,r){if(isFunction(n)){r=n;n=undefined}if(r){return fromEvent(e,t,n).pipe(map((function(e){return isArray(e)?r.apply(void 0,e):r(e)})))}return new Observable((function(r){function i(e){if(arguments.length>1){r.next(Array.prototype.slice.call(arguments))}else{r.next(e)}}setupSubscription(e,t,i,r,n)}))}function setupSubscription(e,t,n,r,i){var a;if(isEventTarget(e)){var s=e;e.addEventListener(t,n,i);a=function(){return s.removeEventListener(t,n,i)}}else if(isJQueryStyleEventEmitter(e)){var o=e;e.on(t,n);a=function(){return o.off(t,n)}}else if(isNodeStyleEventEmitter(e)){var u=e;e.addListener(t,n);a=function(){return u.removeListener(t,n)}}else if(e&&e.length){for(var l=0,c=e.length;l<c;l++){setupSubscription(e[l],t,n,r,i)}}else{throw new TypeError("Invalid event target")}r.add(a)}function isNodeStyleEventEmitter(e){return e&&typeof e.addListener==="function"&&typeof e.removeListener==="function"}function isJQueryStyleEventEmitter(e){return e&&typeof e.on==="function"&&typeof e.off==="function"}function isEventTarget(e){return e&&typeof e.addEventListener==="function"&&typeof e.removeEventListener==="function"}function debounceTime(e,t){if(t===void 0){t=async}return function(n){return n.lift(new DebounceTimeOperator(e,t))}}var DebounceTimeOperator=function(){function e(e,t){this.dueTime=e;this.scheduler=t}e.prototype.call=function(e,t){return t.subscribe(new DebounceTimeSubscriber(e,this.dueTime,this.scheduler))};return e}();var DebounceTimeSubscriber=function(e){__extends(t,e);function t(t,n,r){var i=e.call(this,t)||this;i.dueTime=n;i.scheduler=r;i.debouncedSubscription=null;i.lastValue=null;i.hasValue=false;return i}t.prototype._next=function(e){this.clearDebounce();this.lastValue=e;this.hasValue=true;this.add(this.debouncedSubscription=this.scheduler.schedule(dispatchNext,this.dueTime,this))};t.prototype._complete=function(){this.debouncedNext();this.destination.complete()};t.prototype.debouncedNext=function(){this.clearDebounce();if(this.hasValue){var e=this.lastValue;this.lastValue=null;this.hasValue=false;this.destination.next(e)}};t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;if(e!==null){this.remove(e);e.unsubscribe();this.debouncedSubscription=null}};return t}(Subscriber);function dispatchNext(e){e.debouncedNext()}function tap(e,t,n){return function r(i){return i.lift(new DoOperator(e,t,n))}}var DoOperator=function(){function e(e,t,n){this.nextOrObserver=e;this.error=t;this.complete=n}e.prototype.call=function(e,t){return t.subscribe(new TapSubscriber(e,this.nextOrObserver,this.error,this.complete))};return e}();var TapSubscriber=function(e){__extends(t,e);function t(t,n,r,i){var a=e.call(this,t)||this;a._tapNext=noop;a._tapError=noop;a._tapComplete=noop;a._tapError=r||noop;a._tapComplete=i||noop;if(isFunction(n)){a._context=a;a._tapNext=n}else if(n){a._context=n;a._tapNext=n.next||noop;a._tapError=n.error||noop;a._tapComplete=n.complete||noop}return a}t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.next(e)};t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.error(e)};t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){this.destination.error(e);return}return this.destination.complete()};return t}(Subscriber);var AppVersion="5.85.53162";var Lazy=function(){function e(e){this.factory=e;this._value=none}Object.defineProperty(e.prototype,"value",{get:function(){if(isSome(this._value)){return this._value.value}var e=this.factory();this._value=some(e);return e},enumerable:false,configurable:true});return e}();function addSlashToUrl(){if(!window.location.pathname.endsWith("/")){var e=window.location.pathname+"/"+window.location.search+window.location.hash;history.pushState(history.state,"",e)}}var DEFAULT_DELIMITER="/";var DEFAULT_DELIMITERS="./";var PATH_REGEXP=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g");var parse=function(e,t){var n=[];var r=0;var i=0;var a="";var s=t&&t.delimiter||DEFAULT_DELIMITER;var o=t&&t.delimiters||DEFAULT_DELIMITERS;var u=false;var l;while((l=PATH_REGEXP.exec(e))!==null){var c=l[0];var d=l[1];var f=l.index;a+=e.slice(i,f);i=f+c.length;if(d){a+=d[1];u=true;continue}var p="";var h=e[i];var m=l[2];var v=l[3];var g=l[4];var y=l[5];if(!u&&a.length){var S=a.length-1;if(o.indexOf(a[S])>-1){p=a[S];a=a.slice(0,S)}}if(a){n.push(a);a="";u=false}var b=p!==""&&h!==undefined&&h!==p;var x=y==="+"||y==="*";var C=y==="?"||y==="*";var w=p||s;var _=v||g;n.push({name:m||r++,prefix:p,delimiter:w,optional:C,repeat:x,partial:b,pattern:_?escapeGroup(_):"[^"+escapeString(w)+"]+?"})}if(a||i<e.length){n.push(a+e.substr(i))}return n};var escapeString=function(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")};var escapeGroup=function(e){return e.replace(/([=!:$/()])/g,"\\$1")};var flags=function(e){return e&&e.sensitive?"":"i"};var regexpToRegexp=function(e,t){if(!t)return e;var n=e.source.match(/\((?!\?)/g);if(n){for(var r=0;r<n.length;r++){t.push({name:r,prefix:null,delimiter:null,optional:false,repeat:false,partial:false,pattern:null})}}return e};var arrayToRegexp=function(e,t,n){var r=[];for(var i=0;i<e.length;i++){r.push(pathToRegexp(e[i],t,n).source)}return new RegExp("(?:"+r.join("|")+")",flags(n))};var stringToRegexp=function(e,t,n){return tokensToRegExp(parse(e,n),t,n)};var tokensToRegExp=function(e,t,n){n=n||{};var r=n.strict;var i=n.end!==false;var a=escapeString(n.delimiter||DEFAULT_DELIMITER);var s=n.delimiters||DEFAULT_DELIMITERS;var o=[].concat(n.endsWith||[]).map(escapeString).concat("$").join("|");var u="";var l=false;for(var c=0;c<e.length;c++){var d=e[c];if(typeof d==="string"){u+=escapeString(d);l=c===e.length-1&&s.indexOf(d[d.length-1])>-1}else{var f=escapeString(d.prefix||"");var p=d.repeat?"(?:"+d.pattern+")(?:"+f+"(?:"+d.pattern+"))*":d.pattern;if(t)t.push(d);if(d.optional){if(d.partial){u+=f+"("+p+")?"}else{u+="(?:"+f+"("+p+"))?"}}else{u+=f+"("+p+")"}}}if(i){if(!r)u+="(?:"+a+")?";u+=o==="$"?"$":"(?="+o+")"}else{if(!r)u+="(?:"+a+"(?="+o+"))?";if(!l)u+="(?="+a+"|"+o+")"}return new RegExp("^"+u,flags(n))};var pathToRegexp=function(e,t,n){if(e instanceof RegExp){return regexpToRegexp(e,t)}if(Array.isArray(e)){return arrayToRegexp(e,t,n)}return stringToRegexp(e,t,n)};var hasBasename=function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)};var stripBasename=function(e,t){return hasBasename(e,t)?e.substr(t.length):e};var stripTrailingSlash=function(e){return e.charAt(e.length-1)==="/"?e.slice(0,-1):e};var addLeadingSlash=function(e){return e.charAt(0)==="/"?e:"/"+e};var stripLeadingSlash=function(e){return e.charAt(0)==="/"?e.substr(1):e};var parsePath=function(e){var t=e||"/";var n="";var r="";var i=t.indexOf("#");if(i!==-1){r=t.substr(i);t=t.substr(0,i)}var a=t.indexOf("?");if(a!==-1){n=t.substr(a);t=t.substr(0,a)}return{pathname:t,search:n==="?"?"":n,hash:r==="#"?"":r,query:{},key:""}};var createPath=function(e){var t=e.pathname,n=e.search,r=e.hash;var i=t||"/";if(n&&n!=="?"){i+=n.charAt(0)==="?"?n:"?"+n}if(r&&r!=="#"){i+=r.charAt(0)==="#"?r:"#"+r}return i};var parseQueryString=function(e){if(!e){return{}}return(/^[?#]/.test(e)?e.slice(1):e).split("&").reduce((function(e,t){var n=t.split("="),r=n[0],i=n[1];e[r]=i?decodeURIComponent(i.replace(/\+/g," ")):"";return e}),{})};var isAbsolute=function(e){return e.charAt(0)==="/"};var createKey=function(e){return Math.random().toString(36).substr(2,e)};var spliceOne=function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1){e[n]=e[r]}e.pop()};var resolvePathname=function(e,t){if(t===void 0){t=""}var n=t&&t.split("/")||[];var r;var i=0;var a=e&&e.split("/")||[];var s=e&&isAbsolute(e);var o=t&&isAbsolute(t);var u=s||o;if(e&&isAbsolute(e)){n=a}else if(a.length){n.pop();n=n.concat(a)}if(!n.length){return"/"}if(n.length){var l=n[n.length-1];r=l==="."||l===".."||l===""}else{r=false}for(var c=n.length;c>=0;c--){var d=n[c];if(d==="."){spliceOne(n,c)}else if(d===".."){spliceOne(n,c);i++}else if(i){spliceOne(n,c);i--}}if(!u){for(;i--;i){n.unshift("..")}}if(u&&n[0]!==""&&(!n[0]||!isAbsolute(n[0]))){n.unshift("")}var f=n.join("/");if(r&&f.substr(-1)!=="/"){f+="/"}return f};var valueEqual=function(e,t){if(e===t){return true}if(e==null||t==null){return false}if(Array.isArray(e)){return Array.isArray(t)&&e.length===t.length&&e.every((function(e,n){return valueEqual(e,t[n])}))}var n=typeof e;var r=typeof t;if(n!==r){return false}if(n==="object"){var i=e.valueOf();var a=t.valueOf();if(i!==e||a!==t){return valueEqual(i,a)}var s=Object.keys(e);var o=Object.keys(t);if(s.length!==o.length){return false}return s.every((function(n){return valueEqual(e[n],t[n])}))}return false};var locationsAreEqual=function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&valueEqual(e.state,t.state)};var createLocation=function(e,t,n,r){var i;if(typeof e==="string"){i=parsePath(e);if(t!==undefined){i.state=t}}else{i=Object.assign({pathname:""},e);if(i.search&&i.search.charAt(0)!=="?"){i.search="?"+i.search}if(i.hash&&i.hash.charAt(0)!=="#"){i.hash="#"+i.hash}if(t!==undefined&&i.state===undefined){i.state=t}}try{i.pathname=decodeURI(i.pathname)}catch(e){if(e instanceof URIError){throw new URIError('Pathname "'+i.pathname+'" could not be decoded. '+"This is likely caused by an invalid percent-encoding.")}else{throw e}}i.key=n;if(r){if(!i.pathname){i.pathname=r.pathname}else if(i.pathname.charAt(0)!=="/"){i.pathname=resolvePathname(i.pathname,r.pathname)}}else{if(!i.pathname){i.pathname="/"}}i.query=parseQueryString(i.search||"");return i};var cacheCount=0;var patternCache={};var cacheLimit=1e4;var compilePath=function(e,t){var n=""+t.end+t.strict;var r=patternCache[n]||(patternCache[n]={});var i=JSON.stringify(e);if(r[i]){return r[i]}var a=[];var s=pathToRegexp(e,a,t);var o={re:s,keys:a};if(cacheCount<cacheLimit){r[i]=o;cacheCount+=1}return o};var matchPath=function(e,t){if(t===void 0){t={}}if(typeof t==="string"){t={path:t}}var n=t.path,r=n===void 0?"/":n,i=t.exact,a=i===void 0?false:i,s=t.strict,o=s===void 0?false:s;var u=compilePath(r,{end:a,strict:o}),l=u.re,c=u.keys;var d=l.exec(e);if(!d){return null}var f=d[0],p=d.slice(1);var h=e===f;if(a&&!h){return null}return{path:r,url:r==="/"&&f===""?"/":f,isExact:h,params:c.reduce((function(e,t,n){e[t.name]=p[n];return e}),{})}};var matchesAreEqual=function(e,t){if(e==null&&t==null){return true}if(t==null){return false}return e&&t&&e.path===t.path&&e.url===t.url&&valueEqual(e.params,t.params)};var PromiseButtonState;(function(e){e[e["Available"]=0]="Available";e[e["Pending"]=1]="Pending";e[e["Error"]=2]="Error"})(PromiseButtonState||(PromiseButtonState={}));var Button=function(){function e(e){registerInstance(this,e);this.fillWidth=false;this.fillWidthOnMobile=false;this.disabled=false;this.variant="primary";this.size="base";this.promiseFn=function(){return Promise.resolve()};this.state=PromiseButtonState.Available}e.prototype.render=function(){var e;var t=this;var n={xs:"px-2.5 py-1.5 text-xs",base:"px-4 py-2 text-base",xl:"px-6 py-3 text-base"};return h("button",{"data-testid":this.testid,class:(e={},e[n[this.size]]=true,e["inline-flex items-center justify-center border font-medium"]=true,e["rounded-md shadow-sm focus:outline-none focus:ring-2"]=true,e["focus:ring-offset-2 focus:ring-primary-focus pointer-events-auto"]=true,e["disabled:pointer-events-none disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400"]=true,e["border-transparent text-white bg-primary-base hover:bg-primary-hover"]=this.variant==="primary",e["border-gray-300 text-gray-700 bg-white hover:bg-gray-50"]=this.variant==="secondary",e["border-transparent bg-primary-light hover:bg-primary-base text-primary-dark hover:text-white"]=this.variant==="light",e["w-full"]=this.fillWidth||this.fillWidthOnMobile,e["sm:w-auto"]=this.fillWidthOnMobile,e),disabled:this.disabled,onClick:function(){return t.clicked()}},this.state===PromiseButtonState.Pending&&h("sss-loading-indicator",{theme:this.variant==="primary"?"light":"primary",size:16}),h("div",{class:{hidden:this.state===PromiseButtonState.Pending}},h("slot",null)))};e.prototype.clicked=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!this.promiseFn||this.state===PromiseButtonState.Pending)return[2];t.label=1;case 1:t.trys.push([1,3,,4]);this.state=PromiseButtonState.Pending;return[4,this.promiseFn()];case 2:t.sent();this.state=PromiseButtonState.Available;return[3,4];case 3:e=t.sent();this.state=PromiseButtonState.Error;throw e;case 4:return[2]}}))}))};return e}();var ChoiceRouter=function(){function e(e){registerInstance(this,e)}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(superSelectionAppService.superCampaignCanNotBeActivated){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.SuperCampaign)}return[2]}))}))};e.prototype.render=function(){return h(Fragment,null)};return e}();injectHistory(ChoiceRouter);var myOwnFundCustomOption={label:CustomFundTypes.MyOwnFund,value:SuperSelectionAppRoutes.MyOwnFund};var CustomFund=function(){function e(e){registerInstance(this,e);this.currentCustomFund=myOwnFundCustomOption;this.showFundOptionsSelection=false}e.prototype.componentWillLoad=function(){var e=SuperSelectionAppRoutes.MyOwnFund;if(window.location.pathname.includes(SuperSelectionAppRoutes.MyOwnFund))e=SuperSelectionAppRoutes.MyOwnFund;if(window.location.pathname.includes(SuperSelectionAppRoutes.DefaultFund))e=SuperSelectionAppRoutes.DefaultFund;if(window.location.pathname.includes(SuperSelectionAppRoutes.SelfManagedFund))e=SuperSelectionAppRoutes.SelfManagedFund;if(window.location.pathname.includes(SuperSelectionAppRoutes.FeaturedFunds))e=SuperSelectionAppRoutes.FeaturedFunds;this.fundOptionsList=[myOwnFundCustomOption,{label:CustomFundTypes.SelfManagedFund,value:SuperSelectionAppRoutes.SelfManagedFund}];if(superSelectionAppService.isFeaturedFundsEnabled&&superSelectionAppService.isUsingSuperCampaign){this.fundOptionsList.push({label:CustomFundTypes.FeaturedFunds,value:SuperSelectionAppRoutes.FeaturedFunds})}this.fundOptionsList.push({label:CustomFundTypes.DefaultFund,value:SuperSelectionAppRoutes.DefaultFund});this.currentCustomFund=this.fundOptionsList.find((function(t){return t.value===e}))||this.currentCustomFund;navigationService.navigateInternally(this.history,e)};e.prototype.render=function(){var e=this;var t=function(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-500",viewBox:"0 0 20 20"},h("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"}))};var n=function(){return h("svg",{class:"h-5 w-5 fill-primary-base group-hover:fill-white",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},h("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"}))};return h("div",{class:"max-w-560 sm:w-560 relative"},h("label",{class:"font-medium text-gray-700 text-sm"},"Which fund would you like to nominate?"),h("div",{class:"mt-1 mb-4"},h("button",{type:"button",class:"bg-white relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-primary-focus focus:border-primary-base text-base sm:text-sm",onClick:function(){return e.showFundOptionsSelection=!e.showFundOptionsSelection}},h("span",{class:{"block truncate":true,"text-gray-500":this.showFundOptionsSelection}},this.showFundOptionsSelection?"Select":this.currentCustomFund.label),h("span",{class:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none"},h(t,null))),this.showFundOptionsSelection&&h("ul",{class:"absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none text-base sm:text-sm"},this.fundOptionsList.map((function(t){return h("li",{class:"text-gray-900 cursor-default select-none relative py-2 pl-3 pr-9 group hover:bg-primary-base hover:text-white",onClick:function(){e.showFundOptionsSelection=!e.showFundOptionsSelection;navigationService.navigateInternally(e.history,t.value)}},h("span",{class:{"block truncate":true,"font-semibold":e.currentCustomFund===t}},t.label),e.currentCustomFund===t&&h("span",{class:"absolute inset-y-0 right-0 flex items-center pr-4"},h(n,null)))})))),h("div",{onClick:function(){return e.showFundOptionsSelection=false}},h("slot",null)))};return e}();injectHistory(CustomFund);var AustralianFundLookupService=function(){function e(){}e.prototype.searchFundsAsync=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,superSelectionApi.getAustralianFundsAsync({searchString:e,maxRecordCount:t})]}))}))};e.prototype.getFundAsync=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(r){switch(r.label){case 0:return[4,superSelectionApi.getAustralianFundAsync(e,t)];case 1:n=r.sent();return[2,Option.some(n)]}}))}))};return e}();var australianFundLookupService=new AustralianFundLookupService;var DefaultFund=function(){function e(e){registerInstance(this,e);this.defaultFundProductName="Loading fund...";this.eventTrackingService=EventTrackingService.Instance}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:e=superSelectionAppService.defaultFundUsi;if(Option.isNone(e)){return[2]}this.isDefaultFundExists=true;return[4,australianFundLookupService.getFundAsync(e.value,true)];case 1:t=n.sent();if(Option.isNone(t)){this.isInvalidDefaultFund=true;return[2]}this.defaultFund=t.value;this.defaultFundProductName=t.value.productName;return[2]}}))}))};e.prototype.componentDidLoad=function(){var e,t,n,r;return this.eventTrackingService.TrackDefaultSuperFundDetailViewedAsync({fundUsi:(t=(e=this.defaultFund)===null||e===void 0?void 0:e.usi)!==null&&t!==void 0?t:"",fundName:(r=(n=this.defaultFund)===null||n===void 0?void 0:n.productName)!==null&&r!==void 0?r:"",promotedFundsShown:superSelectionAppService.promotedFunds,defaultFundUsiSet:Option.toUndefined(superSelectionAppService.defaultFundUsi)})};e.prototype.render=function(){var e=this;return h(Host,null,h("sss-header-section",null),h("div",{class:"flex justify-center mt-11"},h("sss-custom-fund",null,h("div",{class:"p-4 sm:p-6 pb-6 sm:pb-8 border shadow-sm rounded-lg"},h("p",{class:"sm:text-lg font-bold mb-3"},"Fund details"),(!this.isDefaultFundExists||this.isInvalidDefaultFund)&&h("div",{class:"bg-yellow-50 border-l-4 border-yellow-400 p-4 my-3"},h("div",{class:"flex"},h("div",{class:"flex-shrink-0"},h("img",{class:"h-5 w-5",src:getAssetPath("assets/icon-exclamation.svg")})),h("div",{class:"ml-3 text-sm text-yellow-700 leading-5"},h("span",null,"It looks like your employer has not specified a default fund, please contact them if you’d like to use your company’s default fund.")))),this.isDefaultFundExists&&!this.isInvalidDefaultFund&&h("div",null,h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Fund Name"),h("div",{class:"mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm"},this.defaultFundProductName)),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Fund USI"),h("div",{class:"mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm"},this.defaultFund.usi)),h("div",{class:"mt-8 mb-8 h-px w-full bg-gray-200"}),h("div",{class:"text-sm text-gray-700"},h("label",{class:"font-semibold text-gray-900"},"By clicking “Continue”, you acknowledge that:"),h("ul",{class:"list-disc list-outside pl-5"},h("li",{class:"mt-2"},"you are choosing to join your employer’s default super fund;"),h("li",{class:"mt-2"},"your employer will open a new account for you with their default super fund; and"),h("li",{class:"mt-2"},"your application to join is subject to Trustee approval."))))),h("div",{class:"flex justify-center mt-8"},h("div",{class:"sm:max-w-320 w-full"},this.isDefaultFundExists&&!this.isInvalidDefaultFund&&h("div",{class:"mb-4"},h("sss-button",{testid:"continue-button",fillWidth:true,promiseFn:function(){return e.handleSubmitForm()}},"Continue")),h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("sss-button",{testid:"back-button",fillWidth:true,variant:"secondary"},"Back")))))))};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){if(this.isInvalidDefaultFund){return[2]}navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:"Employer’s default fund",fundDetails:{type:"default",fundName:this.defaultFundProductName,fundUsi:this.defaultFund.usi},handleSubmitFn:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,customFundChoiceApi.submitDefaultFundChoiceAsync(Object.assign({standardChoiceFormSignature:t},superSelectionAppService.promotedFundsConfig))];case 1:e.sent();return[2]}}))}))}});return[2]}))}))};return e}();var dropdownAsyncCss="html{scroll-behavior:smooth}.sss-dropdown-menu{max-height:min(20rem, 50vh)}";var DEFAULT_SEARCH_LENGTH=3;var SelectInputAsync=function(){function e(e){var t=this;registerInstance(this,e);this.valueChanged=createEvent(this,"valueChanged",7);this.required=false;this.disabled=false;this.minSearchStringLength=DEFAULT_SEARCH_LENGTH;this.isMouseOver=false;this.searchState="pristine";this.inputValue="";this.isDropdownVisible=false;this.filteredOptions=[];this.shouldExecuteSearch=function(e){var n;return t.isDropdownVisible&&(e===null||e===void 0?void 0:e.length)>=t.minSearchStringLength&&((n=t.selectedOption)===null||n===void 0?void 0:n.label)!==e};this.onBeginSearch=function(e){t.inputValue=e;t.searchState="in progress"};this.onCompleteSearch=function(e){t.highlightedOptionIndex=undefined;switch(e.kind){case"too-many-results":t.searchState="too many results";t.filteredOptions=[];break;case"success":t.searchState="done";t.filteredOptions=e.value;break;default:t.searchState="done";t.filteredOptions=[];break}};this.renderFilteredResults=function(){if(t.searchState==="pristine"){return h("span",{class:"cursor-pointer text-gray-500 py-1.5 pl-4"},"Start typing to find the results")}if(t.searchState==="in progress"){return h("span",{class:"cursor-pointer text-gray-500 py-1.5 pl-4"},"Searching...")}if(t.searchState==="too many results"){return h("span",{class:"cursor-pointer text-gray-500 py-1.5 pl-4"},"Keep typing to narrow down your search.")}if(t.filteredOptions.length===0){return h("span",{class:"cursor-pointer text-gray-500 py-1.5 pl-4"},"No items match your search")}return t.filteredOptions.map((function(e,n){return h("div",{class:{"cursor-pointer text-wrap hover:bg-primary-base py-1.5 pl-4":true,"bg-primary-base":t.isOptionSelected(e)},onClick:function(r){t.highlightedOptionIndex=n;t.toggleDropdown(false);t.selectOption(e)}},e.label)}))};this.resetInput=function(){var e,n;t.inputValue=(n=(e=t.selectedOption)===null||e===void 0?void 0:e.label)!==null&&n!==void 0?n:""};this.toggleDropdown=function(e){t.isDropdownVisible=e};this.processKeyboardNavigation=function(e){var n="Enter";var r="ArrowDown";var i="ArrowUp";var a="Escape";switch(e.key){case r:t.toggleDropdown(true);t.highlightItem("Next");return true;case i:t.highlightItem("Prev");return true;case n:if(t.highlightedOptionIndex!==undefined){t.toggleDropdown(false);t.selectOption(t.filteredOptions[t.highlightedOptionIndex])}return true;case a:t.inputElement.blur();return true}return false};this.highlightItem=function(e){var n=e==="Next"?1:-1;if(t.filteredOptions.length===0){return}t.highlightedOptionIndex=t.highlightedOptionIndex===undefined?0:Math.min(Math.max(0,t.highlightedOptionIndex+n),t.filteredOptions.length-1);if(t.highlightedOptionIndex!==undefined)t.selectOption(t.filteredOptions[t.highlightedOptionIndex])};this.selectOption=function(e){t.selectedOption=e;t.inputValue=e.label;t.valueChanged.emit(e)};this.isOptionSelected=function(e){var n;return((n=t.selectedOption)===null||n===void 0?void 0:n.label)===e.label}}e.prototype.componentWillLoad=function(){this.selectedOption=this.value};e.prototype.componentDidLoad=function(){var e=this;this.searchResultsSubscription=fromEvent(this.inputElement,"keyup").pipe(debounceTime(500),map((function(t){return e.inputElement.value})),distinctUntilChanged(),filter(this.shouldExecuteSearch),tap(this.onBeginSearch),mergeMap(this._searchFunction),tap(this.onCompleteSearch)).subscribe();this.resetInput()};e.prototype.disconnectedCallback=function(){this.searchResultsSubscription.unsubscribe()};e.prototype.handleFocus=function(){this.toggleDropdown(true)};e.prototype.handleBlur=function(){if(this.isMouseOver){return}this.toggleDropdown(false);this.resetInput()};e.prototype.handleKeyDown=function(e){if(this.processKeyboardNavigation(e)){e.preventDefault()}};e.prototype.render=function(){var e=this;var t;return h(Host,null,h("div",{class:"relative"},h("input",{"data-testid":this.testId,type:"text",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md":true,"invalid:border-red-300 invalid:text-red-900 invalid:placeholder-red-300 invalid:focus:ring-red-500 invalid:focus:border-red-500":this.showValidationErrors},placeholder:this.placeholder,required:this.required,disabled:this.disabled,value:this.inputValue,ref:function(t){return e.inputElement=t}}),h("div",{class:{"invalid-feedback mt-2 text-sm text-red-600":true,hidden:!this.isDropdownVisible}},(t=this.requiredValidationMessage)!==null&&t!==void 0?t:"Required."),h("div",{class:{"sss-dropdown-menu absolute shadow rounded-md border mt-0.5 w-full overflow-auto bg-white z-50 py-2 text-sm":true,hidden:!this.isDropdownVisible},onMouseEnter:function(t){return e.isMouseOver=true},onMouseLeave:function(t){return e.isMouseOver=false}},this.renderFilteredResults())))};Object.defineProperty(e.prototype,"_searchFunction",{get:function(){if(this.searchFunction===undefined){throw new Error("Can't render <sss-dropdown-async/> component with no searchFunction")}return this.searchFunction},enumerable:false,configurable:true});return e}();SelectInputAsync.style=dropdownAsyncCss;var ExistingFundService=function(){function e(){}e.prototype.GetExistingFundAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,r,i,a,s,o,u,o,l,c,l,c,l,o,l,c;return __generator(this,(function(d){switch(d.label){case 0:t=superSelectionAppService.superBuyer.superChoice;n=(e=superSelectionAppService.superBuyer.superChoice)===null||e===void 0?void 0:e.choiceDetails;if(!t)return[2,none];if(!n)return[2,none];r=t.dateSubmitted==undefined?none:some(new Date(t.dateSubmitted));i=getSuperChoiceUsi(n);a=getSuperChoiceMemberNumber(n);s=n.kind;switch(s){case"Promoted":return[3,1];case"MyOwnFund":return[3,3];case"SMSF":return[3,5];case"Default":return[3,6];case"PromotedDefault":return[3,8];case"DefinedBenefits":return[3,10];case"PromotedDefaultWithJoin":return[3,12]}return[3,14];case 1:if(isNone(i))return[2,none];return[4,this.getFundByUsiAsync(i.value)];case 2:o=d.sent();return[2,some({type:"Promoted Fund",id:getPromotedFundId(n.promoted),name:isSome(o)?o.value.productName:i.value,usi:i,valid:"Active",memberNumber:a,lastNominatedAt:r})];case 3:u=n.myOwnFund.usi;return[4,this.getFundByUsiAsync(u)];case 4:o=d.sent();return[2,some({type:"My Own Fund",name:isSome(o)?o.value.productName:u,usi:i,valid:this.toFundValidState(o),memberNumber:a,lastNominatedAt:r})];case 5:return[2,some({type:"Self Managed Fund",name:n.smsf.fundName,valid:"Unknown",lastNominatedAt:r})];case 6:l=n.default.usi;return[4,this.getFundByUsiAsync(l)];case 7:c=d.sent();return[2,some({type:"Default Fund",name:isSome(c)?c.value.productName:l,usi:i,valid:this.toFundValidState(c),lastNominatedAt:r})];case 8:l=n.promotedDefault.usi;return[4,this.getFundByUsiAsync(l)];case 9:c=d.sent();return[2,some({type:"Promoted Default Fund",id:n.promotedDefault.fundId,name:isSome(c)?c.value.productName:l,usi:i,valid:this.toFundValidState(c),lastNominatedAt:r})];case 10:l=n.definedBenefits.usi;return[4,this.getFundByUsiAsync(l)];case 11:o=d.sent();return[2,some({type:"Defined Benefits Fund",name:isSome(o)?o.value.productName:l,usi:i,valid:this.toFundValidState(o),lastNominatedAt:r})];case 12:l=n.promotedDefaultWithJoin.usi;return[4,this.getFundByUsiAsync(l)];case 13:c=d.sent();return[2,some({type:"Promoted Default Fund With Join",id:n.promotedDefaultWithJoin.fundId,name:isSome(c)?c.value.productName:l,usi:i,valid:this.toFundValidState(c),memberNumber:a,lastNominatedAt:r})];case 14:return[2,none]}}))}))};e.prototype.submitRetainSuperFundAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/retain-super-fund").post(e).badRequest((function(){throw new Error("Failed to process default fund join request")})).text()]}))}))};e.prototype.getFundByUsiAsync=function(e){return australianFundLookupService.getFundAsync(e,true)};e.prototype.toFundValidState=function(e){if(isSome(e)){return e.value.isActive?"Active":"Inactive"}else{return"Unknown"}};return e}();var existingFundService=new ExistingFundService;var ExistingChoice=function(){function e(e){registerInstance(this,e);this.eventTrackingService=EventTrackingService.Instance;this.createSuperFundNominationDetail=function(e){function t(e){return isSome(e)?e.value:undefined}function n(e){return"usi"in e?t(e.usi):undefined}function r(e){return"memberNumber"in e?t(e.memberNumber):undefined}return{fundType:e.type.toString(),fundName:e.name,fundUsi:n(e),memberNumber:r(e),fundStatus:e.valid.toString(),lastNominatedAt:isSome(e.lastNominatedAt)?e.lastNominatedAt.value.toISOString():""}}}e.prototype.componentDidLoad=function(){var e=this.createSuperFundNominationDetail(this.existingFund);return this.eventTrackingService.TrackSuperFundNominationViewedAsync(e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,existingFundService.GetExistingFundAsync()];case 1:e=t.sent();if(isSome(e)&&e.value.valid!=="Inactive"){this.existingFund=e.value}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)}return[2]}}))}))};e.prototype.render=function(){var e=this;var t=function(e){return h("div",{class:"flex justify-center"})};var n=function(){return h("div",{class:"flex h-20 justify-center items-center relative"},h("div",{class:"h-20 w-20 rounded-full bg-primary-base opacity-10"}),h("div",{class:"h-10 w-10 absolute"},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",class:"fill-primary-base"},h("path",{d:"M174.7 111.8C165.1 110.3 160.1 102.1 161.5 93.35C170.4 40.37 216.5 0 272 0C320.8 0 362.3 31.19 377.6 74.67C380.6 82.1 376.2 92.14 367.9 95.09C359.5 98.03 350.4 93.66 347.5 85.33C336.5 54.24 306.8 32 272 32C232.4 32 199.5 60.82 193.1 98.65C191.6 107.4 183.4 113.2 174.7 111.8V111.8zM400 264C400 250.7 410.7 240 424 240C437.3 240 448 250.7 448 264C448 277.3 437.3 288 424 288C410.7 288 400 277.3 400 264zM488.5 125.8L480 159.1C501.1 176.5 519.6 198.5 530.7 224H544C561.7 224 576 238.3 576 256V352C576 369.7 561.7 384 544 384H512C495.5 405.1 473.5 423.6 448 434.7V464C448 490.5 426.5 512 400 512H368C341.5 512 320 490.5 320 464V448H256V464C256 490.5 234.5 512 208 512H176C149.5 512 128 490.5 128 464V416C89.14 386.8 64 340.3 64 288C28.52 287.2 0 258.2 0 222.6C0 197.8 14 175.1 36.18 164L40.84 161.7C48.75 157.7 58.36 160.9 62.31 168.8C66.26 176.7 63.06 186.4 55.16 190.3L50.49 192.6C39.16 198.3 31.1 209.9 31.1 222.6C31.1 241 46.97 256 65.44 256H67.2C82.02 182.1 146.6 128 223.1 128H376.4C394 108.4 419.6 96 448 96H465.3C480.9 96 492.3 110.7 488.5 125.8H488.5zM224 160C153.3 160 96 217.3 96 288C96 329.9 116.1 367 147.2 390.4L160 400V464C160 472.8 167.2 480 176 480H208C216.8 480 224 472.8 224 464V416H352V464C352 472.8 359.2 480 368 480H400C408.8 480 416 472.8 416 464V413.7L435.2 405.4C455.6 396.5 473.2 382.4 486.4 364.8L496 352H544V256H509.7L501.4 236.8C492.5 216.4 478.4 198.8 460.8 185.6L443.8 172.8L455 128H448C429 128 412.1 136.2 400.3 149.3L390.7 160H224z"}))))};var r=function(){return h("div",{class:"flex h-20 justify-center items-center relative"},h("div",{class:"h-20 w-20 rounded-full bg-primary-base opacity-10"}),h("div",{class:"h-10 w-10 absolute"},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",class:"fill-primary-base"},h("path",{d:"M248.9 192H272v48C272 248.8 279.2 256 288 256C296.8 256 304 248.8 304 240V192h23.12C411.4 192 480 113 480 16C480 7.164 472.8 0 464 0h-39.13C364.9 0 313 40.13 288 98.13C263 40.13 211.1 0 151.1 0H112C103.2 0 96 7.164 96 16C96 113 164.6 192 248.9 192zM424.9 32h22.38c-6.625 71.88-58 128-120 128h-22.5C311.4 88.13 362.8 32 424.9 32zM151.1 32C213.3 32 264.5 88.13 271.3 160h-22.5c-62 0-113.4-56.13-120-128H151.1zM558.2 333.6c-9.5-8.619-22-13.37-35.12-13.37c-12.5 0-24.88 4.248-34.62 12.12l-61.45 49.21c-1.928 1.545-4.324 2.385-6.795 2.385h-41.62c4.625-9.619 6.5-20.74 4.75-32.23C379.4 323.7 353.7 304 325.6 304H181.2c-20.75 0-40.1 6.746-57.5 19.24l-38.5 28.73H16c-8.801 0-16 7.195-16 15.99S7.198 383.1 15.1 383.1l80.01-.0238l46.86-35.25c11.12-8.244 24.62-12.74 38.37-12.74h146.7c13.25 0 24 10.74 24 23.99s-10.75 23.98-24 23.98H239.1c-8.75 0-16 7.246-16 15.99c0 8.746 7.25 15.99 16 15.99h180.2c9.625 0 19-3.248 26.62-9.246l61.62-49.22c4.25-3.373 9.5-5.248 14.62-5.248c5 0 9.875 1.75 13.75 5.248c10.12 9.119 9.375 24.48-.875 32.61l-100.7 80.58c-7.584 6.064-17.01 9.369-26.72 9.369H16c-8.801 0-15.1 7.189-15.1 15.98S7.198 512 15.1 512h392.5c17 0 33.38-5.871 46.62-16.37l100.9-80.7c12.25-9.744 19.5-24.36 19.1-39.98C576.5 359.3 569.1 344.2 558.2 333.6z"}))))};var i=function(){return h("div",{class:"flex h-20 justify-center items-center relative"},h("div",{class:"h-20 w-20 rounded-full bg-primary-base opacity-10"}),h("div",{class:"h-10 w-10 absolute"},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:"fill-primary-base"},h("path",{d:"M448 96h-64V48C384 21.53 362.5 0 336 0h-160C149.5 0 128 21.53 128 48V96H64C28.65 96 0 124.7 0 160v256c0 35.35 28.65 64 64 64h384c35.35 0 64-28.65 64-64V160C512 124.7 483.3 96 448 96zM160 48C160 39.17 167.2 32 176 32h160C344.8 32 352 39.17 352 48V96H160V48zM480 416c0 17.64-14.36 32-32 32H64c-17.64 0-32-14.36-32-32V288h144v64c0 8.844 7.156 16 16 16h128c8.844 0 16-7.156 16-16V288H480V416zM208 336V288h96v48H208zM480 256H32V160c0-17.64 14.36-32 32-32h384c17.64 0 32 14.36 32 32V256z"}))))};var a=function(){return h("div",{class:"flex h-20 justify-center items-center relative"},h("div",{class:"h-20 w-20 rounded-full bg-primary-base opacity-10"}),h("div",{class:"h-10 w-10 absolute"},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",class:"fill-primary-base"},h("path",{d:"M174.7 111.8C165.1 110.3 160.1 102.1 161.5 93.35C170.4 40.37 216.5 0 272 0C320.8 0 362.3 31.19 377.6 74.67C380.6 82.1 376.2 92.14 367.9 95.09C359.5 98.03 350.4 93.66 347.5 85.33C336.5 54.24 306.8 32 272 32C232.4 32 199.5 60.82 193.1 98.65C191.6 107.4 183.4 113.2 174.7 111.8V111.8zM400 264C400 250.7 410.7 240 424 240C437.3 240 448 250.7 448 264C448 277.3 437.3 288 424 288C410.7 288 400 277.3 400 264zM488.5 125.8L480 159.1C501.1 176.5 519.6 198.5 530.7 224H544C561.7 224 576 238.3 576 256V352C576 369.7 561.7 384 544 384H512C495.5 405.1 473.5 423.6 448 434.7V464C448 490.5 426.5 512 400 512H368C341.5 512 320 490.5 320 464V448H256V464C256 490.5 234.5 512 208 512H176C149.5 512 128 490.5 128 464V416C89.14 386.8 64 340.3 64 288C28.52 287.2 0 258.2 0 222.6C0 197.8 14 175.1 36.18 164L40.84 161.7C48.75 157.7 58.36 160.9 62.31 168.8C66.26 176.7 63.06 186.4 55.16 190.3L50.49 192.6C39.16 198.3 31.1 209.9 31.1 222.6C31.1 241 46.97 256 65.44 256H67.2C82.02 182.1 146.6 128 223.1 128H376.4C394 108.4 419.6 96 448 96H465.3C480.9 96 492.3 110.7 488.5 125.8H488.5zM224 160C153.3 160 96 217.3 96 288C96 329.9 116.1 367 147.2 390.4L160 400V464C160 472.8 167.2 480 176 480H208C216.8 480 224 472.8 224 464V416H352V464C352 472.8 359.2 480 368 480H400C408.8 480 416 472.8 416 464V413.7L435.2 405.4C455.6 396.5 473.2 382.4 486.4 364.8L496 352H544V256H509.7L501.4 236.8C492.5 216.4 478.4 198.8 460.8 185.6L443.8 172.8L455 128H448C429 128 412.1 136.2 400.3 149.3L390.7 160H224z"}))))};var s=function(){return e.existingFund.type=="Defined Benefits Fund"?null:h("div",{class:"mt-4"},h("sss-button",{testid:"choose-another-fund-button",fillWidth:true,variant:"secondary",promiseFn:function(){return e.handleFundNominationDeclined()}},"Choose another fund"))};return h("div",null,h("div",{class:"text-2xl sm:text-3xl font-bold text-center"},"Your super nomination"),this.existingFund.type=="Defined Benefits Fund"?null:h("div",{class:"sm:text-lg text-gray-600 mt-3 sm:mt-4 max-w-800 text-center leading-7"},"Continue with your chosen fund or choose another fund below."),h("div",{class:"flex justify-center mt-8 sm:mt-12"},h("div",{class:"max-w-400 w-full"},h("div",{class:"flex-col border shadow-sm p-6 pt-8 rounded-lg text-center"},h("div",{class:"space-y-4"},function(){switch(e.existingFund.type){case"Promoted Fund":case"Promoted Default Fund":return h(t,{name:e.existingFund.name});case"Self Managed Fund":return h(r,null);case"My Own Fund":case"Promoted Default Fund With Join":return h(n,null);case"Default Fund":return h(i,null);case"Defined Benefits Fund":return h(a,null);default:return h("div",null)}}(),h("div",{class:"sm:text-lg font-bold leading-6 break-words"},function(){switch(e.existingFund.type){case"Default Fund":return"Employer's default fund";case"My Own Fund":case"Promoted Fund":case"Self Managed Fund":case"Promoted Default Fund":case"Defined Benefits Fund":case"Promoted Default Fund With Join":return e.existingFund.name;default:return""}}())),h("div",{class:"mt-6"},h("sss-button",{testid:"continue-with-this-fund-button",fillWidth:true,promiseFn:function(){return e.handleFundNominationAccepted()}},"Continue with this fund"))),h(s,null))))};e.prototype.handleFundNominationAccepted=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundNominationDetail(this.existingFund);return[4,existingFundService.submitRetainSuperFundAsync(e)];case 1:t.sent();superSelectionAppService.markSuperSelectionAsSubmitted();return[2]}}))}))};e.prototype.handleFundNominationDeclined=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundNominationDetail(this.existingFund);return[4,this.eventTrackingService.TrackSuperFundNominationDeclinedAsync(e)];case 1:t.sent();navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage);return[2]}}))}))};return e}();var DefaultFooterText="Powered by Flare";var FooterSection=function(){function e(e){var t=this;registerInstance(this,e);this.footerText=function(){return t.textOverride!==undefined?t.textOverride:DefaultFooterText}}e.prototype.render=function(){return h("div",{class:{"text-center text-gray-500 text-xs w-full max-w-960 mx-auto":true,"mt-8 sm:mt-20":!superSelectionAppService.hideFooterSection}},!superSelectionAppService.hideFooterSection&&h("span",null,this.footerText()),h("p",{class:"block text-transparent"},"v",AppVersion))};return e}();var RouteLink=function(e,t){return h("stencil-route-link",{exact:true,url:e.route},h("div",{class:{"block focus:outline-none focus:ring-2 ring-offset-1 focus:ring-primary-focus focus:z-10 rounded-md py-2 text-sm font-medium w-auto px-3 sm:px-8 h-full":true,"bg-white shadow-sm text-primary-base":e.isActive,"hover:bg-primary-hover text-white":!e.isActive}},t))};var ChooseAnotherFundLink=function(e){var t=SuperSelectionAppRoutes.MyOwnFund;if(window.location.href.includes(SuperSelectionAppRoutes.SelfManagedFund)){t=SuperSelectionAppRoutes.SelfManagedFund}else if(window.location.href.includes(SuperSelectionAppRoutes.DefaultFund)){t=SuperSelectionAppRoutes.DefaultFund}else if(window.location.href.includes(SuperSelectionAppRoutes.FeaturedFunds)){t=SuperSelectionAppRoutes.FeaturedFunds}return h(RouteLink,{route:t,isActive:e.isActive},"Choose another fund")};var HeaderSection=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h("div",{class:"flex justify-center"},h("div",{class:"text-center max-w-800"},h("h3",{class:"font-bold mb-3 sm:mb-4 text-2xl sm:text-3xl"},"Nominate a super fund"),h(Fragment,null,h("div",{class:"text-gray-600 sm:text-lg leading-7 sm:leading-8"},superSelectionAppService.superCampaignCanNotBeActivated?h(Fragment,null,"You can choose any super fund, including your current fund/SMSF or your employer’s default fund."):h(Fragment,null,"You can choose any super fund, including your current fund/SMSF, your employer’s default fund, or alternatively, you can select from one of the featured funds.")),!superSelectionAppService.superCampaignCanNotBeActivated&&h("div",{class:"inline-flex mt-8 sm:mt-12 bg-primary-base rounded-lg p-0.5 whitespace-normal"},h(RouteLink,{route:SuperSelectionAppRoutes.ChoicePage,isActive:false},"Featured super funds"),h(ChooseAnotherFundLink,{isActive:true})))))};return e}();var LoadingIndicator=function(){function e(e){registerInstance(this,e);this.theme="primary";this.size=48}e.prototype.render=function(){return h("div",{class:"inline-block animate-spin"},h("svg",{width:this.size,height:this.size,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM1.99743 8C1.99743 11.3151 4.68487 14.0026 8 14.0026C11.3151 14.0026 14.0026 11.3151 14.0026 8C14.0026 4.68487 11.3151 1.99743 8 1.99743C4.68487 1.99743 1.99743 4.68487 1.99743 8Z",fill:"white","fill-opacity":"0.3"}),h("path",{d:"M8 1C8 0.447715 8.44943 -0.00643769 8.99741 0.0624193C9.70527 0.151368 10.3996 0.334798 11.0615 0.608964C12.0321 1.011 12.914 1.60028 13.6569 2.34315C14.3997 3.08602 14.989 3.96793 15.391 4.93853C15.6652 5.60043 15.8486 6.29473 15.9376 7.0026C16.0064 7.55057 15.5523 8 15 8C14.4477 8 14.0085 7.54925 13.9169 7.00462C13.842 6.55939 13.7169 6.12298 13.5433 5.7039C13.2417 4.97595 12.7998 4.31451 12.2426 3.75736C11.6855 3.20021 11.0241 2.75825 10.2961 2.45672C9.87702 2.28313 9.44061 2.15804 8.99538 2.08314C8.45075 1.99152 8 1.55228 8 1Z",class:this.theme==="primary"?"fill-primary-base":"fill-white"})))};return e}();var LoadingPage=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h(Host,{class:"flex flex-col justify-center items-center"},h("h5",{class:"text-lg"},"Loading your superannuation step"),h("sss-loading-indicator",null))};return e}();var MyOwnFundEngagementStep=function(){function e(e){var t=this;registerInstance(this,e);this.stepContinued=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender=="byof-engagement"))return[3,2];return[4,EventTrackingService.Instance.TrackSuperMyOwnFundEngagementStepContinued(this.fundUsi,e.detail.reason)];case 1:t.sent();this.navigateToStandardChoice();t.label=2;case 2:return[2]}}))}))};this.subscribeToStepEvents=function(){for(var e in t.stepEventHandlers){document.addEventListener(e,t.stepEventHandlers[e])}};this.unSubscribeFromStepEvents=function(){for(var e in t.stepEventHandlers){document.removeEventListener(e,t.stepEventHandlers[e])}};this.stepEventHandlers={continue:this.stepContinued.bind(this)}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!(superSelectionAppService.isBringYourOwnFundCustomStepEnabled&&superSelectionAppService.isUsingSuperCampaign&&Option.isSome(state.myOwnFundForm.fundUsi)&&Option.isSome(state.myOwnFundForm.fundName)&&Option.isSome(state.myOwnFundForm.memberNumber)&&Option.isSome(state.myOwnFundForm.memberFirstName)&&Option.isSome(state.myOwnFundForm.memberFamilyName)&&Option.isSome(superSelectionAppService.backendUrl)&&Option.isSome(superSelectionAppService.state.jwt)))return[3,2];this.backendUrl=superSelectionAppService.backendUrl.value;this.accessToken=superSelectionAppService.state.jwt.value;this.fundUsi=state.myOwnFundForm.fundUsi.value;this.fundName=state.myOwnFundForm.fundName.value;this.memberNumber=state.myOwnFundForm.memberNumber.value;this.memberFirstName=state.myOwnFundForm.memberFirstName.value;this.memberFamilyName=state.myOwnFundForm.memberFamilyName.value;this.unSubscribeFromStepEvents();this.subscribeToStepEvents();superSelectionAppService.hideFooterSection=true;return[4,EventTrackingService.Instance.TrackSuperMyOwnFundEngagementStepActivationSucceeded(this.fundUsi)];case 1:e.sent();return[3,3];case 2:navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund);e.label=3;case 3:return[2]}}))}))};e.prototype.disconnectedCallback=function(){this.unSubscribeFromStepEvents();superSelectionAppService.hideFooterSection=false};e.prototype.render=function(){return h(Host,null,h("apollo-super-byof-engagement",{"backend-url":this.backendUrl,"access-token":this.accessToken,"fund-usi":this.fundUsi}))};e.prototype.navigateToStandardChoice=function(){var e=this;navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:this.fundName,fundDetails:{type:"myOwnFund",fundName:this.fundName,fundUsi:this.fundUsi,memberNumber:this.memberNumber},handleSubmitFn:function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:e=Object.assign({fundUsi:this.fundUsi,memberNumber:this.memberNumber,memberFirstName:this.memberFirstName,memberFamilyName:this.memberFamilyName,standardChoiceFormSignature:t},superSelectionAppService.promotedFundsConfig);return[4,customFundChoiceApi.submitCustomFundChoiceAsync(e)];case 1:n.sent();return[2]}}))}))}})};return e}();injectHistory(MyOwnFundEngagementStep);var MemberNameInput=function(){function e(e){registerInstance(this,e);this.myInputChange=createEvent(this,"myInputChange",7);this.value="";this.name="";this.readableName="";this.showValidationErrors=false;this.errorMessage="";this.NAME_PATTERN="^[A-Za-z](?:[A-Za-z]||'[A-Za-z]||-[A-Za-z]|| [A-Za-z])*\\s*$"}e.prototype.render=function(){var e=this;return h(Host,null,h("input",{"data-testid":this.testId,type:"text",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md":true,"invalid:border-red-300 invalid:text-red-900 invalid:focus:ring-red-500 invalid:focus:border-red-500":this.showValidationErrors},required:true,pattern:this.NAME_PATTERN,name:this.name,value:this.value,onInput:function(t){return e.handleInput(t)}}),this.errorMessage&&h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},this.errorMessage))};e.prototype.handleInput=function(e){var t=e.target;t.value=t.value.replace(/\s+/g," ");this.validateInput(t);this.myInputChange.emit(t.value.trim())};e.prototype.validateInput=function(e){if(!e.checkValidity()){if(e.validity.valueMissing){this.errorMessage=this.readableName+" is required."}else if(e.validity.patternMismatch){if(e.value.startsWith("-")||e.value.startsWith("'")){this.errorMessage=this.readableName+" must start with a letter."}else if(e.value.includes("--")){this.errorMessage=this.readableName+" must not have a double hypen."}else{this.errorMessage=this.readableName+" contains unsupported characters."}}else{this.errorMessage="Invalid input."}}else{this.errorMessage=""}};return e}();var Prefill=function(){function e(e){registerInstance(this,e);this.prefill=undefined;this.ignorePopState=function(){return window.history.pushState(null,"",null)}}e.prototype.connectedCallback=function(){this.ignorePopState();window.addEventListener("popstate",this.ignorePopState)};e.prototype.disconnectedCallback=function(){window.removeEventListener("popstate",this.ignorePopState)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.prefill=isSome(superSelectionAppService.state.superChoicePrefill)?superSelectionAppService.state.superChoicePrefill.value:undefined;return[2]}))}))};e.prototype.render=function(){if(this.prefill&&this.prefill.type==="myOwnFund"){if(this.prefill.data.fundDetail.type==="Valid"){return this.renderMyOwnFund(this.prefill.data)}else{return this.renderInvalidMyOwnFund(this.prefill.data)}}if(this.prefill&&this.prefill.type==="smsf"){if(this.prefill.data.fundAbn.valid){return this.renderSMSF(this.prefill.data)}else{return this.renderInvalidSMSF(this.prefill.data)}}navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage);return null};e.prototype.renderMyOwnFund=function(e){return h("sss-prefill-my-own-fund",{history:this.history,prefill:e})};e.prototype.renderInvalidMyOwnFund=function(e){return h("sss-prefill-invalid-my-own-fund",{history:this.history,prefill:e})};e.prototype.renderSMSF=function(e){return h("sss-prefill-smsf",{history:this.history,prefill:e})};e.prototype.renderInvalidSMSF=function(e){return h("sss-prefill-invalid-smsf",{history:this.history,prefill:e})};return e}();var DisplayField=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h("div",{class:"flex w-full flex-col sm:flex-row sm:min-h-5 justify-center items-start gap-0.5 sm:gap-4 self-stretch"},h("div",{class:{"sm:w-2/5 sm:max-w-40 self-stretch text-gray-500 text-xs sm:text-sm not-italic font-medium leading-4 sm:leading-5":true,"text-red-600":!this.field.isValid}},this.field.name),h("div",{"data-testid":this.field.testId,class:{"sm:w-3/5 max-w-[300px] self-stretch text-gray-900 text-sm not-italic font-normal leading-5 break-words":true,"h-5 sm:h-auto":this.field.isEmpty,"text-red-600":!this.field.isValid}},this.field.value))};return e}();var PrefillErrorBox=function(){function e(e){registerInstance(this,e);this.withHeader=false}e.prototype.render=function(){var e=function(){return h("div",{class:"w-5 h-5"},h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},h("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18ZM8.70711 7.29289C8.31658 6.90237 7.68342 6.90237 7.29289 7.29289C6.90237 7.68342 6.90237 8.31658 7.29289 8.70711L8.58579 10L7.29289 11.2929C6.90237 11.6834 6.90237 12.3166 7.29289 12.7071C7.68342 13.0976 8.31658 13.0976 8.70711 12.7071L10 11.4142L11.2929 12.7071C11.6834 13.0976 12.3166 13.0976 12.7071 12.7071C13.0976 12.3166 13.0976 11.6834 12.7071 11.2929L11.4142 10L12.7071 8.70711C13.0976 8.31658 13.0976 7.68342 12.7071 7.29289C12.3166 6.90237 11.6834 6.90237 11.2929 7.29289L10 8.58579L8.70711 7.29289Z",fill:"#F87171"})))};return h("div",{class:"flex items-start self-stretch rounded-md bg-red-50"},h("div",{class:"w-1 self-stretch bg-red-400"}),h("div",{class:"flex items-start gap-3 flex-[1_0_0] p-4"},h(e,null),h("div",{class:"flex-col justify-start items-start gap-2 inline-flex"},this.withHeader&&h("div",{class:"self-stretch text-red-800 text-sm font-medium leading-tight"},"Please correct ",this.notificationList.length," issues with your fund details"),this.withHeader&&this.notificationList.map((function(e){return h("div",{class:"self-stretch h-5 flex-col justify-start items-start gap-1 flex"},h("div",{class:"self-stretch pl-1.5 justify-start items-start gap-[7px] inline-flex"},h("div",{class:"pt-1.5 justify-center items-center flex"},h("div",{class:"w-1.5 h-1.5 bg-red-700 rounded-full"})),h("div",{class:"grow shrink basis-0 text-red-700 text-sm font-normal leading-tight"},e)))})),!this.withHeader&&this.notificationList.map((function(e){return h("div",{class:"text-sm font-medium leading-tight text-red-800"},e)})))))};return e}();function isNullOrWhitespace(e){return e==null||e.trim()===""}var DisabledField=function(e,t,n){return h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},e),h("div",{"data-testid":t,class:"mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm"},n))};var Header=function(){return h("div",null,h("div",{class:"text-2xl sm:text-3xl font-bold text-center"},"Your super nomination"),h("div",{class:"sm:text-lg text-gray-600 mt-3 sm:mt-4 max-w-800 text-center leading-7"},"Review or update the below super fund nomination details provided by your employer."))};var Style=function(){function e(){}e.Input=function(e){return{"relative shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md focus:z-10":true,"invalid:border-red-300 invalid:text-red-900 invalid:placeholder-red-300 invalid:focus:ring-red-500 invalid:focus:border-red-500":e}};return e}();var NAME_PATTERN="[A-Za-z][A-Za-z']+(( |-)[A-Za-z][A-Za-z']+)*\\s*$";var FormField=function(){function e(e,t,n){this.name=e;this.testId=t;this._value=n!==null&&n!==void 0?n:"";this._errorMessage=this.validateAndReturnErrorMessage(this._value)}Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._errorMessage=this.validateAndReturnErrorMessage(e);this._value=e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isValid",{get:function(){return this._errorMessage===null},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isEmpty",{get:function(){return isNullOrWhitespace(this._value)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"errorMessage",{get:function(){return this._errorMessage},enumerable:false,configurable:true});return e}();var StaticFormField=function(){function e(e,t,n,r){this.name=e;this.testId=t;this._value=n!==null&&n!==void 0?n:"";this._isValid=r}Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isValid",{get:function(){return this._isValid},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isEmpty",{get:function(){return isNullOrWhitespace(this._value)},enumerable:false,configurable:true});return e}();var FundUsi=function(e){__extends(t,e);function t(t,n){return e.call(this,"Fund USI","fund-usi",t,n)||this}return t}(StaticFormField);var FundName=function(e){__extends(t,e);function t(t,n){return e.call(this,"Fund name","fund-name",t,n)||this}return t}(StaticFormField);var SmsfFundName=function(e){__extends(t,e);function t(t){return e.call(this,"Fund name","smsf-fund-name",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"Fund name is required."}else if(e.length<2){return"Enter a valid Fund name."}else{return null}};return t}(FormField);var MemberNumber=function(e){__extends(t,e);function t(t){return e.call(this,"Member number","member-number",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=/^[A-Za-z0-9]{4,16}$/;if(isNullOrWhitespace(e)){return"Member number is required."}else if(!t.test(e)){return"Enter a valid member number (only numbers and / or letters)"}else{return null}};return t}(FormField);var MemberLastName=function(e){__extends(t,e);function t(t){return e.call(this,"Member last name","member-last-name",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=new RegExp(NAME_PATTERN);if(isNullOrWhitespace(e)){return"Member last name is required."}else if(!t.test(e)){return"Member last name contains unsupported characters."}else{return null}};return t}(FormField);var MemberGivenNames=function(e){__extends(t,e);function t(t){return e.call(this,"Member given name(s)","member-given-names",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=new RegExp(NAME_PATTERN);if(isNullOrWhitespace(e)){return"Member given name(s) is required."}else if(!t.test(e)){return"Member given name(s) contains unsupported characters."}else{return null}};return t}(FormField);var FundAbn=function(e){__extends(t,e);function t(t,n){return e.call(this,"Fund ABN","fund-abn",t,n)||this}return t}(StaticFormField);var FundEsa=function(e){__extends(t,e);function t(t){return e.call(this,"Fund ESA","fund-esa",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"Fund ESA is required."}else if(e.length<2){return"Enter a valid Fund ESA."}else{return null}};return t}(FormField);var FundAddressLine1=function(e){__extends(t,e);function t(t){return e.call(this,"Address line 1","address-line-one",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"Address line 1 is required."}else if(e.length<2){return"Enter a valid Address line 1."}else{return null}};return t}(FormField);var FundAddressLine2=function(e){__extends(t,e);function t(t){return e.call(this,"Address line 2","address-line-two",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){return null};return t}(FormField);var FundAddressCity=function(e){__extends(t,e);function t(t){return e.call(this,"City/suburb","city-suburb",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"City/suburb is required."}else{return null}};return t}(FormField);var FundAddressPostcode=function(e){__extends(t,e);function t(t){return e.call(this,"Postcode","postcode",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=/^[0-9]{4}$/;if(isNullOrWhitespace(e)){return"Postcode is required."}else if(!t.test(e)){return"Enter a valid postcode."}else{return null}};return t}(FormField);var FundAddressState=function(e){__extends(t,e);function t(t){return e.call(this,"State","state",t)||this}Object.defineProperty(t.prototype,"options",{get:function(){return[{value:"NSW",label:"NSW"},{value:"QLD",label:"QLD"},{value:"ACT",label:"ACT"},{value:"VIC",label:"VIC"},{value:"TAS",label:"TAS"},{value:"WA",label:"WA"},{value:"SA",label:"SA"},{value:"NT",label:"NT"}]},enumerable:false,configurable:true});t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"State is required."}else if(this.options.find((function(t){return t.value=e}))===undefined){return"Enter a valid state."}else{return null}};return t}(FormField);var FundAddress=function(e){__extends(t,e);function t(t,n,r,i,a){var s=this;var o=[t,n,r,i,a].map((function(e){return e.value})).filter((function(e){return e})).join(", ");var u=t.isValid&&n.isValid&&r.isValid&&i.isValid&&a.isValid;s=e.call(this,"Fund address","fund-address",o,u)||this;return s}return t}(StaticFormField);var BankAccountName=function(e){__extends(t,e);function t(t){return e.call(this,"Account name","account-name",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){if(isNullOrWhitespace(e)){return"Account name is required."}else if(e.length<2){return"Enter a valid Account name."}else{return null}};return t}(FormField);var BankName=function(e){__extends(t,e);function t(t,n){return e.call(this,"Bank name","bank-name",t,n)||this}return t}(StaticFormField);var BankAccountBsb=function(e){__extends(t,e);function t(t){return e.call(this,"BSB","bsb",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=/^[0-9]{6,7}$/;if(isNullOrWhitespace(e)){return"BSB is required."}else if(!t.test(e)){return"Enter a valid BSB."}else{return null}};return t}(FormField);var BankAccountNumber=function(e){__extends(t,e);function t(t){return e.call(this,"Account number","account-number",t)||this}t.prototype.validateAndReturnErrorMessage=function(e){var t=/^[0-9]{2,11}$/;if(isNullOrWhitespace(e)){return"Account number is required."}else if(!t.test(e)){return"Enter a valid Account number."}else{return null}};return t}(FormField);var PrefillInvalidMyOwnFund=function(){function e(e){registerInstance(this,e);this.eventTrackingService=EventTrackingService.Instance;this.createSuperFundPrefillDeclinedDetail=function(e){return{fundType:"My Own Fund",isUsiValid:e.fundDetail.type==="Valid",isMemberNumberPresent:!isNullOrWhitespace(e.memberNumber),isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}};this.createSuperFundPrefillViewedDetail=function(e){return{fundType:"My Own Fund",isUsiValid:e.fundDetail.type==="Valid",isMemberNumberPresent:!isNullOrWhitespace(e.memberNumber),isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}}}e.prototype.componentDidLoad=function(){var e=this.createSuperFundPrefillViewedDetail(this.prefill);return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.prefill&&this.prefill.fundDetail.type==="Invalid"){this.fundUsi=new FundUsi(this.prefill.fundDetail.fundUsi,false);this.fundName=new FundName("",false);this.memberNumber=new MemberNumber(this.prefill.memberNumber);this.memberGivenNames=new MemberGivenNames(this.prefill.memberFirstName);this.memberLastName=new MemberLastName(this.prefill.memberFamilyName)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)}return[2]}))}))};e.prototype.render=function(){var e=this;return h("div",null,h(Header,null),h("div",{class:"flex flex-col items-center gap-8 mt-8 sm:mt-12"},h("div",{class:"flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg"},h("div",{class:"flex flex-col items-start gap-3 self-stretch"},h("div",{class:"self-stretch text-grey-900 text-lg not-italic font-bold leading-7"},"Your fund details"),h("sss-prefill-error-box",{class:"self-stretch",notificationList:["The fund USI is invalid, or no longer in use. You are required to choose another fund to continue with your super nomination."]}),h("div",{class:"flex flex-col gap-3 self-stretch mt-4"},h("sss-prefill-display-field",{field:this.fundUsi}),h("sss-prefill-display-field",{field:this.fundName}),h("sss-prefill-display-field",{field:this.memberNumber}),h("sss-prefill-display-field",{field:this.memberLastName}),h("sss-prefill-display-field",{field:this.memberGivenNames})))),h("div",{class:"flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4"},h("sss-button",{testid:"choose-another-fund-button",class:"self-stretch",fillWidth:true,variant:"primary",promiseFn:function(){return e.handleChooseAnotherFund()}},"Choose another fund"))))};e.prototype.handleChooseAnotherFund=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundPrefillDeclinedDetail(this.prefill);return[4,this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(e)];case 1:t.sent();return[2,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)]}}))}))};return e}();var PrefillInvalidSMSF=function(){function e(e){registerInstance(this,e);this.eventTrackingService=EventTrackingService.Instance;this.createSuperFundPrefillDeclinedDetail=function(e){return{fundType:"SMSF",isAbnValid:e.fundAbn.valid,isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}};this.createSuperFundPrefillViewedDetail=function(e){return{fundType:"SMSF",isAbnValid:e.fundAbn.valid,isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}}}e.prototype.componentDidLoad=function(){var e=this.createSuperFundPrefillViewedDetail(this.prefill);return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.prefill&&!this.prefill.fundAbn.valid){this.initialiseComponent(this.prefill)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.PrefillInvalidMyOwnFundPage)}return[2]}))}))};e.prototype.render=function(){var e=this;return h("div",null,h(Header,null),h("div",{class:"flex flex-col items-center gap-8 mt-8 sm:mt-12"},h("div",{class:"flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg"},h("div",{class:"flex flex-col items-start gap-3 self-stretch"},h("div",{class:"self-stretch text-grey-900 text-lg not-italic font-bold leading-7"},"Your self-managed super fund (SMSF) details"),h("sss-prefill-error-box",{class:"self-stretch",notificationList:["The fund ABN is invalid. You are required to choose another fund to continue with your super nomination."]}),h("div",{class:"flex flex-col gap-3 self-stretch mt-4"},h("sss-prefill-display-field",{field:this.fundName}),h("sss-prefill-display-field",{field:this.fundAbn}),h("sss-prefill-display-field",{field:this.fundEsa}),h("sss-prefill-display-field",{field:this.fundAddress}),h("sss-prefill-display-field",{field:this.memberLastName}),h("sss-prefill-display-field",{field:this.memberGivenNames}),h("div",{class:"mt-4 mb-2 text-gray-900 text-lg font-bold leading-7"},"Fund bank details"),h("sss-prefill-display-field",{field:this.bankAccountName}),h("sss-prefill-display-field",{field:this.bankAccountBsb}),h("sss-prefill-display-field",{field:this.bankAccountNumber})))),h("div",{class:"flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4"},h("sss-button",{testid:"make-another-nomination-button",class:"self-stretch",fillWidth:true,variant:"primary",promiseFn:function(){return e.handleFundNominationDeclined()}},"Make another nomination"))))};e.prototype.initialiseComponent=function(e){this.fundName=new SmsfFundName(e.fundName);this.fundAbn=new FundAbn(e.fundAbn.value,e.fundAbn.valid);this.fundEsa=new FundEsa(e.electronicServiceAddress);this.fundAddressLine1=new FundAddressLine1(e.addressLine1);this.fundAddressLine2=new FundAddressLine2(e.addressLine2);this.fundAddressCity=new FundAddressCity(e.addressCity);this.fundAddressPostcode=new FundAddressPostcode(e.addressPostcode);this.fundAddressState=new FundAddressState(e.addressState);this.fundAddress=new FundAddress(this.fundAddressLine1,this.fundAddressLine2,this.fundAddressCity,this.fundAddressState,this.fundAddressPostcode);this.memberGivenNames=new MemberGivenNames(e.memberFirstName);this.memberLastName=new MemberLastName(e.memberFamilyName);this.bankAccountName=new BankAccountName(e.bankAccountName);this.bankAccountBsb=new BankAccountBsb(e.bankAccountBsb);this.bankAccountNumber=new BankAccountNumber(e.bankAccountNumber)};e.prototype.handleFundNominationDeclined=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundPrefillDeclinedDetail(this.prefill);return[4,this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(e)];case 1:t.sent();return[2,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)]}}))}))};return e}();var PrefillMyOwnFund=function(){function e(e){registerInstance(this,e);this.mode="review";this.formState="pristine";this.isSubmitDisabled=true;this.eventTrackingService=EventTrackingService.Instance;this.createSuperFundPrefillDeclinedDetail=function(e){return{fundType:"My Own Fund",isUsiValid:e.fundDetail.type==="Valid",isMemberNumberPresent:!isNullOrWhitespace(e.memberNumber),isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}};this.createSuperFundPrefillViewedDetail=function(e){return{fundType:"My Own Fund",isUsiValid:e.fundDetail.type==="Valid",isMemberNumberPresent:!isNullOrWhitespace(e.memberNumber),isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}}}e.prototype.componentDidLoad=function(){var e=this.createSuperFundPrefillViewedDetail(this.prefill);return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.prefill&&this.prefill.fundDetail.type==="Valid"){this.initialiseComponent(this.prefill.fundDetail.fundName,this.prefill)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)}return[2]}))}))};e.prototype.render=function(){var e=this;var t=[this.memberNumber.errorMessage,this.memberLastName.errorMessage,this.memberGivenNames.errorMessage].filter((function(e){return e!==null}));return h("div",null,h(Header,null),h("div",{class:"flex flex-col items-center gap-8 mt-8 sm:mt-12"},h("div",{class:"flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg"},h("div",{class:"flex flex-col items-start gap-3.5 self-stretch"},h("div",{class:"self-stretch text-grey-900 text-lg not-italic font-bold leading-7"},"Your fund details"),h("sss-prefill-warning-box",{class:"self-stretch",notificationList:["Make sure you are a current member of the fund before completing this step.","Please check that the fund USI is correct as some funds have similar names."]}),this.mode==="review"&&t.length>0&&h("sss-prefill-error-box",{class:"self-stretch",notificationList:t,withHeader:true}),this.mode==="review"&&h("div",{class:"flex flex-col gap-3 self-stretch mt-4"},h("sss-prefill-display-field",{field:this.fundUsi}),h("sss-prefill-display-field",{field:this.fundName}),h("sss-prefill-display-field",{field:this.memberNumber}),h("sss-prefill-display-field",{field:this.memberLastName}),h("sss-prefill-display-field",{field:this.memberGivenNames})),this.mode==="review"&&h("sss-button",{testid:"edit-details-button",class:"self-stretch mt-3",fillWidth:true,variant:"secondary",promiseFn:function(){return e.setModeToEdit()}},h("div",{class:"flex flex-row gap-2"},h("div",{class:"text-sm not-italic font-medium leading-4"},"Edit details"),h("div",{class:"w-4 h-4 relative"},h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"currentColor"},h("path",{d:"M11.369 2.86865C11.9939 2.24381 13.0069 2.24381 13.6318 2.86865C14.2566 3.49349 14.2566 4.50656 13.6318 5.1314L12.9974 5.76571L10.7347 3.50297L11.369 2.86865Z"}),h("path",{d:"M9.60334 4.63434L2.90039 11.3373V13.6H5.16313L11.8661 6.89708L9.60334 4.63434Z"}))))),this.mode==="edit"&&h("form",{noValidate:true,onSubmit:function(e){return e.preventDefault()},class:{"was-validated":this.formState==="validated"},ref:function(t){return e.formElement=t},onInput:function(t){return e.isSubmitDisabled=e.formHasMissingData()}},DisabledField(this.fundName.name,this.fundName.testId,this.fundName.value),DisabledField(this.fundUsi.name,this.fundUsi.testId,this.fundUsi.value),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.memberNumber.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,pattern:"[A-Za-z0-9]{4,16}","data-testid":this.memberNumber.testId,value:this.memberNumber.value,onInput:function(t){e.updateMemberNumber(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.memberNumber.errorMessage))),h("div",{class:"flex mt-3 gap-x-4 flex-col sm:flex-row"},h("div",{class:"w-full sm:w-1/2"},h("label",{class:"text-sm font-medium text-gray-700"},this.memberGivenNames.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,pattern:NAME_PATTERN,"data-testid":this.memberGivenNames.testId,value:this.memberGivenNames.value,onInput:function(t){e.updateMemberGivenNames(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.memberGivenNames.errorMessage))),h("div",{class:"w-full sm:w-1/2"},h("label",{class:"text-sm font-medium text-gray-700"},this.memberLastName.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,pattern:NAME_PATTERN,"data-testid":this.memberLastName.testId,value:this.memberLastName.value,onInput:function(t){e.updateMemberLastName(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.memberLastName.errorMessage))))))),h("div",{class:"flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4"},h("sss-button",{testid:"continue-button",class:"self-stretch",fillWidth:true,variant:"primary",disabled:this.isSubmitDisabled,promiseFn:function(){return e.handleSubmitForm()}},"Continue"),h("sss-button",{testid:"choose-another-fund-button",class:"self-stretch",fillWidth:true,variant:"secondary",promiseFn:function(){return e.handleFundNominationDeclined()}},"Choose another fund"))))};e.prototype.initialiseComponent=function(e,t){this.fundUsi=new FundUsi(t.fundDetail.fundUsi,true);this.fundName=new FundName(e,true);this.memberNumber=new MemberNumber(t.memberNumber);this.memberGivenNames=new MemberGivenNames(t.memberFirstName);this.memberLastName=new MemberLastName(t.memberFamilyName);this.isSubmitDisabled=this.formHasMissingData()};e.prototype.isFormValid=function(){return this.fundUsi.isValid&&this.fundName.isValid&&this.memberNumber.isValid&&this.memberGivenNames.isValid&&this.memberLastName.isValid};e.prototype.formHasMissingData=function(){return this.fundUsi.isEmpty||this.fundName.isEmpty||this.memberNumber.isEmpty||this.memberGivenNames.isEmpty||this.memberLastName.isEmpty};e.prototype.setModeToEdit=function(){this.mode="edit";return Promise.resolve()};e.prototype.updateMemberNumber=function(e){this.memberNumber=new MemberNumber(e.trim())};e.prototype.updateMemberGivenNames=function(e){this.memberGivenNames=new MemberGivenNames(e.trimStart())};e.prototype.updateMemberLastName=function(e){this.memberLastName=new MemberLastName(e.trim())};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.formState="validated";if(!this.isFormValid()){return[2]}if(this.mode==="edit"&&!this.formElement.checkValidity()){return[2]}navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:this.fundName.value,fundDetails:{type:"myOwnFund",fundName:this.fundName.value,fundUsi:this.fundUsi.value,memberNumber:this.memberNumber.value},handleSubmitFn:function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:e=Object.assign({fundUsi:this.fundUsi.value,memberNumber:this.memberNumber.value,memberFirstName:this.memberGivenNames.value,memberFamilyName:this.memberLastName.value,standardChoiceFormSignature:t},superSelectionAppService.promotedFundsConfig);return[4,customFundChoiceApi.submitCustomFundChoiceAsync(e)];case 1:n.sent();return[2]}}))}))}});return[2]}))}))};e.prototype.handleFundNominationDeclined=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundPrefillDeclinedDetail(this.prefill);return[4,this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(e)];case 1:t.sent();return[2,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)]}}))}))};return e}();var bsbNumbers={"01":"Australia and New Zealand Banking Group","03":"Westpac Banking Corporation",73:"Westpac Banking Corporation","06":"Commonwealth Bank of Australia",76:"Commonwealth Bank of Australia","08":"National Australia Bank",78:"National Australia Bank","09":"Reserve Bank of Australia",10:"BankSA (division of Westpac Bank)",11:"St George Bank (division of Westpac Bank)",33:"St George Bank (division of Westpac Bank)",12:"Bank of Queensland",14:"Rabobank",15:"Town & Country Bank",18:"Macquarie Bank",19:"Bank of Melbourne (division of Westpac Bank)",55:"Bank of Melbourne (division of Westpac Bank)",21:"JP Morgan Chase Bank",22:"BNP Paribas",23:"Bank of America",24:"Citibank & Citibank NA",510:"Citibank & Citibank NA",25:"BNP Paribas Securities",26:"Bankers Trust Australia (division of Westpac Bank)",29:"MUFG Bank",30:"Bankwest (division of Commonwealth Bank)",31:"Bank Australia",325:"Beyond Bank",34:"HSBC Bank Australia",985:"HSBC Bank Australia",35:"Bank of China",980:"Bank of China",40:"Commonwealth Bank of Australia",41:"Deutsche Bank",42:"Commonwealth Bank of Australia",52:"Commonwealth Bank of Australia",45:"OCBC Bank",46:"Advance Bank (division of Westpac Bank)",47:"Challenge Bank (division of Westpac Bank)",48:"Suncorp-Metway",664:"Suncorp-Metway",512:"Community First Credit Union",514:"RACQ Bank",517:"Volt Bank",533:"Bananacoast Community Credit Union",57:"Australian Settlements",61:"Adelaide Bank (division of Bendigo and Adelaide Bank)",611:"Endeavour Mutual Bank",823:"Endeavour Mutual Bank",630:"Greater Bank",637:"Greater Bank",632:"B&E",633:"Bendigo Bank",634:"Uniting Financial Services",638:"Heritage Bank",880:"Heritage Bank",639:"Home Building Society (division of Bank of Queensland)",640:"Hume Bank",641:"IMB",647:"IMB",642:"Australian Military Bank",645:"Auswide Bank",656:"Auswide Bank",646:"Maitland Mutual Building Society",650:"Newcastle Permanent Building Society",653:"Pioneer Permanent Building Society (division of Bank of Queensland)",654:"Queensland Country Credit Union",655:"The Rock",659:"G&C Mutual Bank",676:"Gateway Bank",70:"Indue",721:"Holiday Coast Credit Union",722:"Southern Cross Credit Union",723:"Bank of Heritage Isle",724:"MOVE",728:"Summerland Credit Union",777:"Police & Nurse",80:"Cuscal",670:"Cuscal",812:"Teachers Mutual Bank",813:"Capricornian",814:"Credit Union Australia",815:"Police Bank",817:"Warwick Credit Union",818:"Bank of Communications",819:"Industrial & Commercial Bank of China",824:"Sutherland Credit Union",825:"Big Sky Building Society",833:"Defence Bank",882:"Unity Bank",888:"China Construction Bank",90:"Australia Post",911:"Sumitomo Mitsui Banking Corporation",913:"State Street Bank & Trust Company",917:"Arab Bank Australia",918:"Mizuho Bank",922:"United Overseas Bank",923:"ING Bank",936:"ING Bank",931:"Mega International Commercial Bank",932:"Regional Australia Bank",939:"AMP Bank",941:"Delphi Bank (division of Bendigo and Adelaide Bank)",942:"Bank of Sydney",943:"Taiwan Business Bank",944:"Members Equity Bank",946:"UBS AG",951:"BOQ Specialist",969:"Tyro Payments"};var PrefillSMSF=function(){function e(e){registerInstance(this,e);this.mode="review";this.formState="pristine";this.isSubmitDisabled=true;this.eventTrackingService=EventTrackingService.Instance;this.createSuperFundPrefillDeclinedDetail=function(e){return{fundType:"SMSF",isAbnValid:e.fundAbn.valid,isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}};this.createSuperFundPrefillViewedDetail=function(e){return{fundType:"SMSF",isAbnValid:e.fundAbn.valid,isMemberFirstNamePresent:!isNullOrWhitespace(e.memberFirstName),isMemberLastNamePresent:!isNullOrWhitespace(e.memberFamilyName)}}}e.prototype.componentDidLoad=function(){var e=this.createSuperFundPrefillViewedDetail(this.prefill);return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(e)};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.prefill&&this.prefill.fundAbn.valid){this.initialiseComponent(this.prefill)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.PrefillInvalidSMSFPage)}return[2]}))}))};e.prototype.render=function(){var e=this;var t=[this.fundName.errorMessage,this.fundEsa.errorMessage,this.fundAddressLine1.errorMessage,this.fundAddressLine2.errorMessage,this.fundAddressCity.errorMessage,this.fundAddressPostcode.errorMessage,this.fundAddressState.errorMessage,this.memberLastName.errorMessage,this.memberGivenNames.errorMessage,this.bankAccountName.errorMessage,this.bankAccountBsb.errorMessage,this.bankAccountNumber.errorMessage].filter((function(e){return e!==null}));return h("div",null,h(Header,null),h("div",{class:"flex flex-col items-center gap-8 mt-8 sm:mt-12"},h("div",{class:"flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg"},h("div",{class:"flex flex-col items-start gap-3 self-stretch"},h("div",{class:"self-stretch text-grey-900 text-lg not-italic font-bold leading-7"},"Your self-managed super fund (SMSF) details"),h("sss-prefill-warning-box",{class:"self-stretch",notificationList:["Make sure your Self-managed super fund (SMSF) is a registered fund before completing this step."]}),this.mode==="review"&&t.length>0&&h("sss-prefill-error-box",{class:"self-stretch",notificationList:t,withHeader:true}),this.mode==="review"&&h("div",{class:"flex flex-col gap-3 self-stretch mt-4"},h("sss-prefill-display-field",{field:this.fundName}),h("sss-prefill-display-field",{field:this.fundAbn}),h("sss-prefill-display-field",{field:this.fundEsa}),h("sss-prefill-display-field",{field:this.fundAddress}),h("sss-prefill-display-field",{field:this.memberLastName}),h("sss-prefill-display-field",{field:this.memberGivenNames}),h("div",{class:"mt-4 mb-2 text-gray-900 text-lg font-bold leading-7"},"Fund bank details"),h("sss-prefill-display-field",{field:this.bankAccountName}),h("sss-prefill-display-field",{field:this.bankAccountBsb}),this.bankName.isValid&&h("sss-prefill-display-field",{field:this.bankName}),h("sss-prefill-display-field",{field:this.bankAccountNumber})),this.mode==="review"&&h("sss-button",{testid:"edit-details-button",class:"self-stretch mt-3",fillWidth:true,variant:"secondary",promiseFn:function(){return e.setModeToEdit()}},h("div",{class:"flex flex-row gap-2"},h("div",{class:"text-sm not-italic font-medium leading-4"},"Edit details"),h("div",{class:"w-4 h-4 relative"},h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"currentColor"},h("path",{d:"M11.369 2.86865C11.9939 2.24381 13.0069 2.24381 13.6318 2.86865C14.2566 3.49349 14.2566 4.50656 13.6318 5.1314L12.9974 5.76571L10.7347 3.50297L11.369 2.86865Z"}),h("path",{d:"M9.60334 4.63434L2.90039 11.3373V13.6H5.16313L11.8661 6.89708L9.60334 4.63434Z"}))))),this.mode==="edit"&&h("form",{noValidate:true,onSubmit:function(e){return e.preventDefault()},class:{"w-full":true,"was-validated":this.formState==="validated"},ref:function(t){return e.formElement=t},onInput:function(t){return e.isSubmitDisabled=e.formHasMissingData()}},h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.fundName.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.fundName.testId,value:this.fundName.value,onInput:function(t){e.updateFundName(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.fundName.errorMessage))),DisabledField(this.fundAbn.name,this.fundAbn.testId,this.fundAbn.value),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.fundEsa.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,minlength:"2","data-testid":this.fundEsa.testId,value:this.fundEsa.value,onInput:function(t){e.updateFundEsa(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.fundEsa.errorMessage))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Fund address"),h("div",{class:"mt-1 rounded-md shadow-sm -space-y-px"},h("input",{placeholder:"Address line 1",type:"text",class:Object.assign(Object.assign({},Style.Input(this.formState==="validated")),{"rounded-none rounded-t-md shadow-none border-b-0":true}),required:true,minlength:"2",name:"addressLine1",id:"addressLine1","data-testid":this.fundAddressLine1.testId,value:this.fundAddressLine1.value,onInput:function(t){e.updateAddressLine1(t.target.value)}}),h("input",{placeholder:"Address line 2 (optional)",type:"text",class:Object.assign(Object.assign({},Style.Input(this.formState==="validated")),{"rounded-none shadow-none border-b-0":true}),"data-testid":this.fundAddressLine2.testId,value:this.fundAddressLine2.value,onInput:function(t){return e.updateAddressLine2(t.target.value)}}),h("input",{placeholder:"City/suburb",type:"text",class:Object.assign(Object.assign({},Style.Input(this.formState==="validated")),{"rounded-none shadow-none border-b-0":true}),required:true,"data-testid":this.fundAddressCity.testId,value:this.fundAddressCity.value,onInput:function(t){e.updateAddressCity(t.target.value)}}),h("div",{class:"flex -space-x-px"},h("div",{class:"w-1/2 flex-1 min-w-0"},h("input",{placeholder:"Postcode",type:"text",required:true,class:Object.assign(Object.assign({},Style.Input(this.formState==="validated")),{"rounded-none rounded-bl-md shadow-none border-r-0":true}),name:"postcode",minlength:"4",maxlength:"4",pattern:"[0-9]{4}",id:"postcode","data-testid":this.fundAddressPostcode.testId,value:this.fundAddressPostcode.value,inputmode:"numeric",onInput:function(t){e.updateAddressPostcode(t.target.value)}})),h("div",{class:"flex-1 min-w-0"},h("select",{class:Object.assign(Object.assign({},Style.Input(this.formState==="validated")),{"rounded-none rounded-br-md shadow-none":true,"text-gray-500":this.formState!=="validated"}),name:"state",required:true,"data-testid":this.fundAddressState.testId,id:"state",onInput:function(t){e.updateAddressState(t.target.value)}},h("option",{disabled:true,selected:this.fundAddressState.value!==undefined,value:""},"State"),this.fundAddressState.options.map((function(t){return h("option",{value:t.value,selected:e.fundAddressState.value===t.value},t.label)})))))),this.formState==="validated"&&h("div",{class:"mt-2 text-sm text-red-600"},this.fundAddressLine1.errorMessage||this.fundAddressLine1.errorMessage||this.fundAddressCity.errorMessage||this.fundAddressPostcode.errorMessage||this.fundAddressState.errorMessage)),h("div",{class:"flex gap-x-4 flex-col sm:flex-row"},h("div",{class:"mt-3 w-full sm:w-1/2"},h("label",{class:"text-sm font-medium text-gray-700"},this.memberGivenNames.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.memberGivenNames.testId,value:this.memberGivenNames.value,onInput:function(t){e.updateMemberGivenNames(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.memberGivenNames.errorMessage))),h("div",{class:"mt-3 w-full sm:w-1/2"},h("label",{class:"text-sm font-medium text-gray-700"},this.memberLastName.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.memberLastName.testId,value:this.memberLastName.value,onInput:function(t){e.updateMemberLastName(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.memberLastName.errorMessage)))),h("div",{class:"mt-6 text-gray-900 text-lg font-bold leading-7"},"Fund bank details"),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.bankAccountName.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.bankAccountName.testId,value:this.bankAccountName.value,onInput:function(t){e.updateBankAccountName(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.bankAccountName.errorMessage))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.bankAccountBsb.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.bankAccountBsb.testId,value:this.bankAccountBsb.value,onInput:function(t){var n=t.target.value;e.updateBankName(n);e.updateBankAccountBsb(n)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.bankAccountBsb.errorMessage))),this.bankName.isValid&&DisabledField(this.bankName.name,this.bankName.testId,this.bankName.value),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},this.bankAccountNumber.name),h("div",{class:"mt-1"},h("input",{type:"text",class:Style.Input(this.formState==="validated"),required:true,"data-testid":this.bankAccountNumber.testId,value:this.bankAccountNumber.value,onInput:function(t){e.updateBankAccountNumber(t.target.value)}}),h("div",{class:"mt-2 text-sm text-red-600"},this.formState==="validated"&&this.bankAccountNumber.errorMessage)))))),h("div",{class:"flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4"},h("sss-button",{testid:"continue-button",class:"self-stretch",fillWidth:true,variant:"primary",disabled:this.isSubmitDisabled,promiseFn:function(){return e.handleSubmitForm()}},"Continue"),h("sss-button",{testid:"make-another-nomination-button",class:"self-stretch",fillWidth:true,variant:"secondary",promiseFn:function(){return e.handleFundNominationDeclined()}},"Make another nomination"))))};e.prototype.isFormValid=function(){return this.fundName.isValid&&this.fundAbn.isValid&&this.fundEsa.isValid&&this.fundAddressLine1.isValid&&this.fundAddressLine2.isValid&&this.fundAddressCity.isValid&&this.fundAddressPostcode.isValid&&this.fundAddressState.isValid&&this.memberGivenNames.isValid&&this.memberLastName.isValid&&this.bankAccountName.isValid&&this.bankAccountBsb.isValid&&this.bankAccountNumber.isValid};e.prototype.formHasMissingData=function(){return this.fundName.isEmpty||this.fundAbn.isEmpty||this.fundEsa.isEmpty||this.fundAddressLine1.isEmpty||this.fundAddressCity.isEmpty||this.fundAddressPostcode.isEmpty||this.fundAddressState.isEmpty||this.memberGivenNames.isEmpty||this.memberLastName.isEmpty||this.bankAccountName.isEmpty||this.bankAccountBsb.isEmpty||this.bankAccountNumber.isEmpty};e.prototype.setModeToEdit=function(){this.mode="edit";return Promise.resolve()};e.prototype.updateFundName=function(e){this.fundName=new SmsfFundName(e.trim())};e.prototype.updateFundEsa=function(e){this.fundEsa=new FundEsa(e.trim())};e.prototype.updateAddressLine1=function(e){this.fundAddressLine1=new FundAddressLine1(e.trim())};e.prototype.updateAddressLine2=function(e){this.fundAddressLine2=new FundAddressLine2(e.trim())};e.prototype.updateAddressCity=function(e){this.fundAddressCity=new FundAddressCity(e.trim())};e.prototype.updateAddressPostcode=function(e){this.fundAddressPostcode=new FundAddressPostcode(e.trim())};e.prototype.updateAddressState=function(e){this.fundAddressState=new FundAddressState(e.trim())};e.prototype.updateBankAccountName=function(e){this.bankAccountName=new BankAccountName(e.trim())};e.prototype.updateBankAccountBsb=function(e){this.bankAccountBsb=new BankAccountBsb(e.trim())};e.prototype.updateBankAccountNumber=function(e){this.bankAccountNumber=new BankAccountNumber(e.trim())};e.prototype.updateMemberGivenNames=function(e){this.memberGivenNames=new MemberGivenNames(e)};e.prototype.updateMemberLastName=function(e){this.memberLastName=new MemberLastName(e.trim())};e.prototype.filterDigits=function(e){return e.replace(/[^0-9]/g,"")};e.prototype.tryGetBankName=function(e){if(e==null)return null;var t=this.filterDigits(e);var n=t.substring(0,2);var r=t.substring(0,3);var i=bsbNumbers[n];var a=bsbNumbers[r];if(i)return i;if(a)return a;return null};e.prototype.updateBankName=function(e){var t=this.tryGetBankName(e);this.bankName=new BankName(t,t!=null)};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.formState="validated";if(!this.isFormValid()){return[2]}if(this.mode==="edit"&&!this.formElement.checkValidity()){return[2]}navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:"Self-managed super fund",fundDetails:{type:"smsf",fundName:this.fundName.value,fundEsa:this.fundEsa.value},handleSubmitFn:function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:e=Object.assign({smsfChoice:{abn:this.fundAbn.value,fundName:this.fundName.value,fundAddress:{addressLine1:this.fundAddressLine1.value,addressLine2:this.fundAddressLine2.value.trim()===""?null:this.fundAddressLine2.value.trim(),city:this.fundAddressCity.value,state:this.fundAddressState.value,postcode:this.fundAddressPostcode.value},bsb:this.bankAccountBsb.value,bankAccountName:this.bankAccountName.value,bankAccountNumber:this.bankAccountNumber.value,electronicServiceAddress:this.fundEsa.value,memberFirstName:this.memberGivenNames.value,memberFamilyName:this.memberLastName.value},standardChoiceFormSignature:t},superSelectionAppService.promotedFundsConfig);return[4,customFundChoiceApi.submitSelfManagedFundChoiceAsync(e)];case 1:n.sent();return[2]}}))}))}});return[2]}))}))};e.prototype.initialiseComponent=function(e){this.fundName=new SmsfFundName(e.fundName);this.fundAbn=new FundAbn(e.fundAbn.value,e.fundAbn.valid);this.fundEsa=new FundEsa(e.electronicServiceAddress);this.fundAddressLine1=new FundAddressLine1(e.addressLine1);this.fundAddressLine2=new FundAddressLine2(e.addressLine2);this.fundAddressCity=new FundAddressCity(e.addressCity);this.fundAddressPostcode=new FundAddressPostcode(e.addressPostcode);this.fundAddressState=new FundAddressState(e.addressState);this.fundAddress=new FundAddress(this.fundAddressLine1,this.fundAddressLine2,this.fundAddressCity,this.fundAddressState,this.fundAddressPostcode);this.memberGivenNames=new MemberGivenNames(e.memberFirstName);this.memberLastName=new MemberLastName(e.memberFamilyName);this.bankAccountName=new BankAccountName(e.bankAccountName);var t=this.tryGetBankName(e.bankAccountBsb);this.bankName=new BankName(t,t!=null);this.bankAccountBsb=new BankAccountBsb(e.bankAccountBsb);this.bankAccountNumber=new BankAccountNumber(e.bankAccountNumber);this.isSubmitDisabled=this.formHasMissingData()};e.prototype.handleFundNominationDeclined=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this.createSuperFundPrefillDeclinedDetail(this.prefill);return[4,this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(e)];case 1:t.sent();return[2,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)]}}))}))};return e}();var PrefillWarningBox=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){var e=this;var t=function(){return h("div",{class:"w-5 h-5"},h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},h("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.25706 3.09882C9.02167 1.73952 10.9788 1.73952 11.7434 3.09882L17.3237 13.0194C18.0736 14.3526 17.1102 15.9999 15.5805 15.9999H4.4199C2.89025 15.9999 1.92682 14.3526 2.67675 13.0194L8.25706 3.09882ZM11.0001 13C11.0001 13.5523 10.5524 14 10.0001 14C9.44784 14 9.00012 13.5523 9.00012 13C9.00012 12.4477 9.44784 12 10.0001 12C10.5524 12 11.0001 12.4477 11.0001 13ZM10.0001 5C9.44784 5 9.00012 5.44772 9.00012 6V9C9.00012 9.55228 9.44784 10 10.0001 10C10.5524 10 11.0001 9.55228 11.0001 9V6C11.0001 5.44772 10.5524 5 10.0001 5Z",fill:"#FBBF24"})))};return h("div",{class:"flex items-start self-stretch rounded-md bg-yellow-50"},h("div",{class:"w-1 self-stretch bg-yellow-400"}),h("div",{class:"flex items-start gap-3 flex-[1_0_0] p-4"},h(t,null),h("div",{class:"flex flex-col items-start gap-2 flex-[1_0_0]"},h("div",{class:"flex flex-col items-start gap-1 self-stretch"},this.notificationList.map((function(t){return h("div",{class:"flex items-start gap-[7px] self-stretch pl-0"},e.notificationList.length>1&&h("div",{class:"pt-1.5 justify-center items-center flex"},h("div",{class:"w-1.5 h-1.5 bg-yellow-700 rounded-full"})),h("div",{class:"flex-[1_0_0] text-sm not-italic font-normal leading-5 text-yellow-700"},t))}))))))};return e}();var SmsfEngagementStep=function(){function e(e){var t=this;registerInstance(this,e);this.allFormFieldsAreFilled=function(e){return e.fundName!=null&&e.fundAbn!=null&&e.fundEsa!=null&&e.addressLine1!=null&&e.city!=null&&e.state!=null&&e.postcode!=null&&e.bsb!=null&&e.bankAccountName!=null&&e.bankAccountNumber!=null&&e.memberFirstName!=null&&e.memberFamilyName!=null};this.stepContinued=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender=="smsf-engagement"))return[3,2];return[4,EventTrackingService.Instance.TrackSuperSmsfEngagementStepContinued(e.detail.reason)];case 1:t.sent();this.navigateToStandardChoice();t.label=2;case 2:return[2]}}))}))};this.subscribeToStepEvents=function(){for(var e in t.stepEventHandlers){document.addEventListener(e,t.stepEventHandlers[e])}};this.unSubscribeFromStepEvents=function(){for(var e in t.stepEventHandlers){document.removeEventListener(e,t.stepEventHandlers[e])}};this.stepEventHandlers={continue:this.stepContinued.bind(this)}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!(superSelectionAppService.isSmsfCustomStepEnabled&&superSelectionAppService.isUsingSuperCampaign&&this.allFormFieldsAreFilled(state.selfManagedFundForm)&&Option.isSome(superSelectionAppService.backendUrl)&&Option.isSome(superSelectionAppService.state.jwt)))return[3,2];this.backendUrl=superSelectionAppService.backendUrl.value;this.accessToken=superSelectionAppService.state.jwt.value;this.accountId=superSelectionAppService.accountIdOrDefault;this.partnerId=superSelectionAppService.partnerIdOrDefault;this.initialiseFormState(state.selfManagedFundForm);this.unSubscribeFromStepEvents();this.subscribeToStepEvents();superSelectionAppService.hideFooterSection=true;return[4,EventTrackingService.Instance.TrackSuperSmsfEngagementStepActivationSucceeded()];case 1:e.sent();return[3,3];case 2:navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.SelfManagedFund);e.label=3;case 3:return[2]}}))}))};e.prototype.disconnectedCallback=function(){this.unSubscribeFromStepEvents();superSelectionAppService.hideFooterSection=false};e.prototype.render=function(){return h(Host,null,h("apollo-super-smsf-engagement",{"backend-url":this.backendUrl,"access-token":this.accessToken,"account-id":this.accountId,"partner-id":this.partnerId}))};e.prototype.navigateToStandardChoice=function(){var e=this;navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:"Self-managed super fund",fundDetails:{type:"smsf",fundName:this.fundName,fundEsa:this.fundEsa},handleSubmitFn:function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:e=Object.assign({smsfChoice:{abn:this.fundAbn,fundName:this.fundName,fundAddress:{addressLine1:this.fundAddress.addressLine1,addressLine2:this.fundAddress.addressLine2,city:this.fundAddress.city,state:this.fundAddress.state,postcode:this.fundAddress.postcode},bsb:this.bsb,bankAccountName:this.bankAccountName,bankAccountNumber:this.bankAccountNumber,electronicServiceAddress:this.fundEsa,memberFirstName:this.memberFirstName,memberFamilyName:this.memberFamilyName},standardChoiceFormSignature:t},superSelectionAppService.promotedFundsConfig);return[4,customFundChoiceApi.submitSelfManagedFundChoiceAsync(e)];case 1:n.sent();return[2]}}))}))}})};e.prototype.initialiseFormState=function(e){this.fundName=e.fundName;this.fundAbn=e.fundAbn;this.fundEsa=e.fundEsa;this.fundAddress={addressLine1:e.addressLine1,addressLine2:e.addressLine2,city:e.city,state:e.state,postcode:e.postcode};this.bsb=e.bsb;this.bankAccountName=e.bankAccountName;this.bankAccountNumber=e.bankAccountNumber;this.memberFirstName=e.memberFirstName;this.memberFamilyName=e.memberFamilyName};return e}();injectHistory(SmsfEngagementStep);var StandardChoiceFormInputDefaultFund=function(){function e(e){registerInstance(this,e);this.standardChoiceFormSignature="";this.isSubmitDisabled=true;this.eventTrackingService=EventTrackingService.Instance;this.ignorePopState=function(){return window.history.pushState(null,"",null)}}e.prototype.connectedCallback=function(){this.ignorePopState();window.addEventListener("popstate",this.ignorePopState)};e.prototype.disconnectedCallback=function(){window.removeEventListener("popstate",this.ignorePopState)};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"text-2xl sm:text-3xl font-bold text-center"},"Confirm your super choice"),h("div",{class:"sm:text-lg text-gray-600 max-w-800 mt-4 text-center leading-7 sm:leading-8"},"Your authorisation is required to complete your super choice by signing the standard choice form, which informs your employer of your choice of fund."),h("div",{class:"flex justify-center mt-8 sm:mt-12"},h("div",{class:"max-w-560"},h("div",{class:"p-4 sm:p-6 border shadow-sm rounded-lg flex flex-col sm:flex-row"},this.renderLogo(),h("div",{class:"flex justify-between w-full"},h("div",null,h("div",{class:"text-xs font-semibold text-gray-500 uppercase"},"Nominated fund"),h("div",{class:"text-sm mt-2"},state$1.fundName)),h("div",{class:"grid content-center ml-4"},h("sss-button",{testid:"change-fund-button",size:"xs",variant:"secondary",promiseFn:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.trackChangeRequestedAsync()];case 1:e.sent();navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage);return[2]}}))}))}},"Change")))),h("div",{class:"mt-4 p-4 sm:p-6 border shadow-sm rounded-lg"},h("div",{class:"sm:text-lg font-bold"},"Superannuation Standard Choice Form"),h("div",{class:"bg-blue-50 border-l-4 border-blue-400 p-4 mt-3"},h("div",{class:"flex"},h("div",{class:"flex-shrink-0"},h("img",{class:"h-5 w-5",src:getAssetPath("assets/icon-information-circle.svg")})),h("div",{class:"ml-2"},h("p",{class:"text-sm text-blue-800 leading-5"},"Applying your full name in the text field below is the same as applying your written signature and is legally binding.")))),h("form",{noValidate:true,onSubmit:function(e){return e.preventDefault()},class:{"mt-3":true,"was-validated":this.formState==="validated"},ref:function(t){return e.formElement=t},onInput:function(t){return e.isSubmitDisabled=!e.formElement.checkValidity()}},h("label",{class:"text-sm font-medium text-gray-700"},"Type your full name"),h("input",{"data-testid":"standard-choice-form-signature-input",type:"text",autocomplete:"off",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-focus w-full text-base sm:text-sm border-gray-300 rounded-md mt-1":true,"invalid:border-red-300 invalid:text-red-900 invalid:focus:ring-red-500 invalid:focus:border-red-500":this.formState==="validated"},required:true,minlength:"2",name:"standardChoiceFormSignature",id:"standardChoiceFormSignature",value:this.standardChoiceFormSignature,onInput:function(t){return e.standardChoiceFormSignature=t.target.value}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Type your full name"),h("div",{class:"mt-6"},h("sss-button",{testid:"confirm-and-continue-button",fillWidth:true,promiseFn:function(){return e.handleSubmitForm()},disabled:this.isSubmitDisabled},"Confirm and continue")))))))};e.prototype.renderLogo=function(){return};e.prototype.trackChangeRequestedAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:e={promotedFundsShown:superSelectionAppService.promotedFunds,defaultFundUsiSet:toUndefined(superSelectionAppService.defaultFundUsi)};t=state$1.fundDetails.type;switch(t){case"default":return[3,1];case"myOwnFund":return[3,3];case"smsf":return[3,5];case"promoted":return[3,7];case"promotedDefault":return[3,9];case"promotedDefaultWithJoin":return[3,11];case"null":return[3,13]}return[3,14];case 1:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({DefaultFund:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 2:n.sent();return[3,14];case 3:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({MyOwnFund:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 4:n.sent();return[3,14];case 5:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({Smsf:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 6:n.sent();return[3,14];case 7:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({PromotedFund:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 8:n.sent();return[3,14];case 9:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({PromotedDefaultFund:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 10:n.sent();return[3,14];case 11:return[4,this.eventTrackingService.TrackSuperFundDetailChangeRequestedAsync({PromotedDefaultFundWithJoin:Object.assign(Object.assign({},state$1.fundDetails),e)})];case 12:n.sent();return[3,14];case 13:throw"standardChoiceFormState.fundDetails was not set";case 14:return[2]}}))}))};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.formState="validated";if(!this.formElement.checkValidity())return[3,2];return[4,state$1.handleSubmitFn(this.standardChoiceFormSignature.trim())];case 1:e.sent();superSelectionAppService.markSuperSelectionAsSubmitted();e.label=2;case 2:return[2]}}))}))};return e}();var Success=function(){function e(e){registerInstance(this,e);this.ignorePopState=function(){return window.history.pushState(null,"",null)}}e.prototype.connectedCallback=function(){this.ignorePopState();window.addEventListener("popstate",this.ignorePopState)};e.prototype.disconnectedCallback=function(){window.removeEventListener("popstate",this.ignorePopState)};e.prototype.render=function(){var e=function(){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:"fill-primary-base"},h("path",{d:"M443.3 100.7C449.6 106.9 449.6 117.1 443.3 123.3L171.3 395.3C165.1 401.6 154.9 401.6 148.7 395.3L4.686 251.3C-1.562 245.1-1.562 234.9 4.686 228.7C10.93 222.4 21.06 222.4 27.31 228.7L160 361.4L420.7 100.7C426.9 94.44 437.1 94.44 443.3 100.7H443.3z"}))};return h(Host,{class:"text-center"},h("div",{class:"flex justify-center"},h("div",{class:"relative"},h("div",{class:"h-20 w-20 rounded-full bg-primary-base opacity-10"}),h("div",{class:"h-8 w-8 absolute top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2"},h(e,null)))),h("h3",{class:"text-2xl leading-8 font-bold mt-4"},"Your super choice has been submitted"),h("p",{class:"mt-4 text-center text-gray-600 leading-7 max-w-560 mx-auto"},"Your superannuation details have been updated successfully and will be submitted to your employer."),h("div",{class:"flex justify-center mt-8"},h("div",{class:"max-w-[200px] w-full"},h("sss-button",{testid:"continue-button",size:"xl",fillWidth:true,onClick:this.handleContinueButtonClick},h("span",null,"Continue")))))};e.prototype.handleContinueButtonClick=function(e){superSelectionAppService.completeSuperSelectionFlow()};return e}();var MiscService=function(){function e(){}e.prototype.trackClickPromotedTileAsync=function(e){return superSelectionApi.clickPromotedTileAsync(e)};return e}();var miscService=new MiscService;var getSuperCampaignState=function(){if(superSelectionAppService.superCampaignState!=undefined)return superSelectionAppService.superCampaignState;throw new Error("Super campaign state has not been initialized")};var fundTileClicked=function(e){var t=e.sender,n=e.placementId,r=e.fundId,i=e.fundUsi,a=e.fundName,s=e.fundType,o=e.sourceOfJoin,u=e.isDefaultExclusive;return __awaiter(void 0,void 0,void 0,(function(){var e,l,c,d,f;return __generator(this,(function(p){switch(p.label){case 0:if(!(t==="super-campaign"||t==="featured-funds"))return[3,6];e=getSuperCampaignState().PromotedFundIds;l=Option.toUndefined(superSelectionAppService.defaultFundUsi);d=(c=Promise).all;if(!(s==="promoted-default"))return[3,2];return[4,EventTrackingService.Instance.TrackPromotedDefaultSuperFundDetailViewedAsync({fundUsi:i!==null&&i!==void 0?i:"",fundName:a,promotedFundId:r,promotedFundsShown:e,defaultFundUsiSet:l,superCampaignEnabled:true,placementId:n,sourceOfJoin:o,isDefaultExclusive:u})];case 1:f=p.sent();return[3,4];case 2:return[4,EventTrackingService.Instance.TrackPromotedSuperFundDetailViewedAsync({fundUsi:i!==null&&i!==void 0?i:undefined,fundName:a,promotedFundId:r,promotedFundsShown:e,defaultFundUsiSet:l,superCampaignEnabled:true,placementId:n,sourceOfJoin:o,isDefaultExclusive:u})];case 3:f=p.sent();p.label=4;case 4:return[4,d.apply(c,[[f,miscService.trackClickPromotedTileAsync(s==="promoted-default"?{promotedDefault:{fundId:r,placementId:n}}:{promoted:{fundId:r,placementId:n}})]])];case 5:p.sent();p.label=6;case 6:return[2]}}))}))};var strShimFunction="function";var strShimObject="object";var strShimUndefined="undefined";var strShimPrototype="prototype";var strShimHasOwnProperty="hasOwnProperty";function getGlobal(){if(typeof globalThis!==strShimUndefined&&globalThis){return globalThis}if(typeof self!==strShimUndefined&&self){return self}if(typeof window!==strShimUndefined&&window){return window}if(typeof global!==strShimUndefined&&global){return global}return null}function objCreateFn(e){var t=Object["create"];if(t){return t(e)}if(e==null){return{}}var n=typeof e;if(n!==strShimObject&&n!==strShimFunction){throw new TypeError("Object prototype may only be an Object:"+e)}function r(){}r[strShimPrototype]=e;return new r}function __assignFn(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t){if(Object[strShimPrototype][strShimHasOwnProperty].call(t,i)){e[i]=t[i]}}}return e}var __extendStaticsFn=function(e,t){__extendStaticsFn=Object["setPrototypeOf"]||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t){if(t[strShimHasOwnProperty](n)){e[n]=t[n]}}};return __extendStaticsFn(e,t)};function __extendsFn(e,t){__extendStaticsFn(e,t);function n(){this.constructor=e}e[strShimPrototype]=t===null?objCreateFn(t):(n[strShimPrototype]=t[strShimPrototype],new n)}var globalObj=getGlobal()||{};(function(e,t,n){if(!e.__assign){e.__assign=Object.assign||t}if(!e.__extends){e.__extends=n}})(globalObj,__assignFn,__extendsFn);if(!__assign){__assign=globalObj.__assign}if(!__extends){__extends=globalObj.__extends}var EventsDiscardedReason={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5};var strUndefined=strShimUndefined;var strObject=strShimObject;var strPrototype=strShimPrototype;var strFunction=strShimFunction;var strWindow="window";var strDocument="document";var strNavigator="navigator";var strHistory="history";var strLocation="location";var strConsole="console";var strPerformance="performance";var strJSON="JSON";var strCrypto="crypto";var strMsCrypto="msCrypto";var strReactNative="ReactNative";var getGlobal$1=getGlobal;function getGlobalInst(e){var t=getGlobal$1();if(t&&t[e]){return t[e]}if(e===strWindow&&hasWindow()){return window}return null}function hasWindow(){return Boolean(typeof window===strObject&&window)}function getWindow(){if(hasWindow()){return window}return getGlobalInst(strWindow)}function hasDocument(){return Boolean(typeof document===strObject&&document)}function getDocument(){if(hasDocument()){return document}return getGlobalInst(strDocument)}function hasNavigator(){return Boolean(typeof navigator===strObject&&navigator)}function getNavigator(){if(hasNavigator()){return navigator}return getGlobalInst(strNavigator)}function hasHistory(){return Boolean(typeof history===strObject&&history)}function getHistory(){if(hasHistory()){return history}return getGlobalInst(strHistory)}function getLocation(){if(typeof location===strObject&&location){return location}return getGlobalInst(strLocation)}function getConsole(){if(typeof console!==strUndefined){return console}return getGlobalInst(strConsole)}function getPerformance(){return getGlobalInst(strPerformance)}function hasJSON(){return Boolean(typeof JSON===strObject&&JSON||getGlobalInst(strJSON)!==null)}function getJSON(){if(hasJSON()){return JSON||getGlobalInst(strJSON)}return null}function getCrypto(){return getGlobalInst(strCrypto)}function getMsCrypto(){return getGlobalInst(strMsCrypto)}function isReactNative(){var e=getNavigator();if(e&&e.product){return e.product===strReactNative}return false}var strOnPrefix="on";var strAttachEvent="attachEvent";var strAddEventHelper="addEventListener";var strDetachEvent="detachEvent";var strRemoveEventListener="removeEventListener";var UInt32Mask=4294967296;var MaxUInt32=4294967295;var _isTrident=null;var _mwcSeeded=false;var _mwcW=123456789;var _mwcZ=987654321;function _mwcSeed(e){if(e<0){e>>>=0}_mwcW=123456789+e&MaxUInt32;_mwcZ=987654321-e&MaxUInt32;_mwcSeeded=true}function _autoSeedMwc(){_mwcSeed(Math.random()*UInt32Mask^(new Date).getTime())}function _isTypeof(e,t){return typeof e===t}function _isUndefined(e){return _isTypeof(e,strShimUndefined)||e===undefined}function _isNullOrUndefined(e){return _isUndefined(e)||e===null}function _hasOwnProperty(e,t){return e&&Object[strShimPrototype].hasOwnProperty.call(e,t)}function _isObject(e){return _isTypeof(e,strShimObject)}function _isFunction(e){return _isTypeof(e,strShimFunction)}function _attachEvent(e,t,n,r){if(r===void 0){r=false}var i=false;if(!_isNullOrUndefined(e)){try{if(!_isNullOrUndefined(e[strAddEventHelper])){e[strAddEventHelper](t,n,r);i=true}else if(!_isNullOrUndefined(e[strAttachEvent])){e[strAttachEvent](strOnPrefix+t,n);i=true}}catch(e){}}return i}function _detachEvent(e,t,n,r){if(r===void 0){r=false}if(!_isNullOrUndefined(e)){try{if(!_isNullOrUndefined(e[strRemoveEventListener])){e[strRemoveEventListener](t,n,r)}else if(!_isNullOrUndefined(e[strDetachEvent])){e[strDetachEvent](strOnPrefix+t,n)}}catch(e){}}}function normalizeJsName(e){var t=e;var n=/([^\w\d_$])/g;if(n.test(e)){t=e.replace(n,"_")}return t}function objForEachKey(e,t){if(e&&_isObject(e)){for(var n in e){if(_hasOwnProperty(e,n)){t.call(e,n,e[n])}}}}var CoreUtils=function(){function e(){}e.isDate=function(e){return Object[strShimPrototype].toString.call(e)==="[object Date]"};e.isArray=function(e){return Object[strShimPrototype].toString.call(e)==="[object Array]"};e.isError=function(e){return Object[strShimPrototype].toString.call(e)==="[object Error]"};e.isString=function(e){return _isTypeof(e,"string")};e.isNumber=function(e){return _isTypeof(e,"number")};e.isBoolean=function(e){return _isTypeof(e,"boolean")};e.disableCookies=function(){e._canUseCookies=false};e.newGuid=function(){function t(){return e.randomValue(15)}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(GuidRegex,(function(e){var n=t()|0,r=e==="x"?n:n&3|8;return r.toString(16)}))};e.toISOString=function(t){if(e.isDate(t)){var n=function(e){var t=String(e);if(t.length===1){t="0"+t}return t};return t.getUTCFullYear()+"-"+n(t.getUTCMonth()+1)+"-"+n(t.getUTCDate())+"T"+n(t.getUTCHours())+":"+n(t.getUTCMinutes())+":"+n(t.getUTCSeconds())+"."+String((t.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}};e.arrForEach=function(e,t,n){var r=e.length;for(var i=0;i<r;i++){if(i in e){t.call(n||e,e[i],i,e)}}};e.arrIndexOf=function(e,t,n){var r=e.length;var i=n||0;for(var a=Math.max(i>=0?i:r-Math.abs(i),0);a<r;a++){if(a in e&&e[a]===t){return a}}return-1};e.arrMap=function(e,t,n){var r=e.length;var i=n||e;var a=new Array(r);for(var s=0;s<r;s++){if(s in e){a[s]=t.call(i,e[s],e)}}return a};e.arrReduce=function(e,t,n){var r=e.length;var i=0;var a;if(arguments.length>=3){a=arguments[2]}else{while(i<r&&!(i in e)){i++}a=e[i++]}while(i<r){if(i in e){a=t(a,e[i],i,e)}i++}return a};e.strTrim=function(t){if(!e.isString(t)){return t}return t.replace(/^\s+|\s+$/g,"")};e.objKeys=function(e){var t=!{toString:null}.propertyIsEnumerable("toString");if(!_isFunction(e)&&(!_isObject(e)||e===null)){throw new TypeError("objKeys called on non-object")}var n=[];for(var r in e){if(_hasOwnProperty(e,r)){n.push(r)}}if(t){var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var a=i.length;for(var s=0;s<a;s++){if(_hasOwnProperty(e,i[s])){n.push(i[s])}}}return n};e.objDefineAccessors=function(e,t,n,r){var i=Object["defineProperty"];if(i){try{var a={enumerable:true,configurable:true};if(n){a.get=n}if(r){a.set=r}i(e,t,a);return true}catch(e){}}return false};e.addEventHandler=function(e,t){var n=false;var r=getWindow();if(r){n=_attachEvent(r,e,t);n=_attachEvent(r["body"],e,t)||n}var i=getDocument();if(i){n=EventHelper.Attach(i,e,t)||n}return n};e.dateNow=function(){var e=Date;if(e.now){return e.now()}return(new e).getTime()};e.perfNow=function(){var t=getPerformance();if(t&&t.now){return t.now()}return e.dateNow()};e.newId=function(t){if(t===void 0){t=22}var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var r=e.random32()>>>0;var i=0;var a="";while(a.length<t){i++;a+=n.charAt(r&63);r>>>=6;if(i===5){r=(e.random32()<<2&4294967295|r&3)>>>0;i=0}}return a};e.isIE=function(){if(_isTrident===null){var e=getNavigator()||{};var t=(e.userAgent||"").toLowerCase();_isTrident=t.indexOf("msie")!==-1||t.indexOf("trident/")!==-1}return _isTrident};e.randomValue=function(t){if(t>0){return Math.floor(e.random32()/MaxUInt32*(t+1))>>>0}return 0};e.random32=function(t){var n;var r=getCrypto()||getMsCrypto();if(r&&r.getRandomValues){n=r.getRandomValues(new Uint32Array(1))[0]&MaxUInt32}else if(e.isIE()){if(!_mwcSeeded){_autoSeedMwc()}n=e.mwcRandom32()&MaxUInt32}else{n=Math.floor(UInt32Mask*Math.random()|0)}if(!t){n>>>=0}return n};e.mwcRandomSeed=function(e){if(!e){_autoSeedMwc()}else{_mwcSeed(e)}};e.mwcRandom32=function(e){_mwcZ=36969*(_mwcZ&65535)+(_mwcZ>>16)&MaxUInt32;_mwcW=18e3*(_mwcW&65535)+(_mwcW>>16)&MaxUInt32;var t=(_mwcZ<<16)+(_mwcW&65535)>>>0&MaxUInt32|0;if(!e){t>>>=0}return t};e.generateW3CId=function(){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];var n="",r;for(var i=0;i<4;i++){r=e.random32();n+=t[r&15]+t[r>>4&15]+t[r>>8&15]+t[r>>12&15]+t[r>>16&15]+t[r>>20&15]+t[r>>24&15]+t[r>>28&15]}var a=t[8+(e.random32()&3)|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+a+n.substr(16,3)+n.substr(19,12)};e.isTypeof=_isTypeof;e.isUndefined=_isUndefined;e.isNullOrUndefined=_isNullOrUndefined;e.hasOwnProperty=_hasOwnProperty;e.isFunction=_isFunction;e.isObject=_isObject;e.objCreate=objCreateFn;return e}();var GuidRegex=/[xy]/g;var EventHelper=function(){function e(){}e.Attach=_attachEvent;e.AttachEvent=_attachEvent;e.Detach=_detachEvent;e.DetachEvent=_detachEvent;return e}();var LoggingSeverity;(function(e){e[e["CRITICAL"]=1]="CRITICAL";e[e["WARNING"]=2]="WARNING"})(LoggingSeverity||(LoggingSeverity={}));var _InternalMessageId={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103};
2
2
  /*!
3
3
  * Microsoft Dynamic Proto Utility, 1.1.0
4
4
  * Copyright (c) Microsoft and contributors. All rights reserved.
@@ -50,11 +50,11 @@ var __extends=this&&this.__extends||function(){var e=function(t,n){e=Object.setP
50
50
  /*!
51
51
  * Application Insights JavaScript SDK - Channel, 2.5.10
52
52
  * Copyright (c) Microsoft and contributors. All rights reserved.
53
- */function _getResponseText(e){try{return e.responseText}catch(e){}return null}var Sender=function(e){__extends(t,e);function t(){var n=e.call(this)||this;n.priority=1001;n.identifier=BreezeChannelIdentifier;n._XMLHttpRequestSupported=false;var r;var i;var a;var s;dynamicProto(t,n,(function(e,o){function u(){throw new Error("Method not implemented.")}e.pause=u;e.resume=u;e.flush=function(){try{e.triggerSend(true,null,1)}catch(t){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.FlushFailed,"flush failed, telemetry will not be collected: "+Util.getExceptionName(t),{exception:Util.dump(t)})}};e.onunloadFlush=function(){if((e._senderConfig.onunloadDisableBeacon()===false||e._senderConfig.isBeaconApiDisabled()===false)&&Util.IsBeaconApiSupported()){try{e.triggerSend(true,c,2)}catch(t){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.FailedToSendQueuedTelemetry,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+Util.getExceptionName(t),{exception:Util.dump(t)})}}else{e.flush()}};e.teardown=u;e.initialize=function(n,a,u,l){o.initialize(n,a,u,l);var f=e._getTelCtx();var p=e.identifier;s=new Serializer(a.logger);r=0;i=null;e._sender=null;var h=t._getDefaultAppInsightsChannelConfig();e._senderConfig=t._getEmptyAppInsightsChannelConfig();objForEachKey(h,(function(t,n){e._senderConfig[t]=function(){return f.getConfig(p,t,n())}}));e._buffer=e._senderConfig.enableSessionStorageBuffer()&&Util.canUseSessionStorage()?new SessionStorageSendBuffer(e.diagLog(),e._senderConfig):new ArraySendBuffer(e._senderConfig);e._sample=new Sample(e._senderConfig.samplingPercentage(),e.diagLog());if(!x(n)){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.InvalidInstrumentationKey,"Invalid Instrumentation key "+n.instrumentationKey)}if(!e._senderConfig.isBeaconApiDisabled()&&Util.IsBeaconApiSupported()){e._sender=c}else{if(typeof XMLHttpRequest!==undefined){var m=getGlobalInst("XMLHttpRequest");if(m){var v=new m;if("withCredentials"in v){e._sender=d;e._XMLHttpRequestSupported=true}else if(typeof XDomainRequest!==undefined){e._sender=y}}}}};e.processTelemetry=function(n,r){r=e._getTelCtx(r);try{if(e._senderConfig.disableTelemetry()){return}if(!n){r.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.CannotSendEmptyTelemetry,"Cannot send empty telemetry");return}if(n.baseData&&!n.baseType){r.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.InvalidEvent,"Cannot send telemetry without baseData and baseType");return}if(!n.baseType){n.baseType="EventData"}if(!e._sender){r.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.SenderNotInitialized,"Sender was not initialized");return}if(!l(n)){r.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TelemetrySampledAndNotSent,"Telemetry item was sampled out and not sent",{SampleRate:e._sample.sampleRate});return}else{n[SampleRate]=e._sample.sampleRate}var i=t.constructEnvelope(n,e._senderConfig.instrumentationKey(),r.diagLog());if(!i){r.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.CreateEnvelopeError,"Unable to create an AppInsights envelope");return}var a=false;if(n.tags&&n.tags[ProcessLegacy]){CoreUtils.arrForEach(n.tags[ProcessLegacy],(function(e){try{if(e&&e(i)===false){a=true;r.diagLog().warnToConsole("Telemetry processor check returns false")}}catch(e){r.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+Util.getExceptionName(e),{exception:Util.dump(e)},true)}}));delete n.tags[ProcessLegacy]}if(a){return}var o=s.serialize(i);var u=e._buffer.getItems();var c=e._buffer.batchPayloads(u);if(c&&c.length+o.length>e._senderConfig.maxBatchSizeInBytes()){e.triggerSend(true,null,10)}e._buffer.enqueue(o);m()}catch(e){r.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.FailedAddingTelemetryToBuffer,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Util.getExceptionName(e),{exception:Util.dump(e)})}e.processNext(n,r)};e._xhrReadyStateChange=function(t,n,i){if(t.readyState===4){var a=null;if(!e._appId){a=f(_getResponseText(t)||t.response);if(a&&a.appId){e._appId=a.appId}}if((t.status<200||t.status>=300)&&t.status!==0){if(!e._senderConfig.isRetryDisabled()&&v(t.status)){p(n);e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TransmissionFailed,". "+"Response code "+t.status+". Will retry to send "+n.length+" items.")}else{e._onError(n,g(t))}}else if(Offline.isOffline()){if(!e._senderConfig.isRetryDisabled()){var s=10;p(n,s);e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TransmissionFailed,". Offline - Response Code: "+t.status+". Offline status: "+Offline.isOffline()+". Will retry to send "+n.length+" items.")}}else{if(t.status===206){if(!a){a=f(_getResponseText(t)||t.response)}if(a&&!e._senderConfig.isRetryDisabled()){e._onPartialSuccess(n,a)}else{e._onError(n,g(t))}}else{r=0;e._onSuccess(n,i)}}}};e.triggerSend=function(t,r,s){if(t===void 0){t=true}try{if(!e._senderConfig.disableTelemetry()){if(e._buffer.count()>0){var o=e._buffer.getItems();C(s||0,t);if(r){r.call(n,o,t)}else{e._sender(o,t)}}}else{e._buffer.clear()}clearTimeout(a);a=null;i=null}catch(t){var u=Util.getIEVersion();if(!u||u>9){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TransmissionFailed,"Telemetry transmission failed, some telemetry will be lost: "+Util.getExceptionName(t),{exception:Util.dump(t)})}}};e._onError=function(t,n,r){e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.OnError,"Failed to send telemetry.",{message:n});e._buffer.clearSent(t)};e._onPartialSuccess=function(t,n){var r=[];var i=[];var a=n.errors.reverse();for(var s=0,o=a;s<o.length;s++){var u=o[s];var l=t.splice(u.index,1)[0];if(v(u.statusCode)){i.push(l)}else{r.push(l)}}if(t.length>0){e._onSuccess(t,n.itemsAccepted)}if(r.length>0){e._onError(r,g(null,["partial success",n.itemsAccepted,"of",n.itemsReceived].join(" ")))}if(i.length>0){p(i);e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TransmissionFailed,"Partial success. "+"Delivered: "+t.length+", Failed: "+r.length+". Will retry to send "+i.length+" our of "+n.itemsReceived+" items")}};e._onSuccess=function(t,n){e._buffer.clearSent(t)};e._xdrOnLoad=function(t,n){var i=_getResponseText(t);if(t&&(i+""==="200"||i==="")){r=0;e._onSuccess(n,0)}else{var a=f(i);if(a&&a.itemsReceived&&a.itemsReceived>a.itemsAccepted&&!e._senderConfig.isRetryDisabled()){e._onPartialSuccess(n,a)}else{e._onError(n,S(t))}}};function l(t){return e._sample.isSampledIn(t)}function c(t,n){var r=e._senderConfig.endpointUrl();var i=e._buffer.batchPayloads(t);var a=new Blob([i],{type:"text/plain;charset=UTF-8"});var s=getNavigator().sendBeacon(r,a);if(s){e._buffer.markAsSent(t);e._onSuccess(t,t.length)}else{d(t,true);e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TransmissionFailed,". "+"Failed to send telemetry with Beacon API, retried with xhrSender.")}}function d(t,n){var r=new XMLHttpRequest;var i=e._senderConfig.endpointUrl();try{r[DisabledPropertyName]=true}catch(e){}r.open("POST",i,n);r.setRequestHeader("Content-type","application/json");if(Util.isInternalApplicationInsightsEndpoint(i)){r.setRequestHeader(RequestHeaders.sdkContextHeader,RequestHeaders.sdkContextHeaderAppIdRequest)}r.onreadystatechange=function(){return e._xhrReadyStateChange(r,t,t.length)};r.onerror=function(n){return e._onError(t,g(r),n)};var a=e._buffer.batchPayloads(t);r.send(a);e._buffer.markAsSent(t)}function f(t){try{if(t&&t!==""){var n=getJSON().parse(t);if(n&&n.itemsReceived&&n.itemsReceived>=n.itemsAccepted&&n.itemsReceived-n.itemsAccepted===n.errors.length){return n}}}catch(n){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.InvalidBackendResponse,"Cannot parse the response. "+Util.getExceptionName(n),{response:t})}return null}function p(t,n){if(n===void 0){n=1}if(!t||t.length===0){return}e._buffer.clearSent(t);r++;for(var i=0,a=t;i<a.length;i++){var s=a[i];e._buffer.enqueue(s)}h(n);m()}function h(e){var t=10;var n;if(r<=1){n=t}else{var a=(Math.pow(2,r)-1)/2;var s=Math.floor(Math.random()*a*t)+1;s=e*s;n=Math.max(Math.min(s,3600),t)}var o=CoreUtils.dateNow()+n*1e3;i=o}function m(){if(!a){var t=i?Math.max(0,i-CoreUtils.dateNow()):0;var n=Math.max(e._senderConfig.maxBatchInterval(),t);a=setTimeout((function(){e.triggerSend(true,null,1)}),n)}}function v(e){return e===408||e===429||e===500||e===503}function g(e,t){if(e){return"XMLHttpRequest,Status:"+e.status+",Response:"+_getResponseText(e)||e.response||""}return t}function y(t,n){var r=getWindow();var i=new XDomainRequest;i.onload=function(){return e._xdrOnLoad(i,t)};i.onerror=function(n){return e._onError(t,S(i),n)};var a=r&&r.location&&r.location.protocol||"";if(e._senderConfig.endpointUrl().lastIndexOf(a,0)!==0){e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TransmissionFailed,". "+"Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.");e._buffer.clear();return}var s=e._senderConfig.endpointUrl().replace(/^(https?:)/,"");i.open("POST",s);var o=e._buffer.batchPayloads(t);i.send(o);e._buffer.markAsSent(t)}function S(e,t){if(e){return"XDomainRequest,Response:"+_getResponseText(e)||""}return t}function b(){var t="getNotifyMgr";if(e.core[t]){return e.core[t]()}return e.core["_notificationManager"]}function C(t,n){var r=b();if(r&&r.eventsSendRequest){try{r.eventsSendRequest(t,n)}catch(t){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.NotificationException,"send request notification failed: "+Util.getExceptionName(t),{exception:Util.dump(t)})}}}function x(e){var t=CoreUtils.isNullOrUndefined(e.disableInstrumentaionKeyValidation)?false:e.disableInstrumentaionKeyValidation;if(t){return true}var n="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$";var r=new RegExp(n);return r.test(e.instrumentationKey)}}));return n}t.constructEnvelope=function(e,t,n){var r;if(t!==e.iKey&&!CoreUtils.isNullOrUndefined(t)){r=__assign({},e,{iKey:t})}else{r=e}switch(r.baseType){case Event$1.dataType:return EventEnvelopeCreator.EventEnvelopeCreator.Create(n,r);case Trace.dataType:return TraceEnvelopeCreator.TraceEnvelopeCreator.Create(n,r);case PageView.dataType:return PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(n,r);case PageViewPerformance.dataType:return PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(n,r);case Exception.dataType:return ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(n,r);case Metric.dataType:return MetricEnvelopeCreator.MetricEnvelopeCreator.Create(n,r);case RemoteDependencyData$1.dataType:return DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(n,r);default:return EventEnvelopeCreator.EventEnvelopeCreator.Create(n,r)}};t._getDefaultAppInsightsChannelConfig=function(){return{endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return false},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return false},enableSessionStorageBuffer:function(){return true},isRetryDisabled:function(){return false},isBeaconApiDisabled:function(){return true},onunloadDisableBeacon:function(){return false},instrumentationKey:function(){return undefined},namePrefix:function(){return undefined},samplingPercentage:function(){return 100}}};t._getEmptyAppInsightsChannelConfig=function(){return{endpointUrl:undefined,emitLineDelimitedJson:undefined,maxBatchInterval:undefined,maxBatchSizeInBytes:undefined,disableTelemetry:undefined,enableSessionStorageBuffer:undefined,isRetryDisabled:undefined,isBeaconApiDisabled:undefined,onunloadDisableBeacon:undefined,instrumentationKey:undefined,namePrefix:undefined,samplingPercentage:undefined}};return t}(BaseTelemetryPlugin);var Session=function(){function e(){}return e}();var _SessionManager=function(){function e(t,n){var r=this;if(CoreUtils.isNullOrUndefined(n)){this._logger=new DiagnosticLogger}else{this._logger=n}if(!t){t={}}if(!(typeof t.sessionExpirationMs==="function")){t.sessionExpirationMs=function(){return e.acquisitionSpan}}if(!(typeof t.sessionRenewalMs==="function")){t.sessionRenewalMs=function(){return e.renewalSpan}}this.config=t;this._storageNamePrefix=function(){return r.config.namePrefix&&r.config.namePrefix()?e.cookieNameConst+r.config.namePrefix():e.cookieNameConst};this.automaticSession=new Session}e.prototype.update=function(){if(!this.automaticSession.id){this.initializeAutomaticSession()}var t=(new Date).getTime();var n=this.config.sessionExpirationMs()===0?false:t-this.automaticSession.acquisitionDate>this.config.sessionExpirationMs();var r=this.config.sessionExpirationMs()===0?false:t-this.automaticSession.renewalDate>this.config.sessionRenewalMs();if(n||r){this.renew()}else{if(!this.cookieUpdatedTimestamp||t-this.cookieUpdatedTimestamp>e.cookieUpdateInterval){this.automaticSession.renewalDate=t;this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate)}}};e.prototype.backup=function(){this.setStorage(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate)};e.prototype.initializeAutomaticSession=function(){var e=Util.getCookie(this._logger,this._storageNamePrefix());if(e&&typeof e.split==="function"){this.initializeAutomaticSessionWithData(e)}else{var t=Util.getStorage(this._logger,this._storageNamePrefix());if(t){this.initializeAutomaticSessionWithData(t)}}if(!this.automaticSession.id){this.renew()}};e.prototype.initializeAutomaticSessionWithData=function(e){var t=e.split("|");if(t.length>0){this.automaticSession.id=t[0]}try{if(t.length>1){var n=+t[1];this.automaticSession.acquisitionDate=+new Date(n);this.automaticSession.acquisitionDate=this.automaticSession.acquisitionDate>0?this.automaticSession.acquisitionDate:0}if(t.length>2){var r=+t[2];this.automaticSession.renewalDate=+new Date(r);this.automaticSession.renewalDate=this.automaticSession.renewalDate>0?this.automaticSession.renewalDate:0}}catch(e){this._logger.throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.ErrorParsingAISessionCookie,"Error parsing ai_session cookie, session will be reset: "+Util.getExceptionName(e),{exception:Util.dump(e)})}if(this.automaticSession.renewalDate===0){this._logger.throwInternal(LoggingSeverity.WARNING,_InternalMessageId.SessionRenewalDateIsZero,"AI session renewal date is 0, session will be reset.")}};e.prototype.renew=function(){var e=(new Date).getTime();this.automaticSession.id=Util.newId(this.config&&this.config.idLength?this.config.idLength():22);this.automaticSession.acquisitionDate=e;this.automaticSession.renewalDate=e;this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate);if(!Util.canUseLocalStorage()){this._logger.throwInternal(LoggingSeverity.WARNING,_InternalMessageId.BrowserDoesNotSupportLocalStorage,"Browser does not support local storage. Session durations will be inaccurate.")}};e.prototype.setCookie=function(e,t,n){var r=t+this.config.sessionExpirationMs();var i=n+this.config.sessionRenewalMs();var a=new Date;var s=[e,t,n];if(r<i){a.setTime(r)}else{a.setTime(i)}var o=this.config.cookieDomain?this.config.cookieDomain():null;var u=this.config.sessionExpirationMs()===0?"0":a.toUTCString();Util.setCookie(this._logger,this._storageNamePrefix(),s.join("|")+";expires="+u,o);this.cookieUpdatedTimestamp=(new Date).getTime()};e.prototype.setStorage=function(e,t,n){Util.setStorage(this._logger,this._storageNamePrefix(),[e,t,n].join("|"))};e.acquisitionSpan=864e5;e.renewalSpan=18e5;e.cookieUpdateInterval=6e4;e.cookieNameConst="ai_session";return e}();var Application=function(){function e(){}return e}();var Device=function(){function e(){this.id="browser";this.deviceClass="Browser"}return e}();var Version="2.5.10";var Internal=function(){function e(e){this.sdkVersion=(e.sdkExtension&&e.sdkExtension()?e.sdkExtension()+"_":"")+"javascript:"+Version}return e}();var User=function(){function e(t,n){this.isNewUser=false;this._logger=n;var r=Util.getCookie(this._logger,e.userCookieName);if(r){this.isNewUser=false;var i=r.split(e.cookieSeparator);if(i.length>0){this.id=i[0]}}this.config=t;if(!this.id){this.id=CoreUtils.newId(t&&t.idLength?t.idLength():22);var a=new Date;var s=CoreUtils.toISOString(a);this.accountAcquisitionDate=s;this.isNewUser=true;a.setTime(a.getTime()+31536e6);var o=[this.id,s];var u=this.config.cookieDomain?this.config.cookieDomain():undefined;Util.setCookie(this._logger,e.userCookieName,o.join(e.cookieSeparator)+";expires="+a.toUTCString(),u);var l=t.namePrefix&&t.namePrefix()?t.namePrefix()+"ai_session":"ai_session";Util.removeStorage(this._logger,l)}this.accountId=t.accountId?t.accountId():undefined;var c=Util.getCookie(this._logger,e.authUserCookieName);if(c){c=decodeURI(c);var d=c.split(e.cookieSeparator);if(d[0]){this.authenticatedId=d[0]}if(d.length>1&&d[1]){this.accountId=d[1]}}}e.prototype.setAuthenticatedUserContext=function(t,n,r){if(r===void 0){r=false}var i=!this.validateUserInput(t)||n&&!this.validateUserInput(n);if(i){this._logger.throwInternal(LoggingSeverity.WARNING,_InternalMessageId.SetAuthContextFailedAccountName,"Setting auth user context failed. "+"User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.",true);return}this.authenticatedId=t;var a=this.authenticatedId;if(n){this.accountId=n;a=[this.authenticatedId,this.accountId].join(e.cookieSeparator)}if(r){Util.setCookie(this._logger,e.authUserCookieName,encodeURI(a),this.config.cookieDomain())}};e.prototype.clearAuthenticatedUserContext=function(){this.authenticatedId=null;this.accountId=null;Util.deleteCookie(this._logger,e.authUserCookieName)};e.prototype.validateUserInput=function(e){if(typeof e!=="string"||!e||e.match(/,|;|=| |\|/)){return false}return true};e.cookieSeparator="|";e.userCookieName="ai_user";e.authUserCookieName="ai_authUser";return e}();var Location=function(){function e(){}return e}();var TelemetryTrace=function(){function e(e,t,n,r){this.traceID=e||Util.generateW3CId();this.parentID=t;this.name=n;var i=getLocation();if(!n&&i&&i.pathname){this.name=i.pathname}this.name=DataSanitizer.sanitizeString(r,this.name)}return e}();var TelemetryContext=function(){function e(e,t){var n=this;n.application=new Application;n.internal=new Internal(t);if(hasWindow()){n.sessionManager=new _SessionManager(t,e);n.device=new Device;n.location=new Location;n.user=new User(t,e);n.telemetryTrace=new TelemetryTrace(undefined,undefined,undefined,e);n.session=new Session}n.appId=function(){return null}}e.prototype.applySessionContext=function(e,t){var n=this.session;var r=this.sessionManager;var i=n||r&&r.automaticSession;if(i){if(CoreUtils.isString(i.id)){e.ext.app.sesId=i.id}}if(n){if(CoreUtils.isString(n.id)){e.ext.app.sesId=n.id}else{e.ext.app.sesId=r.automaticSession.id}}};e.prototype.applyOperatingSystemContxt=function(e,t){var n=this.os;if(n&&n.name){e.ext.os=n}};e.prototype.applyApplicationContext=function(e,t){var n=this.application;if(n){if(CoreUtils.isString(n.ver)){e.tags[CtxTagKeys.applicationVersion]=n.ver}if(CoreUtils.isString(n.build)){e.tags[CtxTagKeys.applicationBuild]=n.build}}};e.prototype.applyDeviceContext=function(e,t){var n=this.device;if(n){if(CoreUtils.isString(n.id)){e.ext.device.localId=n.id}if(CoreUtils.isString(n.ip)){e.ext.device.ip=n.ip}if(CoreUtils.isString(n.model)){e.ext.device.model=n.model}if(CoreUtils.isString(n.deviceClass)){e.ext.device.deviceClass=n.deviceClass}}};e.prototype.applyInternalContext=function(e,t){var n=this.internal;if(n){if(CoreUtils.isString(n.agentVersion)){e.tags[CtxTagKeys.internalAgentVersion]=n.agentVersion}if(CoreUtils.isString(n.sdkVersion)){e.tags[CtxTagKeys.internalSdkVersion]=n.sdkVersion}if(e.baseType===_InternalLogMessage.dataType||e.baseType===PageView.dataType){if(CoreUtils.isString(n.snippetVer)){e.tags[CtxTagKeys.internalSnippet]=n.snippetVer}if(CoreUtils.isString(n.sdkSrc)){e.tags[CtxTagKeys.internalSdkSrc]=n.sdkSrc}}}};e.prototype.applyLocationContext=function(e,t){var n=this.location;if(n){if(CoreUtils.isString(n.ip)){e.tags[CtxTagKeys.locationIp]=n.ip}}};e.prototype.applyOperationContext=function(e,t){var n=this.telemetryTrace;if(n){var r=e.ext.trace||{traceID:undefined,parentID:undefined};if(CoreUtils.isString(n.traceID)){r.traceID=n.traceID}if(CoreUtils.isString(n.name)){r.name=n.name}if(CoreUtils.isString(n.parentID)){r.parentID=n.parentID}e.ext.trace=r}};e.prototype.applyWebContext=function(e,t){var n=this.web;if(n){e.ext.web=e.ext.web||{};e.ext.web=n}};e.prototype.applyUserContext=function(e,t){var n=this.user;if(n){if(!e.tags){e.tags=[]}if(CoreUtils.isString(n.accountId)){e.tags[CtxTagKeys.userAccountId]=n.accountId}if(CoreUtils.isString(n.id)){e.ext.user.id=n.id}if(CoreUtils.isString(n.authenticatedId)){e.ext.user.authId=n.authenticatedId}}};e.prototype.cleanUp=function(e,t){if(e.ext[Extensions.DeviceExt]&&CoreUtils.objKeys(e.ext[Extensions.DeviceExt]).length===0){delete e.ext[Extensions.DeviceExt]}if(e.ext[Extensions.UserExt]&&CoreUtils.objKeys(e.ext[Extensions.UserExt]).length===0){delete e.ext[Extensions.UserExt]}if(e.ext[Extensions.WebExt]&&CoreUtils.objKeys(e.ext[Extensions.WebExt]).length===0){delete e.ext[Extensions.WebExt]}if(e.ext[Extensions.OSExt]&&CoreUtils.objKeys(e.ext[Extensions.OSExt]).length===0){delete e.ext[Extensions.OSExt]}if(e.ext[Extensions.AppExt]&&CoreUtils.objKeys(e.ext[Extensions.AppExt]).length===0){delete e.ext[Extensions.AppExt]}if(e.ext[Extensions.TraceExt]&&CoreUtils.objKeys(e.ext[Extensions.TraceExt]).length===0){delete e.ext[Extensions.TraceExt]}};return e}();var PropertiesPlugin=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.priority=110;t.identifier=PropertiesPluginIdentifier;return t}t.getDefaultConfig=function(){var e={instrumentationKey:function(){return undefined},accountId:function(){return null},sessionRenewalMs:function(){return 30*60*1e3},samplingPercentage:function(){return 100},sessionExpirationMs:function(){return 24*60*60*1e3},cookieDomain:function(){return null},sdkExtension:function(){return null},isBrowserLinkTrackingEnabled:function(){return false},appId:function(){return null},namePrefix:function(){return undefined},idLength:function(){return 22}};return e};t.prototype.initialize=function(n,r,i,a){var s=this;e.prototype.initialize.call(this,n,r,i,a);var o=this._getTelCtx();var u=this.identifier;var l=t.getDefaultConfig();this._extensionConfig=this._extensionConfig||t.getDefaultConfig();objForEachKey(l,(function(e,t){s._extensionConfig[e]=function(){return o.getConfig(u,e,t())}}));this.context=new TelemetryContext(r.logger,this._extensionConfig);this._breezeChannel=Util.getExtension(i,BreezeChannelIdentifier);this.context.appId=function(){return s._breezeChannel?s._breezeChannel["_appId"]:null}};t.prototype.processTelemetry=function(e,t){if(CoreUtils.isNullOrUndefined(e));else{t=this._getTelCtx(t);if(e.name===PageView.envelopeType){t.diagLog().resetInternalMessageCount()}if(this.context.session){if(typeof this.context.session.id!=="string"){this.context.sessionManager.update()}}this._processTelemetryInternal(e,t);if(this.context&&this.context.user&&this.context.user.isNewUser){this.context.user.isNewUser=false;var n=new _InternalLogMessage(_InternalMessageId.SendBrowserInfoOnUserInit,(getNavigator()||{}).userAgent||"");t.diagLog().logInternalMessage(LoggingSeverity.CRITICAL,n)}this.processNext(e,t)}};t.prototype._processTelemetryInternal=function(e,t){if(!e.tags){e.tags=[]}if(!e.ext){e.ext={}}var n=e.ext;n[Extensions.DeviceExt]=n[Extensions.DeviceExt]||{};n[Extensions.WebExt]=n[Extensions.WebExt]||{};n[Extensions.UserExt]=n[Extensions.UserExt]||{};n[Extensions.OSExt]=n[Extensions.OSExt]||{};n[Extensions.AppExt]=n[Extensions.AppExt]||{};n[Extensions.TraceExt]=n[Extensions.TraceExt]||{};var r=this.context;r.applySessionContext(e,t);r.applyApplicationContext(e,t);r.applyDeviceContext(e,t);r.applyOperationContext(e,t);r.applyUserContext(e,t);r.applyOperatingSystemContxt(e,t);r.applyWebContext(e,t);r.applyLocationContext(e,t);r.applyInternalContext(e,t);r.cleanUp(e,t)};return t}(BaseTelemetryPlugin);
53
+ */function _getResponseText(e){try{return e.responseText}catch(e){}return null}var Sender=function(e){__extends(t,e);function t(){var n=e.call(this)||this;n.priority=1001;n.identifier=BreezeChannelIdentifier;n._XMLHttpRequestSupported=false;var r;var i;var a;var s;dynamicProto(t,n,(function(e,o){function u(){throw new Error("Method not implemented.")}e.pause=u;e.resume=u;e.flush=function(){try{e.triggerSend(true,null,1)}catch(t){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.FlushFailed,"flush failed, telemetry will not be collected: "+Util.getExceptionName(t),{exception:Util.dump(t)})}};e.onunloadFlush=function(){if((e._senderConfig.onunloadDisableBeacon()===false||e._senderConfig.isBeaconApiDisabled()===false)&&Util.IsBeaconApiSupported()){try{e.triggerSend(true,c,2)}catch(t){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.FailedToSendQueuedTelemetry,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+Util.getExceptionName(t),{exception:Util.dump(t)})}}else{e.flush()}};e.teardown=u;e.initialize=function(n,a,u,l){o.initialize(n,a,u,l);var f=e._getTelCtx();var p=e.identifier;s=new Serializer(a.logger);r=0;i=null;e._sender=null;var h=t._getDefaultAppInsightsChannelConfig();e._senderConfig=t._getEmptyAppInsightsChannelConfig();objForEachKey(h,(function(t,n){e._senderConfig[t]=function(){return f.getConfig(p,t,n())}}));e._buffer=e._senderConfig.enableSessionStorageBuffer()&&Util.canUseSessionStorage()?new SessionStorageSendBuffer(e.diagLog(),e._senderConfig):new ArraySendBuffer(e._senderConfig);e._sample=new Sample(e._senderConfig.samplingPercentage(),e.diagLog());if(!C(n)){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.InvalidInstrumentationKey,"Invalid Instrumentation key "+n.instrumentationKey)}if(!e._senderConfig.isBeaconApiDisabled()&&Util.IsBeaconApiSupported()){e._sender=c}else{if(typeof XMLHttpRequest!==undefined){var m=getGlobalInst("XMLHttpRequest");if(m){var v=new m;if("withCredentials"in v){e._sender=d;e._XMLHttpRequestSupported=true}else if(typeof XDomainRequest!==undefined){e._sender=y}}}}};e.processTelemetry=function(n,r){r=e._getTelCtx(r);try{if(e._senderConfig.disableTelemetry()){return}if(!n){r.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.CannotSendEmptyTelemetry,"Cannot send empty telemetry");return}if(n.baseData&&!n.baseType){r.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.InvalidEvent,"Cannot send telemetry without baseData and baseType");return}if(!n.baseType){n.baseType="EventData"}if(!e._sender){r.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.SenderNotInitialized,"Sender was not initialized");return}if(!l(n)){r.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TelemetrySampledAndNotSent,"Telemetry item was sampled out and not sent",{SampleRate:e._sample.sampleRate});return}else{n[SampleRate]=e._sample.sampleRate}var i=t.constructEnvelope(n,e._senderConfig.instrumentationKey(),r.diagLog());if(!i){r.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.CreateEnvelopeError,"Unable to create an AppInsights envelope");return}var a=false;if(n.tags&&n.tags[ProcessLegacy]){CoreUtils.arrForEach(n.tags[ProcessLegacy],(function(e){try{if(e&&e(i)===false){a=true;r.diagLog().warnToConsole("Telemetry processor check returns false")}}catch(e){r.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TelemetryInitializerFailed,"One of telemetry initializers failed, telemetry item will not be sent: "+Util.getExceptionName(e),{exception:Util.dump(e)},true)}}));delete n.tags[ProcessLegacy]}if(a){return}var o=s.serialize(i);var u=e._buffer.getItems();var c=e._buffer.batchPayloads(u);if(c&&c.length+o.length>e._senderConfig.maxBatchSizeInBytes()){e.triggerSend(true,null,10)}e._buffer.enqueue(o);m()}catch(e){r.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.FailedAddingTelemetryToBuffer,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Util.getExceptionName(e),{exception:Util.dump(e)})}e.processNext(n,r)};e._xhrReadyStateChange=function(t,n,i){if(t.readyState===4){var a=null;if(!e._appId){a=f(_getResponseText(t)||t.response);if(a&&a.appId){e._appId=a.appId}}if((t.status<200||t.status>=300)&&t.status!==0){if(!e._senderConfig.isRetryDisabled()&&v(t.status)){p(n);e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TransmissionFailed,". "+"Response code "+t.status+". Will retry to send "+n.length+" items.")}else{e._onError(n,g(t))}}else if(Offline.isOffline()){if(!e._senderConfig.isRetryDisabled()){var s=10;p(n,s);e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TransmissionFailed,". Offline - Response Code: "+t.status+". Offline status: "+Offline.isOffline()+". Will retry to send "+n.length+" items.")}}else{if(t.status===206){if(!a){a=f(_getResponseText(t)||t.response)}if(a&&!e._senderConfig.isRetryDisabled()){e._onPartialSuccess(n,a)}else{e._onError(n,g(t))}}else{r=0;e._onSuccess(n,i)}}}};e.triggerSend=function(t,r,s){if(t===void 0){t=true}try{if(!e._senderConfig.disableTelemetry()){if(e._buffer.count()>0){var o=e._buffer.getItems();x(s||0,t);if(r){r.call(n,o,t)}else{e._sender(o,t)}}}else{e._buffer.clear()}clearTimeout(a);a=null;i=null}catch(t){var u=Util.getIEVersion();if(!u||u>9){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TransmissionFailed,"Telemetry transmission failed, some telemetry will be lost: "+Util.getExceptionName(t),{exception:Util.dump(t)})}}};e._onError=function(t,n,r){e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.OnError,"Failed to send telemetry.",{message:n});e._buffer.clearSent(t)};e._onPartialSuccess=function(t,n){var r=[];var i=[];var a=n.errors.reverse();for(var s=0,o=a;s<o.length;s++){var u=o[s];var l=t.splice(u.index,1)[0];if(v(u.statusCode)){i.push(l)}else{r.push(l)}}if(t.length>0){e._onSuccess(t,n.itemsAccepted)}if(r.length>0){e._onError(r,g(null,["partial success",n.itemsAccepted,"of",n.itemsReceived].join(" ")))}if(i.length>0){p(i);e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TransmissionFailed,"Partial success. "+"Delivered: "+t.length+", Failed: "+r.length+". Will retry to send "+i.length+" our of "+n.itemsReceived+" items")}};e._onSuccess=function(t,n){e._buffer.clearSent(t)};e._xdrOnLoad=function(t,n){var i=_getResponseText(t);if(t&&(i+""==="200"||i==="")){r=0;e._onSuccess(n,0)}else{var a=f(i);if(a&&a.itemsReceived&&a.itemsReceived>a.itemsAccepted&&!e._senderConfig.isRetryDisabled()){e._onPartialSuccess(n,a)}else{e._onError(n,S(t))}}};function l(t){return e._sample.isSampledIn(t)}function c(t,n){var r=e._senderConfig.endpointUrl();var i=e._buffer.batchPayloads(t);var a=new Blob([i],{type:"text/plain;charset=UTF-8"});var s=getNavigator().sendBeacon(r,a);if(s){e._buffer.markAsSent(t);e._onSuccess(t,t.length)}else{d(t,true);e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TransmissionFailed,". "+"Failed to send telemetry with Beacon API, retried with xhrSender.")}}function d(t,n){var r=new XMLHttpRequest;var i=e._senderConfig.endpointUrl();try{r[DisabledPropertyName]=true}catch(e){}r.open("POST",i,n);r.setRequestHeader("Content-type","application/json");if(Util.isInternalApplicationInsightsEndpoint(i)){r.setRequestHeader(RequestHeaders.sdkContextHeader,RequestHeaders.sdkContextHeaderAppIdRequest)}r.onreadystatechange=function(){return e._xhrReadyStateChange(r,t,t.length)};r.onerror=function(n){return e._onError(t,g(r),n)};var a=e._buffer.batchPayloads(t);r.send(a);e._buffer.markAsSent(t)}function f(t){try{if(t&&t!==""){var n=getJSON().parse(t);if(n&&n.itemsReceived&&n.itemsReceived>=n.itemsAccepted&&n.itemsReceived-n.itemsAccepted===n.errors.length){return n}}}catch(n){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.InvalidBackendResponse,"Cannot parse the response. "+Util.getExceptionName(n),{response:t})}return null}function p(t,n){if(n===void 0){n=1}if(!t||t.length===0){return}e._buffer.clearSent(t);r++;for(var i=0,a=t;i<a.length;i++){var s=a[i];e._buffer.enqueue(s)}h(n);m()}function h(e){var t=10;var n;if(r<=1){n=t}else{var a=(Math.pow(2,r)-1)/2;var s=Math.floor(Math.random()*a*t)+1;s=e*s;n=Math.max(Math.min(s,3600),t)}var o=CoreUtils.dateNow()+n*1e3;i=o}function m(){if(!a){var t=i?Math.max(0,i-CoreUtils.dateNow()):0;var n=Math.max(e._senderConfig.maxBatchInterval(),t);a=setTimeout((function(){e.triggerSend(true,null,1)}),n)}}function v(e){return e===408||e===429||e===500||e===503}function g(e,t){if(e){return"XMLHttpRequest,Status:"+e.status+",Response:"+_getResponseText(e)||e.response||""}return t}function y(t,n){var r=getWindow();var i=new XDomainRequest;i.onload=function(){return e._xdrOnLoad(i,t)};i.onerror=function(n){return e._onError(t,S(i),n)};var a=r&&r.location&&r.location.protocol||"";if(e._senderConfig.endpointUrl().lastIndexOf(a,0)!==0){e.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TransmissionFailed,". "+"Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.");e._buffer.clear();return}var s=e._senderConfig.endpointUrl().replace(/^(https?:)/,"");i.open("POST",s);var o=e._buffer.batchPayloads(t);i.send(o);e._buffer.markAsSent(t)}function S(e,t){if(e){return"XDomainRequest,Response:"+_getResponseText(e)||""}return t}function b(){var t="getNotifyMgr";if(e.core[t]){return e.core[t]()}return e.core["_notificationManager"]}function x(t,n){var r=b();if(r&&r.eventsSendRequest){try{r.eventsSendRequest(t,n)}catch(t){e.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.NotificationException,"send request notification failed: "+Util.getExceptionName(t),{exception:Util.dump(t)})}}}function C(e){var t=CoreUtils.isNullOrUndefined(e.disableInstrumentaionKeyValidation)?false:e.disableInstrumentaionKeyValidation;if(t){return true}var n="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$";var r=new RegExp(n);return r.test(e.instrumentationKey)}}));return n}t.constructEnvelope=function(e,t,n){var r;if(t!==e.iKey&&!CoreUtils.isNullOrUndefined(t)){r=__assign({},e,{iKey:t})}else{r=e}switch(r.baseType){case Event$1.dataType:return EventEnvelopeCreator.EventEnvelopeCreator.Create(n,r);case Trace.dataType:return TraceEnvelopeCreator.TraceEnvelopeCreator.Create(n,r);case PageView.dataType:return PageViewEnvelopeCreator.PageViewEnvelopeCreator.Create(n,r);case PageViewPerformance.dataType:return PageViewPerformanceEnvelopeCreator.PageViewPerformanceEnvelopeCreator.Create(n,r);case Exception.dataType:return ExceptionEnvelopeCreator.ExceptionEnvelopeCreator.Create(n,r);case Metric.dataType:return MetricEnvelopeCreator.MetricEnvelopeCreator.Create(n,r);case RemoteDependencyData$1.dataType:return DependencyEnvelopeCreator.DependencyEnvelopeCreator.Create(n,r);default:return EventEnvelopeCreator.EventEnvelopeCreator.Create(n,r)}};t._getDefaultAppInsightsChannelConfig=function(){return{endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return false},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return false},enableSessionStorageBuffer:function(){return true},isRetryDisabled:function(){return false},isBeaconApiDisabled:function(){return true},onunloadDisableBeacon:function(){return false},instrumentationKey:function(){return undefined},namePrefix:function(){return undefined},samplingPercentage:function(){return 100}}};t._getEmptyAppInsightsChannelConfig=function(){return{endpointUrl:undefined,emitLineDelimitedJson:undefined,maxBatchInterval:undefined,maxBatchSizeInBytes:undefined,disableTelemetry:undefined,enableSessionStorageBuffer:undefined,isRetryDisabled:undefined,isBeaconApiDisabled:undefined,onunloadDisableBeacon:undefined,instrumentationKey:undefined,namePrefix:undefined,samplingPercentage:undefined}};return t}(BaseTelemetryPlugin);var Session=function(){function e(){}return e}();var _SessionManager=function(){function e(t,n){var r=this;if(CoreUtils.isNullOrUndefined(n)){this._logger=new DiagnosticLogger}else{this._logger=n}if(!t){t={}}if(!(typeof t.sessionExpirationMs==="function")){t.sessionExpirationMs=function(){return e.acquisitionSpan}}if(!(typeof t.sessionRenewalMs==="function")){t.sessionRenewalMs=function(){return e.renewalSpan}}this.config=t;this._storageNamePrefix=function(){return r.config.namePrefix&&r.config.namePrefix()?e.cookieNameConst+r.config.namePrefix():e.cookieNameConst};this.automaticSession=new Session}e.prototype.update=function(){if(!this.automaticSession.id){this.initializeAutomaticSession()}var t=(new Date).getTime();var n=this.config.sessionExpirationMs()===0?false:t-this.automaticSession.acquisitionDate>this.config.sessionExpirationMs();var r=this.config.sessionExpirationMs()===0?false:t-this.automaticSession.renewalDate>this.config.sessionRenewalMs();if(n||r){this.renew()}else{if(!this.cookieUpdatedTimestamp||t-this.cookieUpdatedTimestamp>e.cookieUpdateInterval){this.automaticSession.renewalDate=t;this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate)}}};e.prototype.backup=function(){this.setStorage(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate)};e.prototype.initializeAutomaticSession=function(){var e=Util.getCookie(this._logger,this._storageNamePrefix());if(e&&typeof e.split==="function"){this.initializeAutomaticSessionWithData(e)}else{var t=Util.getStorage(this._logger,this._storageNamePrefix());if(t){this.initializeAutomaticSessionWithData(t)}}if(!this.automaticSession.id){this.renew()}};e.prototype.initializeAutomaticSessionWithData=function(e){var t=e.split("|");if(t.length>0){this.automaticSession.id=t[0]}try{if(t.length>1){var n=+t[1];this.automaticSession.acquisitionDate=+new Date(n);this.automaticSession.acquisitionDate=this.automaticSession.acquisitionDate>0?this.automaticSession.acquisitionDate:0}if(t.length>2){var r=+t[2];this.automaticSession.renewalDate=+new Date(r);this.automaticSession.renewalDate=this.automaticSession.renewalDate>0?this.automaticSession.renewalDate:0}}catch(e){this._logger.throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.ErrorParsingAISessionCookie,"Error parsing ai_session cookie, session will be reset: "+Util.getExceptionName(e),{exception:Util.dump(e)})}if(this.automaticSession.renewalDate===0){this._logger.throwInternal(LoggingSeverity.WARNING,_InternalMessageId.SessionRenewalDateIsZero,"AI session renewal date is 0, session will be reset.")}};e.prototype.renew=function(){var e=(new Date).getTime();this.automaticSession.id=Util.newId(this.config&&this.config.idLength?this.config.idLength():22);this.automaticSession.acquisitionDate=e;this.automaticSession.renewalDate=e;this.setCookie(this.automaticSession.id,this.automaticSession.acquisitionDate,this.automaticSession.renewalDate);if(!Util.canUseLocalStorage()){this._logger.throwInternal(LoggingSeverity.WARNING,_InternalMessageId.BrowserDoesNotSupportLocalStorage,"Browser does not support local storage. Session durations will be inaccurate.")}};e.prototype.setCookie=function(e,t,n){var r=t+this.config.sessionExpirationMs();var i=n+this.config.sessionRenewalMs();var a=new Date;var s=[e,t,n];if(r<i){a.setTime(r)}else{a.setTime(i)}var o=this.config.cookieDomain?this.config.cookieDomain():null;var u=this.config.sessionExpirationMs()===0?"0":a.toUTCString();Util.setCookie(this._logger,this._storageNamePrefix(),s.join("|")+";expires="+u,o);this.cookieUpdatedTimestamp=(new Date).getTime()};e.prototype.setStorage=function(e,t,n){Util.setStorage(this._logger,this._storageNamePrefix(),[e,t,n].join("|"))};e.acquisitionSpan=864e5;e.renewalSpan=18e5;e.cookieUpdateInterval=6e4;e.cookieNameConst="ai_session";return e}();var Application=function(){function e(){}return e}();var Device=function(){function e(){this.id="browser";this.deviceClass="Browser"}return e}();var Version="2.5.10";var Internal=function(){function e(e){this.sdkVersion=(e.sdkExtension&&e.sdkExtension()?e.sdkExtension()+"_":"")+"javascript:"+Version}return e}();var User=function(){function e(t,n){this.isNewUser=false;this._logger=n;var r=Util.getCookie(this._logger,e.userCookieName);if(r){this.isNewUser=false;var i=r.split(e.cookieSeparator);if(i.length>0){this.id=i[0]}}this.config=t;if(!this.id){this.id=CoreUtils.newId(t&&t.idLength?t.idLength():22);var a=new Date;var s=CoreUtils.toISOString(a);this.accountAcquisitionDate=s;this.isNewUser=true;a.setTime(a.getTime()+31536e6);var o=[this.id,s];var u=this.config.cookieDomain?this.config.cookieDomain():undefined;Util.setCookie(this._logger,e.userCookieName,o.join(e.cookieSeparator)+";expires="+a.toUTCString(),u);var l=t.namePrefix&&t.namePrefix()?t.namePrefix()+"ai_session":"ai_session";Util.removeStorage(this._logger,l)}this.accountId=t.accountId?t.accountId():undefined;var c=Util.getCookie(this._logger,e.authUserCookieName);if(c){c=decodeURI(c);var d=c.split(e.cookieSeparator);if(d[0]){this.authenticatedId=d[0]}if(d.length>1&&d[1]){this.accountId=d[1]}}}e.prototype.setAuthenticatedUserContext=function(t,n,r){if(r===void 0){r=false}var i=!this.validateUserInput(t)||n&&!this.validateUserInput(n);if(i){this._logger.throwInternal(LoggingSeverity.WARNING,_InternalMessageId.SetAuthContextFailedAccountName,"Setting auth user context failed. "+"User auth/account id should be of type string, and not contain commas, semi-colons, equal signs, spaces, or vertical-bars.",true);return}this.authenticatedId=t;var a=this.authenticatedId;if(n){this.accountId=n;a=[this.authenticatedId,this.accountId].join(e.cookieSeparator)}if(r){Util.setCookie(this._logger,e.authUserCookieName,encodeURI(a),this.config.cookieDomain())}};e.prototype.clearAuthenticatedUserContext=function(){this.authenticatedId=null;this.accountId=null;Util.deleteCookie(this._logger,e.authUserCookieName)};e.prototype.validateUserInput=function(e){if(typeof e!=="string"||!e||e.match(/,|;|=| |\|/)){return false}return true};e.cookieSeparator="|";e.userCookieName="ai_user";e.authUserCookieName="ai_authUser";return e}();var Location=function(){function e(){}return e}();var TelemetryTrace=function(){function e(e,t,n,r){this.traceID=e||Util.generateW3CId();this.parentID=t;this.name=n;var i=getLocation();if(!n&&i&&i.pathname){this.name=i.pathname}this.name=DataSanitizer.sanitizeString(r,this.name)}return e}();var TelemetryContext=function(){function e(e,t){var n=this;n.application=new Application;n.internal=new Internal(t);if(hasWindow()){n.sessionManager=new _SessionManager(t,e);n.device=new Device;n.location=new Location;n.user=new User(t,e);n.telemetryTrace=new TelemetryTrace(undefined,undefined,undefined,e);n.session=new Session}n.appId=function(){return null}}e.prototype.applySessionContext=function(e,t){var n=this.session;var r=this.sessionManager;var i=n||r&&r.automaticSession;if(i){if(CoreUtils.isString(i.id)){e.ext.app.sesId=i.id}}if(n){if(CoreUtils.isString(n.id)){e.ext.app.sesId=n.id}else{e.ext.app.sesId=r.automaticSession.id}}};e.prototype.applyOperatingSystemContxt=function(e,t){var n=this.os;if(n&&n.name){e.ext.os=n}};e.prototype.applyApplicationContext=function(e,t){var n=this.application;if(n){if(CoreUtils.isString(n.ver)){e.tags[CtxTagKeys.applicationVersion]=n.ver}if(CoreUtils.isString(n.build)){e.tags[CtxTagKeys.applicationBuild]=n.build}}};e.prototype.applyDeviceContext=function(e,t){var n=this.device;if(n){if(CoreUtils.isString(n.id)){e.ext.device.localId=n.id}if(CoreUtils.isString(n.ip)){e.ext.device.ip=n.ip}if(CoreUtils.isString(n.model)){e.ext.device.model=n.model}if(CoreUtils.isString(n.deviceClass)){e.ext.device.deviceClass=n.deviceClass}}};e.prototype.applyInternalContext=function(e,t){var n=this.internal;if(n){if(CoreUtils.isString(n.agentVersion)){e.tags[CtxTagKeys.internalAgentVersion]=n.agentVersion}if(CoreUtils.isString(n.sdkVersion)){e.tags[CtxTagKeys.internalSdkVersion]=n.sdkVersion}if(e.baseType===_InternalLogMessage.dataType||e.baseType===PageView.dataType){if(CoreUtils.isString(n.snippetVer)){e.tags[CtxTagKeys.internalSnippet]=n.snippetVer}if(CoreUtils.isString(n.sdkSrc)){e.tags[CtxTagKeys.internalSdkSrc]=n.sdkSrc}}}};e.prototype.applyLocationContext=function(e,t){var n=this.location;if(n){if(CoreUtils.isString(n.ip)){e.tags[CtxTagKeys.locationIp]=n.ip}}};e.prototype.applyOperationContext=function(e,t){var n=this.telemetryTrace;if(n){var r=e.ext.trace||{traceID:undefined,parentID:undefined};if(CoreUtils.isString(n.traceID)){r.traceID=n.traceID}if(CoreUtils.isString(n.name)){r.name=n.name}if(CoreUtils.isString(n.parentID)){r.parentID=n.parentID}e.ext.trace=r}};e.prototype.applyWebContext=function(e,t){var n=this.web;if(n){e.ext.web=e.ext.web||{};e.ext.web=n}};e.prototype.applyUserContext=function(e,t){var n=this.user;if(n){if(!e.tags){e.tags=[]}if(CoreUtils.isString(n.accountId)){e.tags[CtxTagKeys.userAccountId]=n.accountId}if(CoreUtils.isString(n.id)){e.ext.user.id=n.id}if(CoreUtils.isString(n.authenticatedId)){e.ext.user.authId=n.authenticatedId}}};e.prototype.cleanUp=function(e,t){if(e.ext[Extensions.DeviceExt]&&CoreUtils.objKeys(e.ext[Extensions.DeviceExt]).length===0){delete e.ext[Extensions.DeviceExt]}if(e.ext[Extensions.UserExt]&&CoreUtils.objKeys(e.ext[Extensions.UserExt]).length===0){delete e.ext[Extensions.UserExt]}if(e.ext[Extensions.WebExt]&&CoreUtils.objKeys(e.ext[Extensions.WebExt]).length===0){delete e.ext[Extensions.WebExt]}if(e.ext[Extensions.OSExt]&&CoreUtils.objKeys(e.ext[Extensions.OSExt]).length===0){delete e.ext[Extensions.OSExt]}if(e.ext[Extensions.AppExt]&&CoreUtils.objKeys(e.ext[Extensions.AppExt]).length===0){delete e.ext[Extensions.AppExt]}if(e.ext[Extensions.TraceExt]&&CoreUtils.objKeys(e.ext[Extensions.TraceExt]).length===0){delete e.ext[Extensions.TraceExt]}};return e}();var PropertiesPlugin=function(e){__extends(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;t.priority=110;t.identifier=PropertiesPluginIdentifier;return t}t.getDefaultConfig=function(){var e={instrumentationKey:function(){return undefined},accountId:function(){return null},sessionRenewalMs:function(){return 30*60*1e3},samplingPercentage:function(){return 100},sessionExpirationMs:function(){return 24*60*60*1e3},cookieDomain:function(){return null},sdkExtension:function(){return null},isBrowserLinkTrackingEnabled:function(){return false},appId:function(){return null},namePrefix:function(){return undefined},idLength:function(){return 22}};return e};t.prototype.initialize=function(n,r,i,a){var s=this;e.prototype.initialize.call(this,n,r,i,a);var o=this._getTelCtx();var u=this.identifier;var l=t.getDefaultConfig();this._extensionConfig=this._extensionConfig||t.getDefaultConfig();objForEachKey(l,(function(e,t){s._extensionConfig[e]=function(){return o.getConfig(u,e,t())}}));this.context=new TelemetryContext(r.logger,this._extensionConfig);this._breezeChannel=Util.getExtension(i,BreezeChannelIdentifier);this.context.appId=function(){return s._breezeChannel?s._breezeChannel["_appId"]:null}};t.prototype.processTelemetry=function(e,t){if(CoreUtils.isNullOrUndefined(e));else{t=this._getTelCtx(t);if(e.name===PageView.envelopeType){t.diagLog().resetInternalMessageCount()}if(this.context.session){if(typeof this.context.session.id!=="string"){this.context.sessionManager.update()}}this._processTelemetryInternal(e,t);if(this.context&&this.context.user&&this.context.user.isNewUser){this.context.user.isNewUser=false;var n=new _InternalLogMessage(_InternalMessageId.SendBrowserInfoOnUserInit,(getNavigator()||{}).userAgent||"");t.diagLog().logInternalMessage(LoggingSeverity.CRITICAL,n)}this.processNext(e,t)}};t.prototype._processTelemetryInternal=function(e,t){if(!e.tags){e.tags=[]}if(!e.ext){e.ext={}}var n=e.ext;n[Extensions.DeviceExt]=n[Extensions.DeviceExt]||{};n[Extensions.WebExt]=n[Extensions.WebExt]||{};n[Extensions.UserExt]=n[Extensions.UserExt]||{};n[Extensions.OSExt]=n[Extensions.OSExt]||{};n[Extensions.AppExt]=n[Extensions.AppExt]||{};n[Extensions.TraceExt]=n[Extensions.TraceExt]||{};var r=this.context;r.applySessionContext(e,t);r.applyApplicationContext(e,t);r.applyDeviceContext(e,t);r.applyOperationContext(e,t);r.applyUserContext(e,t);r.applyOperatingSystemContxt(e,t);r.applyWebContext(e,t);r.applyLocationContext(e,t);r.applyInternalContext(e,t);r.cleanUp(e,t)};return t}(BaseTelemetryPlugin);
54
54
  /*!
55
55
  * Application Insights JavaScript SDK - Dependencies Plugin, 2.5.10
56
56
  * Copyright (c) Microsoft and contributors. All rights reserved.
57
- */var strProperties$1="properties";var _objKeys=CoreUtils.objKeys;var _arrForEach$1=CoreUtils.arrForEach;function _calcPerfDuration(e,t,n){var r=0;var i=e[t];var a=e[n];if(i&&a){r=DateTimeUtils.GetDuration(i,a)}return r}function _setPerfDuration(e,t,n,r,i){var a=0;var s=_calcPerfDuration(n,r,i);if(s){a=_setPerfValue(e,t,Util.msToTimeSpan(s))}return a}function _setPerfValue(e,t,n){var r="ajaxPerf";var i=0;if(e&&t&&n){var a=e[r]=e[r]||{};a[t]=n;i=1}return i}function _populatePerfData(e,t){var n=e.perfTiming;var r=t[strProperties$1]||{};var i=0;var a=CoreUtils.isString;var s="name";var o="Start";var u="End";var l="domainLookup";var c="connect";var d="redirect";var f="request";var p="response";var h="duration";var m="startTime";var v=l+o;var g=l+u;var y=c+o;var S=c+u;var b=f+o;var C=f+u;var x=p+o;var w=p+u;var _=d+o;var I=d=u;var A="transferSize";var T="encodedBodySize";var E="decodedBodySize";var F="serverTiming";if(n){i|=_setPerfDuration(r,d,n,_,I);i|=_setPerfDuration(r,l,n,v,g);i|=_setPerfDuration(r,c,n,y,S);i|=_setPerfDuration(r,f,n,b,C);i|=_setPerfDuration(r,p,n,x,w);i|=_setPerfDuration(r,"networkConnect",n,m,S);i|=_setPerfDuration(r,"sentRequest",n,b,w);var N=n[h];if(!N){N=_calcPerfDuration(n,m,w)||0}i|=_setPerfValue(r,h,N);i|=_setPerfValue(r,"perfTotal",N);var P=n[F];if(P){var k={};_arrForEach$1(P,(function(e,t){var n=normalizeJsName(e[s]||""+t);var r=k[n]||{};objForEachKey(e,(function(e,t){if(e!==s&&a(t)||CoreUtils.isNumber(t)){if(r[e]){t=r[e]+";"+t}if(t||!a(t)){r[e]=t}}}));k[n]=r}));i|=_setPerfValue(r,F,k)}i|=_setPerfValue(r,A,n[A]);i|=_setPerfValue(r,T,n[T]);i|=_setPerfValue(r,E,n[E])}else{if(e.perfMark){i|=_setPerfValue(r,"missing",e.perfAttempts)}}if(i){t[strProperties$1]=r}}var XHRMonitoringState=function(){function e(){var e=this;e.openDone=false;e.setRequestHeaderDone=false;e.sendDone=false;e.abortDone=false;e.stateChangeAttached=false}return e}();var ajaxRecord=function(){function e(t,n,r){var i=this;var a=r;var s="responseText";i.perfMark=null;i.completed=false;i.requestHeadersSize=null;i.requestHeaders=null;i.responseReceivingDuration=null;i.callbackDuration=null;i.ajaxTotalDuration=null;i.aborted=0;i.pageUrl=null;i.requestUrl=null;i.requestSize=0;i.method=null;i.status=null;i.requestSentTime=null;i.responseStartedTime=null;i.responseFinishedTime=null;i.callbackFinishedTime=null;i.endTime=null;i.xhrMonitoringState=new XHRMonitoringState;i.clientFailure=0;i.traceID=t;i.spanID=n;dynamicProto(e,i,(function(e){e.getAbsoluteUrl=function(){return e.requestUrl?UrlHelper.getAbsoluteUrl(e.requestUrl):null};e.getPathName=function(){return e.requestUrl?DataSanitizer.sanitizeUrl(a,UrlHelper.getCompleteUrl(e.method,e.requestUrl)):null};e.CreateTrackItem=function(t,n,r){e.ajaxTotalDuration=Math.round(DateTimeUtils.GetDuration(e.requestSentTime,e.responseFinishedTime)*1e3)/1e3;if(e.ajaxTotalDuration<0){return null}var i=(l={id:"|"+e.traceID+"."+e.spanID,target:e.getAbsoluteUrl(),name:e.getPathName(),type:t,duration:e.ajaxTotalDuration,success:+e.status>=200&&+e.status<400,responseCode:+e.status,method:e.method},l[strProperties$1]={HttpMethod:e.method},l);_populatePerfData(e,i);if(n){if(_objKeys(e.requestHeaders).length>0){i[strProperties$1]=i[strProperties$1]||{};i[strProperties$1].requestHeaders=e.requestHeaders}}if(r){var a=r();if(a){var o=a.correlationContext;if(o){i.correlationContext=o}if(a.headerMap){if(_objKeys(a.headerMap).length>0){i[strProperties$1]=i[strProperties$1]||{};i[strProperties$1].responseHeaders=a.headerMap}}if(e.status>=400){var u=a.type;i[strProperties$1]=i[strProperties$1]||{};if(u===""||u==="text"){i[strProperties$1][s]=a[s]?a.statusText+" - "+a[s]:a.statusText}if(u==="json"){i[strProperties$1][s]=a.response?a.statusText+" - "+JSON.stringify(a.response):a.statusText}}}}return i;var l}}))}return e}();
57
+ */var strProperties$1="properties";var _objKeys=CoreUtils.objKeys;var _arrForEach$1=CoreUtils.arrForEach;function _calcPerfDuration(e,t,n){var r=0;var i=e[t];var a=e[n];if(i&&a){r=DateTimeUtils.GetDuration(i,a)}return r}function _setPerfDuration(e,t,n,r,i){var a=0;var s=_calcPerfDuration(n,r,i);if(s){a=_setPerfValue(e,t,Util.msToTimeSpan(s))}return a}function _setPerfValue(e,t,n){var r="ajaxPerf";var i=0;if(e&&t&&n){var a=e[r]=e[r]||{};a[t]=n;i=1}return i}function _populatePerfData(e,t){var n=e.perfTiming;var r=t[strProperties$1]||{};var i=0;var a=CoreUtils.isString;var s="name";var o="Start";var u="End";var l="domainLookup";var c="connect";var d="redirect";var f="request";var p="response";var h="duration";var m="startTime";var v=l+o;var g=l+u;var y=c+o;var S=c+u;var b=f+o;var x=f+u;var C=p+o;var w=p+u;var _=d+o;var I=d=u;var A="transferSize";var E="encodedBodySize";var T="decodedBodySize";var F="serverTiming";if(n){i|=_setPerfDuration(r,d,n,_,I);i|=_setPerfDuration(r,l,n,v,g);i|=_setPerfDuration(r,c,n,y,S);i|=_setPerfDuration(r,f,n,b,x);i|=_setPerfDuration(r,p,n,C,w);i|=_setPerfDuration(r,"networkConnect",n,m,S);i|=_setPerfDuration(r,"sentRequest",n,b,w);var N=n[h];if(!N){N=_calcPerfDuration(n,m,w)||0}i|=_setPerfValue(r,h,N);i|=_setPerfValue(r,"perfTotal",N);var P=n[F];if(P){var D={};_arrForEach$1(P,(function(e,t){var n=normalizeJsName(e[s]||""+t);var r=D[n]||{};objForEachKey(e,(function(e,t){if(e!==s&&a(t)||CoreUtils.isNumber(t)){if(r[e]){t=r[e]+";"+t}if(t||!a(t)){r[e]=t}}}));D[n]=r}));i|=_setPerfValue(r,F,D)}i|=_setPerfValue(r,A,n[A]);i|=_setPerfValue(r,E,n[E]);i|=_setPerfValue(r,T,n[T])}else{if(e.perfMark){i|=_setPerfValue(r,"missing",e.perfAttempts)}}if(i){t[strProperties$1]=r}}var XHRMonitoringState=function(){function e(){var e=this;e.openDone=false;e.setRequestHeaderDone=false;e.sendDone=false;e.abortDone=false;e.stateChangeAttached=false}return e}();var ajaxRecord=function(){function e(t,n,r){var i=this;var a=r;var s="responseText";i.perfMark=null;i.completed=false;i.requestHeadersSize=null;i.requestHeaders=null;i.responseReceivingDuration=null;i.callbackDuration=null;i.ajaxTotalDuration=null;i.aborted=0;i.pageUrl=null;i.requestUrl=null;i.requestSize=0;i.method=null;i.status=null;i.requestSentTime=null;i.responseStartedTime=null;i.responseFinishedTime=null;i.callbackFinishedTime=null;i.endTime=null;i.xhrMonitoringState=new XHRMonitoringState;i.clientFailure=0;i.traceID=t;i.spanID=n;dynamicProto(e,i,(function(e){e.getAbsoluteUrl=function(){return e.requestUrl?UrlHelper.getAbsoluteUrl(e.requestUrl):null};e.getPathName=function(){return e.requestUrl?DataSanitizer.sanitizeUrl(a,UrlHelper.getCompleteUrl(e.method,e.requestUrl)):null};e.CreateTrackItem=function(t,n,r){e.ajaxTotalDuration=Math.round(DateTimeUtils.GetDuration(e.requestSentTime,e.responseFinishedTime)*1e3)/1e3;if(e.ajaxTotalDuration<0){return null}var i=(l={id:"|"+e.traceID+"."+e.spanID,target:e.getAbsoluteUrl(),name:e.getPathName(),type:t,duration:e.ajaxTotalDuration,success:+e.status>=200&&+e.status<400,responseCode:+e.status,method:e.method},l[strProperties$1]={HttpMethod:e.method},l);_populatePerfData(e,i);if(n){if(_objKeys(e.requestHeaders).length>0){i[strProperties$1]=i[strProperties$1]||{};i[strProperties$1].requestHeaders=e.requestHeaders}}if(r){var a=r();if(a){var o=a.correlationContext;if(o){i.correlationContext=o}if(a.headerMap){if(_objKeys(a.headerMap).length>0){i[strProperties$1]=i[strProperties$1]||{};i[strProperties$1].responseHeaders=a.headerMap}}if(e.status>=400){var u=a.type;i[strProperties$1]=i[strProperties$1]||{};if(u===""||u==="text"){i[strProperties$1][s]=a[s]?a.statusText+" - "+a[s]:a.statusText}if(u==="json"){i[strProperties$1][s]=a.response?a.statusText+" - "+JSON.stringify(a.response):a.statusText}}}}return i;var l}}))}return e}();
58
58
  /*!
59
59
  * Application Insights JavaScript SDK - Dependencies Plugin, 2.5.10
60
60
  * Copyright (c) Microsoft and contributors. All rights reserved.
@@ -62,8 +62,8 @@ var __extends=this&&this.__extends||function(){var e=function(t,n){e=Object.setP
62
62
  /*!
63
63
  * Application Insights JavaScript SDK - Dependencies Plugin, 2.5.10
64
64
  * Copyright (c) Microsoft and contributors. All rights reserved.
65
- */var AJAX_MONITOR_PREFIX="ai.ajxmn.";var strDiagLog="diagLog";var strAjaxData="ajaxData";var strThrowInternal="throwInternal";var strFetch="fetch";var _isNullOrUndefined$3=CoreUtils.isNullOrUndefined;var _arrForEach$2=CoreUtils.arrForEach;var _markCount=0;function _supportsFetch(){var e=getGlobal$1();if(!e||_isNullOrUndefined$3(e.Request)||_isNullOrUndefined$3(e.Request[strPrototype])||_isNullOrUndefined$3(e[strFetch])){return null}return e[strFetch]}function _supportsAjaxMonitoring(e){var t=false;if(typeof XMLHttpRequest!==strUndefined&&!_isNullOrUndefined$3(XMLHttpRequest)){var n=XMLHttpRequest[strPrototype];t=!_isNullOrUndefined$3(n)&&!_isNullOrUndefined$3(n.open)&&!_isNullOrUndefined$3(n.send)&&!_isNullOrUndefined$3(n.abort)}var r=Util.getIEVersion();if(r&&r<9){t=false}if(t){try{var i=new XMLHttpRequest;i[strAjaxData]={};var a=XMLHttpRequest[strPrototype].open;XMLHttpRequest[strPrototype].open=a}catch(n){t=false;_throwInternalCritical(e,_InternalMessageId.FailedMonitorAjaxOpen,"Failed to enable XMLHttpRequest monitoring, extension is not supported",{exception:Util.dump(n)})}}return t}function _getFailedAjaxDiagnosticsMessage(e){var t="";try{if(!_isNullOrUndefined$3(e)&&!_isNullOrUndefined$3(e[strAjaxData])&&!_isNullOrUndefined$3(e[strAjaxData].requestUrl)){t+="(url: '"+e[strAjaxData].requestUrl+"')"}}catch(e){}return t}function _throwInternalCritical(e,t,n,r,i){e[strDiagLog]()[strThrowInternal](LoggingSeverity.CRITICAL,t,n,r,i)}function _throwInternalWarning(e,t,n,r,i){e[strDiagLog]()[strThrowInternal](LoggingSeverity.WARNING,t,n,r,i)}function _createErrorCallbackFunc(e,t,n){return function(r){_throwInternalCritical(e,t,n,{ajaxDiagnosticsMessage:_getFailedAjaxDiagnosticsMessage(r.inst),exception:Util.dump(r.err)})}}function _indexOf(e,t){if(e&&t){return e.indexOf(t)}return-1}var AjaxMonitor=function(e){__extends(t,e);function t(){var n=e.call(this)||this;n.identifier=t.identifier;n.priority=120;var r="trackDependencyDataInternal";var i=getLocation();var a=false;var s=false;var o=i&&i.host&&i.host.toLowerCase();var u=t.getEmptyConfig();var l=false;var c=0;var d;var f;var p;var h;var m=false;var v=0;var g=false;var y=[];var S={};dynamicProto(t,n,(function(e,n){e.initialize=function(r,a,s,o){if(!e.isInitialized()){n.initialize(r,a,s,o);var c=e._getTelCtx();var y=t.getDefaultConfig();objForEachKey(y,(function(e,n){u[e]=c.getConfig(t.identifier,e,n)}));var S=u.distributedTracingMode;l=u.enableRequestHeaderTracking;m=u.enableAjaxPerfTracking;v=u.maxAjaxCallsPerView;g=u.enableResponseHeaderTracking;p=S===DistributedTracingModes.AI||S===DistributedTracingModes.AI_AND_W3C;f=S===DistributedTracingModes.AI_AND_W3C||S===DistributedTracingModes.W3C;if(m){var b=r.instrumentationKey||"unkwn";if(b.length>5){h=AJAX_MONITOR_PREFIX+b.substring(b.length-5)+"."}else{h=AJAX_MONITOR_PREFIX+b+"."}}if(u.disableAjaxTracking===false){C()}i();if(s.length>0&&s){var x=void 0,w=0;while(!x&&w<s.length){if(s[w]&&s[w].identifier===PropertiesPluginIdentifier){x=s[w]}w++}if(x){d=x.context}}}};e.teardown=function(){_arrForEach$2(y,(function(e){e.rm()}));y=[];a=false;s=false;e.setInitialized(false)};e.trackDependencyData=function(t,n){e[r](t,n)};e.includeCorrelationHeaders=function(t,n,r,i){var a=e["_currentWindowHost"]||o;if(n){if(CorrelationIdHelper.canIncludeCorrelationHeader(u,t.getAbsoluteUrl(),a)){if(!r){r={}}r.headers=new Headers(r.headers||(n instanceof Request?n.headers||{}:{}));if(p){var s="|"+t.traceID+"."+t.spanID;r.headers.set(RequestHeaders.requestIdHeader,s);if(l){t.requestHeaders[RequestHeaders.requestIdHeader]=s}}var c=u.appId||d&&d.appId();if(c){r.headers.set(RequestHeaders.requestContextHeader,RequestHeaders.requestContextAppIdFormat+c);if(l){t.requestHeaders[RequestHeaders.requestContextHeader]=RequestHeaders.requestContextAppIdFormat+c}}if(f){var h=new Traceparent(t.traceID,t.spanID);r.headers.set(RequestHeaders.traceParentHeader,h.toString());if(l){t.requestHeaders[RequestHeaders.traceParentHeader]=h.toString()}}}return r}else if(i){if(CorrelationIdHelper.canIncludeCorrelationHeader(u,t.getAbsoluteUrl(),a)){if(p){var s="|"+t.traceID+"."+t.spanID;i.setRequestHeader(RequestHeaders.requestIdHeader,s);if(l){t.requestHeaders[RequestHeaders.requestIdHeader]=s}}var c=u.appId||d&&d.appId();if(c){i.setRequestHeader(RequestHeaders.requestContextHeader,RequestHeaders.requestContextAppIdFormat+c);if(l){t.requestHeaders[RequestHeaders.requestContextHeader]=RequestHeaders.requestContextAppIdFormat+c}}if(f){var h=new Traceparent(t.traceID,t.spanID);i.setRequestHeader(RequestHeaders.traceParentHeader,h.toString());if(l){t.requestHeaders[RequestHeaders.traceParentHeader]=h.toString()}}}return i}return undefined};e[r]=function(t,n,r){if(v===-1||c<v){if((u.distributedTracingMode===DistributedTracingModes.W3C||u.distributedTracingMode===DistributedTracingModes.AI_AND_W3C)&&typeof t.id==="string"&&t.id[t.id.length-1]!=="."){t.id+="."}if(CoreUtils.isNullOrUndefined(t.startTime)){t.startTime=new Date}var i=TelemetryItemCreator.create(t,RemoteDependencyData$1.dataType,RemoteDependencyData$1.envelopeType,e[strDiagLog](),n,r);e.core.track(i)}else if(c===v){_throwInternalCritical(e,_InternalMessageId.MaxAjaxPerPVExceeded,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",true)}++c};function i(){var t=_supportsFetch();if(!t){return}var n=getGlobal$1();var r=t.polyfill;if(u.disableFetchTracking===false){y.push(InstrumentFunc(n,strFetch,{req:function(t,n,i){var o;if(a&&!x(null,n,i)&&!(r&&s)){var u=t.ctx();o=P(n,i);var l=e.includeCorrelationHeaders(o,n,i);if(l!==i){t.set(1,l)}u.data=o}},rsp:function(e,t){var n=e.ctx().data;if(n){e.rslt=e.rslt.then((function(t){D(e,(t||{}).status,t,n,(function(){var e={statusText:t.statusText,headerMap:null,correlationContext:U(t)};if(g){var n={};t.headers.forEach((function(e,t){n[t]=e}));e.headerMap=n}return e}));return t}))["catch"]((function(r){D(e,0,t,n,null);throw r}))}},hkErr:_createErrorCallbackFunc(e,_InternalMessageId.FailedMonitorAjaxOpen,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.")}));a=true}else if(r){y.push(InstrumentFunc(n,strFetch,{req:function(e,t,n){x(null,t,n)}}))}if(r){n[strFetch].polyfill=r}}function b(e,t,n){y.push(InstrumentProto(e,t,n))}function C(){if(_supportsAjaxMonitoring(e)&&!s){b(XMLHttpRequest,"open",{req:function(e,t,n,r){var i=e.inst;var a=i[strAjaxData];if(!x(i,n)&&w(i,true)&&(!a||!a.xhrMonitoringState.openDone)){_(i,t,n,r)}},hkErr:_createErrorCallbackFunc(e,_InternalMessageId.FailedMonitorAjaxOpen,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")});b(XMLHttpRequest,"send",{req:function(t,n){var r=t.inst;var i=r[strAjaxData];if(w(r)&&!i.xhrMonitoringState.sendDone){F("xhr",i);i.requestSentTime=DateTimeUtils.Now();r=e.includeCorrelationHeaders(i,undefined,undefined,r);i.xhrMonitoringState.sendDone=true}},hkErr:_createErrorCallbackFunc(e,_InternalMessageId.FailedMonitorAjaxSend,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.")});b(XMLHttpRequest,"abort",{req:function(e){var t=e.inst;var n=t[strAjaxData];if(w(t)&&!n.xhrMonitoringState.abortDone){n.aborted=1;n.xhrMonitoringState.abortDone=true}},hkErr:_createErrorCallbackFunc(e,_InternalMessageId.FailedMonitorAjaxAbort,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.")});if(l){b(XMLHttpRequest,"setRequestHeader",{req:function(e,t,n){var r=e.inst;if(w(r)){r[strAjaxData].requestHeaders[t]=n}},hkErr:_createErrorCallbackFunc(e,_InternalMessageId.FailedMonitorAjaxSetRequestHeader,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.")})}s=true}}function x(e,t,n){var r=false;var i=((!CoreUtils.isString(t)?(t||{}).url||"":t)||"").toLowerCase();var a=_indexOf(i,"?");var s=_indexOf(i,"#");if(a===-1||s!==-1&&s<a){a=s}if(a!==-1){i=i.substring(0,a)}if(!_isNullOrUndefined$3(e)){r=e[DisabledPropertyName]===true||i[DisabledPropertyName]===true}else if(!_isNullOrUndefined$3(t)){r=(typeof t==="object"?t[DisabledPropertyName]===true:false)||(n?n[DisabledPropertyName]===true:false)}if(r){if(!S[i]){S[i]=1}}else{if(S[i]){r=true}}return r}function w(e,t){var n=true;var r=s;if(!_isNullOrUndefined$3(e)){n=t===true||!_isNullOrUndefined$3(e[strAjaxData])}return r&&n}function _(t,n,r,i){var a=d&&d.telemetryTrace&&d.telemetryTrace.traceID||Util.generateW3CId();var s=Util.generateW3CId().substr(0,16);var o=new ajaxRecord(a,s,e[strDiagLog]());o.method=n;o.requestUrl=r;o.xhrMonitoringState.openDone=true;o.requestHeaders={};o.async=i;t[strAjaxData]=o;I(t)}function I(t){t[strAjaxData].xhrMonitoringState.stateChangeAttached=EventHelper.Attach(t,"readystatechange",(function(){try{if(t&&t.readyState===4&&w(t)){T(t)}}catch(r){var n=Util.dump(r);if(!n||_indexOf(n.toLowerCase(),"c00c023f")===-1){_throwInternalCritical(e,_InternalMessageId.FailedMonitorAjaxRSC,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_getFailedAjaxDiagnosticsMessage(t),exception:n})}}}))}function A(e){try{var t=e.responseType;if(t===""||t==="text"){return e.responseText}}catch(e){}return null}function T(t){var n=t[strAjaxData];n.responseFinishedTime=DateTimeUtils.Now();n.status=t.status;function i(n,r){var i=r||{};i["ajaxDiagnosticsMessage"]=_getFailedAjaxDiagnosticsMessage(t);if(n){i["exception"]=Util.dump(n)}_throwInternalWarning(e,_InternalMessageId.FailedMonitorAjaxDur,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",i)}N("xmlhttprequest",n,(function(){try{var a=n.CreateTrackItem("Ajax",l,(function(){var e={statusText:t.statusText,headerMap:null,correlationContext:E(t),type:t.responseType,responseText:A(t),response:t.response};if(g){var n=t.getAllResponseHeaders();if(n){var r=CoreUtils.strTrim(n).split(/[\r\n]+/);var i={};_arrForEach$2(r,(function(e){var t=e.split(": ");var n=t.shift();var r=t.join(": ");i[n]=r}));e.headerMap=i}}return e}));if(a){e[r](a)}else{i(null,{requestSentTime:n.requestSentTime,responseFinishedTime:n.responseFinishedTime})}}finally{try{t[strAjaxData]=null}catch(e){}}}),(function(e){i(e,null)}))}function E(t){try{var n=t.getAllResponseHeaders();if(n!==null){var r=_indexOf(n.toLowerCase(),RequestHeaders.requestContextHeaderLowerCase);if(r!==-1){var i=t.getResponseHeader(RequestHeaders.requestContextHeader);return CorrelationIdHelper.getCorrelationContext(i)}}}catch(n){_throwInternalWarning(e,_InternalMessageId.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:_getFailedAjaxDiagnosticsMessage(t),exception:Util.dump(n)})}}function F(e,t){if(t.requestUrl&&h&&m){var n=getPerformance();if(n&&CoreUtils.isFunction(n.mark)){_markCount++;var r=h+e+"#"+_markCount;n.mark(r);var i=n.getEntriesByName(r);if(i&&i.length===1){t.perfMark=i[0]}}}}function N(e,t,n,r){var i=t.perfMark;var a=getPerformance();var s=u.maxAjaxPerfLookupAttempts;var o=u.ajaxPerfLookupDelay;var l=t.requestUrl;var c=0;(function u(){try{if(a&&i){c++;var d=null;var f=a.getEntries();for(var p=f.length-1;p>=0;p--){var h=f[p];if(h){if(h.entryType==="resource"){if(h.initiatorType===e&&(_indexOf(h.name,l)!==-1||_indexOf(l,h.name)!==-1)){d=h}}else if(h.entryType==="mark"&&h.name===i.name){t.perfTiming=d;break}if(h.startTime<i.startTime-1e3){break}}}}if(!i||t.perfTiming||c>=s||t.async===false){if(i&&CoreUtils.isFunction(a.clearMarks)){a.clearMarks(i.name)}t.perfAttempts=c;n()}else{setTimeout(u,o)}}catch(e){r(e)}})()}function P(t,n){var r=d&&d.telemetryTrace&&d.telemetryTrace.traceID||Util.generateW3CId();var i=Util.generateW3CId().substr(0,16);var a=new ajaxRecord(r,i,e[strDiagLog]());a.requestSentTime=DateTimeUtils.Now();if(t instanceof Request){a.requestUrl=t?t.url:""}else{a.requestUrl=t}var s="GET";if(n&&n.method){s=n.method}else if(t&&t instanceof Request){s=t.method}a.method=s;var o={};if(l){var u=new Headers((n?n.headers:0)||(t instanceof Request?t.headers||{}:{}));u.forEach((function(e,t){o[t]=e}))}a.requestHeaders=o;F("fetch",a);return a}function k(t){var n="";try{if(!_isNullOrUndefined$3(t)){if(typeof t==="string"){n+="(url: '"+t+"')"}else{n+="(url: '"+t.url+"')"}}}catch(t){_throwInternalCritical(e,_InternalMessageId.FailedMonitorAjaxOpen,"Failed to grab failed fetch diagnostics message",{exception:Util.dump(t)})}return n}function D(t,n,i,a,s,o){if(!a){return}function u(t,n,r){var a=r||{};a["fetchDiagnosticsMessage"]=k(i);if(n){a["exception"]=Util.dump(n)}_throwInternalWarning(e,t,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",a)}a.responseFinishedTime=DateTimeUtils.Now();a.status=n;N("fetch",a,(function(){var t=a.CreateTrackItem("Fetch",l,s);if(t){e[r](t)}else{u(_InternalMessageId.FailedMonitorAjaxDur,null,{requestSentTime:a.requestSentTime,responseFinishedTime:a.responseFinishedTime})}}),(function(e){u(_InternalMessageId.FailedMonitorAjaxGetCorrelationHeader,e,null)}))}function U(t){if(t&&t.headers){try{var n=t.headers.get(RequestHeaders.requestContextHeader);return CorrelationIdHelper.getCorrelationContext(n)}catch(n){_throwInternalWarning(e,_InternalMessageId.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:k(t),exception:Util.dump(n)})}}}}));return n}t.getDefaultConfig=function(){var e={maxAjaxCallsPerView:500,disableAjaxTracking:false,disableFetchTracking:true,disableCorrelationHeaders:false,distributedTracingMode:DistributedTracingModes.AI,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:undefined,appId:undefined,enableCorsCorrelation:false,enableRequestHeaderTracking:false,enableResponseHeaderTracking:false,enableAjaxErrorStatusText:false,enableAjaxPerfTracking:false,maxAjaxPerfLookupAttempts:3,ajaxPerfLookupDelay:25};return e};t.getEmptyConfig=function(){var e=this.getDefaultConfig();objForEachKey(e,(function(t){e[t]=undefined}));return e};t.prototype.processTelemetry=function(e,t){this.processNext(e,t)};t.identifier="AjaxDependencyPlugin";return t}(BaseTelemetryPlugin);
65
+ */var AJAX_MONITOR_PREFIX="ai.ajxmn.";var strDiagLog="diagLog";var strAjaxData="ajaxData";var strThrowInternal="throwInternal";var strFetch="fetch";var _isNullOrUndefined$3=CoreUtils.isNullOrUndefined;var _arrForEach$2=CoreUtils.arrForEach;var _markCount=0;function _supportsFetch(){var e=getGlobal$1();if(!e||_isNullOrUndefined$3(e.Request)||_isNullOrUndefined$3(e.Request[strPrototype])||_isNullOrUndefined$3(e[strFetch])){return null}return e[strFetch]}function _supportsAjaxMonitoring(e){var t=false;if(typeof XMLHttpRequest!==strUndefined&&!_isNullOrUndefined$3(XMLHttpRequest)){var n=XMLHttpRequest[strPrototype];t=!_isNullOrUndefined$3(n)&&!_isNullOrUndefined$3(n.open)&&!_isNullOrUndefined$3(n.send)&&!_isNullOrUndefined$3(n.abort)}var r=Util.getIEVersion();if(r&&r<9){t=false}if(t){try{var i=new XMLHttpRequest;i[strAjaxData]={};var a=XMLHttpRequest[strPrototype].open;XMLHttpRequest[strPrototype].open=a}catch(n){t=false;_throwInternalCritical(e,_InternalMessageId.FailedMonitorAjaxOpen,"Failed to enable XMLHttpRequest monitoring, extension is not supported",{exception:Util.dump(n)})}}return t}function _getFailedAjaxDiagnosticsMessage(e){var t="";try{if(!_isNullOrUndefined$3(e)&&!_isNullOrUndefined$3(e[strAjaxData])&&!_isNullOrUndefined$3(e[strAjaxData].requestUrl)){t+="(url: '"+e[strAjaxData].requestUrl+"')"}}catch(e){}return t}function _throwInternalCritical(e,t,n,r,i){e[strDiagLog]()[strThrowInternal](LoggingSeverity.CRITICAL,t,n,r,i)}function _throwInternalWarning(e,t,n,r,i){e[strDiagLog]()[strThrowInternal](LoggingSeverity.WARNING,t,n,r,i)}function _createErrorCallbackFunc(e,t,n){return function(r){_throwInternalCritical(e,t,n,{ajaxDiagnosticsMessage:_getFailedAjaxDiagnosticsMessage(r.inst),exception:Util.dump(r.err)})}}function _indexOf(e,t){if(e&&t){return e.indexOf(t)}return-1}var AjaxMonitor=function(e){__extends(t,e);function t(){var n=e.call(this)||this;n.identifier=t.identifier;n.priority=120;var r="trackDependencyDataInternal";var i=getLocation();var a=false;var s=false;var o=i&&i.host&&i.host.toLowerCase();var u=t.getEmptyConfig();var l=false;var c=0;var d;var f;var p;var h;var m=false;var v=0;var g=false;var y=[];var S={};dynamicProto(t,n,(function(e,n){e.initialize=function(r,a,s,o){if(!e.isInitialized()){n.initialize(r,a,s,o);var c=e._getTelCtx();var y=t.getDefaultConfig();objForEachKey(y,(function(e,n){u[e]=c.getConfig(t.identifier,e,n)}));var S=u.distributedTracingMode;l=u.enableRequestHeaderTracking;m=u.enableAjaxPerfTracking;v=u.maxAjaxCallsPerView;g=u.enableResponseHeaderTracking;p=S===DistributedTracingModes.AI||S===DistributedTracingModes.AI_AND_W3C;f=S===DistributedTracingModes.AI_AND_W3C||S===DistributedTracingModes.W3C;if(m){var b=r.instrumentationKey||"unkwn";if(b.length>5){h=AJAX_MONITOR_PREFIX+b.substring(b.length-5)+"."}else{h=AJAX_MONITOR_PREFIX+b+"."}}if(u.disableAjaxTracking===false){x()}i();if(s.length>0&&s){var C=void 0,w=0;while(!C&&w<s.length){if(s[w]&&s[w].identifier===PropertiesPluginIdentifier){C=s[w]}w++}if(C){d=C.context}}}};e.teardown=function(){_arrForEach$2(y,(function(e){e.rm()}));y=[];a=false;s=false;e.setInitialized(false)};e.trackDependencyData=function(t,n){e[r](t,n)};e.includeCorrelationHeaders=function(t,n,r,i){var a=e["_currentWindowHost"]||o;if(n){if(CorrelationIdHelper.canIncludeCorrelationHeader(u,t.getAbsoluteUrl(),a)){if(!r){r={}}r.headers=new Headers(r.headers||(n instanceof Request?n.headers||{}:{}));if(p){var s="|"+t.traceID+"."+t.spanID;r.headers.set(RequestHeaders.requestIdHeader,s);if(l){t.requestHeaders[RequestHeaders.requestIdHeader]=s}}var c=u.appId||d&&d.appId();if(c){r.headers.set(RequestHeaders.requestContextHeader,RequestHeaders.requestContextAppIdFormat+c);if(l){t.requestHeaders[RequestHeaders.requestContextHeader]=RequestHeaders.requestContextAppIdFormat+c}}if(f){var h=new Traceparent(t.traceID,t.spanID);r.headers.set(RequestHeaders.traceParentHeader,h.toString());if(l){t.requestHeaders[RequestHeaders.traceParentHeader]=h.toString()}}}return r}else if(i){if(CorrelationIdHelper.canIncludeCorrelationHeader(u,t.getAbsoluteUrl(),a)){if(p){var s="|"+t.traceID+"."+t.spanID;i.setRequestHeader(RequestHeaders.requestIdHeader,s);if(l){t.requestHeaders[RequestHeaders.requestIdHeader]=s}}var c=u.appId||d&&d.appId();if(c){i.setRequestHeader(RequestHeaders.requestContextHeader,RequestHeaders.requestContextAppIdFormat+c);if(l){t.requestHeaders[RequestHeaders.requestContextHeader]=RequestHeaders.requestContextAppIdFormat+c}}if(f){var h=new Traceparent(t.traceID,t.spanID);i.setRequestHeader(RequestHeaders.traceParentHeader,h.toString());if(l){t.requestHeaders[RequestHeaders.traceParentHeader]=h.toString()}}}return i}return undefined};e[r]=function(t,n,r){if(v===-1||c<v){if((u.distributedTracingMode===DistributedTracingModes.W3C||u.distributedTracingMode===DistributedTracingModes.AI_AND_W3C)&&typeof t.id==="string"&&t.id[t.id.length-1]!=="."){t.id+="."}if(CoreUtils.isNullOrUndefined(t.startTime)){t.startTime=new Date}var i=TelemetryItemCreator.create(t,RemoteDependencyData$1.dataType,RemoteDependencyData$1.envelopeType,e[strDiagLog](),n,r);e.core.track(i)}else if(c===v){_throwInternalCritical(e,_InternalMessageId.MaxAjaxPerPVExceeded,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",true)}++c};function i(){var t=_supportsFetch();if(!t){return}var n=getGlobal$1();var r=t.polyfill;if(u.disableFetchTracking===false){y.push(InstrumentFunc(n,strFetch,{req:function(t,n,i){var o;if(a&&!C(null,n,i)&&!(r&&s)){var u=t.ctx();o=P(n,i);var l=e.includeCorrelationHeaders(o,n,i);if(l!==i){t.set(1,l)}u.data=o}},rsp:function(e,t){var n=e.ctx().data;if(n){e.rslt=e.rslt.then((function(t){k(e,(t||{}).status,t,n,(function(){var e={statusText:t.statusText,headerMap:null,correlationContext:U(t)};if(g){var n={};t.headers.forEach((function(e,t){n[t]=e}));e.headerMap=n}return e}));return t}))["catch"]((function(r){k(e,0,t,n,null);throw r}))}},hkErr:_createErrorCallbackFunc(e,_InternalMessageId.FailedMonitorAjaxOpen,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.")}));a=true}else if(r){y.push(InstrumentFunc(n,strFetch,{req:function(e,t,n){C(null,t,n)}}))}if(r){n[strFetch].polyfill=r}}function b(e,t,n){y.push(InstrumentProto(e,t,n))}function x(){if(_supportsAjaxMonitoring(e)&&!s){b(XMLHttpRequest,"open",{req:function(e,t,n,r){var i=e.inst;var a=i[strAjaxData];if(!C(i,n)&&w(i,true)&&(!a||!a.xhrMonitoringState.openDone)){_(i,t,n,r)}},hkErr:_createErrorCallbackFunc(e,_InternalMessageId.FailedMonitorAjaxOpen,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")});b(XMLHttpRequest,"send",{req:function(t,n){var r=t.inst;var i=r[strAjaxData];if(w(r)&&!i.xhrMonitoringState.sendDone){F("xhr",i);i.requestSentTime=DateTimeUtils.Now();r=e.includeCorrelationHeaders(i,undefined,undefined,r);i.xhrMonitoringState.sendDone=true}},hkErr:_createErrorCallbackFunc(e,_InternalMessageId.FailedMonitorAjaxSend,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.")});b(XMLHttpRequest,"abort",{req:function(e){var t=e.inst;var n=t[strAjaxData];if(w(t)&&!n.xhrMonitoringState.abortDone){n.aborted=1;n.xhrMonitoringState.abortDone=true}},hkErr:_createErrorCallbackFunc(e,_InternalMessageId.FailedMonitorAjaxAbort,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.")});if(l){b(XMLHttpRequest,"setRequestHeader",{req:function(e,t,n){var r=e.inst;if(w(r)){r[strAjaxData].requestHeaders[t]=n}},hkErr:_createErrorCallbackFunc(e,_InternalMessageId.FailedMonitorAjaxSetRequestHeader,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.")})}s=true}}function C(e,t,n){var r=false;var i=((!CoreUtils.isString(t)?(t||{}).url||"":t)||"").toLowerCase();var a=_indexOf(i,"?");var s=_indexOf(i,"#");if(a===-1||s!==-1&&s<a){a=s}if(a!==-1){i=i.substring(0,a)}if(!_isNullOrUndefined$3(e)){r=e[DisabledPropertyName]===true||i[DisabledPropertyName]===true}else if(!_isNullOrUndefined$3(t)){r=(typeof t==="object"?t[DisabledPropertyName]===true:false)||(n?n[DisabledPropertyName]===true:false)}if(r){if(!S[i]){S[i]=1}}else{if(S[i]){r=true}}return r}function w(e,t){var n=true;var r=s;if(!_isNullOrUndefined$3(e)){n=t===true||!_isNullOrUndefined$3(e[strAjaxData])}return r&&n}function _(t,n,r,i){var a=d&&d.telemetryTrace&&d.telemetryTrace.traceID||Util.generateW3CId();var s=Util.generateW3CId().substr(0,16);var o=new ajaxRecord(a,s,e[strDiagLog]());o.method=n;o.requestUrl=r;o.xhrMonitoringState.openDone=true;o.requestHeaders={};o.async=i;t[strAjaxData]=o;I(t)}function I(t){t[strAjaxData].xhrMonitoringState.stateChangeAttached=EventHelper.Attach(t,"readystatechange",(function(){try{if(t&&t.readyState===4&&w(t)){E(t)}}catch(r){var n=Util.dump(r);if(!n||_indexOf(n.toLowerCase(),"c00c023f")===-1){_throwInternalCritical(e,_InternalMessageId.FailedMonitorAjaxRSC,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_getFailedAjaxDiagnosticsMessage(t),exception:n})}}}))}function A(e){try{var t=e.responseType;if(t===""||t==="text"){return e.responseText}}catch(e){}return null}function E(t){var n=t[strAjaxData];n.responseFinishedTime=DateTimeUtils.Now();n.status=t.status;function i(n,r){var i=r||{};i["ajaxDiagnosticsMessage"]=_getFailedAjaxDiagnosticsMessage(t);if(n){i["exception"]=Util.dump(n)}_throwInternalWarning(e,_InternalMessageId.FailedMonitorAjaxDur,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",i)}N("xmlhttprequest",n,(function(){try{var a=n.CreateTrackItem("Ajax",l,(function(){var e={statusText:t.statusText,headerMap:null,correlationContext:T(t),type:t.responseType,responseText:A(t),response:t.response};if(g){var n=t.getAllResponseHeaders();if(n){var r=CoreUtils.strTrim(n).split(/[\r\n]+/);var i={};_arrForEach$2(r,(function(e){var t=e.split(": ");var n=t.shift();var r=t.join(": ");i[n]=r}));e.headerMap=i}}return e}));if(a){e[r](a)}else{i(null,{requestSentTime:n.requestSentTime,responseFinishedTime:n.responseFinishedTime})}}finally{try{t[strAjaxData]=null}catch(e){}}}),(function(e){i(e,null)}))}function T(t){try{var n=t.getAllResponseHeaders();if(n!==null){var r=_indexOf(n.toLowerCase(),RequestHeaders.requestContextHeaderLowerCase);if(r!==-1){var i=t.getResponseHeader(RequestHeaders.requestContextHeader);return CorrelationIdHelper.getCorrelationContext(i)}}}catch(n){_throwInternalWarning(e,_InternalMessageId.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:_getFailedAjaxDiagnosticsMessage(t),exception:Util.dump(n)})}}function F(e,t){if(t.requestUrl&&h&&m){var n=getPerformance();if(n&&CoreUtils.isFunction(n.mark)){_markCount++;var r=h+e+"#"+_markCount;n.mark(r);var i=n.getEntriesByName(r);if(i&&i.length===1){t.perfMark=i[0]}}}}function N(e,t,n,r){var i=t.perfMark;var a=getPerformance();var s=u.maxAjaxPerfLookupAttempts;var o=u.ajaxPerfLookupDelay;var l=t.requestUrl;var c=0;(function u(){try{if(a&&i){c++;var d=null;var f=a.getEntries();for(var p=f.length-1;p>=0;p--){var h=f[p];if(h){if(h.entryType==="resource"){if(h.initiatorType===e&&(_indexOf(h.name,l)!==-1||_indexOf(l,h.name)!==-1)){d=h}}else if(h.entryType==="mark"&&h.name===i.name){t.perfTiming=d;break}if(h.startTime<i.startTime-1e3){break}}}}if(!i||t.perfTiming||c>=s||t.async===false){if(i&&CoreUtils.isFunction(a.clearMarks)){a.clearMarks(i.name)}t.perfAttempts=c;n()}else{setTimeout(u,o)}}catch(e){r(e)}})()}function P(t,n){var r=d&&d.telemetryTrace&&d.telemetryTrace.traceID||Util.generateW3CId();var i=Util.generateW3CId().substr(0,16);var a=new ajaxRecord(r,i,e[strDiagLog]());a.requestSentTime=DateTimeUtils.Now();if(t instanceof Request){a.requestUrl=t?t.url:""}else{a.requestUrl=t}var s="GET";if(n&&n.method){s=n.method}else if(t&&t instanceof Request){s=t.method}a.method=s;var o={};if(l){var u=new Headers((n?n.headers:0)||(t instanceof Request?t.headers||{}:{}));u.forEach((function(e,t){o[t]=e}))}a.requestHeaders=o;F("fetch",a);return a}function D(t){var n="";try{if(!_isNullOrUndefined$3(t)){if(typeof t==="string"){n+="(url: '"+t+"')"}else{n+="(url: '"+t.url+"')"}}}catch(t){_throwInternalCritical(e,_InternalMessageId.FailedMonitorAjaxOpen,"Failed to grab failed fetch diagnostics message",{exception:Util.dump(t)})}return n}function k(t,n,i,a,s,o){if(!a){return}function u(t,n,r){var a=r||{};a["fetchDiagnosticsMessage"]=D(i);if(n){a["exception"]=Util.dump(n)}_throwInternalWarning(e,t,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",a)}a.responseFinishedTime=DateTimeUtils.Now();a.status=n;N("fetch",a,(function(){var t=a.CreateTrackItem("Fetch",l,s);if(t){e[r](t)}else{u(_InternalMessageId.FailedMonitorAjaxDur,null,{requestSentTime:a.requestSentTime,responseFinishedTime:a.responseFinishedTime})}}),(function(e){u(_InternalMessageId.FailedMonitorAjaxGetCorrelationHeader,e,null)}))}function U(t){if(t&&t.headers){try{var n=t.headers.get(RequestHeaders.requestContextHeader);return CorrelationIdHelper.getCorrelationContext(n)}catch(n){_throwInternalWarning(e,_InternalMessageId.FailedMonitorAjaxGetCorrelationHeader,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:D(t),exception:Util.dump(n)})}}}}));return n}t.getDefaultConfig=function(){var e={maxAjaxCallsPerView:500,disableAjaxTracking:false,disableFetchTracking:true,disableCorrelationHeaders:false,distributedTracingMode:DistributedTracingModes.AI,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:undefined,appId:undefined,enableCorsCorrelation:false,enableRequestHeaderTracking:false,enableResponseHeaderTracking:false,enableAjaxErrorStatusText:false,enableAjaxPerfTracking:false,maxAjaxPerfLookupAttempts:3,ajaxPerfLookupDelay:25};return e};t.getEmptyConfig=function(){var e=this.getDefaultConfig();objForEachKey(e,(function(t){e[t]=undefined}));return e};t.prototype.processTelemetry=function(e,t){this.processNext(e,t)};t.identifier="AjaxDependencyPlugin";return t}(BaseTelemetryPlugin);
66
66
  /*!
67
67
  * Application Insights JavaScript SDK - Web, 2.5.10
68
68
  * Copyright (c) Microsoft and contributors. All rights reserved.
69
- */var _internalSdkSrc;var Initialization=function(){function e(e){var t=this;t._snippetVersion=""+(e.sv||e.version||"");e.queue=e.queue||[];e.version=e.version||2;var n=e.config||{};if(n.connectionString){var r=ConnectionStringParser.parse(n.connectionString);var i=r.ingestionendpoint;n.endpointUrl=i?i+"/v2/track":n.endpointUrl;n.instrumentationKey=r.instrumentationkey||n.instrumentationKey}t.appInsights=new ApplicationInsights;t.properties=new PropertiesPlugin;t.dependencies=new AjaxMonitor;t.core=new AppInsightsCore;t.snippet=e;t.config=n;t.getSKUDefaults()}e.prototype.trackEvent=function(e,t){this.appInsights.trackEvent(e,t)};e.prototype.trackPageView=function(e){var t=e||{};this.appInsights.trackPageView(t)};e.prototype.trackPageViewPerformance=function(e){var t=e||{};this.appInsights.trackPageViewPerformance(t)};e.prototype.trackException=function(e){if(!e.exception&&e.error){e.exception=e.error}this.appInsights.trackException(e)};e.prototype._onerror=function(e){this.appInsights._onerror(e)};e.prototype.trackTrace=function(e,t){this.appInsights.trackTrace(e,t)};e.prototype.trackMetric=function(e,t){this.appInsights.trackMetric(e,t)};e.prototype.startTrackPage=function(e){this.appInsights.startTrackPage(e)};e.prototype.stopTrackPage=function(e,t,n,r){this.appInsights.stopTrackPage(e,t,n,r)};e.prototype.startTrackEvent=function(e){this.appInsights.startTrackEvent(e)};e.prototype.stopTrackEvent=function(e,t,n){this.appInsights.stopTrackEvent(e,t,n)};e.prototype.addTelemetryInitializer=function(e){return this.appInsights.addTelemetryInitializer(e)};e.prototype.setAuthenticatedUserContext=function(e,t,n){if(n===void 0){n=false}this.properties.context.user.setAuthenticatedUserContext(e,t,n)};e.prototype.clearAuthenticatedUserContext=function(){this.properties.context.user.clearAuthenticatedUserContext()};e.prototype.trackDependencyData=function(e){this.dependencies.trackDependencyData(e)};e.prototype.flush=function(e){var t=this;if(e===void 0){e=true}doPerf(this.core,(function(){return"AISKU.flush"}),(function(){CoreUtils.arrForEach(t.core.getTransmissionControls(),(function(t){CoreUtils.arrForEach(t,(function(t){t.flush(e)}))}))}),null,e)};e.prototype.onunloadFlush=function(e){if(e===void 0){e=true}CoreUtils.arrForEach(this.core.getTransmissionControls(),(function(t){CoreUtils.arrForEach(t,(function(t){if(t.onunloadFlush){t.onunloadFlush()}else{t.flush(e)}}))}))};e.prototype.loadAppInsights=function(e,t,n){var r=this;if(e===void 0){e=false}var i=this;function a(t){if(t){var n="";if(!CoreUtils.isNullOrUndefined(i._snippetVersion)){n+=i._snippetVersion}if(e){n+=".lg"}if(i.context&&i.context.internal){i.context.internal.snippetVer=n||"-"}objForEachKey(i,(function(e,n){if(CoreUtils.isString(e)&&!CoreUtils.isFunction(n)&&e.substring(0,1)!=="_"){t[e]=n}}))}}if(e&&i.config.extensions&&i.config.extensions.length>0){throw new Error("Extensions not allowed in legacy mode")}doPerf(i.core,(function(){return"AISKU.loadAppInsights"}),(function(){var e=[];var s=new Sender;e.push(s);e.push(i.properties);e.push(i.dependencies);e.push(i.appInsights);i.core.initialize(i.config,e,t,n);i.context=i.properties.context;if(_internalSdkSrc&&i.context){i.context.internal.sdkSrc=_internalSdkSrc}a(i.snippet);i.emptyQueue();i.pollInternalLogs();i.addHousekeepingBeforeUnload(r)}));return i};e.prototype.updateSnippetDefinitions=function(e){objForEachKey(this,(function(t,n){if(CoreUtils.isString(t)){e[t]=n}}))};e.prototype.emptyQueue=function(){var e=this;try{if(Util.isArray(e.snippet.queue)){var t=e.snippet.queue.length;for(var n=0;n<t;n++){var r=e.snippet.queue[n];r()}e.snippet.queue=undefined;delete e.snippet.queue}}catch(e){var i={};if(e&&CoreUtils.isFunction(e.toString)){i.exception=e.toString()}}};e.prototype.pollInternalLogs=function(){this.core.pollInternalLogs()};e.prototype.addHousekeepingBeforeUnload=function(e){if(hasWindow()||hasDocument()){var t=function(){e.onunloadFlush(false);var t=e.appInsights.core["_extensions"][PropertiesPluginIdentifier];if(t&&t.context&&t.context._sessionManager){t.context._sessionManager.backup()}};if(!e.appInsights.config.disableFlushOnBeforeUnload){var n=CoreUtils.addEventHandler("beforeunload",t);n=CoreUtils.addEventHandler("pagehide",t)||n;if(!n&&!isReactNative()){e.appInsights.core.logger.throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.FailedToAddHandlerForOnBeforeUnload,"Could not add handler for beforeunload and pagehide")}}if(!e.appInsights.config.disableFlushOnUnload){CoreUtils.addEventHandler("pagehide",t)}}};e.prototype.getSKUDefaults=function(){var e=this;e.config.diagnosticLogInterval=e.config.diagnosticLogInterval&&e.config.diagnosticLogInterval>0?e.config.diagnosticLogInterval:1e4};return e}();(function(){var e=null;var t=["://js.monitor.azure.com/","://az416426.vo.msecnd.net/"];try{var n=(document||{}).currentScript;if(n){e=n.src}}catch(e){}if(e){try{var r=e.toLowerCase();if(r){var i="";for(var a=0;a<t.length;a++){if(r.indexOf(t[a])!==-1){i="cdn"+(a+1);if(r.indexOf("/scripts/")===-1){if(r.indexOf("/next/")!==-1){i+="-next"}else if(r.indexOf("/beta/")!==-1){i+="-beta"}}_internalSdkSrc=i+"";break}}}}catch(e){}}})();var __decorate=undefined&&undefined.__decorate||function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)if(s=e[o])a=(i<3?s(a):i>3?s(t,n,a):s(t,n))||a;return i>3&&a&&Object.defineProperty(t,n,a),a};var AuthenticationState;(function(e){e[e["Unauthorized"]=0]="Unauthorized";e[e["Authenticated"]=1]="Authenticated";e[e["Error"]=2]="Error"})(AuthenticationState||(AuthenticationState={}));var ReactNativeInteropMode=function(){function e(){}return e}();function createInitialState(){return{authenticationState:AuthenticationState.Unauthorized,jwt:none,reactNativeInterop:none,iframeInterop:none,appConfiguration:none,ignoreExistingSelection:false}}var SessionStore=function(e){__extends(t,e);function t(){return e.call(this,createInitialState())||this}return t}(Store);SessionStore=__decorate([StoreConfig({name:"sss-session",resettable:true})],SessionStore);var sessionStore=new SessionStore;var AppConfigurationQuery=function(e){__extends(t,e);function t(t){var n=e.call(this,t)||this;n.store=t;n.appConfiguration$=n.select((function(e){return e.appConfiguration}));return n}Object.defineProperty(t.prototype,"configuration",{get:function(){var e=this.getValue().appConfiguration;if(isNone(e)){throw Error("App configuration is not yet loaded")}return e.value},enumerable:false,configurable:true});return t}(Query);var appConfigurationQuery=new AppConfigurationQuery(sessionStore);var AppInsightsService=function(){function e(){this.appInsights=new Lazy((function(){return new Initialization({config:{instrumentationKey:appConfigurationQuery.configuration.AppInsightsKey,enableAutoRouteTracking:true,autoTrackPageVisitTime:true,maxBatchInterval:1e3,enableUnhandledPromiseRejectionTracking:true}})}))}e.prototype.init=function(){var e=this;this.appInsights.value.loadAppInsights();setErrorHandler((function(t){return e.appInsightsErrorHandler(t)}))};e.prototype.getAppInsights=function(){return this.appInsights.value};e.prototype.addCustomProperties=function(e){this.appInsights.value.addTelemetryInitializer((function(t){t.data=t.data?t.data:{};for(var n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],a=i[0],s=i[1];t.data[a]=s}}))};e.prototype.trackErrorTrace=function(e){this.appInsights.value.trackTrace({message:e,severityLevel:SeverityLevel.Error})};e.prototype.appInsightsErrorHandler=function(e){this.appInsights.value.trackException({error:e,severityLevel:SeverityLevel.Error});var t=function(e){return console.error(e)};t(e)};return e}();var appInsights=new AppInsightsService;var PromotedFundChoiceApi=function(){function e(){}e.prototype.submitChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/promoted-fund").post(e).badRequest((function(){throw new Error("Failed to process Promoted Fund choice request")})).text()]}))}))};e.prototype.submitDefaultChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/promoted-fund/default").post(e).badRequest((function(){throw new Error("Failed to process Promoted Default Fund choice request")})).text()]}))}))};e.prototype.submitDefaultChoiceWithJoinAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/promoted-fund/default-with-join").post(e).badRequest((function(){throw new Error("Failed to process Promoted Default Fund With Join choice request")})).text()]}))}))};return e}();var promotedFundChoiceApi=new PromotedFundChoiceApi;var SlateChoiceApi=function(){function e(){}e.prototype.submitSlateChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/slate").post(e).badRequest((function(){throw new Error("Failed to process Slate join request")})).text()]}))}))};return e}();var slateChoiceApi=new SlateChoiceApi;var Usi={clean:function(e){return e.replace(/ /g,"")}};var LoadWaitingTimeout=3e4;var PromotedFundJoinedEventHandler=function(){function e(e,t){var n=this;this.handle=function(e){return __awaiter(n,void 0,void 0,(function(){var t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!(e.detail.sender==="super-campaign"||e.detail.sender==="featured-funds"))return[3,6];t=e.detail.fundJoinInfo;n=t.fundType;switch(n){case"Promoted":return[3,1];case"DefinedBenefits":return[3,2];case"PromotedDefault":return[3,4];case"PromotedDefaultWithJoin":return[3,5]}return[3,6];case 1:this.handlePromotedFundJoined(t);return[3,6];case 2:return[4,this.handleDefinedBenefitsJoined(t)];case 3:r.sent();return[3,6];case 4:this.handlePromotedDefaultFundJoined(t);return[3,6];case 5:this.handlePromotedDefaultFundWithJoinWasJoined(t);return[3,6];case 6:return[2,Promise.resolve()]}}))}))};this.stringIsNullOrEmtpty=function(e){return!(typeof e==="string"&&e.trim().length>0)};this.handlePromotedFundJoined=function(e){if(n.stringIsNullOrEmtpty(e.memberNumber)||n.stringIsNullOrEmtpty(e.usi)){appInsights.trackErrorTrace("Super Campaign did not return (Promoted) memberNumber and/or usi");return}var t=Usi.clean(e.usi);var r=Option.toUndefined(superSelectionAppService.defaultFundUsi);navigationService.navigateInternallyToStandardChoice({history:n.history,fundName:e.fundName,promotedFundId:e.fundId,fundDetails:{type:"promoted",fundName:e.fundName,fundUsi:t,memberNumber:e.memberNumber,promotedFundId:e.fundId},handleSubmitFn:function(i){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:if(!(e.fundId===slate.fundId))return[3,2];return[4,slateChoiceApi.submitSlateChoiceAsync(Object.assign({memberNumber:e.memberNumber,memberFirstName:e.memberFirstName,memberFamilyName:e.memberFamilyName,standardChoiceFormSignature:i,defaultFundUsiSet:r,placementId:this.placementId},this.PromotedFundsConfig))];case 1:n.sent();return[3,4];case 2:return[4,promotedFundChoiceApi.submitChoiceAsync(Object.assign({fundId:e.fundId,memberNumber:e.memberNumber,memberFirstName:e.memberFirstName,memberFamilyName:e.memberFamilyName,usi:t,standardChoiceFormSignature:i,defaultFundUsiSet:r,placementId:this.placementId},this.PromotedFundsConfig))];case 3:n.sent();n.label=4;case 4:return[2]}}))}))}})};this.handlePromotedDefaultFundJoined=function(e){if(n.stringIsNullOrEmtpty(e.usi)){appInsights.trackErrorTrace("Super Campaign did not return (PromotedDefault) usi");return}var t=Usi.clean(e.usi);navigationService.navigateInternallyToStandardChoice({history:n.history,fundName:e.fundName,promotedFundId:e.fundId,fundDetails:{type:"promotedDefault",fundName:e.fundName,fundUsi:t,promotedFundId:e.fundId},handleSubmitFn:function(r){return promotedFundChoiceApi.submitDefaultChoiceAsync(Object.assign({fundId:e.fundId,usi:t,standardChoiceFormSignature:r,defaultFundUsiSet:Option.toUndefined(superSelectionAppService.defaultFundUsi),placementId:n.placementId},n.PromotedFundsConfig))}})};this.handlePromotedDefaultFundWithJoinWasJoined=function(e){if(n.stringIsNullOrEmtpty(e.memberNumber)||n.stringIsNullOrEmtpty(e.usi)){appInsights.trackErrorTrace("Super Campaign did not return (PromotedDefaultWithJoin) memberNumber and/or usi");return}var t=Usi.clean(e.usi);navigationService.navigateInternallyToStandardChoice({history:n.history,fundName:e.fundName,promotedFundId:e.fundId,fundDetails:{type:"promotedDefaultWithJoin",fundName:e.fundName,fundUsi:t,memberNumber:e.memberNumber,promotedFundId:e.fundId},handleSubmitFn:function(r){return promotedFundChoiceApi.submitDefaultChoiceWithJoinAsync(Object.assign({fundId:e.fundId,memberNumber:e.memberNumber,memberFirstName:e.memberFirstName,memberFamilyName:e.memberFamilyName,usi:t,standardChoiceFormSignature:r,defaultFundUsiSet:Option.toUndefined(superSelectionAppService.defaultFundUsi),placementId:n.placementId},n.PromotedFundsConfig))}})};this.handleDefinedBenefitsJoined=function(e){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(this.stringIsNullOrEmtpty(e.memberNumber)||this.stringIsNullOrEmtpty(e.usi)){appInsights.trackErrorTrace("Super Campaign did not return (DefinedBenefits) memberNumber and/or usi");return[2]}return[4,customFundChoiceApi.submitDefinedBenefitsChoiceAsync(Object.assign({fundUsi:Usi.clean(e.usi),fundId:e.fundId,memberNumber:e.memberNumber,memberElectContributionRatePreTax:e.memberElectContributionRatePreTax,memberElectContributionRatePostTax:e.memberElectContributionRatePostTax},this.PromotedFundsConfig))];case 1:t.sent();superSelectionAppService.markSuperSelectionAsSubmitted();return[2]}}))}))};this.history=t;this.placementId=e}Object.defineProperty(e.prototype,"PromotedFundsConfig",{get:function(){return superSelectionAppService.promotedFundsConfig},enumerable:false,configurable:true});return e}();var FeaturedFunds=function(){function e(e){var t=this;registerInstance(this,e);this.currentView="featured-funds";this.subscribeToEvents=function(){for(var e in t.eventHandlers){document.addEventListener(e,t.eventHandlers[e])}};this.unsubscribeFromEvents=function(){for(var e in t.eventHandlers){document.removeEventListener(e,t.eventHandlers[e])}};this.backClicked=function(){navigationService.navigateInternally(t.history,SuperSelectionAppRoutes.ChoicePage);return Promise.resolve()};this.cancelClicked=function(){t.currentView="featured-funds";return Promise.resolve()};this.continueClicked=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.currentView="fund-join";return[4,fundTileClicked({sender:e.detail.sender,placementId:"byof",fundId:e.detail.fundId,fundUsi:e.detail.fundUsi,fundName:e.detail.fundName,fundType:e.detail.fundType})];case 1:t.sent();return[2]}}))}))};this.fundPanelShown=function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:if(!(e.detail.sender==="featured-funds"))return[3,2];t=e.detail.shownFunds.map((function(e){return e.fundId}));return[4,superSelectionAppService.viewSuperFundPanelAsync("byof",t)];case 1:n.sent();n.label=2;case 2:return[2]}}))}))};this.eventHandlers={"back-clicked":this.backClicked.bind(this),"continue-clicked":this.continueClicked.bind(this),"cancel-clicked":this.cancelClicked.bind(this),"featured-fund-panel-shown":this.fundPanelShown.bind(this),"promoted-fund-joined":new PromotedFundJoinedEventHandler("byof",this.history).handle}}e.prototype.componentWillLoad=function(){if(superSelectionAppService.isFeaturedFundsEnabled&&superSelectionAppService.isUsingSuperCampaign&&Option.isSome(superSelectionAppService.backendUrl)&&Option.isSome(superSelectionAppService.state.jwt)){this.backendUrl=superSelectionAppService.backendUrl.value;this.accessToken=superSelectionAppService.state.jwt.value;this.unsubscribeFromEvents();this.subscribeToEvents();superSelectionAppService.hideFooterSection=true}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund)}};e.prototype.disconnectedCallback=function(){this.unsubscribeFromEvents();superSelectionAppService.hideFooterSection=false};e.prototype.render=function(){return h(Host,null,this.currentView==="featured-funds"&&h("sss-header-section",null),h("div",{class:{"flex flex-col w-full justify-center items-center mt-11 mx-auto":this.currentView==="featured-funds","-mt-20":this.currentView==="fund-join"}},this.currentView==="featured-funds"&&h("sss-custom-fund",null),h("apollo-super-campaign-featured-funds",{"backend-url":this.backendUrl,"access-token":this.accessToken})))};return e}();injectHistory(FeaturedFunds);var SuperCampaignErrorApi=function(){function e(){}Object.defineProperty(e,"Instance",{get:function(){return this.instance||(this.instance=new this)},enumerable:false,configurable:true});e.prototype.PostError=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){buildBackendApiClient().url("super-campaign/errors").post(e);return[2]}))}))};return e}();var SuperFundDisclaimerViewedDetail={create:function(e){var t="Not set";if(Option.isSome(superSelectionAppService.isDefinedBenefitsEligible)){t=superSelectionAppService.isDefinedBenefitsEligible.value?"True":"False"}return{isDefinedBenefitsEligible:t,superCampaignEnabled:e}}};var SuperCampaignHost=function(){function e(e){var t=this;registerInstance(this,e);this.scriptImported=false;this.subscribeToSuperCampaignEvents=function(){for(var e in t.superCampaignEventHandlers){document.addEventListener(e,t.superCampaignEventHandlers[e])}};this.unSubscribeFromSuperCampaignEvents=function(){for(var e in t.superCampaignEventHandlers){document.removeEventListener(e,t.superCampaignEventHandlers[e])}};this.superCampaignLoaded=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];superSelectionAppService.superCampaignComponentStatus=SuperCampaignComponentStatus.Loaded;clearTimeout(this.loadingTimeoutRef);return[4,EventTrackingService.Instance.TrackSuperCampaignActivationSucceededAsync({})];case 1:t.sent();t.label=2;case 2:return[2,Promise.resolve()]}}))}))};this.superCampaignLoadFailed=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,this.activateFallbackMechanism({type:"SuperCampaignActivationFailed",reason:e.detail.reason||"Unknown"})];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.superCampaignFailed=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,this.activateFallbackMechanism({type:"SuperCampaignOperationFailed",reason:e.detail.reason||"Unknown"})];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.chooseAnotherFundRequested=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund)];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.fundPanelShown=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];superSelectionAppService.setSuperCampaignPromotedFundsShown(e.detail.shownFunds);return[4,superSelectionAppService.viewSuperFundPanelAsync("panel")];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.fundTileClicked=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,fundTileClicked({sender:e.detail.sender,placementId:"panel",fundId:e.detail.fundId,fundUsi:e.detail.fundUsi,fundName:e.detail.fundName,fundType:e.detail.fundType})];case 1:t.sent();return[2]}}))}))};this.fundPdsViewed=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,EventTrackingService.Instance.TrackSuperFundPdsViewedAsync({fundName:e.detail.fundName,fundUsi:e.detail.fundUsi,pageName:e.detail.pageName,superCampaignEnabled:true})];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.disclaimerViewed=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,EventTrackingService.Instance.TrackSuperFundDisclaimerViewedAsync(SuperFundDisclaimerViewedDetail.create(true))];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.disclaimerAccepted=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,EventTrackingService.Instance.TrackSuperFundDisclaimerAcceptedAsync({superCampaignEnabled:true})];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.superCampaignEventHandlers={"choose-another-fund-requested":this.chooseAnotherFundRequested.bind(this),"fund-panel-shown":this.fundPanelShown.bind(this),"fund-tile-clicked":this.fundTileClicked.bind(this),"fund-pds-viewed":this.fundPdsViewed.bind(this),"disclaimer-viewed":this.disclaimerViewed.bind(this),"disclaimer-accepted":this.disclaimerAccepted.bind(this),"promoted-fund-joined":new PromotedFundJoinedEventHandler("panel",this.history).handle,"super-campaign-loaded":this.superCampaignLoaded.bind(this),"super-campaign-load-failed":this.superCampaignLoadFailed.bind(this),"super-campaign-failed":this.superCampaignFailed.bind(this)}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:if(superSelectionAppService.state.superCampaignComponentStatus===SuperCampaignComponentStatus.NotWorking){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund);return[2]}e=undefined;n.label=1;case 1:n.trys.push([1,6,,7]);if(!(Option.isSome(superSelectionAppService.backendUrl)&&Option.isSome(superSelectionAppService.state.jwt)))return[3,4];this.backendUrl=superSelectionAppService.backendUrl.value;this.accessToken=superSelectionAppService.state.jwt.value;this.unSubscribeFromSuperCampaignEvents();if(!(superSelectionAppService.state.superCampaignComponentStatus===SuperCampaignComponentStatus.NotLoaded))return[3,3];e=this.createApolloSuperCampaignScriptUrl();return[4,import(e)];case 2:n.sent();this.loadingTimeoutRef=setTimeout(this.superCampaignLoadingTimeoutTriggered.bind(this),LoadWaitingTimeout);n.label=3;case 3:this.subscribeToSuperCampaignEvents();this.scriptImported=true;superSelectionAppService.hideFooterSection=true;return[3,5];case 4:throw Error("SuperCampaignHost pre-requisites not met.");case 5:return[3,7];case 6:t=n.sent();this.activateFallbackMechanism({type:"SuperCampaignActivationFailed",reason:"Problem in loading SuperCampaing script from:"+e+" Error: "+t});return[3,7];case 7:return[2]}}))}))};e.prototype.disconnectedCallback=function(){clearTimeout(this.loadingTimeoutRef);this.unSubscribeFromSuperCampaignEvents();superSelectionAppService.hideFooterSection=false};e.prototype.render=function(){return h("div",null,this.scriptImported?h("apollo-super-campaign",{"backend-url":this.backendUrl,"access-token":this.accessToken}):null)};e.prototype.activateFallbackMechanism=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(superSelectionAppService.superCampaignComponentStatus!==SuperCampaignComponentStatus.NotWorking))return[3,3];superSelectionAppService.superCampaignComponentStatus=SuperCampaignComponentStatus.NotWorking;return[4,SuperCampaignErrorApi.Instance.PostError(e)];case 1:t.sent();return[4,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund)];case 2:t.sent();t.label=3;case 3:return[2]}}))}))};e.prototype.superCampaignLoadingTimeoutTriggered=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(superSelectionAppService.superCampaignComponentStatus!==SuperCampaignComponentStatus.Loaded){this.activateFallbackMechanism({type:"SuperCampaignActivationFailed",reason:"Activation timeout was triggered after:"+LoadWaitingTimeout/1e3+" seconds"})}return[2]}))}))};e.prototype.createApolloSuperCampaignScriptUrl=function(){var e=function(){var e=window.location.hostname.toLowerCase().split(".")[0];switch(e){case"test-partner":case"partner":case"sandbox-partner":case"autodev-partner":return e;default:return"autodev-partner"}};return"https://"+e()+".flarehr.com/super-campaign/cdn/app/apollo-super-campaign.js"};return e}();injectHistory(SuperCampaignHost);var LoadWaitingTimeout$1=3e4;var SuperSmsfComponentStatus;(function(e){e[e["NotLoaded"]=1]="NotLoaded";e[e["Loaded"]=2]="Loaded"})(SuperSmsfComponentStatus||(SuperSmsfComponentStatus={}));var superSmsfComponentStatus=SuperSmsfComponentStatus.NotLoaded;var SuperSmsfHost=function(){function e(e){var t=this;registerInstance(this,e);this.eventTrackingService=EventTrackingService.Instance;this.subscribeToSuperSmsfEvents=function(){for(var e in t.smsfEventHandlers){document.addEventListener(e,t.smsfEventHandlers[e])}};this.unSubscribeFromSuperSmsfEvents=function(){for(var e in t.smsfEventHandlers){document.removeEventListener(e,t.smsfEventHandlers[e])}};this.smsfLoaded=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-smsf"))return[3,2];superSmsfComponentStatus=SuperSmsfComponentStatus.Loaded;clearTimeout(this.loadingTimeoutRef);return[4,this.eventTrackingService.TrackSmsfSuperFundDetailViewedAsync({promotedFundsShown:superSelectionAppService.promotedFunds,defaultFundUsiSet:Option.toUndefined(superSelectionAppService.defaultFundUsi)})];case 1:t.sent();t.label=2;case 2:return[2,Promise.resolve()]}}))}))};this.smsfCompleted=function(e){return __awaiter(t,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){if(e.detail.sender==="super-smsf"){this.updateCustomFundStateStore(e.detail);if(superSelectionAppService.isSmsfCustomStepEnabled&&superSelectionAppService.isUsingSuperCampaign){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.SmsfEngagementStep);return[2]}navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:"Self-managed super fund",fundDetails:{type:"smsf",fundName:e.detail.fundName,fundEsa:e.detail.fundEsa},handleSubmitFn:function(n){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:t=Object.assign({smsfChoice:{abn:e.detail.fundAbn,fundName:e.detail.fundName,fundAddress:{addressLine1:e.detail.fundAddressLine1,addressLine2:e.detail.fundAddressLine2,city:e.detail.fundCity,state:e.detail.fundState,postcode:e.detail.fundPostcode},bsb:e.detail.bankBsb,bankAccountName:e.detail.bankAccountName,bankAccountNumber:e.detail.bankAccountNumber,electronicServiceAddress:e.detail.fundEsa,memberFirstName:e.detail.memberFirstName,memberFamilyName:e.detail.memberLastName},standardChoiceFormSignature:n},superSelectionAppService.promotedFundsConfig);return[4,customFundChoiceApi.submitSelfManagedFundChoiceAsync(t)];case 1:r.sent();return[2]}}))}))}})}return[2]}))}))};this.smsfCancelled=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){if(e.detail.sender==="super-smsf"){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)}return[2]}))}))};this.smsfEventHandlers={"smsf-loaded":this.smsfLoaded.bind(this),"smsf-completed":this.smsfCompleted.bind(this),"smsf-cancelled":this.smsfCancelled.bind(this)}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(Option.isSome(superSelectionAppService.backendUrl)&&Option.isSome(superSelectionAppService.state.jwt)){this.backendUrl=superSelectionAppService.backendUrl.value;this.accessToken=superSelectionAppService.state.jwt.value;if(superSmsfComponentStatus===SuperSmsfComponentStatus.NotLoaded){this.loadingTimeoutRef=setTimeout(this.smsfLoadingTimeoutTriggered.bind(this),LoadWaitingTimeout$1)}this.subscribeToSuperSmsfEvents()}else{throw Error("SuperSmsfHost pre-requisites not met.")}return[2]}))}))};e.prototype.disconnectedCallback=function(){clearTimeout(this.loadingTimeoutRef);this.unSubscribeFromSuperSmsfEvents()};e.prototype.render=function(){return h(Host,null,h("sss-header-section",null),h("div",{class:"flex justify-center mt-11"},h("sss-custom-fund",null,h("div",null,h("apollo-super-smsf",{"backend-url":this.backendUrl,"access-token":this.accessToken})))))};e.prototype.updateCustomFundStateStore=function(e){state.selfManagedFundForm={fundAbn:e.fundAbn,fundName:e.fundName,addressLine1:e.fundAddressLine1,addressLine2:e.fundAddressLine2,city:e.fundCity,state:e.fundState,postcode:e.fundPostcode,bsb:e.bankBsb,bankAccountName:e.bankAccountName,bankAccountNumber:e.bankAccountNumber,fundEsa:e.fundEsa,memberFirstName:e.memberFirstName,memberFamilyName:e.memberLastName}};e.prototype.smsfLoadingTimeoutTriggered=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(superSmsfComponentStatus!==SuperSmsfComponentStatus.Loaded){throw Error("SMSF component failed to load.")}return[2]}))}))};return e}();injectHistory(SuperSmsfHost);var routeCss="stencil-route.inactive{display:none}";var Route=function(){function e(e){registerInstance(this,e);this.group=null;this.match=null;this.componentProps={};this.exact=false;this.scrollOnNextRender=false;this.previousMatch=null}e.prototype.computeMatch=function(e){var t=this.group!=null||this.el.parentElement!=null&&this.el.parentElement.tagName.toLowerCase()==="stencil-route-switch";if(!e||t){return}this.previousMatch=this.match;return this.match=matchPath(e.pathname,{path:this.url,exact:this.exact,strict:true})};e.prototype.loadCompleted=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e={};if(this.history&&this.history.location.hash){e={scrollToId:this.history.location.hash.substr(1)}}else if(this.scrollTopOffset){e={scrollTopOffset:this.scrollTopOffset}}if(typeof this.componentUpdated==="function"){this.componentUpdated(e)}else if(this.match&&!matchesAreEqual(this.match,this.previousMatch)&&this.routeViewsUpdated){this.routeViewsUpdated(e)}return[2]}))}))};e.prototype.componentDidUpdate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.loadCompleted()];case 1:e.sent();return[2]}}))}))};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.loadCompleted()];case 1:e.sent();return[2]}}))}))};e.prototype.render=function(){if(!this.match||!this.history){return null}var e=Object.assign({},this.componentProps,{history:this.history,match:this.match});if(this.routeRender){return this.routeRender(Object.assign({},e,{component:this.component}))}if(this.component){var t=this.component;return h(t,Object.assign({},e))}};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{location:["computeMatch"]}},enumerable:false,configurable:true});return e}();ActiveRouter.injectProps(Route,["location","history","historyType","routeViewsUpdated"]);Route.style=routeCss;var getConfirmation=function(e,t,n){return n(e.confirm(t))};var isModifiedEvent=function(e){return e.metaKey||e.altKey||e.ctrlKey||e.shiftKey};var supportsHistory=function(e){var t=e.navigator.userAgent;if((t.indexOf("Android 2.")!==-1||t.indexOf("Android 4.0")!==-1)&&t.indexOf("Mobile Safari")!==-1&&t.indexOf("Chrome")===-1&&t.indexOf("Windows Phone")===-1){return false}return e.history&&"pushState"in e.history};var supportsPopStateOnHashChange=function(e){return e.userAgent.indexOf("Trident")===-1};var supportsGoWithoutReloadUsingHash=function(e){return e.userAgent.indexOf("Firefox")===-1};var isExtraneousPopstateEvent=function(e,t){return t.state===undefined&&e.userAgent.indexOf("CriOS")===-1};var storageAvailable=function(e,t){var n=e[t];var r="__storage_test__";try{n.setItem(r,r);n.removeItem(r);return true}catch(e){return e instanceof DOMException&&(e.code===22||e.code===1014||e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")&&n.length!==0}};var getUrl=function(e,t){if(e.charAt(0)=="/"&&t.charAt(t.length-1)=="/"){return t.slice(0,t.length-1)+e}return t+e};var RouteLink$1=function(){function e(e){registerInstance(this,e);this.unsubscribe=function(){return};this.activeClass="link-active";this.exact=false;this.strict=true;this.custom="a";this.match=null}e.prototype.componentWillLoad=function(){this.computeMatch()};e.prototype.computeMatch=function(){if(this.location){this.match=matchPath(this.location.pathname,{path:this.urlMatch||this.url,exact:this.exact,strict:this.strict})}};e.prototype.handleClick=function(e){if(isModifiedEvent(e)||!this.history||!this.url||!this.root){return}e.preventDefault();return this.history.push(getUrl(this.url,this.root))};e.prototype.render=function(){var e;var t={class:(e={},e[this.activeClass]=this.match!==null,e),onClick:this.handleClick.bind(this)};if(this.anchorClass){t.class[this.anchorClass]=true}if(this.custom==="a"){t=Object.assign({},t,{href:this.url,title:this.anchorTitle,role:this.anchorRole,tabindex:this.anchorTabIndex,"aria-haspopup":this.ariaHaspopup,id:this.anchorId,"aria-posinset":this.ariaPosinset,"aria-setsize":this.ariaSetsize,"aria-label":this.ariaLabel})}return h(this.custom,Object.assign({},t),h("slot",null))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{location:["computeMatch"]}},enumerable:false,configurable:true});return e}();ActiveRouter.injectProps(RouteLink$1,["history","location","root"]);var getUniqueId=function(){return((Math.random()*1e17).toString().match(/.{4}/g)||[]).join("-")};var getMatch=function(e,t,n){return matchPath(e,{path:t,exact:n,strict:true})};var isHTMLStencilRouteElement=function(e){return e.tagName==="STENCIL-ROUTE"};var RouteSwitch=function(){function e(e){registerInstance(this,e);this.group=getUniqueId();this.subscribers=[];this.queue=getContext(this,"queue")}e.prototype.componentWillLoad=function(){if(this.location!=null){this.regenerateSubscribers(this.location)}};e.prototype.regenerateSubscribers=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n;var r=this;return __generator(this,(function(i){if(e==null){return[2]}t=-1;this.subscribers=Array.prototype.slice.call(this.el.children).filter(isHTMLStencilRouteElement).map((function(n,r){var i=getMatch(e.pathname,n.url,n.exact);if(i&&t===-1){t=r}return{el:n,match:i}}));if(t===-1){return[2]}if(this.activeIndex===t){this.subscribers[t].el.match=this.subscribers[t].match;return[2]}this.activeIndex=t;n=this.subscribers[this.activeIndex];if(this.scrollTopOffset){n.el.scrollTopOffset=this.scrollTopOffset}n.el.group=this.group;n.el.match=n.match;n.el.componentUpdated=function(e){r.queue.write((function(){r.subscribers.forEach((function(e,t){e.el.componentUpdated=undefined;if(t===r.activeIndex){return e.el.style.display=""}if(r.scrollTopOffset){e.el.scrollTopOffset=r.scrollTopOffset}e.el.group=r.group;e.el.match=null;e.el.style.display="none"}))}));if(r.routeViewsUpdated){r.routeViewsUpdated(Object.assign({scrollTopOffset:r.scrollTopOffset},e))}};return[2]}))}))};e.prototype.render=function(){return h("slot",null)};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{location:["regenerateSubscribers"]}},enumerable:false,configurable:true});return e}();ActiveRouter.injectProps(RouteSwitch,["location","routeViewsUpdated"]);var warning=function(e){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}if(!e){console.warn.apply(console,t)}};var createTransitionManager=function(){var e;var t=[];var n=function(t){warning(e==null,"A history supports only one prompt at a time");e=t;return function(){if(e===t){e=null}}};var r=function(t,n,r,i){if(e!=null){var a=typeof e==="function"?e(t,n):e;if(typeof a==="string"){if(typeof r==="function"){r(a,i)}else{warning(false,"A history needs a getUserConfirmation function in order to use a prompt message");i(true)}}else{i(a!==false)}}else{i(true)}};var i=function(e){var n=true;var r=function(){var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}if(n){e.apply(void 0,t)}};t.push(r);return function(){n=false;t=t.filter((function(e){return e!==r}))}};var a=function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}t.forEach((function(t){return t.apply(void 0,e)}))};return{setPrompt:n,confirmTransitionTo:r,appendListener:i,notifyListeners:a}};var createScrollHistory=function(e,t){if(t===void 0){t="scrollPositions"}var n=new Map;var r=function(t,r){n.set(t,r);if(storageAvailable(e,"sessionStorage")){var i=[];n.forEach((function(e,t){i.push([t,e])}));e.sessionStorage.setItem("scrollPositions",JSON.stringify(i))}};var i=function(e){return n.get(e)};var a=function(e){return n.has(e)};var s=function(t){r(t,[e.scrollX,e.scrollY])};if(storageAvailable(e,"sessionStorage")){var o=e.sessionStorage.getItem(t);n=o?new Map(JSON.parse(o)):n}if("scrollRestoration"in e.history){history.scrollRestoration="manual"}return{set:r,get:i,has:a,capture:s}};var PopStateEvent="popstate";var HashChangeEvent="hashchange";var createBrowserHistory=function(e,t){if(t===void 0){t={}}var n=false;var r=e.history;var i=e.location;var a=e.navigator;var s=supportsHistory(e);var o=!supportsPopStateOnHashChange(a);var u=createScrollHistory(e);var l=t.forceRefresh!=null?t.forceRefresh:false;var c=t.getUserConfirmation!=null?t.getUserConfirmation:getConfirmation;var d=t.keyLength!=null?t.keyLength:6;var f=t.basename?stripTrailingSlash(addLeadingSlash(t.basename)):"";var p=function(){try{return e.history.state||{}}catch(e){return{}}};var h=function(e){e=e||{};var t=e.key,n=e.state;var r=i.pathname,a=i.search,s=i.hash;var o=r+a+s;warning(!f||hasBasename(o,f),"You are attempting to use a basename on a page whose URL path does not begin "+'with the basename. Expected path "'+o+'" to begin with "'+f+'".');if(f){o=stripBasename(o,f)}return createLocation(o,n,t||createKey(d))};var m=createTransitionManager();var v=function(e){u.capture(U.location.key);Object.assign(U,e);U.location.scrollPosition=u.get(U.location.key);U.length=r.length;m.notifyListeners(U.location,U.action)};var g=function(e){if(!isExtraneousPopstateEvent(a,e)){S(h(e.state))}};var y=function(){S(h(p()))};var S=function(e){if(n){n=false;v()}else{var t="POP";m.confirmTransitionTo(e,t,c,(function(n){if(n){v({action:t,location:e})}else{b(e)}}))}};var b=function(e){var t=U.location;var r=x.indexOf(t.key);var i=x.indexOf(e.key);if(r===-1){r=0}if(i===-1){i=0}var a=r-i;if(a){n=true;E(a)}};var C=h(p());var x=[C.key];var w=0;var _=false;var I=function(e){return f+createPath(e)};var A=function(e,t){warning(!(typeof e==="object"&&e.state!==undefined&&t!==undefined),"You should avoid providing a 2nd state argument to push when the 1st "+"argument is a location-like object that already has state; it is ignored");var n="PUSH";var a=createLocation(e,t,createKey(d),U.location);m.confirmTransitionTo(a,n,c,(function(e){if(!e){return}var t=I(a);var o=a.key,u=a.state;if(s){r.pushState({key:o,state:u},"",t);if(l){i.href=t}else{var c=x.indexOf(U.location.key);var d=x.slice(0,c===-1?0:c+1);d.push(a.key);x=d;v({action:n,location:a})}}else{warning(u===undefined,"Browser history cannot push state in browsers that do not support HTML5 history");i.href=t}}))};var T=function(e,t){warning(!(typeof e==="object"&&e.state!==undefined&&t!==undefined),"You should avoid providing a 2nd state argument to replace when the 1st "+"argument is a location-like object that already has state; it is ignored");var n="REPLACE";var a=createLocation(e,t,createKey(d),U.location);m.confirmTransitionTo(a,n,c,(function(e){if(!e){return}var t=I(a);var o=a.key,u=a.state;if(s){r.replaceState({key:o,state:u},"",t);if(l){i.replace(t)}else{var c=x.indexOf(U.location.key);if(c!==-1){x[c]=a.key}v({action:n,location:a})}}else{warning(u===undefined,"Browser history cannot replace state in browsers that do not support HTML5 history");i.replace(t)}}))};var E=function(e){r.go(e)};var F=function(){return E(-1)};var N=function(){return E(1)};var P=function(t){w+=t;if(w===1){e.addEventListener(PopStateEvent,g);if(o){e.addEventListener(HashChangeEvent,y)}}else if(w===0){e.removeEventListener(PopStateEvent,g);if(o){e.removeEventListener(HashChangeEvent,y)}}};var k=function(e){if(e===void 0){e=""}var t=m.setPrompt(e);if(!_){P(1);_=true}return function(){if(_){_=false;P(-1)}return t()}};var D=function(e){var t=m.appendListener(e);P(1);return function(){P(-1);t()}};var U={length:r.length,action:"POP",location:C,createHref:I,push:A,replace:T,go:E,goBack:F,goForward:N,block:k,listen:D,win:e};return U};var HashChangeEvent$1="hashchange";var HashPathCoders={hashbang:{encodePath:function(e){return e.charAt(0)==="!"?e:"!/"+stripLeadingSlash(e)},decodePath:function(e){return e.charAt(0)==="!"?e.substr(1):e}},noslash:{encodePath:stripLeadingSlash,decodePath:addLeadingSlash},slash:{encodePath:addLeadingSlash,decodePath:addLeadingSlash}};var createHashHistory=function(e,t){if(t===void 0){t={}}var n=false;var r=null;var i=0;var a=false;var s=e.location;var o=e.history;var u=supportsGoWithoutReloadUsingHash(e.navigator);var l=t.keyLength!=null?t.keyLength:6;var c=t.getUserConfirmation,d=c===void 0?getConfirmation:c,f=t.hashType,p=f===void 0?"slash":f;var h=t.basename?stripTrailingSlash(addLeadingSlash(t.basename)):"";var m=HashPathCoders[p],v=m.encodePath,g=m.decodePath;var y=function(){var e=s.href;var t=e.indexOf("#");return t===-1?"":e.substring(t+1)};var S=function(e){return s.hash=e};var b=function(e){var t=s.href.indexOf("#");s.replace(s.href.slice(0,t>=0?t:0)+"#"+e)};var C=function(){var e=g(y());warning(!h||hasBasename(e,h),"You are attempting to use a basename on a page whose URL path does not begin "+'with the basename. Expected path "'+e+'" to begin with "'+h+'".');if(h){e=stripBasename(e,h)}return createLocation(e,undefined,createKey(l))};var x=createTransitionManager();var w=function(e){Object.assign(V,e);V.length=o.length;x.notifyListeners(V.location,V.action)};var _=function(){var e=y();var t=v(e);if(e!==t){b(t)}else{var i=C();var a=V.location;if(!n&&locationsAreEqual(a,i)){return}if(r===createPath(i)){return}r=null;I(i)}};var I=function(e){if(n){n=false;w()}else{var t="POP";x.confirmTransitionTo(e,t,d,(function(n){if(n){w({action:t,location:e})}else{A(e)}}))}};var A=function(e){var t=V.location;var r=N.lastIndexOf(createPath(t));var i=N.lastIndexOf(createPath(e));if(r===-1){r=0}if(i===-1){i=0}var a=r-i;if(a){n=true;U(a)}};var T=y();var E=v(T);if(T!==E){b(E)}var F=C();var N=[createPath(F)];var P=function(e){return"#"+v(h+createPath(e))};var k=function(e,t){warning(t===undefined,"Hash history cannot push state; it is ignored");var n="PUSH";var i=createLocation(e,undefined,createKey(l),V.location);x.confirmTransitionTo(i,n,d,(function(e){if(!e){return}var t=createPath(i);var a=v(h+t);var s=y()!==a;if(s){r=t;S(a);var o=N.lastIndexOf(createPath(V.location));var u=N.slice(0,o===-1?0:o+1);u.push(t);N=u;w({action:n,location:i})}else{warning(false,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack");w()}}))};var D=function(e,t){warning(t===undefined,"Hash history cannot replace state; it is ignored");var n="REPLACE";var i=createLocation(e,undefined,createKey(l),V.location);x.confirmTransitionTo(i,n,d,(function(e){if(!e){return}var t=createPath(i);var a=v(h+t);var s=y()!==a;if(s){r=t;b(a)}var o=N.indexOf(createPath(V.location));if(o!==-1){N[o]=t}w({action:n,location:i})}))};var U=function(e){warning(u,"Hash history go(n) causes a full page reload in this browser");o.go(e)};var O=function(){return U(-1)};var M=function(){return U(1)};var L=function(e,t){i+=t;if(i===1){e.addEventListener(HashChangeEvent$1,_)}else if(i===0){e.removeEventListener(HashChangeEvent$1,_)}};var R=function(t){if(t===void 0){t=""}var n=x.setPrompt(t);if(!a){L(e,1);a=true}return function(){if(a){a=false;L(e,-1)}return n()}};var B=function(t){var n=x.appendListener(t);L(e,1);return function(){L(e,-1);n()}};var V={length:o.length,action:"POP",location:F,createHref:P,push:k,replace:D,go:U,goBack:O,goForward:M,block:R,listen:B,win:e};return V};var getLocation$1=function(e,t){var n=e.pathname.indexOf(t)==0?"/"+e.pathname.slice(t.length):e.pathname;return Object.assign({},e,{pathname:n})};var HISTORIES={browser:createBrowserHistory,hash:createHashHistory};var Router=function(){function e(e){var t=this;registerInstance(this,e);this.root="/";this.historyType="browser";this.titleSuffix="";this.routeViewsUpdated=function(e){if(e===void 0){e={}}if(t.history&&e.scrollToId&&t.historyType==="browser"){var n=t.history.win.document.getElementById(e.scrollToId);if(n){return n.scrollIntoView()}}t.scrollTo(e.scrollTopOffset||t.scrollTopOffset)};this.isServer=getContext(this,"isServer");this.queue=getContext(this,"queue")}e.prototype.componentWillLoad=function(){var e=this;this.history=HISTORIES[this.historyType](this.el.ownerDocument.defaultView);this.history.listen((function(t){t=getLocation$1(t,e.root);e.location=t}));this.location=getLocation$1(this.history.location,this.root)};e.prototype.scrollTo=function(e){var t=this.history;if(e==null||this.isServer||!t){return}if(t.action==="POP"&&Array.isArray(t.location.scrollPosition)){return this.queue.write((function(){if(t&&t.location&&Array.isArray(t.location.scrollPosition)){t.win.scrollTo(t.location.scrollPosition[0],t.location.scrollPosition[1])}}))}return this.queue.write((function(){t.win.scrollTo(0,e)}))};e.prototype.render=function(){if(!this.location||!this.history){return}var e={historyType:this.historyType,location:this.location,titleSuffix:this.titleSuffix,root:this.root,history:this.history,routeViewsUpdated:this.routeViewsUpdated};return h(ActiveRouter.Provider,{state:e},h("slot",null))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();var superSelectionAppCss="html{scroll-behavior:smooth}stencil-route{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-pack:center;justify-content:center}stencil-route:empty{display:none}input+.invalid-feedback{display:none}select+.invalid-feedback{display:none}.was-validated input:invalid+.invalid-feedback{display:block}.was-validated select:invalid+.invalid-feedback{display:block}";var SuperSelectionApp=function(){function e(e){registerInstance(this,e);this.stepSubmitSuccess=createEvent(this,"step-completion",7);this.successPageAcknowledged=createEvent(this,"successPageAcknowledged",5);this.initialised=createEvent(this,"initialised",7);this.isSelfHosted=false;this.isAppInitialised=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;var r=this;return __generator(this,(function(i){e=Option.fromNullable(this.accessToken);if(Option.isNone(e)){throw Error("jwt property is missing.")}superSelectionAppService.state.jwt=e;t=Option.fromNullable(this.backendUrl);if(Option.isNone(t)){throw Error("apiBaseUrl property is missing.")}superSelectionAppService.state.apiBaseUrl=Option.some(t.value.replace(/\/$/,"")+"/");n=Option.fromNullable(this.appBaseUrl);if(Option.isNone(n)){throw Error("appBaseUrl property is missing.")}superSelectionAppService.state.appBaseUrl=Option.some(n.value.replace(/\/$/,""));superSelectionAppService.onChange("hasSuccessPageBeenAcknowledged",(function(e){return r.successPageAcknowledged.emit()}));superSelectionAppService.onChange("hasSuperSelectionBeenSubmitted",(function(e){if(!e)return;r.stepSubmitSuccess.emit();superSelectionAppService.state.hasSuperSelectionBeenSubmitted=false;if(r.isSelfHosted){navigationService.navigateInternally(r.history,SuperSelectionAppRoutes.Success)}}));return[2]}))}))};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:return[4,superSelectionAppService.loadAppStateAsync()];case 1:i.sent();return[4,existingFundService.GetExistingFundAsync()];case 2:e=i.sent();this.isAppInitialised=true;this.initialised.emit({accountIdOrDefault:superSelectionAppService.accountIdOrDefault,partnerIdOrDefault:superSelectionAppService.partnerIdOrDefault,profileId:superSelectionAppService.profileId});iframe.appReady();t=Option.fromNullable(this.ignoreExistingSelection);n=Option.isSome(e)&&e.value.type=="Defined Benefits Fund"&&(Option.isNone(superSelectionAppService.isDefinedBenefitsEligible)||!superSelectionAppService.isDefinedBenefitsEligible.value);r=Option.isSome(t)&&t.value||n;if(Option.isSome(superSelectionAppService.state.superChoicePrefill)){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.Prefill)}else if(Option.isSome(e)&&e.value.valid!=="Inactive"&&!r){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ExistingChoicePage)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)}return[2]}}))}))};e.prototype.authTokenChanged=function(e){superSelectionAppService.state.jwt=Option.fromNullable(e)};e.prototype.onRouteChange=function(){window===null||window===void 0?void 0:window.scroll(0,0)};e.prototype.render=function(){return h(Host,null,h("link",{rel:"stylesheet",href:getAssetPath("apollo-super-selection.css"),media:"all"}),this.renderAppContent())};e.prototype.routerBaseUrl=function(){var e;return((e=this.appBaseUrl)===null||e===void 0?void 0:e.replace(/\/$/,""))+"/"};e.prototype.renderAppContent=function(){return h("stencil-router",{root:this.routerBaseUrl(),class:"font-inter"},h("stencil-route-switch",{scrollTopOffset:0},this.isAppInitialised?h("div",{class:"pt-28 -mt-12 pb-6"},superSelectionAppStencilRoutes,h("sss-footer-section",null)):h("div",{class:"flex justify-center py-20"},h("sss-loading-indicator",null))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{accessToken:["authTokenChanged"],location:["onRouteChange"]}},enumerable:false,configurable:true});return e}();injectHistory(SuperSelectionApp);SuperSelectionApp.style=superSelectionAppCss;var resizeObservers=[];var hasActiveObservations=function(){return resizeObservers.some((function(e){return e.activeTargets.length>0}))};var hasSkippedObservations=function(){return resizeObservers.some((function(e){return e.skippedTargets.length>0}))};var msg="ResizeObserver loop completed with undelivered notifications.";var deliverResizeLoopError=function(){var e;if(typeof ErrorEvent==="function"){e=new ErrorEvent("error",{message:msg})}else{e=document.createEvent("Event");e.initEvent("error",false,false);e.message=msg}window.dispatchEvent(e)};var ResizeObserverBoxOptions;(function(e){e["BORDER_BOX"]="border-box";e["CONTENT_BOX"]="content-box";e["DEVICE_PIXEL_CONTENT_BOX"]="device-pixel-content-box"})(ResizeObserverBoxOptions||(ResizeObserverBoxOptions={}));var freeze=function(e){return Object.freeze(e)};var ResizeObserverSize=function(){function e(e,t){this.inlineSize=e;this.blockSize=t;freeze(this)}return e}();var DOMRectReadOnly=function(){function e(e,t,n,r){this.x=e;this.y=t;this.width=n;this.height=r;this.top=this.y;this.left=this.x;this.bottom=this.top+this.height;this.right=this.left+this.width;return freeze(this)}e.prototype.toJSON=function(){var e=this,t=e.x,n=e.y,r=e.top,i=e.right,a=e.bottom,s=e.left,o=e.width,u=e.height;return{x:t,y:n,top:r,right:i,bottom:a,left:s,width:o,height:u}};e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)};return e}();var isSVG=function(e){return e instanceof SVGElement&&"getBBox"in e};var isHidden=function(e){if(isSVG(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,a=i.offsetWidth,s=i.offsetHeight;return!(a||s||e.getClientRects().length)};var isElement=function(e){var t,n;var r=(n=(t=e)===null||t===void 0?void 0:t.ownerDocument)===null||n===void 0?void 0:n.defaultView;return!!(r&&e instanceof r.Element)};var isReplacedElement=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image"){break}case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return true}return false};var global$1=typeof window!=="undefined"?window:{};var cache=new WeakMap;var scrollRegexp=/auto|scroll/;var verticalRegexp=/^tb|vertical/;var IE=/msie|trident/i.test(global$1.navigator&&global$1.navigator.userAgent);var parseDimension=function(e){return parseFloat(e||"0")};var size=function(e,t,n){if(e===void 0){e=0}if(t===void 0){t=0}if(n===void 0){n=false}return new ResizeObserverSize((n?t:e)||0,(n?e:t)||0)};var zeroBoxes=freeze({devicePixelContentBoxSize:size(),borderBoxSize:size(),contentBoxSize:size(),contentRect:new DOMRectReadOnly(0,0,0,0)});var calculateBoxSizes=function(e,t){if(t===void 0){t=false}if(cache.has(e)&&!t){return cache.get(e)}if(isHidden(e)){cache.set(e,zeroBoxes);return zeroBoxes}var n=getComputedStyle(e);var r=isSVG(e)&&e.ownerSVGElement&&e.getBBox();var i=!IE&&n.boxSizing==="border-box";var a=verticalRegexp.test(n.writingMode||"");var s=!r&&scrollRegexp.test(n.overflowY||"");var o=!r&&scrollRegexp.test(n.overflowX||"");var u=r?0:parseDimension(n.paddingTop);var l=r?0:parseDimension(n.paddingRight);var c=r?0:parseDimension(n.paddingBottom);var d=r?0:parseDimension(n.paddingLeft);var f=r?0:parseDimension(n.borderTopWidth);var p=r?0:parseDimension(n.borderRightWidth);var h=r?0:parseDimension(n.borderBottomWidth);var m=r?0:parseDimension(n.borderLeftWidth);var v=d+l;var g=u+c;var y=m+p;var S=f+h;var b=!o?0:e.offsetHeight-S-e.clientHeight;var C=!s?0:e.offsetWidth-y-e.clientWidth;var x=i?v+y:0;var w=i?g+S:0;var _=r?r.width:parseDimension(n.width)-x-C;var I=r?r.height:parseDimension(n.height)-w-b;var A=_+v+C+y;var T=I+g+b+S;var E=freeze({devicePixelContentBoxSize:size(Math.round(_*devicePixelRatio),Math.round(I*devicePixelRatio),a),borderBoxSize:size(A,T,a),contentBoxSize:size(_,I,a),contentRect:new DOMRectReadOnly(d,u,_,I)});cache.set(e,E);return E};var calculateBoxSize=function(e,t,n){var r=calculateBoxSizes(e,n),i=r.borderBoxSize,a=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:return s;case ResizeObserverBoxOptions.BORDER_BOX:return i;default:return a}};var ResizeObserverEntry=function(){function e(e){var t=calculateBoxSizes(e);this.target=e;this.contentRect=t.contentRect;this.borderBoxSize=freeze([t.borderBoxSize]);this.contentBoxSize=freeze([t.contentBoxSize]);this.devicePixelContentBoxSize=freeze([t.devicePixelContentBoxSize])}return e}();var calculateDepthForNode=function(e){if(isHidden(e)){return Infinity}var t=0;var n=e.parentNode;while(n){t+=1;n=n.parentNode}return t};var broadcastActiveObservations=function(){var e=Infinity;var t=[];resizeObservers.forEach((function n(r){if(r.activeTargets.length===0){return}var i=[];r.activeTargets.forEach((function t(n){var r=new ResizeObserverEntry(n.target);var a=calculateDepthForNode(n.target);i.push(r);n.lastReportedSize=calculateBoxSize(n.target,n.observedBox);if(a<e){e=a}}));t.push((function e(){r.callback.call(r.observer,i,r.observer)}));r.activeTargets.splice(0,r.activeTargets.length)}));for(var n=0,r=t;n<r.length;n++){var i=r[n];i()}return e};var gatherActiveObservationsAtDepth=function(e){resizeObservers.forEach((function t(n){n.activeTargets.splice(0,n.activeTargets.length);n.skippedTargets.splice(0,n.skippedTargets.length);n.observationTargets.forEach((function t(r){if(r.isActive()){if(calculateDepthForNode(r.target)>e){n.activeTargets.push(r)}else{n.skippedTargets.push(r)}}}))}))};var process=function(){var e=0;gatherActiveObservationsAtDepth(e);while(hasActiveObservations()){e=broadcastActiveObservations();gatherActiveObservationsAtDepth(e)}if(hasSkippedObservations()){deliverResizeLoopError()}return e>0};var trigger;var callbacks=[];var notify=function(){return callbacks.splice(0).forEach((function(e){return e()}))};var queueMicroTask=function(e){if(!trigger){var t=0;var n=document.createTextNode("");var r={characterData:true};new MutationObserver((function(){return notify()})).observe(n,r);trigger=function(){n.textContent=""+(t?t--:t++)}}callbacks.push(e);trigger()};var queueResizeObserver=function(e){queueMicroTask((function t(){requestAnimationFrame(e)}))};var watching=0;var isWatching=function(){return!!watching};var CATCH_PERIOD=250;var observerConfig={attributes:true,characterData:true,childList:true,subtree:true};var events=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"];var time=function(e){if(e===void 0){e=0}return Date.now()+e};var scheduled=false;var Scheduler=function(){function e(){var e=this;this.stopped=true;this.listener=function(){return e.schedule()}}e.prototype.run=function(e){var t=this;if(e===void 0){e=CATCH_PERIOD}if(scheduled){return}scheduled=true;var n=time(e);queueResizeObserver((function(){var r=false;try{r=process()}finally{scheduled=false;e=n-time();if(!isWatching()){return}if(r){t.run(1e3)}else if(e>0){t.run(e)}else{t.start()}}}))};e.prototype.schedule=function(){this.stop();this.run()};e.prototype.observe=function(){var e=this;var t=function(){return e.observer&&e.observer.observe(document.body,observerConfig)};document.body?t():global$1.addEventListener("DOMContentLoaded",t)};e.prototype.start=function(){var e=this;if(this.stopped){this.stopped=false;this.observer=new MutationObserver(this.listener);this.observe();events.forEach((function(t){return global$1.addEventListener(t,e.listener,true)}))}};e.prototype.stop=function(){var e=this;if(!this.stopped){this.observer&&this.observer.disconnect();events.forEach((function(t){return global$1.removeEventListener(t,e.listener,true)}));this.stopped=true}};return e}();var scheduler=new Scheduler;var updateCount=function(e){!watching&&e>0&&scheduler.start();watching+=e;!watching&&scheduler.stop()};var skipNotifyOnElement=function(e){return!isSVG(e)&&!isReplacedElement(e)&&getComputedStyle(e).display==="inline"};var ResizeObservation=function(){function e(e,t){this.target=e;this.observedBox=t||ResizeObserverBoxOptions.CONTENT_BOX;this.lastReportedSize={inlineSize:0,blockSize:0}}e.prototype.isActive=function(){var e=calculateBoxSize(this.target,this.observedBox,true);if(skipNotifyOnElement(this.target)){this.lastReportedSize=e}if(this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize){return true}return false};return e}();var ResizeObserverDetail=function(){function e(e,t){this.activeTargets=[];this.skippedTargets=[];this.observationTargets=[];this.observer=e;this.callback=t}return e}();var observerMap=new WeakMap;var getObservationIndex=function(e,t){for(var n=0;n<e.length;n+=1){if(e[n].target===t){return n}}return-1};var ResizeObserverController=function(){function e(){}e.connect=function(e,t){var n=new ResizeObserverDetail(e,t);observerMap.set(e,n)};e.observe=function(e,t,n){var r=observerMap.get(e);var i=r.observationTargets.length===0;if(getObservationIndex(r.observationTargets,t)<0){i&&resizeObservers.push(r);r.observationTargets.push(new ResizeObservation(t,n&&n.box));updateCount(1);scheduler.schedule()}};e.unobserve=function(e,t){var n=observerMap.get(e);var r=getObservationIndex(n.observationTargets,t);var i=n.observationTargets.length===1;if(r>=0){i&&resizeObservers.splice(resizeObservers.indexOf(n),1);n.observationTargets.splice(r,1);updateCount(-1)}};e.disconnect=function(e){var t=this;var n=observerMap.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)}));n.activeTargets.splice(0,n.activeTargets.length)};return e}();var ResizeObserver=function(){function e(e){if(arguments.length===0){throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.")}if(typeof e!=="function"){throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.")}ResizeObserverController.connect(this,e)}e.prototype.observe=function(e,t){if(arguments.length===0){throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.")}if(!isElement(e)){throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element")}ResizeObserverController.observe(this,e,t)};e.prototype.unobserve=function(e){if(arguments.length===0){throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.")}if(!isElement(e)){throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element")}ResizeObserverController.unobserve(this,e)};e.prototype.disconnect=function(){ResizeObserverController.disconnect(this)};e.toString=function(){return"function ResizeObserver () { [polyfill code] }"};return e}();var AppConfigurationService=function(){function e(){var e=this;this._appRootUrl=new Lazy((function(){return e.resolveRootUrl()}));this.getAppRootUrl=function(){return e._appRootUrl.value};this.getAppHostUrl=function(){return(""+window.location.origin+e.getAppRootUrl()).replace(/\/$/,"")}}e.prototype.loadConfigurationAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,factory(this.getAppRootUrl()+"config.json").get().json()];case 1:e=t.sent();sessionStore.update({appConfiguration:Option.fromNullable(e)});return[2]}}))}))};e.prototype.resolveRootUrl=function(){var e=Option.fromNullable(window.location.pathname.match(/^\/super-selection\/embed\/v1.0\/app/));if(Option.isNone(e)){throw Error("Unsupported host URL")}return e.value[0]+"/"};return e}();var appConfigurationService=new AppConfigurationService;var AppParametersService=function(){function e(){this.ignoreExistingSelectionQueryParameter="ignoreExistingSelection"}e.prototype.init=function(e){var t=new URLSearchParams(e);var n=Option.fromNullable(t.get(this.ignoreExistingSelectionQueryParameter));var r=Option.fold((function(){return false}),(function(e){return e==="true"}))(n);sessionStore.update({ignoreExistingSelection:r})};return e}();var appParametersService=new AppParametersService;var AuthenticationQuery=function(e){__extends(t,e);function t(t){var n=e.call(this,t)||this;n.store=t;n.sessionState$=n.select((function(e){return e.authenticationState}));n.jwt$=n.select((function(e){return e.jwt}));return n}Object.defineProperty(t.prototype,"sessionState",{get:function(){return this.getValue().authenticationState},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isUnauthorized",{get:function(){return this.getValue().authenticationState===AuthenticationState.Unauthorized||this.getValue().authenticationState===AuthenticationState.Error},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isAuthorized",{get:function(){return this.getValue().authenticationState===AuthenticationState.Authenticated},enumerable:false,configurable:true});return t}(Query);var sessionQuery=new AuthenticationQuery(sessionStore);function sendAnalyticsEvent(e,t){if(window["gtag"]){window["gtag"]("event",e,t)}}var AuthenticationService=function(){function e(){this.authCodeQueryParameter="code"}e.prototype.authorizationCodeIsPresent=function(e){var t=this.getAuthorizationCodeFromRoute(e);return Option.isSome(t)};e.prototype.initFromRoute=function(e){var t=this.getAuthorizationCodeFromRoute(e);if(Option.isNone(t)){sessionStore.update({authenticationState:AuthenticationState.Error});throw Error('"'+this.authCodeQueryParameter+'" URL query parameter missing')}this.authCodeExchangeAsync(t.value)};e.prototype.authCodeExchangeAsync=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n;return __generator(this,(function(r){switch(r.label){case 0:t=new URLSearchParams([["grant_type","authorization_code"],["client_id","apollo-super-selection-app"],["code",e],["redirect_uri",""+appConfigurationService.getAppHostUrl()]]);return[4,factory(appConfigurationQuery.configuration.OidcAuthority+"/connect/token").headers({"Content-Type":"application/x-www-form-urlencoded"}).post(t.toString()).badRequest((function(){sessionStore.update({authenticationState:AuthenticationState.Error});throw new Error("Failed to authenticate.")})).json()];case 1:n=r.sent();sessionStore.update({jwt:Option.fromNullable(n.access_token),authenticationState:AuthenticationState.Authenticated});sendAnalyticsEvent("oidc_sign_in",{});window.history.replaceState(null,"",appConfigurationService.getAppRootUrl());return[2]}}))}))};e.prototype.getAuthorizationCodeFromRoute=function(e){var t=new URLSearchParams(e);return Option.fromNullable(t.get(this.authCodeQueryParameter))};return e}();var authenticationService=new AuthenticationService;var InteropQuery=function(e){__extends(t,e);function t(t){var n=e.call(this,t)||this;n.store=t;return n}t.prototype.isReactNativeInteropEnabled=function(){return isSome(this.getValue().reactNativeInterop)};t.prototype.isIframeInteropEnabled=function(){return isSome(this.getValue().iframeInterop)};t.prototype.getIframeInteropMode=function(){var e=this.getValue().iframeInterop;if(isNone(e)){throw Error("Failed to get iframe interop information: no data in store")}if(!this.isIframeInteropEnabled()){throw Error("Failed to get iframe interop information: iframe mode is disabled")}return e.value};return t}(Query);var interopQuery=new InteropQuery(sessionStore);var IFrameInteropService=function(){function e(){}e.completeSuperSelectionStep=function(){var e=interopQuery.getIframeInteropMode().successRedirectionUrl;if(Option.isSome(e)){window.top.location.href=e.value}else{iframe.complete()}};e.initFromRoute=function(e){var t="success-redirection-url";var n=new URLSearchParams(e);var r=Option.fromNullable(n.get(t));var i={successRedirectionUrl:Option.none};if(Option.isSome(r)){try{var a=new URL(r.value);i.successRedirectionUrl=Option.some(a.toString())}catch(e){throw Error('"'+r.value+'" is not a valid URL')}}return i};return e}();var ReactNativeInteropService=function(){function e(){}e.init=function(){var e=window["ReactNativeWebView"]!==undefined;if(!e){throw Error("React Native WebView messaging is not enabled. Please, refer to https://github.com/react-native-webview/react-native-webview/blob/master/docs/Guide.md#the-windowreactnativewebviewpostmessage-method-and-onmessage-prop")}return new ReactNativeInteropMode};e.completeSuperSelectionStep=function(){this.postRNMessage()};e.postRNMessage=function(){var t={stepStatus:"completed"};e.getRnInterop().postMessage(JSON.stringify(t))};return e}();ReactNativeInteropService.getRnInterop=function(){return window["ReactNativeWebView"]};var HostInteropService=function(){function e(){this.interopModeQueryParameter="interop-mode"}e.prototype.completeSuperSelectionStep=function(){if(interopQuery.isIframeInteropEnabled()){IFrameInteropService.completeSuperSelectionStep()}else if(interopQuery.isReactNativeInteropEnabled()){ReactNativeInteropService.completeSuperSelectionStep()}else{throw Error("Unknown interop mode")}};e.prototype.init=function(e){var t=new URLSearchParams(e);var n=fromNullable(t.get(this.interopModeQueryParameter));if(isSome(n)&&n.value==="react-native"){sessionStore.update({reactNativeInterop:some(ReactNativeInteropService.init())});return}sessionStore.update({iframeInterop:some(IFrameInteropService.initFromRoute(e))})};return e}();var hostInteropService=new HostInteropService;function initHost(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:appParametersService.init(window.location.search);return[4,appConfigurationService.loadConfigurationAsync()];case 1:t.sent();appInsights.init();addSlashToUrl();e=sessionQuery.isUnauthorized||authenticationService.authorizationCodeIsPresent(window.location.search);if(!e){return[2]}hostInteropService.init(window.location.search);authenticationService.initFromRoute(window.location.search);return[2]}}))}))}var AppParametersQuery=function(e){__extends(t,e);function t(t){var n=e.call(this,t)||this;n.store=t;n.ignoreExistingSelection$=n.select((function(e){return e.ignoreExistingSelection}));return n}Object.defineProperty(t.prototype,"ignoreExistingSelection",{get:function(){return this.getValue().ignoreExistingSelection},enumerable:false,configurable:true});return t}(Query);var appParametersQuery=new AppParametersQuery(sessionStore);var superSelectionAppHostCss="html{scroll-behavior:smooth}.sss-app-container{--fl-color-primary:#2E66F7;--fl-color-primary-light:#EAF0FE;--fl-color-primary-dark:#031495;--fl-color-primary-disabled:#88ABFA;--fl-color-primary-hover:#5786F8;--fl-color-primary-focus:#1033C6;--fl-color-primary-text:#3d3d3d;--fl-color-secondary:#e5e5e5;--fl-color-secondary-hover:#b3b3b3;--fl-color-secondary-focus:#b3b3b3}@media screen and (-webkit-min-device-pixel-ratio: 0){select,textarea,input{font-size:16px}}";var SuperSelectionAppHost=function(){function e(e){registerInstance(this,e)}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:return[4,initHost()];case 1:t.sent();sessionQuery.sessionState$.subscribe((function(t){return e.sessionState=t}));sessionQuery.jwt$.subscribe((function(t){return e.jwt=t}));appConfigurationQuery.appConfiguration$.subscribe((function(t){return e.appConfiguration=t}));appParametersQuery.ignoreExistingSelection$.subscribe((function(t){return e.ignoreExistingSelection=t}));return[2]}}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("link",{rel:"stylesheet",href:getAssetPath("apollo-super-selection.css"),media:"all"}),h("div",{ref:function(t){return e.observeContentResize(t)}},Option.isNone(this.appConfiguration)?h("sss-loading-page",{class:"font-inter"}):this.renderAppContent()))};e.prototype.renderAppContent=function(){var e=this;return h("stencil-router",{root:appConfigurationService.getAppRootUrl(),class:"sss-app-container"},h("stencil-route-switch",{scrollTopOffset:0},h("stencil-route",{url:"/",routeRender:this.renderProtectedRoute((function(t){return h("super-selection-app",Object.assign({accessToken:Option.toUndefined(e.jwt),ignoreExistingSelection:e.ignoreExistingSelection,backendUrl:appConfigurationQuery.configuration.ApiBaseUrl,appBaseUrl:e.getAppBaseUrl(),onSuccessPageAcknowledged:e.handleSuccessPageAcknowledged,"onStep-completion":e.handleStepSubmitSuccess,onInitialised:e.handleAppInitialised,isSelfHosted:true},t))}))})))};e.prototype.getAppBaseUrl=function(){var e=window.location.pathname.split("app");return e[0]+"app/"};e.prototype.handleSuccessPageAcknowledged=function(){hostInteropService.completeSuperSelectionStep()};e.prototype.handleStepSubmitSuccess=function(){iframe.submitSuccess()};e.prototype.handleAppInitialised=function(e){appInsights.addCustomProperties({"X-ACCOUNT-ID":e.detail.accountIdOrDefault,"X-PARTNER-ID":e.detail.partnerIdOrDefault,"X-PROFILE-ID":e.detail.profileId});appInsights.getAppInsights().trackPageView();var t=document.getElementById("sss-external-loading-page-container");if(t){document.body.removeChild(t)}};e.prototype.observeContentResize=function(e){var t=window.ResizeObserver||ResizeObserver;new t((function(){iframe.resize(e.offsetHeight,-1)})).observe(e)};e.prototype.renderProtectedRoute=function(e){switch(this.sessionState){case AuthenticationState.Authenticated:return e;case AuthenticationState.Unauthorized:return function(){return h("sss-loading-page",null)};case AuthenticationState.Error:return function(){return h("h1",null,"Authentication Error")};default:return function(){return h("h1",null,"Authentication Error")}}};return e}();SuperSelectionAppHost.style=superSelectionAppHostCss;export{Button as sss_button,ChoiceRouter as sss_choice_router,CustomFund as sss_custom_fund,DefaultFund as sss_default_fund,SelectInputAsync as sss_dropdown_async,ExistingChoice as sss_existing_choice_page,FooterSection as sss_footer_section,HeaderSection as sss_header_section,LoadingIndicator as sss_loading_indicator,LoadingPage as sss_loading_page,MyOwnFundEngagementStep as sss_my_own_fund_engagement_step_host,MemberNameInput as sss_name_input,Prefill as sss_prefill,DisplayField as sss_prefill_display_field,PrefillErrorBox as sss_prefill_error_box,PrefillInvalidMyOwnFund as sss_prefill_invalid_my_own_fund,PrefillInvalidSMSF as sss_prefill_invalid_smsf,PrefillMyOwnFund as sss_prefill_my_own_fund,PrefillSMSF as sss_prefill_smsf,PrefillWarningBox as sss_prefill_warning_box,SmsfEngagementStep as sss_smsf_engagement_step_host,StandardChoiceFormInputDefaultFund as sss_standard_choice_form,Success as sss_success,FeaturedFunds as sss_super_campaign_featured_funds,SuperCampaignHost as sss_super_campaign_host,SuperSmsfHost as sss_super_smsf_host,Route as stencil_route,RouteLink$1 as stencil_route_link,RouteSwitch as stencil_route_switch,Router as stencil_router,SuperSelectionApp as super_selection_app,SuperSelectionAppHost as super_selection_app_host};
69
+ */var _internalSdkSrc;var Initialization=function(){function e(e){var t=this;t._snippetVersion=""+(e.sv||e.version||"");e.queue=e.queue||[];e.version=e.version||2;var n=e.config||{};if(n.connectionString){var r=ConnectionStringParser.parse(n.connectionString);var i=r.ingestionendpoint;n.endpointUrl=i?i+"/v2/track":n.endpointUrl;n.instrumentationKey=r.instrumentationkey||n.instrumentationKey}t.appInsights=new ApplicationInsights;t.properties=new PropertiesPlugin;t.dependencies=new AjaxMonitor;t.core=new AppInsightsCore;t.snippet=e;t.config=n;t.getSKUDefaults()}e.prototype.trackEvent=function(e,t){this.appInsights.trackEvent(e,t)};e.prototype.trackPageView=function(e){var t=e||{};this.appInsights.trackPageView(t)};e.prototype.trackPageViewPerformance=function(e){var t=e||{};this.appInsights.trackPageViewPerformance(t)};e.prototype.trackException=function(e){if(!e.exception&&e.error){e.exception=e.error}this.appInsights.trackException(e)};e.prototype._onerror=function(e){this.appInsights._onerror(e)};e.prototype.trackTrace=function(e,t){this.appInsights.trackTrace(e,t)};e.prototype.trackMetric=function(e,t){this.appInsights.trackMetric(e,t)};e.prototype.startTrackPage=function(e){this.appInsights.startTrackPage(e)};e.prototype.stopTrackPage=function(e,t,n,r){this.appInsights.stopTrackPage(e,t,n,r)};e.prototype.startTrackEvent=function(e){this.appInsights.startTrackEvent(e)};e.prototype.stopTrackEvent=function(e,t,n){this.appInsights.stopTrackEvent(e,t,n)};e.prototype.addTelemetryInitializer=function(e){return this.appInsights.addTelemetryInitializer(e)};e.prototype.setAuthenticatedUserContext=function(e,t,n){if(n===void 0){n=false}this.properties.context.user.setAuthenticatedUserContext(e,t,n)};e.prototype.clearAuthenticatedUserContext=function(){this.properties.context.user.clearAuthenticatedUserContext()};e.prototype.trackDependencyData=function(e){this.dependencies.trackDependencyData(e)};e.prototype.flush=function(e){var t=this;if(e===void 0){e=true}doPerf(this.core,(function(){return"AISKU.flush"}),(function(){CoreUtils.arrForEach(t.core.getTransmissionControls(),(function(t){CoreUtils.arrForEach(t,(function(t){t.flush(e)}))}))}),null,e)};e.prototype.onunloadFlush=function(e){if(e===void 0){e=true}CoreUtils.arrForEach(this.core.getTransmissionControls(),(function(t){CoreUtils.arrForEach(t,(function(t){if(t.onunloadFlush){t.onunloadFlush()}else{t.flush(e)}}))}))};e.prototype.loadAppInsights=function(e,t,n){var r=this;if(e===void 0){e=false}var i=this;function a(t){if(t){var n="";if(!CoreUtils.isNullOrUndefined(i._snippetVersion)){n+=i._snippetVersion}if(e){n+=".lg"}if(i.context&&i.context.internal){i.context.internal.snippetVer=n||"-"}objForEachKey(i,(function(e,n){if(CoreUtils.isString(e)&&!CoreUtils.isFunction(n)&&e.substring(0,1)!=="_"){t[e]=n}}))}}if(e&&i.config.extensions&&i.config.extensions.length>0){throw new Error("Extensions not allowed in legacy mode")}doPerf(i.core,(function(){return"AISKU.loadAppInsights"}),(function(){var e=[];var s=new Sender;e.push(s);e.push(i.properties);e.push(i.dependencies);e.push(i.appInsights);i.core.initialize(i.config,e,t,n);i.context=i.properties.context;if(_internalSdkSrc&&i.context){i.context.internal.sdkSrc=_internalSdkSrc}a(i.snippet);i.emptyQueue();i.pollInternalLogs();i.addHousekeepingBeforeUnload(r)}));return i};e.prototype.updateSnippetDefinitions=function(e){objForEachKey(this,(function(t,n){if(CoreUtils.isString(t)){e[t]=n}}))};e.prototype.emptyQueue=function(){var e=this;try{if(Util.isArray(e.snippet.queue)){var t=e.snippet.queue.length;for(var n=0;n<t;n++){var r=e.snippet.queue[n];r()}e.snippet.queue=undefined;delete e.snippet.queue}}catch(e){var i={};if(e&&CoreUtils.isFunction(e.toString)){i.exception=e.toString()}}};e.prototype.pollInternalLogs=function(){this.core.pollInternalLogs()};e.prototype.addHousekeepingBeforeUnload=function(e){if(hasWindow()||hasDocument()){var t=function(){e.onunloadFlush(false);var t=e.appInsights.core["_extensions"][PropertiesPluginIdentifier];if(t&&t.context&&t.context._sessionManager){t.context._sessionManager.backup()}};if(!e.appInsights.config.disableFlushOnBeforeUnload){var n=CoreUtils.addEventHandler("beforeunload",t);n=CoreUtils.addEventHandler("pagehide",t)||n;if(!n&&!isReactNative()){e.appInsights.core.logger.throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.FailedToAddHandlerForOnBeforeUnload,"Could not add handler for beforeunload and pagehide")}}if(!e.appInsights.config.disableFlushOnUnload){CoreUtils.addEventHandler("pagehide",t)}}};e.prototype.getSKUDefaults=function(){var e=this;e.config.diagnosticLogInterval=e.config.diagnosticLogInterval&&e.config.diagnosticLogInterval>0?e.config.diagnosticLogInterval:1e4};return e}();(function(){var e=null;var t=["://js.monitor.azure.com/","://az416426.vo.msecnd.net/"];try{var n=(document||{}).currentScript;if(n){e=n.src}}catch(e){}if(e){try{var r=e.toLowerCase();if(r){var i="";for(var a=0;a<t.length;a++){if(r.indexOf(t[a])!==-1){i="cdn"+(a+1);if(r.indexOf("/scripts/")===-1){if(r.indexOf("/next/")!==-1){i+="-next"}else if(r.indexOf("/beta/")!==-1){i+="-beta"}}_internalSdkSrc=i+"";break}}}}catch(e){}}})();var __decorate=undefined&&undefined.__decorate||function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)if(s=e[o])a=(i<3?s(a):i>3?s(t,n,a):s(t,n))||a;return i>3&&a&&Object.defineProperty(t,n,a),a};var AuthenticationState;(function(e){e[e["Unauthorized"]=0]="Unauthorized";e[e["Authenticated"]=1]="Authenticated";e[e["Error"]=2]="Error"})(AuthenticationState||(AuthenticationState={}));var ReactNativeInteropMode=function(){function e(){}return e}();function createInitialState(){return{authenticationState:AuthenticationState.Unauthorized,jwt:none,reactNativeInterop:none,iframeInterop:none,appConfiguration:none,ignoreExistingSelection:false}}var SessionStore=function(e){__extends(t,e);function t(){return e.call(this,createInitialState())||this}return t}(Store);SessionStore=__decorate([StoreConfig({name:"sss-session",resettable:true})],SessionStore);var sessionStore=new SessionStore;var AppConfigurationQuery=function(e){__extends(t,e);function t(t){var n=e.call(this,t)||this;n.store=t;n.appConfiguration$=n.select((function(e){return e.appConfiguration}));return n}Object.defineProperty(t.prototype,"configuration",{get:function(){var e=this.getValue().appConfiguration;if(isNone(e)){throw Error("App configuration is not yet loaded")}return e.value},enumerable:false,configurable:true});return t}(Query);var appConfigurationQuery=new AppConfigurationQuery(sessionStore);var AppInsightsService=function(){function e(){this.appInsights=new Lazy((function(){return new Initialization({config:{instrumentationKey:appConfigurationQuery.configuration.AppInsightsKey,enableAutoRouteTracking:true,autoTrackPageVisitTime:true,maxBatchInterval:1e3,enableUnhandledPromiseRejectionTracking:true}})}))}e.prototype.init=function(){var e=this;this.appInsights.value.loadAppInsights();setErrorHandler((function(t){return e.appInsightsErrorHandler(t)}))};e.prototype.getAppInsights=function(){return this.appInsights.value};e.prototype.addCustomProperties=function(e){this.appInsights.value.addTelemetryInitializer((function(t){t.data=t.data?t.data:{};for(var n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],a=i[0],s=i[1];t.data[a]=s}}))};e.prototype.trackErrorTrace=function(e){this.appInsights.value.trackTrace({message:e,severityLevel:SeverityLevel.Error})};e.prototype.appInsightsErrorHandler=function(e){this.appInsights.value.trackException({error:e,severityLevel:SeverityLevel.Error});var t=function(e){return console.error(e)};t(e)};return e}();var appInsights=new AppInsightsService;var PromotedFundChoiceApi=function(){function e(){}e.prototype.submitChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/promoted-fund").post(e).badRequest((function(){throw new Error("Failed to process Promoted Fund choice request")})).text()]}))}))};e.prototype.submitDefaultChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/promoted-fund/default").post(e).badRequest((function(){throw new Error("Failed to process Promoted Default Fund choice request")})).text()]}))}))};e.prototype.submitDefaultChoiceWithJoinAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/promoted-fund/default-with-join").post(e).badRequest((function(){throw new Error("Failed to process Promoted Default Fund With Join choice request")})).text()]}))}))};return e}();var promotedFundChoiceApi=new PromotedFundChoiceApi;var SlateChoiceApi=function(){function e(){}e.prototype.submitSlateChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/slate").post(e).badRequest((function(){throw new Error("Failed to process Slate join request")})).text()]}))}))};return e}();var slateChoiceApi=new SlateChoiceApi;var Usi={clean:function(e){return e.replace(/ /g,"")}};var LoadWaitingTimeout=3e4;var PromotedFundJoinedEventHandler=function(){function e(e,t){var n=this;this.handle=function(e){return __awaiter(n,void 0,void 0,(function(){var t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!(e.detail.sender==="super-campaign"||e.detail.sender==="featured-funds"))return[3,6];t=e.detail.fundJoinInfo;n=t.fundType;switch(n){case"Promoted":return[3,1];case"DefinedBenefits":return[3,2];case"PromotedDefault":return[3,4];case"PromotedDefaultWithJoin":return[3,5]}return[3,6];case 1:this.handlePromotedFundJoined(t);return[3,6];case 2:return[4,this.handleDefinedBenefitsJoined(t)];case 3:r.sent();return[3,6];case 4:this.handlePromotedDefaultFundJoined(t);return[3,6];case 5:this.handlePromotedDefaultFundWithJoinWasJoined(t);return[3,6];case 6:return[2,Promise.resolve()]}}))}))};this.stringIsNullOrEmtpty=function(e){return!(typeof e==="string"&&e.trim().length>0)};this.handlePromotedFundJoined=function(e){if(n.stringIsNullOrEmtpty(e.memberNumber)||n.stringIsNullOrEmtpty(e.usi)){appInsights.trackErrorTrace("Super Campaign did not return (Promoted) memberNumber and/or usi");return}var t=Usi.clean(e.usi);var r=Option.toUndefined(superSelectionAppService.defaultFundUsi);navigationService.navigateInternallyToStandardChoice({history:n.history,fundName:e.fundName,promotedFundId:e.fundId,fundDetails:{type:"promoted",fundName:e.fundName,fundUsi:t,memberNumber:e.memberNumber,promotedFundId:e.fundId},handleSubmitFn:function(i){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:if(!(e.fundId===slate.fundId))return[3,2];return[4,slateChoiceApi.submitSlateChoiceAsync(Object.assign({memberNumber:e.memberNumber,memberFirstName:e.memberFirstName,memberFamilyName:e.memberFamilyName,standardChoiceFormSignature:i,defaultFundUsiSet:r,placementId:this.placementId},this.PromotedFundsConfig))];case 1:n.sent();return[3,4];case 2:return[4,promotedFundChoiceApi.submitChoiceAsync(Object.assign({fundId:e.fundId,memberNumber:e.memberNumber,memberFirstName:e.memberFirstName,memberFamilyName:e.memberFamilyName,usi:t,standardChoiceFormSignature:i,defaultFundUsiSet:r,placementId:this.placementId,sourceOfJoin:e.sourceOfJoin,isDefaultExclusive:e.isDefaultExclusive},this.PromotedFundsConfig))];case 3:n.sent();n.label=4;case 4:return[2]}}))}))}})};this.handlePromotedDefaultFundJoined=function(e){if(n.stringIsNullOrEmtpty(e.usi)){appInsights.trackErrorTrace("Super Campaign did not return (PromotedDefault) usi");return}var t=Usi.clean(e.usi);navigationService.navigateInternallyToStandardChoice({history:n.history,fundName:e.fundName,promotedFundId:e.fundId,fundDetails:{type:"promotedDefault",fundName:e.fundName,fundUsi:t,promotedFundId:e.fundId},handleSubmitFn:function(r){return promotedFundChoiceApi.submitDefaultChoiceAsync(Object.assign({fundId:e.fundId,usi:t,standardChoiceFormSignature:r,defaultFundUsiSet:Option.toUndefined(superSelectionAppService.defaultFundUsi),placementId:n.placementId,sourceOfJoin:e.sourceOfJoin,isDefaultExclusive:e.isDefaultExclusive},n.PromotedFundsConfig))}})};this.handlePromotedDefaultFundWithJoinWasJoined=function(e){if(n.stringIsNullOrEmtpty(e.memberNumber)||n.stringIsNullOrEmtpty(e.usi)){appInsights.trackErrorTrace("Super Campaign did not return (PromotedDefaultWithJoin) memberNumber and/or usi");return}var t=Usi.clean(e.usi);navigationService.navigateInternallyToStandardChoice({history:n.history,fundName:e.fundName,promotedFundId:e.fundId,fundDetails:{type:"promotedDefaultWithJoin",fundName:e.fundName,fundUsi:t,memberNumber:e.memberNumber,promotedFundId:e.fundId},handleSubmitFn:function(r){return promotedFundChoiceApi.submitDefaultChoiceWithJoinAsync(Object.assign({fundId:e.fundId,memberNumber:e.memberNumber,memberFirstName:e.memberFirstName,memberFamilyName:e.memberFamilyName,usi:t,standardChoiceFormSignature:r,defaultFundUsiSet:Option.toUndefined(superSelectionAppService.defaultFundUsi),placementId:n.placementId,sourceOfJoin:e.sourceOfJoin,isDefaultExclusive:e.isDefaultExclusive},n.PromotedFundsConfig))}})};this.handleDefinedBenefitsJoined=function(e){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(this.stringIsNullOrEmtpty(e.memberNumber)||this.stringIsNullOrEmtpty(e.usi)){appInsights.trackErrorTrace("Super Campaign did not return (DefinedBenefits) memberNumber and/or usi");return[2]}return[4,customFundChoiceApi.submitDefinedBenefitsChoiceAsync(Object.assign({fundUsi:Usi.clean(e.usi),fundId:e.fundId,memberNumber:e.memberNumber,memberElectContributionRatePreTax:e.memberElectContributionRatePreTax,memberElectContributionRatePostTax:e.memberElectContributionRatePostTax,sourceOfJoin:e.sourceOfJoin,isDefaultExclusive:e.isDefaultExclusive},this.PromotedFundsConfig))];case 1:t.sent();superSelectionAppService.markSuperSelectionAsSubmitted();return[2]}}))}))};this.history=t;this.placementId=e}Object.defineProperty(e.prototype,"PromotedFundsConfig",{get:function(){return superSelectionAppService.promotedFundsConfig},enumerable:false,configurable:true});return e}();var FeaturedFunds=function(){function e(e){var t=this;registerInstance(this,e);this.currentView="featured-funds";this.subscribeToEvents=function(){for(var e in t.eventHandlers){document.addEventListener(e,t.eventHandlers[e])}};this.unsubscribeFromEvents=function(){for(var e in t.eventHandlers){document.removeEventListener(e,t.eventHandlers[e])}};this.backClicked=function(){navigationService.navigateInternally(t.history,SuperSelectionAppRoutes.ChoicePage);return Promise.resolve()};this.cancelClicked=function(){t.currentView="featured-funds";return Promise.resolve()};this.continueClicked=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.currentView="fund-join";return[4,fundTileClicked({sender:e.detail.sender,placementId:"byof",fundId:e.detail.fundId,fundUsi:e.detail.fundUsi,fundName:e.detail.fundName,fundType:e.detail.fundType,sourceOfJoin:e.detail.sourceOfJoin,isDefaultExclusive:e.detail.isDefaultExclusive})];case 1:t.sent();return[2]}}))}))};this.fundPanelShown=function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:if(!(e.detail.sender==="featured-funds"))return[3,2];t=e.detail.shownFunds.map((function(e){return e.fundId}));return[4,superSelectionAppService.viewSuperFundPanelAsync("byof",t)];case 1:n.sent();n.label=2;case 2:return[2]}}))}))};this.eventHandlers={"back-clicked":this.backClicked.bind(this),"continue-clicked":this.continueClicked.bind(this),"cancel-clicked":this.cancelClicked.bind(this),"featured-fund-panel-shown":this.fundPanelShown.bind(this),"promoted-fund-joined":new PromotedFundJoinedEventHandler("byof",this.history).handle}}e.prototype.componentWillLoad=function(){if(superSelectionAppService.isFeaturedFundsEnabled&&superSelectionAppService.isUsingSuperCampaign&&Option.isSome(superSelectionAppService.backendUrl)&&Option.isSome(superSelectionAppService.state.jwt)){this.backendUrl=superSelectionAppService.backendUrl.value;this.accessToken=superSelectionAppService.state.jwt.value;this.unsubscribeFromEvents();this.subscribeToEvents();superSelectionAppService.hideFooterSection=true}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund)}};e.prototype.disconnectedCallback=function(){this.unsubscribeFromEvents();superSelectionAppService.hideFooterSection=false};e.prototype.render=function(){return h(Host,null,this.currentView==="featured-funds"&&h("sss-header-section",null),h("div",{class:{"flex flex-col w-full justify-center items-center mt-11 mx-auto":this.currentView==="featured-funds","-mt-20":this.currentView==="fund-join"}},this.currentView==="featured-funds"&&h("sss-custom-fund",null),h("apollo-super-campaign-featured-funds",{"backend-url":this.backendUrl,"access-token":this.accessToken})))};return e}();injectHistory(FeaturedFunds);var SuperCampaignErrorApi=function(){function e(){}Object.defineProperty(e,"Instance",{get:function(){return this.instance||(this.instance=new this)},enumerable:false,configurable:true});e.prototype.PostError=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){buildBackendApiClient().url("super-campaign/errors").post(e);return[2]}))}))};return e}();var SuperFundDisclaimerViewedDetail={create:function(e){var t="Not set";if(Option.isSome(superSelectionAppService.isDefinedBenefitsEligible)){t=superSelectionAppService.isDefinedBenefitsEligible.value?"True":"False"}return{isDefinedBenefitsEligible:t,superCampaignEnabled:e}}};var SuperCampaignHost=function(){function e(e){var t=this;registerInstance(this,e);this.scriptImported=false;this.subscribeToSuperCampaignEvents=function(){for(var e in t.superCampaignEventHandlers){document.addEventListener(e,t.superCampaignEventHandlers[e])}};this.unSubscribeFromSuperCampaignEvents=function(){for(var e in t.superCampaignEventHandlers){document.removeEventListener(e,t.superCampaignEventHandlers[e])}};this.superCampaignLoaded=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];superSelectionAppService.superCampaignComponentStatus=SuperCampaignComponentStatus.Loaded;clearTimeout(this.loadingTimeoutRef);return[4,EventTrackingService.Instance.TrackSuperCampaignActivationSucceededAsync({})];case 1:t.sent();t.label=2;case 2:return[2,Promise.resolve()]}}))}))};this.superCampaignLoadFailed=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,this.activateFallbackMechanism({type:"SuperCampaignActivationFailed",reason:e.detail.reason||"Unknown"})];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.superCampaignFailed=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,this.activateFallbackMechanism({type:"SuperCampaignOperationFailed",reason:e.detail.reason||"Unknown"})];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.chooseAnotherFundRequested=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund)];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.fundPanelShown=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];superSelectionAppService.setSuperCampaignPromotedFundsShown(e.detail.shownFunds);return[4,superSelectionAppService.viewSuperFundPanelAsync("panel")];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.fundTileClicked=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,fundTileClicked({sender:e.detail.sender,placementId:"panel",fundId:e.detail.fundId,fundUsi:e.detail.fundUsi,fundName:e.detail.fundName,fundType:e.detail.fundType,sourceOfJoin:e.detail.sourceOfJoin,isDefaultExclusive:e.detail.isDefaultExclusive})];case 1:t.sent();return[2]}}))}))};this.fundPdsViewed=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,EventTrackingService.Instance.TrackSuperFundPdsViewedAsync({fundName:e.detail.fundName,fundUsi:e.detail.fundUsi,pageName:e.detail.pageName,superCampaignEnabled:true})];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.disclaimerViewed=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,EventTrackingService.Instance.TrackSuperFundDisclaimerViewedAsync(SuperFundDisclaimerViewedDetail.create(true))];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.disclaimerAccepted=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-campaign"))return[3,2];return[4,EventTrackingService.Instance.TrackSuperFundDisclaimerAcceptedAsync({superCampaignEnabled:true})];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.superCampaignEventHandlers={"choose-another-fund-requested":this.chooseAnotherFundRequested.bind(this),"fund-panel-shown":this.fundPanelShown.bind(this),"fund-tile-clicked":this.fundTileClicked.bind(this),"fund-pds-viewed":this.fundPdsViewed.bind(this),"disclaimer-viewed":this.disclaimerViewed.bind(this),"disclaimer-accepted":this.disclaimerAccepted.bind(this),"promoted-fund-joined":new PromotedFundJoinedEventHandler("panel",this.history).handle,"super-campaign-loaded":this.superCampaignLoaded.bind(this),"super-campaign-load-failed":this.superCampaignLoadFailed.bind(this),"super-campaign-failed":this.superCampaignFailed.bind(this)}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:if(superSelectionAppService.state.superCampaignComponentStatus===SuperCampaignComponentStatus.NotWorking){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund);return[2]}e=undefined;n.label=1;case 1:n.trys.push([1,6,,7]);if(!(Option.isSome(superSelectionAppService.backendUrl)&&Option.isSome(superSelectionAppService.state.jwt)))return[3,4];this.backendUrl=superSelectionAppService.backendUrl.value;this.accessToken=superSelectionAppService.state.jwt.value;this.unSubscribeFromSuperCampaignEvents();if(!(superSelectionAppService.state.superCampaignComponentStatus===SuperCampaignComponentStatus.NotLoaded))return[3,3];e=this.createApolloSuperCampaignScriptUrl();return[4,import(e)];case 2:n.sent();this.loadingTimeoutRef=setTimeout(this.superCampaignLoadingTimeoutTriggered.bind(this),LoadWaitingTimeout);n.label=3;case 3:this.subscribeToSuperCampaignEvents();this.scriptImported=true;superSelectionAppService.hideFooterSection=true;return[3,5];case 4:throw Error("SuperCampaignHost pre-requisites not met.");case 5:return[3,7];case 6:t=n.sent();this.activateFallbackMechanism({type:"SuperCampaignActivationFailed",reason:"Problem in loading SuperCampaing script from:"+e+" Error: "+t});return[3,7];case 7:return[2]}}))}))};e.prototype.disconnectedCallback=function(){clearTimeout(this.loadingTimeoutRef);this.unSubscribeFromSuperCampaignEvents();superSelectionAppService.hideFooterSection=false};e.prototype.render=function(){return h("div",null,this.scriptImported?h("apollo-super-campaign",{"backend-url":this.backendUrl,"access-token":this.accessToken}):null)};e.prototype.activateFallbackMechanism=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(superSelectionAppService.superCampaignComponentStatus!==SuperCampaignComponentStatus.NotWorking))return[3,3];superSelectionAppService.superCampaignComponentStatus=SuperCampaignComponentStatus.NotWorking;return[4,SuperCampaignErrorApi.Instance.PostError(e)];case 1:t.sent();return[4,navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.MyOwnFund)];case 2:t.sent();t.label=3;case 3:return[2]}}))}))};e.prototype.superCampaignLoadingTimeoutTriggered=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(superSelectionAppService.superCampaignComponentStatus!==SuperCampaignComponentStatus.Loaded){this.activateFallbackMechanism({type:"SuperCampaignActivationFailed",reason:"Activation timeout was triggered after:"+LoadWaitingTimeout/1e3+" seconds"})}return[2]}))}))};e.prototype.createApolloSuperCampaignScriptUrl=function(){var e=function(){var e=window.location.hostname.toLowerCase().split(".")[0];switch(e){case"test-partner":case"partner":case"sandbox-partner":case"autodev-partner":return e;default:return"autodev-partner"}};return"https://"+e()+".flarehr.com/super-campaign/cdn/app/apollo-super-campaign.js"};return e}();injectHistory(SuperCampaignHost);var LoadWaitingTimeout$1=3e4;var SuperSmsfComponentStatus;(function(e){e[e["NotLoaded"]=1]="NotLoaded";e[e["Loaded"]=2]="Loaded"})(SuperSmsfComponentStatus||(SuperSmsfComponentStatus={}));var superSmsfComponentStatus=SuperSmsfComponentStatus.NotLoaded;var SuperSmsfHost=function(){function e(e){var t=this;registerInstance(this,e);this.eventTrackingService=EventTrackingService.Instance;this.subscribeToSuperSmsfEvents=function(){for(var e in t.smsfEventHandlers){document.addEventListener(e,t.smsfEventHandlers[e])}};this.unSubscribeFromSuperSmsfEvents=function(){for(var e in t.smsfEventHandlers){document.removeEventListener(e,t.smsfEventHandlers[e])}};this.smsfLoaded=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(e.detail.sender==="super-smsf"))return[3,2];superSmsfComponentStatus=SuperSmsfComponentStatus.Loaded;clearTimeout(this.loadingTimeoutRef);return[4,this.eventTrackingService.TrackSmsfSuperFundDetailViewedAsync({promotedFundsShown:superSelectionAppService.promotedFunds,defaultFundUsiSet:Option.toUndefined(superSelectionAppService.defaultFundUsi)})];case 1:t.sent();t.label=2;case 2:return[2,Promise.resolve()]}}))}))};this.smsfCompleted=function(e){return __awaiter(t,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){if(e.detail.sender==="super-smsf"){this.updateCustomFundStateStore(e.detail);if(superSelectionAppService.isSmsfCustomStepEnabled&&superSelectionAppService.isUsingSuperCampaign){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.SmsfEngagementStep);return[2]}navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:"Self-managed super fund",fundDetails:{type:"smsf",fundName:e.detail.fundName,fundEsa:e.detail.fundEsa},handleSubmitFn:function(n){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:t=Object.assign({smsfChoice:{abn:e.detail.fundAbn,fundName:e.detail.fundName,fundAddress:{addressLine1:e.detail.fundAddressLine1,addressLine2:e.detail.fundAddressLine2,city:e.detail.fundCity,state:e.detail.fundState,postcode:e.detail.fundPostcode},bsb:e.detail.bankBsb,bankAccountName:e.detail.bankAccountName,bankAccountNumber:e.detail.bankAccountNumber,electronicServiceAddress:e.detail.fundEsa,memberFirstName:e.detail.memberFirstName,memberFamilyName:e.detail.memberLastName},standardChoiceFormSignature:n},superSelectionAppService.promotedFundsConfig);return[4,customFundChoiceApi.submitSelfManagedFundChoiceAsync(t)];case 1:r.sent();return[2]}}))}))}})}return[2]}))}))};this.smsfCancelled=function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){if(e.detail.sender==="super-smsf"){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)}return[2]}))}))};this.smsfEventHandlers={"smsf-loaded":this.smsfLoaded.bind(this),"smsf-completed":this.smsfCompleted.bind(this),"smsf-cancelled":this.smsfCancelled.bind(this)}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(Option.isSome(superSelectionAppService.backendUrl)&&Option.isSome(superSelectionAppService.state.jwt)){this.backendUrl=superSelectionAppService.backendUrl.value;this.accessToken=superSelectionAppService.state.jwt.value;if(superSmsfComponentStatus===SuperSmsfComponentStatus.NotLoaded){this.loadingTimeoutRef=setTimeout(this.smsfLoadingTimeoutTriggered.bind(this),LoadWaitingTimeout$1)}this.subscribeToSuperSmsfEvents()}else{throw Error("SuperSmsfHost pre-requisites not met.")}return[2]}))}))};e.prototype.disconnectedCallback=function(){clearTimeout(this.loadingTimeoutRef);this.unSubscribeFromSuperSmsfEvents()};e.prototype.render=function(){return h(Host,null,h("sss-header-section",null),h("div",{class:"flex justify-center mt-11"},h("sss-custom-fund",null,h("div",null,h("apollo-super-smsf",{"backend-url":this.backendUrl,"access-token":this.accessToken})))))};e.prototype.updateCustomFundStateStore=function(e){state.selfManagedFundForm={fundAbn:e.fundAbn,fundName:e.fundName,addressLine1:e.fundAddressLine1,addressLine2:e.fundAddressLine2,city:e.fundCity,state:e.fundState,postcode:e.fundPostcode,bsb:e.bankBsb,bankAccountName:e.bankAccountName,bankAccountNumber:e.bankAccountNumber,fundEsa:e.fundEsa,memberFirstName:e.memberFirstName,memberFamilyName:e.memberLastName}};e.prototype.smsfLoadingTimeoutTriggered=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(superSmsfComponentStatus!==SuperSmsfComponentStatus.Loaded){throw Error("SMSF component failed to load.")}return[2]}))}))};return e}();injectHistory(SuperSmsfHost);var routeCss="stencil-route.inactive{display:none}";var Route=function(){function e(e){registerInstance(this,e);this.group=null;this.match=null;this.componentProps={};this.exact=false;this.scrollOnNextRender=false;this.previousMatch=null}e.prototype.computeMatch=function(e){var t=this.group!=null||this.el.parentElement!=null&&this.el.parentElement.tagName.toLowerCase()==="stencil-route-switch";if(!e||t){return}this.previousMatch=this.match;return this.match=matchPath(e.pathname,{path:this.url,exact:this.exact,strict:true})};e.prototype.loadCompleted=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e={};if(this.history&&this.history.location.hash){e={scrollToId:this.history.location.hash.substr(1)}}else if(this.scrollTopOffset){e={scrollTopOffset:this.scrollTopOffset}}if(typeof this.componentUpdated==="function"){this.componentUpdated(e)}else if(this.match&&!matchesAreEqual(this.match,this.previousMatch)&&this.routeViewsUpdated){this.routeViewsUpdated(e)}return[2]}))}))};e.prototype.componentDidUpdate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.loadCompleted()];case 1:e.sent();return[2]}}))}))};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.loadCompleted()];case 1:e.sent();return[2]}}))}))};e.prototype.render=function(){if(!this.match||!this.history){return null}var e=Object.assign({},this.componentProps,{history:this.history,match:this.match});if(this.routeRender){return this.routeRender(Object.assign({},e,{component:this.component}))}if(this.component){var t=this.component;return h(t,Object.assign({},e))}};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{location:["computeMatch"]}},enumerable:false,configurable:true});return e}();ActiveRouter.injectProps(Route,["location","history","historyType","routeViewsUpdated"]);Route.style=routeCss;var getConfirmation=function(e,t,n){return n(e.confirm(t))};var isModifiedEvent=function(e){return e.metaKey||e.altKey||e.ctrlKey||e.shiftKey};var supportsHistory=function(e){var t=e.navigator.userAgent;if((t.indexOf("Android 2.")!==-1||t.indexOf("Android 4.0")!==-1)&&t.indexOf("Mobile Safari")!==-1&&t.indexOf("Chrome")===-1&&t.indexOf("Windows Phone")===-1){return false}return e.history&&"pushState"in e.history};var supportsPopStateOnHashChange=function(e){return e.userAgent.indexOf("Trident")===-1};var supportsGoWithoutReloadUsingHash=function(e){return e.userAgent.indexOf("Firefox")===-1};var isExtraneousPopstateEvent=function(e,t){return t.state===undefined&&e.userAgent.indexOf("CriOS")===-1};var storageAvailable=function(e,t){var n=e[t];var r="__storage_test__";try{n.setItem(r,r);n.removeItem(r);return true}catch(e){return e instanceof DOMException&&(e.code===22||e.code===1014||e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED")&&n.length!==0}};var getUrl=function(e,t){if(e.charAt(0)=="/"&&t.charAt(t.length-1)=="/"){return t.slice(0,t.length-1)+e}return t+e};var RouteLink$1=function(){function e(e){registerInstance(this,e);this.unsubscribe=function(){return};this.activeClass="link-active";this.exact=false;this.strict=true;this.custom="a";this.match=null}e.prototype.componentWillLoad=function(){this.computeMatch()};e.prototype.computeMatch=function(){if(this.location){this.match=matchPath(this.location.pathname,{path:this.urlMatch||this.url,exact:this.exact,strict:this.strict})}};e.prototype.handleClick=function(e){if(isModifiedEvent(e)||!this.history||!this.url||!this.root){return}e.preventDefault();return this.history.push(getUrl(this.url,this.root))};e.prototype.render=function(){var e;var t={class:(e={},e[this.activeClass]=this.match!==null,e),onClick:this.handleClick.bind(this)};if(this.anchorClass){t.class[this.anchorClass]=true}if(this.custom==="a"){t=Object.assign({},t,{href:this.url,title:this.anchorTitle,role:this.anchorRole,tabindex:this.anchorTabIndex,"aria-haspopup":this.ariaHaspopup,id:this.anchorId,"aria-posinset":this.ariaPosinset,"aria-setsize":this.ariaSetsize,"aria-label":this.ariaLabel})}return h(this.custom,Object.assign({},t),h("slot",null))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{location:["computeMatch"]}},enumerable:false,configurable:true});return e}();ActiveRouter.injectProps(RouteLink$1,["history","location","root"]);var getUniqueId=function(){return((Math.random()*1e17).toString().match(/.{4}/g)||[]).join("-")};var getMatch=function(e,t,n){return matchPath(e,{path:t,exact:n,strict:true})};var isHTMLStencilRouteElement=function(e){return e.tagName==="STENCIL-ROUTE"};var RouteSwitch=function(){function e(e){registerInstance(this,e);this.group=getUniqueId();this.subscribers=[];this.queue=getContext(this,"queue")}e.prototype.componentWillLoad=function(){if(this.location!=null){this.regenerateSubscribers(this.location)}};e.prototype.regenerateSubscribers=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n;var r=this;return __generator(this,(function(i){if(e==null){return[2]}t=-1;this.subscribers=Array.prototype.slice.call(this.el.children).filter(isHTMLStencilRouteElement).map((function(n,r){var i=getMatch(e.pathname,n.url,n.exact);if(i&&t===-1){t=r}return{el:n,match:i}}));if(t===-1){return[2]}if(this.activeIndex===t){this.subscribers[t].el.match=this.subscribers[t].match;return[2]}this.activeIndex=t;n=this.subscribers[this.activeIndex];if(this.scrollTopOffset){n.el.scrollTopOffset=this.scrollTopOffset}n.el.group=this.group;n.el.match=n.match;n.el.componentUpdated=function(e){r.queue.write((function(){r.subscribers.forEach((function(e,t){e.el.componentUpdated=undefined;if(t===r.activeIndex){return e.el.style.display=""}if(r.scrollTopOffset){e.el.scrollTopOffset=r.scrollTopOffset}e.el.group=r.group;e.el.match=null;e.el.style.display="none"}))}));if(r.routeViewsUpdated){r.routeViewsUpdated(Object.assign({scrollTopOffset:r.scrollTopOffset},e))}};return[2]}))}))};e.prototype.render=function(){return h("slot",null)};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{location:["regenerateSubscribers"]}},enumerable:false,configurable:true});return e}();ActiveRouter.injectProps(RouteSwitch,["location","routeViewsUpdated"]);var warning=function(e){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}if(!e){console.warn.apply(console,t)}};var createTransitionManager=function(){var e;var t=[];var n=function(t){warning(e==null,"A history supports only one prompt at a time");e=t;return function(){if(e===t){e=null}}};var r=function(t,n,r,i){if(e!=null){var a=typeof e==="function"?e(t,n):e;if(typeof a==="string"){if(typeof r==="function"){r(a,i)}else{warning(false,"A history needs a getUserConfirmation function in order to use a prompt message");i(true)}}else{i(a!==false)}}else{i(true)}};var i=function(e){var n=true;var r=function(){var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}if(n){e.apply(void 0,t)}};t.push(r);return function(){n=false;t=t.filter((function(e){return e!==r}))}};var a=function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}t.forEach((function(t){return t.apply(void 0,e)}))};return{setPrompt:n,confirmTransitionTo:r,appendListener:i,notifyListeners:a}};var createScrollHistory=function(e,t){if(t===void 0){t="scrollPositions"}var n=new Map;var r=function(t,r){n.set(t,r);if(storageAvailable(e,"sessionStorage")){var i=[];n.forEach((function(e,t){i.push([t,e])}));e.sessionStorage.setItem("scrollPositions",JSON.stringify(i))}};var i=function(e){return n.get(e)};var a=function(e){return n.has(e)};var s=function(t){r(t,[e.scrollX,e.scrollY])};if(storageAvailable(e,"sessionStorage")){var o=e.sessionStorage.getItem(t);n=o?new Map(JSON.parse(o)):n}if("scrollRestoration"in e.history){history.scrollRestoration="manual"}return{set:r,get:i,has:a,capture:s}};var PopStateEvent="popstate";var HashChangeEvent="hashchange";var createBrowserHistory=function(e,t){if(t===void 0){t={}}var n=false;var r=e.history;var i=e.location;var a=e.navigator;var s=supportsHistory(e);var o=!supportsPopStateOnHashChange(a);var u=createScrollHistory(e);var l=t.forceRefresh!=null?t.forceRefresh:false;var c=t.getUserConfirmation!=null?t.getUserConfirmation:getConfirmation;var d=t.keyLength!=null?t.keyLength:6;var f=t.basename?stripTrailingSlash(addLeadingSlash(t.basename)):"";var p=function(){try{return e.history.state||{}}catch(e){return{}}};var h=function(e){e=e||{};var t=e.key,n=e.state;var r=i.pathname,a=i.search,s=i.hash;var o=r+a+s;warning(!f||hasBasename(o,f),"You are attempting to use a basename on a page whose URL path does not begin "+'with the basename. Expected path "'+o+'" to begin with "'+f+'".');if(f){o=stripBasename(o,f)}return createLocation(o,n,t||createKey(d))};var m=createTransitionManager();var v=function(e){u.capture(U.location.key);Object.assign(U,e);U.location.scrollPosition=u.get(U.location.key);U.length=r.length;m.notifyListeners(U.location,U.action)};var g=function(e){if(!isExtraneousPopstateEvent(a,e)){S(h(e.state))}};var y=function(){S(h(p()))};var S=function(e){if(n){n=false;v()}else{var t="POP";m.confirmTransitionTo(e,t,c,(function(n){if(n){v({action:t,location:e})}else{b(e)}}))}};var b=function(e){var t=U.location;var r=C.indexOf(t.key);var i=C.indexOf(e.key);if(r===-1){r=0}if(i===-1){i=0}var a=r-i;if(a){n=true;T(a)}};var x=h(p());var C=[x.key];var w=0;var _=false;var I=function(e){return f+createPath(e)};var A=function(e,t){warning(!(typeof e==="object"&&e.state!==undefined&&t!==undefined),"You should avoid providing a 2nd state argument to push when the 1st "+"argument is a location-like object that already has state; it is ignored");var n="PUSH";var a=createLocation(e,t,createKey(d),U.location);m.confirmTransitionTo(a,n,c,(function(e){if(!e){return}var t=I(a);var o=a.key,u=a.state;if(s){r.pushState({key:o,state:u},"",t);if(l){i.href=t}else{var c=C.indexOf(U.location.key);var d=C.slice(0,c===-1?0:c+1);d.push(a.key);C=d;v({action:n,location:a})}}else{warning(u===undefined,"Browser history cannot push state in browsers that do not support HTML5 history");i.href=t}}))};var E=function(e,t){warning(!(typeof e==="object"&&e.state!==undefined&&t!==undefined),"You should avoid providing a 2nd state argument to replace when the 1st "+"argument is a location-like object that already has state; it is ignored");var n="REPLACE";var a=createLocation(e,t,createKey(d),U.location);m.confirmTransitionTo(a,n,c,(function(e){if(!e){return}var t=I(a);var o=a.key,u=a.state;if(s){r.replaceState({key:o,state:u},"",t);if(l){i.replace(t)}else{var c=C.indexOf(U.location.key);if(c!==-1){C[c]=a.key}v({action:n,location:a})}}else{warning(u===undefined,"Browser history cannot replace state in browsers that do not support HTML5 history");i.replace(t)}}))};var T=function(e){r.go(e)};var F=function(){return T(-1)};var N=function(){return T(1)};var P=function(t){w+=t;if(w===1){e.addEventListener(PopStateEvent,g);if(o){e.addEventListener(HashChangeEvent,y)}}else if(w===0){e.removeEventListener(PopStateEvent,g);if(o){e.removeEventListener(HashChangeEvent,y)}}};var D=function(e){if(e===void 0){e=""}var t=m.setPrompt(e);if(!_){P(1);_=true}return function(){if(_){_=false;P(-1)}return t()}};var k=function(e){var t=m.appendListener(e);P(1);return function(){P(-1);t()}};var U={length:r.length,action:"POP",location:x,createHref:I,push:A,replace:E,go:T,goBack:F,goForward:N,block:D,listen:k,win:e};return U};var HashChangeEvent$1="hashchange";var HashPathCoders={hashbang:{encodePath:function(e){return e.charAt(0)==="!"?e:"!/"+stripLeadingSlash(e)},decodePath:function(e){return e.charAt(0)==="!"?e.substr(1):e}},noslash:{encodePath:stripLeadingSlash,decodePath:addLeadingSlash},slash:{encodePath:addLeadingSlash,decodePath:addLeadingSlash}};var createHashHistory=function(e,t){if(t===void 0){t={}}var n=false;var r=null;var i=0;var a=false;var s=e.location;var o=e.history;var u=supportsGoWithoutReloadUsingHash(e.navigator);var l=t.keyLength!=null?t.keyLength:6;var c=t.getUserConfirmation,d=c===void 0?getConfirmation:c,f=t.hashType,p=f===void 0?"slash":f;var h=t.basename?stripTrailingSlash(addLeadingSlash(t.basename)):"";var m=HashPathCoders[p],v=m.encodePath,g=m.decodePath;var y=function(){var e=s.href;var t=e.indexOf("#");return t===-1?"":e.substring(t+1)};var S=function(e){return s.hash=e};var b=function(e){var t=s.href.indexOf("#");s.replace(s.href.slice(0,t>=0?t:0)+"#"+e)};var x=function(){var e=g(y());warning(!h||hasBasename(e,h),"You are attempting to use a basename on a page whose URL path does not begin "+'with the basename. Expected path "'+e+'" to begin with "'+h+'".');if(h){e=stripBasename(e,h)}return createLocation(e,undefined,createKey(l))};var C=createTransitionManager();var w=function(e){Object.assign(V,e);V.length=o.length;C.notifyListeners(V.location,V.action)};var _=function(){var e=y();var t=v(e);if(e!==t){b(t)}else{var i=x();var a=V.location;if(!n&&locationsAreEqual(a,i)){return}if(r===createPath(i)){return}r=null;I(i)}};var I=function(e){if(n){n=false;w()}else{var t="POP";C.confirmTransitionTo(e,t,d,(function(n){if(n){w({action:t,location:e})}else{A(e)}}))}};var A=function(e){var t=V.location;var r=N.lastIndexOf(createPath(t));var i=N.lastIndexOf(createPath(e));if(r===-1){r=0}if(i===-1){i=0}var a=r-i;if(a){n=true;U(a)}};var E=y();var T=v(E);if(E!==T){b(T)}var F=x();var N=[createPath(F)];var P=function(e){return"#"+v(h+createPath(e))};var D=function(e,t){warning(t===undefined,"Hash history cannot push state; it is ignored");var n="PUSH";var i=createLocation(e,undefined,createKey(l),V.location);C.confirmTransitionTo(i,n,d,(function(e){if(!e){return}var t=createPath(i);var a=v(h+t);var s=y()!==a;if(s){r=t;S(a);var o=N.lastIndexOf(createPath(V.location));var u=N.slice(0,o===-1?0:o+1);u.push(t);N=u;w({action:n,location:i})}else{warning(false,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack");w()}}))};var k=function(e,t){warning(t===undefined,"Hash history cannot replace state; it is ignored");var n="REPLACE";var i=createLocation(e,undefined,createKey(l),V.location);C.confirmTransitionTo(i,n,d,(function(e){if(!e){return}var t=createPath(i);var a=v(h+t);var s=y()!==a;if(s){r=t;b(a)}var o=N.indexOf(createPath(V.location));if(o!==-1){N[o]=t}w({action:n,location:i})}))};var U=function(e){warning(u,"Hash history go(n) causes a full page reload in this browser");o.go(e)};var O=function(){return U(-1)};var M=function(){return U(1)};var L=function(e,t){i+=t;if(i===1){e.addEventListener(HashChangeEvent$1,_)}else if(i===0){e.removeEventListener(HashChangeEvent$1,_)}};var R=function(t){if(t===void 0){t=""}var n=C.setPrompt(t);if(!a){L(e,1);a=true}return function(){if(a){a=false;L(e,-1)}return n()}};var B=function(t){var n=C.appendListener(t);L(e,1);return function(){L(e,-1);n()}};var V={length:o.length,action:"POP",location:F,createHref:P,push:D,replace:k,go:U,goBack:O,goForward:M,block:R,listen:B,win:e};return V};var getLocation$1=function(e,t){var n=e.pathname.indexOf(t)==0?"/"+e.pathname.slice(t.length):e.pathname;return Object.assign({},e,{pathname:n})};var HISTORIES={browser:createBrowserHistory,hash:createHashHistory};var Router=function(){function e(e){var t=this;registerInstance(this,e);this.root="/";this.historyType="browser";this.titleSuffix="";this.routeViewsUpdated=function(e){if(e===void 0){e={}}if(t.history&&e.scrollToId&&t.historyType==="browser"){var n=t.history.win.document.getElementById(e.scrollToId);if(n){return n.scrollIntoView()}}t.scrollTo(e.scrollTopOffset||t.scrollTopOffset)};this.isServer=getContext(this,"isServer");this.queue=getContext(this,"queue")}e.prototype.componentWillLoad=function(){var e=this;this.history=HISTORIES[this.historyType](this.el.ownerDocument.defaultView);this.history.listen((function(t){t=getLocation$1(t,e.root);e.location=t}));this.location=getLocation$1(this.history.location,this.root)};e.prototype.scrollTo=function(e){var t=this.history;if(e==null||this.isServer||!t){return}if(t.action==="POP"&&Array.isArray(t.location.scrollPosition)){return this.queue.write((function(){if(t&&t.location&&Array.isArray(t.location.scrollPosition)){t.win.scrollTo(t.location.scrollPosition[0],t.location.scrollPosition[1])}}))}return this.queue.write((function(){t.win.scrollTo(0,e)}))};e.prototype.render=function(){if(!this.location||!this.history){return}var e={historyType:this.historyType,location:this.location,titleSuffix:this.titleSuffix,root:this.root,history:this.history,routeViewsUpdated:this.routeViewsUpdated};return h(ActiveRouter.Provider,{state:e},h("slot",null))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();var superSelectionAppCss="html{scroll-behavior:smooth}stencil-route{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-pack:center;justify-content:center}stencil-route:empty{display:none}input+.invalid-feedback{display:none}select+.invalid-feedback{display:none}.was-validated input:invalid+.invalid-feedback{display:block}.was-validated select:invalid+.invalid-feedback{display:block}";var SuperSelectionApp=function(){function e(e){registerInstance(this,e);this.stepSubmitSuccess=createEvent(this,"step-completion",7);this.successPageAcknowledged=createEvent(this,"successPageAcknowledged",5);this.initialised=createEvent(this,"initialised",7);this.isSelfHosted=false;this.isAppInitialised=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;var r=this;return __generator(this,(function(i){e=Option.fromNullable(this.accessToken);if(Option.isNone(e)){throw Error("jwt property is missing.")}superSelectionAppService.state.jwt=e;t=Option.fromNullable(this.backendUrl);if(Option.isNone(t)){throw Error("apiBaseUrl property is missing.")}superSelectionAppService.state.apiBaseUrl=Option.some(t.value.replace(/\/$/,"")+"/");n=Option.fromNullable(this.appBaseUrl);if(Option.isNone(n)){throw Error("appBaseUrl property is missing.")}superSelectionAppService.state.appBaseUrl=Option.some(n.value.replace(/\/$/,""));superSelectionAppService.onChange("hasSuccessPageBeenAcknowledged",(function(e){return r.successPageAcknowledged.emit()}));superSelectionAppService.onChange("hasSuperSelectionBeenSubmitted",(function(e){if(!e)return;r.stepSubmitSuccess.emit();superSelectionAppService.state.hasSuperSelectionBeenSubmitted=false;if(r.isSelfHosted){navigationService.navigateInternally(r.history,SuperSelectionAppRoutes.Success)}}));return[2]}))}))};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:return[4,superSelectionAppService.loadAppStateAsync()];case 1:i.sent();return[4,existingFundService.GetExistingFundAsync()];case 2:e=i.sent();this.isAppInitialised=true;this.initialised.emit({accountIdOrDefault:superSelectionAppService.accountIdOrDefault,partnerIdOrDefault:superSelectionAppService.partnerIdOrDefault,profileId:superSelectionAppService.profileId});iframe.appReady();t=Option.fromNullable(this.ignoreExistingSelection);n=Option.isSome(e)&&e.value.type=="Defined Benefits Fund"&&(Option.isNone(superSelectionAppService.isDefinedBenefitsEligible)||!superSelectionAppService.isDefinedBenefitsEligible.value);r=Option.isSome(t)&&t.value||n;if(Option.isSome(superSelectionAppService.state.superChoicePrefill)){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.Prefill)}else if(Option.isSome(e)&&e.value.valid!=="Inactive"&&!r){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ExistingChoicePage)}else{navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage)}return[2]}}))}))};e.prototype.authTokenChanged=function(e){superSelectionAppService.state.jwt=Option.fromNullable(e)};e.prototype.onRouteChange=function(){window===null||window===void 0?void 0:window.scroll(0,0)};e.prototype.render=function(){return h(Host,null,h("link",{rel:"stylesheet",href:getAssetPath("apollo-super-selection.css"),media:"all"}),this.renderAppContent())};e.prototype.routerBaseUrl=function(){var e;return((e=this.appBaseUrl)===null||e===void 0?void 0:e.replace(/\/$/,""))+"/"};e.prototype.renderAppContent=function(){return h("stencil-router",{root:this.routerBaseUrl(),class:"font-inter"},h("stencil-route-switch",{scrollTopOffset:0},this.isAppInitialised?h("div",{class:"pt-28 -mt-12 pb-6"},superSelectionAppStencilRoutes,h("sss-footer-section",null)):h("div",{class:"flex justify-center py-20"},h("sss-loading-indicator",null))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{accessToken:["authTokenChanged"],location:["onRouteChange"]}},enumerable:false,configurable:true});return e}();injectHistory(SuperSelectionApp);SuperSelectionApp.style=superSelectionAppCss;var resizeObservers=[];var hasActiveObservations=function(){return resizeObservers.some((function(e){return e.activeTargets.length>0}))};var hasSkippedObservations=function(){return resizeObservers.some((function(e){return e.skippedTargets.length>0}))};var msg="ResizeObserver loop completed with undelivered notifications.";var deliverResizeLoopError=function(){var e;if(typeof ErrorEvent==="function"){e=new ErrorEvent("error",{message:msg})}else{e=document.createEvent("Event");e.initEvent("error",false,false);e.message=msg}window.dispatchEvent(e)};var ResizeObserverBoxOptions;(function(e){e["BORDER_BOX"]="border-box";e["CONTENT_BOX"]="content-box";e["DEVICE_PIXEL_CONTENT_BOX"]="device-pixel-content-box"})(ResizeObserverBoxOptions||(ResizeObserverBoxOptions={}));var freeze=function(e){return Object.freeze(e)};var ResizeObserverSize=function(){function e(e,t){this.inlineSize=e;this.blockSize=t;freeze(this)}return e}();var DOMRectReadOnly=function(){function e(e,t,n,r){this.x=e;this.y=t;this.width=n;this.height=r;this.top=this.y;this.left=this.x;this.bottom=this.top+this.height;this.right=this.left+this.width;return freeze(this)}e.prototype.toJSON=function(){var e=this,t=e.x,n=e.y,r=e.top,i=e.right,a=e.bottom,s=e.left,o=e.width,u=e.height;return{x:t,y:n,top:r,right:i,bottom:a,left:s,width:o,height:u}};e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)};return e}();var isSVG=function(e){return e instanceof SVGElement&&"getBBox"in e};var isHidden=function(e){if(isSVG(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,a=i.offsetWidth,s=i.offsetHeight;return!(a||s||e.getClientRects().length)};var isElement=function(e){var t,n;var r=(n=(t=e)===null||t===void 0?void 0:t.ownerDocument)===null||n===void 0?void 0:n.defaultView;return!!(r&&e instanceof r.Element)};var isReplacedElement=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image"){break}case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return true}return false};var global$1=typeof window!=="undefined"?window:{};var cache=new WeakMap;var scrollRegexp=/auto|scroll/;var verticalRegexp=/^tb|vertical/;var IE=/msie|trident/i.test(global$1.navigator&&global$1.navigator.userAgent);var parseDimension=function(e){return parseFloat(e||"0")};var size=function(e,t,n){if(e===void 0){e=0}if(t===void 0){t=0}if(n===void 0){n=false}return new ResizeObserverSize((n?t:e)||0,(n?e:t)||0)};var zeroBoxes=freeze({devicePixelContentBoxSize:size(),borderBoxSize:size(),contentBoxSize:size(),contentRect:new DOMRectReadOnly(0,0,0,0)});var calculateBoxSizes=function(e,t){if(t===void 0){t=false}if(cache.has(e)&&!t){return cache.get(e)}if(isHidden(e)){cache.set(e,zeroBoxes);return zeroBoxes}var n=getComputedStyle(e);var r=isSVG(e)&&e.ownerSVGElement&&e.getBBox();var i=!IE&&n.boxSizing==="border-box";var a=verticalRegexp.test(n.writingMode||"");var s=!r&&scrollRegexp.test(n.overflowY||"");var o=!r&&scrollRegexp.test(n.overflowX||"");var u=r?0:parseDimension(n.paddingTop);var l=r?0:parseDimension(n.paddingRight);var c=r?0:parseDimension(n.paddingBottom);var d=r?0:parseDimension(n.paddingLeft);var f=r?0:parseDimension(n.borderTopWidth);var p=r?0:parseDimension(n.borderRightWidth);var h=r?0:parseDimension(n.borderBottomWidth);var m=r?0:parseDimension(n.borderLeftWidth);var v=d+l;var g=u+c;var y=m+p;var S=f+h;var b=!o?0:e.offsetHeight-S-e.clientHeight;var x=!s?0:e.offsetWidth-y-e.clientWidth;var C=i?v+y:0;var w=i?g+S:0;var _=r?r.width:parseDimension(n.width)-C-x;var I=r?r.height:parseDimension(n.height)-w-b;var A=_+v+x+y;var E=I+g+b+S;var T=freeze({devicePixelContentBoxSize:size(Math.round(_*devicePixelRatio),Math.round(I*devicePixelRatio),a),borderBoxSize:size(A,E,a),contentBoxSize:size(_,I,a),contentRect:new DOMRectReadOnly(d,u,_,I)});cache.set(e,T);return T};var calculateBoxSize=function(e,t,n){var r=calculateBoxSizes(e,n),i=r.borderBoxSize,a=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:return s;case ResizeObserverBoxOptions.BORDER_BOX:return i;default:return a}};var ResizeObserverEntry=function(){function e(e){var t=calculateBoxSizes(e);this.target=e;this.contentRect=t.contentRect;this.borderBoxSize=freeze([t.borderBoxSize]);this.contentBoxSize=freeze([t.contentBoxSize]);this.devicePixelContentBoxSize=freeze([t.devicePixelContentBoxSize])}return e}();var calculateDepthForNode=function(e){if(isHidden(e)){return Infinity}var t=0;var n=e.parentNode;while(n){t+=1;n=n.parentNode}return t};var broadcastActiveObservations=function(){var e=Infinity;var t=[];resizeObservers.forEach((function n(r){if(r.activeTargets.length===0){return}var i=[];r.activeTargets.forEach((function t(n){var r=new ResizeObserverEntry(n.target);var a=calculateDepthForNode(n.target);i.push(r);n.lastReportedSize=calculateBoxSize(n.target,n.observedBox);if(a<e){e=a}}));t.push((function e(){r.callback.call(r.observer,i,r.observer)}));r.activeTargets.splice(0,r.activeTargets.length)}));for(var n=0,r=t;n<r.length;n++){var i=r[n];i()}return e};var gatherActiveObservationsAtDepth=function(e){resizeObservers.forEach((function t(n){n.activeTargets.splice(0,n.activeTargets.length);n.skippedTargets.splice(0,n.skippedTargets.length);n.observationTargets.forEach((function t(r){if(r.isActive()){if(calculateDepthForNode(r.target)>e){n.activeTargets.push(r)}else{n.skippedTargets.push(r)}}}))}))};var process=function(){var e=0;gatherActiveObservationsAtDepth(e);while(hasActiveObservations()){e=broadcastActiveObservations();gatherActiveObservationsAtDepth(e)}if(hasSkippedObservations()){deliverResizeLoopError()}return e>0};var trigger;var callbacks=[];var notify=function(){return callbacks.splice(0).forEach((function(e){return e()}))};var queueMicroTask=function(e){if(!trigger){var t=0;var n=document.createTextNode("");var r={characterData:true};new MutationObserver((function(){return notify()})).observe(n,r);trigger=function(){n.textContent=""+(t?t--:t++)}}callbacks.push(e);trigger()};var queueResizeObserver=function(e){queueMicroTask((function t(){requestAnimationFrame(e)}))};var watching=0;var isWatching=function(){return!!watching};var CATCH_PERIOD=250;var observerConfig={attributes:true,characterData:true,childList:true,subtree:true};var events=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"];var time=function(e){if(e===void 0){e=0}return Date.now()+e};var scheduled=false;var Scheduler=function(){function e(){var e=this;this.stopped=true;this.listener=function(){return e.schedule()}}e.prototype.run=function(e){var t=this;if(e===void 0){e=CATCH_PERIOD}if(scheduled){return}scheduled=true;var n=time(e);queueResizeObserver((function(){var r=false;try{r=process()}finally{scheduled=false;e=n-time();if(!isWatching()){return}if(r){t.run(1e3)}else if(e>0){t.run(e)}else{t.start()}}}))};e.prototype.schedule=function(){this.stop();this.run()};e.prototype.observe=function(){var e=this;var t=function(){return e.observer&&e.observer.observe(document.body,observerConfig)};document.body?t():global$1.addEventListener("DOMContentLoaded",t)};e.prototype.start=function(){var e=this;if(this.stopped){this.stopped=false;this.observer=new MutationObserver(this.listener);this.observe();events.forEach((function(t){return global$1.addEventListener(t,e.listener,true)}))}};e.prototype.stop=function(){var e=this;if(!this.stopped){this.observer&&this.observer.disconnect();events.forEach((function(t){return global$1.removeEventListener(t,e.listener,true)}));this.stopped=true}};return e}();var scheduler=new Scheduler;var updateCount=function(e){!watching&&e>0&&scheduler.start();watching+=e;!watching&&scheduler.stop()};var skipNotifyOnElement=function(e){return!isSVG(e)&&!isReplacedElement(e)&&getComputedStyle(e).display==="inline"};var ResizeObservation=function(){function e(e,t){this.target=e;this.observedBox=t||ResizeObserverBoxOptions.CONTENT_BOX;this.lastReportedSize={inlineSize:0,blockSize:0}}e.prototype.isActive=function(){var e=calculateBoxSize(this.target,this.observedBox,true);if(skipNotifyOnElement(this.target)){this.lastReportedSize=e}if(this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize){return true}return false};return e}();var ResizeObserverDetail=function(){function e(e,t){this.activeTargets=[];this.skippedTargets=[];this.observationTargets=[];this.observer=e;this.callback=t}return e}();var observerMap=new WeakMap;var getObservationIndex=function(e,t){for(var n=0;n<e.length;n+=1){if(e[n].target===t){return n}}return-1};var ResizeObserverController=function(){function e(){}e.connect=function(e,t){var n=new ResizeObserverDetail(e,t);observerMap.set(e,n)};e.observe=function(e,t,n){var r=observerMap.get(e);var i=r.observationTargets.length===0;if(getObservationIndex(r.observationTargets,t)<0){i&&resizeObservers.push(r);r.observationTargets.push(new ResizeObservation(t,n&&n.box));updateCount(1);scheduler.schedule()}};e.unobserve=function(e,t){var n=observerMap.get(e);var r=getObservationIndex(n.observationTargets,t);var i=n.observationTargets.length===1;if(r>=0){i&&resizeObservers.splice(resizeObservers.indexOf(n),1);n.observationTargets.splice(r,1);updateCount(-1)}};e.disconnect=function(e){var t=this;var n=observerMap.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)}));n.activeTargets.splice(0,n.activeTargets.length)};return e}();var ResizeObserver=function(){function e(e){if(arguments.length===0){throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.")}if(typeof e!=="function"){throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.")}ResizeObserverController.connect(this,e)}e.prototype.observe=function(e,t){if(arguments.length===0){throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.")}if(!isElement(e)){throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element")}ResizeObserverController.observe(this,e,t)};e.prototype.unobserve=function(e){if(arguments.length===0){throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.")}if(!isElement(e)){throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element")}ResizeObserverController.unobserve(this,e)};e.prototype.disconnect=function(){ResizeObserverController.disconnect(this)};e.toString=function(){return"function ResizeObserver () { [polyfill code] }"};return e}();var AppConfigurationService=function(){function e(){var e=this;this._appRootUrl=new Lazy((function(){return e.resolveRootUrl()}));this.getAppRootUrl=function(){return e._appRootUrl.value};this.getAppHostUrl=function(){return(""+window.location.origin+e.getAppRootUrl()).replace(/\/$/,"")}}e.prototype.loadConfigurationAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,factory(this.getAppRootUrl()+"config.json").get().json()];case 1:e=t.sent();sessionStore.update({appConfiguration:Option.fromNullable(e)});return[2]}}))}))};e.prototype.resolveRootUrl=function(){var e=Option.fromNullable(window.location.pathname.match(/^\/super-selection\/embed\/v1.0\/app/));if(Option.isNone(e)){throw Error("Unsupported host URL")}return e.value[0]+"/"};return e}();var appConfigurationService=new AppConfigurationService;var AppParametersService=function(){function e(){this.ignoreExistingSelectionQueryParameter="ignoreExistingSelection"}e.prototype.init=function(e){var t=new URLSearchParams(e);var n=Option.fromNullable(t.get(this.ignoreExistingSelectionQueryParameter));var r=Option.fold((function(){return false}),(function(e){return e==="true"}))(n);sessionStore.update({ignoreExistingSelection:r})};return e}();var appParametersService=new AppParametersService;var AuthenticationQuery=function(e){__extends(t,e);function t(t){var n=e.call(this,t)||this;n.store=t;n.sessionState$=n.select((function(e){return e.authenticationState}));n.jwt$=n.select((function(e){return e.jwt}));return n}Object.defineProperty(t.prototype,"sessionState",{get:function(){return this.getValue().authenticationState},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isUnauthorized",{get:function(){return this.getValue().authenticationState===AuthenticationState.Unauthorized||this.getValue().authenticationState===AuthenticationState.Error},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isAuthorized",{get:function(){return this.getValue().authenticationState===AuthenticationState.Authenticated},enumerable:false,configurable:true});return t}(Query);var sessionQuery=new AuthenticationQuery(sessionStore);function sendAnalyticsEvent(e,t){if(window["gtag"]){window["gtag"]("event",e,t)}}var AuthenticationService=function(){function e(){this.authCodeQueryParameter="code"}e.prototype.authorizationCodeIsPresent=function(e){var t=this.getAuthorizationCodeFromRoute(e);return Option.isSome(t)};e.prototype.initFromRoute=function(e){var t=this.getAuthorizationCodeFromRoute(e);if(Option.isNone(t)){sessionStore.update({authenticationState:AuthenticationState.Error});throw Error('"'+this.authCodeQueryParameter+'" URL query parameter missing')}this.authCodeExchangeAsync(t.value)};e.prototype.authCodeExchangeAsync=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n;return __generator(this,(function(r){switch(r.label){case 0:t=new URLSearchParams([["grant_type","authorization_code"],["client_id","apollo-super-selection-app"],["code",e],["redirect_uri",""+appConfigurationService.getAppHostUrl()]]);return[4,factory(appConfigurationQuery.configuration.OidcAuthority+"/connect/token").headers({"Content-Type":"application/x-www-form-urlencoded"}).post(t.toString()).badRequest((function(){sessionStore.update({authenticationState:AuthenticationState.Error});throw new Error("Failed to authenticate.")})).json()];case 1:n=r.sent();sessionStore.update({jwt:Option.fromNullable(n.access_token),authenticationState:AuthenticationState.Authenticated});sendAnalyticsEvent("oidc_sign_in",{});window.history.replaceState(null,"",appConfigurationService.getAppRootUrl());return[2]}}))}))};e.prototype.getAuthorizationCodeFromRoute=function(e){var t=new URLSearchParams(e);return Option.fromNullable(t.get(this.authCodeQueryParameter))};return e}();var authenticationService=new AuthenticationService;var InteropQuery=function(e){__extends(t,e);function t(t){var n=e.call(this,t)||this;n.store=t;return n}t.prototype.isReactNativeInteropEnabled=function(){return isSome(this.getValue().reactNativeInterop)};t.prototype.isIframeInteropEnabled=function(){return isSome(this.getValue().iframeInterop)};t.prototype.getIframeInteropMode=function(){var e=this.getValue().iframeInterop;if(isNone(e)){throw Error("Failed to get iframe interop information: no data in store")}if(!this.isIframeInteropEnabled()){throw Error("Failed to get iframe interop information: iframe mode is disabled")}return e.value};return t}(Query);var interopQuery=new InteropQuery(sessionStore);var IFrameInteropService=function(){function e(){}e.completeSuperSelectionStep=function(){var e=interopQuery.getIframeInteropMode().successRedirectionUrl;if(Option.isSome(e)){window.top.location.href=e.value}else{iframe.complete()}};e.initFromRoute=function(e){var t="success-redirection-url";var n=new URLSearchParams(e);var r=Option.fromNullable(n.get(t));var i={successRedirectionUrl:Option.none};if(Option.isSome(r)){try{var a=new URL(r.value);i.successRedirectionUrl=Option.some(a.toString())}catch(e){throw Error('"'+r.value+'" is not a valid URL')}}return i};return e}();var ReactNativeInteropService=function(){function e(){}e.init=function(){var e=window["ReactNativeWebView"]!==undefined;if(!e){throw Error("React Native WebView messaging is not enabled. Please, refer to https://github.com/react-native-webview/react-native-webview/blob/master/docs/Guide.md#the-windowreactnativewebviewpostmessage-method-and-onmessage-prop")}return new ReactNativeInteropMode};e.completeSuperSelectionStep=function(){this.postRNMessage()};e.postRNMessage=function(){var t={stepStatus:"completed"};e.getRnInterop().postMessage(JSON.stringify(t))};return e}();ReactNativeInteropService.getRnInterop=function(){return window["ReactNativeWebView"]};var HostInteropService=function(){function e(){this.interopModeQueryParameter="interop-mode"}e.prototype.completeSuperSelectionStep=function(){if(interopQuery.isIframeInteropEnabled()){IFrameInteropService.completeSuperSelectionStep()}else if(interopQuery.isReactNativeInteropEnabled()){ReactNativeInteropService.completeSuperSelectionStep()}else{throw Error("Unknown interop mode")}};e.prototype.init=function(e){var t=new URLSearchParams(e);var n=fromNullable(t.get(this.interopModeQueryParameter));if(isSome(n)&&n.value==="react-native"){sessionStore.update({reactNativeInterop:some(ReactNativeInteropService.init())});return}sessionStore.update({iframeInterop:some(IFrameInteropService.initFromRoute(e))})};return e}();var hostInteropService=new HostInteropService;function initHost(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:appParametersService.init(window.location.search);return[4,appConfigurationService.loadConfigurationAsync()];case 1:t.sent();appInsights.init();addSlashToUrl();e=sessionQuery.isUnauthorized||authenticationService.authorizationCodeIsPresent(window.location.search);if(!e){return[2]}hostInteropService.init(window.location.search);authenticationService.initFromRoute(window.location.search);return[2]}}))}))}var AppParametersQuery=function(e){__extends(t,e);function t(t){var n=e.call(this,t)||this;n.store=t;n.ignoreExistingSelection$=n.select((function(e){return e.ignoreExistingSelection}));return n}Object.defineProperty(t.prototype,"ignoreExistingSelection",{get:function(){return this.getValue().ignoreExistingSelection},enumerable:false,configurable:true});return t}(Query);var appParametersQuery=new AppParametersQuery(sessionStore);var superSelectionAppHostCss="html{scroll-behavior:smooth}.sss-app-container{--fl-color-primary:#2E66F7;--fl-color-primary-light:#EAF0FE;--fl-color-primary-dark:#031495;--fl-color-primary-disabled:#88ABFA;--fl-color-primary-hover:#5786F8;--fl-color-primary-focus:#1033C6;--fl-color-primary-text:#3d3d3d;--fl-color-secondary:#e5e5e5;--fl-color-secondary-hover:#b3b3b3;--fl-color-secondary-focus:#b3b3b3}@media screen and (-webkit-min-device-pixel-ratio: 0){select,textarea,input{font-size:16px}}";var SuperSelectionAppHost=function(){function e(e){registerInstance(this,e)}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:return[4,initHost()];case 1:t.sent();sessionQuery.sessionState$.subscribe((function(t){return e.sessionState=t}));sessionQuery.jwt$.subscribe((function(t){return e.jwt=t}));appConfigurationQuery.appConfiguration$.subscribe((function(t){return e.appConfiguration=t}));appParametersQuery.ignoreExistingSelection$.subscribe((function(t){return e.ignoreExistingSelection=t}));return[2]}}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("link",{rel:"stylesheet",href:getAssetPath("apollo-super-selection.css"),media:"all"}),h("div",{ref:function(t){return e.observeContentResize(t)}},Option.isNone(this.appConfiguration)?h("sss-loading-page",{class:"font-inter"}):this.renderAppContent()))};e.prototype.renderAppContent=function(){var e=this;return h("stencil-router",{root:appConfigurationService.getAppRootUrl(),class:"sss-app-container"},h("stencil-route-switch",{scrollTopOffset:0},h("stencil-route",{url:"/",routeRender:this.renderProtectedRoute((function(t){return h("super-selection-app",Object.assign({accessToken:Option.toUndefined(e.jwt),ignoreExistingSelection:e.ignoreExistingSelection,backendUrl:appConfigurationQuery.configuration.ApiBaseUrl,appBaseUrl:e.getAppBaseUrl(),onSuccessPageAcknowledged:e.handleSuccessPageAcknowledged,"onStep-completion":e.handleStepSubmitSuccess,onInitialised:e.handleAppInitialised,isSelfHosted:true},t))}))})))};e.prototype.getAppBaseUrl=function(){var e=window.location.pathname.split("app");return e[0]+"app/"};e.prototype.handleSuccessPageAcknowledged=function(){hostInteropService.completeSuperSelectionStep()};e.prototype.handleStepSubmitSuccess=function(){iframe.submitSuccess()};e.prototype.handleAppInitialised=function(e){appInsights.addCustomProperties({"X-ACCOUNT-ID":e.detail.accountIdOrDefault,"X-PARTNER-ID":e.detail.partnerIdOrDefault,"X-PROFILE-ID":e.detail.profileId});appInsights.getAppInsights().trackPageView();var t=document.getElementById("sss-external-loading-page-container");if(t){document.body.removeChild(t)}};e.prototype.observeContentResize=function(e){var t=window.ResizeObserver||ResizeObserver;new t((function(){iframe.resize(e.offsetHeight,-1)})).observe(e)};e.prototype.renderProtectedRoute=function(e){switch(this.sessionState){case AuthenticationState.Authenticated:return e;case AuthenticationState.Unauthorized:return function(){return h("sss-loading-page",null)};case AuthenticationState.Error:return function(){return h("h1",null,"Authentication Error")};default:return function(){return h("h1",null,"Authentication Error")}}};return e}();SuperSelectionAppHost.style=superSelectionAppHostCss;export{Button as sss_button,ChoiceRouter as sss_choice_router,CustomFund as sss_custom_fund,DefaultFund as sss_default_fund,SelectInputAsync as sss_dropdown_async,ExistingChoice as sss_existing_choice_page,FooterSection as sss_footer_section,HeaderSection as sss_header_section,LoadingIndicator as sss_loading_indicator,LoadingPage as sss_loading_page,MyOwnFundEngagementStep as sss_my_own_fund_engagement_step_host,MemberNameInput as sss_name_input,Prefill as sss_prefill,DisplayField as sss_prefill_display_field,PrefillErrorBox as sss_prefill_error_box,PrefillInvalidMyOwnFund as sss_prefill_invalid_my_own_fund,PrefillInvalidSMSF as sss_prefill_invalid_smsf,PrefillMyOwnFund as sss_prefill_my_own_fund,PrefillSMSF as sss_prefill_smsf,PrefillWarningBox as sss_prefill_warning_box,SmsfEngagementStep as sss_smsf_engagement_step_host,StandardChoiceFormInputDefaultFund as sss_standard_choice_form,Success as sss_success,FeaturedFunds as sss_super_campaign_featured_funds,SuperCampaignHost as sss_super_campaign_host,SuperSmsfHost as sss_super_smsf_host,Route as stencil_route,RouteLink$1 as stencil_route_link,RouteSwitch as stencil_route_switch,Router as stencil_router,SuperSelectionApp as super_selection_app,SuperSelectionAppHost as super_selection_app_host};