@department-of-veterans-affairs/component-library 49.4.1 → 50.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/1214.app.bundle.js +1 -1
  2. package/dist/1450.app.bundle.js +1 -1
  3. package/dist/2222.app.bundle.js +1 -1
  4. package/dist/2387.app.bundle.js +1 -1
  5. package/dist/2654.app.bundle.js +1 -1
  6. package/dist/2664.app.bundle.js +1 -1
  7. package/dist/2801.app.bundle.js +1 -1
  8. package/dist/286.app.bundle.js +1 -1
  9. package/dist/3071.app.bundle.js +1 -1
  10. package/dist/3156.app.bundle.js +1 -1
  11. package/dist/3347.app.bundle.js +1 -0
  12. package/dist/4033.app.bundle.js +1 -0
  13. package/dist/4064.app.bundle.js +1 -1
  14. package/dist/4117.app.bundle.js +1 -1
  15. package/dist/4140.app.bundle.js +1 -1
  16. package/dist/4493.app.bundle.js +1 -1
  17. package/dist/4715.app.bundle.js +1 -1
  18. package/dist/5155.app.bundle.js +1 -1
  19. package/dist/5189.app.bundle.js +1 -1
  20. package/dist/5306.app.bundle.js +1 -1
  21. package/dist/5610.app.bundle.js +1 -1
  22. package/dist/5699.app.bundle.js +1 -1
  23. package/dist/5830.app.bundle.js +1 -1
  24. package/dist/6034.app.bundle.js +1 -1
  25. package/dist/6246.app.bundle.js +1 -1
  26. package/dist/6247.app.bundle.js +1 -1
  27. package/dist/641.app.bundle.js +1 -1
  28. package/dist/6527.app.bundle.js +1 -1
  29. package/dist/6655.app.bundle.js +1 -1
  30. package/dist/6824.app.bundle.js +1 -1
  31. package/dist/712.app.bundle.js +1 -1
  32. package/dist/7367.app.bundle.js +1 -1
  33. package/dist/7531.app.bundle.js +1 -1
  34. package/dist/7663.app.bundle.js +1 -1
  35. package/dist/7821.app.bundle.js +1 -1
  36. package/dist/8175.app.bundle.js +1 -1
  37. package/dist/82.app.bundle.js +1 -1
  38. package/dist/8762.app.bundle.js +1 -1
  39. package/dist/890.app.bundle.js +1 -1
  40. package/dist/9157.app.bundle.js +1 -1
  41. package/dist/9288.app.bundle.js +1 -1
  42. package/dist/9670.app.bundle.js +1 -1
  43. package/dist/9724.app.bundle.js +1 -1
  44. package/dist/9800.app.bundle.js +1 -1
  45. package/dist/app.bundle.js +1 -1
  46. package/dist/components/index.d.ts +2 -0
  47. package/dist/components/index.js +1 -1
  48. package/dist/components/types/components.d.ts +68 -31
  49. package/dist/components/utils.js +1 -1
  50. package/dist/components/va-accordion.js +1 -1
  51. package/dist/components/va-additional-info.js +1 -1
  52. package/dist/components/va-alert-critical.d.ts +11 -0
  53. package/dist/components/va-alert-critical.js +1 -0
  54. package/dist/components/va-alert-critical2.js +1 -0
  55. package/dist/components/va-alert-expandable.js +1 -1
  56. package/dist/components/va-alert2.js +1 -1
  57. package/dist/components/va-back-to-top.js +1 -1
  58. package/dist/components/va-button-icon2.js +1 -1
  59. package/dist/components/va-button2.js +1 -1
  60. package/dist/components/va-card2.js +1 -1
  61. package/dist/components/va-checkbox-group.js +1 -1
  62. package/dist/components/va-checkbox2.js +1 -1
  63. package/dist/components/va-combo-box.js +2 -6
  64. package/dist/components/va-crisis-line-modal2.js +1 -1
  65. package/dist/components/va-file-input-multiple.js +1 -1
  66. package/dist/components/va-file-input2.js +1 -1
  67. package/dist/components/va-header-minimal.js +1 -1
  68. package/dist/components/va-icon2.js +1 -1
  69. package/dist/components/va-language-toggle.js +1 -1
  70. package/dist/components/va-link-action.js +1 -1
  71. package/dist/components/va-loading-indicator.js +1 -1
  72. package/dist/components/va-minimal-footer.js +1 -1
  73. package/dist/components/va-need-help.js +1 -1
  74. package/dist/components/va-notification.js +1 -1
  75. package/dist/components/va-official-gov-banner2.js +1 -1
  76. package/dist/components/va-omb-info.js +1 -1
  77. package/dist/components/va-pagination.js +1 -1
  78. package/dist/components/va-privacy-agreement.js +1 -1
  79. package/dist/components/va-process-list-item.js +1 -1
  80. package/dist/components/va-process-list.js +1 -1
  81. package/dist/components/va-progress-bar2.js +1 -1
  82. package/dist/components/va-radio-option.js +1 -1
  83. package/dist/components/va-radio.js +1 -1
  84. package/dist/components/va-search-input.js +1 -1
  85. package/dist/components/va-select2.js +1 -1
  86. package/dist/components/va-service-list-item.js +1 -1
  87. package/dist/components/va-statement-of-truth.js +1 -1
  88. package/dist/components/va-summary-box.js +1 -1
  89. package/dist/components/va-table-inner2.js +1 -1
  90. package/dist/components/va-table-row.js +1 -1
  91. package/dist/components/va-table.js +1 -1
  92. package/dist/components/va-telephone2.js +1 -1
  93. package/dist/components/va-text-input2.js +1 -1
  94. package/dist/components/va-textarea.js +1 -1
  95. package/dist/react-bindings/index.d.ts +1 -0
  96. package/dist/react-bindings/index.js +1 -1
  97. package/dist/react-bindings/index.js.map +1 -1
  98. package/dist/react-bindings/index.ts +1 -0
  99. package/package.json +2 -2
  100. package/dist/9161.app.bundle.js +0 -1
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see va-combo-box.js.LICENSE.txt */
2
- import{proxyCustomElement,HTMLElement,createEvent,forceUpdate,h,Fragment,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import"./i18n-setup.js";import"./contacts.js";import{i as instance}from"./i18next.js";var keymap$1={exports:{}},keyboardeventKeyPolyfill={exports:{}};!function(e){!function(){var t,o={polyfill:function(){if(!("KeyboardEvent"in window)||"key"in KeyboardEvent.prototype)return!1;var e={get:function(e){var t=o.keys[this.which||this.keyCode];return Array.isArray(t)&&(t=t[+this.shiftKey]),t}};return Object.defineProperty(KeyboardEvent.prototype,"key",e),e},keys:{3:"Cancel",6:"Help",8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",28:"Convert",29:"NonConvert",30:"Accept",31:"ModeChange",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",42:"Print",43:"Execute",44:"PrintScreen",45:"Insert",46:"Delete",48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],91:"OS",93:"ContextMenu",144:"NumLock",145:"ScrollLock",181:"VolumeMute",182:"VolumeDown",183:"VolumeUp",186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"'],224:"Meta",225:"AltGraph",246:"Attn",247:"CrSel",248:"ExSel",249:"EraseEof",250:"Play",251:"ZoomOut"}};for(t=1;t<25;t++)o.keys[111+t]="F"+t;var a="";for(t=65;t<91;t++)a=String.fromCharCode(t),o.keys[t]=[a.toLowerCase(),a.toUpperCase()];e.exports=o}()}(keyboardeventKeyPolyfill);const MODIFIERS={Alt:"altKey",Control:"ctrlKey",Ctrl:"ctrlKey",Shift:"shiftKey"},MODIFIER_SEPARATOR="+",getEventKey=function(e,t){var o=e.key;if(t)for(var a in MODIFIERS)!0===e[MODIFIERS[a]]&&(o=[a,o].join("+"));return o};keymap$1.exports=function(e){const t=Object.keys(e).some((function(e){return e.indexOf("+")>-1}));return function(o){var a=getEventKey(o,t);return[a,a.toLowerCase()].reduce((function(t,s){return s in e&&(t=e[a].call(this,o)),t}),void 0)}},keymap$1.exports.MODIFIERS=MODIFIERS;const keymap=keymap$1.exports,isElement$1=e=>e&&"object"==typeof e&&1===e.nodeType;var select$1=(e,t)=>{if("string"!=typeof e)return[];t&&isElement$1(t)||(t=window.document);const o=t.querySelectorAll(e);return Array.prototype.slice.call(o)};const select=select$1,isElement=e=>e&&"object"==typeof e&&1===e.nodeType;var selectOrMatches=(e,t)=>{const o=select(e,t);return"string"!=typeof e||isElement(t)&&t.matches(e)&&o.push(t),o},getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function shouldUseNative(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},o=0;o<10;o++)t["_"+String.fromCharCode(o)]=o;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach((function(e){a[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}var objectAssign=shouldUseNative()?Object.assign:function(e,t){for(var o,a,s=toObject(e),r=1;r<arguments.length;r++){for(var i in o=Object(arguments[r]))hasOwnProperty.call(o,i)&&(s[i]=o[i]);if(getOwnPropertySymbols){a=getOwnPropertySymbols(o);for(var n=0;n<a.length;n++)propIsEnumerable.call(o,a[n])&&(s[a[n]]=o[a[n]])}}return s};!function(e){"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,o=(t.document||t.ownerDocument).querySelectorAll(e),a=0;o[a]&&o[a]!==t;)++a;return Boolean(o[a])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window.Element.prototype);var delegate$2=function(e,t){return function(o){var a=o.target.closest(e);if(a)return t.call(a,o)}},compose$1=function(e){return function(t){return e.some((function(e){return!1===e.call(this,t)}),this)}};const delegate$1=delegate$2,compose=compose$1,SPLAT="*";var delegateAll$1=function(e){const t=Object.keys(e);if(1===t.length&&"*"===t[0])return e["*"];const o=t.reduce((function(t,o){return t.push(delegate$1(o,e[o])),t}),[]);return compose(o)};const assign$1=objectAssign,delegate=delegate$2,delegateAll=delegateAll$1,DELEGATE_PATTERN=/^(.+):delegate\((.+)\)$/,SPACE=" ",getListeners=function(e,t){var o,a,s=e.match(DELEGATE_PATTERN);s&&(e=s[1],o=s[2]),"object"==typeof t&&(a={capture:popKey(t,"capture"),passive:popKey(t,"passive")});var r={selector:o,delegate:"object"==typeof t?delegateAll(t):o?delegate(o,t):t,options:a};return e.indexOf(" ")>-1?e.split(" ").map((function(e){return assign$1({type:e},r)})):(r.type=e,[r])};var popKey=function(e,t){var o=e[t];return delete e[t],o},behavior$1=function(e,t){const o=Object.keys(e).reduce((function(t,o){var a=getListeners(o,e[o]);return t.concat(a)}),[]);return assign$1({add:function(e){o.forEach((function(t){e.addEventListener(t.type,t.delegate,t.options)}))},remove:function(e){o.forEach((function(t){e.removeEventListener(t.type,t.delegate,t.options)}))}},t)};const assign=objectAssign,Behavior=behavior$1,sequence=(...e)=>function(t=document.body){e.forEach((e=>{"function"==typeof this[e]&&this[e].call(this,t)}))};var behavior=(e,t)=>Behavior(e,assign({on:sequence("init","add"),off:sequence("teardown","remove")},t)),sanitizer={exports:{}};sanitizer.exports=function(){var e={_entity:/[&<>"'/]/g,_entities:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;","/":"&#x2F;"},getEntity:function(t){return e._entities[t]},escapeHTML:function(t){for(var o="",a=0;a<t.length;a++)o+=t[a],a+1<arguments.length&&(o+=String(arguments[a+1]||"").replace(e._entity,e.getEntity));return o},createSafeHTML:function(t){for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];return{__html:e.escapeHTML.apply(e,[t].concat(a)),toString:function(){return"[object WrappedHTMLObject]"},info:"This is a wrapped HTML object. See https://developer.mozilla.org/en-US/Firefox_OS/Security/Security_Automation for more."}},unwrapSafeHTML:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return t.map((function(e){return e.__html})).join("")}};return e}();const Sanitizer=sanitizer.exports;var events={CLICK:"click"};const PREFIX="usa",COMBO_BOX_CLASS="usa-combo-box",COMBO_BOX_PRISTINE_CLASS="usa-combo-box--pristine",SELECT_CLASS="usa-combo-box__select",INPUT_CLASS="usa-combo-box__input",CLEAR_INPUT_BUTTON_CLASS="usa-combo-box__clear-input",CLEAR_INPUT_BUTTON_WRAPPER_CLASS=`${CLEAR_INPUT_BUTTON_CLASS}__wrapper`,INPUT_BUTTON_SEPARATOR_CLASS="usa-combo-box__input-button-separator",TOGGLE_LIST_BUTTON_CLASS="usa-combo-box__toggle-list",TOGGLE_LIST_BUTTON_WRAPPER_CLASS=`${TOGGLE_LIST_BUTTON_CLASS}__wrapper`,LIST_CLASS="usa-combo-box__list",LIST_OPTION_CLASS="usa-combo-box__list-option",LIST_OPTION_GROUP_CLASS=`${LIST_OPTION_CLASS}--group`,LIST_OPTION_GROUP_OPTION_CLASS=`${LIST_OPTION_CLASS}--group-option`,LIST_OPTION_FOCUSED_CLASS=`${LIST_OPTION_CLASS}--focused`,LIST_OPTION_SELECTED_CLASS=`${LIST_OPTION_CLASS}--selected`,STATUS_CLASS="usa-combo-box__status",COMBO_BOX=".usa-combo-box",SELECT=`.${SELECT_CLASS}`,INPUT=`.${INPUT_CLASS}`,CLEAR_INPUT_BUTTON=`.${CLEAR_INPUT_BUTTON_CLASS}`,TOGGLE_LIST_BUTTON=`.${TOGGLE_LIST_BUTTON_CLASS}`,LIST=`.${LIST_CLASS}`,LIST_OPTION=`.${LIST_OPTION_CLASS}`,LIST_OPTION_FOCUSED=`.${LIST_OPTION_FOCUSED_CLASS}`,LIST_OPTION_SELECTED=`.${LIST_OPTION_SELECTED_CLASS}`,STATUS=`.${STATUS_CLASS}`,DEFAULT_FILTER=".*{{query}}.*",noop=()=>{},changeElementValue=(e,t="")=>{const o=e;o.value=t;const a=new CustomEvent("change",{bubbles:!0,cancelable:!0,detail:{value:t}});o.dispatchEvent(a)},getComboBoxContext=e=>{const t=e.closest(COMBO_BOX);if(!t)throw new Error(`Element is missing outer ${COMBO_BOX}`);const o=t.querySelector(SELECT),a=t.querySelector(INPUT),s=t.querySelector(LIST),r=t.querySelector(STATUS),i=t.querySelector(LIST_OPTION_FOCUSED),n=t.querySelector(LIST_OPTION_SELECTED),l=t.querySelector(TOGGLE_LIST_BUTTON),c=t.querySelector(CLEAR_INPUT_BUTTON),u=t.classList.contains(COMBO_BOX_PRISTINE_CLASS);return{comboBoxEl:t,selectEl:o,inputEl:a,listEl:s,statusEl:r,focusedOptionEl:i,selectedOptionEl:n,toggleListBtnEl:l,clearInputBtnEl:c,isPristine:u,disableFiltering:"true"===t.dataset.disableFiltering}},disable=e=>{const{inputEl:t,toggleListBtnEl:o,clearInputBtnEl:a}=getComboBoxContext(e);a.hidden=!0,a.disabled=!0,o.disabled=!0,t.disabled=!0},ariaDisable=e=>{const{inputEl:t,toggleListBtnEl:o,clearInputBtnEl:a}=getComboBoxContext(e);a.hidden=!0,a.setAttribute("aria-disabled",!0),o.setAttribute("aria-disabled",!0),t.setAttribute("aria-disabled",!0)},enable=e=>{const{inputEl:t,toggleListBtnEl:o,clearInputBtnEl:a}=getComboBoxContext(e);a.hidden=!1,a.disabled=!1,o.disabled=!1,t.disabled=!1},enhanceComboBox=(e,t)=>{const o=e.closest(COMBO_BOX);if(o.dataset.enhanced)return;const a=o.querySelector("select");if(!a)throw new Error(`${COMBO_BOX} is missing inner select`);const s=a.id,r=t,i=`${s}--list`,n=`${s}-label`,l=`${s}--assistiveHint`,c=[],{defaultValue:u}=o.dataset,{placeholder:d}=o.dataset;let b;if(d&&c.push({placeholder:d}),u)for(let e=0,t=a.options.length;e<t;e+=1){const t=a.options[e];if(t.value===u){b=t;break}}if(!r||!r.matches(`label[for="${s}"]`))throw new Error(`${COMBO_BOX} for ${s} is either missing a label or a "for" attribute`);r.setAttribute("id",n),r.setAttribute("id",n),a.setAttribute("aria-hidden","true"),a.setAttribute("tabindex","-1"),a.classList.add("usa-sr-only",SELECT_CLASS),a.id="",a.value="",["required","aria-label","aria-labelledby"].forEach((e=>{if(a.hasAttribute(e)){const t=a.getAttribute(e);c.push({[e]:t}),a.removeAttribute(e)}}));const p=document.createElement("input");if(p.setAttribute("id",s),p.setAttribute("aria-owns",i),p.setAttribute("aria-controls",i),p.setAttribute("aria-autocomplete","list"),p.setAttribute("aria-describedby",l),p.setAttribute("aria-expanded","false"),p.setAttribute("autocapitalize","off"),p.setAttribute("autocomplete","off"),p.setAttribute("class",INPUT_CLASS),p.setAttribute("type","text"),p.setAttribute("role","combobox"),c.forEach((e=>Object.keys(e).forEach((t=>{const o=Sanitizer.escapeHTML`${e[t]}`;p.setAttribute(t,o)})))),o.insertAdjacentElement("beforeend",p),o.insertAdjacentHTML("beforeend",Sanitizer.escapeHTML`
2
+ import{proxyCustomElement,HTMLElement,createEvent,forceUpdate,h,Fragment,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import"./i18n-setup.js";import"./contacts.js";import{i as isMessageSet}from"./utils.js";import{i as instance}from"./i18next.js";var keymap$1={exports:{}},keyboardeventKeyPolyfill={exports:{}};!function(e){!function(){var t,o={polyfill:function(){if(!("KeyboardEvent"in window)||"key"in KeyboardEvent.prototype)return!1;var e={get:function(e){var t=o.keys[this.which||this.keyCode];return Array.isArray(t)&&(t=t[+this.shiftKey]),t}};return Object.defineProperty(KeyboardEvent.prototype,"key",e),e},keys:{3:"Cancel",6:"Help",8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",28:"Convert",29:"NonConvert",30:"Accept",31:"ModeChange",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",42:"Print",43:"Execute",44:"PrintScreen",45:"Insert",46:"Delete",48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],91:"OS",93:"ContextMenu",144:"NumLock",145:"ScrollLock",181:"VolumeMute",182:"VolumeDown",183:"VolumeUp",186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"'],224:"Meta",225:"AltGraph",246:"Attn",247:"CrSel",248:"ExSel",249:"EraseEof",250:"Play",251:"ZoomOut"}};for(t=1;t<25;t++)o.keys[111+t]="F"+t;var a="";for(t=65;t<91;t++)a=String.fromCharCode(t),o.keys[t]=[a.toLowerCase(),a.toUpperCase()];e.exports=o}()}(keyboardeventKeyPolyfill);const MODIFIERS={Alt:"altKey",Control:"ctrlKey",Ctrl:"ctrlKey",Shift:"shiftKey"},MODIFIER_SEPARATOR="+",getEventKey=function(e,t){var o=e.key;if(t)for(var a in MODIFIERS)!0===e[MODIFIERS[a]]&&(o=[a,o].join("+"));return o};keymap$1.exports=function(e){const t=Object.keys(e).some((function(e){return e.indexOf("+")>-1}));return function(o){var a=getEventKey(o,t);return[a,a.toLowerCase()].reduce((function(t,s){return s in e&&(t=e[a].call(this,o)),t}),void 0)}},keymap$1.exports.MODIFIERS=MODIFIERS;const keymap=keymap$1.exports,isElement$1=e=>e&&"object"==typeof e&&1===e.nodeType;var select$1=(e,t)=>{if("string"!=typeof e)return[];t&&isElement$1(t)||(t=window.document);const o=t.querySelectorAll(e);return Array.prototype.slice.call(o)};const select=select$1,isElement=e=>e&&"object"==typeof e&&1===e.nodeType;var selectOrMatches=(e,t)=>{const o=select(e,t);return"string"!=typeof e||isElement(t)&&t.matches(e)&&o.push(t),o},getOwnPropertySymbols=Object.getOwnPropertySymbols,hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function shouldUseNative(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},o=0;o<10;o++)t["_"+String.fromCharCode(o)]=o;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach((function(e){a[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}var objectAssign=shouldUseNative()?Object.assign:function(e,t){for(var o,a,s=toObject(e),r=1;r<arguments.length;r++){for(var i in o=Object(arguments[r]))hasOwnProperty.call(o,i)&&(s[i]=o[i]);if(getOwnPropertySymbols){a=getOwnPropertySymbols(o);for(var n=0;n<a.length;n++)propIsEnumerable.call(o,a[n])&&(s[a[n]]=o[a[n]])}}return s};!function(e){"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,o=(t.document||t.ownerDocument).querySelectorAll(e),a=0;o[a]&&o[a]!==t;)++a;return Boolean(o[a])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window.Element.prototype);var delegate$2=function(e,t){return function(o){var a=o.target.closest(e);if(a)return t.call(a,o)}},compose$1=function(e){return function(t){return e.some((function(e){return!1===e.call(this,t)}),this)}};const delegate$1=delegate$2,compose=compose$1,SPLAT="*";var delegateAll$1=function(e){const t=Object.keys(e);if(1===t.length&&"*"===t[0])return e["*"];const o=t.reduce((function(t,o){return t.push(delegate$1(o,e[o])),t}),[]);return compose(o)};const assign$1=objectAssign,delegate=delegate$2,delegateAll=delegateAll$1,DELEGATE_PATTERN=/^(.+):delegate\((.+)\)$/,SPACE=" ",getListeners=function(e,t){var o,a,s=e.match(DELEGATE_PATTERN);s&&(e=s[1],o=s[2]),"object"==typeof t&&(a={capture:popKey(t,"capture"),passive:popKey(t,"passive")});var r={selector:o,delegate:"object"==typeof t?delegateAll(t):o?delegate(o,t):t,options:a};return e.indexOf(" ")>-1?e.split(" ").map((function(e){return assign$1({type:e},r)})):(r.type=e,[r])};var popKey=function(e,t){var o=e[t];return delete e[t],o},behavior$1=function(e,t){const o=Object.keys(e).reduce((function(t,o){var a=getListeners(o,e[o]);return t.concat(a)}),[]);return assign$1({add:function(e){o.forEach((function(t){e.addEventListener(t.type,t.delegate,t.options)}))},remove:function(e){o.forEach((function(t){e.removeEventListener(t.type,t.delegate,t.options)}))}},t)};const assign=objectAssign,Behavior=behavior$1,sequence=(...e)=>function(t=document.body){e.forEach((e=>{"function"==typeof this[e]&&this[e].call(this,t)}))};var behavior=(e,t)=>Behavior(e,assign({on:sequence("init","add"),off:sequence("teardown","remove")},t)),sanitizer={exports:{}};sanitizer.exports=function(){var e={_entity:/[&<>"'/]/g,_entities:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;","/":"&#x2F;"},getEntity:function(t){return e._entities[t]},escapeHTML:function(t){for(var o="",a=0;a<t.length;a++)o+=t[a],a+1<arguments.length&&(o+=String(arguments[a+1]||"").replace(e._entity,e.getEntity));return o},createSafeHTML:function(t){for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];return{__html:e.escapeHTML.apply(e,[t].concat(a)),toString:function(){return"[object WrappedHTMLObject]"},info:"This is a wrapped HTML object. See https://developer.mozilla.org/en-US/Firefox_OS/Security/Security_Automation for more."}},unwrapSafeHTML:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return t.map((function(e){return e.__html})).join("")}};return e}();const Sanitizer=sanitizer.exports;var events={CLICK:"click"};const PREFIX="usa",COMBO_BOX_CLASS="usa-combo-box",COMBO_BOX_PRISTINE_CLASS="usa-combo-box--pristine",SELECT_CLASS="usa-combo-box__select",INPUT_CLASS="usa-combo-box__input",CLEAR_INPUT_BUTTON_CLASS="usa-combo-box__clear-input",CLEAR_INPUT_BUTTON_WRAPPER_CLASS=`${CLEAR_INPUT_BUTTON_CLASS}__wrapper`,INPUT_BUTTON_SEPARATOR_CLASS="usa-combo-box__input-button-separator",TOGGLE_LIST_BUTTON_CLASS="usa-combo-box__toggle-list",TOGGLE_LIST_BUTTON_WRAPPER_CLASS=`${TOGGLE_LIST_BUTTON_CLASS}__wrapper`,LIST_CLASS="usa-combo-box__list",LIST_OPTION_CLASS="usa-combo-box__list-option",LIST_OPTION_GROUP_CLASS=`${LIST_OPTION_CLASS}--group`,LIST_OPTION_GROUP_OPTION_CLASS=`${LIST_OPTION_CLASS}--group-option`,LIST_OPTION_FOCUSED_CLASS=`${LIST_OPTION_CLASS}--focused`,LIST_OPTION_SELECTED_CLASS=`${LIST_OPTION_CLASS}--selected`,STATUS_CLASS="usa-combo-box__status",COMBO_BOX=".usa-combo-box",SELECT=`.${SELECT_CLASS}`,INPUT=`.${INPUT_CLASS}`,CLEAR_INPUT_BUTTON=`.${CLEAR_INPUT_BUTTON_CLASS}`,TOGGLE_LIST_BUTTON=`.${TOGGLE_LIST_BUTTON_CLASS}`,LIST=`.${LIST_CLASS}`,LIST_OPTION=`.${LIST_OPTION_CLASS}`,LIST_OPTION_FOCUSED=`.${LIST_OPTION_FOCUSED_CLASS}`,LIST_OPTION_SELECTED=`.${LIST_OPTION_SELECTED_CLASS}`,STATUS=`.${STATUS_CLASS}`,DEFAULT_FILTER=".*{{query}}.*",noop=()=>{},changeElementValue=(e,t="")=>{const o=e;o.value=t;const a=new CustomEvent("change",{bubbles:!0,cancelable:!0,detail:{value:t}});o.dispatchEvent(a)},getComboBoxContext=e=>{const t=e.closest(COMBO_BOX);if(!t)throw new Error(`Element is missing outer ${COMBO_BOX}`);const o=t.querySelector(SELECT),a=t.querySelector(INPUT),s=t.querySelector(LIST),r=t.querySelector(STATUS),i=t.querySelector(LIST_OPTION_FOCUSED),n=t.querySelector(LIST_OPTION_SELECTED),l=t.querySelector(TOGGLE_LIST_BUTTON),c=t.querySelector(CLEAR_INPUT_BUTTON),u=t.classList.contains(COMBO_BOX_PRISTINE_CLASS);return{comboBoxEl:t,selectEl:o,inputEl:a,listEl:s,statusEl:r,focusedOptionEl:i,selectedOptionEl:n,toggleListBtnEl:l,clearInputBtnEl:c,isPristine:u,disableFiltering:"true"===t.dataset.disableFiltering}},disable=e=>{const{inputEl:t,toggleListBtnEl:o,clearInputBtnEl:a}=getComboBoxContext(e);a.hidden=!0,a.disabled=!0,o.disabled=!0,t.disabled=!0},ariaDisable=e=>{const{inputEl:t,toggleListBtnEl:o,clearInputBtnEl:a}=getComboBoxContext(e);a.hidden=!0,a.setAttribute("aria-disabled",!0),o.setAttribute("aria-disabled",!0),t.setAttribute("aria-disabled",!0)},enable=e=>{const{inputEl:t,toggleListBtnEl:o,clearInputBtnEl:a}=getComboBoxContext(e);a.hidden=!1,a.disabled=!1,o.disabled=!1,t.disabled=!1},handleMouseUp=e=>{const t=e.target;t.selectionStart===t.selectionEnd&&t.select()},enhanceComboBox=(e,t)=>{const o=e.closest(COMBO_BOX);if(o.dataset.enhanced)return;const a=o.querySelector("select");if(!a)throw new Error(`${COMBO_BOX} is missing inner select`);const s=a.id,r=t,i=`${s}--list`,n=`${s}-label`,l=`${s}--assistiveHint`,c=[],{defaultValue:u}=o.dataset,{placeholder:d}=o.dataset;let b;if(d&&c.push({placeholder:d}),u)for(let e=0,t=a.options.length;e<t;e+=1){const t=a.options[e];if(t.value===u){b=t;break}}if(!r||!r.matches(`label[for="${s}"]`))throw new Error(`${COMBO_BOX} for ${s} is either missing a label or a "for" attribute`);r.setAttribute("id",n),r.setAttribute("id",n),a.setAttribute("aria-hidden","true"),a.setAttribute("tabindex","-1"),a.classList.add("usa-sr-only",SELECT_CLASS),a.id="",a.value="",["required","aria-label","aria-labelledby"].forEach((e=>{if(a.hasAttribute(e)){const t=a.getAttribute(e);c.push({[e]:t}),a.removeAttribute(e)}}));const p=document.createElement("input");if(p.setAttribute("id",s),p.setAttribute("aria-owns",i),p.setAttribute("aria-controls",i),p.setAttribute("aria-autocomplete","list"),p.setAttribute("aria-describedby",l),p.setAttribute("aria-expanded","false"),p.setAttribute("autocapitalize","off"),p.setAttribute("autocomplete","off"),p.setAttribute("class",INPUT_CLASS),p.setAttribute("type","text"),p.setAttribute("role","combobox"),p.onmouseup=handleMouseUp,c.forEach((e=>Object.keys(e).forEach((t=>{const o=Sanitizer.escapeHTML`${e[t]}`;p.setAttribute(t,o)})))),o.insertAdjacentElement("beforeend",p),o.insertAdjacentHTML("beforeend",Sanitizer.escapeHTML`
3
3
  <span class="${CLEAR_INPUT_BUTTON_WRAPPER_CLASS}" tabindex="-1">
4
4
  <button type="button" class="${CLEAR_INPUT_BUTTON_CLASS}" aria-label="Clear the select contents">&nbsp;</button>
5
5
  </span>
@@ -15,8 +15,4 @@ import{proxyCustomElement,HTMLElement,createEvent,forceUpdate,h,Fragment,Host}fr
15
15
  aria-labelledby="${n}"
16
16
  hidden>
17
17
  </ul>
18
- <div class="${STATUS_CLASS} usa-sr-only" role="status"></div>
19
- <span id="${l}" class="usa-sr-only">
20
- When autocomplete results are available use up and down arrows to review and enter to select.
21
- Touch device users, explore by touch or with swipe gestures.
22
- </span>`),b){const{inputEl:e}=getComboBoxContext(o);changeElementValue(a,b.value),changeElementValue(e,b.text),o.classList.add(COMBO_BOX_PRISTINE_CLASS)}a.disabled&&(disable(o),a.disabled=!1),a.hasAttribute("aria-disabled")&&(ariaDisable(o),a.removeAttribute("aria-disabled")),o.dataset.enhanced="true"},highlightOption=(e,t,{skipFocus:o,preventScroll:a}={})=>{const{inputEl:s,listEl:r,focusedOptionEl:i}=getComboBoxContext(e);if(i&&(i.classList.remove(LIST_OPTION_FOCUSED_CLASS),i.setAttribute("tabIndex","-1")),t){if(s.setAttribute("aria-activedescendant",t.id),t.setAttribute("tabIndex","0"),t.classList.add(LIST_OPTION_FOCUSED_CLASS),!a){const e=t.offsetTop+t.offsetHeight;e>r.scrollTop+r.offsetHeight&&(r.scrollTop=e-r.offsetHeight),t.offsetTop<r.scrollTop&&(r.scrollTop=t.offsetTop)}o||t.focus({preventScroll:a})}else s.setAttribute("aria-activedescendant",""),s.focus()},generateDynamicRegExp=(e,t="",o={})=>{const a=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");let s=e.replace(/{{(.*?)}}/g,((e,s)=>{const r=s.trim(),i=o[r];if("query"!==r&&i){const e=new RegExp(i,"i"),o=t.match(e);return o?a(o[1]):""}return a(t)}));return s=`^(?:${s})$`,new RegExp(s,"i")},isDataOptGroup=e=>"true"===e.getAttribute("data-optgroup"),displayList=e=>{const{comboBoxEl:t,selectEl:o,inputEl:a,listEl:s,statusEl:r,isPristine:i,disableFiltering:n}=getComboBoxContext(e);let l,c;const u=`${s.id}--option-`,d=(a.value||"").toLowerCase(),b=t.dataset.filter||DEFAULT_FILTER,p=generateDynamicRegExp(b,d,t.dataset),m=[];let g="";for(let e=0,t=o.options.length;e<t;e+=1){const t=o.options[e],a=`${u}${m.length}`;if(t.value&&(n||i||!d||p.test(t.text))){if(o.value&&t.value===o.value&&(l=a),n&&!c&&p.test(t.text)&&(c=a),!d){m.push(t);continue}if(d&&p.test(t.text)&&"true"!==t.getAttribute("data-optgroup")){if("true"===t.getAttribute("data-optgroup-option")&&g!==t.getAttribute("aria-describedby")){g=t.getAttribute("aria-describedby");const e=o.querySelector("#"+g);m.push(e)}m.push(t)}}}const h=m.length,_=m.filter((e=>!isDataOptGroup(e))).length;let x=!1,f=0;const S=m.map(((e,t)=>{const a=isDataOptGroup(e),s=null!==e.getAttribute("data-optgroup-option");a||(f+=1);const r=`${u}${t}`,i=a?[]:[LIST_OPTION_CLASS];let n="-1",c="false";o.value&&e.value===o.value&&(i.push(LIST_OPTION_SELECTED_CLASS,LIST_OPTION_FOCUSED_CLASS),n="0",c="true"),l||x||a||(i.push(LIST_OPTION_FOCUSED_CLASS),n="0",x=!0),a?i.push(LIST_OPTION_GROUP_CLASS):s&&i.push(LIST_OPTION_GROUP_OPTION_CLASS);const d=document.createElement("li");return a||(d.setAttribute("aria-setsize",_),d.setAttribute("aria-posinset",f),d.setAttribute("aria-describedby",e.getAttribute("aria-describedby"))),d.setAttribute("aria-selected",c),d.setAttribute("id",a?e.id:r),d.setAttribute("class",i.join(" ")),d.setAttribute("tabindex",n),d.setAttribute("role",a?"group":"option"),d.setAttribute("data-value",e.value),d.textContent=e.text,d})),v=document.createElement("li");let E;v.setAttribute("class",`${LIST_OPTION_CLASS}--no-results`),v.textContent="No results found",s.hidden=!1,h?(s.innerHTML="",S.forEach((e=>s.insertAdjacentElement("beforeend",e)))):(s.innerHTML="",s.insertAdjacentElement("beforeend",v)),a.setAttribute("aria-expanded","true"),r.textContent=_?`${_} result${_>1?"s":""} available.`:"No results.",i&&l?E=s.querySelector(`#${l}`):n&&c&&(E=s.querySelector(`#${c}`)),E&&highlightOption(s,E,{skipFocus:!0})},hideList=e=>{const{inputEl:t,listEl:o,statusEl:a,focusedOptionEl:s}=getComboBoxContext(e);a.innerHTML="",t.setAttribute("aria-expanded","false"),t.setAttribute("aria-activedescendant",""),s&&s.classList.remove(LIST_OPTION_FOCUSED_CLASS),o.scrollTop=0,o.hidden=!0},selectItem=e=>{const{comboBoxEl:t,selectEl:o,inputEl:a}=getComboBoxContext(e);changeElementValue(o,e.dataset.value),changeElementValue(a,e.textContent),t.classList.add(COMBO_BOX_PRISTINE_CLASS),hideList(t),a.focus()},clearInput=e=>{const{comboBoxEl:t,listEl:o,selectEl:a,inputEl:s}=getComboBoxContext(e),r=!o.hidden;a.value&&changeElementValue(a),s.value&&changeElementValue(s),t.classList.remove(COMBO_BOX_PRISTINE_CLASS),r&&displayList(t),s.focus()},resetSelection=e=>{const{comboBoxEl:t,selectEl:o,inputEl:a}=getComboBoxContext(e),s=o.value,r=(a.value||"").toLowerCase();if(s)for(let e=0,i=o.options.length;e<i;e+=1){const i=o.options[e];if(i.value===s)return r!==i.text&&changeElementValue(a,i.text),void t.classList.add(COMBO_BOX_PRISTINE_CLASS)}r&&changeElementValue(a)},completeSelection=e=>{const{comboBoxEl:t,selectEl:o,inputEl:a,statusEl:s}=getComboBoxContext(e);s.textContent="";const r=(a.value||"").toLowerCase();if(r)for(let e=0,s=o.options.length;e<s;e+=1){const s=o.options[e];if(s.text.toLowerCase()===r)return changeElementValue(o,s.value),changeElementValue(a,s.text),void t.classList.add(COMBO_BOX_PRISTINE_CLASS)}resetSelection(t)},handleEscape=e=>{const{comboBoxEl:t,inputEl:o}=getComboBoxContext(e.target);hideList(t),resetSelection(t),o.focus()},handleDownFromInput=e=>{const{comboBoxEl:t,listEl:o}=getComboBoxContext(e.target);o.hidden&&displayList(t);let a=o.querySelector(LIST_OPTION_FOCUSED)||o.querySelector(LIST_OPTION);a&&("group"===a.getAttribute("role")&&(a=a.nextSibling),highlightOption(t,a)),e.preventDefault()},handleEnterFromInput=e=>{const{comboBoxEl:t,listEl:o}=getComboBoxContext(e.target),a=!o.hidden;completeSelection(t),a&&hideList(t),e.preventDefault()},handleDownFromListOption=e=>{const t=e.target;let o=t.nextSibling;o&&("group"===o.getAttribute("role")&&(o=o.nextSibling),highlightOption(t,o)),e.preventDefault()},handleSpaceFromListOption=e=>{selectItem(e.target),e.preventDefault()},handleEnterFromListOption=e=>{selectItem(e.target),e.preventDefault()},handleUpFromListOption=e=>{const{comboBoxEl:t,listEl:o,focusedOptionEl:a}=getComboBoxContext(e.target);let s=a&&a.previousSibling;const r=!o.hidden;s&&("group"===s.getAttribute("role")&&(s=s.previousSibling),highlightOption(a,s)),r&&e.preventDefault(),s||hideList(t)},handleMouseover=e=>{e.classList.contains(LIST_OPTION_FOCUSED_CLASS)||highlightOption(e,e,{preventScroll:!0})},toggleList=e=>{const{comboBoxEl:t,listEl:o,inputEl:a}=getComboBoxContext(e);o.hidden?displayList(t):hideList(t),a.focus()},handleClickFromInput=e=>{const{comboBoxEl:t,listEl:o}=getComboBoxContext(e);o.hidden&&displayList(t)},comboBox=behavior({[events.CLICK]:{[INPUT](){this.disabled||handleClickFromInput(this)},[TOGGLE_LIST_BUTTON](){this.disabled||toggleList(this)},[LIST_OPTION](){this.disabled||selectItem(this)},[CLEAR_INPUT_BUTTON](){this.disabled||clearInput(this)}},focusout:{[COMBO_BOX](e){this.contains(e.relatedTarget)||(resetSelection(this),hideList(this))}},keydown:{[COMBO_BOX]:keymap({Escape:handleEscape}),[INPUT]:keymap({Enter:handleEnterFromInput,ArrowDown:handleDownFromInput,Down:handleDownFromInput}),[LIST_OPTION]:keymap({ArrowUp:handleUpFromListOption,Up:handleUpFromListOption,ArrowDown:handleDownFromListOption,Down:handleDownFromListOption,Enter:handleEnterFromListOption," ":handleSpaceFromListOption,"Shift+Tab":noop})},input:{[INPUT](){this.closest(COMBO_BOX).classList.remove(COMBO_BOX_PRISTINE_CLASS),displayList(this)}},mouseover:{[LIST_OPTION](){handleMouseover(this)}}},{init(e,t){selectOrMatches(COMBO_BOX,e).forEach((e=>{enhanceComboBox(e,t)}))},getComboBoxContext:getComboBoxContext,enhanceComboBox:enhanceComboBox,generateDynamicRegExp:generateDynamicRegExp,disable:disable,enable:enable,displayList:displayList,hideList:hideList,COMBO_BOX_CLASS:"usa-combo-box"}),vaComboBoxCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}input,select,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0.1rem solid var(--vads-color-base-dark);border-radius:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--vads-color-base-darkest);display:block;font-size:1.06rem;height:2.625rem;line-height:1.3;margin:0.2em 0;max-width:46rem;padding:1rem 0.7em;width:100%}.usa-hint,.usa-select,.usa-combo-box__input,.usa-combo-box__list{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-select,.usa-combo-box__input{border-width:1px;border-color:#565c65;border-style:solid;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:0;color:#1b1b1b;display:block;height:2.5rem;margin-top:0.5rem;max-width:30rem;padding:0.5rem;width:100%}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-combo-box{max-width:30rem;position:relative}.usa-combo-box--pristine .usa-combo-box__input{padding-right:calc(5em + 4px)}.usa-combo-box--pristine .usa-combo-box__input::-ms-clear{display:none}.usa-combo-box--pristine .usa-combo-box__clear-input{display:block}@media (forced-colors: active){.usa-combo-box--pristine .usa-combo-box__clear-input{background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E");background-repeat:no-repeat;background-position:center center;background-size:1rem 1rem;display:inline-block;height:1rem;width:1rem;height:1.5rem;width:auto;top:0.5rem}@supports ((-webkit-mask: url("")) or (mask: url(""))){.usa-combo-box--pristine .usa-combo-box__clear-input{background:none;background-color:ButtonText;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:1rem 1rem;mask-size:1rem 1rem}}}.usa-combo-box__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin-bottom:0;max-width:none;padding-right:calc(2.5em + 3px)}.usa-combo-box__input:disabled,.usa-combo-box__input[aria-disabled=true]{color:#454545;background-color:#c9c9c9;cursor:not-allowed;opacity:1;-webkit-text-fill-color:#454545}.usa-combo-box__input:disabled:hover,.usa-combo-box__input:disabled:active,.usa-combo-box__input:disabled:focus,.usa-combo-box__input:disabled.usa-focus,.usa-combo-box__input[aria-disabled=true]:hover,.usa-combo-box__input[aria-disabled=true]:active,.usa-combo-box__input[aria-disabled=true]:focus,.usa-combo-box__input[aria-disabled=true].usa-focus{color:#454545;background-color:#c9c9c9}@media (forced-colors: active){.usa-combo-box__input:disabled,.usa-combo-box__input[aria-disabled=true]{border:0;color:GrayText}.usa-combo-box__input:disabled:hover,.usa-combo-box__input:disabled:active,.usa-combo-box__input:disabled:focus,.usa-combo-box__input:disabled.usa-focus,.usa-combo-box__input[aria-disabled=true]:hover,.usa-combo-box__input[aria-disabled=true]:active,.usa-combo-box__input[aria-disabled=true]:focus,.usa-combo-box__input[aria-disabled=true].usa-focus{color:GrayText}}@media (forced-colors: active){.usa-combo-box__input:disabled,.usa-combo-box__input[aria-disabled=true]{border:2px solid GrayText}}.usa-combo-box__input:disabled::-webkit-input-placeholder,.usa-combo-box__input[aria-disabled=true]::-webkit-input-placeholder{opacity:1}.usa-combo-box__input:disabled::-moz-placeholder,.usa-combo-box__input[aria-disabled=true]::-moz-placeholder{opacity:1}.usa-combo-box__input:disabled:-ms-input-placeholder,.usa-combo-box__input[aria-disabled=true]:-ms-input-placeholder{opacity:1}.usa-combo-box__input:disabled::-ms-input-placeholder,.usa-combo-box__input[aria-disabled=true]::-ms-input-placeholder{opacity:1}.usa-combo-box__input:disabled::placeholder,.usa-combo-box__input[aria-disabled=true]::placeholder{opacity:1}.usa-combo-box__input:disabled~.usa-combo-box__input-button-separator,.usa-combo-box__input[aria-disabled=true]~.usa-combo-box__input-button-separator{background-color:#454545;cursor:not-allowed}button.usa-combo-box__toggle-list:focus,button.usa-combo-box__clear-input:focus{outline-offset:-4px}button.usa-combo-box__toggle-list:disabled,button.usa-combo-box__toggle-list[aria-disabled=true],button.usa-combo-box__clear-input:disabled,button.usa-combo-box__clear-input[aria-disabled=true]{cursor:not-allowed}.usa-combo-box__toggle-list__wrapper:focus,.usa-combo-box__clear-input__wrapper:focus{outline:0}.usa-combo-box__toggle-list,.usa-combo-box__clear-input{background-color:transparent;background-position:center;background-size:auto 1.5rem;border:0;bottom:1px;cursor:pointer;margin-bottom:0;opacity:0.6;padding-right:2rem;position:absolute;top:1px;z-index:100}.usa-combo-box__clear-input{background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);background-repeat:no-repeat;display:none;right:calc(2.5em + 3px)}.usa-combo-box__toggle-list{background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);background-repeat:no-repeat;background-size:auto 2rem;right:1px}@media (forced-colors: active){.usa-combo-box__toggle-list{background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E");background-repeat:no-repeat;background-position:center center;background-size:1rem 1rem;display:inline-block;height:1rem;width:1rem;height:auto;width:auto}@supports ((-webkit-mask: url("")) or (mask: url(""))){.usa-combo-box__toggle-list{background:none;background-color:ButtonText;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:1rem 1rem;mask-size:1rem 1rem}}.usa-combo-box__toggle-list:disabled,.usa-combo-box__toggle-list[aria-disabled=true]{background-color:GrayText}}.usa-combo-box__input-button-separator{background-color:#c6cace;position:absolute;top:1px;height:calc(100% - 1rem);margin-bottom:0.5rem;margin-top:0.5rem;width:1px;right:calc(2.5em + 2px);-webkit-box-sizing:border-box;box-sizing:border-box;z-index:200}@media (forced-colors: active){.usa-combo-box__input-button-separator{background-color:ButtonText}}.usa-combo-box__list{border-width:1px;border-color:#565c65;border-style:solid;background-color:white;border-radius:0;border-top:0;margin:0;max-height:12.1em;overflow-x:hidden;overflow-y:scroll;padding:0;position:absolute;width:100%;z-index:300}.usa-combo-box__list:focus{outline:0}.usa-combo-box__list-option{border-bottom:1px solid #dfe1e2;cursor:pointer;display:block;padding:0.5rem}.usa-combo-box__list-option--focused{outline:2px solid #162e51;outline-offset:-2px;position:relative;z-index:100}.usa-combo-box__list-option--focused:focus{outline-offset:-4px}.usa-combo-box__list-option--selected{background-color:#005ea2;border-color:#005ea2;color:white}.usa-combo-box__list-option--no-results{cursor:not-allowed;display:block;padding:0.5rem}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-icon{display:inline-block;fill:currentColor;height:1em;position:relative;width:1em}.usa-icon--size-3{height:1.5rem;width:1.5rem}.usa-icon--size-4{height:2rem;width:2rem}.usa-icon--size-5{height:2.5rem;width:2.5rem}.usa-icon--size-6{height:3rem;width:3rem}.usa-icon--size-7{height:3.5rem;width:3.5rem}.usa-icon--size-8{height:4rem;width:4rem}.usa-icon--size-9{height:4.5rem;width:4.5rem}.usa-select{background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:white;background-position:right 0.5rem center;background-size:1.25rem;padding-right:2rem}.usa-select::-ms-expand{display:none}.usa-select:-webkit-autofill{-webkit-appearance:menulist;appearance:menulist}.usa-select:-moz-focusring{color:transparent;text-shadow:0 0 0 black}.usa-select[multiple]{height:auto;background-image:none;padding-right:0}.usa-select option{overflow:hidden;text-overflow:ellipsis}.usa-select:disabled,.usa-select[aria-disabled=true]{color:#454545;background-color:#c9c9c9;cursor:not-allowed;opacity:1}.usa-select:disabled:hover,.usa-select:disabled:active,.usa-select:disabled:focus,.usa-select:disabled.usa-focus,.usa-select[aria-disabled=true]:hover,.usa-select[aria-disabled=true]:active,.usa-select[aria-disabled=true]:focus,.usa-select[aria-disabled=true].usa-focus{color:#454545;background-color:#c9c9c9}@media (forced-colors: active){.usa-select:disabled,.usa-select[aria-disabled=true]{border:0;color:GrayText}.usa-select:disabled:hover,.usa-select:disabled:active,.usa-select:disabled:focus,.usa-select:disabled.usa-focus,.usa-select[aria-disabled=true]:hover,.usa-select[aria-disabled=true]:active,.usa-select[aria-disabled=true]:focus,.usa-select[aria-disabled=true].usa-focus{color:GrayText}}@media (forced-colors: active){.usa-select:disabled,.usa-select[aria-disabled=true]{border:2px solid GrayText}}@media (forced-colors: active){.usa-select{-webkit-appearance:listbox;-moz-appearance:listbox;appearance:listbox;background-image:none;padding-right:0}}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}:host .usa-input--2xs{max-width:5ex}:host .usa-input--xs{max-width:9ex}:host .usa-input--sm,:host .usa-input--small{max-width:13ex}:host .usa-input--md,:host .usa-input--medium{max-width:20ex}:host .usa-input--lg{max-width:30ex}:host .usa-input--xl{max-width:40ex}:host .usa-input--2xl{max-width:50ex}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}:host{display:block;font-family:var(--font-source-sans);color:var(--vads-color-base);max-width:30rem}:host([inert]) select{border:0;background:none}.usa-select{margin-bottom:0}::slotted(option),::slotted(optgroup){display:none}.usa-combo-box__list{width:calc(100% - 2px)}.usa-combo-box__list-option--focused{outline:2px solid var(--vads-color-action-border-base-active-on-light)}.usa-combo-box__list-option--focused:focus{outline-offset:-2px}.usa-combo-box__list-option--group{font-weight:bold;background-color:var(--vads-color-base-lightest);cursor:not-allowed;display:block;padding:0.5rem}.usa-combo-box__list-option--group-option{padding-left:24px}.usa-combo-box__clear-input{right:calc(2.5rem + 3px)}.usa-combo-box__input-button-separator{right:calc(2.5rem + 2px)}',VaComboBoxStyle0=vaComboBoxCss,VaComboBox$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaSelect=createEvent(this,"vaSelect",7),this.options=void 0,this.labelNode=void 0,this.required=!1,this.disabled=!1,this.label=void 0,this.placeholder=void 0,this.name=void 0,this.value=void 0,this.error=void 0,this.hint=void 0,this.messageAriaDescribedby=void 0}connectedCallback(){instance.on("languageChanged",(()=>{forceUpdate(this.el)}))}componentDidLoad(){const e=this.el.shadowRoot.querySelector(".usa-combo-box"),t=this.el.shadowRoot.querySelector("label");e&&(comboBox.init(e,t),comboBox.on(e));const o=this.el.shadowRoot.querySelector("input");o&&this.error&&o.classList.add("usa-input--error");const a=`${this.messageAriaDescribedby?"input-message":""} ${this.error?"input-error-message":""} ${this.hint?"input-hint":""} ${o.getAttribute("aria-describedby")}`.trim();o.setAttribute("aria-describedby",a)}disconnectedCallback(){instance.off("languageChanged");const e=this.el.shadowRoot.querySelector(".usa-combo-box");e&&comboBox.off(e)}populateOptions(){const{value:e}=this,t=this.el.querySelectorAll("option, optgroup");return Array.from(t).map(((t,o)=>"optgroup"===t.nodeName.toLowerCase()?h(Fragment,null,h("option",{"data-optgroup":"true",id:"optgroup-"+o},t.label),Array.from(t.children).map((t=>h("option",{value:t.value,selected:e===t.value,"data-optgroup-option":"true","aria-describedby":"optgroup-"+o},t.text)))):"option"===t.nodeName.toLowerCase()&&"optgroup"!==t.parentElement.nodeName.toLowerCase()?h("option",{value:t.value,selected:e===t.value},t.textContent):void 0))}handleChange(e){const t=e.target;this.value=t.value,this.vaSelect.emit({value:this.value})}render(){const{error:e,value:t,disabled:o,placeholder:a,label:s,required:r,name:i,hint:n,messageAriaDescribedby:l}=this,c=classnames({"usa-label":!0,"usa-label--error":e});return h(Host,{key:"dc550a76f0a5b9f7c5f54d7f0e7ce2cc6b615e0e"},h("label",{key:"ea3885e25bf6a95ba9def3a26e3d90c387ac68b4",htmlFor:"options",class:c,id:"options-label"},s,r&&h("span",{key:"364c96c8cc61f1639a3d188595f345cf3b6e2fa8",class:"usa-label--required"}," ",instance.t("required"))),n&&h("span",{key:"cca87724292835a33222c6e433b1c2cd10b12d26",class:"usa-hint",id:"input-hint"},n),h("span",{key:"f739a6a49ca83375c784e685e4b09115289952ae",id:"input-error-message",role:"alert"},e&&h(Fragment,{key:"92caaf6986049c00fc67ed1d38695b587f349992"},h("span",{key:"0ce5951215073721ae4007fd1edb50af542bded9",class:"usa-sr-only"},instance.t("error")),h("span",{key:"a680391e5d99a7a85a26612213b689e306e3cda7",class:"usa-error-message"},e))),h("slot",{key:"578df5da8d615d0899f8e2cfeddd8dd805bfb0e1"}),h("div",{key:"99b3d9fc4768298387108320426929175939b765",class:"usa-combo-box","data-default-value":t,"data-placeholder":a},h("select",{key:"8bdb48b6173ac6f0764521456c4a01e6367b9694",class:"usa-select",name:i,id:"options",onChange:e=>this.handleChange(e),disabled:o},this.populateOptions())),l&&h("span",{key:"28bfad34ee3e9e0eb0fab01698ef13600e33a016",id:"input-message",class:"usa-sr-only dd-privacy-hidden"},l))}get el(){return this}static get style(){return VaComboBoxStyle0}},[1,"va-combo-box",{required:[4],disabled:[4],label:[1],placeholder:[1],name:[1],value:[1537],error:[1],hint:[1],messageAriaDescribedby:[1,"message-aria-describedby"],options:[32],labelNode:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-combo-box"].forEach((e=>{"va-combo-box"===e&&(customElements.get(e)||customElements.define(e,VaComboBox$1))}))}const VaComboBox=VaComboBox$1,defineCustomElement=defineCustomElement$1;export{VaComboBox,defineCustomElement};
18
+ <div class="${STATUS_CLASS} usa-sr-only" role="status"></div>`),b){const{inputEl:e}=getComboBoxContext(o);changeElementValue(a,b.value),changeElementValue(e,b.text),o.classList.add(COMBO_BOX_PRISTINE_CLASS)}a.disabled&&(disable(o),a.disabled=!1),a.hasAttribute("aria-disabled")&&(ariaDisable(o),a.removeAttribute("aria-disabled")),o.dataset.enhanced="true"},highlightOption=(e,t,{skipFocus:o,preventScroll:a}={})=>{const{inputEl:s,listEl:r,focusedOptionEl:i}=getComboBoxContext(e);if(i&&(i.classList.remove(LIST_OPTION_FOCUSED_CLASS),i.setAttribute("tabIndex","-1")),t){if(s.setAttribute("aria-activedescendant",t.id),t.setAttribute("tabIndex","0"),t.classList.add(LIST_OPTION_FOCUSED_CLASS),!a){const e=t.offsetTop+t.offsetHeight;e>r.scrollTop+r.offsetHeight&&(r.scrollTop=e-r.offsetHeight),t.offsetTop<r.scrollTop&&(r.scrollTop=t.offsetTop)}o||t.focus({preventScroll:a})}else s.setAttribute("aria-activedescendant",""),s.focus()},generateDynamicRegExp=(e,t="",o={})=>{const a=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");let s=e.replace(/{{(.*?)}}/g,((e,s)=>{const r=s.trim(),i=o[r];if("query"!==r&&i){const e=new RegExp(i,"i"),o=t.match(e);return o?a(o[1]):""}return a(t)}));return s=`^(?:${s})$`,new RegExp(s,"i")},isDataOptGroup=e=>"true"===e.getAttribute("data-optgroup"),displayList=e=>{const{comboBoxEl:t,selectEl:o,inputEl:a,listEl:s,statusEl:r,isPristine:i,disableFiltering:n}=getComboBoxContext(e);let l,c;const u=`${s.id}--option-`,d=(a.value||"").trim().toLowerCase(),b=t.dataset.filter||DEFAULT_FILTER,p=generateDynamicRegExp(b,d,t.dataset),m=[];let g="";for(let e=0,t=o.options.length;e<t;e+=1){const t=o.options[e],a=`${u}${m.length}`;if(t.value&&(n||i||!d||p.test(t.text))){if(o.value&&t.value===o.value&&(l=a),n&&!c&&p.test(t.text)&&(c=a),!d){m.push(t);continue}if(d&&p.test(t.text)&&"true"!==t.getAttribute("data-optgroup")){if("true"===t.getAttribute("data-optgroup-option")&&g!==t.getAttribute("aria-describedby")){g=t.getAttribute("aria-describedby");const e=o.querySelector("#"+g);m.push(e)}m.push(t)}}}const h=m.length,_=m.filter((e=>!isDataOptGroup(e))).length;let x=!1,f=0;const S=m.map(((e,t)=>{const a=isDataOptGroup(e),s=null!==e.getAttribute("data-optgroup-option");a||(f+=1);const r=`${u}${t}`,i=a?[]:[LIST_OPTION_CLASS];let n="-1",c="false";o.value&&e.value===o.value&&(i.push(LIST_OPTION_SELECTED_CLASS,LIST_OPTION_FOCUSED_CLASS),n="0",c="true"),l||x||a||(i.push(LIST_OPTION_FOCUSED_CLASS),n="0",x=!0),a?i.push(LIST_OPTION_GROUP_CLASS):s&&i.push(LIST_OPTION_GROUP_OPTION_CLASS);const d=document.createElement("li");return a||(d.setAttribute("aria-setsize",_),d.setAttribute("aria-posinset",f),d.setAttribute("aria-describedby",e.getAttribute("aria-describedby"))),d.setAttribute("aria-selected",c),d.setAttribute("id",a?e.id:r),d.setAttribute("class",i.join(" ")),d.setAttribute("tabindex",n),d.setAttribute("role",a?"group":"option"),d.setAttribute("data-value",e.value),d.textContent=e.text,d})),v=document.createElement("li");let E;v.setAttribute("class",`${LIST_OPTION_CLASS}--no-results`),v.textContent="No results found",s.hidden=!1,h?(s.innerHTML="",S.forEach((e=>s.insertAdjacentElement("beforeend",e)))):(s.innerHTML="",s.insertAdjacentElement("beforeend",v)),a.setAttribute("aria-expanded","true"),r.textContent=_?`${_} result${_>1?"s":""} available.`:"No results.",i&&l?E=s.querySelector(`#${l}`):n&&c&&(E=s.querySelector(`#${c}`)),E&&highlightOption(s,E,{skipFocus:!0})},hideList=e=>{const{inputEl:t,listEl:o,statusEl:a,focusedOptionEl:s}=getComboBoxContext(e);a.innerHTML="",t.setAttribute("aria-expanded","false"),t.setAttribute("aria-activedescendant",""),s&&s.classList.remove(LIST_OPTION_FOCUSED_CLASS),o.scrollTop=0,o.hidden=!0},selectItem=e=>{const{comboBoxEl:t,selectEl:o,inputEl:a}=getComboBoxContext(e);changeElementValue(o,e.dataset.value),changeElementValue(a,e.textContent),t.classList.add(COMBO_BOX_PRISTINE_CLASS),hideList(t),a.focus()},clearInput=e=>{const{comboBoxEl:t,listEl:o,selectEl:a,inputEl:s}=getComboBoxContext(e),r=!o.hidden;a.value&&changeElementValue(a),s.value&&changeElementValue(s),t.classList.remove(COMBO_BOX_PRISTINE_CLASS),r&&displayList(t),s.focus()},resetSelection=e=>{const{comboBoxEl:t,selectEl:o,inputEl:a}=getComboBoxContext(e),s=o.value,r=(a.value||"").trim().toLowerCase();if(s)for(let e=0,i=o.options.length;e<i;e+=1){const i=o.options[e];if(i.value===s)return r!==i.text&&changeElementValue(a,i.text),void t.classList.add(COMBO_BOX_PRISTINE_CLASS)}r&&changeElementValue(a)},completeSelection=e=>{const{comboBoxEl:t,selectEl:o,inputEl:a,statusEl:s}=getComboBoxContext(e);s.textContent="";const r=(a.value||"").trim().toLowerCase();if(r)for(let e=0,s=o.options.length;e<s;e+=1){const s=o.options[e];if(s.text.toLowerCase()===r)return changeElementValue(o,s.value),changeElementValue(a,s.text),void t.classList.add(COMBO_BOX_PRISTINE_CLASS)}resetSelection(t)},handleEscape=e=>{const{comboBoxEl:t,inputEl:o}=getComboBoxContext(e.target);hideList(t),resetSelection(t),o.focus()},handleDownFromInput=e=>{const{comboBoxEl:t,listEl:o}=getComboBoxContext(e.target);o.hidden&&displayList(t);let a=o.querySelector(LIST_OPTION_FOCUSED)||o.querySelector(LIST_OPTION);a&&("group"===a.getAttribute("role")&&(a=a.nextSibling),highlightOption(t,a)),e.preventDefault()},handleEnterFromInput=e=>{const{comboBoxEl:t,listEl:o}=getComboBoxContext(e.target),a=!o.hidden;completeSelection(t),a&&hideList(t),e.preventDefault()},handleDownFromListOption=e=>{const t=e.target;let o=t.nextSibling;o&&("group"===o.getAttribute("role")&&(o=o.nextSibling),highlightOption(t,o)),e.preventDefault()},handleSpaceFromListOption=e=>{selectItem(e.target),e.preventDefault()},handleEnterFromListOption=e=>{selectItem(e.target),e.preventDefault()},handleUpFromListOption=e=>{const{comboBoxEl:t,listEl:o,focusedOptionEl:a}=getComboBoxContext(e.target);let s=a&&a.previousSibling;const r=!o.hidden;s&&("group"===s.getAttribute("role")&&(s=s.previousSibling),highlightOption(a,s)),r&&e.preventDefault(),s||hideList(t)},handleMouseover=e=>{e.classList.contains(LIST_OPTION_FOCUSED_CLASS)||highlightOption(e,e,{preventScroll:!0})},toggleList=e=>{const{comboBoxEl:t,listEl:o,inputEl:a}=getComboBoxContext(e);o.hidden?displayList(t):hideList(t),a.focus()},handleClickFromInput=e=>{const{comboBoxEl:t,listEl:o}=getComboBoxContext(e);o.hidden&&displayList(t)},comboBox=behavior({[events.CLICK]:{[INPUT](){this.disabled||handleClickFromInput(this)},[TOGGLE_LIST_BUTTON](){this.disabled||toggleList(this)},[LIST_OPTION](){this.disabled||selectItem(this)},[CLEAR_INPUT_BUTTON](){this.disabled||clearInput(this)}},focusout:{[COMBO_BOX](e){this.contains(e.relatedTarget)||(completeSelection(this),hideList(this))}},keydown:{[COMBO_BOX]:keymap({Escape:handleEscape}),[INPUT]:keymap({Enter:handleEnterFromInput,ArrowDown:handleDownFromInput,Down:handleDownFromInput}),[LIST_OPTION]:keymap({ArrowUp:handleUpFromListOption,Up:handleUpFromListOption,ArrowDown:handleDownFromListOption,Down:handleDownFromListOption,Enter:handleEnterFromListOption," ":handleSpaceFromListOption,"Shift+Tab":noop})},input:{[INPUT](){this.closest(COMBO_BOX).classList.remove(COMBO_BOX_PRISTINE_CLASS),displayList(this)}},mouseover:{[LIST_OPTION](){handleMouseover(this)}}},{init(e,t){selectOrMatches(COMBO_BOX,e).forEach((e=>{enhanceComboBox(e,t)}))},getComboBoxContext:getComboBoxContext,enhanceComboBox:enhanceComboBox,generateDynamicRegExp:generateDynamicRegExp,disable:disable,enable:enable,displayList:displayList,hideList:hideList,COMBO_BOX_CLASS:"usa-combo-box"}),vaComboBoxCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}input,select,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0.1rem solid var(--vads-color-base-dark);border-radius:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--vads-color-base-darkest);display:block;font-size:1.06rem;height:2.625rem;line-height:1.3;margin:0.2em 0;max-width:46rem;padding:1rem 0.7em;width:100%}.usa-hint,.usa-select,.usa-combo-box__input,.usa-combo-box__list{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-select,.usa-combo-box__input{border-width:1px;border-color:#565c65;border-style:solid;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:0;color:#1b1b1b;display:block;height:2.5rem;margin-top:0.5rem;max-width:30rem;padding:0.5rem;width:100%}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-combo-box{max-width:30rem;position:relative}.usa-combo-box--pristine .usa-combo-box__input{padding-right:calc(5em + 4px)}.usa-combo-box--pristine .usa-combo-box__input::-ms-clear{display:none}.usa-combo-box--pristine .usa-combo-box__clear-input{display:block}@media (forced-colors: active){.usa-combo-box--pristine .usa-combo-box__clear-input{background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E");background-repeat:no-repeat;background-position:center center;background-size:1rem 1rem;display:inline-block;height:1rem;width:1rem;height:1.5rem;width:auto;top:0.5rem}@supports ((-webkit-mask: url("")) or (mask: url(""))){.usa-combo-box--pristine .usa-combo-box__clear-input{background:none;background-color:ButtonText;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:1rem 1rem;mask-size:1rem 1rem}}}.usa-combo-box__input{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin-bottom:0;max-width:none;padding-right:calc(2.5em + 3px)}.usa-combo-box__input:disabled,.usa-combo-box__input[aria-disabled=true]{color:#454545;background-color:#c9c9c9;cursor:not-allowed;opacity:1;-webkit-text-fill-color:#454545}.usa-combo-box__input:disabled:hover,.usa-combo-box__input:disabled:active,.usa-combo-box__input:disabled:focus,.usa-combo-box__input:disabled.usa-focus,.usa-combo-box__input[aria-disabled=true]:hover,.usa-combo-box__input[aria-disabled=true]:active,.usa-combo-box__input[aria-disabled=true]:focus,.usa-combo-box__input[aria-disabled=true].usa-focus{color:#454545;background-color:#c9c9c9}@media (forced-colors: active){.usa-combo-box__input:disabled,.usa-combo-box__input[aria-disabled=true]{border:0;color:GrayText}.usa-combo-box__input:disabled:hover,.usa-combo-box__input:disabled:active,.usa-combo-box__input:disabled:focus,.usa-combo-box__input:disabled.usa-focus,.usa-combo-box__input[aria-disabled=true]:hover,.usa-combo-box__input[aria-disabled=true]:active,.usa-combo-box__input[aria-disabled=true]:focus,.usa-combo-box__input[aria-disabled=true].usa-focus{color:GrayText}}@media (forced-colors: active){.usa-combo-box__input:disabled,.usa-combo-box__input[aria-disabled=true]{border:2px solid GrayText}}.usa-combo-box__input:disabled::-webkit-input-placeholder,.usa-combo-box__input[aria-disabled=true]::-webkit-input-placeholder{opacity:1}.usa-combo-box__input:disabled::-moz-placeholder,.usa-combo-box__input[aria-disabled=true]::-moz-placeholder{opacity:1}.usa-combo-box__input:disabled:-ms-input-placeholder,.usa-combo-box__input[aria-disabled=true]:-ms-input-placeholder{opacity:1}.usa-combo-box__input:disabled::-ms-input-placeholder,.usa-combo-box__input[aria-disabled=true]::-ms-input-placeholder{opacity:1}.usa-combo-box__input:disabled::placeholder,.usa-combo-box__input[aria-disabled=true]::placeholder{opacity:1}.usa-combo-box__input:disabled~.usa-combo-box__input-button-separator,.usa-combo-box__input[aria-disabled=true]~.usa-combo-box__input-button-separator{background-color:#454545;cursor:not-allowed}button.usa-combo-box__toggle-list:focus,button.usa-combo-box__clear-input:focus{outline-offset:-4px}button.usa-combo-box__toggle-list:disabled,button.usa-combo-box__toggle-list[aria-disabled=true],button.usa-combo-box__clear-input:disabled,button.usa-combo-box__clear-input[aria-disabled=true]{cursor:not-allowed}.usa-combo-box__toggle-list__wrapper:focus,.usa-combo-box__clear-input__wrapper:focus{outline:0}.usa-combo-box__toggle-list,.usa-combo-box__clear-input{background-color:transparent;background-position:center;background-size:auto 1.5rem;border:0;bottom:1px;cursor:pointer;margin-bottom:0;opacity:0.6;padding-right:2rem;position:absolute;top:1px;z-index:100}.usa-combo-box__clear-input{background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);background-repeat:no-repeat;display:none;right:calc(2.5em + 3px)}.usa-combo-box__toggle-list{background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);background-repeat:no-repeat;background-size:auto 2rem;right:1px}@media (forced-colors: active){.usa-combo-box__toggle-list{background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E");background-repeat:no-repeat;background-position:center center;background-size:1rem 1rem;display:inline-block;height:1rem;width:1rem;height:auto;width:auto}@supports ((-webkit-mask: url("")) or (mask: url(""))){.usa-combo-box__toggle-list{background:none;background-color:ButtonText;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));mask-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:1rem 1rem;mask-size:1rem 1rem}}.usa-combo-box__toggle-list:disabled,.usa-combo-box__toggle-list[aria-disabled=true]{background-color:GrayText}}.usa-combo-box__input-button-separator{background-color:#c6cace;position:absolute;top:1px;height:calc(100% - 1rem);margin-bottom:0.5rem;margin-top:0.5rem;width:1px;right:calc(2.5em + 2px);-webkit-box-sizing:border-box;box-sizing:border-box;z-index:200}@media (forced-colors: active){.usa-combo-box__input-button-separator{background-color:ButtonText}}.usa-combo-box__list{border-width:1px;border-color:#565c65;border-style:solid;background-color:white;border-radius:0;border-top:0;margin:0;max-height:12.1em;overflow-x:hidden;overflow-y:scroll;padding:0;position:absolute;width:100%;z-index:300}.usa-combo-box__list:focus{outline:0}.usa-combo-box__list-option{border-bottom:1px solid #dfe1e2;cursor:pointer;display:block;padding:0.5rem}.usa-combo-box__list-option--focused{outline:2px solid #162e51;outline-offset:-2px;position:relative;z-index:100}.usa-combo-box__list-option--focused:focus{outline-offset:-4px}.usa-combo-box__list-option--selected{background-color:#005ea2;border-color:#005ea2;color:white}.usa-combo-box__list-option--no-results{cursor:not-allowed;display:block;padding:0.5rem}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-icon{display:inline-block;fill:currentColor;height:1em;position:relative;width:1em}.usa-icon--size-3{height:1.5rem;width:1.5rem}.usa-icon--size-4{height:2rem;width:2rem}.usa-icon--size-5{height:2.5rem;width:2.5rem}.usa-icon--size-6{height:3rem;width:3rem}.usa-icon--size-7{height:3.5rem;width:3.5rem}.usa-icon--size-8{height:4rem;width:4rem}.usa-icon--size-9{height:4.5rem;width:4.5rem}.usa-select{background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z%22%2F%3E%3C%2Fsvg%3E"), -webkit-gradient(linear, left top, left bottom, from(transparent), to(transparent));background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22%3E%3Cpath d%3D%22M12 5.83 15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z%22%2F%3E%3C%2Fsvg%3E"), linear-gradient(transparent, transparent);background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:white;background-position:right 0.5rem center;background-size:1.25rem;padding-right:2rem}.usa-select::-ms-expand{display:none}.usa-select:-webkit-autofill{-webkit-appearance:menulist;appearance:menulist}.usa-select:-moz-focusring{color:transparent;text-shadow:0 0 0 black}.usa-select[multiple]{height:auto;background-image:none;padding-right:0}.usa-select option{overflow:hidden;text-overflow:ellipsis}.usa-select:disabled,.usa-select[aria-disabled=true]{color:#454545;background-color:#c9c9c9;cursor:not-allowed;opacity:1}.usa-select:disabled:hover,.usa-select:disabled:active,.usa-select:disabled:focus,.usa-select:disabled.usa-focus,.usa-select[aria-disabled=true]:hover,.usa-select[aria-disabled=true]:active,.usa-select[aria-disabled=true]:focus,.usa-select[aria-disabled=true].usa-focus{color:#454545;background-color:#c9c9c9}@media (forced-colors: active){.usa-select:disabled,.usa-select[aria-disabled=true]{border:0;color:GrayText}.usa-select:disabled:hover,.usa-select:disabled:active,.usa-select:disabled:focus,.usa-select:disabled.usa-focus,.usa-select[aria-disabled=true]:hover,.usa-select[aria-disabled=true]:active,.usa-select[aria-disabled=true]:focus,.usa-select[aria-disabled=true].usa-focus{color:GrayText}}@media (forced-colors: active){.usa-select:disabled,.usa-select[aria-disabled=true]{border:2px solid GrayText}}@media (forced-colors: active){.usa-select{-webkit-appearance:listbox;-moz-appearance:listbox;appearance:listbox;background-image:none;padding-right:0}}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}:host .usa-input--2xs{max-width:5ex}:host .usa-input--xs{max-width:9ex}:host .usa-input--sm,:host .usa-input--small{max-width:13ex}:host .usa-input--md,:host .usa-input--medium{max-width:20ex}:host .usa-input--lg{max-width:30ex}:host .usa-input--xl{max-width:40ex}:host .usa-input--2xl{max-width:50ex}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}:host{display:block;font-family:var(--font-source-sans);color:var(--vads-color-base);max-width:30rem}:host([inert]) select{border:0;background:none}.usa-select{margin-bottom:0}::slotted(option),::slotted(optgroup){display:none}.usa-combo-box{max-width:auto}.usa-combo-box__list{width:calc(100% - 2px)}.usa-combo-box__list-option--focused{outline:2px solid var(--vads-color-action-border-base-active-on-light)}.usa-combo-box__list-option--focused:focus{outline-offset:-2px}.usa-combo-box__list-option--group{font-weight:bold;background-color:var(--vads-color-base-lightest);cursor:not-allowed;display:block;padding:0.5rem}.usa-combo-box__list-option--group-option{padding-left:24px}.usa-combo-box__clear-input{right:calc(2.5rem + 3px)}.usa-combo-box__input-button-separator{right:calc(2.5rem + 2px)}',VaComboBoxStyle0=vaComboBoxCss,VaComboBox$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaSelect=createEvent(this,"vaSelect",7),this.options=void 0,this.labelNode=void 0,this.required=!1,this.disabled=!1,this.label=void 0,this.placeholder=void 0,this.name=void 0,this.value=void 0,this.error=void 0,this.hint=void 0,this.messageAriaDescribedby=void 0}connectedCallback(){instance.on("languageChanged",(()=>{forceUpdate(this.el)}))}componentDidLoad(){const e=this.el.shadowRoot.querySelector(".usa-combo-box"),t=this.el.shadowRoot.querySelector("label");e&&(comboBox.init(e,t),comboBox.on(e));const o=this.el.shadowRoot.querySelector("input");o&&this.error&&o.classList.add("usa-input--error");const a=`${this.messageAriaDescribedby?"input-message":""} ${this.error?"input-error-message":""} ${this.hint?"input-hint":""} ${o.getAttribute("aria-describedby")}`.trim();o.setAttribute("aria-describedby",a)}disconnectedCallback(){instance.off("languageChanged");const e=this.el.shadowRoot.querySelector(".usa-combo-box");e&&comboBox.off(e)}populateOptions(){const{value:e}=this,t=this.el.querySelectorAll("option, optgroup");return Array.from(t).map(((t,o)=>"optgroup"===t.nodeName.toLowerCase()?h(Fragment,null,h("option",{"data-optgroup":"true",id:"optgroup-"+o},t.label),Array.from(t.children).map((t=>h("option",{value:t.value,selected:e===t.value,"data-optgroup-option":"true","aria-describedby":"optgroup-"+o},t.text)))):"option"===t.nodeName.toLowerCase()&&"optgroup"!==t.parentElement.nodeName.toLowerCase()?h("option",{value:t.value,selected:e===t.value},t.textContent):void 0))}handleChange(e){const t=e.target;this.value=t.value,this.vaSelect.emit({value:this.value})}render(){const{error:e,value:t,disabled:o,placeholder:a,label:s,required:r,name:i,hint:n,messageAriaDescribedby:l}=this,c=classnames({"usa-label":!0,"usa-label--error":e});return h(Host,{key:"d386b6d4902ba1fafddde31608c10a9cff4ed639"},h("label",{key:"b46d57f918cd608324a53b8299f1849908ff74fe",htmlFor:"options",class:c,id:"options-label"},s,r&&h("span",{key:"4989270a096694dfddb7e9bed5002d71022646d4",class:"usa-label--required"}," ",instance.t("required"))),n&&h("span",{key:"0d161f5595af8e06cbe6f8d34f0606af48027d96",class:"usa-hint",id:"input-hint"},n),h("span",{key:"4406c8652573d2baf33c696ad288067cdcd52057",id:"input-error-message",role:"alert"},e&&h(Fragment,{key:"fd89bb6ad53918f9565a0b86006756262e0650b6"},h("span",{key:"e43d2a16d18452215421957ab4c4541573c20907",class:"usa-sr-only"},instance.t("error")),h("span",{key:"168077de0b1e433d8df1f9c6783f54919c2147dc",class:"usa-error-message"},e))),h("slot",{key:"316f2dd0a012a3f240e561c801589e103c26c1d4"}),h("div",{key:"462e8380ddc2b084e8db6c4d5e62d183faa6aff7",class:"usa-combo-box","data-default-value":t,"data-placeholder":a},h("select",{key:"53473ecd010e88689f0edb984927e3247f62c93b",class:"usa-select",name:i,id:"options",onChange:e=>this.handleChange(e),disabled:o},this.populateOptions())),isMessageSet(l)&&h("span",{key:"3d28f6733076c8847f2bb6724a948355fdf978a3",id:"input-message",class:"usa-sr-only dd-privacy-hidden"},l))}get el(){return this}static get style(){return VaComboBoxStyle0}},[1,"va-combo-box",{required:[4],disabled:[4],label:[1],placeholder:[1],name:[1],value:[1537],error:[1],hint:[1],messageAriaDescribedby:[1,"message-aria-describedby"],options:[32],labelNode:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-combo-box"].forEach((e=>{"va-combo-box"===e&&(customElements.get(e)||customElements.define(e,VaComboBox$1))}))}const VaComboBox=VaComboBox$1,defineCustomElement=defineCustomElement$1;export{VaComboBox,defineCustomElement};
@@ -1 +1 @@
1
- import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{C as CONTACTS}from"./contacts.js";import{d as defineCustomElement$4}from"./va-button2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-modal2.js";import{d as defineCustomElement$1}from"./va-telephone2.js";const vaCrisisLineModalCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}.va-crisis-line-container{position:relative;margin:auto;background-color:var(--vads-color-secondary-dark)}@media (min-width: 1008px){.va-crisis-line-container{max-width:60.938rem;background-color:transparent}}a{color:var(--vads-color-link)}button.va-crisis-line{cursor:pointer;background-color:var(--vads-color-secondary-darkest);display:block;border-radius:0;color:var(--vads-button-color-text-primary-alt-on-light);font-family:var(--font-source-sans);font-size:16px;font-weight:normal;text-decoration:none;padding:0;margin:0;width:100%;border:0;-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:background-color;transition-property:background-color}button.va-crisis-line:focus{outline-offset:-2px}button.va-crisis-line:hover,button.va-crisis-line:active{background-color:#8b0a03}@media (min-width: 1008px){button.va-crisis-line:hover .va-crisis-line-icon,button.va-crisis-line:active .va-crisis-line-icon{background-color:#b51d09}}@media (min-width: 1008px){button.va-crisis-line{width:auto;border-radius:0 0 2.3px 2.3px;-webkit-box-shadow:0 2px 5px var(--vads-color-base);box-shadow:0 2px 5px var(--vads-color-base)}}.va-crisis-line-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin:auto}@media (min-width: 1008px){.va-crisis-line-inner{text-align:left;-ms-flex-pack:justify;justify-content:space-between}}.va-crisis-line-icon{content:"";background:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 96 60%22 width%3D%2296px%22 height%3D%2260px%22%3E%3Cpath d%3D%22M58 14c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 30c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 46c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm-48 2L32 60h-2V48H4c-2.20914 0-4-1.79086-4-4V4c0-2.20914 1.79086-4 4-4h40c2.20914 0 4 1.79086 4 4v40c0 2.20914-1.79086 4-4 4h-2zM24 31.72174L33.86667 39l-3.73334-11.86087L40 20.13043H28L24 8l-4 12.13043H8l9.86667 7.0087L14.13333 39 24 31.72174z%22 fill%3D%22%23FFF%22 fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat right 29%;background-size:30px auto;background-position:8px 8px;width:40px;height:36px;padding-right:3px;-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:background-color;transition-property:background-color}@media (max-width: 480px){.va-crisis-line-icon{display:none}}@media (min-width: 1008px){.va-crisis-line-icon{border-bottom-left-radius:3.2px}}.va-crisis-line-text{padding:8px}.va-icon__right-arrow{position:relative;top:2px}.va-clm__icon{position:relative;top:15px;margin-right:23px}.va-crisis-panel{color:var(--vads-color-base)}.va-crisis-panel-body{max-height:100%}.va-crisis-panel-title{color:var(--vads-color-base);padding-left:41px;background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 96 60%22 width%3D%2296px%22 height%3D%2260px%22%3E%3Cpath d%3D%22M58 14c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 30c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 46c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm-48 2L32 60h-2V48H4c-2.20914 0-4-1.79086-4-4V4c0-2.20914 1.79086-4 4-4h40c2.20914 0 4 1.79086 4 4v40c0 2.20914-1.79086 4-4 4h-2zM24 31.72174L33.86667 39l-3.73334-11.86087L40 20.13043H28L24 8l-4 12.13043H8l9.86667 7.0087L14.13333 39 24 31.72174z%22 fill%3D%22%23FFF%22 fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat left;background-position:left 5px;background-size:32px auto}.va-crisis-panel-list{list-style:none;padding:0}.va-crisis-panel-list>li{display:-ms-flexbox;display:flex;min-height:56px;margin-bottom:0;border-top:1px solid var(--vads-color-base-light)}.va-crisis-panel-list>li:last-child{border-bottom:1px solid var(--vads-color-base-light)}.va-crisis-panel-list>li>a,.va-crisis-panel-list>li>span{padding:8px 0;-ms-flex-item-align:center;align-self:center}',VaCrisisLineModalStyle0=vaCrisisLineModalCss,VACrisisLineModal=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.isOpen=!1,this.shifted=!1}setVisible(){this.isOpen=!0}setNotVisible(){this.isOpen=!1}trackShiftKey(e){this.shifted=e.shiftKey}trapFocus(){var e;const i=null===(e=this.el)||void 0===e?void 0:e.shadowRoot.querySelector("va-modal"),a=null==i?void 0:i.getAttribute("visible");if(null!==a&&"false"!==a){let e;const a=this.shifted?".last-focusable-child":'[role="document"]';e=this.shifted?null==i?void 0:i.querySelector(a):null==i?void 0:i.shadowRoot.querySelector(a),null==e||e.focus()}}render(){return h(Host,{key:"95dffb293057e7e690f20e4c74c0e450df53dfc9"},h("div",{key:"834c2522557996f2f70e5beca9df7a378365fca5",class:"va-crisis-line-container"},h("button",{key:"62f6f52a14122f5127ced40a0948352a2e4dbc11",onClick:()=>this.setVisible(),onFocusin:()=>this.trapFocus(),"data-show":"#modal-crisisline",class:"va-crisis-line va-overlay-trigger",part:"button"},h("div",{key:"26272563b53c78f7936cd850d00042d19fb131a7",class:"va-crisis-line-inner"},h("span",{key:"212c397313a3dd72aa2881fe124a6362800faa26",class:"va-crisis-line-icon","aria-hidden":"true"}),h("span",{key:"9018a9c933f8c0b5893f8c03ff263640cc439901",class:"va-crisis-line-text"},"Talk to the ",h("strong",{key:"1dc7c2d284612291ea2e188cdc551b0a5c4cb92c"},"Veterans Crisis Line")," now"),h("va-icon",{key:"e8a3c4dbb7060817ad88478a523a2c35839af3ad",class:"va-icon__right-arrow",icon:"navigate_next",size:3})))),h("va-modal",{key:"564e427efe86050f6818d1a4e386c65785f4ce93",modalTitle:"We’re here anytime, day or night – 24/7",onPrimaryButtonClick:()=>this.setNotVisible(),onCloseEvent:()=>this.setNotVisible(),visible:this.isOpen,large:!0},h("p",{key:"53c7e713765f8c26993a5e39f641d79f8a6c0044"},"If you are a Veteran in crisis or concerned about one, connect with our caring, qualified responders for confidential help. Many of them are Veterans themselves."),h("ul",{key:"9e1c10998509af5a615f8f8139ff2d80fdf6286a",class:"va-crisis-panel-list"},h("li",{key:"ad46e442d2033480d646380916d2e506ff6c3bd1"},h("va-icon",{key:"3d4ed1ff8931078c4a9e23d2ee32909097ed8060",class:"va-clm__icon",icon:"phone",size:3}),h("span",{key:"6b6c4630f7a6e07c0a9a670e85e042e77e375704"},"Call"," ",h("strong",{key:"20b6b88eb6115afd4bef8afc1f3c181b554ca934"},h("va-telephone",{key:"72b3399b3aad5c8f511f566c20259494633a3755",contact:"988"})," and select 1"))),h("li",{key:"a73f35551aefc6942fe8100d64c3a26c6337c441"},h("va-icon",{key:"a3a85f42c568196c49af8cf4f687a7d78553a0e4",icon:"phone_iphone",class:"va-clm__icon",size:3}),h("span",{key:"7f039210fd8c98fc91b2889e6901d11731b0231e"},"Text ",h("strong",{key:"035c41f8a9242b10fc9350d50e23b506932fb789"},h("va-telephone",{key:"3cbb424c8867f0f1e8a315720cf560b1cab71e07",sms:!0,contact:"838255"})))),h("li",{key:"4382af6e5b9855cb89df33b0c72fc78cc88055da"},h("va-icon",{key:"3d05064ca0411b9eea940a8d823fa4ffee4c5af0",icon:"chat",class:"va-clm__icon",size:3}),h("a",{key:"331d4f25a702b81c60b15db7cb287eacea62d1e0",class:"no-external-icon",href:"https://www.veteranscrisisline.net/get-help-now/chat/"},"Start a confidential chat")),h("li",{key:"a02a2db4b7aa09db25bd8d7f95f678d6679f047e"},h("va-icon",{key:"518c2dd6678807e6dd25477872c2850d409546fb",icon:"tty",class:"va-clm__icon",size:3}),h("p",{key:"447ae6f44ddb0ef334e9f332a742f62e8e11d948"},"Call TTY if you have hearing loss"," ",h("strong",{key:"0664bf4a0525db330e2d843025ea0a1f5fd78129"},h("va-telephone",{key:"39322f74070c6ac938dd218af58e79f2ba9b3ccf",tty:!0,contact:CONTACTS.CRISIS_TTY}))))),h("p",{key:"79cc0588532e26567f2ee4481ecd731243ed341c"},"Get more resources at"," ",h("a",{key:"0088a6788b7cfb6fc05baa2653f3f973c3cba72f",class:"no-external-icon",href:"https://www.veteranscrisisline.net/"},"VeteransCrisisLine.net"))))}get el(){return this}static get style(){return VaCrisisLineModalStyle0}},[1,"va-crisis-line-modal",{isOpen:[32],shifted:[32]},[[8,"keydown","trackShiftKey"]]]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-crisis-line-modal","va-button","va-icon","va-modal","va-telephone"].forEach((e=>{switch(e){case"va-crisis-line-modal":customElements.get(e)||customElements.define(e,VACrisisLineModal);break;case"va-button":customElements.get(e)||defineCustomElement$4();break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-modal":customElements.get(e)||defineCustomElement$2();break;case"va-telephone":customElements.get(e)||defineCustomElement$1()}}))}export{VACrisisLineModal as V,defineCustomElement as d};
1
+ import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{C as CONTACTS}from"./contacts.js";import{d as defineCustomElement$4}from"./va-button2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-modal2.js";import{d as defineCustomElement$1}from"./va-telephone2.js";const vaCrisisLineModalCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}.va-crisis-line-container{position:relative;margin:auto;background-color:var(--vads-color-secondary-dark)}@media (min-width: 1008px){.va-crisis-line-container{max-width:60.938rem;background-color:transparent}}a{color:var(--vads-color-link)}button.va-crisis-line{cursor:pointer;background-color:var(--vads-color-secondary-darkest);display:block;border-radius:0;color:var(--vads-button-color-text-primary-alt-on-light);font-family:var(--font-source-sans);font-size:16px;font-weight:normal;text-decoration:none;padding:0;margin:0;width:100%;border:0;-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:background-color;transition-property:background-color}button.va-crisis-line:focus{outline-offset:-2px}button.va-crisis-line:hover,button.va-crisis-line:active{background-color:#8b0a03}@media (min-width: 1008px){button.va-crisis-line:hover .va-crisis-line-icon,button.va-crisis-line:active .va-crisis-line-icon{background-color:#b51d09}}@media (min-width: 1008px){button.va-crisis-line{width:auto;border-radius:0 0 2.3px 2.3px;-webkit-box-shadow:0 2px 5px var(--vads-color-base);box-shadow:0 2px 5px var(--vads-color-base)}}.va-crisis-line-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin:auto}@media (min-width: 1008px){.va-crisis-line-inner{text-align:left;-ms-flex-pack:justify;justify-content:space-between}}.va-crisis-line-icon{content:"";background:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 96 60%22 width%3D%2296px%22 height%3D%2260px%22%3E%3Cpath d%3D%22M58 14c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 30c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 46c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm-48 2L32 60h-2V48H4c-2.20914 0-4-1.79086-4-4V4c0-2.20914 1.79086-4 4-4h40c2.20914 0 4 1.79086 4 4v40c0 2.20914-1.79086 4-4 4h-2zM24 31.72174L33.86667 39l-3.73334-11.86087L40 20.13043H28L24 8l-4 12.13043H8l9.86667 7.0087L14.13333 39 24 31.72174z%22 fill%3D%22%23FFF%22 fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat right 29%;background-size:30px auto;background-position:8px 8px;width:40px;height:36px;padding-right:3px;-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:background-color;transition-property:background-color}@media (max-width: 480px){.va-crisis-line-icon{display:none}}@media (min-width: 1008px){.va-crisis-line-icon{border-bottom-left-radius:3.2px}}.va-crisis-line-text{padding:8px}.va-icon__right-arrow{position:relative;top:2px}.va-clm__icon{position:relative;top:15px;margin-right:23px}.va-crisis-panel{color:var(--vads-color-base)}.va-crisis-panel-body{max-height:100%}.va-crisis-panel-title{color:var(--vads-color-base);padding-left:41px;background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 96 60%22 width%3D%2296px%22 height%3D%2260px%22%3E%3Cpath d%3D%22M58 14c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 30c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 46c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm-48 2L32 60h-2V48H4c-2.20914 0-4-1.79086-4-4V4c0-2.20914 1.79086-4 4-4h40c2.20914 0 4 1.79086 4 4v40c0 2.20914-1.79086 4-4 4h-2zM24 31.72174L33.86667 39l-3.73334-11.86087L40 20.13043H28L24 8l-4 12.13043H8l9.86667 7.0087L14.13333 39 24 31.72174z%22 fill%3D%22%23FFF%22 fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat left;background-position:left 5px;background-size:32px auto}.va-crisis-panel-list{list-style:none;padding:0}.va-crisis-panel-list>li{display:-ms-flexbox;display:flex;min-height:56px;margin-bottom:0;border-top:1px solid var(--vads-color-base-light)}.va-crisis-panel-list>li:last-child{border-bottom:1px solid var(--vads-color-base-light)}.va-crisis-panel-list>li>a,.va-crisis-panel-list>li>span{padding:8px 0;-ms-flex-item-align:center;align-self:center}',VaCrisisLineModalStyle0=vaCrisisLineModalCss,VACrisisLineModal=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.isOpen=!1,this.shifted=!1}setVisible(){this.isOpen=!0}setNotVisible(){this.isOpen=!1}trackShiftKey(e){this.shifted=e.shiftKey}trapFocus(){var e;const i=null===(e=this.el)||void 0===e?void 0:e.shadowRoot.querySelector("va-modal"),a=null==i?void 0:i.getAttribute("visible");if(null!==a&&"false"!==a){let e;const a=this.shifted?".last-focusable-child":'[role="document"]';e=this.shifted?null==i?void 0:i.querySelector(a):null==i?void 0:i.shadowRoot.querySelector(a),null==e||e.focus()}}render(){return h(Host,{key:"36f879c01d0b6a74e940e7e469f73452e4297563"},h("div",{key:"f12f3e781c1a41f9aeb1814854b47d4637262f39",class:"va-crisis-line-container"},h("button",{key:"e5fff59bc49108aad42124c8c6cb3c6767bec7cb",onClick:()=>this.setVisible(),onFocusin:()=>this.trapFocus(),"data-show":"#modal-crisisline",class:"va-crisis-line va-overlay-trigger",part:"button"},h("div",{key:"091b036014a9099390d6835ae85991bb6d3e361c",class:"va-crisis-line-inner"},h("span",{key:"eb9a6adfaf6445f3f82a33a2fb66454e7c165112",class:"va-crisis-line-icon","aria-hidden":"true"}),h("span",{key:"dc1c49e9fb993d9d72a77632a93235749216adbf",class:"va-crisis-line-text"},"Talk to the ",h("strong",{key:"cf35186666f42ce728e915c4ad99a3206b75abc4"},"Veterans Crisis Line")," now"),h("va-icon",{key:"1e7416c30c47f0e99c8d4a4491759f8dc475d87c",class:"va-icon__right-arrow",icon:"navigate_next",size:3})))),h("va-modal",{key:"23149ce5f7ee422f72ce58e68510eee32b39217f",modalTitle:"We’re here anytime, day or night – 24/7",onPrimaryButtonClick:()=>this.setNotVisible(),onCloseEvent:()=>this.setNotVisible(),visible:this.isOpen,large:!0},h("p",{key:"95a7a779092359eb2ee4d551ff819dea18a398a5"},"If you are a Veteran in crisis or concerned about one, connect with our caring, qualified responders for confidential help. Many of them are Veterans themselves."),h("ul",{key:"3255b05fff6debc9ab6d29b19b25e25f1c32a890",class:"va-crisis-panel-list"},h("li",{key:"d768def20402342f41c8d9cd8702bc009cc1fd6f"},h("va-icon",{key:"4e5dfdae2ea6baa6a891c65243feac4f61ebb0e4",class:"va-clm__icon",icon:"phone",size:3}),h("span",{key:"b221a37645003deee45c436bc56f5e1464a3cdb9"},"Call"," ",h("strong",{key:"033edd4a02fda19531e0e303b36a879685c84ab6"},h("va-telephone",{key:"54ef398bd29f270fc9ae19d82eff594a7d4641d3",contact:"988"})," and select 1"))),h("li",{key:"c7079191f92efa3e3ed989acd02ba7171b68da9f"},h("va-icon",{key:"06320970bd797531a7c8903b1fdc0d4f5efdf951",icon:"phone_iphone",class:"va-clm__icon",size:3}),h("span",{key:"95494da98e0f35291bd1c632fef9011b236b28a2"},"Text ",h("strong",{key:"c0fdd2729ae49cb70b1248516a772c3b97bdd441"},h("va-telephone",{key:"d5ea7dd5b47660beac9eaf202b47ab4305827f6a",sms:!0,contact:"838255"})))),h("li",{key:"f2dca76ec54dad33c4a58a9ada35a6c4bd5df20a"},h("va-icon",{key:"d27d8527489fdbdb57bb92ac69af943866c5d999",icon:"chat",class:"va-clm__icon",size:3}),h("a",{key:"1354c19be43173ccb7eb3e7269506d024daad9ca",class:"no-external-icon",href:"https://www.veteranscrisisline.net/get-help-now/chat/"},"Start a confidential chat")),h("li",{key:"2e545c2469ef2af443feacfb65c9a38376a94d3c"},h("va-icon",{key:"b862ccf452347399daefe5696a80ab3b113f21d7",icon:"tty",class:"va-clm__icon",size:3}),h("p",{key:"ce540a5741a0a654a5c9a2a62cf17544c0fb683e"},"Call TTY if you have hearing loss"," ",h("strong",{key:"7b78d78695b79b2e9576f050414b675db5f75158"},h("va-telephone",{key:"e2e1c38f0f2e98156b4041f594baadccb9af59d9",tty:!0,contact:CONTACTS.CRISIS_TTY}))))),h("p",{key:"601993e4047dea6e42e72080260cea29677e7951"},"Get more resources at"," ",h("a",{key:"a9cc66fcaad9e6340784c181ab95e4551222c3cd",class:"no-external-icon",href:"https://www.veteranscrisisline.net/"},"VeteransCrisisLine.net"))))}get el(){return this}static get style(){return VaCrisisLineModalStyle0}},[1,"va-crisis-line-modal",{isOpen:[32],shifted:[32]},[[8,"keydown","trackShiftKey"]]]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-crisis-line-modal","va-button","va-icon","va-modal","va-telephone"].forEach((e=>{switch(e){case"va-crisis-line-modal":customElements.get(e)||customElements.define(e,VACrisisLineModal);break;case"va-button":customElements.get(e)||defineCustomElement$4();break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-modal":customElements.get(e)||defineCustomElement$2();break;case"va-telephone":customElements.get(e)||defineCustomElement$1()}}))}export{VACrisisLineModal as V,defineCustomElement as d};
@@ -1 +1 @@
1
- import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import"./i18n-setup.js";import"./contacts.js";import{d as defineCustomElement$8}from"./va-button2.js";import{d as defineCustomElement$7}from"./va-button-icon2.js";import{d as defineCustomElement$6}from"./va-card2.js";import{d as defineCustomElement$5}from"./va-file-input2.js";import{d as defineCustomElement$4}from"./va-icon2.js";import{d as defineCustomElement$3}from"./va-modal2.js";import{d as defineCustomElement$2}from"./va-progress-bar2.js";import{i as instance}from"./i18next.js";const vaFileInputMultipleCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}h1{margin-top:0}h1,h2,h3,h4,h5,h6{margin-bottom:0;margin-top:0;clear:both}*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:1.5em}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*{margin-top:1em}h1{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:2.44rem;line-height:1.2;font-weight:700}h2{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.95rem;line-height:1.2;font-weight:700}h3{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.34rem;line-height:1.2;font-weight:700}h4{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.98rem;line-height:1.2;font-weight:700}h5{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.91rem;line-height:1.2;font-weight:700}h6{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:0.87rem;line-height:1.1;font-weight:normal;letter-spacing:0.025em;text-transform:uppercase}h1,h2,h3,h4,h5{font-family:Bitter, Georgia, Cambria, "Times New Roman", Times, serif;font-weight:700}h6{font-family:"Source Sans Pro Web", "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}@import \'~@department-of-veterans-affairs/css-library/dist/stylesheets/base/headings.css\';:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}[hidden]{display:none}:host{display:block;font-family:var(--font-source-sans);font-size:16.96px;}:host .label-header{color:var(--vads-color-base);font-weight:var(--font-weight-normal)}:host .label-header-tag{margin:0;display:inline-block}:host .file-input-wrapper{display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host .file-input{cursor:pointer;height:100%;width:100%;max-width:none;top:0;left:0;z-index:1;margin:0;position:absolute;text-indent:-999em;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target{border:1px dashed var(--vads-color-action-border-base-active-on-dark);display:block;margin-top:0.3125rem;position:relative;text-align:center;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target.file-input-target-error{border:2px dashed var(--vads-color-secondary-dark)}:host .file-input-box{background:var(--vads-color-white);height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}:host .file-input-instructions{font-size:1.06rem;padding:1.25rem 0.625rem;pointer-events:none;position:relative;z-index:3}:host .file-input-choose-text{color:var(--vads-color-link);text-decoration:underline;font-weight:var(--font-weight-normal)}:host .file-icon{color:var(--vads-color-primary-alt-darkest)}:host .selected-files-wrapper{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light)}:host .selected-files-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;border-bottom:1px solid var(--vads-color-white);margin-bottom:8px;padding:8px}:host .va-card{margin:8px}:host .file-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;padding:0 8px;display:block;width:100%;word-wrap:break-word;word-break:break-word;overflow:hidden}:host #input-error-message{padding:0 8px;width:100%}:host .file-size-label,:host .file-status-label{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:1.06rem;padding:0 8px;display:block}:host .file-status-label{font-style:italic}:host .file-info-section{padding:0 8px 8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .file-button-section{margin-top:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row;flex-direction:row}:host .file-button-section>va-button-icon{font-size:1.06rem}@media screen and (max-width: 320px){:host .file-button-section{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}:host .separator{border:0;border-top:1px solid var(--vads-color-base-lighter);margin:0}:host .vads-u-line-height--2{line-height:1.15}:host .thumbnail-container{height:40px;width:40px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .thumbnail-preview{max-width:40px;width:auto;max-height:40px;height:auto}:host .thumbnail-error{color:#b21d38}:host va-progress-bar{font-size:var(--vads-font-size-root);display:block;margin-left:16px}:host .uploading-status{font-style:var(--font-style-italic)}:host(.has-error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host(.has-error){margin-left:-0.9rem}}.required{color:var(--vads-color-secondary-dark);margin-left:0.25rem}h1 .required,h2 .required,h3 .required,h4 .required,h5 .required,h6 .required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}:host.has-error{border-left:0.25rem solid #b50909;padding-left:1rem}:host .outer-wrap{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light);display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host va-file-input.no-file{margin:0 8px}:host va-file-input:not(:last-child){border-bottom:1px solid var(--vads-color-white)}:host va-file-input.has-error{border-left:none;padding-left:0}@media screen and (min-width: 1008px){:host va-file-input.has-error{margin-left:0}}',VaFileInputMultipleStyle0=vaFileInputMultipleCss,VaFileInputMultiple$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaMultipleChange=createEvent(this,"vaMultipleChange",7),this.fileKeyCounter=0,this.additionalSlot=null,this.additionalFileUploadMessage=h("span",null,"Drag an additional file here or"," ",h("span",{class:"file-input-choose-text"},"choose from folder")),this.renderLabelOrHeader=(e,t,i)=>{const o=t?h("span",{class:"required"}," ",instance.t("required")):null;return i&&i>=1&&i<=6?h("div",{class:"label-header"},h(`h${i}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,o)):h("div",{class:"label-header"},h("span",{part:"label",class:"usa-label"},e),o)},this.addValueFiles=async()=>(this.files.shift(),this.value.forEach((e=>{this.files.push({file:e,key:this.fileKeyCounter,content:this.getAdditionalContent()||null}),this.fileKeyCounter++})),this.readOnly||this.files.push({file:null,key:this.fileKeyCounter,content:null}),this.valueAdded=!0,Promise.resolve()),this.hasErrors=()=>this.errors.some((e=>!!e)),this.label=void 0,this.name=void 0,this.required=!1,this.accept=void 0,this.errors=[],this.hint=void 0,this.enableAnalytics=!1,this.headerSize=void 0,this.value=void 0,this.readOnly=!1,this.slotFieldIndexes=null,this.files=[{key:0,file:null,content:null}],this.valueAdded=!1}findFileByKey(e){return this.files.find((t=>t.key===e))}findIndexByKey(e){return this.files.indexOf(this.files.find((t=>t.key===e)))}isEmpty(){return null===this.files[0].file}setSlotContent(){const e=this.el.shadowRoot.querySelector("slot");this.additionalSlot||(this.additionalSlot=e?e.assignedElements({flatten:!0}):[]),null==e||e.remove()}getAdditionalContent(){return this.additionalSlot&&this.additionalSlot.map((e=>e.cloneNode(!0)))}handleChange(e,t,i){const o=e.detail.files[0];let s,r,a;if(o){const e=this.findFileByKey(t);e.file?(r="FILE_UPDATED",a=o,e.file=o):(r="FILE_ADDED",a=o,e.file=o,e.content=this.getAdditionalContent(),this.fileKeyCounter++,this.files.push({file:null,key:this.fileKeyCounter,content:null})),s=this.buildFilesArray(this.files.map((e=>e.file)),!1,this.findIndexByKey(t))}else{r="FILE_REMOVED",a=this.files[i].file,this.files.splice(i,1);const e=this.el.shadowRoot.querySelector("#statusMessage");e.textContent="",setTimeout((()=>{e.textContent="File removed."}),1e3),s=this.buildFilesArray(this.files.map((e=>e.file)),!0)}const n={action:r,file:a,state:s};this.vaMultipleChange.emit(n),this.files=Array.of(...this.files)}buildFilesArray(e,t,i){let o=e.filter((e=>!!e)).map((e=>({file:e,changed:!1})));return!t&&o[i]&&(o[i].changed=!0),o}componentDidRender(){const e=this.el.shadowRoot.querySelectorAll("va-file-input");return this.setSlotContent(),e.forEach(((e,t)=>{!this.files[t].content||this.slotFieldIndexes&&!this.slotFieldIndexes.includes(t)||this.files[t].content.forEach((t=>e.append(t)))})),this.value&&this.value.length&&!this.valueAdded?this.addValueFiles():Promise.resolve()}render(){const{label:e,required:t,headerSize:i,hint:o,files:s,name:r,accept:a,errors:n,enableAnalytics:l,readOnly:d}=this,m=this.isEmpty()?"":"outer-wrap",f=this.hasErrors()?"has-error":"";return h(Host,{key:"5aaf16734bca9c49e4bb012c2b8c629a945347ce",class:f},e&&!d&&this.renderLabelOrHeader(e,t,i),o&&!d&&h("div",{key:"c6c4e7674e56481843d291c0004cef49d14c36b2",class:"usa-hint",id:"input-hint-message"},o),h("div",{key:"b804c9ad5bb8266b8fed9869a48114b9a40e6d17",class:m},h("div",{key:"3ec253f775dbaef0791618a5e3187ff3fe08ae23",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),!this.isEmpty()&&h("div",{key:"a7c10de43698d42c94f84271e326e9bb35f80dcd",class:"selected-files-label"},d?"Files you uploaded":"Selected files"),s.map(((i,s)=>h("va-file-input",Object.assign({key:i.key,headless:!0,label:e,hint:o,name:`${r}-${i.key}`,accept:a,required:t},s>0?{uploadMessage:this.additionalFileUploadMessage}:{},{error:n[s],onVaChange:e=>this.handleChange(e,i.key,s),"enable-analytics":l,value:i.file,readOnly:d,class:i.file?"has-file":"no-file"}))))),h("slot",{key:"2f05ac1c0ba022c5629920e1227fa4aae6f7519b"}))}get el(){return this}static get style(){return VaFileInputMultipleStyle0}},[1,"va-file-input-multiple",{label:[1],name:[1],required:[4],accept:[1],errors:[16],hint:[1],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],value:[16],readOnly:[4,"read-only"],slotFieldIndexes:[16],files:[32],valueAdded:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-file-input-multiple","va-button","va-button-icon","va-card","va-file-input","va-icon","va-modal","va-progress-bar"].forEach((e=>{switch(e){case"va-file-input-multiple":customElements.get(e)||customElements.define(e,VaFileInputMultiple$1);break;case"va-button":customElements.get(e)||defineCustomElement$8();break;case"va-button-icon":customElements.get(e)||defineCustomElement$7();break;case"va-card":customElements.get(e)||defineCustomElement$6();break;case"va-file-input":customElements.get(e)||defineCustomElement$5();break;case"va-icon":customElements.get(e)||defineCustomElement$4();break;case"va-modal":customElements.get(e)||defineCustomElement$3();break;case"va-progress-bar":customElements.get(e)||defineCustomElement$2()}}))}const VaFileInputMultiple=VaFileInputMultiple$1,defineCustomElement=defineCustomElement$1;export{VaFileInputMultiple,defineCustomElement};
1
+ import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import"./i18n-setup.js";import"./contacts.js";import{d as defineCustomElement$8}from"./va-button2.js";import{d as defineCustomElement$7}from"./va-button-icon2.js";import{d as defineCustomElement$6}from"./va-card2.js";import{d as defineCustomElement$5}from"./va-file-input2.js";import{d as defineCustomElement$4}from"./va-icon2.js";import{d as defineCustomElement$3}from"./va-modal2.js";import{d as defineCustomElement$2}from"./va-progress-bar2.js";import{i as instance}from"./i18next.js";const vaFileInputMultipleCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}h1{margin-top:0}h1,h2,h3,h4,h5,h6{margin-bottom:0;margin-top:0;clear:both}*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:1.5em}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*{margin-top:1em}h1{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:2.44rem;line-height:1.2;font-weight:700}h2{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.95rem;line-height:1.2;font-weight:700}h3{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.34rem;line-height:1.2;font-weight:700}h4{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.98rem;line-height:1.2;font-weight:700}h5{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.91rem;line-height:1.2;font-weight:700}h6{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:0.87rem;line-height:1.1;font-weight:normal;letter-spacing:0.025em;text-transform:uppercase}h1,h2,h3,h4,h5{font-family:Bitter, Georgia, Cambria, "Times New Roman", Times, serif;font-weight:700}h6{font-family:"Source Sans Pro Web", "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}@import \'~@department-of-veterans-affairs/css-library/dist/stylesheets/base/headings.css\';:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}[hidden]{display:none}:host{display:block;font-family:var(--font-source-sans);font-size:16.96px;}:host .label-header{color:var(--vads-color-base);font-weight:var(--font-weight-normal)}:host .label-header-tag{margin:0;display:inline-block}:host .file-input-wrapper{display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host .file-input{cursor:pointer;height:100%;width:100%;max-width:none;top:0;left:0;z-index:1;margin:0;position:absolute;text-indent:-999em;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target{border:1px dashed var(--vads-color-action-border-base-active-on-dark);display:block;margin-top:0.3125rem;position:relative;text-align:center;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target.file-input-target-error{border:2px dashed var(--vads-color-secondary-dark)}:host .file-input-box{background:var(--vads-color-white);height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}:host .file-input-instructions{font-size:1.06rem;padding:1.25rem 0.625rem;pointer-events:none;position:relative;z-index:3}:host .file-input-choose-text{color:var(--vads-color-link);text-decoration:underline;font-weight:var(--font-weight-normal)}:host .file-icon{color:var(--vads-color-primary-alt-darkest)}:host .selected-files-wrapper{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light)}:host .selected-files-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;border-bottom:1px solid var(--vads-color-white);margin-bottom:8px;padding:8px}:host .va-card{margin:8px}:host .file-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;padding:0 8px;display:block;width:100%;word-wrap:break-word;word-break:break-word;overflow:hidden}:host #input-error-message{padding:0 8px;width:100%}:host .file-size-label,:host .file-status-label{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:1.06rem;padding:0 8px;display:block}:host .file-status-label{font-style:italic}:host .file-info-section{padding:0 8px 8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .file-button-section{margin-top:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row;flex-direction:row}:host .file-button-section>va-button-icon{font-size:1.06rem}@media screen and (max-width: 320px){:host .file-button-section{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}:host .separator{border:0;border-top:1px solid var(--vads-color-base-lighter);margin:0}:host .vads-u-line-height--2{line-height:1.15}:host .thumbnail-container{height:40px;width:40px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .thumbnail-preview{max-width:40px;width:auto;max-height:40px;height:auto}:host .thumbnail-error{color:#b21d38}:host va-progress-bar{font-size:var(--vads-font-size-root);display:block;margin-left:16px}:host .uploading-status{font-style:var(--font-style-italic)}:host(.has-error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host(.has-error){margin-left:-0.9rem}}.required{color:var(--vads-color-secondary-dark);margin-left:0.25rem}h1 .required,h2 .required,h3 .required,h4 .required,h5 .required,h6 .required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}:host.has-error{border-left:0.25rem solid #b50909;padding-left:1rem}:host .outer-wrap{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light);display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host va-file-input.no-file{margin:0 8px}:host va-file-input:not(:last-child){border-bottom:1px solid var(--vads-color-white)}:host va-file-input.has-error{border-left:none;padding-left:0}@media screen and (min-width: 1008px){:host va-file-input.has-error{margin-left:0}}',VaFileInputMultipleStyle0=vaFileInputMultipleCss,VaFileInputMultiple$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaMultipleChange=createEvent(this,"vaMultipleChange",7),this.fileKeyCounter=0,this.additionalSlot=null,this.additionalFileUploadMessage=h("span",null,"Drag an additional file here or"," ",h("span",{class:"file-input-choose-text"},"choose from folder")),this.renderLabelOrHeader=(e,t,i)=>{const o=t?h("span",{class:"required"}," ",instance.t("required")):null;return i&&i>=1&&i<=6?h("div",{class:"label-header"},h(`h${i}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,o)):h("div",{class:"label-header"},h("span",{part:"label",class:"usa-label"},e),o)},this.addValueFiles=async()=>(this.files.shift(),this.value.forEach((e=>{this.files.push({file:e,key:this.fileKeyCounter,content:this.getAdditionalContent()||null}),this.fileKeyCounter++})),this.readOnly||this.files.push({file:null,key:this.fileKeyCounter,content:null}),this.valueAdded=!0,Promise.resolve()),this.hasErrors=()=>this.errors.some((e=>!!e)),this.label=void 0,this.name=void 0,this.required=!1,this.accept=void 0,this.errors=[],this.hint=void 0,this.enableAnalytics=!1,this.headerSize=void 0,this.value=void 0,this.readOnly=!1,this.slotFieldIndexes=null,this.files=[{key:0,file:null,content:null}],this.valueAdded=!1}findFileByKey(e){return this.files.find((t=>t.key===e))}findIndexByKey(e){return this.files.indexOf(this.files.find((t=>t.key===e)))}isEmpty(){return null===this.files[0].file}setSlotContent(){const e=this.el.shadowRoot.querySelector("slot");this.additionalSlot||(this.additionalSlot=e?e.assignedElements({flatten:!0}):[]),null==e||e.remove()}getAdditionalContent(){return this.additionalSlot&&this.additionalSlot.map((e=>e.cloneNode(!0)))}handleChange(e,t,i){const o=e.detail.files[0];let s,r,a;if(o){const e=this.findFileByKey(t);e.file?(r="FILE_UPDATED",a=o,e.file=o):(r="FILE_ADDED",a=o,e.file=o,e.content=this.getAdditionalContent(),this.fileKeyCounter++,this.files.push({file:null,key:this.fileKeyCounter,content:null})),s=this.buildFilesArray(this.files.map((e=>e.file)),!1,this.findIndexByKey(t))}else{r="FILE_REMOVED",a=this.files[i].file,this.files.splice(i,1);const e=this.el.shadowRoot.querySelector("#statusMessage");e.textContent="",setTimeout((()=>{e.textContent="File removed."}),1e3),s=this.buildFilesArray(this.files.map((e=>e.file)),!0)}const n={action:r,file:a,state:s};this.vaMultipleChange.emit(n),this.files=Array.of(...this.files)}buildFilesArray(e,t,i){let o=e.filter((e=>!!e)).map((e=>({file:e,changed:!1})));return!t&&o[i]&&(o[i].changed=!0),o}componentDidRender(){const e=this.el.shadowRoot.querySelectorAll("va-file-input");return this.setSlotContent(),e.forEach(((e,t)=>{!this.files[t].content||this.slotFieldIndexes&&!this.slotFieldIndexes.includes(t)||this.files[t].content.forEach((t=>e.append(t)))})),this.value&&this.value.length&&!this.valueAdded?this.addValueFiles():Promise.resolve()}render(){const{label:e,required:t,headerSize:i,hint:o,files:s,name:r,accept:a,errors:n,enableAnalytics:l,readOnly:d}=this,m=this.isEmpty()?"":"outer-wrap",f=this.hasErrors()?"has-error":"";return h(Host,{key:"65619167a0c67b3b289390e2ed02d3890599dae5",class:f},e&&!d&&this.renderLabelOrHeader(e,t,i),o&&!d&&h("div",{key:"4a127051f0f019820335139e301481776ea6b422",class:"usa-hint",id:"input-hint-message"},o),h("div",{key:"267d345d2c3abd82e16f68ee2f3028149a8e9ed2",class:m},h("div",{key:"8e86555ea2764e08c336e2960bdd5dfb3c98fcff",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),!this.isEmpty()&&h("div",{key:"cecf7ed2e819cc08e13fca37016d18539408e67a",class:"selected-files-label"},d?"Files you uploaded":"Selected files"),s.map(((i,s)=>h("va-file-input",Object.assign({key:i.key,headless:!0,label:e,hint:o,name:`${r}-${i.key}`,accept:a,required:t},s>0?{uploadMessage:this.additionalFileUploadMessage}:{},{error:n[s],onVaChange:e=>this.handleChange(e,i.key,s),"enable-analytics":l,value:i.file,readOnly:d,class:i.file?"has-file":"no-file"}))))),h("slot",{key:"2e0fe579211e0680c48f0caa997c255dfddad94c"}))}get el(){return this}static get style(){return VaFileInputMultipleStyle0}},[1,"va-file-input-multiple",{label:[1],name:[1],required:[4],accept:[1],errors:[16],hint:[1],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],value:[16],readOnly:[4,"read-only"],slotFieldIndexes:[16],files:[32],valueAdded:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-file-input-multiple","va-button","va-button-icon","va-card","va-file-input","va-icon","va-modal","va-progress-bar"].forEach((e=>{switch(e){case"va-file-input-multiple":customElements.get(e)||customElements.define(e,VaFileInputMultiple$1);break;case"va-button":customElements.get(e)||defineCustomElement$8();break;case"va-button-icon":customElements.get(e)||defineCustomElement$7();break;case"va-card":customElements.get(e)||defineCustomElement$6();break;case"va-file-input":customElements.get(e)||defineCustomElement$5();break;case"va-icon":customElements.get(e)||defineCustomElement$4();break;case"va-modal":customElements.get(e)||defineCustomElement$3();break;case"va-progress-bar":customElements.get(e)||defineCustomElement$2()}}))}const VaFileInputMultiple=VaFileInputMultiple$1,defineCustomElement=defineCustomElement$1;export{VaFileInputMultiple,defineCustomElement};
@@ -1 +1 @@
1
- import{proxyCustomElement,HTMLElement,createEvent,h,forceUpdate,Host,Fragment}from"@stencil/core/internal/client";import"./i18n-setup.js";import"./contacts.js";import{s as selectOrMatches,S as Sanitizer}from"./utils.js";import{d as defineCustomElement$6}from"./va-button2.js";import{d as defineCustomElement$5}from"./va-button-icon2.js";import{d as defineCustomElement$4}from"./va-card2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-modal2.js";import{d as defineCustomElement$1}from"./va-progress-bar2.js";import{i as instance}from"./i18next.js";const PREFIX="usa",DROPZONE_CLASS="usa-file-input",DROPZONE=`.${DROPZONE_CLASS}`,INPUT_CLASS="usa-file-input__input",TARGET_CLASS="usa-file-input__target",INPUT=`.${INPUT_CLASS}`,BOX_CLASS="usa-file-input__box",INSTRUCTIONS_CLASS="usa-file-input__instructions",PREVIEW_CLASS="usa-file-input__preview",PREVIEW_HEADING_CLASS="usa-file-input__preview-heading",DISABLED_CLASS="usa-file-input--disabled",CHOOSE_CLASS="usa-file-input__choose",ACCEPTED_FILE_MESSAGE_CLASS="usa-file-input__accepted-files-message",DRAG_TEXT_CLASS="usa-file-input__drag-text",DRAG_CLASS="usa-file-input--drag",LOADING_CLASS="is-loading",INVALID_FILE_CLASS="has-invalid-file",GENERIC_PREVIEW_CLASS_NAME="usa-file-input__preview-image",GENERIC_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--generic`,PDF_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--pdf`,WORD_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--word`,VIDEO_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--video`,EXCEL_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--excel`,SR_ONLY_CLASS="usa-sr-only",SPACER_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let TYPE_IS_VALID=Boolean(!0),DEFAULT_ARIA_LABEL_TEXT="",DEFAULT_FILE_STATUS_TEXT="";const getFileInputContext=e=>{const t=e.closest(DROPZONE);if(!t)throw new Error(`Element is missing outer ${DROPZONE}`);const i=t.querySelector(INPUT);return{dropZoneEl:t,inputEl:i}},disable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!0,t.classList.add(DISABLED_CLASS)},ariaDisable=e=>{const{dropZoneEl:t}=getFileInputContext(e);t.classList.add(DISABLED_CLASS)},enable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!1,t.classList.remove(DISABLED_CLASS),t.removeAttribute("aria-disabled")},replaceName=e=>{const t=e.charCodeAt(0);return 32===t?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__000${t.toString(16).slice(-4)}`},makeSafeForID=e=>e.replace(/[^a-z0-9]/g,replaceName),createUniqueID=e=>`${e}-${Math.floor(Date.now()/1e3)}`,getItemsLabel=e=>e.hasAttribute("multiple")?"files":"file",createTargetArea=e=>{const t=document.createElement("div"),i=document.createElement("div"),a=document.createElement("div");return e.classList.remove(DROPZONE_CLASS),e.classList.add(INPUT_CLASS),t.classList.add(DROPZONE_CLASS),a.classList.add(BOX_CLASS),i.classList.add(TARGET_CLASS),i.prepend(a),e.parentNode.insertBefore(i,e),e.parentNode.insertBefore(t,i),i.appendChild(e),t.appendChild(i),i},createVisibleInstructions=e=>{const t=e.closest(DROPZONE),i=getItemsLabel(e),a=document.createElement("div"),s=`Drag ${i} here or`,o="choose from folder";return DEFAULT_ARIA_LABEL_TEXT=`${s} ${o}`,a.classList.add(INSTRUCTIONS_CLASS),a.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT),a.innerHTML=Sanitizer.escapeHTML(`<span class="${DRAG_TEXT_CLASS}">${s}</span> <span class="${CHOOSE_CLASS}">${o}</span>`),e.parentNode.insertBefore(a,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${DRAG_TEXT_CLASS}`).outerHTML=""),a},createSROnlyStatus=e=>{const t=document.createElement("div"),i=getItemsLabel(e),a=e.closest(DROPZONE),s=e.closest(`.${TARGET_CLASS}`);DEFAULT_FILE_STATUS_TEXT=`No ${i} selected.`,t.classList.add("usa-sr-only"),t.setAttribute("aria-live","polite"),t.textContent=DEFAULT_FILE_STATUS_TEXT,a.insertBefore(t,s)},enhanceFileInput=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),i=createTargetArea(e),a=createVisibleInstructions(e),{dropZoneEl:s}=getFileInputContext(e);return t?s.classList.add(DISABLED_CLASS):createSROnlyStatus(e),{instructions:a,dropTarget:i}},removeOldPreviews=(e,t)=>{const i=e.querySelectorAll(`.${PREVIEW_CLASS}`),a=e.querySelector(`.${PREVIEW_HEADING_CLASS}`),s=e.querySelector(`.${ACCEPTED_FILE_MESSAGE_CLASS}`);a&&(a.outerHTML=""),s&&(s.outerHTML="",e.classList.remove("has-invalid-file")),null!==i&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(i,(e=>{e.parentNode.removeChild(e)})))},updateStatusMessage=(e,t,i)=>{const a=e;let s=DEFAULT_FILE_STATUS_TEXT;1===t.length?s=`You have selected the file: ${i}`:t.length>1&&(s=`You have selected ${t.length} files: ${i.join(", ")}`),setTimeout((()=>{a.textContent=s}),1e3)},addPreviewHeading=(e,t)=>{const i=document.createElement("div"),a=e.closest(`.${TARGET_CLASS}`),s=a.querySelector(`.${INSTRUCTIONS_CLASS}`);let o="Change file",n="";1===t.length?n=Sanitizer.escapeHTML(`Selected file <span class="usa-file-input__choose">${o}</span>`):t.length>1&&(o="Change files",n=Sanitizer.escapeHTML(`${t.length} files selected <span class="usa-file-input__choose">${o}</span>`)),s.setAttribute("hidden","true"),i.classList.add(PREVIEW_HEADING_CLASS),i.innerHTML=n,a.insertBefore(i,s),e.setAttribute("aria-label",o)},handleChange=(e,t,i,a)=>{const s=t.getAttribute("multiple")?e.target.files:[e.target.files[0]],o=a.closest(`.${DROPZONE_CLASS}`).querySelector(".usa-sr-only"),n=[];removeOldPreviews(a,i);for(let e=0;e<s.length;e+=1){const t=new FileReader,o=s[e].name;let r;n.push(o),t.onloadstart=function(){r=createUniqueID(makeSafeForID(o)),i.insertAdjacentHTML("afterend",Sanitizer.escapeHTML(`<div class="${PREVIEW_CLASS}" aria-hidden="true">\n <img id="${r}" src="${SPACER_GIF}" alt="" class="${GENERIC_PREVIEW_CLASS_NAME} is-loading"/>${o}\n <div>`))},t.onloadend=function(){const e=a.querySelector(`#${r}`);o.indexOf(".pdf")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${PDF_PREVIEW_CLASS}")`):o.indexOf(".doc")>0||o.indexOf(".pages")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${WORD_PREVIEW_CLASS}")`):o.indexOf(".xls")>0||o.indexOf(".numbers")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${EXCEL_PREVIEW_CLASS}")`):o.indexOf(".mov")>0||o.indexOf(".mp4")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${VIDEO_PREVIEW_CLASS}")`):e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${GENERIC_PREVIEW_CLASS}")`),e.classList.remove("is-loading"),e.src=t.result},s[e]&&t.readAsDataURL(s[e])}0===s.length?t.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT):addPreviewHeading(t,s),updateStatusMessage(o,s,n)},preventInvalidFiles=(e,t,i,a)=>{const s=t.getAttribute("accept");a.classList.remove("has-invalid-file");const o=(e,t)=>{let i=!1;return e.indexOf(t)>=0&&(i=!0),i};if(s){const n=s.split(","),r=document.createElement("div");let l=!0;const d=e.target.files||e.dataTransfer.files;for(let e=0;e<d.length;e+=1){const t=d[e];if(!l)break;for(let e=0;e<n.length;e+=1){const i=n[e];if(l=t.name.indexOf(i)>0||o(t.type,i.replace(/\*/g,"")),l){TYPE_IS_VALID=!0;break}}}l||(removeOldPreviews(a,i),t.value="",a.insertBefore(r,t),r.textContent=t.dataset.errormessage||"This is not a valid file type.",r.classList.add(ACCEPTED_FILE_MESSAGE_CLASS),a.classList.add("has-invalid-file"),TYPE_IS_VALID=!1,e.preventDefault(),e.stopPropagation())}},handleUpload=(e,t,i,a)=>{preventInvalidFiles(e,t,i,a),!0===TYPE_IS_VALID&&handleChange(e,t,i,a)},fileInput={init(e){selectOrMatches(DROPZONE,e).forEach((e=>{const{instructions:t,dropTarget:i}=enhanceFileInput(e);i.addEventListener("dragover",(function(){this.classList.add(DRAG_CLASS)}),!1),i.addEventListener("dragleave",(function(){this.classList.remove(DRAG_CLASS)}),!1),i.addEventListener("drop",(function(a){a.preventDefault(),this.classList.remove(DRAG_CLASS);const s=a.dataTransfer;if(a.target.files=s.files,s.files.length>1)return;handleUpload(a,e,t,i);const o=new CustomEvent("change",{detail:{files:s.files}});e.dispatchEvent(o)}),!1),e.addEventListener("input",(a=>handleUpload(a,e,t,i)),!1)}))},teardown(e){selectOrMatches(INPUT,e).forEach((e=>{const t=e.parentElement.parentElement;t.parentElement.replaceChild(e,t),e.className=DROPZONE_CLASS}))},getFileInputContext:getFileInputContext,disable:disable,ariaDisable:ariaDisable,enable:enable},extensionToMimeType={".txt":"text/plain",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".odt":"application/vnd.oasis.opendocument.text",".rtf":"application/rtf",".csv":"text/csv",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".bmp":"image/bmp",".webp":"image/webp",".tif":"image/tiff",".tiff":"image/tiff",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".mkv":"video/x-matroska",".webm":"video/webm",".zip":"application/zip",".rar":"application/x-rar-compressed",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript"},vaFileInputCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}h1{margin-top:0}h1,h2,h3,h4,h5,h6{margin-bottom:0;margin-top:0;clear:both}*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:1.5em}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*{margin-top:1em}h1{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:2.44rem;line-height:1.2;font-weight:700}h2{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.95rem;line-height:1.2;font-weight:700}h3{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.34rem;line-height:1.2;font-weight:700}h4{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.98rem;line-height:1.2;font-weight:700}h5{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.91rem;line-height:1.2;font-weight:700}h6{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:0.87rem;line-height:1.1;font-weight:normal;letter-spacing:0.025em;text-transform:uppercase}h1,h2,h3,h4,h5{font-family:Bitter, Georgia, Cambria, "Times New Roman", Times, serif;font-weight:700}h6{font-family:"Source Sans Pro Web", "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}[hidden]{display:none}:host{display:block;font-family:var(--font-source-sans);font-size:16.96px;}:host .label-header{color:var(--vads-color-base);font-weight:var(--font-weight-normal)}:host .label-header-tag{margin:0;display:inline-block}:host .file-input-wrapper{display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host .file-input{cursor:pointer;height:100%;width:100%;max-width:none;top:0;left:0;z-index:1;margin:0;position:absolute;text-indent:-999em;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target{border:1px dashed var(--vads-color-action-border-base-active-on-dark);display:block;margin-top:0.3125rem;position:relative;text-align:center;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target.file-input-target-error{border:2px dashed var(--vads-color-secondary-dark)}:host .file-input-box{background:var(--vads-color-white);height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}:host .file-input-instructions{font-size:1.06rem;padding:1.25rem 0.625rem;pointer-events:none;position:relative;z-index:3}:host .file-input-choose-text{color:var(--vads-color-link);text-decoration:underline;font-weight:var(--font-weight-normal)}:host .file-icon{color:var(--vads-color-primary-alt-darkest)}:host .selected-files-wrapper{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light)}:host .selected-files-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;border-bottom:1px solid var(--vads-color-white);margin-bottom:8px;padding:8px}:host .va-card{margin:8px}:host .file-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;padding:0 8px;display:block;width:100%;word-wrap:break-word;word-break:break-word;overflow:hidden}:host #input-error-message{padding:0 8px;width:100%}:host .file-size-label,:host .file-status-label{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:1.06rem;padding:0 8px;display:block}:host .file-status-label{font-style:italic}:host .file-info-section{padding:0 8px 8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .file-button-section{margin-top:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row;flex-direction:row}:host .file-button-section>va-button-icon{font-size:1.06rem}@media screen and (max-width: 320px){:host .file-button-section{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}:host .separator{border:0;border-top:1px solid var(--vads-color-base-lighter);margin:0}:host .vads-u-line-height--2{line-height:1.15}:host .thumbnail-container{height:40px;width:40px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .thumbnail-preview{max-width:40px;width:auto;max-height:40px;height:auto}:host .thumbnail-error{color:#b21d38}:host va-progress-bar{font-size:var(--vads-font-size-root);display:block;margin-left:16px}:host .uploading-status{font-style:var(--font-style-italic)}:host(.has-error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host(.has-error){margin-left:-0.9rem}}.required{color:var(--vads-color-secondary-dark);margin-left:0.25rem}h1 .required,h2 .required,h3 .required,h4 .required,h5 .required,h6 .required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}',VaFileInputStyle0=vaFileInputCss,VaFileInput=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaChange=createEvent(this,"vaChange",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.uploadStatus="idle",this.handleChange=e=>{const t=e.target;t.files&&t.files.length>0&&this.handleFile(t.files[0]),t.value=""},this.handleDrop=e=>{e.preventDefault(),e.stopPropagation();const t=e.dataTransfer.files;t.length>0&&this.handleFile(t[0])},this.handleFile=(e,t=!0)=>{if(this.accept){const t=this.normalizeAcceptProp(this.accept);if(!this.isAcceptedFileType(e.type,t))return this.removeFile(!1),void(this.internalError="This is not a valid file type.")}if(e.size>this.maxFileSize)return this.internalError=`\n We can't upload your file because it's too big. Files must be less than ${this.formatFileSize(this.maxFileSize)}.`,this.fileContents=null,void(this.uploadStatus="idle");this.uploadedFile=null,this.file=e,t&&this.vaChange.emit({files:[this.file]}),this.uploadStatus="success",this.internalError=null,this.generateFileContents(this.file),this.updateStatusMessage(`You have selected the file: ${this.file.name}`),this.el.focus(),this.enableAnalytics&&this.componentLibraryAnalytics.emit({componentName:"va-file-input",action:"change",details:{label:this.label}})},this.removeFile=(e=!0)=>{this.closeModal(),this.uploadStatus="idle",this.internalError=null,e&&this.vaChange.emit({files:[]}),this.file=null,this.uploadedFile=null,this.updateStatusMessage("File removed. No file selected."),this.el.focus()},this.openModal=()=>{this.el.shadowRoot.querySelector("va-modal").setAttribute("status","warning"),this.showModal=!0},this.closeModal=()=>{this.showModal=!1,setTimeout((()=>{this.fileInputRef.focus()}),0)},this.changeFile=()=>{this.fileInputRef&&this.fileInputRef.click()},this.formatFileSize=e=>{const t=["B","KB","MB","GB","TB"];if(0===e)return"0 B";const i=Math.floor(Math.log(e)/Math.log(1024));return 0===i?`${e} ${t[i]}`:`${(e/Math.pow(1024,i)).toFixed(i<2?0:1)} ${t[i]}`},this.normalizeAcceptProp=e=>e.split(",").map((e=>(e=e.trim()).startsWith(".")?extensionToMimeType[e]:e)),this.isAcceptedFileType=(e,t)=>{for(const i of t){if(i===e)return!0;if(i.endsWith("/*")&&e.startsWith(i.slice(0,-1)))return!0}return!1},this.renderLabelOrHeader=(e,t,i)=>{const a=t?h("span",{class:"required"}," ",instance.t("required")):null;return h("div",{class:"label-header"},i&&i>=1&&i<=6?h(`h${i}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,a):h("label",{htmlFor:"fileInputField",part:"label",class:"usa-label"},e,a))},this.file=void 0,this.fileContents=void 0,this.internalError=void 0,this.showModal=!1,this.showSeparator=!0,this.label=void 0,this.name=void 0,this.buttonText=void 0,this.value=void 0,this.required=!1,this.accept=void 0,this.error=void 0,this.hint=void 0,this.statusText=void 0,this.uploadMessage=null,this.enableAnalytics=!1,this.headerSize=void 0,this.headless=!1,this.readOnly=!1,this.uploadedFile=void 0,this.maxFileSize=1/0,this.percentUploaded=null}handleValueChange(e){setTimeout((()=>{this.updateStatusMessage(e)}))}percentHandler(e){e>=100&&this.resetState()}resetState(){this.fileContents=null,this.uploadStatus="idle",this.percentUploaded=null,forceUpdate(this.el)}updateStatusMessage(e){setTimeout((()=>{const t=this.el.shadowRoot.querySelector("#statusMessage");t&&(t.textContent=e)}),1e3)}generateFileContents(e){if(!e)return;const t=new FileReader;this.fileType=e.type,t.onloadend=()=>{this.fileContents=t.result},this.fileType&&("application/pdf"===this.fileType||this.fileType.startsWith("image/"))&&t.readAsDataURL(e)}componentWillRender(){const e=!!this.el.querySelector(":scope > *"),t=!(!this.value&&!this.file||this.readOnly);this.showSeparator=e||t}componentDidLoad(){fileInput.init(this.el)}connectedCallback(){this.el.addEventListener("change",this.handleChange)}disconnectedCallback(){this.el.removeEventListener("change",this.handleChange)}getDefaultUploadMessage(){return h("span",null,"Drag a file here or"," ",h("span",{class:"file-input-choose-text"},"choose from folder"))}render(){const{label:e,name:t,required:i,accept:a,error:s,hint:o,file:n,uploadStatus:r,uploadMessage:l,headerSize:d,fileContents:c,fileType:f,headless:p,value:u,readOnly:m,statusText:b,uploadedFile:g,percentUploaded:v}=this;u&&!this.file&&this.handleFile(u,!1);const S=this.error||this.internalError,E=`${o?"input-hint-message":""} ${S?"input-error-message":""}`.trim()||null,A=("file-input-target "+(S?"file-input-target-error":"")).trim();let _=h("div",{key:"9f8e203689fa7f65274910db83f9112c9cef19c9",class:"thumbnail-container"},h("svg",{key:"eb2928461ad5bd4f31d53743402136f827de9617",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"#07648d",width:"40px",height:"40px"},h("path",{key:"41df5984f061868da2f9d4a6665a440636f0ffbd",d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"})));s?_=h("div",{key:"381162923cb4530bd297371816ccfc39a318f43f",class:"thumbnail-container"},h("va-icon",{key:"3a3da39e02945a0a0880e06ba33ea66ee2e4b22b",icon:"error",size:3,class:"thumbnail-preview thumbnail-error"})):c&&(f.startsWith("image/")?_=h("div",{key:"d1bfc7717fc9088b2db1b20aa14985eb42c4fb5e",class:"thumbnail-container","aria-hidden":"true"},h("img",{key:"7ffe772b516bc71e325d57df21bd96ff38c991a2",class:"thumbnail-preview",src:c,alt:"image"})):"application/pdf"===f&&(_=h("div",{key:"b4cb552b8f013e694098b9d6b0f12916657562d9",class:"thumbnail-container","aria-hidden":"true"},h("object",{key:"aeaa42b5ac428f677864206f7ee6e0d9614e8f5b",class:"thumbnail-preview",data:c,type:"application/pdf"}))));let C=p?"headless-selected-files-wrapper":"selected-files-wrapper";const x="usa-hint"+(p?" usa-sr-only":""),y=null!==v&&v<100;let L="file-status-label";return y&&(L=`${L} uploading-status`),h(Host,{key:"6c9b48b477fded6ed4354d6cda17a9229a7acf13",class:{"has-error":!!S}},!m&&h("span",{key:"c9d49d56d016277e124612b73d5545c0b81d7dcc",class:{"usa-sr-only":!!p}},e&&this.renderLabelOrHeader(e,i,d)),o&&!m&&h("div",{key:"377b5fbd3bdfb3690a4ca62321e0fc4d0b3ba9ce",class:x,id:"input-hint-message"},o),h("div",{key:"e96b7756754bf33b2e7b70bf2f604a0503af45ca",class:"file-input-wrapper",onDrop:this.handleDrop},h("input",{key:"a959904f8a3963d11bd9467ede7c05350ee521e1",id:"fileInputField",class:"file-input",style:{visibility:"success"===this.uploadStatus||g?"hidden":"unset"},type:"file",ref:e=>this.fileInputRef=e,name:t,accept:a,"aria-describedby":E,onChange:this.handleChange}),"idle"===r&&!g&&h("div",{key:"0fdf14f29b2b96d73b32f518b6b44425280a11bf"},h("span",{key:"da6b8276f2e20bce2d8a2a782db6a955eaca9a41",id:"file-input-error-alert",role:"alert"},S&&h(Fragment,{key:"be5b28b5bbdce252918190b1e144d7643832acda"},h("span",{key:"71940d34379ef6fc82f090a83c04a7a8a51f4b18",class:"usa-sr-only"},instance.t("error")),h("span",{key:"21716b6500017aa5eb70cad474df7517c6dcbfd1",class:"usa-error-message"},S))),h("div",{key:"5053f27dec8c14d782aad5563423fad9748d6223",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("div",{key:"45b912aaddfb6252c1def9307f2bb75f68238837",class:A},h("div",{key:"ea6161c7e84ac98addeaf190e8985b146ee2be89",class:"file-input-box"}),h("div",{key:"7ba29054f1e665e823abc5c2505f3dd6572f61ee",class:"file-input-instructions"},l||this.getDefaultUploadMessage()))),("idle"!==r||g)&&h("div",{key:"c2dc6962183a87cd8480f50619c9401e8bc146b9",class:C},!p&&h("div",{key:"70aedc0fc485a9755a9df59011b9edff09012d00",class:"selected-files-label"},m?"Files you uploaded":"Selected files"),h("div",{key:"2ca9e11dabf4ce8e38202ac3d2af413a43500eab",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("va-card",{key:"43be7636f45de6c82c58d7c2e90ed608adefd48c",class:"va-card"},h("div",{key:"d029783a2cabaed5a4b0623af860bcd97e8f1581",class:"file-info-section"},_,h("div",{key:"9a59e620e4abe4239ca5206b3824f10b9c3b57bc",class:"file-info-group vads-u-line-height--2"},h("span",{key:"fab0ec83c61ee5990ed807b753ed8c8c644813d1",class:"file-label"},n?n.name:g.name),S&&h("span",{key:"88b64ef06647bc2d76f589f42676d93c4056f429",id:"input-error-message",role:"alert"},h("span",{key:"2fecacff9dd9cffc0a47cde2b4fb86534529ec84",class:"usa-sr-only"},instance.t("error")),h("span",{key:"5dc5a761ee24f6b6a9c35bae9d3b8065cc8ad5d9","aria-live":"polite",class:"usa-error-message"},S)),!y&&h("span",{key:"2e40a6745ed843f6bf14094a22023f16529bae07",class:"file-size-label"},this.formatFileSize(n?n.size:g.size)),h("span",{key:"bd8990d4b0a416aa05ba23ed191d4aec38496e54",class:L,"aria-live":"polite"},y?"Uploading...":b))),(n||u||g)&&h("div",{key:"6e1b33f562b177edb347cec51b6c702a1147f0e7"},this.showSeparator&&h("hr",{key:"8c69afe1585d3b370d362b7c96e5ad2ee2b06a09",class:"separator"}),h("div",{key:"645ea76fa95616b4c67a5810cb1b39f7fa2ca0e2",class:"additional-info-slot"},h("slot",{key:"47e3afff538273690a94ccc22b298c93a45ff7cc"})),m?null:y?h(Fragment,null,h("va-progress-bar",{percent:v}),h("va-button-icon",{buttonType:"cancel",onClick:this.resetState.bind(this)})):h(Fragment,null,h("div",{class:"file-button-section"},h("va-button-icon",{buttonType:"change-file",onClick:this.changeFile,label:"Change file","aria-label":`change file ${n?n.name:g.name}`}),h("va-button-icon",{buttonType:"delete",onClick:this.openModal,"aria-label":`delete file ${n?n.name:g.name}`,label:"Delete"})),h("va-modal",{modalTitle:"Delete this file?",visible:this.showModal,primaryButtonText:"Yes, remove this",secondaryButtonText:"No, keep this",onCloseEvent:this.closeModal,onPrimaryButtonClick:()=>this.removeFile(!0),onSecondaryButtonClick:this.closeModal},"We'll remove the uploaded document"," ",h("span",{class:"file-label"},n?n.name:g.name))))))))}get el(){return this}static get watchers(){return{statusText:["handleValueChange"],percentUploaded:["percentHandler"]}}static get style(){return VaFileInputStyle0}},[1,"va-file-input",{label:[1],name:[1],buttonText:[1,"button-text"],value:[16],required:[4],accept:[1],error:[1],hint:[1],statusText:[1,"status-text"],uploadMessage:[16],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],headless:[4],readOnly:[4,"read-only"],uploadedFile:[16],maxFileSize:[2,"max-file-size"],percentUploaded:[1026,"percent-uploaded"],file:[32],fileContents:[32],internalError:[32],showModal:[32],showSeparator:[32]},void 0,{statusText:["handleValueChange"],percentUploaded:["percentHandler"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-file-input","va-button","va-button-icon","va-card","va-icon","va-modal","va-progress-bar"].forEach((e=>{switch(e){case"va-file-input":customElements.get(e)||customElements.define(e,VaFileInput);break;case"va-button":customElements.get(e)||defineCustomElement$6();break;case"va-button-icon":customElements.get(e)||defineCustomElement$5();break;case"va-card":customElements.get(e)||defineCustomElement$4();break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-modal":customElements.get(e)||defineCustomElement$2();break;case"va-progress-bar":customElements.get(e)||defineCustomElement$1()}}))}export{VaFileInput as V,defineCustomElement as d};
1
+ import{proxyCustomElement,HTMLElement,createEvent,h,forceUpdate,Host,Fragment}from"@stencil/core/internal/client";import"./i18n-setup.js";import"./contacts.js";import{s as selectOrMatches,S as Sanitizer}from"./utils.js";import{d as defineCustomElement$6}from"./va-button2.js";import{d as defineCustomElement$5}from"./va-button-icon2.js";import{d as defineCustomElement$4}from"./va-card2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-modal2.js";import{d as defineCustomElement$1}from"./va-progress-bar2.js";import{i as instance}from"./i18next.js";const PREFIX="usa",DROPZONE_CLASS="usa-file-input",DROPZONE=`.${DROPZONE_CLASS}`,INPUT_CLASS="usa-file-input__input",TARGET_CLASS="usa-file-input__target",INPUT=`.${INPUT_CLASS}`,BOX_CLASS="usa-file-input__box",INSTRUCTIONS_CLASS="usa-file-input__instructions",PREVIEW_CLASS="usa-file-input__preview",PREVIEW_HEADING_CLASS="usa-file-input__preview-heading",DISABLED_CLASS="usa-file-input--disabled",CHOOSE_CLASS="usa-file-input__choose",ACCEPTED_FILE_MESSAGE_CLASS="usa-file-input__accepted-files-message",DRAG_TEXT_CLASS="usa-file-input__drag-text",DRAG_CLASS="usa-file-input--drag",LOADING_CLASS="is-loading",INVALID_FILE_CLASS="has-invalid-file",GENERIC_PREVIEW_CLASS_NAME="usa-file-input__preview-image",GENERIC_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--generic`,PDF_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--pdf`,WORD_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--word`,VIDEO_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--video`,EXCEL_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--excel`,SR_ONLY_CLASS="usa-sr-only",SPACER_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let TYPE_IS_VALID=Boolean(!0),DEFAULT_ARIA_LABEL_TEXT="",DEFAULT_FILE_STATUS_TEXT="";const getFileInputContext=e=>{const t=e.closest(DROPZONE);if(!t)throw new Error(`Element is missing outer ${DROPZONE}`);const i=t.querySelector(INPUT);return{dropZoneEl:t,inputEl:i}},disable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!0,t.classList.add(DISABLED_CLASS)},ariaDisable=e=>{const{dropZoneEl:t}=getFileInputContext(e);t.classList.add(DISABLED_CLASS)},enable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!1,t.classList.remove(DISABLED_CLASS),t.removeAttribute("aria-disabled")},replaceName=e=>{const t=e.charCodeAt(0);return 32===t?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__000${t.toString(16).slice(-4)}`},makeSafeForID=e=>e.replace(/[^a-z0-9]/g,replaceName),createUniqueID=e=>`${e}-${Math.floor(Date.now()/1e3)}`,getItemsLabel=e=>e.hasAttribute("multiple")?"files":"file",createTargetArea=e=>{const t=document.createElement("div"),i=document.createElement("div"),a=document.createElement("div");return e.classList.remove(DROPZONE_CLASS),e.classList.add(INPUT_CLASS),t.classList.add(DROPZONE_CLASS),a.classList.add(BOX_CLASS),i.classList.add(TARGET_CLASS),i.prepend(a),e.parentNode.insertBefore(i,e),e.parentNode.insertBefore(t,i),i.appendChild(e),t.appendChild(i),i},createVisibleInstructions=e=>{const t=e.closest(DROPZONE),i=getItemsLabel(e),a=document.createElement("div"),s=`Drag ${i} here or`,o="choose from folder";return DEFAULT_ARIA_LABEL_TEXT=`${s} ${o}`,a.classList.add(INSTRUCTIONS_CLASS),a.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT),a.innerHTML=Sanitizer.escapeHTML(`<span class="${DRAG_TEXT_CLASS}">${s}</span> <span class="${CHOOSE_CLASS}">${o}</span>`),e.parentNode.insertBefore(a,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${DRAG_TEXT_CLASS}`).outerHTML=""),a},createSROnlyStatus=e=>{const t=document.createElement("div"),i=getItemsLabel(e),a=e.closest(DROPZONE),s=e.closest(`.${TARGET_CLASS}`);DEFAULT_FILE_STATUS_TEXT=`No ${i} selected.`,t.classList.add("usa-sr-only"),t.setAttribute("aria-live","polite"),t.textContent=DEFAULT_FILE_STATUS_TEXT,a.insertBefore(t,s)},enhanceFileInput=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),i=createTargetArea(e),a=createVisibleInstructions(e),{dropZoneEl:s}=getFileInputContext(e);return t?s.classList.add(DISABLED_CLASS):createSROnlyStatus(e),{instructions:a,dropTarget:i}},removeOldPreviews=(e,t)=>{const i=e.querySelectorAll(`.${PREVIEW_CLASS}`),a=e.querySelector(`.${PREVIEW_HEADING_CLASS}`),s=e.querySelector(`.${ACCEPTED_FILE_MESSAGE_CLASS}`);a&&(a.outerHTML=""),s&&(s.outerHTML="",e.classList.remove("has-invalid-file")),null!==i&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(i,(e=>{e.parentNode.removeChild(e)})))},updateStatusMessage=(e,t,i)=>{const a=e;let s=DEFAULT_FILE_STATUS_TEXT;1===t.length?s=`You have selected the file: ${i}`:t.length>1&&(s=`You have selected ${t.length} files: ${i.join(", ")}`),setTimeout((()=>{a.textContent=s}),1e3)},addPreviewHeading=(e,t)=>{const i=document.createElement("div"),a=e.closest(`.${TARGET_CLASS}`),s=a.querySelector(`.${INSTRUCTIONS_CLASS}`);let o="Change file",n="";1===t.length?n=Sanitizer.escapeHTML(`Selected file <span class="usa-file-input__choose">${o}</span>`):t.length>1&&(o="Change files",n=Sanitizer.escapeHTML(`${t.length} files selected <span class="usa-file-input__choose">${o}</span>`)),s.setAttribute("hidden","true"),i.classList.add(PREVIEW_HEADING_CLASS),i.innerHTML=n,a.insertBefore(i,s),e.setAttribute("aria-label",o)},handleChange=(e,t,i,a)=>{const s=t.getAttribute("multiple")?e.target.files:[e.target.files[0]],o=a.closest(`.${DROPZONE_CLASS}`).querySelector(".usa-sr-only"),n=[];removeOldPreviews(a,i);for(let e=0;e<s.length;e+=1){const t=new FileReader,o=s[e].name;let r;n.push(o),t.onloadstart=function(){r=createUniqueID(makeSafeForID(o)),i.insertAdjacentHTML("afterend",Sanitizer.escapeHTML(`<div class="${PREVIEW_CLASS}" aria-hidden="true">\n <img id="${r}" src="${SPACER_GIF}" alt="" class="${GENERIC_PREVIEW_CLASS_NAME} is-loading"/>${o}\n <div>`))},t.onloadend=function(){const e=a.querySelector(`#${r}`);o.indexOf(".pdf")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${PDF_PREVIEW_CLASS}")`):o.indexOf(".doc")>0||o.indexOf(".pages")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${WORD_PREVIEW_CLASS}")`):o.indexOf(".xls")>0||o.indexOf(".numbers")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${EXCEL_PREVIEW_CLASS}")`):o.indexOf(".mov")>0||o.indexOf(".mp4")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${VIDEO_PREVIEW_CLASS}")`):e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${GENERIC_PREVIEW_CLASS}")`),e.classList.remove("is-loading"),e.src=t.result},s[e]&&t.readAsDataURL(s[e])}0===s.length?t.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT):addPreviewHeading(t,s),updateStatusMessage(o,s,n)},preventInvalidFiles=(e,t,i,a)=>{const s=t.getAttribute("accept");a.classList.remove("has-invalid-file");const o=(e,t)=>{let i=!1;return e.indexOf(t)>=0&&(i=!0),i};if(s){const n=s.split(","),r=document.createElement("div");let l=!0;const d=e.target.files||e.dataTransfer.files;for(let e=0;e<d.length;e+=1){const t=d[e];if(!l)break;for(let e=0;e<n.length;e+=1){const i=n[e];if(l=t.name.indexOf(i)>0||o(t.type,i.replace(/\*/g,"")),l){TYPE_IS_VALID=!0;break}}}l||(removeOldPreviews(a,i),t.value="",a.insertBefore(r,t),r.textContent=t.dataset.errormessage||"This is not a valid file type.",r.classList.add(ACCEPTED_FILE_MESSAGE_CLASS),a.classList.add("has-invalid-file"),TYPE_IS_VALID=!1,e.preventDefault(),e.stopPropagation())}},handleUpload=(e,t,i,a)=>{preventInvalidFiles(e,t,i,a),!0===TYPE_IS_VALID&&handleChange(e,t,i,a)},fileInput={init(e){selectOrMatches(DROPZONE,e).forEach((e=>{const{instructions:t,dropTarget:i}=enhanceFileInput(e);i.addEventListener("dragover",(function(){this.classList.add(DRAG_CLASS)}),!1),i.addEventListener("dragleave",(function(){this.classList.remove(DRAG_CLASS)}),!1),i.addEventListener("drop",(function(a){a.preventDefault(),this.classList.remove(DRAG_CLASS);const s=a.dataTransfer;if(a.target.files=s.files,s.files.length>1)return;handleUpload(a,e,t,i);const o=new CustomEvent("change",{detail:{files:s.files}});e.dispatchEvent(o)}),!1),e.addEventListener("input",(a=>handleUpload(a,e,t,i)),!1)}))},teardown(e){selectOrMatches(INPUT,e).forEach((e=>{const t=e.parentElement.parentElement;t.parentElement.replaceChild(e,t),e.className=DROPZONE_CLASS}))},getFileInputContext:getFileInputContext,disable:disable,ariaDisable:ariaDisable,enable:enable},extensionToMimeType={".txt":"text/plain",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".odt":"application/vnd.oasis.opendocument.text",".rtf":"application/rtf",".csv":"text/csv",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".bmp":"image/bmp",".webp":"image/webp",".tif":"image/tiff",".tiff":"image/tiff",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".mkv":"video/x-matroska",".webm":"video/webm",".zip":"application/zip",".rar":"application/x-rar-compressed",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript"},vaFileInputCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}h1{margin-top:0}h1,h2,h3,h4,h5,h6{margin-bottom:0;margin-top:0;clear:both}*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:1.5em}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*{margin-top:1em}h1{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:2.44rem;line-height:1.2;font-weight:700}h2{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.95rem;line-height:1.2;font-weight:700}h3{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.34rem;line-height:1.2;font-weight:700}h4{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.98rem;line-height:1.2;font-weight:700}h5{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.91rem;line-height:1.2;font-weight:700}h6{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:0.87rem;line-height:1.1;font-weight:normal;letter-spacing:0.025em;text-transform:uppercase}h1,h2,h3,h4,h5{font-family:Bitter, Georgia, Cambria, "Times New Roman", Times, serif;font-weight:700}h6{font-family:"Source Sans Pro Web", "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}[hidden]{display:none}:host{display:block;font-family:var(--font-source-sans);font-size:16.96px;}:host .label-header{color:var(--vads-color-base);font-weight:var(--font-weight-normal)}:host .label-header-tag{margin:0;display:inline-block}:host .file-input-wrapper{display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host .file-input{cursor:pointer;height:100%;width:100%;max-width:none;top:0;left:0;z-index:1;margin:0;position:absolute;text-indent:-999em;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target{border:1px dashed var(--vads-color-action-border-base-active-on-dark);display:block;margin-top:0.3125rem;position:relative;text-align:center;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target.file-input-target-error{border:2px dashed var(--vads-color-secondary-dark)}:host .file-input-box{background:var(--vads-color-white);height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}:host .file-input-instructions{font-size:1.06rem;padding:1.25rem 0.625rem;pointer-events:none;position:relative;z-index:3}:host .file-input-choose-text{color:var(--vads-color-link);text-decoration:underline;font-weight:var(--font-weight-normal)}:host .file-icon{color:var(--vads-color-primary-alt-darkest)}:host .selected-files-wrapper{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light)}:host .selected-files-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;border-bottom:1px solid var(--vads-color-white);margin-bottom:8px;padding:8px}:host .va-card{margin:8px}:host .file-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;padding:0 8px;display:block;width:100%;word-wrap:break-word;word-break:break-word;overflow:hidden}:host #input-error-message{padding:0 8px;width:100%}:host .file-size-label,:host .file-status-label{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:1.06rem;padding:0 8px;display:block}:host .file-status-label{font-style:italic}:host .file-info-section{padding:0 8px 8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .file-button-section{margin-top:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row;flex-direction:row}:host .file-button-section>va-button-icon{font-size:1.06rem}@media screen and (max-width: 320px){:host .file-button-section{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}:host .separator{border:0;border-top:1px solid var(--vads-color-base-lighter);margin:0}:host .vads-u-line-height--2{line-height:1.15}:host .thumbnail-container{height:40px;width:40px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .thumbnail-preview{max-width:40px;width:auto;max-height:40px;height:auto}:host .thumbnail-error{color:#b21d38}:host va-progress-bar{font-size:var(--vads-font-size-root);display:block;margin-left:16px}:host .uploading-status{font-style:var(--font-style-italic)}:host(.has-error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host(.has-error){margin-left:-0.9rem}}.required{color:var(--vads-color-secondary-dark);margin-left:0.25rem}h1 .required,h2 .required,h3 .required,h4 .required,h5 .required,h6 .required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}',VaFileInputStyle0=vaFileInputCss,VaFileInput=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaChange=createEvent(this,"vaChange",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.uploadStatus="idle",this.handleChange=e=>{const t=e.target;t.files&&t.files.length>0&&this.handleFile(t.files[0]),t.value=""},this.handleDrop=e=>{e.preventDefault(),e.stopPropagation();const t=e.dataTransfer.files;t.length>0&&this.handleFile(t[0])},this.handleFile=(e,t=!0)=>{if(this.accept){const t=this.normalizeAcceptProp(this.accept);if(!this.isAcceptedFileType(e.type,t))return this.removeFile(!1),void(this.internalError="This is not a valid file type.")}if(e.size>this.maxFileSize)return this.internalError=`\n We can't upload your file because it's too big. Files must be less than ${this.formatFileSize(this.maxFileSize)}.`,this.fileContents=null,void(this.uploadStatus="idle");this.uploadedFile=null,this.file=e,t&&this.vaChange.emit({files:[this.file]}),this.uploadStatus="success",this.internalError=null,this.generateFileContents(this.file),this.updateStatusMessage(`You have selected the file: ${this.file.name}`),this.el.focus(),this.enableAnalytics&&this.componentLibraryAnalytics.emit({componentName:"va-file-input",action:"change",details:{label:this.label}})},this.removeFile=(e=!0)=>{this.closeModal(),this.uploadStatus="idle",this.internalError=null,e&&this.vaChange.emit({files:[]}),this.file=null,this.uploadedFile=null,this.updateStatusMessage("File removed. No file selected."),this.el.focus()},this.openModal=()=>{this.el.shadowRoot.querySelector("va-modal").setAttribute("status","warning"),this.showModal=!0},this.closeModal=()=>{this.showModal=!1,setTimeout((()=>{this.fileInputRef.focus()}),0)},this.changeFile=()=>{this.fileInputRef&&this.fileInputRef.click()},this.formatFileSize=e=>{const t=["B","KB","MB","GB","TB"];if(0===e)return"0 B";const i=Math.floor(Math.log(e)/Math.log(1024));return 0===i?`${e} ${t[i]}`:`${(e/Math.pow(1024,i)).toFixed(i<2?0:1)} ${t[i]}`},this.normalizeAcceptProp=e=>e.split(",").map((e=>(e=e.trim()).startsWith(".")?extensionToMimeType[e]:e)),this.isAcceptedFileType=(e,t)=>{for(const i of t){if(i===e)return!0;if(i.endsWith("/*")&&e.startsWith(i.slice(0,-1)))return!0}return!1},this.renderLabelOrHeader=(e,t,i)=>{const a=t?h("span",{class:"required"}," ",instance.t("required")):null;return h("div",{class:"label-header"},i&&i>=1&&i<=6?h(`h${i}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,a):h("label",{htmlFor:"fileInputField",part:"label",class:"usa-label"},e,a))},this.file=void 0,this.fileContents=void 0,this.internalError=void 0,this.showModal=!1,this.showSeparator=!0,this.label=void 0,this.name=void 0,this.buttonText=void 0,this.value=void 0,this.required=!1,this.accept=void 0,this.error=void 0,this.hint=void 0,this.statusText=void 0,this.uploadMessage=null,this.enableAnalytics=!1,this.headerSize=void 0,this.headless=!1,this.readOnly=!1,this.uploadedFile=void 0,this.maxFileSize=1/0,this.percentUploaded=null}handleValueChange(e){setTimeout((()=>{this.updateStatusMessage(e)}))}percentHandler(e){e>=100&&this.resetState()}resetState(){this.fileContents=null,this.uploadStatus="idle",this.percentUploaded=null,forceUpdate(this.el)}updateStatusMessage(e){setTimeout((()=>{const t=this.el.shadowRoot.querySelector("#statusMessage");t&&(t.textContent=e)}),1e3)}generateFileContents(e){if(!e)return;const t=new FileReader;this.fileType=e.type,t.onloadend=()=>{this.fileContents=t.result},this.fileType&&("application/pdf"===this.fileType||this.fileType.startsWith("image/"))&&t.readAsDataURL(e)}componentWillRender(){const e=!!this.el.querySelector(":scope > *"),t=!(!this.value&&!this.file||this.readOnly);this.showSeparator=e||t}componentDidLoad(){fileInput.init(this.el)}connectedCallback(){this.el.addEventListener("change",this.handleChange)}disconnectedCallback(){this.el.removeEventListener("change",this.handleChange)}getDefaultUploadMessage(){return h("span",null,"Drag a file here or"," ",h("span",{class:"file-input-choose-text"},"choose from folder"))}render(){const{label:e,name:t,required:i,accept:a,error:s,hint:o,file:n,uploadStatus:r,uploadMessage:l,headerSize:d,fileContents:c,fileType:f,headless:p,value:u,readOnly:m,statusText:b,uploadedFile:g,percentUploaded:v}=this;u&&!this.file&&this.handleFile(u,!1);const S=this.error||this.internalError,E=`${o?"input-hint-message":""} ${S?"input-error-message":""}`.trim()||null,A=("file-input-target "+(S?"file-input-target-error":"")).trim();let _=h("div",{key:"f9d5350fbe784f1ee9a6507e35b994f014537457",class:"thumbnail-container"},h("svg",{key:"e4f8804f6dc1f79cc7cacaa1cb87ff7d8a158ee4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"#07648d",width:"40px",height:"40px"},h("path",{key:"c04e0cb8e2eaafa884e5c33ceba886be9a9c59cb",d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"})));s?_=h("div",{key:"c97d656c976a037aa81f2b31b14012d48994137a",class:"thumbnail-container"},h("va-icon",{key:"122ed17eba6cc663f48c5ffaf35bee1c5d8b08f1",icon:"error",size:3,class:"thumbnail-preview thumbnail-error"})):c&&(f.startsWith("image/")?_=h("div",{key:"5a3d3167e0c3884243f9d63920c0e39067c6815c",class:"thumbnail-container","aria-hidden":"true"},h("img",{key:"39383bf510139ed961be4ceefebd7f1c8716833c",class:"thumbnail-preview",src:c,alt:"image"})):"application/pdf"===f&&(_=h("div",{key:"23a987f0362c958bdb8f24564d1cdf3048cafddf",class:"thumbnail-container","aria-hidden":"true"},h("object",{key:"97084429eeb8476e0fa077851906e7cc899c7bf4",class:"thumbnail-preview",data:c,type:"application/pdf"}))));let C=p?"headless-selected-files-wrapper":"selected-files-wrapper";const x="usa-hint"+(p?" usa-sr-only":""),y=null!==v&&v<100;let L="file-status-label";return y&&(L=`${L} uploading-status`),h(Host,{key:"11a121c92cd86a2c812b7aa6b4989e45005f8175",class:{"has-error":!!S}},!m&&h("span",{key:"f34b6cf9d2d50d9aa6b8f0d7044ce099a567dfcc",class:{"usa-sr-only":!!p}},e&&this.renderLabelOrHeader(e,i,d)),o&&!m&&h("div",{key:"7ba8602d66cdaa9bb8220e02c3ef6f4ec080fa55",class:x,id:"input-hint-message"},o),h("div",{key:"a1e2b5ee27f798d1d2c1bc26f03eda105fb6a7b9",class:"file-input-wrapper",onDrop:this.handleDrop},h("input",{key:"3ac5460978205a00d4ff8af492231175ea029392",id:"fileInputField",class:"file-input",style:{visibility:"success"===this.uploadStatus||g?"hidden":"unset"},type:"file",ref:e=>this.fileInputRef=e,name:t,accept:a,"aria-describedby":E,onChange:this.handleChange}),"idle"===r&&!g&&h("div",{key:"6a14f709471a4f44744c2f09cd13f663efce89dc"},h("span",{key:"10b71fbbd1134d73ff887b8e6955d5524334c8af",id:"file-input-error-alert",role:"alert"},S&&h(Fragment,{key:"818131b2db4b8add9cd0f14ef731798194791e4d"},h("span",{key:"0f3bbac24afc3fba6ff97f04e97e8b9fe0b09087",class:"usa-sr-only"},instance.t("error")),h("span",{key:"455df332e8a31371881717c5890d45f6dc5d160b",class:"usa-error-message"},S))),h("div",{key:"cb0bf2ca901fe274cfd34b8aba823a351c382637",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("div",{key:"ca8e028814be7fb5958cb83b08d564f6fc077cdc",class:A},h("div",{key:"84bc1a8c437c2c10e464aabbd1b680be327f3e79",class:"file-input-box"}),h("div",{key:"c31f0cb127294b0f45ed8aa2aee91adfb74fa6da",class:"file-input-instructions"},l||this.getDefaultUploadMessage()))),("idle"!==r||g)&&h("div",{key:"bd361657f81cae4911497172e59bf5d88176eb49",class:C},!p&&h("div",{key:"af5b107f07b2e45808fbf63f21625e8f1ca157c2",class:"selected-files-label"},m?"Files you uploaded":"Selected files"),h("div",{key:"7ca079a1a54fdbb4141776f48bb2028700899f83",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("va-card",{key:"d8e823348a9f2eb1075c8689f0b5504f68b42eb3",class:"va-card"},h("div",{key:"157fb58569f7efab3a45396c3b945753cc8f9c12",class:"file-info-section"},_,h("div",{key:"1bf4ff9a0229e958e4bb651b9931c7c105966327",class:"file-info-group vads-u-line-height--2"},h("span",{key:"6aadb10d22f5c529755e8380002b941bc4716b66",class:"file-label"},n?n.name:g.name),S&&h("span",{key:"b366f3265184fa011d45732c151a892750f21cdd",id:"input-error-message",role:"alert"},h("span",{key:"1fbb0874613710dd2a343916b254fb11f629df48",class:"usa-sr-only"},instance.t("error")),h("span",{key:"86a8e6954682d135e08db27a002c5d1c5ef45bb0","aria-live":"polite",class:"usa-error-message"},S)),!y&&h("span",{key:"9e0db8c27d163fd0ce42893ab744e9bbb6fd2e3d",class:"file-size-label"},this.formatFileSize(n?n.size:g.size)),h("span",{key:"2afffa6b22424d81270d61c6cb256ee772b0c7e6",class:L,"aria-live":"polite"},y?"Uploading...":b))),(n||u||g)&&h("div",{key:"bf4a45f470ff15acb356b0fb2064d0b417e57edd"},this.showSeparator&&h("hr",{key:"5b85fdf040f82b6869bad9ad8dc4cc5fb2de5f22",class:"separator"}),h("div",{key:"9a65cfc670af474d57581933df068cf201d01383",class:"additional-info-slot"},h("slot",{key:"563ac8e7a6af2338ff55b4f164060ea20e635b22"})),m?null:y?h(Fragment,null,h("va-progress-bar",{percent:v}),h("va-button-icon",{buttonType:"cancel",onClick:this.resetState.bind(this)})):h(Fragment,null,h("div",{class:"file-button-section"},h("va-button-icon",{buttonType:"change-file",onClick:this.changeFile,label:"Change file","aria-label":`change file ${n?n.name:g.name}`}),h("va-button-icon",{buttonType:"delete",onClick:this.openModal,"aria-label":`delete file ${n?n.name:g.name}`,label:"Delete"})),h("va-modal",{modalTitle:"Delete this file?",visible:this.showModal,primaryButtonText:"Yes, remove this",secondaryButtonText:"No, keep this",onCloseEvent:this.closeModal,onPrimaryButtonClick:()=>this.removeFile(!0),onSecondaryButtonClick:this.closeModal},"We'll remove the uploaded document"," ",h("span",{class:"file-label"},n?n.name:g.name))))))))}get el(){return this}static get watchers(){return{statusText:["handleValueChange"],percentUploaded:["percentHandler"]}}static get style(){return VaFileInputStyle0}},[1,"va-file-input",{label:[1],name:[1],buttonText:[1,"button-text"],value:[16],required:[4],accept:[1],error:[1],hint:[1],statusText:[1,"status-text"],uploadMessage:[16],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],headless:[4],readOnly:[4,"read-only"],uploadedFile:[16],maxFileSize:[2,"max-file-size"],percentUploaded:[1026,"percent-uploaded"],file:[32],fileContents:[32],internalError:[32],showModal:[32],showSeparator:[32]},void 0,{statusText:["handleValueChange"],percentUploaded:["percentHandler"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-file-input","va-button","va-button-icon","va-card","va-icon","va-modal","va-progress-bar"].forEach((e=>{switch(e){case"va-file-input":customElements.get(e)||customElements.define(e,VaFileInput);break;case"va-button":customElements.get(e)||defineCustomElement$6();break;case"va-button-icon":customElements.get(e)||defineCustomElement$5();break;case"va-card":customElements.get(e)||defineCustomElement$4();break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-modal":customElements.get(e)||defineCustomElement$2();break;case"va-progress-bar":customElements.get(e)||defineCustomElement$1()}}))}export{VaFileInput as V,defineCustomElement as d};
@@ -1 +1 @@
1
- import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{d as defineCustomElement$7}from"./va-button2.js";import{d as defineCustomElement$6}from"./va-crisis-line-modal2.js";import{d as defineCustomElement$5}from"./va-icon2.js";import{d as defineCustomElement$4}from"./va-modal2.js";import{d as defineCustomElement$3}from"./va-official-gov-banner2.js";import{d as defineCustomElement$2}from"./va-telephone2.js";const vaSealSvg="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1Ny42IDM1LjIiIHJvbGU9ImltZyI+PHRpdGxlPlZBPC90aXRsZT48ZyBmaWxsPSIjRkZGIj48cGF0aCBkPSJNMTEuMSAzNS4yTDAgMGg4LjZsNC4yIDE0LjljMS4yIDQuMiAyLjIgOC4yIDMuMSAxMi42aC4xYy45LTQuMiAxLjktOC40IDMuMS0xMi40TDIzLjUgMGg4LjNMMjAuMiAzNS4yaC05LjF6TTM2LjYgMjYuMmwtMi41IDloLThMMzYuNiAwaDEwLjJsMTAuOCAzNS4yaC04LjVsLTIuNy05aC05Ljh6bTguOC02bC0yLjItNy41Yy0uNi0yLjEtMS4yLTQuNy0xLjctNi44aC0uMWMtLjUgMi4xLTEgNC44LTEuNiA2LjhsLTIgNy41aDcuNnoiPjwvcGF0aD48L2c+PC9zdmc+",vaHeaderMinimalCss=".va-header{display:-ms-flexbox;display:flex;margin-left:auto;margin-right:auto;max-width:1000px;background-color:var(--vads-color-primary-darker);color:var(--vads-button-color-text-primary-alt-on-light);-ms-flex-align:center;align-items:center;padding:10px 8px;line-height:22px}@media (min-width: 481px){.va-header{padding:10px 16px}}.va-logo-link:focus{outline:2px solid var(--vads-color-action-focus-on-light)}.va-logo{margin-right:8px;min-height:30px;min-width:48px}@media (min-width: 481px){.va-logo{margin-right:16px}}.header-container{padding-left:8px;border-left:1px solid var(--vads-color-white)}@media (min-width: 481px){.header-container{padding-left:16px}}.header-container h1,.header-container .header{font-size:20px;margin:0;font-weight:700}.header-container h2,.header-container .subheader{font-size:20px;margin:0;font-weight:100}@media (min-width: 1008px){va-crisis-line-modal::part(button){position:absolute;right:0;bottom:-5px}}",VaHeaderMinimalStyle0=vaHeaderMinimalCss,VaHeaderMinimal$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.shifted=!1,this.header=void 0,this.subheader=void 0,this.enableHeadings=!1}trackShiftKey(e){this.shifted=e.shiftKey}trapFocus(){var e;const a=null===(e=this.el)||void 0===e?void 0:e.shadowRoot.querySelector("va-crisis-line-modal").shadowRoot.querySelector("va-modal"),t=null==a?void 0:a.getAttribute("visible");if(null!==t&&"false"!==t){let e;const t=this.shifted?".last-focusable-child":".va-modal-close";e=this.shifted?null==a?void 0:a.querySelector(t):null==a?void 0:a.shadowRoot.querySelector(t),null==e||e.focus()}}render(){const{header:e,subheader:a,enableHeadings:t}=this;return h(Host,{key:"de6ef144d4f44b7b21319ee9500274b48e294dfd",role:"banner"},h("va-official-gov-banner",{key:"579da9295024a5605162e2591f1eb6ba12b8a098"}),h("va-crisis-line-modal",{key:"fb9d5ae72e3037cfece2cbfc0eb16951ce94f7e6"}),h("div",{key:"168a6172790ef34e6efca39a0bfce58b9e3d670f",onFocusin:()=>this.trapFocus(),class:"va-header"},h("a",{key:"3db676d77c032470718306337d662b38d6589f90",href:"/",title:"Go to VA.gov",class:"va-logo-link"},h("img",{key:"d41fd05286d3fca0d38549639cec8d29627fc9f0",class:"va-logo",src:vaSealSvg,alt:"VA logo and Seal, U.S. Department of Veterans Affairs"})),h("div",{key:"9a3ce33c9dee2afd43c310fd76d303ef472d74a3",class:"header-container"},t?h("h1",null,e):h("div",{class:"header"},e),a&&(t?h("h2",null,a):h("div",{class:"subheader"},a)))))}get el(){return this}static get style(){return VaHeaderMinimalStyle0}},[1,"va-header-minimal",{header:[1],subheader:[1],enableHeadings:[4,"enable-headings"],shifted:[32]},[[8,"keydown","trackShiftKey"]]]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-header-minimal","va-button","va-crisis-line-modal","va-icon","va-modal","va-official-gov-banner","va-telephone"].forEach((e=>{switch(e){case"va-header-minimal":customElements.get(e)||customElements.define(e,VaHeaderMinimal$1);break;case"va-button":customElements.get(e)||defineCustomElement$7();break;case"va-crisis-line-modal":customElements.get(e)||defineCustomElement$6();break;case"va-icon":customElements.get(e)||defineCustomElement$5();break;case"va-modal":customElements.get(e)||defineCustomElement$4();break;case"va-official-gov-banner":customElements.get(e)||defineCustomElement$3();break;case"va-telephone":customElements.get(e)||defineCustomElement$2()}}))}const VaHeaderMinimal=VaHeaderMinimal$1,defineCustomElement=defineCustomElement$1;export{VaHeaderMinimal,defineCustomElement};
1
+ import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{d as defineCustomElement$7}from"./va-button2.js";import{d as defineCustomElement$6}from"./va-crisis-line-modal2.js";import{d as defineCustomElement$5}from"./va-icon2.js";import{d as defineCustomElement$4}from"./va-modal2.js";import{d as defineCustomElement$3}from"./va-official-gov-banner2.js";import{d as defineCustomElement$2}from"./va-telephone2.js";const vaSealSvg="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1Ny42IDM1LjIiIHJvbGU9ImltZyI+PHRpdGxlPlZBPC90aXRsZT48ZyBmaWxsPSIjRkZGIj48cGF0aCBkPSJNMTEuMSAzNS4yTDAgMGg4LjZsNC4yIDE0LjljMS4yIDQuMiAyLjIgOC4yIDMuMSAxMi42aC4xYy45LTQuMiAxLjktOC40IDMuMS0xMi40TDIzLjUgMGg4LjNMMjAuMiAzNS4yaC05LjF6TTM2LjYgMjYuMmwtMi41IDloLThMMzYuNiAwaDEwLjJsMTAuOCAzNS4yaC04LjVsLTIuNy05aC05Ljh6bTguOC02bC0yLjItNy41Yy0uNi0yLjEtMS4yLTQuNy0xLjctNi44aC0uMWMtLjUgMi4xLTEgNC44LTEuNiA2LjhsLTIgNy41aDcuNnoiPjwvcGF0aD48L2c+PC9zdmc+",vaHeaderMinimalCss=".va-header{display:-ms-flexbox;display:flex;margin-left:auto;margin-right:auto;max-width:1000px;background-color:var(--vads-color-primary-darker);color:var(--vads-button-color-text-primary-alt-on-light);-ms-flex-align:center;align-items:center;padding:10px 8px;line-height:22px}@media (min-width: 481px){.va-header{padding:10px 16px}}.va-logo-link:focus{outline:2px solid var(--vads-color-action-focus-on-light)}.va-logo{margin-right:8px;min-height:30px;min-width:48px}@media (min-width: 481px){.va-logo{margin-right:16px}}.header-container{padding-left:8px;border-left:1px solid var(--vads-color-white)}@media (min-width: 481px){.header-container{padding-left:16px}}.header-container h1,.header-container .header{font-size:20px;margin:0;font-weight:700}.header-container h2,.header-container .subheader{font-size:20px;margin:0;font-weight:100}@media (min-width: 1008px){va-crisis-line-modal::part(button){position:absolute;right:0;bottom:-5px}}",VaHeaderMinimalStyle0=vaHeaderMinimalCss,VaHeaderMinimal$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.shifted=!1,this.header=void 0,this.subheader=void 0,this.enableHeadings=!1}trackShiftKey(e){this.shifted=e.shiftKey}trapFocus(){var e;const a=null===(e=this.el)||void 0===e?void 0:e.shadowRoot.querySelector("va-crisis-line-modal").shadowRoot.querySelector("va-modal"),t=null==a?void 0:a.getAttribute("visible");if(null!==t&&"false"!==t){let e;const t=this.shifted?".last-focusable-child":".va-modal-close";e=this.shifted?null==a?void 0:a.querySelector(t):null==a?void 0:a.shadowRoot.querySelector(t),null==e||e.focus()}}render(){const{header:e,subheader:a,enableHeadings:t}=this;return h(Host,{key:"f1d4c0202be2f776792bf66754e16ffbdaa9320a",role:"banner"},h("va-official-gov-banner",{key:"0da35478674af68e12fe6b811931d4300156751e"}),h("va-crisis-line-modal",{key:"ebb401d3bd09ec54a8b535d63efb7548d381a2e7"}),h("div",{key:"8ffb91157c5cebd457b87e1abb129198012e66e3",onFocusin:()=>this.trapFocus(),class:"va-header"},h("a",{key:"b8498a4fdddfe18ed1d8c00ec5b9ce3de7ba158d",href:"/",title:"Go to VA.gov",class:"va-logo-link"},h("img",{key:"fb7a8736270e1e8cda63e2f6262317a1c8fcb7b4",class:"va-logo",src:vaSealSvg,alt:"VA logo and Seal, U.S. Department of Veterans Affairs"})),h("div",{key:"10bdb8e4dbc4e2ffc7f54ebd54ef716d292e95f3",class:"header-container"},t?h("h1",null,e):h("div",{class:"header"},e),a&&(t?h("h2",null,a):h("div",{class:"subheader"},a)))))}get el(){return this}static get style(){return VaHeaderMinimalStyle0}},[1,"va-header-minimal",{header:[1],subheader:[1],enableHeadings:[4,"enable-headings"],shifted:[32]},[[8,"keydown","trackShiftKey"]]]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-header-minimal","va-button","va-crisis-line-modal","va-icon","va-modal","va-official-gov-banner","va-telephone"].forEach((e=>{switch(e){case"va-header-minimal":customElements.get(e)||customElements.define(e,VaHeaderMinimal$1);break;case"va-button":customElements.get(e)||defineCustomElement$7();break;case"va-crisis-line-modal":customElements.get(e)||defineCustomElement$6();break;case"va-icon":customElements.get(e)||defineCustomElement$5();break;case"va-modal":customElements.get(e)||defineCustomElement$4();break;case"va-official-gov-banner":customElements.get(e)||defineCustomElement$3();break;case"va-telephone":customElements.get(e)||defineCustomElement$2()}}))}const VaHeaderMinimal=VaHeaderMinimal$1,defineCustomElement=defineCustomElement$1;export{VaHeaderMinimal,defineCustomElement};
@@ -1 +1 @@
1
- import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{c as consoleDevError}from"./utils.js";const vaIconCss=".usa-icon{display:inline-block;fill:currentColor;height:1em;position:relative;width:1em}.usa-icon--size-3{height:1.5rem;width:1.5rem}.usa-icon--size-4{height:2rem;width:2rem}.usa-icon--size-5{height:2.5rem;width:2.5rem}.usa-icon--size-6{height:3rem;width:3rem}.usa-icon--size-7{height:3.5rem;width:3.5rem}.usa-icon--size-8{height:4rem;width:4rem}.usa-icon--size-9{height:4.5rem;width:4.5rem}:host{display:inline-block;line-height:0;vertical-align:bottom}",VaIconStyle0=vaIconCss,VaIcon=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=void 0,this.size=void 0,this.srtext=void 0}getSize(){return this.size&&![3,4,5,6,7,8,9].includes(this.size)?(consoleDevError("Size must be an integer between 3 and 9, inclusive."),null):this.size}render(){const{icon:e,srtext:i}=this,t=this.getSize(),s=classnames({"usa-icon":!0,[`usa-icon--size-${t}`]:!!t}),n=`/img/sprite.svg#${e}`;return h(Host,{key:"76ae81158304b7f866203868a1cbdc7ca25eaec7"},h("svg",{key:"60ad891eec64faf5bcdacaed97c561862b40edc9",class:s,"aria-labelledby":i?"icon-title":null,"aria-hidden":i?null:"true",focusable:"false",role:"img"},i&&h("title",{key:"aeb9893f765567aa1d26b95f561adb8249915799",id:"icon-title"},i),h("use",{key:"69b0f269018f6def95752318a0be741881fd6eac",href:n})))}static get assetsDirs(){return["../img"]}static get style(){return VaIconStyle0}},[1,"va-icon",{icon:[1],size:[2],srtext:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-icon"].forEach((e=>{"va-icon"===e&&(customElements.get(e)||customElements.define(e,VaIcon))}))}export{VaIcon as V,defineCustomElement as d};
1
+ import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{c as consoleDevError}from"./utils.js";const vaIconCss=".usa-icon{display:inline-block;fill:currentColor;height:1em;position:relative;width:1em}.usa-icon--size-3{height:1.5rem;width:1.5rem}.usa-icon--size-4{height:2rem;width:2rem}.usa-icon--size-5{height:2.5rem;width:2.5rem}.usa-icon--size-6{height:3rem;width:3rem}.usa-icon--size-7{height:3.5rem;width:3.5rem}.usa-icon--size-8{height:4rem;width:4rem}.usa-icon--size-9{height:4.5rem;width:4.5rem}:host{display:inline-block;line-height:0;vertical-align:bottom}",VaIconStyle0=vaIconCss,VaIcon=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=void 0,this.size=void 0,this.srtext=void 0}getSize(){return this.size&&![3,4,5,6,7,8,9].includes(this.size)?(consoleDevError("Size must be an integer between 3 and 9, inclusive."),null):this.size}render(){const{icon:e,srtext:i}=this,t=this.getSize(),s=classnames({"usa-icon":!0,[`usa-icon--size-${t}`]:!!t}),n=`/img/sprite.svg#${e}`;return h(Host,{key:"087041689b15190ff457cb6c0ff93a19c630618f"},h("svg",{key:"a132a544bfd718e64564e00d995dca4d5553d48e",class:s,"aria-labelledby":i?"icon-title":null,"aria-hidden":i?null:"true",focusable:"false",role:"img"},i&&h("title",{key:"dc32f89b4b0ef4bc3251cf6534b6e4cc39589159",id:"icon-title"},i),h("use",{key:"4d8341f1b132666bfe4c86f8c8824753ff9dd347",href:n})))}static get assetsDirs(){return["../img"]}static get style(){return VaIconStyle0}},[1,"va-icon",{icon:[1],size:[2],srtext:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-icon"].forEach((e=>{"va-icon"===e&&(customElements.get(e)||customElements.define(e,VaIcon))}))}export{VaIcon as V,defineCustomElement as d};
@@ -1 +1 @@
1
- import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-link2.js";const vaLanguageToggleCss=":host div{display:inline-block}:host div div.inner-div{border-right:1px solid var(--vads-color-base-light);padding-right:8px;margin-right:8px}:host div a.is-current-lang{font-weight:var(--font-weight-bold);color:var(--vads-color-black);text-decoration:none;padding-top:10px;padding-bottom:16px}:host div a.is-current-lang:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}:host div va-link{color:var(--vads-color-link);padding-bottom:2px;border-bottom:1px solid var(--vads-color-link)}:host div va-link::part(anchor){text-decoration:none;padding-top:10px;padding-bottom:16px}",VaLanguageToggleStyle0=vaLanguageToggleCss,VaLanguageToggle$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaLanguageToggle=createEvent(this,"vaLanguageToggle",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.language="en",this.enHref=void 0,this.esHref=void 0,this.tlHref=void 0,this.urls=void 0,this.routerLinks=!1}getUrl(e){const t=new URL(window.location.href);return t.searchParams.set("lang",e),t.href}handleToggle(e,t,a){this.routerLinks&&(e.preventDefault(),window.history.replaceState(null,null,this.getUrl(t)),this.language=t),this.vaLanguageToggle.emit({language:t});const n={componentName:"va-language-toggle",action:"linkClick",details:{"pipe-delimited-list-header":t,label:a}};this.componentLibraryAnalytics.emit(n)}componentWillLoad(){this.urls=[{label:"English",lang:"en",href:this.enHref}],this.esHref&&(this.urls=[...this.urls,{label:"Español",lang:"es",href:this.esHref}]),this.tlHref&&(this.urls=[...this.urls,{label:"Tagalog",lang:"tl",href:this.tlHref}])}render(){const{language:e,urls:t}=this;return h(Host,{key:"9ed0b54e752d60f6e5361c64fe570cade1f55e62"},h("div",{key:"4521328e3439b79f4579b6a7202881f2f62646a1",role:"group","aria-label":"Language selection"},t.map((({href:a,lang:n,label:l},s)=>{const o=classnames({"is-current-lang":n===e}),i=classnames({"inner-div":s<t.length-1});return h("div",{class:i},n===e?h("a",{class:o,href:a,hrefLang:n,onClick:e=>this.handleToggle(e,n,l),"aria-current":"language"},l):h("va-link",{class:o,href:a,language:n,onClick:e=>this.handleToggle(e,n,l),text:l,disableAnalytics:!0}))}))))}static get style(){return VaLanguageToggleStyle0}},[1,"va-language-toggle",{language:[1025],enHref:[1,"en-href"],esHref:[1,"es-href"],tlHref:[1,"tl-href"],routerLinks:[4,"router-links"],urls:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-language-toggle","va-icon","va-link"].forEach((e=>{switch(e){case"va-language-toggle":customElements.get(e)||customElements.define(e,VaLanguageToggle$1);break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-link":customElements.get(e)||defineCustomElement$2()}}))}const VaLanguageToggle=VaLanguageToggle$1,defineCustomElement=defineCustomElement$1;export{VaLanguageToggle,defineCustomElement};
1
+ import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-link2.js";const vaLanguageToggleCss=":host div{display:inline-block}:host div div.inner-div{border-right:1px solid var(--vads-color-base-light);padding-right:8px;margin-right:8px}:host div a.is-current-lang{font-weight:var(--font-weight-bold);color:var(--vads-color-black);text-decoration:none;padding-top:10px;padding-bottom:16px}:host div a.is-current-lang:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}:host div va-link{color:var(--vads-color-link);padding-bottom:2px;border-bottom:1px solid var(--vads-color-link)}:host div va-link::part(anchor){text-decoration:none;padding-top:10px;padding-bottom:16px}",VaLanguageToggleStyle0=vaLanguageToggleCss,VaLanguageToggle$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaLanguageToggle=createEvent(this,"vaLanguageToggle",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.language="en",this.enHref=void 0,this.esHref=void 0,this.tlHref=void 0,this.urls=void 0,this.routerLinks=!1}getUrl(e){const t=new URL(window.location.href);return t.searchParams.set("lang",e),t.href}handleToggle(e,t,a){this.routerLinks&&(e.preventDefault(),window.history.replaceState(null,null,this.getUrl(t)),this.language=t),this.vaLanguageToggle.emit({language:t});const n={componentName:"va-language-toggle",action:"linkClick",details:{"pipe-delimited-list-header":t,label:a}};this.componentLibraryAnalytics.emit(n)}componentWillLoad(){this.urls=[{label:"English",lang:"en",href:this.enHref}],this.esHref&&(this.urls=[...this.urls,{label:"Español",lang:"es",href:this.esHref}]),this.tlHref&&(this.urls=[...this.urls,{label:"Tagalog",lang:"tl",href:this.tlHref}])}render(){const{language:e,urls:t}=this;return h(Host,{key:"47bdbe27c8a05fbdecb120d7372cecdc24f37387"},h("div",{key:"a74e62b1e45900c2100f1d3b311730a62051ed1e",role:"group","aria-label":"Language selection"},t.map((({href:a,lang:n,label:l},s)=>{const o=classnames({"is-current-lang":n===e}),i=classnames({"inner-div":s<t.length-1});return h("div",{class:i},n===e?h("a",{class:o,href:a,hrefLang:n,onClick:e=>this.handleToggle(e,n,l),"aria-current":"language"},l):h("va-link",{class:o,href:a,language:n,onClick:e=>this.handleToggle(e,n,l),text:l,disableAnalytics:!0}))}))))}static get style(){return VaLanguageToggleStyle0}},[1,"va-language-toggle",{language:[1025],enHref:[1,"en-href"],esHref:[1,"es-href"],tlHref:[1,"tl-href"],routerLinks:[4,"router-links"],urls:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-language-toggle","va-icon","va-link"].forEach((e=>{switch(e){case"va-language-toggle":customElements.get(e)||customElements.define(e,VaLanguageToggle$1);break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-link":customElements.get(e)||defineCustomElement$2()}}))}const VaLanguageToggle=VaLanguageToggle$1,defineCustomElement=defineCustomElement$1;export{VaLanguageToggle,defineCustomElement};