UNPKG

@utahdts/utah-design-system-header

Version:
181 lines (174 loc) 88.5 kB
(function(O,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(O=typeof globalThis<"u"?globalThis:O||self,y(O["@utahdts/utah-design-system-header"]={}))})(this,(function(O){"use strict";const y={FLYOUT:"flyout",INLINE:"inline",MEGA_MENU:"mega-menu",PLAIN:"plain"},re={BOTTOM:"bottom",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT:"left",LEFT_START:"left-start",LEFT_END:"left-end",RIGHT:"right",RIGHT_START:"right-start",RIGHT_END:"right-end",TOP:"top",TOP_START:"top-start",TOP_END:"top-end"},ke={HEADER_LOADED:"utahHeaderLoaded",HEADER_UNLOADED:"utahHeaderUnloaded"},se={SMALL:"SMALL",MEDIUM:"MEDIUM",LARGE:"LARGE"},on=`/* @media is never in scope for --variables, so this is the only way to solve this. :-( */ @media screen and (max-width: media-size__tablet-landscape__PLACEHOLDER) { /* put your media query here for tablet landscape */ .utah-design-system .search-modal__input[type=text] { width: 75vw; } } @media screen and (max-width: media-size__tablet-portrait__PLACEHOLDER) { .utds-header-desktop--hidden { display: flex !important; } .utds-header-mobile--hidden { display: none !important; } .utds-header { height: 60px; padding: var(--spacing-xs) var(--spacing); } .utds-title-wrapper { font-size: var(--font-size-xl); } .utds-citizen-experience-wrapper { display: none; } .utds-citizen-experience-wrapper--mobile { display: flex; } .utah-design-system .main-menu__wrapper { padding: 0 var(--spacing); /* The utah id button is this tall, but without it, the menu doesn't fill the space up to the mobile menu content popup */ min-height: 46px; } .utah-design-system .main-menu__nav { display: none; } .utah-design-system.utds-header-mobile-menu, .utah-design-system .utds-header-mobile__utah-id-wrapper { display: block; } .utah-design-system .icon-button.main-menu__hamburger, .utah-design-system .utds-header-mobile__vip-action-items--left, .utah-design-system .utds-header-mobile__vip-action-items--right, .utah-design-system .main-menu__search-placeholder { display: flex; } .utah-design-system .search-modal__input[type=text] { width: 80vw; padding: var(--spacing) var(--spacing) var(--spacing) var(--spacing-3xl); } .utah-design-system .search-modal__button-wrapper { right: unset; left: 50%; transform: translateX(-50%) translateY(110%); } .utah-design-system .search-modal__button.button--solid.button--primary-color { border-color: white; width: max-content; } .utah-design-system .utds-official-website-popup__content { flex-wrap: wrap; gap: var(--spacing-l); } .utah-design-system .utds-official-website-popup__col { width: 100%; } .utah-design-system .utds-official-website-popup__address-bar { width: auto; background-size: contain; background-repeat: no-repeat; } .color-example { flex-direction: column; } .color-example > div:not(:last-child) { margin-bottom: var(--spacing-l); } .search-page { .search-modal__form { margin-bottom: var(--spacing-4xl); } .search-modal__input[type=text] { padding: var(--spacing) var(--spacing) var(--spacing) var(--spacing-3xl); } } } @media screen and (max-width: media-size__mobile__PLACEHOLDER) { /* put your media query here for mobile */ } `;function f(e){return`.${(Array.isArray(e)?e:[e]).join(".")}`}const r={UTAH_DESIGN_SYSTEM:"utah-design-system",HEADER:"utds-header",FOOTER:"utds-footer",ICON_BUTTON:"icon-button",CSS_HEADER_MEDIA_TAG_ID:"cssHeaderMediaTag",IS_CLOSED:"is-closed",IS_OPEN:"is-open",VISUALLY_HIDDEN:"visually-hidden",MEDIA_SIZE__MOBILE__PLACEHOLDER:"media-size__mobile__PLACEHOLDER",MEDIA_SIZE__TABLET_LANDSCAPE__PLACEHOLDER:"media-size__tablet-landscape__PLACEHOLDER",MEDIA_SIZE__TABLET_PORTRAIT__PLACEHOLDER:"media-size__tablet-portrait__PLACEHOLDER",ACTION_ITEM:"utds-header-action-item",ACTION_ITEM__ICON_BUTTON:"utds-header-action-item__icon-button",ACTION_ITEM__ICON_BUTTON_TITLE:"utds-header-action-item__icon-button--has-title",ACTION_ITEM__TITLE:"utds-header-action-item__title",BADGE__LABEL:"utds-badge__label",BADGE__VALUE:"utds-badge__value",BADGE_WRAPPER__SMALL:"utds-badge__wrapper--small",BADGE_WRAPPER__ACTION_ITEM:"utds-badge__wrapper--action-item",CITIZEN_EXPERIENCE:"utds-citizen-experience-wrapper",CITIZEN_EXPERIENCE_MOBILE:"utds-citizen-experience-wrapper--mobile",FOOTER_COPYRIGHT_YEAR:"utds-footer__copyright-year",FOOTER_HORIZONTAL_DIVIDER:"utds-footer__horizontal-divider",FOOTER_LINK_PRIVACY_ID:"utds-footer-privacy-link",FOOTER_LINK_TERMS_ID:"utds-footer-terms-link",FOOTER_LINKS:"utds-footer__links",LOGO:"utds-logo-wrapper",LOGO_OFFICIAL_CLOSE_BUTTON:"utds-official-website-popup__close-button",LOGO_OFFICIAL_WRAPPER:"utds-official-website-popup__wrapper",LOGO_SVG:"utah-logo-svg",MAIN_MENU:"main-menu__wrapper",MAIN_MENU__HAMBURGER_ID:"utds-main-menu__hamburger",MAIN_MENU__HAMBURGER_ICON_ID:"utds-main-menu__hamburger-icon",MAIN_MENU__MENU_TOP:"main-menu__menu-top",MAIN_MENU__NAV:"main-menu__nav",MAIN_MENU__OUTER:"main-menu__outer",MAIN_MENU__REMOVED:"main-menu-is-removed",MAIN_MENU__SEARCH:"main-menu__search",MENU_ITEM__ARROW:"menu-item__menu-arrow",MENU_ITEM__BUTTON_TITLE:"menu-item__button-title",MENU_ITEM__LINK_TITLE:"menu-item__link-title",MENU_ITEM__LINK_TITLE_SPAN:"menu-item__link-title-span",MENU_ITEM__SELECTED:"menu-item--selected",MENU_ITEM__SELECTED_PARENT:"menu-item--selected_parent",MENU_ITEM__TITLE:"menu-item__title",MENU_ITEM__FLY_OUT:"menu-item--fly_out",MENU_ITEM__INLINE:"menu-item--inline",MENU_ITEM__MEGA_MENU:"menu-item--mega-menu",DESKTOP__HIDDEN:"utds-header-desktop--hidden",MOBILE__HIDDEN:"utds-header-mobile--hidden",MOBILE__UTAH_ID:"utds-header-mobile__utah-id-wrapper",ACTION_ITEM__SELECTED:"utds-header-mobile-menu__action-item--selected",MOBILE_MENU:"utds-header-mobile-menu",MOBILE_MENU__ACTION_BAR:"utds-header-mobile-menu__action-bar",MOBILE_MENU__BACKDROP:"utds-header-mobile-menu__backdrop",MOBILE_MENU__CONTENT:"utds-header-mobile-menu__content",MOBILE_MENU__CONTENT_ITEM:"utds-header-mobile-menu__content-item",MOBILE_MENU__LAST_FOCUSABLE:"utds-header-mobile-menu__hidden-last-focusable",MOBILE_MENU__WRAPPER:"utds-header-mobile-menu__wrapper",MOBILE_MENU_ACTON_BAR__HOME_ID:"utds-header-mobile-menu_action-bar__home",MOBILE_MENU_ACTON_BAR__PROFILE_ID:"utds-header-mobile-menu_action-bar__profile",MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER:"utds-header-mobile-menu__action-item",VERTICAL_MENU__BUTTON_TITLE:"vertical-menu__button-title",VERTICAL_MENU__CHEVRON:"vertical-menu__chevron",VERTICAL_MENU__DIVIDER:"vertical-menu__divider",VERTICAL_MENU__LINK_TEXT:"vertical-menu__link-text",VERTICAL_MENU__LINK_TITLE:"vertical-menu__link-title",VERTICAL_MENU__PLAIN_TITLE:"vertical-menu__plain-title",VERTICAL_MENU__TITLE:"vertical-menu__title",VERTICAL_MENU_WRAPPER__WRAPPER_TITLE:"vertical-menu__wrapper-title",POPUP__HIDDEN:"popup__wrapper--hidden",POPUP__VISIBLE:"popup__wrapper--visible",POPUP_ARROW:"popup__arrow",POPUP_CONTENT_WRAPPER:"popup__content",POPUP_WRAPPER:"popup__wrapper",SEARCH__SEARCH_BACKDROP:"search-backdrop",SEARCH__SEARCH_CLOSE_BUTTON:"search-modal__close-button",SEARCH__SEARCH_BUTTON:"search-modal__button",SEARCH__SEARCH_BUTTON_WRAPPER:"search-modal__button-wrapper",SEARCH__SEARCH_INPUT:"search-modal__input",SEARCH__SEARCH_MODAL:"search-modal",SKIP_LINK_LINK:"skip-link__link",SKIP_LINK_WRAPPER:"skip-link__wrapper",TITLE__LOGO:"utds-title-wrapper__logo",TITLE__TITLE:"utds-title-wrapper__title",TOOLTIP__ARROW:"tooltip__arrow",TOOLTIP__CONTENT:"tooltip__content",TOOLTIP__WRAPPER:"tooltip__wrapper",TOOLTIP__WRAPPER__HIDDEN:"tooltip__wrapper--hidden",TOOLTIP__WRAPPER__VISIBLE:"tooltip__wrapper--visible",UTAH_ID:"utds-utah-id-wrapper",UTAH_ID__BUTTON:"utds-utah-id__button"};function U(e,t){if(e)throw new Error(t)}function b(e,t){if(e==null)throw new Error(t);return e}function lt(e){return typeof e=="string"||e instanceof String}function rn(e){const t=new DOMParser;let n;if(lt(e)){const o=lt(e)?t.parseFromString(e,"text/html"):e,i=o.body.children.length>1?o.body.children:o.body.children.item(0);if(!i)throw console.error(e),new Error("renderDOM: nothing rendered");n=i}else if(e instanceof Element)n=e;else throw e?(console.error(e),new Error(`renderDOM: str is not a string nor a DOM Element : '${e}'`)):new Error("renderDOM: falsy string passed; cannot render nothing");return n}function I(e){const t=typeof e=="string"?rn(e):e;if(t instanceof HTMLCollection&&t.length>1)throw new Error("renderDOMSingle: must render a single element");const n=t instanceof HTMLCollection?t[0]:t;if(!n)throw console.error(e),new Error("renderDOMSingle: nothing rendered");return n}const pe={applicationType:"",onSearch:!1,mainMenu:!1,mediaSizes:{mobile:640,tabletPortrait:768,tabletLandscape:1024},showTitle:!0,size:se.MEDIUM,skipLinkUrl:"#main-content",title:"My Utah.gov Site",titleUrl:"/",utahId:!1};function sn(e){if(!e.showTitle&&!e.logo)throw new Error("validateSettings: A title must be shown if there is no logo. Please change the `showTitle` setting to be `true` or provide a logo image.")}class an{constructor(){this.settings={...pe}}setSettings(t){const n={...pe,...this.settings,...t};sn(n),this.settings=n}getSettings(){return this.settings}clearSettings(){this.settings={...pe}}}const ye=new an;function A(){return ye.getSettings()}function w(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^b(crypto.getRandomValues(new Uint8Array(1))[0],"uuidv4: crypto")&(15>>e)/4).toString(16))}const cn=`<div class="utds-header-mobile-menu__content-item" role="tabpanel"> </div> `;function We(e){const t=document.querySelector(f(r.MOBILE_MENU__WRAPPER));if(!t)throw new Error("addMobileMenuContentItem: mobileMenuWrapper not found");const n=t.querySelector(f(r.MOBILE_MENU__CONTENT));if(!n)throw new Error("addMobileMenuContentItem: mobileContentWrapper not found");const o=I(cn);return o.appendChild(e),n.appendChild(o),o.setAttribute("id",w()),o}function W(e){return e instanceof Function?e():e}function _e(e){const t=b(document.querySelector(f(r.MOBILE_MENU)),`${e}: mobileMenu not found`),n=document.getElementById(r.MAIN_MENU__HAMBURGER_ID),o=document.getElementById(r.MAIN_MENU__HAMBURGER_ICON_ID);return{hamburger:n,hamburgerIcon:o,mobileMenu:t}}function he(){const{hamburger:e,hamburgerIcon:t,mobileMenu:n}=_e("hideMobileMenu");e?.setAttribute("aria-expanded","false"),n.classList.remove(r.IS_OPEN),e?.setAttribute("aria-label","Open the mobile menu"),t?.classList.add("utds-icon-before-hamburger"),t?.classList.remove("utds-icon-before-x-icon"),document.body.style.position=""}function ln(){document.querySelector(f(r.MAIN_MENU))?.classList.contains(r.MOBILE__HIDDEN)&&document.querySelector(`${f(r.UTAH_DESIGN_SYSTEM)}${f(r.MOBILE_MENU)}`)?.classList.add(r.MAIN_MENU__REMOVED);const{hamburger:t,hamburgerIcon:n,mobileMenu:o}=_e("showMobileMenu");t?.setAttribute("aria-expanded","true"),o.classList.add(r.IS_OPEN),t?.setAttribute("aria-label","Close the mobile menu"),n?.classList.remove("utds-icon-before-hamburger"),n?.classList.add("utds-icon-before-x-icon"),document.body.style.position="relative"}function Fe(e,t){e.querySelectorAll(f(r.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER)).forEach(o=>{o.classList.remove(r.ACTION_ITEM__SELECTED);const i=o.querySelector("button");if(!i)throw new Error("showActionItem: actionWrapper does not have actionItem A");i.setAttribute("aria-selected","false"),i.setAttribute("tabIndex","-1")}),t.classList.add(r.ACTION_ITEM__SELECTED);const n=t.querySelector("button");if(!n)throw new Error("showActionItem: actionWrapper does not have actionItem B");n.setAttribute("aria-selected","true"),n.removeAttribute("tabIndex"),n.focus()}function ut(e,t){e.querySelectorAll(f(r.MOBILE_MENU__CONTENT_ITEM)).forEach(n=>n.classList.remove(r.IS_OPEN)),t.classList.add(r.IS_OPEN)}function Ve(e,t,n,{ariaHasPopupType:o,additionalOnClick:i,onClickHandler:a,shouldOnClickCloseMenu:s}){if(t&&!o)throw new Error("mobileMenuInteractionHandler: there is content, but the aria type is not given");const c=document.querySelector(f(r.MOBILE_MENU));if(!c)throw new Error("mobileMenuInteractionHandler: mobileMenu not found");const d=document.querySelector(f(r.MOBILE_MENU__WRAPPER));if(!d)throw new Error("mobileMenuInteractionHandler: mobileMenuWrapper not found");const u=d.querySelector(f(r.MOBILE_MENU__CONTENT));if(!u)throw new Error("mobileMenuInteractionHandler: mobileContentWrapper not found");const _=W(n),p=W(n)?.querySelector?.("button"),h=(p||e).getAttribute("id");if(!h)throw new Error("mobileMenuInteractionHandler: interactiveElementId not found");if(t){const l=W(t);if(l){const m=l.getAttribute("id");if(!m)throw new Error("mobileMenuInteractionHandler: mobileMenuContentId not found");(p||e).setAttribute("aria-controls",m),l.setAttribute("aria-labelledby",h)}}if(e.onclick)throw new Error("mobileMenuInteractionHandler: interactiveElement already has onclick");if(e.onclick=l=>{if(!a?.(l))if(i?.(l),c.classList.contains(r.IS_OPEN))s&&he();else{ln();const E=W(t);E&&ut(u,E),Fe(d,W(n))}},t){if(_!==e&&_.onclick)throw new Error("mobileMenuInteractionHandler: actionItemWrapperValue already has onclick");_.onclick=l=>{if(!a?.(l)){const m=W(t);m&&ut(u,m),Fe(d,W(n))}}}}function Z(e){return!e.closest(".menu-item__title")&&!e.closest(".vertical-menu__title")}function qe(e,t,n){let o=!1;return e&&(Array.isArray(e)?o=e.some(i=>qe(i,t,n)):(o=n(e),o||(o=!!t?.filter(i=>e[i])?.some(i=>qe(e[i],t,n))))),o}const ae=Math.min,J=Math.max,Se=Math.round,Ne=Math.floor,F=e=>({x:e,y:e}),un={left:"right",right:"left",bottom:"top",top:"bottom"},dn={start:"end",end:"start"};function $e(e,t,n){return J(e,ae(t,n))}function me(e,t){return typeof e=="function"?e(t):e}function ee(e){return e.split("-")[0]}function Ee(e){return e.split("-")[1]}function dt(e){return e==="x"?"y":"x"}function Ge(e){return e==="y"?"height":"width"}const fn=new Set(["top","bottom"]);function X(e){return fn.has(ee(e))?"y":"x"}function ze(e){return dt(X(e))}function pn(e,t,n){n===void 0&&(n=!1);const o=Ee(e),i=ze(e),a=Ge(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Pe(s)),[s,Pe(s)]}function _n(e){const t=Pe(e);return[Ye(e),t,Ye(t)]}function Ye(e){return e.replace(/start|end/g,t=>dn[t])}const ft=["left","right"],pt=["right","left"],hn=["top","bottom"],mn=["bottom","top"];function En(e,t,n){switch(e){case"top":case"bottom":return n?t?pt:ft:t?ft:pt;case"left":case"right":return t?hn:mn;default:return[]}}function In(e,t,n,o){const i=Ee(e);let a=En(ee(e),n==="start",o);return i&&(a=a.map(s=>s+"-"+i),t&&(a=a.concat(a.map(Ye)))),a}function Pe(e){return e.replace(/left|right|bottom|top/g,t=>un[t])}function gn(e){return{top:0,right:0,bottom:0,left:0,...e}}function _t(e){return typeof e!="number"?gn(e):{top:e,right:e,bottom:e,left:e}}function Ce(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function ht(e,t,n){let{reference:o,floating:i}=e;const a=X(t),s=ze(t),c=Ge(s),d=ee(t),u=a==="y",_=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,h=o[c]/2-i[c]/2;let l;switch(d){case"top":l={x:_,y:o.y-i.height};break;case"bottom":l={x:_,y:o.y+o.height};break;case"right":l={x:o.x+o.width,y:p};break;case"left":l={x:o.x-i.width,y:p};break;default:l={x:o.x,y:o.y}}switch(Ee(t)){case"start":l[s]-=h*(n&&u?-1:1);break;case"end":l[s]+=h*(n&&u?-1:1);break}return l}const bn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:a=[],platform:s}=n,c=a.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:_,y:p}=ht(u,o,d),h=o,l={},m=0;for(let E=0;E<c.length;E++){const{name:T,fn:g}=c[E],{x:M,y:v,data:S,reset:L}=await g({x:_,y:p,initialPlacement:o,placement:h,strategy:i,middlewareData:l,rects:u,platform:s,elements:{reference:e,floating:t}});_=M??_,p=v??p,l={...l,[T]:{...l[T],...S}},L&&m<=50&&(m++,typeof L=="object"&&(L.placement&&(h=L.placement),L.rects&&(u=L.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):L.rects),{x:_,y:p}=ht(u,h,d)),E=-1)}return{x:_,y:p,placement:h,strategy:i,middlewareData:l}};async function mt(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:a,rects:s,elements:c,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:_="viewport",elementContext:p="floating",altBoundary:h=!1,padding:l=0}=me(t,e),m=_t(l),T=c[h?p==="floating"?"reference":"floating":p],g=Ce(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(T)))==null||n?T:T.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:u,rootBoundary:_,strategy:d})),M=p==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),S=await(a.isElement==null?void 0:a.isElement(v))?await(a.getScale==null?void 0:a.getScale(v))||{x:1,y:1}:{x:1,y:1},L=Ce(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:M,offsetParent:v,strategy:d}):M);return{top:(g.top-L.top+m.top)/S.y,bottom:(L.bottom-g.bottom+m.bottom)/S.y,left:(g.left-L.left+m.left)/S.x,right:(L.right-g.right+m.right)/S.x}}const Tn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:a,platform:s,elements:c,middlewareData:d}=t,{element:u,padding:_=0}=me(e,t)||{};if(u==null)return{};const p=_t(_),h={x:n,y:o},l=ze(i),m=Ge(l),E=await s.getDimensions(u),T=l==="y",g=T?"top":"left",M=T?"bottom":"right",v=T?"clientHeight":"clientWidth",S=a.reference[m]+a.reference[l]-h[l]-a.floating[m],L=h[l]-a.reference[l],z=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let D=z?z[v]:0;(!D||!await(s.isElement==null?void 0:s.isElement(z)))&&(D=c.floating[v]||a.floating[m]);const Le=S/2-L/2,ne=D/2-E[m]/2-1,Y=ae(p[g],ne),we=ae(p[M],ne),oe=Y,Oe=D-E[m]-we,P=D/2-E[m]/2+Le,ie=$e(oe,P,Oe),K=!d.arrow&&Ee(i)!=null&&P!==ie&&a.reference[m]/2-(P<oe?Y:we)-E[m]/2<0,B=K?P<oe?P-oe:P-Oe:0;return{[l]:h[l]+B,data:{[l]:ie,centerOffset:P-ie-B,...K&&{alignmentOffset:B}},reset:K}}}),An=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:a,rects:s,initialPlacement:c,platform:d,elements:u}=t,{mainAxis:_=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:l="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:E=!0,...T}=me(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const g=ee(i),M=X(c),v=ee(c)===c,S=await(d.isRTL==null?void 0:d.isRTL(u.floating)),L=h||(v||!E?[Pe(c)]:_n(c)),z=m!=="none";!h&&z&&L.push(...In(c,E,m,S));const D=[c,...L],Le=await mt(t,T),ne=[];let Y=((o=a.flip)==null?void 0:o.overflows)||[];if(_&&ne.push(Le[g]),p){const P=pn(i,s,S);ne.push(Le[P[0]],Le[P[1]])}if(Y=[...Y,{placement:i,overflows:ne}],!ne.every(P=>P<=0)){var we,oe;const P=(((we=a.flip)==null?void 0:we.index)||0)+1,ie=D[P];if(ie&&(!(p==="alignment"?M!==X(ie):!1)||Y.every(k=>X(k.placement)===M?k.overflows[0]>0:!0)))return{data:{index:P,overflows:Y},reset:{placement:ie}};let K=(oe=Y.filter(B=>B.overflows[0]<=0).sort((B,k)=>B.overflows[1]-k.overflows[1])[0])==null?void 0:oe.placement;if(!K)switch(l){case"bestFit":{var Oe;const B=(Oe=Y.filter(k=>{if(z){const Q=X(k.placement);return Q===M||Q==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(Q=>Q>0).reduce((Q,ui)=>Q+ui,0)]).sort((k,Q)=>k[1]-Q[1])[0])==null?void 0:Oe[0];B&&(K=B);break}case"initialPlacement":K=c;break}if(i!==K)return{reset:{placement:K}}}return{}}}},Mn=new Set(["left","top"]);async function vn(e,t){const{placement:n,platform:o,elements:i}=e,a=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=ee(n),c=Ee(n),d=X(n)==="y",u=Mn.has(s)?-1:1,_=a&&d?-1:1,p=me(t,e);let{mainAxis:h,crossAxis:l,alignmentAxis:m}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof m=="number"&&(l=c==="end"?m*-1:m),d?{x:l*_,y:h*u}:{x:h*u,y:l*_}}const Ln=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:a,placement:s,middlewareData:c}=t,d=await vn(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:a+d.y,data:{...d,placement:s}}}}},wn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:T=>{let{x:g,y:M}=T;return{x:g,y:M}}},...d}=me(e,t),u={x:n,y:o},_=await mt(t,d),p=X(ee(i)),h=dt(p);let l=u[h],m=u[p];if(a){const T=h==="y"?"top":"left",g=h==="y"?"bottom":"right",M=l+_[T],v=l-_[g];l=$e(M,l,v)}if(s){const T=p==="y"?"top":"left",g=p==="y"?"bottom":"right",M=m+_[T],v=m-_[g];m=$e(M,m,v)}const E=c.fn({...t,[h]:l,[p]:m});return{...E,data:{x:E.x-n,y:E.y-o,enabled:{[h]:a,[p]:s}}}}}};function Re(){return typeof window<"u"}function ce(e){return Et(e)?(e.nodeName||"").toLowerCase():"#document"}function C(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){var t;return(t=(Et(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Et(e){return Re()?e instanceof Node||e instanceof C(e).Node:!1}function x(e){return Re()?e instanceof Element||e instanceof C(e).Element:!1}function q(e){return Re()?e instanceof HTMLElement||e instanceof C(e).HTMLElement:!1}function It(e){return!Re()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof C(e).ShadowRoot}const On=new Set(["inline","contents"]);function Ie(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=H(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!On.has(i)}const yn=new Set(["table","td","th"]);function Sn(e){return yn.has(ce(e))}const Nn=[":popover-open",":modal"];function Ue(e){return Nn.some(t=>{try{return e.matches(t)}catch{return!1}})}const Pn=["transform","translate","scale","rotate","perspective"],Cn=["transform","translate","scale","rotate","perspective","filter"],Rn=["paint","layout","strict","content"];function Ke(e){const t=Ze(),n=x(e)?H(e):e;return Pn.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Cn.some(o=>(n.willChange||"").includes(o))||Rn.some(o=>(n.contain||"").includes(o))}function Un(e){let t=j(e);for(;q(t)&&!le(t);){if(Ke(t))return t;if(Ue(t))return null;t=j(t)}return null}function Ze(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Dn=new Set(["html","body","#document"]);function le(e){return Dn.has(ce(e))}function H(e){return C(e).getComputedStyle(e)}function De(e){return x(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function j(e){if(ce(e)==="html")return e;const t=e.assignedSlot||e.parentNode||It(e)&&e.host||V(e);return It(t)?t.host:t}function gt(e){const t=j(e);return le(t)?e.ownerDocument?e.ownerDocument.body:e.body:q(t)&&Ie(t)?t:gt(t)}function ge(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=gt(e),a=i===((o=e.ownerDocument)==null?void 0:o.body),s=C(i);if(a){const c=Xe(s);return t.concat(s,s.visualViewport||[],Ie(i)?i:[],c&&n?ge(c):[])}return t.concat(i,ge(i,[],n))}function Xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bt(e){const t=H(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=q(e),a=i?e.offsetWidth:n,s=i?e.offsetHeight:o,c=Se(n)!==a||Se(o)!==s;return c&&(n=a,o=s),{width:n,height:o,$:c}}function je(e){return x(e)?e:e.contextElement}function ue(e){const t=je(e);if(!q(t))return F(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:a}=bt(t);let s=(a?Se(n.width):n.width)/o,c=(a?Se(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const xn=F(0);function Tt(e){const t=C(e);return!Ze()||!t.visualViewport?xn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Hn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==C(e)?!1:t}function te(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=je(e);let s=F(1);t&&(o?x(o)&&(s=ue(o)):s=ue(e));const c=Hn(a,n,o)?Tt(a):F(0);let d=(i.left+c.x)/s.x,u=(i.top+c.y)/s.y,_=i.width/s.x,p=i.height/s.y;if(a){const h=C(a),l=o&&x(o)?C(o):o;let m=h,E=Xe(m);for(;E&&o&&l!==m;){const T=ue(E),g=E.getBoundingClientRect(),M=H(E),v=g.left+(E.clientLeft+parseFloat(M.paddingLeft))*T.x,S=g.top+(E.clientTop+parseFloat(M.paddingTop))*T.y;d*=T.x,u*=T.y,_*=T.x,p*=T.y,d+=v,u+=S,m=C(E),E=Xe(m)}}return Ce({width:_,height:p,x:d,y:u})}function xe(e,t){const n=De(e).scrollLeft;return t?t.left+n:te(V(e)).left+n}function At(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-xe(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function Bn(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const a=i==="fixed",s=V(o),c=t?Ue(t.floating):!1;if(o===s||c&&a)return n;let d={scrollLeft:0,scrollTop:0},u=F(1);const _=F(0),p=q(o);if((p||!p&&!a)&&((ce(o)!=="body"||Ie(s))&&(d=De(o)),q(o))){const l=te(o);u=ue(o),_.x=l.x+o.clientLeft,_.y=l.y+o.clientTop}const h=s&&!p&&!a?At(s,d):F(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+_.x+h.x,y:n.y*u.y-d.scrollTop*u.y+_.y+h.y}}function kn(e){return Array.from(e.getClientRects())}function Wn(e){const t=V(e),n=De(e),o=e.ownerDocument.body,i=J(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=J(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+xe(e);const c=-n.scrollTop;return H(o).direction==="rtl"&&(s+=J(t.clientWidth,o.clientWidth)-i),{width:i,height:a,x:s,y:c}}const Mt=25;function Fn(e,t){const n=C(e),o=V(e),i=n.visualViewport;let a=o.clientWidth,s=o.clientHeight,c=0,d=0;if(i){a=i.width,s=i.height;const _=Ze();(!_||_&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const u=xe(o);if(u<=0){const _=o.ownerDocument,p=_.body,h=getComputedStyle(p),l=_.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(o.clientWidth-p.clientWidth-l);m<=Mt&&(a-=m)}else u<=Mt&&(a+=u);return{width:a,height:s,x:c,y:d}}const Vn=new Set(["absolute","fixed"]);function qn(e,t){const n=te(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,a=q(e)?ue(e):F(1),s=e.clientWidth*a.x,c=e.clientHeight*a.y,d=i*a.x,u=o*a.y;return{width:s,height:c,x:d,y:u}}function vt(e,t,n){let o;if(t==="viewport")o=Fn(e,n);else if(t==="document")o=Wn(V(e));else if(x(t))o=qn(t,n);else{const i=Tt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ce(o)}function Lt(e,t){const n=j(e);return n===t||!x(n)||le(n)?!1:H(n).position==="fixed"||Lt(n,t)}function $n(e,t){const n=t.get(e);if(n)return n;let o=ge(e,[],!1).filter(c=>x(c)&&ce(c)!=="body"),i=null;const a=H(e).position==="fixed";let s=a?j(e):e;for(;x(s)&&!le(s);){const c=H(s),d=Ke(s);!d&&c.position==="fixed"&&(i=null),(a?!d&&!i:!d&&c.position==="static"&&!!i&&Vn.has(i.position)||Ie(s)&&!d&&Lt(e,s))?o=o.filter(_=>_!==s):i=c,s=j(s)}return t.set(e,o),o}function Gn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const s=[...n==="clippingAncestors"?Ue(t)?[]:$n(t,this._c):[].concat(n),o],c=s[0],d=s.reduce((u,_)=>{const p=vt(t,_,i);return u.top=J(p.top,u.top),u.right=ae(p.right,u.right),u.bottom=ae(p.bottom,u.bottom),u.left=J(p.left,u.left),u},vt(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function zn(e){const{width:t,height:n}=bt(e);return{width:t,height:n}}function Yn(e,t,n){const o=q(t),i=V(t),a=n==="fixed",s=te(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=F(0);function u(){d.x=xe(i)}if(o||!o&&!a)if((ce(t)!=="body"||Ie(i))&&(c=De(t)),o){const l=te(t,!0,a,t);d.x=l.x+t.clientLeft,d.y=l.y+t.clientTop}else i&&u();a&&!o&&i&&u();const _=i&&!o&&!a?At(i,c):F(0),p=s.left+c.scrollLeft-d.x-_.x,h=s.top+c.scrollTop-d.y-_.y;return{x:p,y:h,width:s.width,height:s.height}}function Qe(e){return H(e).position==="static"}function wt(e,t){if(!q(e)||H(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return V(e)===n&&(n=n.ownerDocument.body),n}function Ot(e,t){const n=C(e);if(Ue(e))return n;if(!q(e)){let i=j(e);for(;i&&!le(i);){if(x(i)&&!Qe(i))return i;i=j(i)}return n}let o=wt(e,t);for(;o&&Sn(o)&&Qe(o);)o=wt(o,t);return o&&le(o)&&Qe(o)&&!Ke(o)?n:o||Un(e)||n}const Kn=async function(e){const t=this.getOffsetParent||Ot,n=this.getDimensions,o=await n(e.floating);return{reference:Yn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Zn(e){return H(e).direction==="rtl"}const Xn={convertOffsetParentRelativeRectToViewportRelativeRect:Bn,getDocumentElement:V,getClippingRect:Gn,getOffsetParent:Ot,getElementRects:Kn,getClientRects:kn,getDimensions:zn,getScale:ue,isElement:x,isRTL:Zn};function yt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jn(e,t){let n=null,o;const i=V(e);function a(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),a();const u=e.getBoundingClientRect(),{left:_,top:p,width:h,height:l}=u;if(c||t(),!h||!l)return;const m=Ne(p),E=Ne(i.clientWidth-(_+h)),T=Ne(i.clientHeight-(p+l)),g=Ne(_),v={rootMargin:-m+"px "+-E+"px "+-T+"px "+-g+"px",threshold:J(0,ae(1,d))||1};let S=!0;function L(z){const D=z[0].intersectionRatio;if(D!==d){if(!S)return s();D?s(!1,D):o=setTimeout(()=>{s(!1,1e-7)},1e3)}D===1&&!yt(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(L,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(L,v)}n.observe(e)}return s(!0),a}function Qn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=je(e),_=i||a?[...u?ge(u):[],...ge(t)]:[];_.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),a&&g.addEventListener("resize",n)});const p=u&&c?jn(u,n):null;let h=-1,l=null;s&&(l=new ResizeObserver(g=>{let[M]=g;M&&M.target===u&&l&&(l.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=l)==null||v.observe(t)})),n()}),u&&!d&&l.observe(u),l.observe(t));let m,E=d?te(e):null;d&&T();function T(){const g=te(e);E&&!yt(E,g)&&n(),E=g,m=requestAnimationFrame(T)}return n(),()=>{var g;_.forEach(M=>{i&&M.removeEventListener("scroll",n),a&&M.removeEventListener("resize",n)}),p?.(),(g=l)==null||g.disconnect(),l=null,d&&cancelAnimationFrame(m)}}const St=Ln,Nt=wn,Pt=An,Ct=Tn,Rt=(e,t,n)=>{const o=new Map,i={platform:Xn,...n},a={...i.platform,_c:o};return bn(e,t,{...i,platform:a})};function Je(e,t,n,o){t?(e.classList.remove(o),e.classList.add(n)):(e.classList.add(o),e.classList.remove(n))}let R;const be={},et={SHIFT:"shift-key"};function Ut(){R&&(document.removeEventListener("click",R.globalOnClick),document.removeEventListener("keyup",R.globalOnKeyup),document.removeEventListener("keydown",R.globalOnKeydown),R=null)}function tt(){const e=[`${f(r.UTAH_DESIGN_SYSTEM)} ${f(r.HEADER)} ${f(r.POPUP_WRAPPER)}`,`${f(r.UTAH_DESIGN_SYSTEM)} ${f(r.MAIN_MENU)} ${f(r.POPUP_WRAPPER)}`],t=document.querySelectorAll(e.join(","));Array.from(t).filter(n=>!n.classList.contains(r.POPUP__HIDDEN)).forEach(n=>{const o=n.getAttribute("id");if(o){const i=document.querySelector(`[aria-controls="${o}"]`);i&&Z(i)&&i.setAttribute("aria-expanded","false")}Je(n,!1,r.POPUP__VISIBLE,r.POPUP__HIDDEN)})}function Jn(){R&&Ut(),R={globalOnClick:()=>{},globalOnKeyup:()=>{},globalOnKeydown:()=>{}},R.globalOnClick=tt,document.addEventListener("click",R.globalOnClick),R.globalOnKeyup=(e=>{e.key==="Escape"&&tt(),e.shiftKey||(be[et.SHIFT]=!1),be[e.key]=!1}),document.addEventListener("keyup",R.globalOnKeyup),R.globalOnKeydown=e=>{e.shiftKey&&(be[et.SHIFT]=!0),be[e.key]=!0},document.addEventListener("keydown",R.globalOnKeydown)}function eo(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function de(e,t,n,o,i){let a=NaN,s=NaN;const c=350,d=150,u=50;Z(t)&&t.setAttribute("aria-expanded","false"),t.setAttribute("aria-haspopup",o);function _(h){clearTimeout(a),clearTimeout(s),(!i?.isPerformPopup||i?.isPerformPopup())&&(a=window.setTimeout(()=>{const l=n.querySelector(f(r.POPUP_ARROW)),m=[St(11),Pt(),Nt()];l&&m.push(Ct({element:l})),Rt(t,n,{placement:i?.popupPlacement||re.BOTTOM,middleware:m}).then(({x:E,y:T,middlewareData:g})=>{n.setAttribute("data-popup-placement",i?.popupPlacement||re.BOTTOM),Object.assign(n.style,{left:`${E}px`,top:`${T}px`}),l&&Object.assign(l.style,{left:E!=null?`${g?.arrow?.x}px`:"",top:T!=null?`${g?.arrow?.y}px`:""})}),Je(n,!0,r.POPUP__VISIBLE,r.POPUP__HIDDEN),Z(t)&&t.setAttribute("aria-expanded","true"),document.querySelectorAll(f(r.TOOLTIP__WRAPPER)).forEach(E=>E.classList.add(r.TOOLTIP__WRAPPER__HIDDEN))},h))}function p(h){clearTimeout(a),clearTimeout(s),(!i?.isPerformPopup||i.isPerformPopup())&&(s=window.setTimeout(()=>{Je(n,!1,r.POPUP__VISIBLE,r.POPUP__HIDDEN),Z(t)&&t.setAttribute("aria-expanded","false")},h))}if(i?.preventOnClickHandling&&(U(!!e.onclick,"popupFocusHandler: wrapper already has an onclick"),e.onclick=h=>{h.stopPropagation()}),e.addEventListener("focusin",()=>_(d)),e.addEventListener("focusout",()=>p(d)),e.addEventListener("keyup",h=>{(h.code==="Escape"||h.key==="Escape")&&(t.focus(),p(u))}),i?.shouldFocusOnHover&&(e.addEventListener("mouseenter",()=>_(c)),e.addEventListener("mouseleave",()=>p(c))),!i?.preventOnClickHandling){if(t.onclick)throw new Error("popupFocusHandler: button already has onclick");t.onclick=h=>{const l=t.getAttribute("aria-expanded")==="true";(!i?.isPerformPopup||i.isPerformPopup())&&(h.stopPropagation(),h.preventDefault(),l&&t.getAttribute("aria-expanded")==="true"?i?.doNotClosePopupOnClick||(p(u),document.activeElement?.blur()):(eo()&&tt(),_(u))),i?.onClick&&i.onClick(h)}}}const nt=`<span class="utds-new-tab-link-a11y"> <span class="visually-hidden">, opens in a new tab</span> <span class="utds-icon-after-external-link" aria-hidden="true"></span> </span> `,to=`<span class="utds-icon-before-chevron-right vertical-menu__chevron" aria-hidden="true"></span> `;function Dt(e,t){let n;return typeof t=="function"?n=t(e):n=t??"Overview",` ${n}`}const no=`<div class="popup__wrapper popup__wrapper--hidden"> <div class="popup__content"> <div class="popup__arrow"></div> </div> </div> `;function ot(e,t){const n=e.getAttribute("id");if(!n)throw new Error("renderPopup: labelledByElement does not have an `id` attribute");const o=w();e.setAttribute("aria-controls",o);const i=I(no);if(i.setAttribute("id",o),i.setAttribute("aria-labelledby",n),t?.removePopupArrow){const a=i.querySelector(f(r.POPUP_ARROW));if(!a)throw new Error("renderPopup(): popup arrow missing (I wanted to remove it!!)");a.remove()}return i}const oo=`<ul class="vertical-menu" /> `,io=`<li class="vertical-menu__item"> <span class="vertical-menu__title"> <span class="vertical-menu__plain-title"></span> <a href="#" class="vertical-menu__link-title"> <span class="vertical-menu__link-text"></span> </a> <button class="vertical-menu__button-title"> <span class="vertical-menu__link-text"></span> </button> </span> <span class="vertical-menu__divider" /> </li> `;function xt(e){const t=e.closest("li");if(!t)throw console.error("element",e),new Error("toggleChildMenuExpansion: parent not found for child");t.querySelectorAll(":scope > ul").forEach(n=>{const o=n.closest("li")?.querySelector(f(r.VERTICAL_MENU__BUTTON_TITLE));if(!o)throw new Error("toggleChildMenuExpansion: button not found");const i=o.querySelector(`:scope > ${f(r.VERTICAL_MENU__CHEVRON)}`);if(!i)throw new Error("toggleChildMenuExpansion: chevron not found");n.classList.toggle(r.VISUALLY_HIDDEN),n.classList.contains(r.VISUALLY_HIDDEN)?(Z(o)&&o.setAttribute("aria-expanded","false"),i.classList.add(r.IS_CLOSED),i.classList.remove(r.IS_OPEN)):(Z(o)&&o.setAttribute("aria-expanded","true"),i.classList.remove(r.IS_CLOSED),i.classList.add(r.IS_OPEN))})}function ro(e){return t=>{t.preventDefault(),t.stopPropagation(),xt(e)}}function Ht(){const e=I(to);return e.classList.add(r.IS_CLOSED),e}function He(){setTimeout(()=>{document.activeElement?.blur()},0)}function so(e,t,n){const o=I(io),i=o.querySelector(f(r.VERTICAL_MENU__TITLE));if(!i)throw new Error("renderPopupMenuItem: menuItemTitleWrapper not found");const a=o.querySelector(f(r.VERTICAL_MENU__BUTTON_TITLE));if(!a)throw new Error("renderPopupMenuItem: menuButton not found");const s=o.querySelector(f(r.VERTICAL_MENU__LINK_TITLE));if(!s)throw new Error("renderPopupMenuItem: aHref not found");const c=o.querySelector(f(r.VERTICAL_MENU__PLAIN_TITLE));if(!c)throw new Error("renderPopupMenuItem: plainTitle not found");const d=o.querySelector(f(r.VERTICAL_MENU__DIVIDER));if(!d)throw new Error("renderPopupMenuItem: menuDivider not found");const u=o.querySelector(`button ${f(r.VERTICAL_MENU__LINK_TEXT)}`);if(!u)throw new Error("renderPopupMenuItem: titleSpanButton not found");const _=o.querySelector(`a ${f(r.VERTICAL_MENU__LINK_TEXT)}`);if(!_)throw new Error("renderPopupMenuItem: titleSpanLink not found");const p=t.actionMenu&&[...t.actionMenu];if(p&&(t.actionFunction||t.actionUrl||t.actionFunctionUrl)&&!t.isOverviewHidden&&p.unshift({actionFunction:t.actionFunction,actionFunctionUrl:t.actionFunctionUrl,actionUrl:t.actionUrl,className:t.className,icon:t.icon,title:`${t.title}${Dt(t,n.parentMenuLinkSuffix)}`}),p?.length||(s.onclick=He,a.onclick=He),p){let l;switch(n.childrenMenuType){case y.FLYOUT:{l=Ht(),a.appendChild(l),a.setAttribute("id",w());const m=it({menuItems:p,title:t.title},a,{...n,removePopupArrow:!0});o.appendChild(m),de(o,a,m,"menu",{popupPlacement:re.RIGHT_START,preventOnClickHandling:!0,shouldFocusOnHover:!0}),s.remove(),c.remove();break}case y.INLINE:{const m=fe(p,n),E=w();m.setAttribute("id",E),m.classList.add(r.VISUALLY_HIDDEN),o.appendChild(m),a.onclick=ro(a),Z(a)&&a.setAttribute("aria-expanded","false"),a.setAttribute("aria-controls",E),l=Ht(),a.appendChild(l),s.remove(),c.remove(),o.addEventListener("focusin",T=>{for(let g=T.target?.closest("ul");g;g=g.parentElement?.closest("ul"))g.classList.remove(r.VISUALLY_HIDDEN),Z(a)&&a.setAttribute("aria-expanded","true"),T.target!==a&&(l?.classList?.remove(r.IS_CLOSED),l?.classList?.add(r.IS_OPEN))});break}case y.MEGA_MENU:{const m=fe(p,n),E=w();m.setAttribute("id",E),o.appendChild(m),s.remove(),a.remove(),c.appendChild(document.createTextNode(t.title));break}default:throw new Error(`renderPopupMenuItem: childrenMenuType unknown '${n.childrenMenuType}'`)}d.remove()}else if(t.actionFunction)a.onclick=l=>{t.actionFunction?.(l),He()},s.remove(),d.remove(),c.remove();else if(t.actionUrl)s.setAttribute("href",t.actionUrl.url),a.remove(),d.remove(),c.remove();else if(t.actionFunctionUrl)s.setAttribute("href",t.actionFunctionUrl.url),s.onclick=l=>{t.actionFunctionUrl?.skipHandleEvent||(l.stopPropagation(),l.preventDefault()),t.actionFunctionUrl?.actionFunction(l),He()},a.remove(),d.remove(),c.remove();else if(t.isDivider)i.remove(),o.setAttribute("aria-hidden","true"),o.setAttribute("role","separator");else throw console.error(t),new Error("renderPopupMenuItem: popupMenuItem must have either actionMenu, actionFunction, actionUrl, or isDivider (popupMenuItem.title)");if(!t.isDivider){if(t.icon){const l=I(t.icon);l.setAttribute("role","presentation"),u.appendChild(l),_.appendChild(l)}if(u.appendChild(document.createTextNode(t.title)),_.appendChild(document.createTextNode(t.title)),t.actionUrl?.openInNewTab||t.actionFunctionUrl?.openInNewTab){s.setAttribute("target","_blank");const l=I(nt);u.appendChild(l),_.appendChild(l)}}const h=t.actionMenu?.length?r.MENU_ITEM__SELECTED_PARENT:r.MENU_ITEM__SELECTED;return(t.isSelected||t.actionMenu&&qe(t.actionMenu,["actionMenu"],l=>!!l.isSelected))&&(a.classList.add(h),s.classList.add(h)),n.childrenMenuType!==y.MEGA_MENU&&(t.isSelected?(xt(o),o.classList.add(h)):o.classList.remove(h)),t.className&&o.classList.add(t.className),e.appendChild(o),o}function fe(e,t){const n=I(oo);return e?.forEach(o=>so(n,o,t)),n}function it(e,t,n){const o=ot(t,{removePopupArrow:n.removePopupArrow}),i=o.querySelector(f(r.POPUP_CONTENT_WRAPPER));if(!i)throw new Error("renderPopupMenu: contentWrapper not found");const a=fe(e.menuItems,n);return a.setAttribute("aria-label",e.title),i.appendChild(a),o}const ao=`<div class="utds-header-action-item-menu"> <div class="vertical-menu__wrapper-title"></div> </div> `,co=`<div class="utds-header-mobile-menu__action-item"> <button type="button" class="icon-button icon-button--borderless utds-header-action-item__icon-button" role="tab"> <div class="utds-header-action-item__title visually-hidden"></div> <span aria-hidden="true" role="presentation"> </button> <span class="menu-chiclet"></span> </div> `,lo=`<div class="utds-badge__wrapper"> <span class="utds-badge__value"></span> <span class="utds-badge__label visually-hidden"></span> </div> `;function rt(e){let t=null;if(e){t=I(lo),t.classList.add(r.BADGE_WRAPPER__ACTION_ITEM);const n=t.querySelector(f(r.BADGE__LABEL));if(!n)throw new Error("renderActionItemBadge: badgeLabel not found");if(n.appendChild(document.createTextNode(e.label)),e.value||e.value===0){const o=t.querySelector(f(r.BADGE__VALUE));if(!o)throw new Error("renderActionItemBadge: badgeValue not found");o.appendChild(document.createTextNode(`${e.value}`))}else t.classList.add(r.BADGE_WRAPPER__SMALL);e.className&&t.classList.add(e.className)}return t}function uo(e){const t=I(co);t.getAttribute("id")||t.setAttribute("id",w());const n=document.createTextNode(e.title),o=t instanceof HTMLCollection?t[0]:t;e.showTitle&&o.classList.add(r.ACTION_ITEM__ICON_BUTTON_TITLE),o.classList.add(r.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER),o.classList.remove(r.ACTION_ITEM);const i=o.querySelector(f(r.ACTION_ITEM__TITLE));if(!i)throw new Error("renderActionItem: titleDiv not found");i.appendChild(n),e.showTitle?i.classList.remove(r.VISUALLY_HIDDEN):i.classList.add(r.VISUALLY_HIDDEN);const a=t.querySelector(f(r.ACTION_ITEM__ICON_BUTTON));if(!a)throw new Error("renderActionItem: iconButton not found");e.className&&a.classList.add(e.className);const s=rt(e.badge);s&&a.appendChild(s);const c=I(e.icon);c.setAttribute("role","presentation"),a.appendChild(c);let d=null;if(e.actionFunction)a.onclick=e.actionFunction;else if(e.actionDom){const u=w();a.setAttribute("id",u),d=I(typeof e.actionDom=="function"?e.actionDom():e.actionDom)}else if(e.actionPopupMenu){const u=w();a.setAttribute("id",u),d=I(ao);const _=d.querySelector(f(r.VERTICAL_MENU_WRAPPER__WRAPPER_TITLE));if(!_)throw new Error("renderMobileActionItem: actionItemContentTitle not found");_.appendChild(document.createTextNode(e.actionPopupMenu.title));const p=fe(e.actionPopupMenu.menuItems,{childrenMenuType:y.INLINE,parentMenuLinkSuffix:e.actionPopupMenu.parentMenuLinkSuffix});d.appendChild(p)}else throw console.error(e),new Error("Action Item: no defined action; must have either actionFunction, actionDom, or actionPopupMenu");return{actionItemElement:t,actionItemContent:d}}function fo(){const e=document.getElementById(r.MOBILE_MENU_ACTON_BAR__HOME_ID);if(!e)throw new Error("renderMobileActionItems: homeActionItem not found");const t=e.closest(f(r.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER));if(!t)throw new Error("renderMobileActionItems: homeActionItemWrapper not found");const i=(!!A().utahId?document.getElementById(r.MOBILE_MENU_ACTON_BAR__PROFILE_ID):null)?.closest?.(f(r.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER));[...A().actionItems||[]].reverse()?.map(s=>({actionItem:s,...uo(s)}))?.forEach(({actionItem:s,actionItemContent:c,actionItemElement:d})=>{let u;switch(s.mobileMenuLocation){case"left":u=t;break;case"none":u=null;break;case"right":default:u=i||t;break}if(u&&(u.after(d),c)){const _=We(c);let p=null;s.actionDom?p="dialog":s.actionPopupMenu&&(p="menu"),Ve(d,_,d,{ariaHasPopupType:p,shouldOnClickCloseMenu:!1})}}),A().mainMenu||(e.remove(),t.remove())}const po=`<div class="utds-footer utah-design-system"> <div class="utds-footer__horizontal-divider"> <hr /> </div> <div class="utds-footer__utah-logo-wrapper"> <div class="utah-logo-svg" id="utah-logo-svg__footer"> <svg viewBox="0 0 107 30.51" role="presentation"> <g> <path d="m12.44,30.51c-4.21,0-7.33-1.22-9.38-3.66C1.02,24.4,0,20.61,0,15.48V0h7.93v16.4c0,2.67.36,4.55,1.08,5.65.77,1.12,2.08,1.74,3.43,1.64,1.36.1,2.68-.52,3.48-1.63.75-1.09,1.13-2.97,1.13-5.65V0h7.65v15.48c0,5.13-1,8.92-3,11.36-2,2.44-5.09,3.66-9.26,3.66Zm24.42-.56V6.64h-7.93V0h23.78v6.64h-7.93v23.31h-7.92Zm26.17-14.56l-.51,2.07h5.53l-.51-2.07c-.37-1.44-.74-3.01-1.11-4.7-.37-1.69-.74-3.29-1.11-4.79h-.18c-.34,1.53-.68,3.14-1.04,4.82-.35,1.68-.71,3.24-1.08,4.68Zm-11.52,14.56L60.64,0h9.58l9.12,29.95h-8.39l-1.48-6.36h-8.38l-1.47,6.36h-8.11Zm30.69,0V0h7.93v11.15h8.94V0h7.93v29.95h-7.93v-11.89h-8.94v11.89h-7.93Z" /> </g> </svg> </div> <div class="utds-footer__vertical-divider" role="separator" aria-orientation="vertical"></div> <div class="utds-footer__official-site-wrapper"> <div class="utds-footer__official-site">An official website of the <span class="whitespace-no-wrap">state of Utah</span></div> <div class="utds-footer__copyright">&copy;<span class="utds-footer__copyright-year">2025</span> State of Utah</div> </div> </div> <div class="utds-footer__links"> <ul> <li> <a href="https://www.utah.gov/index.html" target="__blank" rel="noreferrer">Utah.gov Home</a> </li> <li> <a href="https://www.utah.gov/support/disclaimer.html" target="__blank" rel="noreferrer" id="utds-footer-terms-link">Terms of Use</a> </li> <li> <a href="https://www.utah.gov/support/privacypolicy.html" target="__blank" rel="noreferrer" id="utds-footer-privacy-link">Privacy Policy</a> </li> <li> <a href="https://www.utah.gov/support/accessibility.html" target="__blank" rel="noreferrer">Accessibility</a> </li> <li> <a href="https://www.utah.gov/support/translate.html" target="__blank" rel="noreferrer">Translate</a> </li> </ul> </div> </div> `;function _o(e,t){const n=b(e.querySelector(f(r.FOOTER_COPYRIGHT_YEAR)),"renderFooterCopyrightYear: copyrightYearSpan not found");n.innerHTML=t??""}const $={copyrightYear:void 0,domLocationTarget:{cssSelector:void 0,element:void 0,elementFunction:void 0},showHorizontalRule:!1};function ho(){const e=A(),t=document.querySelector(f(r.FOOTER));let n=t;if(e.footer===null)t?.remove();else if($.domLocationTarget.cssSelector!==e?.footer?.domLocationTarget?.cssSelector||$.domLocationTarget.element!==e?.footer?.domLocationTarget?.element||$.domLocationTarget.elementFunction!==e?.footer?.domLocationTarget?.elementFunction||$.showHorizontalRule!==e?.footer?.showHorizontalRule||$.copyrightYear!==e?.footer?.copyrightYear||!t){t&&t.remove(),n=I(po);let i=document.body;if(e?.footer?.domLocationTarget){const c=[e?.footer?.domLocationTarget.cssSelector,e?.footer?.domLocationTarget.element,e?.footer?.domLocationTarget.elementFunction].filter(d=>d);if(U(c.length<1,"renderFooter: footer.domLocationTarget must either have a value for one of its properties or not be specified at all"),U(c.length>1,"renderFooter: footer.domLocationTarget must only have one target specified"),e?.footer?.domLocationTarget.cssSelector)i=document.querySelector(e?.footer?.domLocationTarget.cssSelector),U(!i,`renderFooter: element not found for domLocationTarget.cssSelector ${e?.footer?.domLocationTarget.cssSelector}`);else if(e?.footer?.domLocationTarget.element)i=e?.footer?.domLocationTarget.element;else if(e?.footer?.domLocationTarget.elementFunction)i=e?.footer?.domLocationTarget.elementFunction(),U(!i,"renderFooter: element not returned from domLocationTarget.elementFunction");else throw new Error("renderFooter: domLocationTarget must have at least one field set")}if(i?.appendChild(n),!e?.footer?.showHorizontalRule){const c=document.querySelector(f(r.FOOTER_HORIZONTAL_DIVIDER));U(!c,"renderFooter: cannot remove horizontal rule; not found"),c?.remove()}if(e?.footer?.linkPrivacyPolicy){const c=document.getElementById(r.FOOTER_LINK_PRIVACY_ID);U(!c,"renderFooter: cannot find privacy policy link"),c?.setAttribute("href",e.footer.linkPrivacyPolicy)}if(e?.footer?.linkTextPrivacyPolicy){const c=document.getElementById(r.FOOTER_LINK_PRIVACY_ID);U(!c,"renderFooter: cannot find privacy policy link"),c&&(c.innerText=e.footer.linkTextPrivacyPolicy)}if(e?.footer?.linkTermsOfUse){const c=document.getElementById(r.FOOTER_LINK_TERMS_ID);U(!c,"renderFooter: cannot find terms of use link"),c?.setAttribute("href",e.footer.linkTermsOfUse)}b(document.querySelector(f(r.FOOTER_LINKS)),"renderFooter: footer links not found").querySelectorAll("a").forEach(c=>{c.appendChild(I(nt))}),_o(n,e?.footer?.copyrightYear),$.copyrightYear=e?.footer?.copyrightYear,$.domLocationTarget.cssSelector=e?.footer?.domLocationTarget?.cssSelector,$.domLocationTarget.element=e?.footer?.domLocationTarget?.element,$.domLocationTarget.elementFunction=e?.footer?.domLocationTarget?.elementFunction,$.showHorizontalRule=e?.footer?.showHorizontalRule}return n}const mo=`<div class="utds-action-items-wrapper"></div> `,Eo=`<div class="tooltip__wrapper tooltip__wrapper--hidden" aria-hidden="true"> <div class="tooltip__content"> <div class="tooltip__arrow"></div> </div> </div> `;let Te=NaN;function Ae(e,t){const n=I(Eo),o=n.querySelector(f(r.TOOLTIP__CONTENT)),i=n.querySelector(f(r.TOOLTIP__ARROW));let a;if(!o)throw new Error("hookupTooltip: tooltipContent not found");o.appendChild(t),e.appendChild(n);const s=[St(5),Pt(),Nt()];i&&s.push(Ct({element:i}));const c=()=>Rt(e,n,{placement:re.BOTTOM,middleware:s}).then(({x:u,y:_,middlewareData:p})=>{n.setAttribute("data-popup-placement",re.BOTTOM),Object.assign(n.style,{left:`${u}px`,to