1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cf0478ab-fb84-596c-8f31-64cd29bf0ecb")}catch(e){}}(); 3import{F as e,at as t,ct as n,k as r,ot as i,rt as a,st as ee}from"./tslib.es6-B0Q9oa_J.js";import{Ar as o,K as s,Kt as c,St as l,_t as u,bt as d,wr as te,xt as f}from"./popover-DJoNi6Yv.js";import{f as p}from"./sidebar-stats-7OdApBnz.js";import{$ as m,Z as h,it as g,rt as _}from"./product-CV3QSSwH.js";import"./comparison-filters-Cgbi7tFy.js";import{O as ne}from"./fund-5YBEyYum.js";import{A as re,B as ie,D as ae,E as oe,F as v,G as y,I as b,K as x,L as S,M as C,O as w,P as T,R as E,T as D,V as O,W as k,j as A,k as j,o as M,q as N,z as P}from"./stores-DMcGutCF.js";var F=e({valid:r()}),I=e({success:r()}),L=t(async e=>{let t=await fetch(`/api/ahm-lead/validate?id=${encodeURIComponent(e)}`);if(!t.ok)return!1;let n=F.safeParse(await t.json());return n.success&&n.data.valid}),R=t(async({id:e,selectedPolicy:t})=>{let n=await fetch(`/api/ahm-lead/submit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({id:e,selectedPolicy:t})});if(!n.ok)throw Error(`ahm-lead submit failed: ${n.status}`);let r=I.safeParse(await n.json());if(!r.success||!r.data.success)throw Error(`ahm-lead submit response malformed or unsuccessful`)}),z=`ahmLead`,B=`lead_id_token`,V=n();function H(e){return typeof e==`string`&&e.length>0}var U=i(!1).on(R.done,()=>!0),W=n();a({clock:V,source:{leadId:u,submitted:U,pending:R.pending},filter:({leadId:e,submitted:t,pending:n})=>H(e)&&!t&&!n,fn:(e,{selectedPolicy:t})=>t,target:W}),a({clock:W,source:u,filter:H,fn:(e,t)=>({id:e,selectedPolicy:t}),target:R});function G(){if(typeof window>`u`)return null;let e=new URLSearchParams(window.location.search).get(z);return e&&e.trim()!==``?e.trim():null}function K(){return q(new URLSearchParams(window.location.search))}function q(e){let t=[...e.keys()].filter(o);for(let n of t)e.delete(n);let n=e.toString();return n?`/compare?${n}`:`/compare`}var J=!1;function se(e){if(J)return;J=!0;let n=t(t=>{let n=e.responses.getAllStore.getState()[B];if(!(typeof n==`string`&&n.length>0))return e.responses.commit({[B]:`ahm-${t}`})});a({clock:l,target:n});let r=t(()=>{if(window.location.pathname!==`/compare`){te(K());return}let e=new URLSearchParams(window.location.search);[...e.keys()].some(o)&&window.history.replaceState(window.history.state,``,q(e))});a({clock:L.done,filter:({result:e})=>e,fn:({params:e})=>e,target:l}),a({clock:L.done,filter:({result:e})=>e,target:r}),a({clock:L.finally,target:f});let i=G();i!==null&&(d(),L(i))}function ce(e,t){if(e===`combined`||t===`visitor`&&e===`extras`)return!0}function Y(e,t){let n=e.policyType===`visitor`;return{state:e.state,coverageType:e.coverageType,coverType:e.coverType,fundCodes:e.fundCodes,excludeFundCodes:e.excludeFundCodes.length>0?e.excludeFundCodes:void 0,maxExcess:e.maxExcess,sortBy:e.sortBy,page:e.currentPage,limit:t?e.cardsPerPage-1:e.cardsPerPage,hospitalTiers:n?void 0:e.hospitalTiers,requiredExtras:e.requiredExtras,requiredHospitalServices:e.requiredHospitalServices,maxPremium:e.maxPremium,minPremium:e.minPremium,rebate:n?null:e.rebate,policyType:e.policyType,visaSubclass:n&&e.visaSubclass||void 0,topRated:e.prioritiseHighlyRated,includeRestrictedFunds:e.includeRestrictedFunds,isOvhc:n?!0:void 0,includePairs:ce(e.coverType,e.policyType)}}var le=ee(m,h,(e,t)=>{let n={},r=t?[t,...e]:e;for(let e of r)n[e.displayFundCode]=ne[e.displayFundCode]??null;return n}),X=n();a({clock:X,source:{filterState:M,existingProduct:h},fn:({filterState:e,existingProduct:t})=>Y(e,t!==null),target:_});var Z=a({source:{filterState:M,existingProduct:h},fn:({filterState:e,existingProduct:t})=>Y(e,t!==null)});a({clock:g,fn:e=>e.totalHits,target:x}),a({clock:Z,fn:e=>e.limit,target:oe});var ue=p(Z,1e3),Q=i(``).on(_,(e,t)=>JSON.stringify(t));a({clock:ue,source:Q,filter:(e,t)=>JSON.stringify(t)!==e,fn:(e,t)=>t,target:_}),a({clock:j,source:Z,target:_}),a({clock:S,source:Z,target:_}),a({clock:s,source:Z,target:_});var $=!1;function de(e){if($)return;$=!0,e.responses.getAllStore.watch(e=>{re(e)});let t=(t,n)=>{e.responses.getAllStore.getState()[t]!==n&&e.responses.register(c(t,n))};w.watch(e=>t(`coverageType`,e)),ae.watch(e=>t(`coverType`,e)),y.watch(e=>t(`state`,e)),E.watch(e=>t(`policyType`,e)),N.watch(e=>t(`visaSubclass`,e)),T.watch(e=>t(`current_monthly_excess`,e)),D.watch(e=>t(`billingPeriod`,e)),k.watch(e=>t(`sortBy`,e)),C.watch(e=>t(`hospitalTiers`,e)),ie.watch(e=>t(`requiredExtras`,e)),O.watch(e=>t(`requiredHospitalServices`,e)),v.watch(e=>t(`maxPremium`,e)),b.watch(e=>t(`minPremium`,e)),P.watch(e=>{e||t(`prioritise_highly_rated`,null)}),a({clock:A,source:e.responses.getAllStore,filter:(e,t)=>{let n=e.fundCode,r=Array.isArray(n)?n.map(String):typeof n==`string`&&n.length>0?[n]:[];if(r.length!==t.length)return!0;let i=new Set(r);return!t.every(e=>i.has(e))},fn:(e,t)=>t}).watch(t=>{e.responses.register({fundCode:t})})}
3export{se as a,Y as i,de as n,V as o,X as r,le as t}; 4//# debugId=cf0478ab-fb84-596c-8f31-64cd29bf0ecb
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.