@flarehr/apollo-super-selection 3.58.63097 → 3.59.63229

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,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 o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r["throw"](e))}catch(e){a(e)}}function u(e){e.done?n(e.value):i(e.value).then(o,s)}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,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return u([e,t])}}function u(o){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;i=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e];i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h,g as getRenderingRef,f as forceUpdate,a as getAssetPath,H as Host,c as createEvent,F as Fragment,d as getElement,e as getContext,s as setErrorHandler}from"./index-e1e930c8.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{A as ActiveRouter}from"./active-router-2056f552.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 o=e;e.addEventListener(t,n,i);a=function(){return o.removeEventListener(t,n,i)}}else if(isJQueryStyleEventEmitter(e)){var s=e;e.on(t,n);a=function(){return s.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="3.58.63097";var isSome=function(e){return e._tag==="Some"};var isNone=function(e){return e._tag==="None"};var none={_tag:"None"};var some=function(e){return{_tag:"Some",value:e}};function fromNullable(e){return e==null?none:some(e)}function toUndefined(e){return isNone(e)?undefined:e.value}var getOrElseW=function(e){return function(t){return isNone(t)?e():t.value}};var getOrElse=getOrElseW;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)}}function injectHistory(e){ActiveRouter.injectProps(e,["history","location"])}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 o=t&&t.delimiter||DEFAULT_DELIMITER;var s=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 g=l[2];var v=l[3];var m=l[4];var y=l[5];if(!u&&a.length){var S=a.length-1;if(s.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 w=y==="+"||y==="*";var _=y==="?"||y==="*";var x=p||o;var C=v||m;n.push({name:g||r++,prefix:p,delimiter:x,optional:_,repeat:w,partial:b,pattern:C?escapeGroup(C):"[^"+escapeString(x)+"]+?"})}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 o=n.delimiters||DEFAULT_DELIMITERS;var s=[].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&&o.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+=s==="$"?"$":"(?="+s+")"}else{if(!r)u+="(?:"+a+"(?="+s+"))?";if(!l)u+="(?="+a+"|"+s+")"}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 o=e&&isAbsolute(e);var s=t&&isAbsolute(t);var u=o||s;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 o=Object.keys(e);var s=Object.keys(t);if(o.length!==s.length){return false}return o.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 o=pathToRegexp(e,a,t);var s={re:o,keys:a};if(cacheCount<cacheLimit){r[i]=s;cacheCount+=1}return s};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,o=t.strict,s=o===void 0?false:o;var u=compilePath(r,{end:a,strict:s}),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.promiseFn=function(){return Promise.resolve()};this.state=PromiseButtonState.Available}e.prototype.render=function(){var e=this;return h("button",{class:{"inline-flex items-center justify-center px-4 py-2 border text-base font-medium rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-focus pointer-events-auto":true,"disabled:pointer-events-none disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400":true,"border-transparent text-white bg-primary-base hover:bg-primary-hover":this.variant==="primary","border-gray-300 text-gray-700 bg-white hover:bg-gray-50":this.variant==="secondary","w-full":this.fillWidth||this.fillWidthOnMobile,"sm:w-auto":this.fillWidthOnMobile},disabled:this.disabled,onClick:function(){return e.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 __assign$1=undefined&&undefined.__assign||function(){__assign$1=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign$1.apply(this,arguments)};var __spreadArrays=undefined&&undefined.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r};var mix=function(e,t,n){if(n===void 0){n=false}if(!e||!t||typeof e!=="object"||typeof t!=="object")return e;var r=__assign$1({},e);for(var i in t){if(t.hasOwnProperty(i)){if(t[i]instanceof Array&&e[i]instanceof Array){r[i]=n?__spreadArrays(e[i],t[i]):t[i]}else if(typeof t[i]==="object"&&typeof e[i]==="object"){r[i]=mix(e[i],t[i],n)}else{r[i]=t[i]}}}return r};var __spreadArrays$1=undefined&&undefined.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r};var config={defaults:{},errorType:null,polyfills:{fetch:null,FormData:null,URLSearchParams:null,performance:null,PerformanceObserver:null,AbortController:null},polyfill:function(e,t){var n=t===void 0?{}:t,r=n.doThrow,i=r===void 0?true:r,a=n.instance,o=a===void 0?false:a;var s=[];for(var u=2;u<arguments.length;u++){s[u-2]=arguments[u]}var l=this.polyfills[e]||(typeof self!=="undefined"?self[e]:null)||(typeof global!=="undefined"?global[e]:null);if(i&&!l)throw new Error(e+" is not defined");return o&&l?new(l.bind.apply(l,__spreadArrays$1([void 0],s))):l}};var onMatch=function(e,t,n,r){if(!e.getEntriesByName)return false;var i=e.getEntriesByName(t);if(i&&i.length>0){n(i.reverse()[0]);if(r.clearMeasures)r.clearMeasures(t);perfs.callbacks.delete(t);if(perfs.callbacks.size<1){perfs.observer.disconnect();if(r.clearResourceTimings){r.clearResourceTimings()}}return true}return false};var lazyObserver=function(e,t){if(!perfs.observer&&e&&t){perfs.observer=new t((function(t){perfs.callbacks.forEach((function(n,r){onMatch(t,r,n,e)}))}));if(e.clearResourceTimings)e.clearResourceTimings()}return perfs.observer};var perfs={callbacks:new Map,observer:null,observe:function(e,t){if(!e||!t)return;var n=config.polyfill("performance",{doThrow:false});var r=config.polyfill("PerformanceObserver",{doThrow:false});if(!lazyObserver(n,r))return;if(!onMatch(n,e,t,n)){if(perfs.callbacks.size<1)perfs.observer.observe({entryTypes:["resource","measure"]});perfs.callbacks.set(e,t)}}};var middlewareHelper=function(e){return function(t){return e.length===0?t:e.length===1?e[0](t):e.reduceRight((function(n,r,i){return i===e.length-2?r(n(t)):r(n)}))}};var WretchErrorWrapper=function(){function e(e){this.error=e}return e}();var resolver=function(e){var t=e._url,n=e._catchers,r=e._resolvers,i=e._middlewares,a=e._options;var o=new Map(n);var s=mix(config.defaults,a);var u=config.polyfill("AbortController",{doThrow:false,instance:true});if(!s["signal"]&&u){s["signal"]=u.signal}var l={ref:null,clear:function(){if(l.ref){clearTimeout(l.ref);l.ref=null}}};var c=middlewareHelper(i)(config.polyfill("fetch"))(t,s);var d=c.catch((function(e){throw new WretchErrorWrapper(e)})).then((function(e){l.clear();if(!e.ok){return e[config.errorType||"text"]().then((function(t){var n=new Error(t);n[config.errorType||"text"]=t;n["status"]=e.status;n["response"]=e;throw n}))}return e}));var f=function(t){return t.catch((function(t){l.clear();var n=t instanceof WretchErrorWrapper?t.error:t;if(t instanceof WretchErrorWrapper&&o.has("__fromFetch"))return o.get("__fromFetch")(n,e);else if(o.has(n.status))return o.get(n.status)(n,e);else if(o.has(n.name))return o.get(n.name)(n,e);else throw n}))};var p=function(e){return function(t){return e?f(d.then((function(t){return t&&t[e]()})).then((function(e){return t?t(e):e}))):f(d.then((function(e){return t?t(e):e})))}};var h={res:p(null),json:p("json"),blob:p("blob"),formData:p("formData"),arrayBuffer:p("arrayBuffer"),text:p("text"),perfs:function(e){c.then((function(t){return perfs.observe(t.url,e)}));return h},setTimeout:function(e,t){if(t===void 0){t=u}l.clear();l.ref=setTimeout((function(){return t.abort()}),e);return h},controller:function(){return[u,h]},error:function(e,t){o.set(e,t);return h},badRequest:function(e){return h.error(400,e)},unauthorized:function(e){return h.error(401,e)},forbidden:function(e){return h.error(403,e)},notFound:function(e){return h.error(404,e)},timeout:function(e){return h.error(408,e)},internalError:function(e){return h.error(500,e)},fetchError:function(e){return h.error("__fromFetch",e)},onAbort:function(e){return h.error("AbortError",e)}};return r.reduce((function(t,n){return n(t,e)}),h)};var __assign$2=undefined&&undefined.__assign||function(){__assign$2=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign$2.apply(this,arguments)};var __spreadArrays$2=undefined&&undefined.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r};var JSON_MIME="application/json";var CONTENT_TYPE_HEADER="Content-Type";var Wretcher=function(){function e(e,t,n,r,i,a){if(n===void 0){n=new Map}if(r===void 0){r=[]}if(i===void 0){i=[]}if(a===void 0){a=[]}this._url=e;this._options=t;this._catchers=n;this._resolvers=r;this._middlewares=i;this._deferredChain=a}e.factory=function(t,n){if(t===void 0){t=""}if(n===void 0){n={}}return new e(t,n)};e.prototype.selfFactory=function(t){var n=t===void 0?{}:t,r=n.url,i=r===void 0?this._url:r,a=n.options,o=a===void 0?this._options:a,s=n.catchers,u=s===void 0?this._catchers:s,l=n.resolvers,c=l===void 0?this._resolvers:l,d=n.middlewares,f=d===void 0?this._middlewares:d,p=n.deferredChain,h=p===void 0?this._deferredChain:p;return new e(i,__assign$2({},o),new Map(u),__spreadArrays$2(c),__spreadArrays$2(f),__spreadArrays$2(h))};e.prototype.defaults=function(e,t){if(t===void 0){t=false}config.defaults=t?mix(config.defaults,e):e;return this};e.prototype.errorType=function(e){config.errorType=e;return this};e.prototype.polyfills=function(e){config.polyfills=__assign$2(__assign$2({},config.polyfills),e);return this};e.prototype.url=function(e,t){if(t===void 0){t=false}if(t)return this.selfFactory({url:e});var n=this._url.split("?");return this.selfFactory({url:n.length>1?n[0]+e+"?"+n[1]:this._url+e})};e.prototype.options=function(e,t){if(t===void 0){t=true}return this.selfFactory({options:t?mix(this._options,e):e})};e.prototype.query=function(e,t){if(t===void 0){t=false}return this.selfFactory({url:appendQueryParams(this._url,e,t)})};e.prototype.headers=function(e){return this.selfFactory({options:mix(this._options,{headers:e||{}})})};e.prototype.accept=function(e){return this.headers({Accept:e})};e.prototype.content=function(e){var t;return this.headers((t={},t[CONTENT_TYPE_HEADER]=e,t))};e.prototype.auth=function(e){return this.headers({Authorization:e})};e.prototype.catcher=function(e,t){var n=new Map(this._catchers);n.set(e,t);return this.selfFactory({catchers:n})};e.prototype.signal=function(e){return this.selfFactory({options:__assign$2(__assign$2({},this._options),{signal:e.signal})})};e.prototype.resolve=function(e,t){if(t===void 0){t=false}return this.selfFactory({resolvers:t?[e]:__spreadArrays$2(this._resolvers,[e])})};e.prototype.defer=function(e,t){if(t===void 0){t=false}return this.selfFactory({deferredChain:t?[e]:__spreadArrays$2(this._deferredChain,[e])})};e.prototype.middlewares=function(e,t){if(t===void 0){t=false}return this.selfFactory({middlewares:t?e:__spreadArrays$2(this._middlewares,e)})};e.prototype.method=function(e,t,n){if(t===void 0){t={}}if(n===void 0){n=null}var r=this._options.headers;var i=!n?this:typeof n==="object"&&(!r||Object.entries(r).every((function(e){var t=e[0],n=e[1];return t.toLowerCase()!==CONTENT_TYPE_HEADER.toLowerCase()||n.startsWith(JSON_MIME)})))?this.json(n):this.body(n);i=i.options(__assign$2(__assign$2({},t),{method:e}));var a=i._deferredChain.reduce((function(e,t){return t(e,e._url,e._options)}),i);return resolver(a)};e.prototype.get=function(e){return this.method("GET",e)};e.prototype.delete=function(e){return this.method("DELETE",e)};e.prototype.put=function(e,t){return this.method("PUT",t,e)};e.prototype.post=function(e,t){return this.method("POST",t,e)};e.prototype.patch=function(e,t){return this.method("PATCH",t,e)};e.prototype.head=function(e){return this.method("HEAD",e)};e.prototype.opts=function(e){return this.method("OPTIONS",e)};e.prototype.replay=function(e){return this.method(this._options.method,e)};e.prototype.body=function(e){return this.selfFactory({options:__assign$2(__assign$2({},this._options),{body:e})})};e.prototype.json=function(e){var t;var n=(t=Object.entries(this._options.headers||{}).find((function(e){var t=e[0],n=e[1];return t.toLowerCase()===CONTENT_TYPE_HEADER.toLowerCase()&&n.startsWith(JSON_MIME)})))===null||t===void 0?void 0:t[1];return this.content(n||JSON_MIME).body(JSON.stringify(e))};e.prototype.formData=function(e,t){if(t===void 0){t=false}return this.body(convertFormData(e,t))};e.prototype.formUrl=function(e){return this.body(typeof e==="string"?e:convertFormUrl(e)).content("application/x-www-form-urlencoded")};return e}();var appendQueryParams=function(e,t,n){var r;if(typeof t==="string"){r=t}else{var i=config.polyfill("URLSearchParams",{instance:true});for(var a in t){if(t[a]instanceof Array){for(var o=0,s=t[a];o<s.length;o++){var u=s[o];i.append(a,u)}}else{i.append(a,t[a])}}r=i.toString()}var l=e.split("?");if(n||l.length<2)return l[0]+"?"+r;return e+"&"+r};function convertFormData(e,t,n,r){if(t===void 0){t=false}if(n===void 0){n=config.polyfill("FormData",{instance:true})}if(r===void 0){r=[]}Object.entries(e).forEach((function(e){var i=e[0],a=e[1];var o=r.reduce((function(e,t){return e?e+"["+t+"]":t}),null);o=o?o+"["+i+"]":i;if(a instanceof Array){for(var s=0,u=a;s<u.length;s++){var l=u[s];n.append(o+"[]",l)}}else if(t&&typeof a==="object"&&(!(t instanceof Array)||!t.includes(i))){if(a!==null){convertFormData(a,t,n,__spreadArrays$2(r,[i]))}}else{n.append(o,a)}}));return n}function encodeQueryValue(e,t){return encodeURIComponent(e)+"="+encodeURIComponent(typeof t==="object"?JSON.stringify(t):""+t)}function convertFormUrl(e){return Object.keys(e).map((function(t){var n=e[t];if(n instanceof Array){return n.map((function(e){return encodeQueryValue(t,e)})).join("&")}return encodeQueryValue(t,n)})).join("&")}var factory=Wretcher.factory;factory["default"]=Wretcher.factory;var appendToMap=function(e,t,n){var r=e.get(t);if(!r){e.set(t,[n])}else if(!r.includes(n)){r.push(n)}};var debounce=function(e,t){var n;return function(){var r=[];for(var i=0;i<arguments.length;i++){r[i]=arguments[i]}if(n){clearTimeout(n)}n=setTimeout((function(){n=0;e.apply(void 0,r)}),t)}};var isConnected=function(e){return!("isConnected"in e)||e.isConnected};var cleanupElements=debounce((function(e){for(var t=0,n=e.keys();t<n.length;t++){var r=n[t];e.set(r,e.get(r).filter(isConnected))}}),2e3);var stencilSubscription=function(e){var t=e.on;var n=new Map;if(typeof getRenderingRef==="function"){t("dispose",(function(){n.clear()}));t("get",(function(e){var t=getRenderingRef();if(t){appendToMap(n,e,t)}}));t("set",(function(e){var t=n.get(e);if(t){n.set(e,t.filter(forceUpdate))}cleanupElements(n)}));t("reset",(function(){n.forEach((function(e){return e.forEach(forceUpdate)}));cleanupElements(n)}))}};var createObservableMap=function(e,t){if(t===void 0){t=function(e,t){return e!==t}}var n=new Map(Object.entries(e!==null&&e!==void 0?e:{}));var r={dispose:[],get:[],set:[],reset:[]};var i=function(){n=new Map(Object.entries(e!==null&&e!==void 0?e:{}));r.reset.forEach((function(e){return e()}))};var a=function(){r.dispose.forEach((function(e){return e()}));i()};var o=function(e){r.get.forEach((function(t){return t(e)}));return n.get(e)};var s=function(e,i){var a=n.get(e);if(t(i,a,e)){n.set(e,i);r.set.forEach((function(t){return t(e,i,a)}))}};var u=typeof Proxy==="undefined"?{}:new Proxy(e,{get:function(e,t){return o(t)},ownKeys:function(e){return Array.from(n.keys())},getOwnPropertyDescriptor:function(){return{enumerable:true,configurable:true}},has:function(e,t){return n.has(t)},set:function(e,t,n){s(t,n);return true}});var l=function(e,t){r[e].push(t);return function(){removeFromArray(r[e],t)}};var c=function(t,n){var r=l("set",(function(e,r){if(e===t){n(r)}}));var i=l("reset",(function(){return n(e[t])}));return function(){r();i()}};var d=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e.forEach((function(e){if(e.set){l("set",e.set)}if(e.get){l("get",e.get)}if(e.reset){l("reset",e.reset)}}))};return{state:u,get:o,set:s,on:l,onChange:c,use:d,dispose:a,reset:i}};var removeFromArray=function(e,t){var n=e.indexOf(t);if(n>=0){e[n]=e[e.length-1];e.length--}};var createStore=function(e,t){var n=createObservableMap(e,t);stencilSubscription(n);return n};function createCommonjsModule(e,t,n){return n={path:t,exports:{},require:function(e,t){return commonjsRequire()}},e(n,n.exports),n.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var _function=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:true});t.bindTo_=t.bind_=t.hole=t.pipe=t.untupled=t.tupled=t.absurd=t.decrement=t.increment=t.tuple=t.flow=t.flip=t.constVoid=t.constUndefined=t.constNull=t.constFalse=t.constTrue=t.constant=t.not=t.unsafeCoerce=t.identity=void 0;function n(e){return e}t.identity=n;t.unsafeCoerce=n;function r(e){return function(t){return!e(t)}}t.not=r;function i(e){return function(){return e}}t.constant=i;t.constTrue=i(true);t.constFalse=i(false);t.constNull=i(null);t.constUndefined=i(undefined);t.constVoid=t.constUndefined;function a(e){return function(t,n){return e(n,t)}}t.flip=a;function o(e,t,n,r,i,a,o,s,u){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return a(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return o(a(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(o(a(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return u(s(o(a(i(r(n(t(e.apply(this,arguments)))))))))}}return}t.flow=o;function s(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e}t.tuple=s;function u(e){return e+1}t.increment=u;function l(e){return e-1}t.decrement=l;function c(e){throw new Error("Called `absurd` function which should be uncallable")}t.absurd=c;function d(e){return function(t){return e.apply(void 0,t)}}t.tupled=d;function f(e){return function(){var t=[];for(var n=0;n<arguments.length;n++){t[n]=arguments[n]}return e(t)}}t.untupled=f;function p(e,t,n,r,i,a,o,s,u,l,c,d,f,p,h,g,v,m,y,S){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return a(i(r(n(t(e)))));case 7:return o(a(i(r(n(t(e))))));case 8:return s(o(a(i(r(n(t(e)))))));case 9:return u(s(o(a(i(r(n(t(e))))))));case 10:return l(u(s(o(a(i(r(n(t(e)))))))));case 11:return c(l(u(s(o(a(i(r(n(t(e))))))))));case 12:return d(c(l(u(s(o(a(i(r(n(t(e)))))))))));case 13:return f(d(c(l(u(s(o(a(i(r(n(t(e))))))))))));case 14:return p(f(d(c(l(u(s(o(a(i(r(n(t(e)))))))))))));case 15:return h(p(f(d(c(l(u(s(o(a(i(r(n(t(e))))))))))))));case 16:return g(h(p(f(d(c(l(u(s(o(a(i(r(n(t(e)))))))))))))));case 17:return v(g(h(p(f(d(c(l(u(s(o(a(i(r(n(t(e))))))))))))))));case 18:return m(v(g(h(p(f(d(c(l(u(s(o(a(i(r(n(t(e)))))))))))))))));case 19:return y(m(v(g(h(p(f(d(c(l(u(s(o(a(i(r(n(t(e))))))))))))))))));case 20:return S(y(m(v(g(h(p(f(d(c(l(u(s(o(a(i(r(n(t(e)))))))))))))))))))}return}t.pipe=p;t.hole=c;var h=function(e,t,n){var r;return Object.assign({},e,(r={},r[t]=n,r))};t.bind_=h;var g=function(e){return function(t){var n;return n={},n[e]=t,n}};t.bindTo_=g}));var Option=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:true});t.getApplySemigroup=t.getOrd=t.getEq=t.getShow=t.URI=t.wilt=t.wither=t.sequence=t.traverse=t.partitionMap=t.partition=t.filterMap=t.filter=t.separate=t.compact=t.reduceRight=t.foldMap=t.reduce=t.duplicate=t.extend=t.throwError=t.zero=t.alt=t.altW=t.flatten=t.chainFirst=t.chain=t.of=t.apSecond=t.apFirst=t.ap=t.map=t.chainNullableK=t.mapNullable=t.fromNullableK=t.getOrElse=t.getOrElseW=t.toUndefined=t.toNullable=t.fold=t.fromEither=t.getRight=t.getLeft=t.tryCatch=t.fromPredicate=t.fromNullable=t.some=t.none=t.isNone=t.isSome=void 0;t.sequenceArray=t.traverseArray=t.traverseArrayWithIndex=t.apS=t.bind=t.bindTo=t.Do=t.getRefinement=t.exists=t.elem=t.option=t.MonadThrow=t.Witherable=t.Traversable=t.Filterable=t.Compactable=t.Extend=t.Alternative=t.Alt=t.Foldable=t.Monad=t.Applicative=t.Functor=t.getMonoid=t.getLastMonoid=t.getFirstMonoid=t.getApplyMonoid=void 0;var n=function(e){return e._tag==="Some"};t.isSome=n;var r=function(e){return e._tag==="None"};t.isNone=r;t.none={_tag:"None"};var i=function(e){return{_tag:"Some",value:e}};t.some=i;function a(e){return e==null?t.none:t.some(e)}t.fromNullable=a;function o(e){return function(n){return e(n)?t.some(n):t.none}}t.fromPredicate=o;function s(e){try{return t.some(e())}catch(e){return t.none}}t.tryCatch=s;function u(e){return e._tag==="Right"?t.none:t.some(e.left)}t.getLeft=u;function l(e){return e._tag==="Left"?t.none:t.some(e.right)}t.getRight=l;t.fromEither=l;function c(e,n){return function(r){return t.isNone(r)?e():n(r.value)}}t.fold=c;function d(e){return t.isNone(e)?null:e.value}t.toNullable=d;function f(e){return t.isNone(e)?undefined:e.value}t.toUndefined=f;var p=function(e){return function(n){return t.isNone(n)?e():n.value}};t.getOrElseW=p;t.getOrElse=t.getOrElseW;function h(e){return function(){var t=[];for(var n=0;n<arguments.length;n++){t[n]=arguments[n]}return a(e.apply(void 0,t))}}t.fromNullableK=h;t.mapNullable=g;function g(e){return function(n){return t.isNone(n)?t.none:a(e(n.value))}}t.chainNullableK=g;var v=function(e,n){return _function.pipe(e,t.map(n))};var m=function(e,n){return _function.pipe(e,t.ap(n))};var y=function(e,n){return _function.pipe(e,t.chain(n))};var S=function(e,n,r){return _function.pipe(e,t.reduce(n,r))};var b=function(e){var n=t.foldMap(e);return function(e,t){return _function.pipe(e,n(t))}};var w=function(e,n,r){return _function.pipe(e,t.reduceRight(n,r))};var _=function(e){var n=t.traverse(e);return function(e,t){return _function.pipe(e,n(t))}};var x=function(e,n){return _function.pipe(e,t.alt(n))};var C=function(e,n){return _function.pipe(e,t.filter(n))};var I=function(e,n){return _function.pipe(e,t.filterMap(n))};var T=function(e,n){return _function.pipe(e,t.extend(n))};var E=function(e,n){return _function.pipe(e,t.partition(n))};var A=function(e,n){return _function.pipe(e,t.partitionMap(n))};var F=function(e){var n=t.wither(e);return function(e,t){return _function.pipe(e,n(t))}};var P=function(e){var n=t.wilt(e);return function(e,t){return _function.pipe(e,n(t))}};var N=function(e){return function(n){return t.isNone(n)?t.none:t.some(e(n.value))}};t.map=N;var D=function(e){return function(n){return t.isNone(n)?t.none:t.isNone(e)?t.none:t.some(n.value(e.value))}};t.ap=D;var k=function(e){return _function.flow(t.map((function(e){return function(){return e}})),t.ap(e))};t.apFirst=k;var U=function(e){return _function.flow(t.map((function(){return function(e){return e}})),t.ap(e))};t.apSecond=U;t.of=t.some;var O=function(e){return function(n){return t.isNone(n)?t.none:e(n.value)}};t.chain=O;var R=function(e){return t.chain((function(n){return _function.pipe(e(n),t.map((function(){return n})))}))};t.chainFirst=R;t.flatten=t.chain(_function.identity);var M=function(e){return function(n){return t.isNone(n)?e():n}};t.altW=M;t.alt=t.altW;var L=function(){return t.none};t.zero=L;var B=function(){return t.none};t.throwError=B;var j=function(e){return function(n){return t.isNone(n)?t.none:t.some(e(n))}};t.extend=j;t.duplicate=t.extend(_function.identity);var V=function(e,n){return function(r){return t.isNone(r)?e:n(e,r.value)}};t.reduce=V;var z=function(e){return function(n){return function(r){return t.isNone(r)?e.empty:n(r.value)}}};t.foldMap=z;var H=function(e,n){return function(r){return t.isNone(r)?e:n(r.value,e)}};t.reduceRight=H;t.compact=t.flatten;var q={left:t.none,right:t.none};var $=function(e){var n=_function.pipe(e,t.map((function(e){return{left:u(e),right:l(e)}})));return t.isNone(n)?q:n.value};t.separate=$;var W=function(e){return function(n){return t.isNone(n)?t.none:e(n.value)?n:t.none}};t.filter=W;var G=function(e){return function(n){return t.isNone(n)?t.none:e(n.value)}};t.filterMap=G;var K=function(e){return function(t){return{left:C(t,(function(t){return!e(t)})),right:C(t,e)}}};t.partition=K;var J=function(e){return _function.flow(t.map(e),t.separate)};t.partitionMap=J;var X=function(e){return function(n){return function(r){return t.isNone(r)?e.of(t.none):e.map(n(r.value),t.some)}}};t.traverse=X;var Q=function(e){return function(n){return t.isNone(n)?e.of(t.none):e.map(n.value,t.some)}};t.sequence=Q;var Y=function(e){return function(n){return function(r){return t.isNone(r)?e.of(t.none):n(r.value)}}};t.wither=Y;var Z=function(e){return function(n){return function(r){return t.isNone(r)?e.of({left:t.none,right:t.none}):e.map(n(r.value),(function(e){return{left:u(e),right:l(e)}}))}}};t.wilt=Z;t.URI="Option";function ee(e){return{show:function(n){return t.isNone(n)?"none":"some("+e.show(n.value)+")"}}}t.getShow=ee;function te(e){return{equals:function(n,r){return n===r||(t.isNone(n)?t.isNone(r):t.isNone(r)?false:e.equals(n.value,r.value))}}}t.getEq=te;function ne(e){return{equals:te(e).equals,compare:function(n,r){return n===r?0:t.isSome(n)?t.isSome(r)?e.compare(n.value,r.value):1:-1}}}t.getOrd=ne;function re(e){return{concat:function(n,r){return t.isSome(n)&&t.isSome(r)?t.some(e.concat(n.value,r.value)):t.none}}}t.getApplySemigroup=re;function ie(e){return{concat:re(e).concat,empty:t.some(e.empty)}}t.getApplyMonoid=ie;function ae(){return{concat:function(e,n){return t.isNone(e)?n:e},empty:t.none}}t.getFirstMonoid=ae;function oe(){return{concat:function(e,n){return t.isNone(n)?e:n},empty:t.none}}t.getLastMonoid=oe;function se(e){return{concat:function(n,r){return t.isNone(n)?r:t.isNone(r)?n:t.some(e.concat(n.value,r.value))},empty:t.none}}t.getMonoid=se;t.Functor={URI:t.URI,map:v};t.Applicative={URI:t.URI,map:v,ap:m,of:t.of};t.Monad={URI:t.URI,map:v,ap:m,of:t.of,chain:y};t.Foldable={URI:t.URI,reduce:S,foldMap:b,reduceRight:w};t.Alt={URI:t.URI,map:v,alt:x};t.Alternative={URI:t.URI,map:v,ap:m,of:t.of,alt:x,zero:t.zero};t.Extend={URI:t.URI,map:v,extend:T};t.Compactable={URI:t.URI,compact:t.compact,separate:t.separate};t.Filterable={URI:t.URI,map:v,compact:t.compact,separate:t.separate,filter:C,filterMap:I,partition:E,partitionMap:A};t.Traversable={URI:t.URI,map:v,reduce:S,foldMap:b,reduceRight:w,traverse:_,sequence:t.sequence};t.Witherable={URI:t.URI,map:v,reduce:S,foldMap:b,reduceRight:w,traverse:_,sequence:t.sequence,compact:t.compact,separate:t.separate,filter:C,filterMap:I,partition:E,partitionMap:A,wither:F,wilt:P};t.MonadThrow={URI:t.URI,map:v,ap:m,of:t.of,chain:y,throwError:t.throwError};t.option={URI:t.URI,map:v,of:t.of,ap:m,chain:y,reduce:S,foldMap:b,reduceRight:w,traverse:_,sequence:t.sequence,zero:t.zero,alt:x,extend:T,compact:t.compact,separate:t.separate,filter:C,filterMap:I,partition:E,partitionMap:A,wither:F,wilt:P,throwError:t.throwError};function ue(e){return function(n,r){return t.isNone(r)?false:e.equals(n,r.value)}}t.elem=ue;function le(e){return function(n){return t.isNone(n)?false:e(n.value)}}t.exists=le;function ce(e){return function(n){return t.isSome(e(n))}}t.getRefinement=ce;t.Do=t.of({});var de=function(e){return t.map(_function.bindTo_(e))};t.bindTo=de;var fe=function(e,n){return t.chain((function(r){return _function.pipe(n(r),t.map((function(t){return _function.bind_(r,e,t)})))}))};t.bind=fe;var pe=function(e,n){return _function.flow(t.map((function(t){return function(n){return _function.bind_(t,e,n)}})),t.ap(n))};t.apS=pe;var he=function(e){return function(n){var r=[];for(var i=0;i<n.length;i++){var a=e(i,n[i]);if(t.isNone(a)){return t.none}r.push(a.value)}return t.some(r)}};t.traverseArrayWithIndex=he;var ge=function(e){return t.traverseArrayWithIndex((function(t,n){return e(n)}))};t.traverseArray=ge;t.sequenceArray=t.traverseArray(_function.identity)}));function e(e){this.message=e}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var n=String(t).replace(/=+$/,"");if(n.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,i,a=0,o=0,s="";i=n.charAt(o++);~i&&(r=a%4?64*r+i:i,a++%4)?s+=String.fromCharCode(255&r>>(-2*a&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return s};function t(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return r(t)}}function n(e){this.message=e}function o(e,r){if("string"!=typeof e)throw new n("Invalid token specified");var i=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(".")[i]))}catch(e){throw new n("Invalid token specified: "+e.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";var SuperSelectionApi=function(){function e(){}e.prototype.getAustralianFundsAsync=function(e,t){if(t===void 0){t=false}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,buildBackendApiClient().url("super-choice/australian-funds?"+this.toQueryString(t,e)).get().notFound((function(){throw new Error("Failed to fetch the list of australian super funds.")})).json()]}))}))};e.prototype.getAppStateAsync=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,buildBackendApiClient().url("client-app-state").get().notFound((function(){throw new Error("Failed to fetch application configuration.")})).json()]}))}))};e.prototype.toSearchFilterQueryString=function(e){switch(e.type){case"partialMatch":return"search="+e.searchString+"&maxRecordCount="+e.maxRecordCount;case"usiMatch":return"usi="+e.usi}};e.prototype.toQueryString=function(e,t){var n=this.toSearchFilterQueryString(t);var r=e?"includeInactive=true":"";var i=function(e){return e&&e.length};return[n,r].filter(i).join("&")};return e}();var superSelectionApi=new SuperSelectionApi;var initialState={apiBaseUrl:Option.none,appBaseUrl:Option.none,profileId:Option.none,jwt:Option.none,superBuyer:Option.none,promotedFunds:Option.none,accountConfiguration:Option.none,hasSuccessPageBeenAcknowledged:false,hasSuperSelectionBeenSubmitted:false};var SuperSelectionAppService=function(){function e(){var e=this;var t=createStore(initialState),n=t.state,r=t.onChange;this._state=n;this._onChange=r;r("jwt",(function(t){e._state.profileId=_function.pipe(t,Option.chain((function(e){return Option.fromNullable(o(e).sub)})))}))}Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"onChange",{get:function(){return this._onChange},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"superBuyer",{get:function(){if(Option.isNone(this._state.superBuyer)){throw Error("User information is not set")}return this._state.superBuyer.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"apiBaseUrl",{get:function(){if(Option.isNone(this._state.apiBaseUrl)){throw Error("API base URL is not set")}return this._state.apiBaseUrl.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"appBaseUrl",{get:function(){if(Option.isNone(this._state.appBaseUrl)){throw Error("App base URL is not set")}return this._state.appBaseUrl.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"promotedFunds",{get:function(){if(Option.isNone(this._state.promotedFunds)){throw Error("Promoted Funds is not set")}return this._state.promotedFunds.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"profileId",{get:function(){if(Option.isNone(this._state.profileId)){throw Error("Failed to get Profile ID from JWT")}return this._state.profileId.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"defaultFundUsi",{get:function(){return _function.pipe(this._state.accountConfiguration,Option.map((function(e){return Option.fromNullable(e.defaultFundUsi)})),Option.flatten)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"accountIdOrDefault",{get:function(){return _function.pipe(this._state.accountConfiguration,Option.map((function(e){return e.accountId})),Option.getOrElse((function(){return""})))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"partnerIdOrDefault",{get:function(){return _function.pipe(this._state.superBuyer,Option.map((function(e){return e.partnerId})),Option.getOrElse((function(){return""})))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"jwt",{get:function(){if(Option.isNone(this._state.jwt)){throw Error("No authentication information was found")}return this._state.jwt.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"showSmsfNotSupported",{get:function(){return _function.pipe(this._state.superBuyer,Option.map((function(e){return e.showSmsfNotSupported})),Option.getOrElse((function(){return false})))},enumerable:false,configurable:true});e.prototype.completeSuperSelectionFlow=function(){this._state.hasSuccessPageBeenAcknowledged=true};e.prototype.markSuperSelectionAsSubmitted=function(){this._state.hasSuperSelectionBeenSubmitted=true};e.prototype.loadAppStateAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,superSelectionApi.getAppStateAsync()];case 1:e=t.sent();this._state.accountConfiguration=Option.fromNullable(e.accountConfiguration);this._state.superBuyer=Option.fromNullable(e.superBuyer);this._state.promotedFunds=Option.fromNullable(e.promotedFunds);return[2]}}))}))};return e}();var superSelectionAppService=new SuperSelectionAppService;function buildBackendApiClient(){var e=superSelectionAppService.jwt;var t=superSelectionAppService.profileId;var n=superSelectionAppService.accountIdOrDefault;var r=superSelectionAppService.partnerIdOrDefault;return factory(superSelectionAppService.apiBaseUrl).headers({Authorization:"Bearer "+e,"X-PROFILE-ID":t,"X-PARTNER-ID":r,"X-ACCOUNT-ID":n})}var EventTrackingApi=function(){function e(){}Object.defineProperty(e,"Instance",{get:function(){return this.instance||(this.instance=new this)},enumerable:false,configurable:true});e.prototype.PostAnalyticsEventAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("analytics-events").post(e).res()]}))}))};return e}();var EventTrackingService=function(){function e(){this.eventTrackingApi=EventTrackingApi.Instance}Object.defineProperty(e,"Instance",{get:function(){return this.instance||(this.instance=new this)},enumerable:false,configurable:true});e.prototype.TrackFinancialProductViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({FinancialProductViewed:e})]}))}))};e.prototype.TrackSuperFundPdsViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundPdsViewed:e})]}))}))};e.prototype.TrackFinancialProductAcceptedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({FinancialProductAccepted:e})]}))}))};e.prototype.TrackFinancialProductRejectedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({FinancialProductRejected:e})]}))}))};e.prototype.TrackSuperFundPrivacyConfirmationAcceptedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundPrivacyConfirmationAccepted:e})]}))}))};e.prototype.TrackPromotedSuperFundDetailViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDetailViewed:{PromotedFund:e}})]}))}))};e.prototype.TrackMyOwnSuperFundDetailViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDetailViewed:{MyOwnFund:e}})]}))}))};e.prototype.TrackSmsfSuperFundDetailViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDetailViewed:{Smsf:e}})]}))}))};e.prototype.TrackDefaultSuperFundDetailViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDetailViewed:{DefaultFund:e}})]}))}))};e.prototype.TrackSuperFundPanelViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundPanelViewed:e})]}))}))};e.prototype.TrackSuperFundNominationViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundNominationViewed:e})]}))}))};e.prototype.TrackSuperFundNominationDeclinedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundNominationDeclined:e})]}))}))};e.prototype.TrackSuperFundDisclaimerViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDisclaimerViewed:e})]}))}))};e.prototype.TrackSuperFundDisclaimerAcceptedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDisclaimerAccepted:e})]}))}))};e.prototype.trackEventAsync=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,this.eventTrackingApi.PostAnalyticsEventAsync({event:e})];case 1:n.sent();return[3,3];case 2:t=n.sent();return[2];case 3:return[2]}}))}))};return e}();function appReady(){postMessage({type:"appReady"})}function postMessage(e,t){if(t===undefined)t="*";e.sender="flare";window.parent.postMessage(e,t)}function resize(e,t){postMessage({type:"contentResized",height:e,width:t})}function navigation(e){postMessage({type:"pageNavigated",url:e})}function complete(){postMessage({type:"complete"})}function submitSuccess(){postMessage({type:"submitSuccess"})}var iframe={appReady:appReady,resize:resize,navigation:navigation,complete:complete,submitSuccess:submitSuccess};var initial={handleSubmitFn:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2]}))}))},fundName:"",promotedFundId:undefined};var state=createStore(initial).state;var SuperSelectionAppRoutes;(function(e){e["ConsentPage"]="/consent";e["ExistingChoicePage"]="/existing";e["ChoicePage"]="/";e["SlateJoin"]="/slate/join/";e["PromotedFundJoin"]="/promoted-fund/join";e["MyOwnFund"]="/super-choice/my-own-fund/";e["SelfManagedFund"]="/super-choice/smsf/";e["DefaultFund"]="/super-choice/default/";e["StandardChoice"]="/standard-choice/";e["Success"]="/success/"})(SuperSelectionAppRoutes||(SuperSelectionAppRoutes={}));var superSelectionAppStencilRoutes=[h("stencil-route",{url:SuperSelectionAppRoutes.ConsentPage,component:"sss-consent-page"}),h("stencil-route",{url:SuperSelectionAppRoutes.ExistingChoicePage,component:"sss-existing-choice-page"}),h("stencil-route",{exact:true,url:SuperSelectionAppRoutes.ChoicePage,component:"sss-super-choice-page"}),h("stencil-route",{url:SuperSelectionAppRoutes.SlateJoin,component:"sss-slate-join-page"}),h("stencil-route",{url:SuperSelectionAppRoutes.PromotedFundJoin,component:"sss-promoted-fund-join-page"}),h("stencil-route",{url:SuperSelectionAppRoutes.MyOwnFund,component:"sss-my-own-fund"}),h("stencil-route",{url:SuperSelectionAppRoutes.SelfManagedFund,component:"sss-self-managed-fund"}),h("stencil-route",{url:SuperSelectionAppRoutes.DefaultFund,component:"sss-default-fund"}),h("stencil-route",{url:SuperSelectionAppRoutes.StandardChoice,component:"sss-standard-choice-form"}),h("stencil-route",{url:SuperSelectionAppRoutes.Success,component:"sss-success"})];var NavigationService=function(){function e(){}e.prototype.navigateInternally=function(e,t){var n=""+this.appBaseUrl+this.toRouteWithLeadingSlash(t);iframe.navigation(n);e.push(n)};e.prototype.navigateInternallyToStandardChoice=function(e){state.handleSubmitFn=e.handleSubmitFn;state.fundName=e.fundName;state.promotedFundId=e.promotedFundId;this.navigateInternally(e.history,SuperSelectionAppRoutes.StandardChoice)};e.prototype.toExternalUrl=function(e){var t=new URL(e);t.searchParams.append("_extnav","true");return t.href};Object.defineProperty(e.prototype,"appBaseUrl",{get:function(){var e=superSelectionAppService.appBaseUrl;return e.replace(/\/$/,"")},enumerable:false,configurable:true});e.prototype.toRouteWithLeadingSlash=function(e){return e.length>0&&e[0]==="/"?e:"/"+e};return e}();var navigationService=new NavigationService;var Consent=function(){function e(e){registerInstance(this,e);this.promotedFunds=superSelectionAppService.promotedFunds;this.eventTrackingService=EventTrackingService.Instance}e.prototype.componentDidLoad=function(){var e={promotedFundsShown:this.promotedFunds};return this.eventTrackingService.TrackSuperFundDisclaimerViewedAsync(e)};e.prototype.render=function(){var e=this;return h("div",null,h("div",{class:"text-2xl sm:text-3xl font-bold text-center leading-8"},"Important information about super"),h("div",{class:"sm:text-lg text-gray-600 mt-3 sm:mt-4 max-w-800 text-center leading-7 sm:leading-8"},"The choice of superannuation fund is an important personal financial decision. Next, you’ll be asked to nominate a super fund to receive your employer contributions."),h("div",{class:"flex justify-center mt-8 sm:mt-12"},h("div",{class:"border shadow-sm p-4 pb-6 sm:p-6 sm:pb-8 max-w-560 rounded-lg"},h("div",{class:"sm:text-lg font-bold leading-6"},"By clicking “Continue” you acknowledge that:"),h("ul",{class:"list-disc list-outside ml-6 mt-3 mb-6 space-y-2 text-sm leading-6"},h("li",null,"Flare (we/us) provides this paperless employee management service, will feature superannuation funds and offer you employee benefits that you may be interested in;"),h("li",null,"all content contained in the following pages does not take into account any of your objectives, financial situation or needs and does not constitute financial product advice;"),h("li",null,"in featuring any superannuation funds, we, the technology partner you are accessing us via, or your employer, are not providing any opinion or recommendation (actual or implied) in relation to the suitability or appropriateness of the featured funds;"),h("li",null,"if you do choose one of the featured superannuation funds, we and our associates will normally receive a fee for you doing so.")),h("sss-button",{fillWidth:true,promiseFn:function(){return e.handleSuperFundDisclaimerAccepted()}},"Continue"))))};e.prototype.handleSuperFundDisclaimerAccepted=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e={promotedFundsShown:this.promotedFunds};return[4,this.eventTrackingService.TrackSuperFundDisclaimerAcceptedAsync(e)];case 1:t.sent();navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage);return[2]}}))}))};return e}();var CustomFundTypes;(function(e){e["MyOwnFund"]="Your current super fund";e["DefaultFund"]="Your employer's default fund";e["SelfManagedFund"]="Your self-managed super fund"})(CustomFundTypes||(CustomFundTypes={}));var initialStateCustomFund={continueAllowed:false,nextRoute:"/",myOwnFundForm:{fundUsi:none,fundName:none,memberNumber:none},selfManagedFundForm:{fundName:"",fundAbn:"",fundEsa:"",addressLine1:"",addressLine2:"",state:"",postcode:"",city:"",bankAccountName:"",bsb:"",bankAccountNumber:""},currentCustomFundType:CustomFundTypes.MyOwnFund,customFunds:[{label:CustomFundTypes.MyOwnFund,value:SuperSelectionAppRoutes.MyOwnFund},{label:CustomFundTypes.SelfManagedFund,value:SuperSelectionAppRoutes.SelfManagedFund},{label:CustomFundTypes.DefaultFund,value:SuperSelectionAppRoutes.DefaultFund}]};var _j=createStore(initialStateCustomFund),state$1=_j.state,reset=_j.reset;var customFundOptions=state$1.customFunds;var CustomFund=function(){function e(e){registerInstance(this,e);this.currentCustomFund=customFundOptions[0];this.fundOptionsList=customFundOptions;this.showFundOptionsSelection=false}e.prototype.componentWillLoad=function(){var e="";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;this.currentCustomFund=customFundOptions.find((function(t){return t.value===e}))||customFundOptions[0];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",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 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-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-sm"},this.fundOptionsList.map((function(t){return h("li",{class:"text-gray-900 cursor-default select-none relative py-2 pl-3 pr-9 hover:bg-primary-hover",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 superSelectionApi.getAustralianFundsAsync({type:"partialMatch",searchString:e,maxRecordCount:t})};e.prototype.getActiveFundByUsiAsync=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,superSelectionApi.getAustralianFundsAsync({type:"usiMatch",usi:e})];case 1:t=n.sent();if(t.length===1){return[2,Option.some(t[0])]}return[2,Option.none]}}))}))};e.prototype.getFundByUsiAsync=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,superSelectionApi.getAustralianFundsAsync({type:"usiMatch",usi:e},true)];case 1:t=n.sent();if(t.length===1){return[2,Option.some(t[0])]}return[2,Option.none]}}))}))};return e}();var australianFundLookupService=new AustralianFundLookupService;var CustomFundChoiceApi=function(){function e(){}e.prototype.submitDefaultFundChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/default").post(e).badRequest((function(){throw new Error("Failed to process default fund join request")})).text()]}))}))};e.prototype.submitCustomFundChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/custom-fund").post(e).badRequest((function(){throw new Error("Failed to process custom fund join request")})).text()]}))}))};e.prototype.submitSelfManagedFundChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/smsf").post(e).badRequest((function(){throw new Error("Failed to process SMSF choice request")})).text()]}))}))};return e}();var customFundChoiceApi=new CustomFundChoiceApi;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.getActiveFundByUsiAsync(e.value)];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})};e.prototype.render=function(){var e=this;return h(Host,null,h("sss-header-section",{currentPage:"own-fund"}),h("div",{class:"flex justify-center mt-11"},h("sss-custom-fund",null,h("div",{class:"p-4 sm:p-6 border shadow-sm rounded-lg"},h("p",{class:"sm:text-lg font-bold mb-3"},"Fund details"),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"},this.isDefaultFundExists&&!this.isInvalidDefaultFund?h("span",null,"By choosing to join your employer’s default super fund, you acknowledge that your application to join is subject to Trustee approval."):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 defaut 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-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-sm"},this.defaultFund.usi)))),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",{fillWidth:true,promiseFn:function(){return e.handleSubmitForm()}},"Continue")),h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("sss-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",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({standardChoiceFormSignature:t})];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.filteredOptions=e;t.highlightedOptionIndex=undefined;t.searchState="done"};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.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-hover py-1.5 pl-4":true,"bg-primary-base":t.isOptionSelected(e)},onClick:function(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.highlightNextItem();return true;case i:t.highlightPreviousItem();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.highlightPreviousItem=function(){if(t.filteredOptions.length===0){return}t.highlightedOptionIndex=t.highlightedOptionIndex===undefined?0:Math.max(t.highlightedOptionIndex-1,0)};this.highlightNextItem=function(){if(t.filteredOptions.length===0){return}t.highlightedOptionIndex=t.highlightedOptionIndex===undefined?0:Math.min(t.highlightedOptionIndex+1,t.filteredOptions.length-1)};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()};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.highlightedOptionIndex=undefined;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",{type:"text",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full 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 Slate={Id:"slate",Name:"Slate Super",PdsUrl:"https://slate.co/pds/?utm_source=flare&utm_medium=superselection",Usi:"32367272075001",DiversaAbn:"49 006 421 638"};var AustralianRetirementTrust={Id:"australian-retirement-trust",Name:"Australian Retirement Trust",PdsUrl:"https://www.australianretirementtrust.com.au/library/media/pdfs/pds/super-savings-product-disclosure-statement-and-membership-form.pdf",Abn:"60 905 115 063"};var Aware={Id:"aware",Name:"Aware Super",PdsUrl:"https://aware.com.au/member/forms-and-resources/pds/FSS",Abn:"53 226 460 365"};var Active={Id:"active",Name:"Active Super",PdsUrl:"https://www.activesuper.com.au/pds",Abn:"28 901 371 321"};var PromotedFundIdList=[{dtoPropName:"slate",id:Slate.Id},{dtoPropName:"australianRetirementTrust",id:AustralianRetirementTrust.Id},{dtoPropName:"aware",id:Aware.Id},{dtoPropName:"active",id:Active.Id}];var getFundNameById=function(e){switch(e){case Slate.Id:return Slate.Name;case AustralianRetirementTrust.Id:return AustralianRetirementTrust.Name;case Aware.Id:return Aware.Name;case Active.Id:return Active.Name;default:return}};var getLogoSrc=function(e){var t="";switch(e){case Slate.Id:t="logo-slate.png";break;case AustralianRetirementTrust.Id:t="logo-art.svg";break;case Aware.Id:t="logo-aware.svg";break;case Active.Id:t="logo-active.svg";break;default:return}if(t!=="")return getAssetPath("assets/"+t)};function getPromotedFundUsi(e){if("slate"in e){return none}else if("australianRetirementTrust"in e){return some(e.australianRetirementTrust.usi)}else if("aware"in e){return some(e.aware.usi)}else if("active"in e){return some(e.active.usi)}else{return none}}function getSuperChoiceUsi(e){if("promoted"in e){return getPromotedFundUsi(e.promoted)}else if("myOwnFund"in e){return some(e.myOwnFund.usi)}else if("smsf"in e){return none}else if("default"in e){return some(e.default.usi)}else{return none}}function getPromotedFundMemberNumber(e){if("slate"in e){return some(e.slate.memberNumber)}else if("australianRetirementTrust"in e){return some(e.australianRetirementTrust.memberNumber)}else if("aware"in e){return some(e.aware.memberNumber)}else if("active"in e){return some(e.active.memberNumber)}else{return none}}function getSuperChoiceMemberNumber(e){if("promoted"in e){return getPromotedFundMemberNumber(e.promoted)}else if("myOwnFund"in e){return some(e.myOwnFund.memberNumber)}else if("smsf"in e){return none}else if("default"in e){return none}else{return none}}var ExistingFundService=function(){function e(){}e.prototype.GetExistingFundAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,r,i,a,o,s,u,s,l,c;return __generator(this,(function(d){switch(d.label){case 0:n=superSelectionAppService.superBuyer.superChoice;r=(e=superSelectionAppService.superBuyer.superChoice)===null||e===void 0?void 0:e.choiceDetails;if(!n)return[2,none];if(!r)return[2,none];i=n.dateSubmitted==undefined?none:some(new Date(n.dateSubmitted));a=getSuperChoiceUsi(r);o=getSuperChoiceMemberNumber(r);if(!("promoted"in r))return[3,1];s=PromotedFundIdList.find((function(e){return e.dtoPropName in r.promoted}));if((s===null||s===void 0?void 0:s.id)==undefined)return[2,none];return[2,some({type:"Promoted Fund",id:s.id,name:(t=getFundNameById(s.id))!==null&&t!==void 0?t:"",usi:a,valid:"Active",memberNumber:o,lastNominatedAt:i})];case 1:if(!("smsf"in r))return[3,2];return[2,some({type:"Self Managed Fund",name:r.smsf.fundName,valid:"Unknown",lastNominatedAt:i})];case 2:if(!("myOwnFund"in r))return[3,4];u=r.myOwnFund.usi;return[4,this.getFundByUsiAsync(u)];case 3:s=d.sent();return[2,some({type:"My Own Fund",name:isSome(s)?s.value.productName:u,usi:a,valid:this.toFundValidState(s),memberNumber:o,lastNominatedAt:i})];case 4:if(!("default"in r))return[3,6];l=r.default.usi;return[4,this.getFundByUsiAsync(l)];case 5:c=d.sent();return[2,some({type:"Default Fund",name:isSome(c)?c.value.productName:l,usi:a,valid:this.toFundValidState(c),lastNominatedAt:i})];case 6: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.getFundByUsiAsync(e)};e.prototype.toFundValidState=function(e){if(isSome(e)){return e.value.isActive?"Active":"Inactive"}else{return"Unknown"}};return e}();var existingFundService=new ExistingFundService;var FeatureFlagService=function(){function e(){}e.isNewComplianceEnabled=function(){var e=["PARTNER-TEST-FLARE","962e142f-df98-460e-92ed-2c4e24149c91","8ad88c67-d446-4c30-8321-f896e1b7643b","e8269f8b-4f5e-482a-863e-4512cca40ec6","973c7953-a607-48b6-9bf9-9266ffd9c25c","cf602138-c843-4c4a-a407-635ba0bf9612","4257a264-863e-4e03-8b07-b9c0328c0557","df9b837f-7f38-41ff-9073-9265106eb231","d6855e49-0412-4600-9b66-c61f0dfc25df"];return e.includes(superSelectionAppService.partnerIdOrDefault)};return e}();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,FeatureFlagService.isNewComplianceEnabled()?SuperSelectionAppRoutes.ConsentPage:SuperSelectionAppRoutes.ChoicePage)}return[2]}}))}))};e.prototype.render=function(){var e=this;var t=function(e){return h("div",{class:"flex justify-center mt-6"},h("img",{class:"h-16 w-auto",alt:getFundNameById(e.id),src:getLogoSrc(e.id)}))};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-8 w-8 absolute "},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",class:"fill-primary-base"},h("path",{d:"M196.6 97.83C184.1 93.41 177.6 79.7 182 67.2C195.8 28.08 233.1 0 277.1 0C320.1 0 358.3 28.08 372.1 67.2C376.5 79.7 369.1 93.41 357.5 97.83C344.1 102.2 331.3 95.7 326.9 83.2C319.6 62.66 300 48 277.1 48C254.1 48 234.5 62.66 227.3 83.2C222.8 95.7 209.1 102.2 196.6 97.83H196.6zM400 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 264zM224 128H376.4C394 108.4 419.6 96 448 96H465.3C480.9 96 492.3 110.7 488.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 384H512C499.1 401.2 482.7 415.8 464 426.6V464C464 490.5 442.5 512 416 512H368C341.5 512 320 490.5 320 464V448H272V464C272 490.5 250.5 512 224 512H176C149.5 512 128 490.5 128 464V416C90.98 388.2 66.42 344.7 64.17 295.4C27.99 290.9 0 259.1 0 222.6C0 194.7 15.72 169.3 40.6 156.9L45.27 154.5C57.12 148.6 71.54 153.4 77.47 165.3C83.39 177.1 78.59 191.5 66.73 197.5L62.06 199.8C53.44 204.1 48 212.9 48 222.6C48 235.1 57.13 245.6 69.13 247.6C87.02 178.8 149.6 128 224 128V128zM224 176C162.1 176 112 226.1 112 288C112 324.6 129.5 357.1 156.8 377.6C168.9 386.7 176 400.9 176 416V464H224V448C224 421.5 245.5 400 272 400H320C346.5 400 368 421.5 368 448V464H416V426.6C416 409.5 425.1 393.6 439.1 385C453.1 377.5 464.6 367.3 473.6 355.2C482.7 343.1 496.9 336 512 336H528V271.9C510 270.9 493.1 259.9 486.7 243.2C478.9 225.4 466.6 209.1 451.2 198.4C435.7 186.8 428.8 167.1 433.4 148.3L434 146.1C425.5 148.6 418 153.5 412.2 160C403.1 170.2 390.1 176 376.4 176H224z"}))))};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-8 w-8 absolute "},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",class:"fill-primary-base"},h("path",{d:"M250.8 192h13.25v40C264 245.2 274.8 256 288 256s24.02-10.8 24.02-23.1V192h13.25c85.39 0 154.8-75.38 154.8-168c0-13.25-10.75-24-24-24H418.8c-55.26 0-103.4 31.75-130.8 79C260.7 31.75 212.5 0 157.3 0H120C106.8 0 96.01 10.75 96.01 23.1C96.01 116.6 165.4 192 250.8 192zM418.8 48h11.13c-9.876 54.75-53.01 96-104.5 96h-11.13C324.2 89.25 367.3 48 418.8 48zM157.3 48c51.51 0 94.64 41.25 104.5 96H250.7c-51.51 0-94.64-41.25-104.5-96H157.3zM551.1 312c-31.13-26.38-69.26-16.12-88.39-1.75l-60.38 45.5h-3.375c-.1251-38-30.5-67.88-69.13-67.88H186.7c-28.38 0-56.38 9.375-78.51 26.37L79.76 336H24C10.8 336 0 346.8 0 359.1S10.8 384 24 384l72-.0244l41.26-31.48C151.3 341.8 168.8 336 186.8 336h144c27.88 0 29 40.25-1.125 40.25h-59.88c-7.501 0-13.75 6.125-13.75 13.75c0 7.625 6.251 13.87 13.75 13.87h134.6c9.711 0 19.16-3.159 26.92-9l61.26-46.12c8.251-6.125 20.5-6.625 28.38 0c10.13 8.5 9.376 23.12-.8751 30.75l-100.6 75.5C411.7 460.8 402.3 464 392.6 464H24C10.8 464 0 474.8 0 487.1S10.8 512 24 512h368.8c20 0 39.38-6.5 55.26-18.5l100.8-75.88c16.63-12.5 26.5-31.5 27.13-52C576.7 345.1 567.8 325.5 551.1 312z"}))))};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-8 w-8 absolute "},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:"fill-primary-base"},h("path",{d:"M448 96h-64V64c0-35.35-28.65-64-64-64H192C156.7 0 128 28.65 128 64v32H64C28.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 96zM192 48h128c8.837 0 16 7.163 16 16v32h-160V64C176 55.16 183.2 48 192 48zM64 144h384c8.8 0 16 7.2 16 16v96h-416V160C48 151.2 55.2 144 64 144zM448 432H64c-8.8 0-16-7.2-16-16V304H192V320c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V304h144V416C464 424.8 456.8 432 448 432z"}))))};return h("div",null,h("div",{class:"text-2xl sm:text-3xl font-bold text-center"},"Your super choice"),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 rounded-lg text-center space-y-4"},function(){switch(e.existingFund.type){case"Promoted Fund":return h(t,{id:e.existingFund.id});case"Self Managed Fund":return h(r,null);case"My Own Fund":return h(n,null);case"Default Fund":return h(i,null)}}(),h("div",{class:"sm:text-lg font-bold leading-6"},this.existingFund.name),h("div",{class:"mt-8"},h("sss-button",{fillWidth:true,promiseFn:function(){return e.handleFundNominationAccepted()}},"Continue with this fund"))),h("div",{class:"mt-4"},h("sss-button",{fillWidth:true,variant:"secondary",promiseFn:function(){return e.handleFundNominationDeclined()}},"Choose another fund")))))};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,FeatureFlagService.isNewComplianceEnabled()?SuperSelectionAppRoutes.ConsentPage:SuperSelectionAppRoutes.ChoicePage);return[2]}}))}))};return e}();var FooterSection=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h("div",{class:"text-center text-gray-500 text-xs mt-8 sm:mt-20 w-full max-w-960 mx-auto"},h("span",null,"Powered by Flare"),h("p",{class:"block text-transparent"},"v",AppVersion),!FeatureFlagService.isNewComplianceEnabled()&&h("p",{class:"mt-4"},"This page contains factual information only and does not take into account your particular objectives, financial circumstances or needs. If you have questions or need help making a decision about your super fund, you should speak to a licensed financial advice provider. You should consider the relevant super fund's PDS and TMD (if applicable) in deciding whether to apply to join the super fund. Each of the advertised fund's PDS and TMD (if applicable) can be found in their advertisements above. If you are considering joining another fund you can find the PDS and TMD on the fund's website. Your employer and Flare do not endorse or accept responsibility for any financial product advice or services provided by the promoters or trustees of the advertised superannuation funds. Flare do not endorse or accept responsibility for any of their content shown about any of the advertised superannuation funds as they are merely passing on the content as provided without any changes. Flare do not express any opinion or make any recommendation about any of the advertised funds."))};return e}();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"),FeatureFlagService.isNewComplianceEnabled()&&h(Fragment,null,h("div",{class:"text-gray-600 sm:text-lg leading-7 sm:leading-8"},"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."),h("div",{class:"inline-flex mt-8 sm:mt-12 bg-primary-base rounded-lg p-0.5 whitespace-normal"},h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("button",{type:"button",class:{"py-2 text-sm font-medium w-auto px-3 sm:px-8 rounded-md h-full":true,"bg-white border-gray-200 text-gray-900 shadow-sm":this.currentPage==="choice","border border-transparent text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-focus focus:z-10 hover:bg-primary-hover":this.currentPage!=="choice"}},"Featured super funds")),h("stencil-route-link",{url:SuperSelectionAppRoutes.MyOwnFund},h("button",{type:"button",class:{"ml-0.5 rounded-md py-2 text-sm font-medium w-auto px-3 sm:px-8 h-full":true,"bg-white border-gray-200 text-gray-900 shadow-sm":this.currentPage==="own-fund","border border-transparent text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-focus focus:z-10 hover:bg-primary-hover":this.currentPage!=="own-fund"}},"Choose another fund"))))))};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 MyOwnFund=function(){function e(e){registerInstance(this,e);this.isNotAllInformationProvidedMessageVisible=false;this.isSubmitDisabled=true;this.eventTrackingService=EventTrackingService.Instance}e.prototype.componentDidLoad=function(){return this.eventTrackingService.TrackMyOwnSuperFundDetailViewedAsync({promotedFundsShown:superSelectionAppService.promotedFunds})};e.prototype.render=function(){var e=this;return h(Host,null,h("sss-header-section",{currentPage:"own-fund"}),h("div",{class:"flex justify-center mt-11"},h("sss-custom-fund",null,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.formElement.checkValidity()}},h("div",{class:"p-4 sm:p-6 border shadow-sm rounded-lg"},h("p",{class:"sm:text-lg font-bold mb-3"},"Fund details"),h("div",{class:"bg-yellow-50 border-l-4 border-yellow-400 p-4 mb-3 sm:mb-4"},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-2"},h("ul",{class:"list-disc list-outside ml-6 space-y-2 text-sm text-yellow-700 leading-5"},h("li",null,"Make sure you are a current member of the fund before completing this step."),h("li",null,"Please check that the fund USI is correct as some funds have similar names."))))),h("sss-my-own-fund-inputs",{myOwnFundForm:state$1.myOwnFundForm,showValidationErrors:this.formState==="validated",onFormChanged:function(t){state$1.myOwnFundForm=Object.assign(Object.assign({},state$1.myOwnFundForm),t.detail);e.isNotAllInformationProvidedMessageVisible=false}}),this.isNotAllInformationProvidedMessageVisible&&h("div",{class:"mt-4 rounded-md bg-red-50 p-4 text-sm text-red-700"},"All fields are required to complete submission. Make sure you have selected a fund.")),h("div",{class:"flex justify-center mt-8"},h("div",{class:"sm:max-w-320 w-full"},h("div",{class:"mb-4"},h("sss-button",{fillWidth:true,promiseFn:function(){return e.handleSubmitForm()},disabled:this.isSubmitDisabled},"Continue")),h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("sss-button",{fillWidth:true,variant:"secondary"},"Back"))))))))};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(n){this.formState="validated";if(!this.formElement.checkValidity()){return[2]}e=isSome(state$1.myOwnFundForm.fundUsi)&&isSome(state$1.myOwnFundForm.memberNumber);if(!e){this.isNotAllInformationProvidedMessageVisible=true;return[2]}navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:this.getOrError(state$1.myOwnFundForm.fundName),handleSubmitFn:function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:t={fundUsi:this.getOrError(state$1.myOwnFundForm.fundUsi),memberNumber:this.getOrError(state$1.myOwnFundForm.memberNumber),standardChoiceFormSignature:e};return[4,customFundChoiceApi.submitCustomFundChoiceAsync(t)];case 1:n.sent();return[2]}}))}))}});return[2]}))}))};e.prototype.getOrError=function(e){return _function.pipe(e,getOrElse((function(){throw new Error("Option value is none.")})))};return e}();injectHistory(MyOwnFund);var MyOwnFundInputs=function(){function e(e){var t=this;registerInstance(this,e);this.formChanged=createEvent(this,"formChanged",7);this.MIN_SEARCH_STRING_LENGTH=3;this.MAX_RECORD_COUNT=10;this.searchFundsAsync=function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,australianFundLookupService.searchFundsAsync(e,this.MAX_RECORD_COUNT)];case 1:t=n.sent();return[2,t.sort((function(e,t){return e.productName.localeCompare(t.productName)})).map((function(e){return{label:e.productName+" ("+e.usi+")",value:e.usi}}))]}}))}))}}e.prototype.render=function(){var e=this;return h("div",null,h("div",null,h("label",{class:"text-sm font-medium text-gray-700"},"Fund name"),h("div",{class:"mt-1"},h("sss-dropdown-async",{searchFunction:this.searchFundsAsync,minSearchStringLength:this.MIN_SEARCH_STRING_LENGTH,required:true,requiredValidationMessage:"Select a fund",placeholder:"Type to search by name or USI...",value:this.selectedOption,onValueChanged:function(t){e.selectedOption=t.detail;e.updateFund(t.detail)},showValidationErrors:this.showValidationErrors})),isSome(this.myOwnFundForm.fundUsi)&&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-sm"},this.myOwnFundForm.fundUsi.value))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Member number"),h("div",{class:"mt-1"},h("input",{type:"text",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full 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:"[A-Za-z0-9]{4,16}",name:"memberNumber",id:"memberNumber",value:toUndefined(state$1.myOwnFundForm.memberNumber),onChange:function(t){return e.updateMemberNumber(t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid member number (only numbers and / or letters)"))))};e.prototype.updateFund=function(e){this.formChanged.emit({fundUsi:some(e.value),fundName:some(e.label)})};e.prototype.updateMemberNumber=function(e){this.formChanged.emit({memberNumber:some(e)})};return e}();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()]}))}))};return e}();var promotedFundChoiceApi=new PromotedFundChoiceApi;var initial$1={fundId:""};var state$2=createStore(initial$1).state;var PromotedFundJoinIFrameBuilder=function(){function e(){var e=this;this.hostIsLocalSuperSelection=function(){return window.location.origin==="http://localhost:7100"};this.environmentDiscriminator=function(){return e.hostIsLocalSuperSelection()?"autodev-partner":window.location.hostname.toLowerCase().split(".")[0]};this.promotedFundJoinAppUrl=function(){return"https://"+e.environmentDiscriminator()+".flarehr.com/promoted-fund-join/embed/v1.0/web"}}e.prototype.build=function(e,t){if(!(e===null||e===void 0?void 0:e.contentDocument))return;var n=Object.assign(Object.assign({},this.getMemberData()),{partnerId:superSelectionAppService.partnerIdOrDefault,accountId:superSelectionAppService.accountIdOrDefault,fundId:state$2.fundId,authToken:superSelectionAppService.jwt});var r=function(n){var i;var a=n.data;if(!a){return}if(a.sender==="promoted-fund-redirect"){window.removeEventListener("message",r);switch(a.type){case"cancel":navigationService.navigateInternally(t,SuperSelectionAppRoutes.ChoicePage);break;case"success":if(a.memberNumber){navigationService.navigateInternallyToStandardChoice({history:t,fundName:(i=getFundNameById(state$2.fundId))!==null&&i!==void 0?i:"",handleSubmitFn:function(e){return promotedFundChoiceApi.submitChoiceAsync(Object.assign(Object.assign({},state$2),{memberNumber:a.memberNumber,usi:a.usi.replace(/ /g,""),standardChoiceFormSignature:e,shownFunds:superSelectionAppService.promotedFunds}))},promotedFundId:state$2.fundId});break}default:navigationService.navigateInternally(t,SuperSelectionAppRoutes.ChoicePage);break}return}if(a.sender==="promoted-fund-join"){switch(a.type){case"contentResized":e.height=a.height>0?a.height:e.height;e.width=a.width>0?a.width:e.width;break;case"pageNavigated":window.scroll(e.offsetLeft,e.offsetTop);iframe.navigation(window.location.href);break}}};window.addEventListener("message",r);var i=e.contentDocument;i.open();var a=i.createElement("form");a.method="POST";a.target="_self";a.action=this.promotedFundJoinAppUrl();var o;for(o in n){var s=n[o];if(s!==undefined){var u=document.createElement("input");u.type="hidden";u.name=o;u.value=s;a.append(u)}}i.appendChild(a);i.close();a.submit()};e.prototype.getMemberData=function(){var e,t;var n=superSelectionAppService.superBuyer;return{title:n.userProfile.title,firstName:n.userProfile.firstName,middleName:n.userProfile.middleName,lastName:n.userProfile.lastName,dateOfBirth:n.userProfile.dateOfBirth,gender:n.userProfile.gender,email:n.userProfile.email,mobilePhone:n.userProfile.mobilePhone,taxFileNumber:(e=n.tfn)!==null&&e!==void 0?e:"",addressLine1:n.userProfile.address.addressLine1,addressLine2:(t=n.userProfile.address.addressLine2)!==null&&t!==void 0?t:"",city:n.userProfile.address.city,state:n.userProfile.address.state,postCode:n.userProfile.address.postcode}};return e}();var PromotedFundJoinIFrameBuilder$1=new PromotedFundJoinIFrameBuilder;var PromotedFundJoinPage=function(){function e(e){registerInstance(this,e)}e.prototype.componentDidLoad=function(){PromotedFundJoinIFrameBuilder$1.build(this.iframeElement,this.history)};e.prototype.render=function(){var e=this;return h(Host,{class:"w-screen"},h("iframe",{width:"100%",height:window.innerHeight,style:{border:"none"},ref:function(t){return e.iframeElement=t}}))};return e}();var SelfManagedFund=function(){function e(e){var t=this;registerInstance(this,e);this.showSmsfNotSupported=false;this.isSubmitDisabled=true;this.eventTrackingService=EventTrackingService.Instance;this.success=function(){navigationService.navigateInternallyToStandardChoice({history:t.history,fundName:"Self-managed super fund",handleSubmitFn:function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:t={smsfChoice:{abn:state$1.selfManagedFundForm.fundAbn,fundName:state$1.selfManagedFundForm.fundName,fundAddress:{addressLine1:state$1.selfManagedFundForm.addressLine1,addressLine2:state$1.selfManagedFundForm.addressLine2,city:state$1.selfManagedFundForm.city,state:state$1.selfManagedFundForm.state,postcode:state$1.selfManagedFundForm.postcode},bsb:state$1.selfManagedFundForm.bsb,bankAccountName:state$1.selfManagedFundForm.bankAccountName,bankAccountNumber:state$1.selfManagedFundForm.bankAccountNumber,electronicServiceAddress:state$1.selfManagedFundForm.fundEsa},standardChoiceFormSignature:e};return[4,customFundChoiceApi.submitSelfManagedFundChoiceAsync(t)];case 1:n.sent();return[2]}}))}))}})}}e.prototype.componentDidLoad=function(){return this.eventTrackingService.TrackSmsfSuperFundDetailViewedAsync({promotedFundsShown:superSelectionAppService.promotedFunds})};e.prototype.render=function(){var e=this;return h(Host,null,h("sss-header-section",{currentPage:"own-fund"}),h("div",{class:"flex justify-center mt-11"},h("sss-custom-fund",null,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.formElement.checkValidity()}},h("div",{class:"p-4 sm:p-6 border shadow-sm rounded-lg max-w-560"},h("p",{class:"sm:text-lg font-bold"},"Fund details"),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"},"Make sure your Self-managed super fund (SMSF) is a registered fund before completing this step."))),h("sss-self-managed-fund-inputs",{fundForm:state$1.selfManagedFundForm,showValidationErrors:this.formState==="validated",onFormChanged:function(e){state$1.selfManagedFundForm=Object.assign(Object.assign({},state$1.selfManagedFundForm),e.detail)}})),h("div",{class:"flex justify-center mt-8"},h("div",{class:"sm:max-w-320 w-full"},h("div",{class:"mb-4"},h("sss-button",{fillWidth:true,promiseFn:function(){return e.handleSubmitForm()},disabled:this.isSubmitDisabled},"Continue")),h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("sss-button",{fillWidth:true,variant:"secondary"},"Back")))),this.showSmsfNotSupported&&h("sss-smsf-not-supported-dialog",{ref:function(t){return e.notSupportedDialog=t},onContinue:this.success})))))};e.prototype.componentDidRender=function(){var e;this.showSmsfNotSupported&&((e=this.notSupportedDialog)===null||e===void 0?void 0:e.scrollIntoView())};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.formState="validated";if(this.formElement.checkValidity()){if(superSelectionAppService.showSmsfNotSupported){this.showSmsfNotSupported=true}else{this.success()}}return[2]}))}))};return e}();injectHistory(SelfManagedFund);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 SelfManagedFundInputs=function(){function e(e){registerInstance(this,e);this.formChanged=createEvent(this,"formChanged",7);this.currentBank=none;this.addressErrorMessage=none;this.stateOptions=[{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"}];this.bsbRegex=new RegExp(/^[0-9]{3}[0-9]{3}$/);this.bankAccountNumberRegex=new RegExp(/^[0-9]{2,10}$/)}e.prototype.render=function(){var e=this;var t={"relative shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full 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":this.showValidationErrors};return h("div",null,h("div",null,h("label",{class:"text-sm font-medium text-gray-700"},"Fund name"),h("div",{class:"mt-1"},h("input",{type:"text",class:t,required:true,minlength:"2",name:"fundName",id:"fundName",value:state$1.selfManagedFundForm.fundName,onChange:function(t){return e.updateFormField("fundName",t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid fund name"))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Fund ABN"),h("div",{class:"mt-1"},h("input",{type:"text",class:t,required:true,minlength:"2",name:"fundAbn",id:"fundAbn",value:state$1.selfManagedFundForm.fundAbn,onChange:function(t){return e.updateFormField("fundAbn",t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid fund ABN"))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Electronic service address alias (ESA)"),h("div",{class:"mt-1"},h("input",{type:"text",class:t,required:true,minlength:"2",name:"fundEsa",id:"fundEsa",value:state$1.selfManagedFundForm.fundEsa,onChange:function(t){return e.updateFormField("fundEsa",t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid fund ESA"))),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({},t),{"rounded-none rounded-t-md shadow-none":true}),required:true,minlength:"2",name:"addressLine1",id:"addressLine1",value:state$1.selfManagedFundForm.addressLine1,onChange:function(t){e.updateFormField("addressLine1",t.target.value.trim());e.updateAddressErrorMessage()},ref:function(t){return e.addressLine1Element=t}}),h("input",{placeholder:"Address line 2 (optional)",type:"text",class:Object.assign(Object.assign({},t),{"rounded-none shadow-none":true}),name:"addressLine2",id:"addressLine2",value:state$1.selfManagedFundForm.addressLine2,onChange:function(t){return e.updateFormField("addressLine2",t.target.value.trim())}}),h("input",{placeholder:"City/suburb",type:"text",class:Object.assign(Object.assign({},t),{"rounded-none shadow-none":true}),name:"city",required:true,id:"city",value:state$1.selfManagedFundForm.city,onChange:function(t){e.updateFormField("city",t.target.value.trim());e.updateAddressErrorMessage()},ref:function(t){return e.cityElement=t}}),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({},t),{"rounded-none rounded-bl-md shadow-none":true}),name:"postcode",minlength:"4",maxlength:"4",pattern:"[0-9]{4}",id:"postcode",value:state$1.selfManagedFundForm.postcode,onChange:function(t){e.updateFormField("postcode",t.target.value.trim());e.updateAddressErrorMessage()},ref:function(t){return e.postcodeElement=t}})),h("div",{class:"flex-1 min-w-0"},h("select",{class:Object.assign(Object.assign({},t),{"rounded-none rounded-br-md shadow-none":true,"text-gray-500":!this.fundForm.state}),name:"state",required:true,id:"state",onChange:function(t){e.updateFormField("state",t.target.value.trim());e.updateAddressErrorMessage()},ref:function(t){return e.stateElement=t}},h("option",{disabled:true,selected:!this.fundForm.state,value:""},"State"),this.stateOptions.map((function(t){return h("option",{value:t.value,selected:e.fundForm.state===t.value},t.label)})))))),isSome(this.addressErrorMessage)&&this.showValidationErrors&&h("div",{class:"mt-2 text-sm text-red-600"},this.addressErrorMessage.value)),h("h3",{class:"text-lg font-bold mt-6"},"Fund bank details"),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Account name"),h("div",{class:"mt-1"},h("input",{type:"text",required:true,class:t,name:"bankAccountName",minlength:"2",id:"bankAccountName",value:state$1.selfManagedFundForm.bankAccountName,onChange:function(t){return e.updateFormField("bankAccountName",t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid bank account name"))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"BSB"),h("div",{class:"mt-1"},h("input",{type:"text",required:true,class:t,name:"bsb",id:"bsb",minlength:"6",maxlength:"7",onKeyUp:function(t){return e.updateCurrentBank(t)},pattern:this.bsbRegex.source,value:state$1.selfManagedFundForm.bsb}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid BSB"))),isSome(this.currentBank)&&h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Bank 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-sm"},this.currentBank.value)),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Account number"),h("div",{class:"mt-1"},h("input",{type:"text",required:true,class:t,name:"bankAccountNumber",id:"bankAccountNumber",minlength:"2",maxlength:"11",pattern:this.bankAccountNumberRegex.source,value:state$1.selfManagedFundForm.bankAccountNumber,onKeyUp:function(t){return e.updateCurrentBankAccountNumber(t)},onChange:function(t){return e.updateFormField("bankAccountNumber",t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid bank account number"))))};e.prototype.updateFormField=function(e,t){var n;this.formChanged.emit((n={},n[e]=t,n))};e.prototype.filterDigits=function(e){return e.replace(/[^0-9]/g,"")};e.prototype.updateCurrentBank=function(e){var t=this.filterDigits(e.target.value);var n=t.substring(0,2);var r=t.substring(0,3);var i=bsbNumbers[n];var a=bsbNumbers[r];if(i)this.currentBank=some(i);if(a)this.currentBank=some(a);if(t===""||t.length>6)this.currentBank=none;this.updateFormField("bsb",t)};e.prototype.updateCurrentBankAccountNumber=function(e){var t=this.filterDigits(e.target.value);this.updateFormField("bankAccountNumber",t)};e.prototype.updateAddressErrorMessage=function(){var e=none;if(isNone(e)&&!this.addressLine1Element.checkValidity()){e=some("Enter a valid address line 1")}if(isNone(e)&&!this.cityElement.checkValidity()){e=some("Enter a valid city/suburb")}if(isNone(e)&&!this.postcodeElement.checkValidity()){e=some("Enter a valid post code")}if(isNone(e)&&!this.stateElement.checkValidity()){e=some("Select a state")}this.addressErrorMessage=e};return 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,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)if(o=e[s])a=(i<3?o(a):i>3?o(t,n,a):o(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}}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 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 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 SlateIFrameBuilder=function(){function e(){var e=this;this.hostIsLocalSuperSelection=function(){return window.location.origin==="http://localhost:7100"};this.hostIsDeployed=function(){return window.location.origin.endsWith("partner.flarehr.com")};this.skipConsolidation=function(){return interopQuery.isReactNativeInteropEnabled()?"true":"false"};this.skipInsurance=function(){return interopQuery.isReactNativeInteropEnabled()?"true":"false"};this.environmentDiscriminator=function(){var e=window.location.hostname.toLowerCase().split(".")[0];switch(e){case"autodev-partner":case"test-partner":case"partner":case"sandbox-partner":return e.replace("partner","");default:return"autodev-"}};this.slateJoinAppUrl=function(){return"https://"+e.environmentDiscriminator()+"join.slatesuper.com.au/confirm"}}e.prototype.build=function(e,t){if(!(e===null||e===void 0?void 0:e.contentDocument))return;var n=this.hostIsLocalSuperSelection()||this.hostIsDeployed()?window.location.origin+"/super-selection/embed/v1.0/app":"https://autodev-partner.flarehr.com/super-selection/embed/v1.0/app";var r=n+"/slate-redirect.html";var i=Object.assign(Object.assign({},this.getSlateJoinMemberData()),{successRedirectUrl:r,cancelRedirectUrl:r,skipConsolidation:this.skipConsolidation(),skipInsurance:this.skipInsurance()});if(this.includeJwt()){i.authToken=superSelectionAppService.jwt}var a=function(n){var r=n.data,i=n.origin;if(!r){return}if(r.sender==="slate-redirect"){window.removeEventListener("message",a);switch(r.type){case"success":if(r.memberNumber){navigationService.navigateInternallyToStandardChoice({history:t,fundName:Slate.Name,handleSubmitFn:function(e){return slateChoiceApi.submitSlateChoiceAsync({memberNumber:r.memberNumber,standardChoiceFormSignature:e,shownFunds:superSelectionAppService.promotedFunds})},promotedFundId:Slate.Id});break}default:navigationService.navigateInternally(t,SuperSelectionAppRoutes.ChoicePage);break}return}if(r.sender==="flare"&&i.endsWith("join.slatesuper.com.au")){switch(r.type){case"contentResized":e.height=r.height>0?r.height:e.height;e.width=r.width>0?r.width:e.width;break}}};window.addEventListener("message",a);var o=e.contentDocument;o.open();var s=o.createElement("form");s.method="POST";s.target="_self";s.action=this.slateJoinAppUrl();var u;for(u in i){var l=i[u];if(l!==undefined){var c=document.createElement("input");c.type="hidden";c.name=u;c.value=l;s.append(c)}}o.appendChild(s);o.close();s.submit()};e.prototype.getSlateJoinMemberData=function(){var e,t;var n=superSelectionAppService.superBuyer;var r=function(e){switch(e){case"Male":return"Male";case"Female":return"Female";case"Intersex":return"Intersex/Indeterminate";default:return"Unknown"}};return{firstName:n.userProfile.firstName,middleName:n.userProfile.middleName,lastName:n.userProfile.lastName,dateOfBirth:n.userProfile.dateOfBirth,gender:r(n.userProfile.gender),email:n.userProfile.email,mobilePhone:n.userProfile.mobilePhone,taxFileNumber:(e=n.tfn)!==null&&e!==void 0?e:"",addressLine1:n.userProfile.address.addressLine1,addressLine2:(t=n.userProfile.address.addressLine2)!==null&&t!==void 0?t:"",city:n.userProfile.address.city,state:n.userProfile.address.state,postCode:n.userProfile.address.postcode}};e.prototype.includeJwt=function(){return!this.slateJoinAppUrl().match(/autodev|sandbox/)};return e}();var slateIFrameBuilder=new SlateIFrameBuilder;var SlateJoinPage=function(){function e(e){registerInstance(this,e)}e.prototype.componentDidLoad=function(){slateIFrameBuilder.build(this.iframeElement,this.history)};e.prototype.render=function(){var e=this;return h(Host,{class:"w-screen"},h("iframe",{width:"100%",height:window.innerHeight,style:{border:"none"},ref:function(t){return e.iframeElement=t}}))};return e}();var SmsfNotSupportedDialog=function(){function e(e){var t=this;registerInstance(this,e);this.continue=createEvent(this,"continue",7);this.standardChoiceFormUrl="/super-selection/embed/v1.0/app/assets/Superannuation_Standard_Choice_Form.pdf";this.handleContinue=function(){t.continue.emit()}}e.prototype.render=function(){return h(Host,null,h("div",{class:"fixed z-40 top-0 left-0 bg-white opacity-70 w-full h-full"}),h("div",{class:"fixed z-50 top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2"},h("div",{class:"p-6 shadow-sm border rounded-lg bg-white text-center max-w-560"},h("div",{class:"flex justify-center"},h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"orange",viewBox:"0 0 16 16"},h("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"}))),h("p",{class:"my-4"},"You’ve selected a self-managed super fund (SMSF). Currently, SMSF information can’t be sent via this form. You’ll need to provide your employer with a"," ",h("a",{target:"_blank",href:this.standardChoiceFormUrl},"standard choice form")," ","for your SMSF details."),h("sss-button",{onClick:this.handleContinue,fillWidth:true},"Continue"))))};return e}();var StandardChoiceFormInputDefaultFund=function(){function e(e){registerInstance(this,e);this.standardChoiceFormSignature="";this.isSubmitDisabled=true}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"},state.promotedFundId&&getLogoSrc(state.promotedFundId)&&h("div",{class:"pb-4 mb-4 border-b flex justify-center sm:pb-0 sm:mb-0 sm:border-b-0 sm:pr-8 sm:mr-8 sm:border-r sm:justify-start"},h("img",{class:"h-16 w-auto",alt:state.fundName,src:getLogoSrc(state.promotedFundId)})),h("div",{class:"flex justify-between w-full"},h("div",null,h("div",{class:"text-xs font-semibold text-gray-500 sm:uppercase"},"Nominated fund"),h("div",{class:"text-sm mt-2"},state.fundName)),h("div",{class:"grid content-center ml-4"},h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("sss-button",{variant:"secondary"},"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",{type:"text",autocomplete:"off",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-focus w-full 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",{fillWidth:true,promiseFn:function(){return e.handleSubmitForm()},disabled:this.isSubmitDisabled},"Confirm and continue")))))))};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.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)}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",{fillWidth:true,onClick:this.handleContinueButtonClick},h("span",null,"Continue")))))};e.prototype.handleContinueButtonClick=function(e){superSelectionAppService.completeSuperSelectionFlow()};return e}();var SuperChoiceItemBottom=function(){function e(e){registerInstance(this,e);this.joinFundClicked=createEvent(this,"joinFundClicked",7)}e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"py-6 px-4 lg:px-6 flex flex-col justify-between h-full"},h("div",null,h("div",{class:"md:max-w-[240px] lg:max-w-full"},h("sss-button",{class:"uuid-button-continue",fillWidth:true,onClick:function(){return e.handleFundClick()}},"Choose this fund")),h("div",{class:"text-xs text-gray-500 mt-6 leading-4"},this.disclaimer)),this.abnInfo&&this.abn&&h("div",{class:"text-xs text-gray-500 mt-2"},h("p",null,""+(FeatureFlagService.isNewComplianceEnabled()?"Issued by ":"")+this.abnInfo+"."),h("p",null,"ABN: ",this.abn))))};e.prototype.handleFundClick=function(){return this.joinFundClicked.emit()};return e}();var SuperChoiceItemTop=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h(Host,null,h("div",{class:"px-4 lg:px-6 pt-6"},h("div",{class:"text-right w-100 -mt-5 -mr-3.5 lg:-mr-5"},h("span",{class:"text-xs bg-gray-100 text-gray-800 font-medium rounded-xl py-0.5 px-2.5 mr-0.5"},FeatureFlagService.isNewComplianceEnabled()?"Featured":"Advertised")),h("div",{class:"flex lg:block mt-2 md:mt-0 lg:mt-2"},h("img",{class:"h-16 object-contain w-auto max-w-[80px] md:hidden lg:block lg:max-w-none",alt:this.name,src:getAssetPath("assets/"+this.logo)}),h("div",{class:"grid content-center"},h("p",{class:"text-lg font-bold ml-4 mb-2 md:ml-0 md:mb-0 lg:mt-4"},this.name))),h("div",{class:"mt-4 text-sm space-y-2"},JSON.parse(this.features).map((function(e){return h("div",{class:"flex"},h("div",{class:"h-5 w-5 flex-none mr-1.5"},h("img",{src:getAssetPath("assets/icon-check.svg")})),h("p",{class:"leading-5"},e.value))}))),this.featureSubText&&h("p",{class:"text-xs text-gray-500 italic mt-4 leading-4"},this.featureSubText)))};return e}();var SuperChoicePage=function(){function e(e){registerInstance(this,e);this.promotedFunds=this.getPromotedFunds();this.eventTrackingService=EventTrackingService.Instance}e.prototype.componentDidLoad=function(){var e=this.promotedFunds.map((function(e){return e.fundId}));return this.eventTrackingService.TrackSuperFundPanelViewedAsync({promotedFundsShown:e})};e.prototype.render=function(){var e=this;var t="https://my.gov.au";var n="www.my.gov.au";var r="https://www.apra.gov.au/register-of-superannuation-institutions";var i="www.apra.gov.au";return h(Host,null,h("div",null,h("sss-header-section",{currentPage:"choice"}),FeatureFlagService.isNewComplianceEnabled()&&h("div",{class:"mt-8 text-sm text-center leading-6"},"Not looking to join a new fund? You can skip the featured super funds and"," ",h("stencil-route-link",{url:SuperSelectionAppRoutes.MyOwnFund},h("span",{class:"text-primary-base font-medium"},"choose another super fund")),"."),!FeatureFlagService.isNewComplianceEnabled()&&h("div",{class:"flex justify-center pb-4"},h("div",{class:"text-center space-y-4 max-w-960 text-sm leading-6"},h("p",{class:"text-lg leading-8 text-gray-600"},"The choice of superannuation fund is an important personal financial decision. It is open to you to continue with your existing fund, or alternatively, you can select from one of the funds below or choose another fund."),h("p",null,"Flare is not licensed to advise you in relation to this decision and you may wish to return to this page at a later stage."),h("p",null,"The content on this page and on the following pages relating to each super fund is provided by the trustee or promoter of the super fund. The super funds presented have not been selected by your employer and neither your employer or Flare are making any recommendation or opinion."),h("p",null,"There are many super funds out there and you should consider the relevant product disclosure statement and choose one that is right for you. If you are unsure, obtain your own advice. You can choose your super fund later, if you need time to obtain advice."),h("p",null,"You should be aware that, if you do choose one of these advertised funds, Flare and its associated entities will normally receive a fee for you doing so."))),h("div",{class:"flex justify-center mt-8"},h("div",{class:{"lg:grid border-l border-t lg:border-b rounded-lg":true,"lg:grid-cols-1 max-w-400":this.promotedFunds.length===1,"lg:grid-cols-2 max-w-720":this.promotedFunds.length===2,"lg:grid-cols-3 max-w-960":this.promotedFunds.length===3}},this.promotedFunds.map((function(t,n){return h("div",{class:{"border-r":true,"rounded-tr-lg":n===0,"lg:rounded-tr-none":n===0&&n!==e.promotedFunds.length-1,"rounded-br-lg lg:rounded-br-none lg:rounded-tr-lg":n===e.promotedFunds.length-1}},h("div",{class:{"flex border-b lg:border-b-0":true,"rounded-b-lg":n===e.promotedFunds.length-1}},h("div",{class:"hidden md:flex lg:hidden w-36 justify-center pt-6 pl-6"},h("img",{class:"h-16 object-contain w-full max-w-[96px]",alt:t.name,src:getAssetPath("assets/"+t.logo)})),h("div",{class:"w-full"},h("sss-super-choice-item-top",{logo:t.logo,name:t.name,features:JSON.stringify(t.features),featureSubText:t.featureSubText}),h("div",{class:"lg:hidden"},h("sss-super-choice-item-bottom",{disclaimer:t.disclaimer,abnInfo:t.abnInfo,abn:t.abn,onJoinFundClicked:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.handleJoinSuperClickAsync(t)]}))}))}})))))})),this.promotedFunds.map((function(t,n){return h("div",{class:{"hidden lg:block border-r":true,"rounded-br-lg":n===e.promotedFunds.length-1}},h("sss-super-choice-item-bottom",{disclaimer:t.disclaimer,abnInfo:t.abnInfo,abn:t.abn,onJoinFundClicked:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.handleJoinSuperClickAsync(t)]}))}))}}))})))),h("div",{class:"flex justify-center mt-8 sm:mt-12"},h("div",{class:"pb-8 sm:pb-12 max-w-720 border-b"},h("h5",{class:"font-bold sm:text-lg"},"Or, choose another super fund:"),h("ul",{class:"list-disc list-outside ml-6 mt-3 mb-6 space-y-2 leading-6 text-sm sm:text-base"},h("li",null,"Select this option if you'd like to use your current account with another super fund, your self-managed super fund, or your employer's default fund."),h("li",null,"If you are unsure of your current super fund details, you can find out at"," ",h("a",{class:"text-primary-base font-medium",target:"_blank",href:navigationService.toExternalUrl(t)},n)),h("li",null,"A full list of super funds can be viewed at"," ",h("a",{class:"text-primary-base font-medium",target:"_blank",href:navigationService.toExternalUrl(r)},i))),h("stencil-route-link",{url:SuperSelectionAppRoutes.MyOwnFund},h("sss-button",{fillWidthOnMobile:true},"Choose another super fund")))),FeatureFlagService.isNewComplianceEnabled()&&h("div",{class:"flex justify-center"},h("div",{class:"pt-8 sm:pt-12 max-w-720"},h("h5",{class:"font-semibold"},"IMPORTANT INFORMATION:"),h("ul",{class:"list-disc list-outside ml-6 mt-3 space-y-2 text-sm leading-6"},h("li",null,"The superannuation funds featured above are for your information only. The order, position and placement of content should not be interpreted as an opinion or recommendation (actual or implied) by Flare as to the suitability or appropriateness of any superannuation fund for you. In featuring these superannuation funds, Flare has not taken into account your objectives, financial situation or needs."),h("li",null,"This is not a comparison service. This page contains factual information only and does not constitute either general or personal advice about any financial products. We do not take into account your objectives, financial situation or needs. If you have questions or need help making a decision about your superannuation fund, you should speak to a licensed financial product advice provider."),h("li",null,"Flare, the technology partner you are accessing Flare via and your employer do not endorse or accept responsibility for any financial product advice or services provided by the promoters or trustees of the featured superannuation funds. Flare does not endorse or accept responsibility for any of the content shown about any of the featured superannuation funds."),h("li",null,"You should consider the relevant superannuation fund’s PDS and TMD (if applicable) in deciding whether to apply to join the superannuation fund. Each of the superannuation funds featured above include a link to their PDS and TMD (if applicable) for your convenience. If you are considering joining another superannuation fund, you can typically find the PDS and TMD (if applicable) on that fund’s website."),h("li",null,"You should be aware that, if you do choose one of the featured superannuation funds, Flare and it’s associates will normally receive a fee for you doing so (this includes Simple Financial Choices Pty Ltd, a wholly owned subsidiary of Flare, which is a sub-promoter of Slate Super)."))))))};e.prototype.allFunds=function(){var e=this;return[{fundId:Slate.Id,name:Slate.Name,logo:"logo-slate.png",route:SuperSelectionAppRoutes.SlateJoin,features:[{order:1,value:"A lifestage investment strategy that evolves with you"},{order:2,value:"Advanced mobile app with retirement forecast and smart features"},{order:3,value:"Member advocates at Slate to assist with your account"}],disclaimer:h("p",{class:"small text-muted"},"You should consider the"," ",h("a",{class:"font-medium underline",target:"_blank",href:navigationService.toExternalUrl(Slate.PdsUrl),onClick:function(){return e.pdsViewedAsync(Slate.Name,Slate.Usi)}},"Product Disclosure Statement")," ","and"," ",h("a",{class:"font-medium underline",target:"_blank",href:navigationService.toExternalUrl("https://slate.co/forms-and-documents/target-market-determination/")},"Target Market Determination")," ","before deciding to invest in or apply to become a member of the fund."),abnInfo:"Diversa Trustees Limited",abn:Slate.DiversaAbn},{fundId:AustralianRetirementTrust.Id,name:AustralianRetirementTrust.Name,logo:"logo-art.svg",route:SuperSelectionAppRoutes.PromotedFundJoin,features:[{order:1,value:"$200 billion in retirement savings"},{order:2,value:"2+ million members"},{order:3,value:"A focus on delivering strong, long‑term returns"}],featureSubText:"QSuper is now part of Australian Retirement Trust. If you have an existing QSuper account, you will continue to hold that account by selecting this option.",disclaimer:h("p",null,"You should consider the"," ",h("a",{class:"font-medium underline",target:"_blank",href:navigationService.toExternalUrl(AustralianRetirementTrust.PdsUrl),onClick:function(){return e.pdsViewedAsync(AustralianRetirementTrust.Name)}},"Product Disclosure Statement")," ","and"," ",h("a",{class:"font-medium underline",target:"_blank",href:navigationService.toExternalUrl("https://www.australianretirementtrust.com.au/tmd")},"Target Market Determination")," ","before deciding to invest in or apply to become a member of this fund."),abnInfo:"Australian Retirement Trust",abn:AustralianRetirementTrust.Abn},{fundId:Aware.Id,name:Aware.Name,logo:"logo-aware.svg",route:SuperSelectionAppRoutes.PromotedFundJoin,features:[{order:1,value:"Acting on climate change"},{order:2,value:"All profits go to members"},{order:3,value:"One of Australia’s largest funds"}],disclaimer:h("p",null,"You should consider the"," ",h("a",{class:"font-medium underline",target:"_blank",href:navigationService.toExternalUrl(Aware.PdsUrl),onClick:function(){return e.pdsViewedAsync(Aware.Name)}},"Product Disclosure Statement")," ","before deciding to invest in or apply to become a member of this fund."),abnInfo:"Aware Super Pty Ltd",abn:Aware.Abn},{fundId:Active.Id,name:Active.Name,logo:"logo-active.svg",route:SuperSelectionAppRoutes.PromotedFundJoin,features:[{order:1,value:"One of Canstar's top-performing funds*"},{order:2,value:"Recognised as a leader in responsible investment"},{order:3,value:"Calls answered in 20 seconds (average over 5 years)"}],featureSubText:"*Past performance is not a reliable indicator of future performance. As at 22 April 2022, Active Super is ranked among Canstar’s top five funds for 18-49 year-olds with a balance up to $250,000 based on returns over 5 years in the Accumulation Scheme.",disclaimer:h("p",null,"Issued by LGSS Pty Limited as trustee for Local Government Super (Active Super ABN:28 901 371 321). Consider the PDS and TMD at"," ",h("a",{class:"font-medium underline",target:"_blank",onClick:function(){return e.pdsViewedAsync(Active.Name)},href:navigationService.toExternalUrl(Active.PdsUrl)},"activesuper.com.au")," ","before making a decision.")}]};e.prototype.getPromotedFunds=function(){var e=this;var t=[];superSelectionAppService.promotedFunds.forEach((function(n){var r=e.allFunds().find((function(e){return n===e.fundId}));if(r!==undefined){t.push(r)}}));return t};e.prototype.handleJoinSuperClickAsync=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:t=superSelectionAppService.promotedFunds;if(!(e.fundId===Slate.Id))return[3,2];return[4,this.eventTrackingService.TrackPromotedSuperFundDetailViewedAsync({fundUsi:Slate.Usi,fundName:Slate.Name,promotedFundId:Slate.Id,promotedFundsShown:t})];case 1:n.sent();return[3,8];case 2:if(!(e.fundId===AustralianRetirementTrust.Id))return[3,4];return[4,this.eventTrackingService.TrackPromotedSuperFundDetailViewedAsync({fundName:AustralianRetirementTrust.Name,promotedFundId:AustralianRetirementTrust.Id,promotedFundsShown:t})];case 3:n.sent();state$2.fundId=e.fundId;return[3,8];case 4:if(!(e.fundId===Aware.Id))return[3,6];return[4,this.eventTrackingService.TrackPromotedSuperFundDetailViewedAsync({fundName:Aware.Name,promotedFundId:Aware.Id,promotedFundsShown:t})];case 5:n.sent();state$2.fundId=e.fundId;return[3,8];case 6:if(!(e.fundId===Active.Id))return[3,8];return[4,this.eventTrackingService.TrackPromotedSuperFundDetailViewedAsync({fundName:Active.Name,promotedFundId:Active.Id,promotedFundsShown:t})];case 7:n.sent();state$2.fundId=e.fundId;n.label=8;case 8:return[2,navigationService.navigateInternally(this.history,e.route)]}}))}))};e.prototype.pdsViewedAsync=function(e,t){return this.eventTrackingService.TrackSuperFundPdsViewedAsync({fundUsi:t,fundName:e,pageName:"Panel Fund Page"})};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();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=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,["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 o=function(t){r(t,[e.scrollX,e.scrollY])};if(storageAvailable(e,"sessionStorage")){var s=e.sessionStorage.getItem(t);n=s?new Map(JSON.parse(s)):n}if("scrollRestoration"in e.history){history.scrollRestoration="manual"}return{set:r,get:i,has:a,capture:o}};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 o=supportsHistory(e);var s=!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,o=i.hash;var s=r+a+o;warning(!f||hasBasename(s,f),"You are attempting to use a basename on a page whose URL path does not begin "+'with the basename. Expected path "'+s+'" to begin with "'+f+'".');if(f){s=stripBasename(s,f)}return createLocation(s,n,t||createKey(d))};var g=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;g.notifyListeners(U.location,U.action)};var m=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";g.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=_.indexOf(t.key);var i=_.indexOf(e.key);if(r===-1){r=0}if(i===-1){i=0}var a=r-i;if(a){n=true;A(a)}};var w=h(p());var _=[w.key];var x=0;var C=false;var I=function(e){return f+createPath(e)};var T=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);g.confirmTransitionTo(a,n,c,(function(e){if(!e){return}var t=I(a);var s=a.key,u=a.state;if(o){r.pushState({key:s,state:u},"",t);if(l){i.href=t}else{var c=_.indexOf(U.location.key);var d=_.slice(0,c===-1?0:c+1);d.push(a.key);_=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);g.confirmTransitionTo(a,n,c,(function(e){if(!e){return}var t=I(a);var s=a.key,u=a.state;if(o){r.replaceState({key:s,state:u},"",t);if(l){i.replace(t)}else{var c=_.indexOf(U.location.key);if(c!==-1){_[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 A=function(e){r.go(e)};var F=function(){return A(-1)};var P=function(){return A(1)};var N=function(t){x+=t;if(x===1){e.addEventListener(PopStateEvent,m);if(s){e.addEventListener(HashChangeEvent,y)}}else if(x===0){e.removeEventListener(PopStateEvent,m);if(s){e.removeEventListener(HashChangeEvent,y)}}};var D=function(e){if(e===void 0){e=""}var t=g.setPrompt(e);if(!C){N(1);C=true}return function(){if(C){C=false;N(-1)}return t()}};var k=function(e){var t=g.appendListener(e);N(1);return function(){N(-1);t()}};var U={length:r.length,action:"POP",location:w,createHref:I,push:T,replace:E,go:A,goBack:F,goForward:P,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 o=e.location;var s=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 g=HashPathCoders[p],v=g.encodePath,m=g.decodePath;var y=function(){var e=o.href;var t=e.indexOf("#");return t===-1?"":e.substring(t+1)};var S=function(e){return o.hash=e};var b=function(e){var t=o.href.indexOf("#");o.replace(o.href.slice(0,t>=0?t:0)+"#"+e)};var w=function(){var e=m(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 _=createTransitionManager();var x=function(e){Object.assign(j,e);j.length=s.length;_.notifyListeners(j.location,j.action)};var C=function(){var e=y();var t=v(e);if(e!==t){b(t)}else{var i=w();var a=j.location;if(!n&&locationsAreEqual(a,i)){return}if(r===createPath(i)){return}r=null;I(i)}};var I=function(e){if(n){n=false;x()}else{var t="POP";_.confirmTransitionTo(e,t,d,(function(n){if(n){x({action:t,location:e})}else{T(e)}}))}};var T=function(e){var t=j.location;var r=P.lastIndexOf(createPath(t));var i=P.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 A=v(E);if(E!==A){b(A)}var F=w();var P=[createPath(F)];var N=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),j.location);_.confirmTransitionTo(i,n,d,(function(e){if(!e){return}var t=createPath(i);var a=v(h+t);var o=y()!==a;if(o){r=t;S(a);var s=P.lastIndexOf(createPath(j.location));var u=P.slice(0,s===-1?0:s+1);u.push(t);P=u;x({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");x()}}))};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),j.location);_.confirmTransitionTo(i,n,d,(function(e){if(!e){return}var t=createPath(i);var a=v(h+t);var o=y()!==a;if(o){r=t;b(a)}var s=P.indexOf(createPath(j.location));if(s!==-1){P[s]=t}x({action:n,location:i})}))};var U=function(e){warning(u,"Hash history go(n) causes a full page reload in this browser");s.go(e)};var O=function(){return U(-1)};var R=function(){return U(1)};var M=function(e,t){i+=t;if(i===1){e.addEventListener(HashChangeEvent$1,C)}else if(i===0){e.removeEventListener(HashChangeEvent$1,C)}};var L=function(t){if(t===void 0){t=""}var n=_.setPrompt(t);if(!a){M(e,1);a=true}return function(){if(a){a=false;M(e,-1)}return n()}};var B=function(t){var n=_.appendListener(t);M(e,1);return function(){M(e,-1);n()}};var j={length:s.length,action:"POP",location:F,createHref:N,push:D,replace:k,go:U,goBack:O,goForward:R,block:L,listen:B,win:e};return j};var getLocation=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(t,e.root);e.location=t}));this.location=getLocation(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;return __generator(this,(function(t){switch(t.label){case 0:return[4,superSelectionAppService.loadAppStateAsync()];case 1:t.sent();return[4,existingFundService.GetExistingFundAsync()];case 2:e=t.sent();this.isAppInitialised=true;this.initialised.emit({accountIdOrDefault:superSelectionAppService.accountIdOrDefault,partnerIdOrDefault:superSelectionAppService.partnerIdOrDefault,profileId:superSelectionAppService.profileId});iframe.appReady();if(Option.isSome(e)&&e.value.valid!=="Inactive"){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ExistingChoicePage)}else{navigationService.navigateInternally(this.history,FeatureFlagService.isNewComplianceEnabled()?SuperSelectionAppRoutes.ConsentPage: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":true,"-mt-12 pb-6":!this.isFundJoinPage(),"-mt-28":this.isFundJoinPage()}},superSelectionAppStencilRoutes,h("sss-footer-section",null)):h("div",{class:"flex justify-center py-20"},h("sss-loading-indicator",null))))};e.prototype.isFundJoinPage=function(){return window.location.pathname.includes(SuperSelectionAppRoutes.SlateJoin)||window.location.pathname.includes(SuperSelectionAppRoutes.PromotedFundJoin)};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,o=e.left,s=e.width,u=e.height;return{x:t,y:n,top:r,right:i,bottom:a,left:o,width:s,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,o=i.offsetHeight;return!(a||o||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 o=!r&&scrollRegexp.test(n.overflowY||"");var s=!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 g=r?0:parseDimension(n.borderLeftWidth);var v=d+l;var m=u+c;var y=g+p;var S=f+h;var b=!s?0:e.offsetHeight-S-e.clientHeight;var w=!o?0:e.offsetWidth-y-e.clientWidth;var _=i?v+y:0;var x=i?m+S:0;var C=r?r.width:parseDimension(n.width)-_-w;var I=r?r.height:parseDimension(n.height)-x-b;var T=C+v+w+y;var E=I+m+b+S;var A=freeze({devicePixelContentBoxSize:size(Math.round(C*devicePixelRatio),Math.round(I*devicePixelRatio),a),borderBoxSize:size(T,E,a),contentBoxSize:size(C,I,a),contentRect:new DOMRectReadOnly(d,u,C,I)});cache.set(e,A);return A};var calculateBoxSize=function(e,t,n){var r=calculateBoxSizes(e,n),i=r.borderBoxSize,a=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(t){case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:return o;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 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$1(){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 o=0;o<r;o++){if(o in e){a[o]=t.call(i,e[o],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 o=0;o<a;o++){if(_hasOwnProperty(e,i[o])){n.push(i[o])}}}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 o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r["throw"](e))}catch(e){a(e)}}function u(e){e.done?n(e.value):i(e.value).then(o,s)}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,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return u([e,t])}}function u(o){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;i=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e];i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h,g as getRenderingRef,f as forceUpdate,a as getAssetPath,H as Host,c as createEvent,F as Fragment,d as getElement,e as getContext,s as setErrorHandler}from"./index-e1e930c8.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{A as ActiveRouter}from"./active-router-2056f552.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 o=e;e.addEventListener(t,n,i);a=function(){return o.removeEventListener(t,n,i)}}else if(isJQueryStyleEventEmitter(e)){var s=e;e.on(t,n);a=function(){return s.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="3.59.63229";var isSome=function(e){return e._tag==="Some"};var isNone=function(e){return e._tag==="None"};var none={_tag:"None"};var some=function(e){return{_tag:"Some",value:e}};function fromNullable(e){return e==null?none:some(e)}function toUndefined(e){return isNone(e)?undefined:e.value}var getOrElseW=function(e){return function(t){return isNone(t)?e():t.value}};var getOrElse=getOrElseW;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)}}function injectHistory(e){ActiveRouter.injectProps(e,["history","location"])}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 o=t&&t.delimiter||DEFAULT_DELIMITER;var s=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 g=l[2];var v=l[3];var m=l[4];var y=l[5];if(!u&&a.length){var b=a.length-1;if(s.indexOf(a[b])>-1){p=a[b];a=a.slice(0,b)}}if(a){n.push(a);a="";u=false}var S=p!==""&&h!==undefined&&h!==p;var w=y==="+"||y==="*";var _=y==="?"||y==="*";var x=p||o;var C=v||m;n.push({name:g||r++,prefix:p,delimiter:x,optional:_,repeat:w,partial:S,pattern:C?escapeGroup(C):"[^"+escapeString(x)+"]+?"})}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 o=n.delimiters||DEFAULT_DELIMITERS;var s=[].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&&o.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+=s==="$"?"$":"(?="+s+")"}else{if(!r)u+="(?:"+a+"(?="+s+"))?";if(!l)u+="(?="+a+"|"+s+")"}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 o=e&&isAbsolute(e);var s=t&&isAbsolute(t);var u=o||s;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 o=Object.keys(e);var s=Object.keys(t);if(o.length!==s.length){return false}return o.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 o=pathToRegexp(e,a,t);var s={re:o,keys:a};if(cacheCount<cacheLimit){r[i]=s;cacheCount+=1}return s};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,o=t.strict,s=o===void 0?false:o;var u=compilePath(r,{end:a,strict:s}),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.promiseFn=function(){return Promise.resolve()};this.state=PromiseButtonState.Available}e.prototype.render=function(){var e=this;return h("button",{class:{"inline-flex items-center justify-center px-4 py-2 border text-base font-medium rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-focus pointer-events-auto":true,"disabled:pointer-events-none disabled:border-gray-300 disabled:bg-gray-100 disabled:text-gray-400":true,"border-transparent text-white bg-primary-base hover:bg-primary-hover":this.variant==="primary","border-gray-300 text-gray-700 bg-white hover:bg-gray-50":this.variant==="secondary","w-full":this.fillWidth||this.fillWidthOnMobile,"sm:w-auto":this.fillWidthOnMobile},disabled:this.disabled,onClick:function(){return e.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 __assign$1=undefined&&undefined.__assign||function(){__assign$1=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign$1.apply(this,arguments)};var __spreadArrays=undefined&&undefined.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r};var mix=function(e,t,n){if(n===void 0){n=false}if(!e||!t||typeof e!=="object"||typeof t!=="object")return e;var r=__assign$1({},e);for(var i in t){if(t.hasOwnProperty(i)){if(t[i]instanceof Array&&e[i]instanceof Array){r[i]=n?__spreadArrays(e[i],t[i]):t[i]}else if(typeof t[i]==="object"&&typeof e[i]==="object"){r[i]=mix(e[i],t[i],n)}else{r[i]=t[i]}}}return r};var __spreadArrays$1=undefined&&undefined.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r};var config={defaults:{},errorType:null,polyfills:{fetch:null,FormData:null,URLSearchParams:null,performance:null,PerformanceObserver:null,AbortController:null},polyfill:function(e,t){var n=t===void 0?{}:t,r=n.doThrow,i=r===void 0?true:r,a=n.instance,o=a===void 0?false:a;var s=[];for(var u=2;u<arguments.length;u++){s[u-2]=arguments[u]}var l=this.polyfills[e]||(typeof self!=="undefined"?self[e]:null)||(typeof global!=="undefined"?global[e]:null);if(i&&!l)throw new Error(e+" is not defined");return o&&l?new(l.bind.apply(l,__spreadArrays$1([void 0],s))):l}};var onMatch=function(e,t,n,r){if(!e.getEntriesByName)return false;var i=e.getEntriesByName(t);if(i&&i.length>0){n(i.reverse()[0]);if(r.clearMeasures)r.clearMeasures(t);perfs.callbacks.delete(t);if(perfs.callbacks.size<1){perfs.observer.disconnect();if(r.clearResourceTimings){r.clearResourceTimings()}}return true}return false};var lazyObserver=function(e,t){if(!perfs.observer&&e&&t){perfs.observer=new t((function(t){perfs.callbacks.forEach((function(n,r){onMatch(t,r,n,e)}))}));if(e.clearResourceTimings)e.clearResourceTimings()}return perfs.observer};var perfs={callbacks:new Map,observer:null,observe:function(e,t){if(!e||!t)return;var n=config.polyfill("performance",{doThrow:false});var r=config.polyfill("PerformanceObserver",{doThrow:false});if(!lazyObserver(n,r))return;if(!onMatch(n,e,t,n)){if(perfs.callbacks.size<1)perfs.observer.observe({entryTypes:["resource","measure"]});perfs.callbacks.set(e,t)}}};var middlewareHelper=function(e){return function(t){return e.length===0?t:e.length===1?e[0](t):e.reduceRight((function(n,r,i){return i===e.length-2?r(n(t)):r(n)}))}};var WretchErrorWrapper=function(){function e(e){this.error=e}return e}();var resolver=function(e){var t=e._url,n=e._catchers,r=e._resolvers,i=e._middlewares,a=e._options;var o=new Map(n);var s=mix(config.defaults,a);var u=config.polyfill("AbortController",{doThrow:false,instance:true});if(!s["signal"]&&u){s["signal"]=u.signal}var l={ref:null,clear:function(){if(l.ref){clearTimeout(l.ref);l.ref=null}}};var c=middlewareHelper(i)(config.polyfill("fetch"))(t,s);var d=c.catch((function(e){throw new WretchErrorWrapper(e)})).then((function(e){l.clear();if(!e.ok){return e[config.errorType||"text"]().then((function(t){var n=new Error(t);n[config.errorType||"text"]=t;n["status"]=e.status;n["response"]=e;throw n}))}return e}));var f=function(t){return t.catch((function(t){l.clear();var n=t instanceof WretchErrorWrapper?t.error:t;if(t instanceof WretchErrorWrapper&&o.has("__fromFetch"))return o.get("__fromFetch")(n,e);else if(o.has(n.status))return o.get(n.status)(n,e);else if(o.has(n.name))return o.get(n.name)(n,e);else throw n}))};var p=function(e){return function(t){return e?f(d.then((function(t){return t&&t[e]()})).then((function(e){return t?t(e):e}))):f(d.then((function(e){return t?t(e):e})))}};var h={res:p(null),json:p("json"),blob:p("blob"),formData:p("formData"),arrayBuffer:p("arrayBuffer"),text:p("text"),perfs:function(e){c.then((function(t){return perfs.observe(t.url,e)}));return h},setTimeout:function(e,t){if(t===void 0){t=u}l.clear();l.ref=setTimeout((function(){return t.abort()}),e);return h},controller:function(){return[u,h]},error:function(e,t){o.set(e,t);return h},badRequest:function(e){return h.error(400,e)},unauthorized:function(e){return h.error(401,e)},forbidden:function(e){return h.error(403,e)},notFound:function(e){return h.error(404,e)},timeout:function(e){return h.error(408,e)},internalError:function(e){return h.error(500,e)},fetchError:function(e){return h.error("__fromFetch",e)},onAbort:function(e){return h.error("AbortError",e)}};return r.reduce((function(t,n){return n(t,e)}),h)};var __assign$2=undefined&&undefined.__assign||function(){__assign$2=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign$2.apply(this,arguments)};var __spreadArrays$2=undefined&&undefined.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r};var JSON_MIME="application/json";var CONTENT_TYPE_HEADER="Content-Type";var Wretcher=function(){function e(e,t,n,r,i,a){if(n===void 0){n=new Map}if(r===void 0){r=[]}if(i===void 0){i=[]}if(a===void 0){a=[]}this._url=e;this._options=t;this._catchers=n;this._resolvers=r;this._middlewares=i;this._deferredChain=a}e.factory=function(t,n){if(t===void 0){t=""}if(n===void 0){n={}}return new e(t,n)};e.prototype.selfFactory=function(t){var n=t===void 0?{}:t,r=n.url,i=r===void 0?this._url:r,a=n.options,o=a===void 0?this._options:a,s=n.catchers,u=s===void 0?this._catchers:s,l=n.resolvers,c=l===void 0?this._resolvers:l,d=n.middlewares,f=d===void 0?this._middlewares:d,p=n.deferredChain,h=p===void 0?this._deferredChain:p;return new e(i,__assign$2({},o),new Map(u),__spreadArrays$2(c),__spreadArrays$2(f),__spreadArrays$2(h))};e.prototype.defaults=function(e,t){if(t===void 0){t=false}config.defaults=t?mix(config.defaults,e):e;return this};e.prototype.errorType=function(e){config.errorType=e;return this};e.prototype.polyfills=function(e){config.polyfills=__assign$2(__assign$2({},config.polyfills),e);return this};e.prototype.url=function(e,t){if(t===void 0){t=false}if(t)return this.selfFactory({url:e});var n=this._url.split("?");return this.selfFactory({url:n.length>1?n[0]+e+"?"+n[1]:this._url+e})};e.prototype.options=function(e,t){if(t===void 0){t=true}return this.selfFactory({options:t?mix(this._options,e):e})};e.prototype.query=function(e,t){if(t===void 0){t=false}return this.selfFactory({url:appendQueryParams(this._url,e,t)})};e.prototype.headers=function(e){return this.selfFactory({options:mix(this._options,{headers:e||{}})})};e.prototype.accept=function(e){return this.headers({Accept:e})};e.prototype.content=function(e){var t;return this.headers((t={},t[CONTENT_TYPE_HEADER]=e,t))};e.prototype.auth=function(e){return this.headers({Authorization:e})};e.prototype.catcher=function(e,t){var n=new Map(this._catchers);n.set(e,t);return this.selfFactory({catchers:n})};e.prototype.signal=function(e){return this.selfFactory({options:__assign$2(__assign$2({},this._options),{signal:e.signal})})};e.prototype.resolve=function(e,t){if(t===void 0){t=false}return this.selfFactory({resolvers:t?[e]:__spreadArrays$2(this._resolvers,[e])})};e.prototype.defer=function(e,t){if(t===void 0){t=false}return this.selfFactory({deferredChain:t?[e]:__spreadArrays$2(this._deferredChain,[e])})};e.prototype.middlewares=function(e,t){if(t===void 0){t=false}return this.selfFactory({middlewares:t?e:__spreadArrays$2(this._middlewares,e)})};e.prototype.method=function(e,t,n){if(t===void 0){t={}}if(n===void 0){n=null}var r=this._options.headers;var i=!n?this:typeof n==="object"&&(!r||Object.entries(r).every((function(e){var t=e[0],n=e[1];return t.toLowerCase()!==CONTENT_TYPE_HEADER.toLowerCase()||n.startsWith(JSON_MIME)})))?this.json(n):this.body(n);i=i.options(__assign$2(__assign$2({},t),{method:e}));var a=i._deferredChain.reduce((function(e,t){return t(e,e._url,e._options)}),i);return resolver(a)};e.prototype.get=function(e){return this.method("GET",e)};e.prototype.delete=function(e){return this.method("DELETE",e)};e.prototype.put=function(e,t){return this.method("PUT",t,e)};e.prototype.post=function(e,t){return this.method("POST",t,e)};e.prototype.patch=function(e,t){return this.method("PATCH",t,e)};e.prototype.head=function(e){return this.method("HEAD",e)};e.prototype.opts=function(e){return this.method("OPTIONS",e)};e.prototype.replay=function(e){return this.method(this._options.method,e)};e.prototype.body=function(e){return this.selfFactory({options:__assign$2(__assign$2({},this._options),{body:e})})};e.prototype.json=function(e){var t;var n=(t=Object.entries(this._options.headers||{}).find((function(e){var t=e[0],n=e[1];return t.toLowerCase()===CONTENT_TYPE_HEADER.toLowerCase()&&n.startsWith(JSON_MIME)})))===null||t===void 0?void 0:t[1];return this.content(n||JSON_MIME).body(JSON.stringify(e))};e.prototype.formData=function(e,t){if(t===void 0){t=false}return this.body(convertFormData(e,t))};e.prototype.formUrl=function(e){return this.body(typeof e==="string"?e:convertFormUrl(e)).content("application/x-www-form-urlencoded")};return e}();var appendQueryParams=function(e,t,n){var r;if(typeof t==="string"){r=t}else{var i=config.polyfill("URLSearchParams",{instance:true});for(var a in t){if(t[a]instanceof Array){for(var o=0,s=t[a];o<s.length;o++){var u=s[o];i.append(a,u)}}else{i.append(a,t[a])}}r=i.toString()}var l=e.split("?");if(n||l.length<2)return l[0]+"?"+r;return e+"&"+r};function convertFormData(e,t,n,r){if(t===void 0){t=false}if(n===void 0){n=config.polyfill("FormData",{instance:true})}if(r===void 0){r=[]}Object.entries(e).forEach((function(e){var i=e[0],a=e[1];var o=r.reduce((function(e,t){return e?e+"["+t+"]":t}),null);o=o?o+"["+i+"]":i;if(a instanceof Array){for(var s=0,u=a;s<u.length;s++){var l=u[s];n.append(o+"[]",l)}}else if(t&&typeof a==="object"&&(!(t instanceof Array)||!t.includes(i))){if(a!==null){convertFormData(a,t,n,__spreadArrays$2(r,[i]))}}else{n.append(o,a)}}));return n}function encodeQueryValue(e,t){return encodeURIComponent(e)+"="+encodeURIComponent(typeof t==="object"?JSON.stringify(t):""+t)}function convertFormUrl(e){return Object.keys(e).map((function(t){var n=e[t];if(n instanceof Array){return n.map((function(e){return encodeQueryValue(t,e)})).join("&")}return encodeQueryValue(t,n)})).join("&")}var factory=Wretcher.factory;factory["default"]=Wretcher.factory;var appendToMap=function(e,t,n){var r=e.get(t);if(!r){e.set(t,[n])}else if(!r.includes(n)){r.push(n)}};var debounce=function(e,t){var n;return function(){var r=[];for(var i=0;i<arguments.length;i++){r[i]=arguments[i]}if(n){clearTimeout(n)}n=setTimeout((function(){n=0;e.apply(void 0,r)}),t)}};var isConnected=function(e){return!("isConnected"in e)||e.isConnected};var cleanupElements=debounce((function(e){for(var t=0,n=e.keys();t<n.length;t++){var r=n[t];e.set(r,e.get(r).filter(isConnected))}}),2e3);var stencilSubscription=function(e){var t=e.on;var n=new Map;if(typeof getRenderingRef==="function"){t("dispose",(function(){n.clear()}));t("get",(function(e){var t=getRenderingRef();if(t){appendToMap(n,e,t)}}));t("set",(function(e){var t=n.get(e);if(t){n.set(e,t.filter(forceUpdate))}cleanupElements(n)}));t("reset",(function(){n.forEach((function(e){return e.forEach(forceUpdate)}));cleanupElements(n)}))}};var createObservableMap=function(e,t){if(t===void 0){t=function(e,t){return e!==t}}var n=new Map(Object.entries(e!==null&&e!==void 0?e:{}));var r={dispose:[],get:[],set:[],reset:[]};var i=function(){n=new Map(Object.entries(e!==null&&e!==void 0?e:{}));r.reset.forEach((function(e){return e()}))};var a=function(){r.dispose.forEach((function(e){return e()}));i()};var o=function(e){r.get.forEach((function(t){return t(e)}));return n.get(e)};var s=function(e,i){var a=n.get(e);if(t(i,a,e)){n.set(e,i);r.set.forEach((function(t){return t(e,i,a)}))}};var u=typeof Proxy==="undefined"?{}:new Proxy(e,{get:function(e,t){return o(t)},ownKeys:function(e){return Array.from(n.keys())},getOwnPropertyDescriptor:function(){return{enumerable:true,configurable:true}},has:function(e,t){return n.has(t)},set:function(e,t,n){s(t,n);return true}});var l=function(e,t){r[e].push(t);return function(){removeFromArray(r[e],t)}};var c=function(t,n){var r=l("set",(function(e,r){if(e===t){n(r)}}));var i=l("reset",(function(){return n(e[t])}));return function(){r();i()}};var d=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e.forEach((function(e){if(e.set){l("set",e.set)}if(e.get){l("get",e.get)}if(e.reset){l("reset",e.reset)}}))};return{state:u,get:o,set:s,on:l,onChange:c,use:d,dispose:a,reset:i}};var removeFromArray=function(e,t){var n=e.indexOf(t);if(n>=0){e[n]=e[e.length-1];e.length--}};var createStore=function(e,t){var n=createObservableMap(e,t);stencilSubscription(n);return n};function createCommonjsModule(e,t,n){return n={path:t,exports:{},require:function(e,t){return commonjsRequire()}},e(n,n.exports),n.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var _function=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:true});t.bindTo_=t.bind_=t.hole=t.pipe=t.untupled=t.tupled=t.absurd=t.decrement=t.increment=t.tuple=t.flow=t.flip=t.constVoid=t.constUndefined=t.constNull=t.constFalse=t.constTrue=t.constant=t.not=t.unsafeCoerce=t.identity=void 0;function n(e){return e}t.identity=n;t.unsafeCoerce=n;function r(e){return function(t){return!e(t)}}t.not=r;function i(e){return function(){return e}}t.constant=i;t.constTrue=i(true);t.constFalse=i(false);t.constNull=i(null);t.constUndefined=i(undefined);t.constVoid=t.constUndefined;function a(e){return function(t,n){return e(n,t)}}t.flip=a;function o(e,t,n,r,i,a,o,s,u){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return a(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return o(a(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(o(a(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return u(s(o(a(i(r(n(t(e.apply(this,arguments)))))))))}}return}t.flow=o;function s(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e}t.tuple=s;function u(e){return e+1}t.increment=u;function l(e){return e-1}t.decrement=l;function c(e){throw new Error("Called `absurd` function which should be uncallable")}t.absurd=c;function d(e){return function(t){return e.apply(void 0,t)}}t.tupled=d;function f(e){return function(){var t=[];for(var n=0;n<arguments.length;n++){t[n]=arguments[n]}return e(t)}}t.untupled=f;function p(e,t,n,r,i,a,o,s,u,l,c,d,f,p,h,g,v,m,y,b){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return a(i(r(n(t(e)))));case 7:return o(a(i(r(n(t(e))))));case 8:return s(o(a(i(r(n(t(e)))))));case 9:return u(s(o(a(i(r(n(t(e))))))));case 10:return l(u(s(o(a(i(r(n(t(e)))))))));case 11:return c(l(u(s(o(a(i(r(n(t(e))))))))));case 12:return d(c(l(u(s(o(a(i(r(n(t(e)))))))))));case 13:return f(d(c(l(u(s(o(a(i(r(n(t(e))))))))))));case 14:return p(f(d(c(l(u(s(o(a(i(r(n(t(e)))))))))))));case 15:return h(p(f(d(c(l(u(s(o(a(i(r(n(t(e))))))))))))));case 16:return g(h(p(f(d(c(l(u(s(o(a(i(r(n(t(e)))))))))))))));case 17:return v(g(h(p(f(d(c(l(u(s(o(a(i(r(n(t(e))))))))))))))));case 18:return m(v(g(h(p(f(d(c(l(u(s(o(a(i(r(n(t(e)))))))))))))))));case 19:return y(m(v(g(h(p(f(d(c(l(u(s(o(a(i(r(n(t(e))))))))))))))))));case 20:return b(y(m(v(g(h(p(f(d(c(l(u(s(o(a(i(r(n(t(e)))))))))))))))))))}return}t.pipe=p;t.hole=c;var h=function(e,t,n){var r;return Object.assign({},e,(r={},r[t]=n,r))};t.bind_=h;var g=function(e){return function(t){var n;return n={},n[e]=t,n}};t.bindTo_=g}));var Option=createCommonjsModule((function(e,t){Object.defineProperty(t,"__esModule",{value:true});t.getApplySemigroup=t.getOrd=t.getEq=t.getShow=t.URI=t.wilt=t.wither=t.sequence=t.traverse=t.partitionMap=t.partition=t.filterMap=t.filter=t.separate=t.compact=t.reduceRight=t.foldMap=t.reduce=t.duplicate=t.extend=t.throwError=t.zero=t.alt=t.altW=t.flatten=t.chainFirst=t.chain=t.of=t.apSecond=t.apFirst=t.ap=t.map=t.chainNullableK=t.mapNullable=t.fromNullableK=t.getOrElse=t.getOrElseW=t.toUndefined=t.toNullable=t.fold=t.fromEither=t.getRight=t.getLeft=t.tryCatch=t.fromPredicate=t.fromNullable=t.some=t.none=t.isNone=t.isSome=void 0;t.sequenceArray=t.traverseArray=t.traverseArrayWithIndex=t.apS=t.bind=t.bindTo=t.Do=t.getRefinement=t.exists=t.elem=t.option=t.MonadThrow=t.Witherable=t.Traversable=t.Filterable=t.Compactable=t.Extend=t.Alternative=t.Alt=t.Foldable=t.Monad=t.Applicative=t.Functor=t.getMonoid=t.getLastMonoid=t.getFirstMonoid=t.getApplyMonoid=void 0;var n=function(e){return e._tag==="Some"};t.isSome=n;var r=function(e){return e._tag==="None"};t.isNone=r;t.none={_tag:"None"};var i=function(e){return{_tag:"Some",value:e}};t.some=i;function a(e){return e==null?t.none:t.some(e)}t.fromNullable=a;function o(e){return function(n){return e(n)?t.some(n):t.none}}t.fromPredicate=o;function s(e){try{return t.some(e())}catch(e){return t.none}}t.tryCatch=s;function u(e){return e._tag==="Right"?t.none:t.some(e.left)}t.getLeft=u;function l(e){return e._tag==="Left"?t.none:t.some(e.right)}t.getRight=l;t.fromEither=l;function c(e,n){return function(r){return t.isNone(r)?e():n(r.value)}}t.fold=c;function d(e){return t.isNone(e)?null:e.value}t.toNullable=d;function f(e){return t.isNone(e)?undefined:e.value}t.toUndefined=f;var p=function(e){return function(n){return t.isNone(n)?e():n.value}};t.getOrElseW=p;t.getOrElse=t.getOrElseW;function h(e){return function(){var t=[];for(var n=0;n<arguments.length;n++){t[n]=arguments[n]}return a(e.apply(void 0,t))}}t.fromNullableK=h;t.mapNullable=g;function g(e){return function(n){return t.isNone(n)?t.none:a(e(n.value))}}t.chainNullableK=g;var v=function(e,n){return _function.pipe(e,t.map(n))};var m=function(e,n){return _function.pipe(e,t.ap(n))};var y=function(e,n){return _function.pipe(e,t.chain(n))};var b=function(e,n,r){return _function.pipe(e,t.reduce(n,r))};var S=function(e){var n=t.foldMap(e);return function(e,t){return _function.pipe(e,n(t))}};var w=function(e,n,r){return _function.pipe(e,t.reduceRight(n,r))};var _=function(e){var n=t.traverse(e);return function(e,t){return _function.pipe(e,n(t))}};var x=function(e,n){return _function.pipe(e,t.alt(n))};var C=function(e,n){return _function.pipe(e,t.filter(n))};var I=function(e,n){return _function.pipe(e,t.filterMap(n))};var T=function(e,n){return _function.pipe(e,t.extend(n))};var E=function(e,n){return _function.pipe(e,t.partition(n))};var A=function(e,n){return _function.pipe(e,t.partitionMap(n))};var F=function(e){var n=t.wither(e);return function(e,t){return _function.pipe(e,n(t))}};var P=function(e){var n=t.wilt(e);return function(e,t){return _function.pipe(e,n(t))}};var N=function(e){return function(n){return t.isNone(n)?t.none:t.some(e(n.value))}};t.map=N;var D=function(e){return function(n){return t.isNone(n)?t.none:t.isNone(e)?t.none:t.some(n.value(e.value))}};t.ap=D;var k=function(e){return _function.flow(t.map((function(e){return function(){return e}})),t.ap(e))};t.apFirst=k;var U=function(e){return _function.flow(t.map((function(){return function(e){return e}})),t.ap(e))};t.apSecond=U;t.of=t.some;var O=function(e){return function(n){return t.isNone(n)?t.none:e(n.value)}};t.chain=O;var R=function(e){return t.chain((function(n){return _function.pipe(e(n),t.map((function(){return n})))}))};t.chainFirst=R;t.flatten=t.chain(_function.identity);var M=function(e){return function(n){return t.isNone(n)?e():n}};t.altW=M;t.alt=t.altW;var L=function(){return t.none};t.zero=L;var B=function(){return t.none};t.throwError=B;var j=function(e){return function(n){return t.isNone(n)?t.none:t.some(e(n))}};t.extend=j;t.duplicate=t.extend(_function.identity);var V=function(e,n){return function(r){return t.isNone(r)?e:n(e,r.value)}};t.reduce=V;var z=function(e){return function(n){return function(r){return t.isNone(r)?e.empty:n(r.value)}}};t.foldMap=z;var H=function(e,n){return function(r){return t.isNone(r)?e:n(r.value,e)}};t.reduceRight=H;t.compact=t.flatten;var q={left:t.none,right:t.none};var $=function(e){var n=_function.pipe(e,t.map((function(e){return{left:u(e),right:l(e)}})));return t.isNone(n)?q:n.value};t.separate=$;var W=function(e){return function(n){return t.isNone(n)?t.none:e(n.value)?n:t.none}};t.filter=W;var G=function(e){return function(n){return t.isNone(n)?t.none:e(n.value)}};t.filterMap=G;var K=function(e){return function(t){return{left:C(t,(function(t){return!e(t)})),right:C(t,e)}}};t.partition=K;var J=function(e){return _function.flow(t.map(e),t.separate)};t.partitionMap=J;var X=function(e){return function(n){return function(r){return t.isNone(r)?e.of(t.none):e.map(n(r.value),t.some)}}};t.traverse=X;var Q=function(e){return function(n){return t.isNone(n)?e.of(t.none):e.map(n.value,t.some)}};t.sequence=Q;var Y=function(e){return function(n){return function(r){return t.isNone(r)?e.of(t.none):n(r.value)}}};t.wither=Y;var Z=function(e){return function(n){return function(r){return t.isNone(r)?e.of({left:t.none,right:t.none}):e.map(n(r.value),(function(e){return{left:u(e),right:l(e)}}))}}};t.wilt=Z;t.URI="Option";function ee(e){return{show:function(n){return t.isNone(n)?"none":"some("+e.show(n.value)+")"}}}t.getShow=ee;function te(e){return{equals:function(n,r){return n===r||(t.isNone(n)?t.isNone(r):t.isNone(r)?false:e.equals(n.value,r.value))}}}t.getEq=te;function ne(e){return{equals:te(e).equals,compare:function(n,r){return n===r?0:t.isSome(n)?t.isSome(r)?e.compare(n.value,r.value):1:-1}}}t.getOrd=ne;function re(e){return{concat:function(n,r){return t.isSome(n)&&t.isSome(r)?t.some(e.concat(n.value,r.value)):t.none}}}t.getApplySemigroup=re;function ie(e){return{concat:re(e).concat,empty:t.some(e.empty)}}t.getApplyMonoid=ie;function ae(){return{concat:function(e,n){return t.isNone(e)?n:e},empty:t.none}}t.getFirstMonoid=ae;function oe(){return{concat:function(e,n){return t.isNone(n)?e:n},empty:t.none}}t.getLastMonoid=oe;function se(e){return{concat:function(n,r){return t.isNone(n)?r:t.isNone(r)?n:t.some(e.concat(n.value,r.value))},empty:t.none}}t.getMonoid=se;t.Functor={URI:t.URI,map:v};t.Applicative={URI:t.URI,map:v,ap:m,of:t.of};t.Monad={URI:t.URI,map:v,ap:m,of:t.of,chain:y};t.Foldable={URI:t.URI,reduce:b,foldMap:S,reduceRight:w};t.Alt={URI:t.URI,map:v,alt:x};t.Alternative={URI:t.URI,map:v,ap:m,of:t.of,alt:x,zero:t.zero};t.Extend={URI:t.URI,map:v,extend:T};t.Compactable={URI:t.URI,compact:t.compact,separate:t.separate};t.Filterable={URI:t.URI,map:v,compact:t.compact,separate:t.separate,filter:C,filterMap:I,partition:E,partitionMap:A};t.Traversable={URI:t.URI,map:v,reduce:b,foldMap:S,reduceRight:w,traverse:_,sequence:t.sequence};t.Witherable={URI:t.URI,map:v,reduce:b,foldMap:S,reduceRight:w,traverse:_,sequence:t.sequence,compact:t.compact,separate:t.separate,filter:C,filterMap:I,partition:E,partitionMap:A,wither:F,wilt:P};t.MonadThrow={URI:t.URI,map:v,ap:m,of:t.of,chain:y,throwError:t.throwError};t.option={URI:t.URI,map:v,of:t.of,ap:m,chain:y,reduce:b,foldMap:S,reduceRight:w,traverse:_,sequence:t.sequence,zero:t.zero,alt:x,extend:T,compact:t.compact,separate:t.separate,filter:C,filterMap:I,partition:E,partitionMap:A,wither:F,wilt:P,throwError:t.throwError};function ue(e){return function(n,r){return t.isNone(r)?false:e.equals(n,r.value)}}t.elem=ue;function le(e){return function(n){return t.isNone(n)?false:e(n.value)}}t.exists=le;function ce(e){return function(n){return t.isSome(e(n))}}t.getRefinement=ce;t.Do=t.of({});var de=function(e){return t.map(_function.bindTo_(e))};t.bindTo=de;var fe=function(e,n){return t.chain((function(r){return _function.pipe(n(r),t.map((function(t){return _function.bind_(r,e,t)})))}))};t.bind=fe;var pe=function(e,n){return _function.flow(t.map((function(t){return function(n){return _function.bind_(t,e,n)}})),t.ap(n))};t.apS=pe;var he=function(e){return function(n){var r=[];for(var i=0;i<n.length;i++){var a=e(i,n[i]);if(t.isNone(a)){return t.none}r.push(a.value)}return t.some(r)}};t.traverseArrayWithIndex=he;var ge=function(e){return t.traverseArrayWithIndex((function(t,n){return e(n)}))};t.traverseArray=ge;t.sequenceArray=t.traverseArray(_function.identity)}));function e(e){this.message=e}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var n=String(t).replace(/=+$/,"");if(n.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,i,a=0,o=0,s="";i=n.charAt(o++);~i&&(r=a%4?64*r+i:i,a++%4)?s+=String.fromCharCode(255&r>>(-2*a&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return s};function t(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return r(t)}}function n(e){this.message=e}function o(e,r){if("string"!=typeof e)throw new n("Invalid token specified");var i=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(".")[i]))}catch(e){throw new n("Invalid token specified: "+e.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";var SuperSelectionApi=function(){function e(){}e.prototype.getAustralianFundsAsync=function(e,t){if(t===void 0){t=false}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,buildBackendApiClient().url("super-choice/australian-funds?"+this.toQueryString(t,e)).get().notFound((function(){throw new Error("Failed to fetch the list of australian super funds.")})).json()]}))}))};e.prototype.getAppStateAsync=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,buildBackendApiClient().url("client-app-state").get().notFound((function(){throw new Error("Failed to fetch application configuration.")})).json()]}))}))};e.prototype.toSearchFilterQueryString=function(e){switch(e.type){case"partialMatch":return"search="+e.searchString+"&maxRecordCount="+e.maxRecordCount;case"usiMatch":return"usi="+e.usi}};e.prototype.toQueryString=function(e,t){var n=this.toSearchFilterQueryString(t);var r=e?"includeInactive=true":"";var i=function(e){return e&&e.length};return[n,r].filter(i).join("&")};return e}();var superSelectionApi=new SuperSelectionApi;var initialState={apiBaseUrl:Option.none,appBaseUrl:Option.none,profileId:Option.none,jwt:Option.none,superBuyer:Option.none,promotedFunds:Option.none,accountConfiguration:Option.none,hasSuccessPageBeenAcknowledged:false,hasSuperSelectionBeenSubmitted:false};var SuperSelectionAppService=function(){function e(){var e=this;var t=createStore(initialState),n=t.state,r=t.onChange;this._state=n;this._onChange=r;r("jwt",(function(t){e._state.profileId=_function.pipe(t,Option.chain((function(e){return Option.fromNullable(o(e).sub)})))}))}Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"onChange",{get:function(){return this._onChange},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"superBuyer",{get:function(){if(Option.isNone(this._state.superBuyer)){throw Error("User information is not set")}return this._state.superBuyer.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"apiBaseUrl",{get:function(){if(Option.isNone(this._state.apiBaseUrl)){throw Error("API base URL is not set")}return this._state.apiBaseUrl.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"appBaseUrl",{get:function(){if(Option.isNone(this._state.appBaseUrl)){throw Error("App base URL is not set")}return this._state.appBaseUrl.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"promotedFunds",{get:function(){if(Option.isNone(this._state.promotedFunds)){throw Error("Promoted Funds is not set")}return this._state.promotedFunds.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"profileId",{get:function(){if(Option.isNone(this._state.profileId)){throw Error("Failed to get Profile ID from JWT")}return this._state.profileId.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"defaultFundUsi",{get:function(){return _function.pipe(this._state.accountConfiguration,Option.map((function(e){return Option.fromNullable(e.defaultFundUsi)})),Option.flatten)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"accountIdOrDefault",{get:function(){return _function.pipe(this._state.accountConfiguration,Option.map((function(e){return e.accountId})),Option.getOrElse((function(){return""})))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"partnerIdOrDefault",{get:function(){return _function.pipe(this._state.superBuyer,Option.map((function(e){return e.partnerId})),Option.getOrElse((function(){return""})))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"jwt",{get:function(){if(Option.isNone(this._state.jwt)){throw Error("No authentication information was found")}return this._state.jwt.value},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"showSmsfNotSupported",{get:function(){return _function.pipe(this._state.superBuyer,Option.map((function(e){return e.showSmsfNotSupported})),Option.getOrElse((function(){return false})))},enumerable:false,configurable:true});e.prototype.completeSuperSelectionFlow=function(){this._state.hasSuccessPageBeenAcknowledged=true};e.prototype.markSuperSelectionAsSubmitted=function(){this._state.hasSuperSelectionBeenSubmitted=true};e.prototype.loadAppStateAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,superSelectionApi.getAppStateAsync()];case 1:e=t.sent();this._state.accountConfiguration=Option.fromNullable(e.accountConfiguration);this._state.superBuyer=Option.fromNullable(e.superBuyer);this._state.promotedFunds=Option.fromNullable(e.promotedFunds);return[2]}}))}))};return e}();var superSelectionAppService=new SuperSelectionAppService;function buildBackendApiClient(){var e=superSelectionAppService.jwt;var t=superSelectionAppService.profileId;var n=superSelectionAppService.accountIdOrDefault;var r=superSelectionAppService.partnerIdOrDefault;return factory(superSelectionAppService.apiBaseUrl).headers({Authorization:"Bearer "+e,"X-PROFILE-ID":t,"X-PARTNER-ID":r,"X-ACCOUNT-ID":n})}var EventTrackingApi=function(){function e(){}Object.defineProperty(e,"Instance",{get:function(){return this.instance||(this.instance=new this)},enumerable:false,configurable:true});e.prototype.PostAnalyticsEventAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("analytics-events").post(e).res()]}))}))};return e}();var EventTrackingService=function(){function e(){this.eventTrackingApi=EventTrackingApi.Instance}Object.defineProperty(e,"Instance",{get:function(){return this.instance||(this.instance=new this)},enumerable:false,configurable:true});e.prototype.TrackFinancialProductViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({FinancialProductViewed:e})]}))}))};e.prototype.TrackSuperFundPdsViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundPdsViewed:e})]}))}))};e.prototype.TrackFinancialProductAcceptedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({FinancialProductAccepted:e})]}))}))};e.prototype.TrackFinancialProductRejectedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({FinancialProductRejected:e})]}))}))};e.prototype.TrackSuperFundPrivacyConfirmationAcceptedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundPrivacyConfirmationAccepted:e})]}))}))};e.prototype.TrackPromotedSuperFundDetailViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDetailViewed:{PromotedFund:e}})]}))}))};e.prototype.TrackMyOwnSuperFundDetailViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDetailViewed:{MyOwnFund:e}})]}))}))};e.prototype.TrackSmsfSuperFundDetailViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDetailViewed:{Smsf:e}})]}))}))};e.prototype.TrackDefaultSuperFundDetailViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDetailViewed:{DefaultFund:e}})]}))}))};e.prototype.TrackSuperFundPanelViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundPanelViewed:e})]}))}))};e.prototype.TrackSuperFundNominationViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundNominationViewed:e})]}))}))};e.prototype.TrackSuperFundNominationDeclinedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundNominationDeclined:e})]}))}))};e.prototype.TrackSuperFundDisclaimerViewedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDisclaimerViewed:e})]}))}))};e.prototype.TrackSuperFundDisclaimerAcceptedAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync({SuperFundDisclaimerAccepted:e})]}))}))};e.prototype.trackEventAsync=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,this.eventTrackingApi.PostAnalyticsEventAsync({event:e})];case 1:n.sent();return[3,3];case 2:t=n.sent();return[2];case 3:return[2]}}))}))};return e}();function appReady(){postMessage({type:"appReady"})}function postMessage(e,t){if(t===undefined)t="*";e.sender="flare";window.parent.postMessage(e,t)}function resize(e,t){postMessage({type:"contentResized",height:e,width:t})}function navigation(e){postMessage({type:"pageNavigated",url:e})}function complete(){postMessage({type:"complete"})}function submitSuccess(){postMessage({type:"submitSuccess"})}var iframe={appReady:appReady,resize:resize,navigation:navigation,complete:complete,submitSuccess:submitSuccess};var initial={handleSubmitFn:function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2]}))}))},fundName:"",promotedFundId:undefined};var state=createStore(initial).state;var SuperSelectionAppRoutes;(function(e){e["ConsentPage"]="/consent";e["ExistingChoicePage"]="/existing";e["ChoicePage"]="/";e["SlateJoin"]="/slate/join/";e["PromotedFundJoin"]="/promoted-fund/join";e["MyOwnFund"]="/super-choice/my-own-fund/";e["SelfManagedFund"]="/super-choice/smsf/";e["DefaultFund"]="/super-choice/default/";e["StandardChoice"]="/standard-choice/";e["Success"]="/success/"})(SuperSelectionAppRoutes||(SuperSelectionAppRoutes={}));var superSelectionAppStencilRoutes=[h("stencil-route",{url:SuperSelectionAppRoutes.ConsentPage,component:"sss-consent-page"}),h("stencil-route",{url:SuperSelectionAppRoutes.ExistingChoicePage,component:"sss-existing-choice-page"}),h("stencil-route",{exact:true,url:SuperSelectionAppRoutes.ChoicePage,component:"sss-super-choice-page"}),h("stencil-route",{url:SuperSelectionAppRoutes.SlateJoin,component:"sss-slate-join-page"}),h("stencil-route",{url:SuperSelectionAppRoutes.PromotedFundJoin,component:"sss-promoted-fund-join-page"}),h("stencil-route",{url:SuperSelectionAppRoutes.MyOwnFund,component:"sss-my-own-fund"}),h("stencil-route",{url:SuperSelectionAppRoutes.SelfManagedFund,component:"sss-self-managed-fund"}),h("stencil-route",{url:SuperSelectionAppRoutes.DefaultFund,component:"sss-default-fund"}),h("stencil-route",{url:SuperSelectionAppRoutes.StandardChoice,component:"sss-standard-choice-form"}),h("stencil-route",{url:SuperSelectionAppRoutes.Success,component:"sss-success"})];var NavigationService=function(){function e(){}e.prototype.navigateInternally=function(e,t){var n=""+this.appBaseUrl+this.toRouteWithLeadingSlash(t);iframe.navigation(n);e.push(n)};e.prototype.navigateInternallyToStandardChoice=function(e){state.handleSubmitFn=e.handleSubmitFn;state.fundName=e.fundName;state.promotedFundId=e.promotedFundId;this.navigateInternally(e.history,SuperSelectionAppRoutes.StandardChoice)};e.prototype.toExternalUrl=function(e){var t=new URL(e);t.searchParams.append("_extnav","true");return t.href};Object.defineProperty(e.prototype,"appBaseUrl",{get:function(){var e=superSelectionAppService.appBaseUrl;return e.replace(/\/$/,"")},enumerable:false,configurable:true});e.prototype.toRouteWithLeadingSlash=function(e){return e.length>0&&e[0]==="/"?e:"/"+e};return e}();var navigationService=new NavigationService;var Consent=function(){function e(e){registerInstance(this,e);this.promotedFunds=superSelectionAppService.promotedFunds;this.eventTrackingService=EventTrackingService.Instance}e.prototype.componentDidLoad=function(){var e={promotedFundsShown:this.promotedFunds};return this.eventTrackingService.TrackSuperFundDisclaimerViewedAsync(e)};e.prototype.render=function(){var e=this;return h("div",null,h("div",{class:"text-2xl sm:text-3xl font-bold text-center leading-8"},"Important information about super"),h("div",{class:"sm:text-lg text-gray-600 mt-3 sm:mt-4 max-w-800 text-center leading-7 sm:leading-8"},"The choice of superannuation fund is an important personal financial decision. Next, you’ll be asked to nominate a super fund to receive your employer contributions."),h("div",{class:"flex justify-center mt-8 sm:mt-12"},h("div",{class:"border shadow-sm p-4 pb-6 sm:p-6 sm:pb-8 max-w-560 rounded-lg"},h("div",{class:"sm:text-lg font-bold leading-6"},"By clicking “Continue” you acknowledge that:"),h("ul",{class:"list-disc list-outside ml-6 mt-3 mb-6 space-y-2 text-sm leading-6"},h("li",null,"Flare (we/us) provides this paperless employee management service, will feature superannuation funds and offer you employee benefits that you may be interested in;"),h("li",null,"all content contained in the following pages does not take into account any of your objectives, financial situation or needs and does not constitute financial product advice;"),h("li",null,"in featuring any superannuation funds, we, the technology partner you are accessing us via, or your employer, are not providing any opinion or recommendation (actual or implied) in relation to the suitability or appropriateness of the featured funds;"),h("li",null,"if you do choose one of the featured superannuation funds, we and our associates will normally receive a fee for you doing so.")),h("sss-button",{fillWidth:true,promiseFn:function(){return e.handleSuperFundDisclaimerAccepted()}},"Continue"))))};e.prototype.handleSuperFundDisclaimerAccepted=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e={promotedFundsShown:this.promotedFunds};return[4,this.eventTrackingService.TrackSuperFundDisclaimerAcceptedAsync(e)];case 1:t.sent();navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ChoicePage);return[2]}}))}))};return e}();var CustomFundTypes;(function(e){e["MyOwnFund"]="Your current super fund";e["DefaultFund"]="Your employer's default fund";e["SelfManagedFund"]="Your self-managed super fund"})(CustomFundTypes||(CustomFundTypes={}));var initialStateCustomFund={continueAllowed:false,nextRoute:"/",myOwnFundForm:{fundUsi:none,fundName:none,memberNumber:none},selfManagedFundForm:{fundName:"",fundAbn:"",fundEsa:"",addressLine1:"",addressLine2:"",state:"",postcode:"",city:"",bankAccountName:"",bsb:"",bankAccountNumber:""},currentCustomFundType:CustomFundTypes.MyOwnFund,customFunds:[{label:CustomFundTypes.MyOwnFund,value:SuperSelectionAppRoutes.MyOwnFund},{label:CustomFundTypes.SelfManagedFund,value:SuperSelectionAppRoutes.SelfManagedFund},{label:CustomFundTypes.DefaultFund,value:SuperSelectionAppRoutes.DefaultFund}]};var _j=createStore(initialStateCustomFund),state$1=_j.state,reset=_j.reset;var customFundOptions=state$1.customFunds;var CustomFund=function(){function e(e){registerInstance(this,e);this.currentCustomFund=customFundOptions[0];this.fundOptionsList=customFundOptions;this.showFundOptionsSelection=false}e.prototype.componentWillLoad=function(){var e="";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;this.currentCustomFund=customFundOptions.find((function(t){return t.value===e}))||customFundOptions[0];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",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 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-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-sm"},this.fundOptionsList.map((function(t){return h("li",{class:"text-gray-900 cursor-default select-none relative py-2 pl-3 pr-9 hover:bg-primary-hover",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 superSelectionApi.getAustralianFundsAsync({type:"partialMatch",searchString:e,maxRecordCount:t})};e.prototype.getActiveFundByUsiAsync=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,superSelectionApi.getAustralianFundsAsync({type:"usiMatch",usi:e})];case 1:t=n.sent();if(t.length===1){return[2,Option.some(t[0])]}return[2,Option.none]}}))}))};e.prototype.getFundByUsiAsync=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,superSelectionApi.getAustralianFundsAsync({type:"usiMatch",usi:e},true)];case 1:t=n.sent();if(t.length===1){return[2,Option.some(t[0])]}return[2,Option.none]}}))}))};return e}();var australianFundLookupService=new AustralianFundLookupService;var CustomFundChoiceApi=function(){function e(){}e.prototype.submitDefaultFundChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/default").post(e).badRequest((function(){throw new Error("Failed to process default fund join request")})).text()]}))}))};e.prototype.submitCustomFundChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/custom-fund").post(e).badRequest((function(){throw new Error("Failed to process custom fund join request")})).text()]}))}))};e.prototype.submitSelfManagedFundChoiceAsync=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,buildBackendApiClient().url("super-choice/smsf").post(e).badRequest((function(){throw new Error("Failed to process SMSF choice request")})).text()]}))}))};return e}();var customFundChoiceApi=new CustomFundChoiceApi;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.getActiveFundByUsiAsync(e.value)];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})};e.prototype.render=function(){var e=this;return h(Host,null,h("sss-header-section",{currentPage:"own-fund"}),h("div",{class:"flex justify-center mt-11"},h("sss-custom-fund",null,h("div",{class:"p-4 sm:p-6 border shadow-sm rounded-lg"},h("p",{class:"sm:text-lg font-bold mb-3"},"Fund details"),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"},this.isDefaultFundExists&&!this.isInvalidDefaultFund?h("span",null,"By choosing to join your employer’s default super fund, you acknowledge that your application to join is subject to Trustee approval."):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 defaut 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-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-sm"},this.defaultFund.usi)))),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",{fillWidth:true,promiseFn:function(){return e.handleSubmitForm()}},"Continue")),h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("sss-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",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({standardChoiceFormSignature:t})];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.filteredOptions=e;t.highlightedOptionIndex=undefined;t.searchState="done"};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.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-hover py-1.5 pl-4":true,"bg-primary-base":t.isOptionSelected(e)},onClick:function(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.highlightNextItem();return true;case i:t.highlightPreviousItem();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.highlightPreviousItem=function(){if(t.filteredOptions.length===0){return}t.highlightedOptionIndex=t.highlightedOptionIndex===undefined?0:Math.max(t.highlightedOptionIndex-1,0)};this.highlightNextItem=function(){if(t.filteredOptions.length===0){return}t.highlightedOptionIndex=t.highlightedOptionIndex===undefined?0:Math.min(t.highlightedOptionIndex+1,t.filteredOptions.length-1)};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()};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.highlightedOptionIndex=undefined;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",{type:"text",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full 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 Slate={Id:"slate",Name:"Slate Super",PdsUrl:"https://slate.co/pds/?utm_source=flare&utm_medium=superselection",Usi:"32367272075001",DiversaAbn:"49 006 421 638"};var AustralianRetirementTrust={Id:"australian-retirement-trust",Name:"Australian Retirement Trust",PdsUrl:"https://www.australianretirementtrust.com.au/library/media/pdfs/pds/super-savings-product-disclosure-statement-and-membership-form.pdf",Abn:"60 905 115 063"};var Aware={Id:"aware",Name:"Aware Super",PdsUrl:"https://aware.com.au/member/forms-and-resources/pds/FSS",Abn:"53 226 460 365"};var Active={Id:"active",Name:"Active Super",PdsUrl:"https://www.activesuper.com.au/pds",Abn:"28 901 371 321"};var PromotedFundIdList=[{dtoPropName:"slate",id:Slate.Id},{dtoPropName:"australianRetirementTrust",id:AustralianRetirementTrust.Id},{dtoPropName:"aware",id:Aware.Id},{dtoPropName:"active",id:Active.Id}];var getFundNameById=function(e){switch(e){case Slate.Id:return Slate.Name;case AustralianRetirementTrust.Id:return AustralianRetirementTrust.Name;case Aware.Id:return Aware.Name;case Active.Id:return Active.Name;default:return}};var getLogoSrc=function(e){var t="";switch(e){case Slate.Id:t="logo-slate.png";break;case AustralianRetirementTrust.Id:t="logo-art.svg";break;case Aware.Id:t="logo-aware.svg";break;case Active.Id:t="logo-active.svg";break;default:return}if(t!=="")return getAssetPath("assets/"+t)};function getPromotedFundUsi(e){if("slate"in e){return none}else if("australianRetirementTrust"in e){return some(e.australianRetirementTrust.usi)}else if("aware"in e){return some(e.aware.usi)}else if("active"in e){return some(e.active.usi)}else{return none}}function getSuperChoiceUsi(e){if("promoted"in e){return getPromotedFundUsi(e.promoted)}else if("myOwnFund"in e){return some(e.myOwnFund.usi)}else if("smsf"in e){return none}else if("default"in e){return some(e.default.usi)}else{return none}}function getPromotedFundMemberNumber(e){if("slate"in e){return some(e.slate.memberNumber)}else if("australianRetirementTrust"in e){return some(e.australianRetirementTrust.memberNumber)}else if("aware"in e){return some(e.aware.memberNumber)}else if("active"in e){return some(e.active.memberNumber)}else{return none}}function getSuperChoiceMemberNumber(e){if("promoted"in e){return getPromotedFundMemberNumber(e.promoted)}else if("myOwnFund"in e){return some(e.myOwnFund.memberNumber)}else if("smsf"in e){return none}else if("default"in e){return none}else{return none}}var ExistingFundService=function(){function e(){}e.prototype.GetExistingFundAsync=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,r,i,a,o,s,u,s,l,c;return __generator(this,(function(d){switch(d.label){case 0:n=superSelectionAppService.superBuyer.superChoice;r=(e=superSelectionAppService.superBuyer.superChoice)===null||e===void 0?void 0:e.choiceDetails;if(!n)return[2,none];if(!r)return[2,none];i=n.dateSubmitted==undefined?none:some(new Date(n.dateSubmitted));a=getSuperChoiceUsi(r);o=getSuperChoiceMemberNumber(r);if(!("promoted"in r))return[3,1];s=PromotedFundIdList.find((function(e){return e.dtoPropName in r.promoted}));if((s===null||s===void 0?void 0:s.id)==undefined)return[2,none];return[2,some({type:"Promoted Fund",id:s.id,name:(t=getFundNameById(s.id))!==null&&t!==void 0?t:"",usi:a,valid:"Active",memberNumber:o,lastNominatedAt:i})];case 1:if(!("smsf"in r))return[3,2];return[2,some({type:"Self Managed Fund",name:r.smsf.fundName,valid:"Unknown",lastNominatedAt:i})];case 2:if(!("myOwnFund"in r))return[3,4];u=r.myOwnFund.usi;return[4,this.getFundByUsiAsync(u)];case 3:s=d.sent();return[2,some({type:"My Own Fund",name:isSome(s)?s.value.productName:u,usi:a,valid:this.toFundValidState(s),memberNumber:o,lastNominatedAt:i})];case 4:if(!("default"in r))return[3,6];l=r.default.usi;return[4,this.getFundByUsiAsync(l)];case 5:c=d.sent();return[2,some({type:"Default Fund",name:isSome(c)?c.value.productName:l,usi:a,valid:this.toFundValidState(c),lastNominatedAt:i})];case 6: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.getFundByUsiAsync(e)};e.prototype.toFundValidState=function(e){if(isSome(e)){return e.value.isActive?"Active":"Inactive"}else{return"Unknown"}};return e}();var existingFundService=new ExistingFundService;var FeatureFlagService=function(){function e(){}e.isNewComplianceEnabled=function(){var e=["PARTNER-TEST-FLARE","962e142f-df98-460e-92ed-2c4e24149c91","8ad88c67-d446-4c30-8321-f896e1b7643b","d1bfe1c5-0cf4-46e3-9ecb-69a0aec86256","973c7953-a607-48b6-9bf9-9266ffd9c25c","cf602138-c843-4c4a-a407-635ba0bf9612","4257a264-863e-4e03-8b07-b9c0328c0557","df9b837f-7f38-41ff-9073-9265106eb231","d6855e49-0412-4600-9b66-c61f0dfc25df"];return e.includes(superSelectionAppService.partnerIdOrDefault)};return e}();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,FeatureFlagService.isNewComplianceEnabled()?SuperSelectionAppRoutes.ConsentPage:SuperSelectionAppRoutes.ChoicePage)}return[2]}}))}))};e.prototype.render=function(){var e=this;var t=function(e){return h("div",{class:"flex justify-center mt-6"},h("img",{class:"h-16 w-auto",alt:getFundNameById(e.id),src:getLogoSrc(e.id)}))};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-8 w-8 absolute "},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",class:"fill-primary-base"},h("path",{d:"M196.6 97.83C184.1 93.41 177.6 79.7 182 67.2C195.8 28.08 233.1 0 277.1 0C320.1 0 358.3 28.08 372.1 67.2C376.5 79.7 369.1 93.41 357.5 97.83C344.1 102.2 331.3 95.7 326.9 83.2C319.6 62.66 300 48 277.1 48C254.1 48 234.5 62.66 227.3 83.2C222.8 95.7 209.1 102.2 196.6 97.83H196.6zM400 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 264zM224 128H376.4C394 108.4 419.6 96 448 96H465.3C480.9 96 492.3 110.7 488.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 384H512C499.1 401.2 482.7 415.8 464 426.6V464C464 490.5 442.5 512 416 512H368C341.5 512 320 490.5 320 464V448H272V464C272 490.5 250.5 512 224 512H176C149.5 512 128 490.5 128 464V416C90.98 388.2 66.42 344.7 64.17 295.4C27.99 290.9 0 259.1 0 222.6C0 194.7 15.72 169.3 40.6 156.9L45.27 154.5C57.12 148.6 71.54 153.4 77.47 165.3C83.39 177.1 78.59 191.5 66.73 197.5L62.06 199.8C53.44 204.1 48 212.9 48 222.6C48 235.1 57.13 245.6 69.13 247.6C87.02 178.8 149.6 128 224 128V128zM224 176C162.1 176 112 226.1 112 288C112 324.6 129.5 357.1 156.8 377.6C168.9 386.7 176 400.9 176 416V464H224V448C224 421.5 245.5 400 272 400H320C346.5 400 368 421.5 368 448V464H416V426.6C416 409.5 425.1 393.6 439.1 385C453.1 377.5 464.6 367.3 473.6 355.2C482.7 343.1 496.9 336 512 336H528V271.9C510 270.9 493.1 259.9 486.7 243.2C478.9 225.4 466.6 209.1 451.2 198.4C435.7 186.8 428.8 167.1 433.4 148.3L434 146.1C425.5 148.6 418 153.5 412.2 160C403.1 170.2 390.1 176 376.4 176H224z"}))))};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-8 w-8 absolute "},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",class:"fill-primary-base"},h("path",{d:"M250.8 192h13.25v40C264 245.2 274.8 256 288 256s24.02-10.8 24.02-23.1V192h13.25c85.39 0 154.8-75.38 154.8-168c0-13.25-10.75-24-24-24H418.8c-55.26 0-103.4 31.75-130.8 79C260.7 31.75 212.5 0 157.3 0H120C106.8 0 96.01 10.75 96.01 23.1C96.01 116.6 165.4 192 250.8 192zM418.8 48h11.13c-9.876 54.75-53.01 96-104.5 96h-11.13C324.2 89.25 367.3 48 418.8 48zM157.3 48c51.51 0 94.64 41.25 104.5 96H250.7c-51.51 0-94.64-41.25-104.5-96H157.3zM551.1 312c-31.13-26.38-69.26-16.12-88.39-1.75l-60.38 45.5h-3.375c-.1251-38-30.5-67.88-69.13-67.88H186.7c-28.38 0-56.38 9.375-78.51 26.37L79.76 336H24C10.8 336 0 346.8 0 359.1S10.8 384 24 384l72-.0244l41.26-31.48C151.3 341.8 168.8 336 186.8 336h144c27.88 0 29 40.25-1.125 40.25h-59.88c-7.501 0-13.75 6.125-13.75 13.75c0 7.625 6.251 13.87 13.75 13.87h134.6c9.711 0 19.16-3.159 26.92-9l61.26-46.12c8.251-6.125 20.5-6.625 28.38 0c10.13 8.5 9.376 23.12-.8751 30.75l-100.6 75.5C411.7 460.8 402.3 464 392.6 464H24C10.8 464 0 474.8 0 487.1S10.8 512 24 512h368.8c20 0 39.38-6.5 55.26-18.5l100.8-75.88c16.63-12.5 26.5-31.5 27.13-52C576.7 345.1 567.8 325.5 551.1 312z"}))))};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-8 w-8 absolute "},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:"fill-primary-base"},h("path",{d:"M448 96h-64V64c0-35.35-28.65-64-64-64H192C156.7 0 128 28.65 128 64v32H64C28.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 96zM192 48h128c8.837 0 16 7.163 16 16v32h-160V64C176 55.16 183.2 48 192 48zM64 144h384c8.8 0 16 7.2 16 16v96h-416V160C48 151.2 55.2 144 64 144zM448 432H64c-8.8 0-16-7.2-16-16V304H192V320c0 17.67 14.33 32 32 32h64c17.67 0 32-14.33 32-32V304h144V416C464 424.8 456.8 432 448 432z"}))))};return h("div",null,h("div",{class:"text-2xl sm:text-3xl font-bold text-center"},"Your super choice"),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 rounded-lg text-center space-y-4"},function(){switch(e.existingFund.type){case"Promoted Fund":return h(t,{id:e.existingFund.id});case"Self Managed Fund":return h(r,null);case"My Own Fund":return h(n,null);case"Default Fund":return h(i,null)}}(),h("div",{class:"sm:text-lg font-bold leading-6"},this.existingFund.name),h("div",{class:"mt-8"},h("sss-button",{fillWidth:true,promiseFn:function(){return e.handleFundNominationAccepted()}},"Continue with this fund"))),h("div",{class:"mt-4"},h("sss-button",{fillWidth:true,variant:"secondary",promiseFn:function(){return e.handleFundNominationDeclined()}},"Choose another fund")))))};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,FeatureFlagService.isNewComplianceEnabled()?SuperSelectionAppRoutes.ConsentPage:SuperSelectionAppRoutes.ChoicePage);return[2]}}))}))};return e}();var FooterSection=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h("div",{class:"text-center text-gray-500 text-xs mt-8 sm:mt-20 w-full max-w-960 mx-auto"},h("span",null,"Powered by Flare"),h("p",{class:"block text-transparent"},"v",AppVersion),!FeatureFlagService.isNewComplianceEnabled()&&h("p",{class:"mt-4"},"This page contains factual information only and does not take into account your particular objectives, financial circumstances or needs. If you have questions or need help making a decision about your super fund, you should speak to a licensed financial advice provider. You should consider the relevant super fund's PDS and TMD (if applicable) in deciding whether to apply to join the super fund. Each of the advertised fund's PDS and TMD (if applicable) can be found in their advertisements above. If you are considering joining another fund you can find the PDS and TMD on the fund's website. Your employer and Flare do not endorse or accept responsibility for any financial product advice or services provided by the promoters or trustees of the advertised superannuation funds. Flare do not endorse or accept responsibility for any of their content shown about any of the advertised superannuation funds as they are merely passing on the content as provided without any changes. Flare do not express any opinion or make any recommendation about any of the advertised funds."))};return e}();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"),FeatureFlagService.isNewComplianceEnabled()&&h(Fragment,null,h("div",{class:"text-gray-600 sm:text-lg leading-7 sm:leading-8"},"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."),h("div",{class:"inline-flex mt-8 sm:mt-12 bg-primary-base rounded-lg p-0.5 whitespace-normal"},h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("button",{type:"button",class:{"py-2 text-sm font-medium w-auto px-3 sm:px-8 rounded-md h-full":true,"bg-white border-gray-200 text-gray-900 shadow-sm":this.currentPage==="choice","border border-transparent text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-focus focus:z-10 hover:bg-primary-hover":this.currentPage!=="choice"}},"Featured super funds")),h("stencil-route-link",{url:SuperSelectionAppRoutes.MyOwnFund},h("button",{type:"button",class:{"ml-0.5 rounded-md py-2 text-sm font-medium w-auto px-3 sm:px-8 h-full":true,"bg-white border-gray-200 text-gray-900 shadow-sm":this.currentPage==="own-fund","border border-transparent text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-focus focus:z-10 hover:bg-primary-hover":this.currentPage!=="own-fund"}},"Choose another fund"))))))};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 MyOwnFund=function(){function e(e){registerInstance(this,e);this.isNotAllInformationProvidedMessageVisible=false;this.isSubmitDisabled=true;this.eventTrackingService=EventTrackingService.Instance}e.prototype.componentDidLoad=function(){return this.eventTrackingService.TrackMyOwnSuperFundDetailViewedAsync({promotedFundsShown:superSelectionAppService.promotedFunds})};e.prototype.render=function(){var e=this;return h(Host,null,h("sss-header-section",{currentPage:"own-fund"}),h("div",{class:"flex justify-center mt-11"},h("sss-custom-fund",null,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.formElement.checkValidity()}},h("div",{class:"p-4 sm:p-6 border shadow-sm rounded-lg"},h("p",{class:"sm:text-lg font-bold mb-3"},"Fund details"),h("div",{class:"bg-yellow-50 border-l-4 border-yellow-400 p-4 mb-3 sm:mb-4"},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-2"},h("ul",{class:"list-disc list-outside ml-6 space-y-2 text-sm text-yellow-700 leading-5"},h("li",null,"Make sure you are a current member of the fund before completing this step."),h("li",null,"Please check that the fund USI is correct as some funds have similar names."))))),h("sss-my-own-fund-inputs",{myOwnFundForm:state$1.myOwnFundForm,showValidationErrors:this.formState==="validated",onFormChanged:function(t){state$1.myOwnFundForm=Object.assign(Object.assign({},state$1.myOwnFundForm),t.detail);e.isNotAllInformationProvidedMessageVisible=false}}),this.isNotAllInformationProvidedMessageVisible&&h("div",{class:"mt-4 rounded-md bg-red-50 p-4 text-sm text-red-700"},"All fields are required to complete submission. Make sure you have selected a fund.")),h("div",{class:"flex justify-center mt-8"},h("div",{class:"sm:max-w-320 w-full"},h("div",{class:"mb-4"},h("sss-button",{fillWidth:true,promiseFn:function(){return e.handleSubmitForm()},disabled:this.isSubmitDisabled},"Continue")),h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("sss-button",{fillWidth:true,variant:"secondary"},"Back"))))))))};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){var e;var t=this;return __generator(this,(function(n){this.formState="validated";if(!this.formElement.checkValidity()){return[2]}e=isSome(state$1.myOwnFundForm.fundUsi)&&isSome(state$1.myOwnFundForm.memberNumber);if(!e){this.isNotAllInformationProvidedMessageVisible=true;return[2]}navigationService.navigateInternallyToStandardChoice({history:this.history,fundName:this.getOrError(state$1.myOwnFundForm.fundName),handleSubmitFn:function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:t={fundUsi:this.getOrError(state$1.myOwnFundForm.fundUsi),memberNumber:this.getOrError(state$1.myOwnFundForm.memberNumber),standardChoiceFormSignature:e};return[4,customFundChoiceApi.submitCustomFundChoiceAsync(t)];case 1:n.sent();return[2]}}))}))}});return[2]}))}))};e.prototype.getOrError=function(e){return _function.pipe(e,getOrElse((function(){throw new Error("Option value is none.")})))};return e}();injectHistory(MyOwnFund);var MyOwnFundInputs=function(){function e(e){var t=this;registerInstance(this,e);this.formChanged=createEvent(this,"formChanged",7);this.MIN_SEARCH_STRING_LENGTH=3;this.MAX_RECORD_COUNT=10;this.searchFundsAsync=function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,australianFundLookupService.searchFundsAsync(e,this.MAX_RECORD_COUNT)];case 1:t=n.sent();return[2,t.sort((function(e,t){return e.productName.localeCompare(t.productName)})).map((function(e){return{label:e.productName+" ("+e.usi+")",value:e.usi}}))]}}))}))}}e.prototype.render=function(){var e=this;return h("div",null,h("div",null,h("label",{class:"text-sm font-medium text-gray-700"},"Fund name"),h("div",{class:"mt-1"},h("sss-dropdown-async",{searchFunction:this.searchFundsAsync,minSearchStringLength:this.MIN_SEARCH_STRING_LENGTH,required:true,requiredValidationMessage:"Select a fund",placeholder:"Type to search by name or USI...",value:this.selectedOption,onValueChanged:function(t){e.selectedOption=t.detail;e.updateFund(t.detail)},showValidationErrors:this.showValidationErrors})),isSome(this.myOwnFundForm.fundUsi)&&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-sm"},this.myOwnFundForm.fundUsi.value))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Member number"),h("div",{class:"mt-1"},h("input",{type:"text",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full 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:"[A-Za-z0-9]{4,16}",name:"memberNumber",id:"memberNumber",value:toUndefined(state$1.myOwnFundForm.memberNumber),onChange:function(t){return e.updateMemberNumber(t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid member number (only numbers and / or letters)"))))};e.prototype.updateFund=function(e){this.formChanged.emit({fundUsi:some(e.value),fundName:some(e.label)})};e.prototype.updateMemberNumber=function(e){this.formChanged.emit({memberNumber:some(e)})};return e}();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()]}))}))};return e}();var promotedFundChoiceApi=new PromotedFundChoiceApi;var initial$1={fundId:""};var state$2=createStore(initial$1).state;var PromotedFundJoinIFrameBuilder=function(){function e(){var e=this;this.hostIsLocalSuperSelection=function(){return window.location.origin==="http://localhost:7100"};this.environmentDiscriminator=function(){return e.hostIsLocalSuperSelection()?"autodev-partner":window.location.hostname.toLowerCase().split(".")[0]};this.promotedFundJoinAppUrl=function(){return"https://"+e.environmentDiscriminator()+".flarehr.com/promoted-fund-join/embed/v1.0/web"}}e.prototype.build=function(e,t){if(!(e===null||e===void 0?void 0:e.contentDocument))return;var n=Object.assign(Object.assign({},this.getMemberData()),{partnerId:superSelectionAppService.partnerIdOrDefault,accountId:superSelectionAppService.accountIdOrDefault,fundId:state$2.fundId,authToken:superSelectionAppService.jwt});var r=function(n){var i;var a=n.data;if(!a){return}if(a.sender==="promoted-fund-redirect"){window.removeEventListener("message",r);switch(a.type){case"cancel":navigationService.navigateInternally(t,SuperSelectionAppRoutes.ChoicePage);break;case"success":if(a.memberNumber){navigationService.navigateInternallyToStandardChoice({history:t,fundName:(i=getFundNameById(state$2.fundId))!==null&&i!==void 0?i:"",handleSubmitFn:function(e){return promotedFundChoiceApi.submitChoiceAsync(Object.assign(Object.assign({},state$2),{memberNumber:a.memberNumber,usi:a.usi.replace(/ /g,""),standardChoiceFormSignature:e,shownFunds:superSelectionAppService.promotedFunds}))},promotedFundId:state$2.fundId});break}default:navigationService.navigateInternally(t,SuperSelectionAppRoutes.ChoicePage);break}return}if(a.sender==="promoted-fund-join"){switch(a.type){case"contentResized":e.height=a.height>0?a.height:e.height;e.width=a.width>0?a.width:e.width;break;case"pageNavigated":window.scroll(e.offsetLeft,e.offsetTop);iframe.navigation(window.location.href);break}}};window.addEventListener("message",r);var i=e.contentDocument;i.open();var a=i.createElement("form");a.method="POST";a.target="_self";a.action=this.promotedFundJoinAppUrl();var o;for(o in n){var s=n[o];if(s!==undefined){var u=document.createElement("input");u.type="hidden";u.name=o;u.value=s;a.append(u)}}i.appendChild(a);i.close();a.submit()};e.prototype.getMemberData=function(){var e,t;var n=superSelectionAppService.superBuyer;return{title:n.userProfile.title,firstName:n.userProfile.firstName,middleName:n.userProfile.middleName,lastName:n.userProfile.lastName,dateOfBirth:n.userProfile.dateOfBirth,gender:n.userProfile.gender,email:n.userProfile.email,mobilePhone:n.userProfile.mobilePhone,taxFileNumber:(e=n.tfn)!==null&&e!==void 0?e:"",addressLine1:n.userProfile.address.addressLine1,addressLine2:(t=n.userProfile.address.addressLine2)!==null&&t!==void 0?t:"",city:n.userProfile.address.city,state:n.userProfile.address.state,postCode:n.userProfile.address.postcode}};return e}();var PromotedFundJoinIFrameBuilder$1=new PromotedFundJoinIFrameBuilder;var PromotedFundJoinPage=function(){function e(e){registerInstance(this,e)}e.prototype.componentDidLoad=function(){PromotedFundJoinIFrameBuilder$1.build(this.iframeElement,this.history)};e.prototype.render=function(){var e=this;return h(Host,{class:"w-screen"},h("iframe",{width:"100%",height:window.innerHeight,style:{border:"none"},ref:function(t){return e.iframeElement=t}}))};return e}();var SelfManagedFund=function(){function e(e){var t=this;registerInstance(this,e);this.showSmsfNotSupported=false;this.isSubmitDisabled=true;this.eventTrackingService=EventTrackingService.Instance;this.success=function(){navigationService.navigateInternallyToStandardChoice({history:t.history,fundName:"Self-managed super fund",handleSubmitFn:function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:t={smsfChoice:{abn:state$1.selfManagedFundForm.fundAbn,fundName:state$1.selfManagedFundForm.fundName,fundAddress:{addressLine1:state$1.selfManagedFundForm.addressLine1,addressLine2:state$1.selfManagedFundForm.addressLine2,city:state$1.selfManagedFundForm.city,state:state$1.selfManagedFundForm.state,postcode:state$1.selfManagedFundForm.postcode},bsb:state$1.selfManagedFundForm.bsb,bankAccountName:state$1.selfManagedFundForm.bankAccountName,bankAccountNumber:state$1.selfManagedFundForm.bankAccountNumber,electronicServiceAddress:state$1.selfManagedFundForm.fundEsa},standardChoiceFormSignature:e};return[4,customFundChoiceApi.submitSelfManagedFundChoiceAsync(t)];case 1:n.sent();return[2]}}))}))}})}}e.prototype.componentDidLoad=function(){return this.eventTrackingService.TrackSmsfSuperFundDetailViewedAsync({promotedFundsShown:superSelectionAppService.promotedFunds})};e.prototype.render=function(){var e=this;return h(Host,null,h("sss-header-section",{currentPage:"own-fund"}),h("div",{class:"flex justify-center mt-11"},h("sss-custom-fund",null,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.formElement.checkValidity()}},h("div",{class:"p-4 sm:p-6 border shadow-sm rounded-lg max-w-560"},h("p",{class:"sm:text-lg font-bold"},"Fund details"),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"},"Make sure your Self-managed super fund (SMSF) is a registered fund before completing this step."))),h("sss-self-managed-fund-inputs",{fundForm:state$1.selfManagedFundForm,showValidationErrors:this.formState==="validated",onFormChanged:function(e){state$1.selfManagedFundForm=Object.assign(Object.assign({},state$1.selfManagedFundForm),e.detail)}})),h("div",{class:"flex justify-center mt-8"},h("div",{class:"sm:max-w-320 w-full"},h("div",{class:"mb-4"},h("sss-button",{fillWidth:true,promiseFn:function(){return e.handleSubmitForm()},disabled:this.isSubmitDisabled},"Continue")),h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("sss-button",{fillWidth:true,variant:"secondary"},"Back")))),this.showSmsfNotSupported&&h("sss-smsf-not-supported-dialog",{ref:function(t){return e.notSupportedDialog=t},onContinue:this.success})))))};e.prototype.componentDidRender=function(){var e;this.showSmsfNotSupported&&((e=this.notSupportedDialog)===null||e===void 0?void 0:e.scrollIntoView())};e.prototype.handleSubmitForm=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.formState="validated";if(this.formElement.checkValidity()){if(superSelectionAppService.showSmsfNotSupported){this.showSmsfNotSupported=true}else{this.success()}}return[2]}))}))};return e}();injectHistory(SelfManagedFund);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 SelfManagedFundInputs=function(){function e(e){registerInstance(this,e);this.formChanged=createEvent(this,"formChanged",7);this.currentBank=none;this.addressErrorMessage=none;this.stateOptions=[{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"}];this.bsbRegex=new RegExp(/^[0-9]{3}[0-9]{3}$/);this.bankAccountNumberRegex=new RegExp(/^[0-9]{2,10}$/)}e.prototype.render=function(){var e=this;var t={"relative shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full 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":this.showValidationErrors};return h("div",null,h("div",null,h("label",{class:"text-sm font-medium text-gray-700"},"Fund name"),h("div",{class:"mt-1"},h("input",{type:"text",class:t,required:true,minlength:"2",name:"fundName",id:"fundName",value:state$1.selfManagedFundForm.fundName,onChange:function(t){return e.updateFormField("fundName",t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid fund name"))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Fund ABN"),h("div",{class:"mt-1"},h("input",{type:"text",class:t,required:true,minlength:"2",name:"fundAbn",id:"fundAbn",value:state$1.selfManagedFundForm.fundAbn,onChange:function(t){return e.updateFormField("fundAbn",t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid fund ABN"))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Electronic service address alias (ESA)"),h("div",{class:"mt-1"},h("input",{type:"text",class:t,required:true,minlength:"2",name:"fundEsa",id:"fundEsa",value:state$1.selfManagedFundForm.fundEsa,onChange:function(t){return e.updateFormField("fundEsa",t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid fund ESA"))),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({},t),{"rounded-none rounded-t-md shadow-none":true}),required:true,minlength:"2",name:"addressLine1",id:"addressLine1",value:state$1.selfManagedFundForm.addressLine1,onChange:function(t){e.updateFormField("addressLine1",t.target.value.trim());e.updateAddressErrorMessage()},ref:function(t){return e.addressLine1Element=t}}),h("input",{placeholder:"Address line 2 (optional)",type:"text",class:Object.assign(Object.assign({},t),{"rounded-none shadow-none":true}),name:"addressLine2",id:"addressLine2",value:state$1.selfManagedFundForm.addressLine2,onChange:function(t){return e.updateFormField("addressLine2",t.target.value.trim())}}),h("input",{placeholder:"City/suburb",type:"text",class:Object.assign(Object.assign({},t),{"rounded-none shadow-none":true}),name:"city",required:true,id:"city",value:state$1.selfManagedFundForm.city,onChange:function(t){e.updateFormField("city",t.target.value.trim());e.updateAddressErrorMessage()},ref:function(t){return e.cityElement=t}}),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({},t),{"rounded-none rounded-bl-md shadow-none":true}),name:"postcode",minlength:"4",maxlength:"4",pattern:"[0-9]{4}",id:"postcode",value:state$1.selfManagedFundForm.postcode,onChange:function(t){e.updateFormField("postcode",t.target.value.trim());e.updateAddressErrorMessage()},ref:function(t){return e.postcodeElement=t}})),h("div",{class:"flex-1 min-w-0"},h("select",{class:Object.assign(Object.assign({},t),{"rounded-none rounded-br-md shadow-none":true,"text-gray-500":!this.fundForm.state}),name:"state",required:true,id:"state",onChange:function(t){e.updateFormField("state",t.target.value.trim());e.updateAddressErrorMessage()},ref:function(t){return e.stateElement=t}},h("option",{disabled:true,selected:!this.fundForm.state,value:""},"State"),this.stateOptions.map((function(t){return h("option",{value:t.value,selected:e.fundForm.state===t.value},t.label)})))))),isSome(this.addressErrorMessage)&&this.showValidationErrors&&h("div",{class:"mt-2 text-sm text-red-600"},this.addressErrorMessage.value)),h("h3",{class:"text-lg font-bold mt-6"},"Fund bank details"),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Account name"),h("div",{class:"mt-1"},h("input",{type:"text",required:true,class:t,name:"bankAccountName",minlength:"2",id:"bankAccountName",value:state$1.selfManagedFundForm.bankAccountName,onChange:function(t){return e.updateFormField("bankAccountName",t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid bank account name"))),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"BSB"),h("div",{class:"mt-1"},h("input",{type:"text",required:true,class:t,name:"bsb",id:"bsb",minlength:"6",maxlength:"7",onKeyUp:function(t){return e.updateCurrentBank(t)},pattern:this.bsbRegex.source,value:state$1.selfManagedFundForm.bsb}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid BSB"))),isSome(this.currentBank)&&h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Bank 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-sm"},this.currentBank.value)),h("div",{class:"mt-3"},h("label",{class:"text-sm font-medium text-gray-700"},"Account number"),h("div",{class:"mt-1"},h("input",{type:"text",required:true,class:t,name:"bankAccountNumber",id:"bankAccountNumber",minlength:"2",maxlength:"11",pattern:this.bankAccountNumberRegex.source,value:state$1.selfManagedFundForm.bankAccountNumber,onKeyUp:function(t){return e.updateCurrentBankAccountNumber(t)},onChange:function(t){return e.updateFormField("bankAccountNumber",t.target.value.trim())}}),h("div",{class:"invalid-feedback mt-2 text-sm text-red-600"},"Enter a valid bank account number"))))};e.prototype.updateFormField=function(e,t){var n;this.formChanged.emit((n={},n[e]=t,n))};e.prototype.filterDigits=function(e){return e.replace(/[^0-9]/g,"")};e.prototype.updateCurrentBank=function(e){var t=this.filterDigits(e.target.value);var n=t.substring(0,2);var r=t.substring(0,3);var i=bsbNumbers[n];var a=bsbNumbers[r];if(i)this.currentBank=some(i);if(a)this.currentBank=some(a);if(t===""||t.length>6)this.currentBank=none;this.updateFormField("bsb",t)};e.prototype.updateCurrentBankAccountNumber=function(e){var t=this.filterDigits(e.target.value);this.updateFormField("bankAccountNumber",t)};e.prototype.updateAddressErrorMessage=function(){var e=none;if(isNone(e)&&!this.addressLine1Element.checkValidity()){e=some("Enter a valid address line 1")}if(isNone(e)&&!this.cityElement.checkValidity()){e=some("Enter a valid city/suburb")}if(isNone(e)&&!this.postcodeElement.checkValidity()){e=some("Enter a valid post code")}if(isNone(e)&&!this.stateElement.checkValidity()){e=some("Select a state")}this.addressErrorMessage=e};return 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,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)if(o=e[s])a=(i<3?o(a):i>3?o(t,n,a):o(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}}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 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 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 SlateIFrameBuilder=function(){function e(){var e=this;this.hostIsLocalSuperSelection=function(){return window.location.origin==="http://localhost:7100"};this.hostIsDeployed=function(){return window.location.origin.endsWith("partner.flarehr.com")};this.skipConsolidation=function(){return interopQuery.isReactNativeInteropEnabled()?"true":"false"};this.skipInsurance=function(){return interopQuery.isReactNativeInteropEnabled()?"true":"false"};this.environmentDiscriminator=function(){var e=window.location.hostname.toLowerCase().split(".")[0];switch(e){case"autodev-partner":case"test-partner":case"partner":case"sandbox-partner":return e.replace("partner","");default:return"autodev-"}};this.slateJoinAppUrl=function(){return"https://"+e.environmentDiscriminator()+"join.slatesuper.com.au/confirm"}}e.prototype.build=function(e,t){if(!(e===null||e===void 0?void 0:e.contentDocument))return;var n=this.hostIsLocalSuperSelection()||this.hostIsDeployed()?window.location.origin+"/super-selection/embed/v1.0/app":"https://autodev-partner.flarehr.com/super-selection/embed/v1.0/app";var r=n+"/slate-redirect.html";var i=Object.assign(Object.assign({},this.getSlateJoinMemberData()),{successRedirectUrl:r,cancelRedirectUrl:r,skipConsolidation:this.skipConsolidation(),skipInsurance:this.skipInsurance()});if(this.includeJwt()){i.authToken=superSelectionAppService.jwt}var a=function(n){var r=n.data,i=n.origin;if(!r){return}if(r.sender==="slate-redirect"){window.removeEventListener("message",a);switch(r.type){case"success":if(r.memberNumber){navigationService.navigateInternallyToStandardChoice({history:t,fundName:Slate.Name,handleSubmitFn:function(e){return slateChoiceApi.submitSlateChoiceAsync({memberNumber:r.memberNumber,standardChoiceFormSignature:e,shownFunds:superSelectionAppService.promotedFunds})},promotedFundId:Slate.Id});break}default:navigationService.navigateInternally(t,SuperSelectionAppRoutes.ChoicePage);break}return}if(r.sender==="flare"&&i.endsWith("join.slatesuper.com.au")){switch(r.type){case"contentResized":e.height=r.height>0?r.height:e.height;e.width=r.width>0?r.width:e.width;break}}};window.addEventListener("message",a);var o=e.contentDocument;o.open();var s=o.createElement("form");s.method="POST";s.target="_self";s.action=this.slateJoinAppUrl();var u;for(u in i){var l=i[u];if(l!==undefined){var c=document.createElement("input");c.type="hidden";c.name=u;c.value=l;s.append(c)}}o.appendChild(s);o.close();s.submit()};e.prototype.getSlateJoinMemberData=function(){var e,t;var n=superSelectionAppService.superBuyer;var r=function(e){switch(e){case"Male":return"Male";case"Female":return"Female";case"Intersex":return"Intersex/Indeterminate";default:return"Unknown"}};return{firstName:n.userProfile.firstName,middleName:n.userProfile.middleName,lastName:n.userProfile.lastName,dateOfBirth:n.userProfile.dateOfBirth,gender:r(n.userProfile.gender),email:n.userProfile.email,mobilePhone:n.userProfile.mobilePhone,taxFileNumber:(e=n.tfn)!==null&&e!==void 0?e:"",addressLine1:n.userProfile.address.addressLine1,addressLine2:(t=n.userProfile.address.addressLine2)!==null&&t!==void 0?t:"",city:n.userProfile.address.city,state:n.userProfile.address.state,postCode:n.userProfile.address.postcode}};e.prototype.includeJwt=function(){return!this.slateJoinAppUrl().match(/autodev|sandbox/)};return e}();var slateIFrameBuilder=new SlateIFrameBuilder;var SlateJoinPage=function(){function e(e){registerInstance(this,e)}e.prototype.componentDidLoad=function(){slateIFrameBuilder.build(this.iframeElement,this.history)};e.prototype.render=function(){var e=this;return h(Host,{class:"w-screen"},h("iframe",{width:"100%",height:window.innerHeight,style:{border:"none"},ref:function(t){return e.iframeElement=t}}))};return e}();var SmsfNotSupportedDialog=function(){function e(e){var t=this;registerInstance(this,e);this.continue=createEvent(this,"continue",7);this.standardChoiceFormUrl="/super-selection/embed/v1.0/app/assets/Superannuation_Standard_Choice_Form.pdf";this.handleContinue=function(){t.continue.emit()}}e.prototype.render=function(){return h(Host,null,h("div",{class:"fixed z-40 top-0 left-0 bg-white opacity-70 w-full h-full"}),h("div",{class:"fixed z-50 top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2"},h("div",{class:"p-6 shadow-sm border rounded-lg bg-white text-center max-w-560"},h("div",{class:"flex justify-center"},h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"orange",viewBox:"0 0 16 16"},h("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"}))),h("p",{class:"my-4"},"You’ve selected a self-managed super fund (SMSF). Currently, SMSF information can’t be sent via this form. You’ll need to provide your employer with a"," ",h("a",{target:"_blank",href:this.standardChoiceFormUrl},"standard choice form")," ","for your SMSF details."),h("sss-button",{onClick:this.handleContinue,fillWidth:true},"Continue"))))};return e}();var StandardChoiceFormInputDefaultFund=function(){function e(e){registerInstance(this,e);this.standardChoiceFormSignature="";this.isSubmitDisabled=true}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"},state.promotedFundId&&getLogoSrc(state.promotedFundId)&&h("div",{class:"pb-4 mb-4 border-b flex justify-center sm:pb-0 sm:mb-0 sm:border-b-0 sm:pr-8 sm:mr-8 sm:border-r sm:justify-start"},h("img",{class:"h-16 w-auto",alt:state.fundName,src:getLogoSrc(state.promotedFundId)})),h("div",{class:"flex justify-between w-full"},h("div",null,h("div",{class:"text-xs font-semibold text-gray-500 sm:uppercase"},"Nominated fund"),h("div",{class:"text-sm mt-2"},state.fundName)),h("div",{class:"grid content-center ml-4"},h("stencil-route-link",{url:SuperSelectionAppRoutes.ChoicePage},h("sss-button",{variant:"secondary"},"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",{type:"text",autocomplete:"off",class:{"shadow-sm focus:ring-primary-focus focus:border-primary-focus w-full 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",{fillWidth:true,promiseFn:function(){return e.handleSubmitForm()},disabled:this.isSubmitDisabled},"Confirm and continue")))))))};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.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)}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",{fillWidth:true,onClick:this.handleContinueButtonClick},h("span",null,"Continue")))))};e.prototype.handleContinueButtonClick=function(e){superSelectionAppService.completeSuperSelectionFlow()};return e}();var SuperChoiceItemBottom=function(){function e(e){registerInstance(this,e);this.joinFundClicked=createEvent(this,"joinFundClicked",7)}e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"py-6 px-4 lg:px-6 flex flex-col justify-between h-full"},h("div",null,h("div",{class:"md:max-w-[240px] lg:max-w-full"},h("sss-button",{class:"uuid-button-continue",fillWidth:true,onClick:function(){return e.handleFundClick()}},"Choose this fund")),h("div",{class:"text-xs text-gray-500 mt-6 leading-4"},this.disclaimer)),this.abnInfo&&this.abn&&h("div",{class:"text-xs text-gray-500 mt-2"},h("p",null,""+(FeatureFlagService.isNewComplianceEnabled()?"Issued by ":"")+this.abnInfo+"."),h("p",null,"ABN: ",this.abn))))};e.prototype.handleFundClick=function(){return this.joinFundClicked.emit()};return e}();var SuperChoiceItemTop=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){return h(Host,null,h("div",{class:"px-4 lg:px-6 pt-6"},h("div",{class:"text-right w-100 -mt-5 -mr-3.5 lg:-mr-5"},h("span",{class:"text-xs bg-gray-100 text-gray-800 font-medium rounded-xl py-0.5 px-2.5 mr-0.5"},FeatureFlagService.isNewComplianceEnabled()?"Featured":"Advertised")),h("div",{class:"flex lg:block mt-2 md:mt-0 lg:mt-2"},h("img",{class:"h-16 object-contain w-auto max-w-[80px] md:hidden lg:block lg:max-w-none",alt:this.name,src:getAssetPath("assets/"+this.logo)}),h("div",{class:"grid content-center"},h("p",{class:"text-lg font-bold ml-4 mb-2 md:ml-0 md:mb-0 lg:mt-4"},this.name))),h("div",{class:"mt-4 text-sm space-y-2"},JSON.parse(this.features).map((function(e){return h("div",{class:"flex"},h("div",{class:"h-5 w-5 flex-none mr-1.5"},h("img",{src:getAssetPath("assets/icon-check.svg")})),h("p",{class:"leading-5"},e.value))}))),this.featureSubText&&h("p",{class:"text-xs text-gray-500 italic mt-4 leading-4"},this.featureSubText)))};return e}();var SuperChoicePage=function(){function e(e){registerInstance(this,e);this.promotedFunds=this.getPromotedFunds();this.eventTrackingService=EventTrackingService.Instance}e.prototype.componentDidLoad=function(){var e=this.promotedFunds.map((function(e){return e.fundId}));return this.eventTrackingService.TrackSuperFundPanelViewedAsync({promotedFundsShown:e})};e.prototype.render=function(){var e=this;var t="https://my.gov.au";var n="www.my.gov.au";var r="https://www.apra.gov.au/register-of-superannuation-institutions";var i="www.apra.gov.au";return h(Host,null,h("div",null,h("sss-header-section",{currentPage:"choice"}),FeatureFlagService.isNewComplianceEnabled()&&h("div",{class:"mt-8 text-sm text-center leading-6"},"Not looking to join a new fund? You can skip the featured super funds and"," ",h("stencil-route-link",{url:SuperSelectionAppRoutes.MyOwnFund},h("span",{class:"text-primary-base font-medium"},"choose another super fund")),"."),!FeatureFlagService.isNewComplianceEnabled()&&h("div",{class:"flex justify-center pb-4"},h("div",{class:"text-center space-y-4 max-w-960 text-sm leading-6"},h("p",{class:"text-lg leading-8 text-gray-600"},"The choice of superannuation fund is an important personal financial decision. It is open to you to continue with your existing fund, or alternatively, you can select from one of the funds below or choose another fund."),h("p",null,"Flare is not licensed to advise you in relation to this decision and you may wish to return to this page at a later stage."),h("p",null,"The content on this page and on the following pages relating to each super fund is provided by the trustee or promoter of the super fund. The super funds presented have not been selected by your employer and neither your employer or Flare are making any recommendation or opinion."),h("p",null,"There are many super funds out there and you should consider the relevant product disclosure statement and choose one that is right for you. If you are unsure, obtain your own advice. You can choose your super fund later, if you need time to obtain advice."),h("p",null,"You should be aware that, if you do choose one of these advertised funds, Flare and its associated entities will normally receive a fee for you doing so."))),h("div",{class:"flex justify-center mt-8"},h("div",{class:{"lg:grid border-l border-t lg:border-b rounded-lg":true,"lg:grid-cols-1 max-w-400":this.promotedFunds.length===1,"lg:grid-cols-2 max-w-720":this.promotedFunds.length===2,"lg:grid-cols-3 max-w-960":this.promotedFunds.length===3}},this.promotedFunds.map((function(t,n){return h("div",{class:{"border-r":true,"rounded-tr-lg":n===0,"lg:rounded-tr-none":n===0&&n!==e.promotedFunds.length-1,"rounded-br-lg lg:rounded-br-none lg:rounded-tr-lg":n===e.promotedFunds.length-1}},h("div",{class:{"flex border-b lg:border-b-0":true,"rounded-b-lg":n===e.promotedFunds.length-1}},h("div",{class:"hidden md:flex lg:hidden w-36 justify-center pt-6 pl-6"},h("img",{class:"h-16 object-contain w-full max-w-[96px]",alt:t.name,src:getAssetPath("assets/"+t.logo)})),h("div",{class:"w-full"},h("sss-super-choice-item-top",{logo:t.logo,name:t.name,features:JSON.stringify(t.features),featureSubText:t.featureSubText}),h("div",{class:"lg:hidden"},h("sss-super-choice-item-bottom",{disclaimer:t.disclaimer,abnInfo:t.abnInfo,abn:t.abn,onJoinFundClicked:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.handleJoinSuperClickAsync(t)]}))}))}})))))})),this.promotedFunds.map((function(t,n){return h("div",{class:{"hidden lg:block border-r":true,"rounded-br-lg":n===e.promotedFunds.length-1}},h("sss-super-choice-item-bottom",{disclaimer:t.disclaimer,abnInfo:t.abnInfo,abn:t.abn,onJoinFundClicked:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.handleJoinSuperClickAsync(t)]}))}))}}))})))),h("div",{class:"flex justify-center mt-8 sm:mt-12"},h("div",{class:"pb-8 sm:pb-12 max-w-720 border-b"},h("h5",{class:"font-bold sm:text-lg"},"Or, choose another super fund:"),h("ul",{class:"list-disc list-outside ml-6 mt-3 mb-6 space-y-2 leading-6 text-sm sm:text-base"},h("li",null,"Select this option if you'd like to use your current account with another super fund, your self-managed super fund, or your employer's default fund."),h("li",null,"If you are unsure of your current super fund details, you can find out at"," ",h("a",{class:"text-primary-base font-medium",target:"_blank",href:navigationService.toExternalUrl(t)},n)),h("li",null,"A full list of super funds can be viewed at"," ",h("a",{class:"text-primary-base font-medium",target:"_blank",href:navigationService.toExternalUrl(r)},i))),h("stencil-route-link",{url:SuperSelectionAppRoutes.MyOwnFund},h("sss-button",{fillWidthOnMobile:true},"Choose another super fund")))),FeatureFlagService.isNewComplianceEnabled()&&h("div",{class:"flex justify-center"},h("div",{class:"pt-8 sm:pt-12 max-w-720"},h("h5",{class:"font-semibold"},"IMPORTANT INFORMATION:"),h("ul",{class:"list-disc list-outside ml-6 mt-3 space-y-2 text-sm leading-6"},h("li",null,"The superannuation funds featured above are for your information only. The order, position and placement of content should not be interpreted as an opinion or recommendation (actual or implied) by Flare as to the suitability or appropriateness of any superannuation fund for you. In featuring these superannuation funds, Flare has not taken into account your objectives, financial situation or needs."),h("li",null,"This is not a comparison service. This page contains factual information only and does not constitute either general or personal advice about any financial products. We do not take into account your objectives, financial situation or needs. If you have questions or need help making a decision about your superannuation fund, you should speak to a licensed financial product advice provider."),h("li",null,"Flare, the technology partner you are accessing Flare via and your employer do not endorse or accept responsibility for any financial product advice or services provided by the promoters or trustees of the featured superannuation funds. Flare does not endorse or accept responsibility for any of the content shown about any of the featured superannuation funds."),h("li",null,"You should consider the relevant superannuation fund’s PDS and TMD (if applicable) in deciding whether to apply to join the superannuation fund. Each of the superannuation funds featured above include a link to their PDS and TMD (if applicable) for your convenience. If you are considering joining another superannuation fund, you can typically find the PDS and TMD (if applicable) on that fund’s website."),h("li",null,"You should be aware that, if you do choose one of the featured superannuation funds, Flare and it’s associates will normally receive a fee for you doing so (this includes Simple Financial Choices Pty Ltd, a wholly owned subsidiary of Flare, which is a sub-promoter of Slate Super)."))))))};e.prototype.allFunds=function(){var e=this;return[{fundId:Slate.Id,name:Slate.Name,logo:"logo-slate.png",route:SuperSelectionAppRoutes.SlateJoin,features:[{order:1,value:"A lifestage investment strategy that evolves with you"},{order:2,value:"Advanced mobile app with retirement forecast and smart features"},{order:3,value:"Member advocates at Slate to assist with your account"}],disclaimer:h("p",{class:"small text-muted"},"You should consider the"," ",h("a",{class:"font-medium underline",target:"_blank",href:navigationService.toExternalUrl(Slate.PdsUrl),onClick:function(){return e.pdsViewedAsync(Slate.Name,Slate.Usi)}},"Product Disclosure Statement")," ","and"," ",h("a",{class:"font-medium underline",target:"_blank",href:navigationService.toExternalUrl("https://slate.co/forms-and-documents/target-market-determination/")},"Target Market Determination")," ","before deciding to invest in or apply to become a member of the fund."),abnInfo:"Diversa Trustees Limited",abn:Slate.DiversaAbn},{fundId:AustralianRetirementTrust.Id,name:AustralianRetirementTrust.Name,logo:"logo-art.svg",route:SuperSelectionAppRoutes.PromotedFundJoin,features:[{order:1,value:"$200 billion in retirement savings"},{order:2,value:"2+ million members"},{order:3,value:"A focus on delivering strong, long‑term returns"}],featureSubText:"QSuper is now part of Australian Retirement Trust. If you have an existing QSuper account, you will continue to hold that account by selecting this option.",disclaimer:h("p",null,"You should consider the"," ",h("a",{class:"font-medium underline",target:"_blank",href:navigationService.toExternalUrl(AustralianRetirementTrust.PdsUrl),onClick:function(){return e.pdsViewedAsync(AustralianRetirementTrust.Name)}},"Product Disclosure Statement")," ","and"," ",h("a",{class:"font-medium underline",target:"_blank",href:navigationService.toExternalUrl("https://www.australianretirementtrust.com.au/tmd")},"Target Market Determination")," ","before deciding to invest in or apply to become a member of this fund."),abnInfo:"Australian Retirement Trust",abn:AustralianRetirementTrust.Abn},{fundId:Aware.Id,name:Aware.Name,logo:"logo-aware.svg",route:SuperSelectionAppRoutes.PromotedFundJoin,features:[{order:1,value:"Acting on climate change"},{order:2,value:"All profits go to members"},{order:3,value:"One of Australia’s largest funds"}],disclaimer:h("p",null,"You should consider the"," ",h("a",{class:"font-medium underline",target:"_blank",href:navigationService.toExternalUrl(Aware.PdsUrl),onClick:function(){return e.pdsViewedAsync(Aware.Name)}},"Product Disclosure Statement")," ","before deciding to invest in or apply to become a member of this fund."),abnInfo:"Aware Super Pty Ltd",abn:Aware.Abn},{fundId:Active.Id,name:Active.Name,logo:"logo-active.svg",route:SuperSelectionAppRoutes.PromotedFundJoin,features:[{order:1,value:"One of Canstar's top-performing funds*"},{order:2,value:"Recognised as a leader in responsible investment"},{order:3,value:"Calls answered in 20 seconds (average over 5 years)"}],featureSubText:"*Past performance is not a reliable indicator of future performance. As at 22 April 2022, Active Super is ranked among Canstar’s top five funds for 18-49 year-olds with a balance up to $250,000 based on returns over 5 years in the Accumulation Scheme.",disclaimer:h("p",null,"Issued by LGSS Pty Limited as trustee for Local Government Super (Active Super ABN:28 901 371 321). Consider the PDS and TMD at"," ",h("a",{class:"font-medium underline",target:"_blank",onClick:function(){return e.pdsViewedAsync(Active.Name)},href:navigationService.toExternalUrl(Active.PdsUrl)},"activesuper.com.au")," ","before making a decision.")}]};e.prototype.getPromotedFunds=function(){var e=this;var t=[];superSelectionAppService.promotedFunds.forEach((function(n){var r=e.allFunds().find((function(e){return n===e.fundId}));if(r!==undefined){t.push(r)}}));return t};e.prototype.handleJoinSuperClickAsync=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:t=superSelectionAppService.promotedFunds;if(!(e.fundId===Slate.Id))return[3,2];return[4,this.eventTrackingService.TrackPromotedSuperFundDetailViewedAsync({fundUsi:Slate.Usi,fundName:Slate.Name,promotedFundId:Slate.Id,promotedFundsShown:t})];case 1:n.sent();return[3,8];case 2:if(!(e.fundId===AustralianRetirementTrust.Id))return[3,4];return[4,this.eventTrackingService.TrackPromotedSuperFundDetailViewedAsync({fundName:AustralianRetirementTrust.Name,promotedFundId:AustralianRetirementTrust.Id,promotedFundsShown:t})];case 3:n.sent();state$2.fundId=e.fundId;return[3,8];case 4:if(!(e.fundId===Aware.Id))return[3,6];return[4,this.eventTrackingService.TrackPromotedSuperFundDetailViewedAsync({fundName:Aware.Name,promotedFundId:Aware.Id,promotedFundsShown:t})];case 5:n.sent();state$2.fundId=e.fundId;return[3,8];case 6:if(!(e.fundId===Active.Id))return[3,8];return[4,this.eventTrackingService.TrackPromotedSuperFundDetailViewedAsync({fundName:Active.Name,promotedFundId:Active.Id,promotedFundsShown:t})];case 7:n.sent();state$2.fundId=e.fundId;n.label=8;case 8:return[2,navigationService.navigateInternally(this.history,e.route)]}}))}))};e.prototype.pdsViewedAsync=function(e,t){return this.eventTrackingService.TrackSuperFundPdsViewedAsync({fundUsi:t,fundName:e,pageName:"Panel Fund Page"})};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();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=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,["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 o=function(t){r(t,[e.scrollX,e.scrollY])};if(storageAvailable(e,"sessionStorage")){var s=e.sessionStorage.getItem(t);n=s?new Map(JSON.parse(s)):n}if("scrollRestoration"in e.history){history.scrollRestoration="manual"}return{set:r,get:i,has:a,capture:o}};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 o=supportsHistory(e);var s=!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,o=i.hash;var s=r+a+o;warning(!f||hasBasename(s,f),"You are attempting to use a basename on a page whose URL path does not begin "+'with the basename. Expected path "'+s+'" to begin with "'+f+'".');if(f){s=stripBasename(s,f)}return createLocation(s,n,t||createKey(d))};var g=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;g.notifyListeners(U.location,U.action)};var m=function(e){if(!isExtraneousPopstateEvent(a,e)){b(h(e.state))}};var y=function(){b(h(p()))};var b=function(e){if(n){n=false;v()}else{var t="POP";g.confirmTransitionTo(e,t,c,(function(n){if(n){v({action:t,location:e})}else{S(e)}}))}};var S=function(e){var t=U.location;var r=_.indexOf(t.key);var i=_.indexOf(e.key);if(r===-1){r=0}if(i===-1){i=0}var a=r-i;if(a){n=true;A(a)}};var w=h(p());var _=[w.key];var x=0;var C=false;var I=function(e){return f+createPath(e)};var T=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);g.confirmTransitionTo(a,n,c,(function(e){if(!e){return}var t=I(a);var s=a.key,u=a.state;if(o){r.pushState({key:s,state:u},"",t);if(l){i.href=t}else{var c=_.indexOf(U.location.key);var d=_.slice(0,c===-1?0:c+1);d.push(a.key);_=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);g.confirmTransitionTo(a,n,c,(function(e){if(!e){return}var t=I(a);var s=a.key,u=a.state;if(o){r.replaceState({key:s,state:u},"",t);if(l){i.replace(t)}else{var c=_.indexOf(U.location.key);if(c!==-1){_[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 A=function(e){r.go(e)};var F=function(){return A(-1)};var P=function(){return A(1)};var N=function(t){x+=t;if(x===1){e.addEventListener(PopStateEvent,m);if(s){e.addEventListener(HashChangeEvent,y)}}else if(x===0){e.removeEventListener(PopStateEvent,m);if(s){e.removeEventListener(HashChangeEvent,y)}}};var D=function(e){if(e===void 0){e=""}var t=g.setPrompt(e);if(!C){N(1);C=true}return function(){if(C){C=false;N(-1)}return t()}};var k=function(e){var t=g.appendListener(e);N(1);return function(){N(-1);t()}};var U={length:r.length,action:"POP",location:w,createHref:I,push:T,replace:E,go:A,goBack:F,goForward:P,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 o=e.location;var s=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 g=HashPathCoders[p],v=g.encodePath,m=g.decodePath;var y=function(){var e=o.href;var t=e.indexOf("#");return t===-1?"":e.substring(t+1)};var b=function(e){return o.hash=e};var S=function(e){var t=o.href.indexOf("#");o.replace(o.href.slice(0,t>=0?t:0)+"#"+e)};var w=function(){var e=m(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 _=createTransitionManager();var x=function(e){Object.assign(j,e);j.length=s.length;_.notifyListeners(j.location,j.action)};var C=function(){var e=y();var t=v(e);if(e!==t){S(t)}else{var i=w();var a=j.location;if(!n&&locationsAreEqual(a,i)){return}if(r===createPath(i)){return}r=null;I(i)}};var I=function(e){if(n){n=false;x()}else{var t="POP";_.confirmTransitionTo(e,t,d,(function(n){if(n){x({action:t,location:e})}else{T(e)}}))}};var T=function(e){var t=j.location;var r=P.lastIndexOf(createPath(t));var i=P.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 A=v(E);if(E!==A){S(A)}var F=w();var P=[createPath(F)];var N=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),j.location);_.confirmTransitionTo(i,n,d,(function(e){if(!e){return}var t=createPath(i);var a=v(h+t);var o=y()!==a;if(o){r=t;b(a);var s=P.lastIndexOf(createPath(j.location));var u=P.slice(0,s===-1?0:s+1);u.push(t);P=u;x({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");x()}}))};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),j.location);_.confirmTransitionTo(i,n,d,(function(e){if(!e){return}var t=createPath(i);var a=v(h+t);var o=y()!==a;if(o){r=t;S(a)}var s=P.indexOf(createPath(j.location));if(s!==-1){P[s]=t}x({action:n,location:i})}))};var U=function(e){warning(u,"Hash history go(n) causes a full page reload in this browser");s.go(e)};var O=function(){return U(-1)};var R=function(){return U(1)};var M=function(e,t){i+=t;if(i===1){e.addEventListener(HashChangeEvent$1,C)}else if(i===0){e.removeEventListener(HashChangeEvent$1,C)}};var L=function(t){if(t===void 0){t=""}var n=_.setPrompt(t);if(!a){M(e,1);a=true}return function(){if(a){a=false;M(e,-1)}return n()}};var B=function(t){var n=_.appendListener(t);M(e,1);return function(){M(e,-1);n()}};var j={length:s.length,action:"POP",location:F,createHref:N,push:D,replace:k,go:U,goBack:O,goForward:R,block:L,listen:B,win:e};return j};var getLocation=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(t,e.root);e.location=t}));this.location=getLocation(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;return __generator(this,(function(t){switch(t.label){case 0:return[4,superSelectionAppService.loadAppStateAsync()];case 1:t.sent();return[4,existingFundService.GetExistingFundAsync()];case 2:e=t.sent();this.isAppInitialised=true;this.initialised.emit({accountIdOrDefault:superSelectionAppService.accountIdOrDefault,partnerIdOrDefault:superSelectionAppService.partnerIdOrDefault,profileId:superSelectionAppService.profileId});iframe.appReady();if(Option.isSome(e)&&e.value.valid!=="Inactive"){navigationService.navigateInternally(this.history,SuperSelectionAppRoutes.ExistingChoicePage)}else{navigationService.navigateInternally(this.history,FeatureFlagService.isNewComplianceEnabled()?SuperSelectionAppRoutes.ConsentPage: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":true,"-mt-12 pb-6":!this.isFundJoinPage(),"-mt-28":this.isFundJoinPage()}},superSelectionAppStencilRoutes,h("sss-footer-section",null)):h("div",{class:"flex justify-center py-20"},h("sss-loading-indicator",null))))};e.prototype.isFundJoinPage=function(){return window.location.pathname.includes(SuperSelectionAppRoutes.SlateJoin)||window.location.pathname.includes(SuperSelectionAppRoutes.PromotedFundJoin)};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,o=e.left,s=e.width,u=e.height;return{x:t,y:n,top:r,right:i,bottom:a,left:o,width:s,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,o=i.offsetHeight;return!(a||o||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 o=!r&&scrollRegexp.test(n.overflowY||"");var s=!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 g=r?0:parseDimension(n.borderLeftWidth);var v=d+l;var m=u+c;var y=g+p;var b=f+h;var S=!s?0:e.offsetHeight-b-e.clientHeight;var w=!o?0:e.offsetWidth-y-e.clientWidth;var _=i?v+y:0;var x=i?m+b:0;var C=r?r.width:parseDimension(n.width)-_-w;var I=r?r.height:parseDimension(n.height)-x-S;var T=C+v+w+y;var E=I+m+S+b;var A=freeze({devicePixelContentBoxSize:size(Math.round(C*devicePixelRatio),Math.round(I*devicePixelRatio),a),borderBoxSize:size(T,E,a),contentBoxSize:size(C,I,a),contentRect:new DOMRectReadOnly(d,u,C,I)});cache.set(e,A);return A};var calculateBoxSize=function(e,t,n){var r=calculateBoxSizes(e,n),i=r.borderBoxSize,a=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(t){case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:return o;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 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$1(){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 o=0;o<r;o++){if(o in e){a[o]=t.call(i,e[o],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 o=0;o<a;o++){if(_hasOwnProperty(e,i[o])){n.push(i[o])}}}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.
@@ -18,7 +18,7 @@ var __extends=this&&this.__extends||function(){var e=function(t,n){e=Object.setP
18
18
  /*!
19
19
  * Application Insights JavaScript SDK - Web Analytics, 2.5.10
20
20
  * Copyright (c) Microsoft and contributors. All rights reserved.
21
- */var durationProperty="duration";function _dispatchEvent(e,t){if(e&&e.dispatchEvent&&t){e.dispatchEvent(t)}}var ApplicationInsights=function(e){__extends(t,e);function t(){var t=e.call(this)||this;t.identifier=AnalyticsPluginIdentifier;t.priority=180;t.autoRoutePVDelay=500;t._trackAjaxAttempts=0;var n=getLocation$1();t._prevUri=n&&n.href||"";return t}t.getDefaultConfig=function(e){if(!e){e={}}e.sessionRenewalMs=30*60*1e3;e.sessionExpirationMs=24*60*60*1e3;e.disableExceptionTracking=Util.stringToBoolOrDefault(e.disableExceptionTracking);e.autoTrackPageVisitTime=Util.stringToBoolOrDefault(e.autoTrackPageVisitTime);e.overridePageViewDuration=Util.stringToBoolOrDefault(e.overridePageViewDuration);e.enableUnhandledPromiseRejectionTracking=Util.stringToBoolOrDefault(e.enableUnhandledPromiseRejectionTracking);if(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||e.samplingPercentage>=100){e.samplingPercentage=100}e.isCookieUseDisabled=Util.stringToBoolOrDefault(e.isCookieUseDisabled);e.isStorageUseDisabled=Util.stringToBoolOrDefault(e.isStorageUseDisabled);e.isBrowserLinkTrackingEnabled=Util.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled);e.enableAutoRouteTracking=Util.stringToBoolOrDefault(e.enableAutoRouteTracking);e.namePrefix=e.namePrefix||"";return e};t.prototype.processTelemetry=function(e,t){var n=this;doPerf(this.core,(function(){return n.identifier+":processTelemetry"}),(function(){var r=false;var i=n._telemetryInitializers.length;t=n._getTelCtx(t);for(var a=0;a<i;++a){var o=n._telemetryInitializers[a];if(o){try{if(o.apply(null,[e])===false){r=true;break}}catch(e){t.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)}}}if(!r){n.processNext(e,t)}}),(function(){return{item:e}}),!e.sync)};t.prototype.trackEvent=function(e,t){try{var n=TelemetryItemCreator.create(e,Event$1.dataType,Event$1.envelopeType,this.diagLog(),t);this.core.track(n)}catch(e){this.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.StartTrackEventFailed,"startTrackEvent failed, event will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,undefined,t)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.StopTrackEventFailed,"stopTrackEvent failed, event will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.trackTrace=function(e,t){try{var n=TelemetryItemCreator.create(e,Trace.dataType,Trace.envelopeType,this.diagLog(),t);this.core.track(n)}catch(e){this.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.trackMetric=function(e,t){try{var n=TelemetryItemCreator.create(e,Metric.dataType,Metric.envelopeType,this.diagLog(),t);this.core.track(n)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TrackMetricFailed,"trackMetric failed, metric will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,__assign({},n.properties,n.measurements,t));if(this.config.autoTrackPageVisitTime){this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TrackPVFailed,"trackPageView failed, page view will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.sendPageViewInternal=function(e,t,n){var r=getDocument();if(r){e.refUri=e.refUri===undefined?r.referrer:e.refUri}var i=TelemetryItemCreator.create(e,PageView.dataType,PageView.envelopeType,this.diagLog(),t,n);this.core.track(i);this._trackAjaxAttempts=0};t.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=TelemetryItemCreator.create(e,PageViewPerformance.dataType,PageViewPerformance.envelopeType,this.diagLog(),t,n);this.core.track(r)};t.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e);this.sendPageViewPerformanceInternal(e,t)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TrackPVFailed,"trackPageViewPerformance failed, page view will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.startTrackPage=function(e){try{if(typeof e!=="string"){var t=getDocument();e=t&&t.title||""}this._pageTracking.start(e)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.StartTrackFailed,"startTrackPage failed, page view may not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.stopTrackPage=function(e,t,n,r){try{if(typeof e!=="string"){var i=getDocument();e=i&&i.title||""}if(typeof t!=="string"){var a=getLocation$1();t=a&&a.href||""}this._pageTracking.stop(e,t,n,r);if(this.config.autoTrackPageVisitTime){this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.StopTrackFailed,"stopTrackPage failed, page view will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.sendExceptionInternal=function(e,t,n){var r=new Exception(this.diagLog(),e.exception||new Error(Util.NotSpecified),e.properties,e.measurements,e.severityLevel,e.id).toInterface();var i=TelemetryItemCreator.create(r,Exception.dataType,Exception.envelopeType,this.diagLog(),t,n);this.core.track(i)};t.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TrackExceptionFailed,"trackException failed, exception will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype._onerror=function(e){try{var t={url:e&&e.url||(getDocument()||{}).URL,lineNumber:e.lineNumber,columnNumber:e.columnNumber,message:e.message};if(Util.isCrossOriginError(e.message,e.url,e.lineNumber,e.columnNumber,e.error)){this._sendCORSException(t.url)}else{if(!Util.isError(e.error)){var n="window.onerror@"+t.url+":"+e.lineNumber+":"+(e.columnNumber||0);e.error=new Error(e.message);e.error.stack=n}this.trackException({exception:e.error,severityLevel:SeverityLevel.Error},t)}}catch(t){var r=e.error?e.error.name+", "+e.error.message:"null";this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.ExceptionWhileLoggingError,"_onError threw exception while logging error, error will not be collected: "+Util.getExceptionName(t),{exception:Util.dump(t),errorString:r})}};t.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)};t.prototype.initialize=function(n,r,i,a){var o=this;if(this.isInitialized()){return}if(CoreUtils.isNullOrUndefined(r)){throw Error("Error initializing")}e.prototype.initialize.call(this,n,r,i,a);this.setInitialized(false);var s=this._getTelCtx();var u=this.identifier;this._globalconfig={instrumentationKey:n.instrumentationKey,endpointUrl:n.endpointUrl||"https://dc.services.visualstudio.com/v2/track"};this.config=s.getExtCfg(u);var l=t.getDefaultConfig();if(l!==undefined){objForEachKey(l,(function(e,t){o.config[e]=s.getConfig(u,e,t)}));if(this._globalconfig){objForEachKey(l,(function(e,t){if(o._globalconfig[e]===undefined){o._globalconfig[e]=t}}))}}if(this.config.isCookieUseDisabled){Util.disableCookies()}if(this.config.isStorageUseDisabled){Util.disableStorage()}var c={instrumentationKey:function(){return n.instrumentationKey},accountId:function(){return o.config.accountId||n.accountId},sessionRenewalMs:function(){return o.config.sessionRenewalMs||n.sessionRenewalMs},sessionExpirationMs:function(){return o.config.sessionExpirationMs||n.sessionExpirationMs},sampleRate:function(){return o.config.samplingPercentage||n.samplingPercentage},cookieDomain:function(){return o.config.cookieDomain||n.cookieDomain},sdkExtension:function(){return o.config.sdkExtension||n.sdkExtension},isBrowserLinkTrackingEnabled:function(){return o.config.isBrowserLinkTrackingEnabled||n.isBrowserLinkTrackingEnabled},appId:function(){return o.config.appId||n.appId}};this._pageViewPerformanceManager=new PageViewPerformanceManager(this.core);this._pageViewManager=new PageViewManager(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager);this._pageVisitTimeManager=new PageVisitTimeManager(this.diagLog(),(function(e,t,n){return o.trackPageVisitTime(e,t,n)}));this._telemetryInitializers=this._telemetryInitializers||[];this._addDefaultTelemetryInitializers(c);this._eventTracking=new Timing(this.diagLog(),"trackEvent");this._eventTracking.action=function(e,t,n,r){if(!r){r={}}r[durationProperty]=n.toString();o.trackEvent({name:e,properties:r})};this._pageTracking=new Timing(this.diagLog(),"trackPageView");this._pageTracking.action=function(e,t,n,r,i){if(CoreUtils.isNullOrUndefined(r)){r={}}r[durationProperty]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a,r)};var d=getWindow();var f=getHistory();var p=getLocation$1();var h=this;if(this.config.disableExceptionTracking===false&&!this.config.autoExceptionInstrumented&&d){var g="onerror";var v=d[g];d.onerror=function(e,t,n,r,i){var a=v&&v(e,t,n,r,i);if(a!==true){h._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i})}return a};this.config.autoExceptionInstrumented=true}if(this.config.disableExceptionTracking===false&&this.config.enableUnhandledPromiseRejectionTracking===true&&!this.config.autoUnhandledPromiseInstrumented&&d){var m="onunhandledrejection";var y=d[m];d[m]=function(e){var t=y&&y.call(d,e);if(t!==true){h._onerror({message:e.reason.toString(),error:e.reason instanceof Error?e.reason:new Error(e.reason.toString()),url:p?p.href:"",lineNumber:0,columnNumber:0})}return t};this.config.autoUnhandledPromiseInstrumented=true}if(this.config.enableAutoRouteTracking===true&&f&&CoreUtils.isFunction(f.pushState)&&CoreUtils.isFunction(f.replaceState)&&d&&typeof Event!=="undefined"){var S=this;CoreUtils.arrForEach(i,(function(e){if(e.identifier===PropertiesPluginIdentifier){o._properties=e}}));f.pushState=function(e){return function t(){var n=e.apply(this,arguments);_dispatchEvent(d,Util.createDomEvent(S.config.namePrefix+"pushState"));_dispatchEvent(d,Util.createDomEvent(S.config.namePrefix+"locationchange"));return n}}(f.pushState);f.replaceState=function(e){return function t(){var n=e.apply(this,arguments);_dispatchEvent(d,Util.createDomEvent(S.config.namePrefix+"replaceState"));_dispatchEvent(d,Util.createDomEvent(S.config.namePrefix+"locationchange"));return n}}(f.replaceState);if(d.addEventListener){d.addEventListener(S.config.namePrefix+"popstate",(function(){_dispatchEvent(d,Util.createDomEvent(S.config.namePrefix+"locationchange"))}));d.addEventListener(S.config.namePrefix+"locationchange",(function(){if(S._properties&&S._properties.context&&S._properties.context.telemetryTrace){S._properties.context.telemetryTrace.traceID=Util.generateW3CId();S._properties.context.telemetryTrace.name=p&&p.pathname||"_unknown_"}if(o._currUri){o._prevUri=o._currUri;o._currUri=p&&p.href||""}else{o._currUri=p&&p.href||""}setTimeout(function(e){S.trackPageView({refUri:e,properties:{duration:0}})}.bind(o,o._prevUri),S.autoRoutePVDelay)}))}}this.setInitialized(true)};t.prototype.trackPageVisitTime=function(e,t,n){var r={PageName:e,PageUrl:t};this.trackMetric({name:"PageVisitTime",average:n,max:n,min:n,sampleCount:1},r)};t.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var t=["/browserLinkSignalR/","/__browserLink/"];var n=function(e){if(e.baseType===RemoteDependencyData$1.dataType){var n=e.baseData;if(n){for(var r=0;r<t.length;r++){if(n.target&&n.target.indexOf(t[r])>=0){return false}}}}return true};this._addTelemetryInitializer(n)}};t.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)};t.prototype._sendCORSException=function(e){var t={message:"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",url:e,lineNumber:0,columnNumber:0,error:undefined};var n=TelemetryItemCreator.create(t,Exception.dataType,Exception.envelopeType,this.diagLog(),{url:e});this.core.track(n)};t.Version="2.5.10";return t}(BaseTelemetryPlugin);var Timing=function(){function e(e,t){this._name=t;this._events={};this._logger=e}e.prototype.start=function(e){if(typeof this._events[e]!=="undefined"){this._logger.throwInternal(LoggingSeverity.WARNING,_InternalMessageId.StartCalledMoreThanOnce,"start was called more than once for this event without calling stop.",{name:this._name,key:e},true)}this._events[e]=+new Date};e.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i)){this._logger.throwInternal(LoggingSeverity.WARNING,_InternalMessageId.StopCalledWithoutStart,"stop was called without a corresponding start.",{name:this._name,key:e},true)}else{var a=+new Date;var o=DateTimeUtils.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e];this._events[e]=undefined};return e}();
21
+ */var durationProperty="duration";function _dispatchEvent(e,t){if(e&&e.dispatchEvent&&t){e.dispatchEvent(t)}}var ApplicationInsights=function(e){__extends(t,e);function t(){var t=e.call(this)||this;t.identifier=AnalyticsPluginIdentifier;t.priority=180;t.autoRoutePVDelay=500;t._trackAjaxAttempts=0;var n=getLocation$1();t._prevUri=n&&n.href||"";return t}t.getDefaultConfig=function(e){if(!e){e={}}e.sessionRenewalMs=30*60*1e3;e.sessionExpirationMs=24*60*60*1e3;e.disableExceptionTracking=Util.stringToBoolOrDefault(e.disableExceptionTracking);e.autoTrackPageVisitTime=Util.stringToBoolOrDefault(e.autoTrackPageVisitTime);e.overridePageViewDuration=Util.stringToBoolOrDefault(e.overridePageViewDuration);e.enableUnhandledPromiseRejectionTracking=Util.stringToBoolOrDefault(e.enableUnhandledPromiseRejectionTracking);if(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||e.samplingPercentage>=100){e.samplingPercentage=100}e.isCookieUseDisabled=Util.stringToBoolOrDefault(e.isCookieUseDisabled);e.isStorageUseDisabled=Util.stringToBoolOrDefault(e.isStorageUseDisabled);e.isBrowserLinkTrackingEnabled=Util.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled);e.enableAutoRouteTracking=Util.stringToBoolOrDefault(e.enableAutoRouteTracking);e.namePrefix=e.namePrefix||"";return e};t.prototype.processTelemetry=function(e,t){var n=this;doPerf(this.core,(function(){return n.identifier+":processTelemetry"}),(function(){var r=false;var i=n._telemetryInitializers.length;t=n._getTelCtx(t);for(var a=0;a<i;++a){var o=n._telemetryInitializers[a];if(o){try{if(o.apply(null,[e])===false){r=true;break}}catch(e){t.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)}}}if(!r){n.processNext(e,t)}}),(function(){return{item:e}}),!e.sync)};t.prototype.trackEvent=function(e,t){try{var n=TelemetryItemCreator.create(e,Event$1.dataType,Event$1.envelopeType,this.diagLog(),t);this.core.track(n)}catch(e){this.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.StartTrackEventFailed,"startTrackEvent failed, event will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,undefined,t)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.StopTrackEventFailed,"stopTrackEvent failed, event will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.trackTrace=function(e,t){try{var n=TelemetryItemCreator.create(e,Trace.dataType,Trace.envelopeType,this.diagLog(),t);this.core.track(n)}catch(e){this.diagLog().throwInternal(LoggingSeverity.WARNING,_InternalMessageId.TrackTraceFailed,"trackTrace failed, trace will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.trackMetric=function(e,t){try{var n=TelemetryItemCreator.create(e,Metric.dataType,Metric.envelopeType,this.diagLog(),t);this.core.track(n)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TrackMetricFailed,"trackMetric failed, metric will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,__assign({},n.properties,n.measurements,t));if(this.config.autoTrackPageVisitTime){this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TrackPVFailed,"trackPageView failed, page view will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.sendPageViewInternal=function(e,t,n){var r=getDocument();if(r){e.refUri=e.refUri===undefined?r.referrer:e.refUri}var i=TelemetryItemCreator.create(e,PageView.dataType,PageView.envelopeType,this.diagLog(),t,n);this.core.track(i);this._trackAjaxAttempts=0};t.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=TelemetryItemCreator.create(e,PageViewPerformance.dataType,PageViewPerformance.envelopeType,this.diagLog(),t,n);this.core.track(r)};t.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e);this.sendPageViewPerformanceInternal(e,t)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TrackPVFailed,"trackPageViewPerformance failed, page view will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.startTrackPage=function(e){try{if(typeof e!=="string"){var t=getDocument();e=t&&t.title||""}this._pageTracking.start(e)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.StartTrackFailed,"startTrackPage failed, page view may not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.stopTrackPage=function(e,t,n,r){try{if(typeof e!=="string"){var i=getDocument();e=i&&i.title||""}if(typeof t!=="string"){var a=getLocation$1();t=a&&a.href||""}this._pageTracking.stop(e,t,n,r);if(this.config.autoTrackPageVisitTime){this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.StopTrackFailed,"stopTrackPage failed, page view will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype.sendExceptionInternal=function(e,t,n){var r=new Exception(this.diagLog(),e.exception||new Error(Util.NotSpecified),e.properties,e.measurements,e.severityLevel,e.id).toInterface();var i=TelemetryItemCreator.create(r,Exception.dataType,Exception.envelopeType,this.diagLog(),t,n);this.core.track(i)};t.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(e){this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.TrackExceptionFailed,"trackException failed, exception will not be collected: "+Util.getExceptionName(e),{exception:Util.dump(e)})}};t.prototype._onerror=function(e){try{var t={url:e&&e.url||(getDocument()||{}).URL,lineNumber:e.lineNumber,columnNumber:e.columnNumber,message:e.message};if(Util.isCrossOriginError(e.message,e.url,e.lineNumber,e.columnNumber,e.error)){this._sendCORSException(t.url)}else{if(!Util.isError(e.error)){var n="window.onerror@"+t.url+":"+e.lineNumber+":"+(e.columnNumber||0);e.error=new Error(e.message);e.error.stack=n}this.trackException({exception:e.error,severityLevel:SeverityLevel.Error},t)}}catch(t){var r=e.error?e.error.name+", "+e.error.message:"null";this.diagLog().throwInternal(LoggingSeverity.CRITICAL,_InternalMessageId.ExceptionWhileLoggingError,"_onError threw exception while logging error, error will not be collected: "+Util.getExceptionName(t),{exception:Util.dump(t),errorString:r})}};t.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)};t.prototype.initialize=function(n,r,i,a){var o=this;if(this.isInitialized()){return}if(CoreUtils.isNullOrUndefined(r)){throw Error("Error initializing")}e.prototype.initialize.call(this,n,r,i,a);this.setInitialized(false);var s=this._getTelCtx();var u=this.identifier;this._globalconfig={instrumentationKey:n.instrumentationKey,endpointUrl:n.endpointUrl||"https://dc.services.visualstudio.com/v2/track"};this.config=s.getExtCfg(u);var l=t.getDefaultConfig();if(l!==undefined){objForEachKey(l,(function(e,t){o.config[e]=s.getConfig(u,e,t)}));if(this._globalconfig){objForEachKey(l,(function(e,t){if(o._globalconfig[e]===undefined){o._globalconfig[e]=t}}))}}if(this.config.isCookieUseDisabled){Util.disableCookies()}if(this.config.isStorageUseDisabled){Util.disableStorage()}var c={instrumentationKey:function(){return n.instrumentationKey},accountId:function(){return o.config.accountId||n.accountId},sessionRenewalMs:function(){return o.config.sessionRenewalMs||n.sessionRenewalMs},sessionExpirationMs:function(){return o.config.sessionExpirationMs||n.sessionExpirationMs},sampleRate:function(){return o.config.samplingPercentage||n.samplingPercentage},cookieDomain:function(){return o.config.cookieDomain||n.cookieDomain},sdkExtension:function(){return o.config.sdkExtension||n.sdkExtension},isBrowserLinkTrackingEnabled:function(){return o.config.isBrowserLinkTrackingEnabled||n.isBrowserLinkTrackingEnabled},appId:function(){return o.config.appId||n.appId}};this._pageViewPerformanceManager=new PageViewPerformanceManager(this.core);this._pageViewManager=new PageViewManager(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager);this._pageVisitTimeManager=new PageVisitTimeManager(this.diagLog(),(function(e,t,n){return o.trackPageVisitTime(e,t,n)}));this._telemetryInitializers=this._telemetryInitializers||[];this._addDefaultTelemetryInitializers(c);this._eventTracking=new Timing(this.diagLog(),"trackEvent");this._eventTracking.action=function(e,t,n,r){if(!r){r={}}r[durationProperty]=n.toString();o.trackEvent({name:e,properties:r})};this._pageTracking=new Timing(this.diagLog(),"trackPageView");this._pageTracking.action=function(e,t,n,r,i){if(CoreUtils.isNullOrUndefined(r)){r={}}r[durationProperty]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a,r)};var d=getWindow();var f=getHistory();var p=getLocation$1();var h=this;if(this.config.disableExceptionTracking===false&&!this.config.autoExceptionInstrumented&&d){var g="onerror";var v=d[g];d.onerror=function(e,t,n,r,i){var a=v&&v(e,t,n,r,i);if(a!==true){h._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i})}return a};this.config.autoExceptionInstrumented=true}if(this.config.disableExceptionTracking===false&&this.config.enableUnhandledPromiseRejectionTracking===true&&!this.config.autoUnhandledPromiseInstrumented&&d){var m="onunhandledrejection";var y=d[m];d[m]=function(e){var t=y&&y.call(d,e);if(t!==true){h._onerror({message:e.reason.toString(),error:e.reason instanceof Error?e.reason:new Error(e.reason.toString()),url:p?p.href:"",lineNumber:0,columnNumber:0})}return t};this.config.autoUnhandledPromiseInstrumented=true}if(this.config.enableAutoRouteTracking===true&&f&&CoreUtils.isFunction(f.pushState)&&CoreUtils.isFunction(f.replaceState)&&d&&typeof Event!=="undefined"){var b=this;CoreUtils.arrForEach(i,(function(e){if(e.identifier===PropertiesPluginIdentifier){o._properties=e}}));f.pushState=function(e){return function t(){var n=e.apply(this,arguments);_dispatchEvent(d,Util.createDomEvent(b.config.namePrefix+"pushState"));_dispatchEvent(d,Util.createDomEvent(b.config.namePrefix+"locationchange"));return n}}(f.pushState);f.replaceState=function(e){return function t(){var n=e.apply(this,arguments);_dispatchEvent(d,Util.createDomEvent(b.config.namePrefix+"replaceState"));_dispatchEvent(d,Util.createDomEvent(b.config.namePrefix+"locationchange"));return n}}(f.replaceState);if(d.addEventListener){d.addEventListener(b.config.namePrefix+"popstate",(function(){_dispatchEvent(d,Util.createDomEvent(b.config.namePrefix+"locationchange"))}));d.addEventListener(b.config.namePrefix+"locationchange",(function(){if(b._properties&&b._properties.context&&b._properties.context.telemetryTrace){b._properties.context.telemetryTrace.traceID=Util.generateW3CId();b._properties.context.telemetryTrace.name=p&&p.pathname||"_unknown_"}if(o._currUri){o._prevUri=o._currUri;o._currUri=p&&p.href||""}else{o._currUri=p&&p.href||""}setTimeout(function(e){b.trackPageView({refUri:e,properties:{duration:0}})}.bind(o,o._prevUri),b.autoRoutePVDelay)}))}}this.setInitialized(true)};t.prototype.trackPageVisitTime=function(e,t,n){var r={PageName:e,PageUrl:t};this.trackMetric({name:"PageVisitTime",average:n,max:n,min:n,sampleCount:1},r)};t.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var t=["/browserLinkSignalR/","/__browserLink/"];var n=function(e){if(e.baseType===RemoteDependencyData$1.dataType){var n=e.baseData;if(n){for(var r=0;r<t.length;r++){if(n.target&&n.target.indexOf(t[r])>=0){return false}}}}return true};this._addTelemetryInitializer(n)}};t.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)};t.prototype._sendCORSException=function(e){var t={message:"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",url:e,lineNumber:0,columnNumber:0,error:undefined};var n=TelemetryItemCreator.create(t,Exception.dataType,Exception.envelopeType,this.diagLog(),{url:e});this.core.track(n)};t.Version="2.5.10";return t}(BaseTelemetryPlugin);var Timing=function(){function e(e,t){this._name=t;this._events={};this._logger=e}e.prototype.start=function(e){if(typeof this._events[e]!=="undefined"){this._logger.throwInternal(LoggingSeverity.WARNING,_InternalMessageId.StartCalledMoreThanOnce,"start was called more than once for this event without calling stop.",{name:this._name,key:e},true)}this._events[e]=+new Date};e.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i)){this._logger.throwInternal(LoggingSeverity.WARNING,_InternalMessageId.StopCalledWithoutStart,"stop was called without a corresponding start.",{name:this._name,key:e},true)}else{var a=+new Date;var o=DateTimeUtils.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e];this._events[e]=undefined};return e}();
22
22
  /*!
23
23
  * Application Insights JavaScript SDK - Channel, 2.5.10
24
24
  * 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 o;dynamicProto(t,n,(function(e,s){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){s.initialize(n,a,u,l);var f=e._getTelCtx();var p=e.identifier;o=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(!_(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 g=getGlobalInst("XMLHttpRequest");if(g){var v=new g;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 s=o.serialize(i);var u=e._buffer.getItems();var c=e._buffer.batchPayloads(u);if(c&&c.length+s.length>e._senderConfig.maxBatchSizeInBytes()){e.triggerSend(true,null,10)}e._buffer.enqueue(s);g()}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,m(t))}}else if(Offline.isOffline()){if(!e._senderConfig.isRetryDisabled()){var o=10;p(n,o);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,m(t))}}else{r=0;e._onSuccess(n,i)}}}};e.triggerSend=function(t,r,o){if(t===void 0){t=true}try{if(!e._senderConfig.disableTelemetry()){if(e._buffer.count()>0){var s=e._buffer.getItems();w(o||0,t);if(r){r.call(n,s,t)}else{e._sender(s,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 o=0,s=a;o<s.length;o++){var u=s[o];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,m(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 o=getNavigator().sendBeacon(r,a);if(o){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,m(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 o=a[i];e._buffer.enqueue(o)}h(n);g()}function h(e){var t=10;var n;if(r<=1){n=t}else{var a=(Math.pow(2,r)-1)/2;var o=Math.floor(Math.random()*a*t)+1;o=e*o;n=Math.max(Math.min(o,3600),t)}var s=CoreUtils.dateNow()+n*1e3;i=s}function g(){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 m(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 o=e._senderConfig.endpointUrl().replace(/^(https?:)/,"");i.open("POST",o);var s=e._buffer.batchPayloads(t);i.send(s);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 w(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 _(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 o=[e,t,n];if(r<i){a.setTime(r)}else{a.setTime(i)}var s=this.config.cookieDomain?this.config.cookieDomain():null;var u=this.config.sessionExpirationMs()===0?"0":a.toUTCString();Util.setCookie(this._logger,this._storageNamePrefix(),o.join("|")+";expires="+u,s);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 o=CoreUtils.toISOString(a);this.accountAcquisitionDate=o;this.isNewUser=true;a.setTime(a.getTime()+31536e6);var s=[this.id,o];var u=this.config.cookieDomain?this.config.cookieDomain():undefined;Util.setCookie(this._logger,e.userCookieName,s.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$1();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 o=this;e.prototype.initialize.call(this,n,r,i,a);var s=this._getTelCtx();var u=this.identifier;var l=t.getDefaultConfig();this._extensionConfig=this._extensionConfig||t.getDefaultConfig();objForEachKey(l,(function(e,t){o._extensionConfig[e]=function(){return s.getConfig(u,e,t())}}));this.context=new TelemetryContext(r.logger,this._extensionConfig);this._breezeChannel=Util.getExtension(i,BreezeChannelIdentifier);this.context.appId=function(){return o._breezeChannel?o._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 o;dynamicProto(t,n,(function(e,s){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){s.initialize(n,a,u,l);var f=e._getTelCtx();var p=e.identifier;o=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(!_(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 g=getGlobalInst("XMLHttpRequest");if(g){var v=new g;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 s=o.serialize(i);var u=e._buffer.getItems();var c=e._buffer.batchPayloads(u);if(c&&c.length+s.length>e._senderConfig.maxBatchSizeInBytes()){e.triggerSend(true,null,10)}e._buffer.enqueue(s);g()}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,m(t))}}else if(Offline.isOffline()){if(!e._senderConfig.isRetryDisabled()){var o=10;p(n,o);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,m(t))}}else{r=0;e._onSuccess(n,i)}}}};e.triggerSend=function(t,r,o){if(t===void 0){t=true}try{if(!e._senderConfig.disableTelemetry()){if(e._buffer.count()>0){var s=e._buffer.getItems();w(o||0,t);if(r){r.call(n,s,t)}else{e._sender(s,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 o=0,s=a;o<s.length;o++){var u=s[o];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,m(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,b(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 o=getNavigator().sendBeacon(r,a);if(o){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,m(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 o=a[i];e._buffer.enqueue(o)}h(n);g()}function h(e){var t=10;var n;if(r<=1){n=t}else{var a=(Math.pow(2,r)-1)/2;var o=Math.floor(Math.random()*a*t)+1;o=e*o;n=Math.max(Math.min(o,3600),t)}var s=CoreUtils.dateNow()+n*1e3;i=s}function g(){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 m(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,b(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 o=e._senderConfig.endpointUrl().replace(/^(https?:)/,"");i.open("POST",o);var s=e._buffer.batchPayloads(t);i.send(s);e._buffer.markAsSent(t)}function b(e,t){if(e){return"XDomainRequest,Response:"+_getResponseText(e)||""}return t}function S(){var t="getNotifyMgr";if(e.core[t]){return e.core[t]()}return e.core["_notificationManager"]}function w(t,n){var r=S();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 _(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 o=[e,t,n];if(r<i){a.setTime(r)}else{a.setTime(i)}var s=this.config.cookieDomain?this.config.cookieDomain():null;var u=this.config.sessionExpirationMs()===0?"0":a.toUTCString();Util.setCookie(this._logger,this._storageNamePrefix(),o.join("|")+";expires="+u,s);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 o=CoreUtils.toISOString(a);this.accountAcquisitionDate=o;this.isNewUser=true;a.setTime(a.getTime()+31536e6);var s=[this.id,o];var u=this.config.cookieDomain?this.config.cookieDomain():undefined;Util.setCookie(this._logger,e.userCookieName,s.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$1();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 o=this;e.prototype.initialize.call(this,n,r,i,a);var s=this._getTelCtx();var u=this.identifier;var l=t.getDefaultConfig();this._extensionConfig=this._extensionConfig||t.getDefaultConfig();objForEachKey(l,(function(e,t){o._extensionConfig[e]=function(){return s.getConfig(u,e,t())}}));this.context=new TelemetryContext(r.logger,this._extensionConfig);this._breezeChannel=Util.getExtension(i,BreezeChannelIdentifier);this.context.appId=function(){return o._breezeChannel?o._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 o=_calcPerfDuration(n,r,i);if(o){a=_setPerfValue(e,t,Util.msToTimeSpan(o))}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 o="name";var s="Start";var u="End";var l="domainLookup";var c="connect";var d="redirect";var f="request";var p="response";var h="duration";var g="startTime";var v=l+s;var m=l+u;var y=c+s;var S=c+u;var b=f+s;var w=f+u;var _=p+s;var x=p+u;var C=d+s;var I=d=u;var T="transferSize";var E="encodedBodySize";var A="decodedBodySize";var F="serverTiming";if(n){i|=_setPerfDuration(r,d,n,C,I);i|=_setPerfDuration(r,l,n,v,m);i|=_setPerfDuration(r,c,n,y,S);i|=_setPerfDuration(r,f,n,b,w);i|=_setPerfDuration(r,p,n,_,x);i|=_setPerfDuration(r,"networkConnect",n,g,S);i|=_setPerfDuration(r,"sentRequest",n,b,x);var P=n[h];if(!P){P=_calcPerfDuration(n,g,x)||0}i|=_setPerfValue(r,h,P);i|=_setPerfValue(r,"perfTotal",P);var N=n[F];if(N){var D={};_arrForEach$1(N,(function(e,t){var n=normalizeJsName(e[o]||""+t);var r=D[n]||{};objForEachKey(e,(function(e,t){if(e!==o&&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,T,n[T]);i|=_setPerfValue(r,E,n[E]);i|=_setPerfValue(r,A,n[A])}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 o="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 s=a.correlationContext;if(s){i.correlationContext=s}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][o]=a[o]?a.statusText+" - "+a[o]:a.statusText}if(u==="json"){i[strProperties$1][o]=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 o=_calcPerfDuration(n,r,i);if(o){a=_setPerfValue(e,t,Util.msToTimeSpan(o))}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 o="name";var s="Start";var u="End";var l="domainLookup";var c="connect";var d="redirect";var f="request";var p="response";var h="duration";var g="startTime";var v=l+s;var m=l+u;var y=c+s;var b=c+u;var S=f+s;var w=f+u;var _=p+s;var x=p+u;var C=d+s;var I=d=u;var T="transferSize";var E="encodedBodySize";var A="decodedBodySize";var F="serverTiming";if(n){i|=_setPerfDuration(r,d,n,C,I);i|=_setPerfDuration(r,l,n,v,m);i|=_setPerfDuration(r,c,n,y,b);i|=_setPerfDuration(r,f,n,S,w);i|=_setPerfDuration(r,p,n,_,x);i|=_setPerfDuration(r,"networkConnect",n,g,b);i|=_setPerfDuration(r,"sentRequest",n,S,x);var P=n[h];if(!P){P=_calcPerfDuration(n,g,x)||0}i|=_setPerfValue(r,h,P);i|=_setPerfValue(r,"perfTotal",P);var N=n[F];if(N){var D={};_arrForEach$1(N,(function(e,t){var n=normalizeJsName(e[o]||""+t);var r=D[n]||{};objForEachKey(e,(function(e,t){if(e!==o&&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,T,n[T]);i|=_setPerfValue(r,E,n[E]);i|=_setPerfValue(r,A,n[A])}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 o="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 s=a.correlationContext;if(s){i.correlationContext=s}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][o]=a[o]?a.statusText+" - "+a[o]:a.statusText}if(u==="json"){i[strProperties$1][o]=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,7 +62,7 @@ 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$1();var a=false;var o=false;var s=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 g=false;var v=0;var m=false;var y=[];var S={};dynamicProto(t,n,(function(e,n){e.initialize=function(r,a,o,s){if(!e.isInitialized()){n.initialize(r,a,o,s);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;g=u.enableAjaxPerfTracking;v=u.maxAjaxCallsPerView;m=u.enableResponseHeaderTracking;p=S===DistributedTracingModes.AI||S===DistributedTracingModes.AI_AND_W3C;f=S===DistributedTracingModes.AI_AND_W3C||S===DistributedTracingModes.W3C;if(g){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){w()}i();if(o.length>0&&o){var _=void 0,x=0;while(!_&&x<o.length){if(o[x]&&o[x].identifier===PropertiesPluginIdentifier){_=o[x]}x++}if(_){d=_.context}}}};e.teardown=function(){_arrForEach$2(y,(function(e){e.rm()}));y=[];a=false;o=false;e.setInitialized(false)};e.trackDependencyData=function(t,n){e[r](t,n)};e.includeCorrelationHeaders=function(t,n,r,i){var a=e["_currentWindowHost"]||s;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 o="|"+t.traceID+"."+t.spanID;r.headers.set(RequestHeaders.requestIdHeader,o);if(l){t.requestHeaders[RequestHeaders.requestIdHeader]=o}}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 o="|"+t.traceID+"."+t.spanID;i.setRequestHeader(RequestHeaders.requestIdHeader,o);if(l){t.requestHeaders[RequestHeaders.requestIdHeader]=o}}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 s;if(a&&!_(null,n,i)&&!(r&&o)){var u=t.ctx();s=N(n,i);var l=e.includeCorrelationHeaders(s,n,i);if(l!==i){t.set(1,l)}u.data=s}},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(m){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){_(null,t,n)}}))}if(r){n[strFetch].polyfill=r}}function b(e,t,n){y.push(InstrumentProto(e,t,n))}function w(){if(_supportsAjaxMonitoring(e)&&!o){b(XMLHttpRequest,"open",{req:function(e,t,n,r){var i=e.inst;var a=i[strAjaxData];if(!_(i,n)&&x(i,true)&&(!a||!a.xhrMonitoringState.openDone)){C(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(x(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(x(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(x(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.")})}o=true}}function _(e,t,n){var r=false;var i=((!CoreUtils.isString(t)?(t||{}).url||"":t)||"").toLowerCase();var a=_indexOf(i,"?");var o=_indexOf(i,"#");if(a===-1||o!==-1&&o<a){a=o}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 x(e,t){var n=true;var r=o;if(!_isNullOrUndefined$3(e)){n=t===true||!_isNullOrUndefined$3(e[strAjaxData])}return r&&n}function C(t,n,r,i){var a=d&&d.telemetryTrace&&d.telemetryTrace.traceID||Util.generateW3CId();var o=Util.generateW3CId().substr(0,16);var s=new ajaxRecord(a,o,e[strDiagLog]());s.method=n;s.requestUrl=r;s.xhrMonitoringState.openDone=true;s.requestHeaders={};s.async=i;t[strAjaxData]=s;I(t)}function I(t){t[strAjaxData].xhrMonitoringState.stateChangeAttached=EventHelper.Attach(t,"readystatechange",(function(){try{if(t&&t.readyState===4&&x(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 T(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)}P("xmlhttprequest",n,(function(){try{var a=n.CreateTrackItem("Ajax",l,(function(){var e={statusText:t.statusText,headerMap:null,correlationContext:A(t),type:t.responseType,responseText:T(t),response:t.response};if(m){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 A(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&&g){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 P(e,t,n,r){var i=t.perfMark;var a=getPerformance();var o=u.maxAjaxPerfLookupAttempts;var s=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>=o||t.async===false){if(i&&CoreUtils.isFunction(a.clearMarks)){a.clearMarks(i.name)}t.perfAttempts=c;n()}else{setTimeout(u,s)}}catch(e){r(e)}})()}function N(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 o="GET";if(n&&n.method){o=n.method}else if(t&&t instanceof Request){o=t.method}a.method=o;var s={};if(l){var u=new Headers((n?n.headers:0)||(t instanceof Request?t.headers||{}:{}));u.forEach((function(e,t){s[t]=e}))}a.requestHeaders=s;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,o,s){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;P("fetch",a,(function(){var t=a.CreateTrackItem("Fetch",l,o);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);
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$1();var a=false;var o=false;var s=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 g=false;var v=0;var m=false;var y=[];var b={};dynamicProto(t,n,(function(e,n){e.initialize=function(r,a,o,s){if(!e.isInitialized()){n.initialize(r,a,o,s);var c=e._getTelCtx();var y=t.getDefaultConfig();objForEachKey(y,(function(e,n){u[e]=c.getConfig(t.identifier,e,n)}));var b=u.distributedTracingMode;l=u.enableRequestHeaderTracking;g=u.enableAjaxPerfTracking;v=u.maxAjaxCallsPerView;m=u.enableResponseHeaderTracking;p=b===DistributedTracingModes.AI||b===DistributedTracingModes.AI_AND_W3C;f=b===DistributedTracingModes.AI_AND_W3C||b===DistributedTracingModes.W3C;if(g){var S=r.instrumentationKey||"unkwn";if(S.length>5){h=AJAX_MONITOR_PREFIX+S.substring(S.length-5)+"."}else{h=AJAX_MONITOR_PREFIX+S+"."}}if(u.disableAjaxTracking===false){w()}i();if(o.length>0&&o){var _=void 0,x=0;while(!_&&x<o.length){if(o[x]&&o[x].identifier===PropertiesPluginIdentifier){_=o[x]}x++}if(_){d=_.context}}}};e.teardown=function(){_arrForEach$2(y,(function(e){e.rm()}));y=[];a=false;o=false;e.setInitialized(false)};e.trackDependencyData=function(t,n){e[r](t,n)};e.includeCorrelationHeaders=function(t,n,r,i){var a=e["_currentWindowHost"]||s;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 o="|"+t.traceID+"."+t.spanID;r.headers.set(RequestHeaders.requestIdHeader,o);if(l){t.requestHeaders[RequestHeaders.requestIdHeader]=o}}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 o="|"+t.traceID+"."+t.spanID;i.setRequestHeader(RequestHeaders.requestIdHeader,o);if(l){t.requestHeaders[RequestHeaders.requestIdHeader]=o}}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 s;if(a&&!_(null,n,i)&&!(r&&o)){var u=t.ctx();s=N(n,i);var l=e.includeCorrelationHeaders(s,n,i);if(l!==i){t.set(1,l)}u.data=s}},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(m){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){_(null,t,n)}}))}if(r){n[strFetch].polyfill=r}}function S(e,t,n){y.push(InstrumentProto(e,t,n))}function w(){if(_supportsAjaxMonitoring(e)&&!o){S(XMLHttpRequest,"open",{req:function(e,t,n,r){var i=e.inst;var a=i[strAjaxData];if(!_(i,n)&&x(i,true)&&(!a||!a.xhrMonitoringState.openDone)){C(i,t,n,r)}},hkErr:_createErrorCallbackFunc(e,_InternalMessageId.FailedMonitorAjaxOpen,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.")});S(XMLHttpRequest,"send",{req:function(t,n){var r=t.inst;var i=r[strAjaxData];if(x(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.")});S(XMLHttpRequest,"abort",{req:function(e){var t=e.inst;var n=t[strAjaxData];if(x(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){S(XMLHttpRequest,"setRequestHeader",{req:function(e,t,n){var r=e.inst;if(x(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.")})}o=true}}function _(e,t,n){var r=false;var i=((!CoreUtils.isString(t)?(t||{}).url||"":t)||"").toLowerCase();var a=_indexOf(i,"?");var o=_indexOf(i,"#");if(a===-1||o!==-1&&o<a){a=o}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(!b[i]){b[i]=1}}else{if(b[i]){r=true}}return r}function x(e,t){var n=true;var r=o;if(!_isNullOrUndefined$3(e)){n=t===true||!_isNullOrUndefined$3(e[strAjaxData])}return r&&n}function C(t,n,r,i){var a=d&&d.telemetryTrace&&d.telemetryTrace.traceID||Util.generateW3CId();var o=Util.generateW3CId().substr(0,16);var s=new ajaxRecord(a,o,e[strDiagLog]());s.method=n;s.requestUrl=r;s.xhrMonitoringState.openDone=true;s.requestHeaders={};s.async=i;t[strAjaxData]=s;I(t)}function I(t){t[strAjaxData].xhrMonitoringState.stateChangeAttached=EventHelper.Attach(t,"readystatechange",(function(){try{if(t&&t.readyState===4&&x(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 T(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)}P("xmlhttprequest",n,(function(){try{var a=n.CreateTrackItem("Ajax",l,(function(){var e={statusText:t.statusText,headerMap:null,correlationContext:A(t),type:t.responseType,responseText:T(t),response:t.response};if(m){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 A(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&&g){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 P(e,t,n,r){var i=t.perfMark;var a=getPerformance();var o=u.maxAjaxPerfLookupAttempts;var s=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>=o||t.async===false){if(i&&CoreUtils.isFunction(a.clearMarks)){a.clearMarks(i.name)}t.perfAttempts=c;n()}else{setTimeout(u,s)}}catch(e){r(e)}})()}function N(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 o="GET";if(n&&n.method){o=n.method}else if(t&&t instanceof Request){o=t.method}a.method=o;var s={};if(l){var u=new Headers((n?n.headers:0)||(t instanceof Request?t.headers||{}:{}));u.forEach((function(e,t){s[t]=e}))}a.requestHeaders=s;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,o,s){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;P("fetch",a,(function(){var t=a.CreateTrackItem("Fetch",l,o);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.