@department-of-veterans-affairs/component-library 48.3.0 → 49.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 (86) hide show
  1. package/contacts.js +1 -1
  2. package/dist/1214.app.bundle.js +1 -1
  3. package/dist/1450.app.bundle.js +1 -1
  4. package/dist/196.app.bundle.js +1 -1
  5. package/dist/2222.app.bundle.js +1 -1
  6. package/dist/2387.app.bundle.js +1 -1
  7. package/dist/2654.app.bundle.js +1 -1
  8. package/dist/2664.app.bundle.js +1 -1
  9. package/dist/2801.app.bundle.js +1 -1
  10. package/dist/286.app.bundle.js +1 -1
  11. package/dist/3071.app.bundle.js +1 -1
  12. package/dist/3156.app.bundle.js +1 -1
  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/5628.app.bundle.js +1 -1
  23. package/dist/575.app.bundle.js +1 -1
  24. package/dist/5830.app.bundle.js +1 -1
  25. package/dist/6034.app.bundle.js +1 -1
  26. package/dist/6246.app.bundle.js +1 -1
  27. package/dist/6247.app.bundle.js +1 -1
  28. package/dist/6527.app.bundle.js +1 -1
  29. package/dist/6771.app.bundle.js +1 -1
  30. package/dist/712.app.bundle.js +1 -1
  31. package/dist/7367.app.bundle.js +1 -1
  32. package/dist/7531.app.bundle.js +1 -1
  33. package/dist/7663.app.bundle.js +1 -1
  34. package/dist/7821.app.bundle.js +1 -1
  35. package/dist/8175.app.bundle.js +1 -1
  36. package/dist/82.app.bundle.js +1 -1
  37. package/dist/8762.app.bundle.js +1 -1
  38. package/dist/8859.app.bundle.js +1 -1
  39. package/dist/9288.app.bundle.js +1 -1
  40. package/dist/9670.app.bundle.js +1 -1
  41. package/dist/9724.app.bundle.js +1 -1
  42. package/dist/9800.app.bundle.js +1 -1
  43. package/dist/app.bundle.js +1 -1
  44. package/dist/components/contacts.js +1 -1
  45. package/dist/components/types/components.d.ts +57 -5
  46. package/dist/components/types/contacts.d.ts +4 -0
  47. package/dist/components/va-accordion.js +1 -1
  48. package/dist/components/va-alert-expandable.js +1 -1
  49. package/dist/components/va-alert-sign-in.js +1 -1
  50. package/dist/components/va-alert2.js +1 -1
  51. package/dist/components/va-button-icon2.js +1 -1
  52. package/dist/components/va-button2.js +1 -1
  53. package/dist/components/va-card2.js +1 -1
  54. package/dist/components/va-checkbox-group.js +1 -1
  55. package/dist/components/va-checkbox2.js +1 -1
  56. package/dist/components/va-combo-box.js +1 -1
  57. package/dist/components/va-crisis-line-modal2.js +1 -1
  58. package/dist/components/va-date.js +1 -1
  59. package/dist/components/va-file-input-multiple.js +1 -1
  60. package/dist/components/va-file-input2.js +1 -1
  61. package/dist/components/va-header-minimal.js +1 -1
  62. package/dist/components/va-icon2.js +1 -1
  63. package/dist/components/va-language-toggle.js +1 -1
  64. package/dist/components/va-link-action.js +1 -1
  65. package/dist/components/va-link2.js +1 -1
  66. package/dist/components/va-loading-indicator.js +1 -1
  67. package/dist/components/va-minimal-footer.js +1 -1
  68. package/dist/components/va-need-help.js +1 -1
  69. package/dist/components/va-official-gov-banner2.js +1 -1
  70. package/dist/components/va-omb-info.js +1 -1
  71. package/dist/components/va-privacy-agreement.js +1 -1
  72. package/dist/components/va-process-list-item.js +1 -1
  73. package/dist/components/va-process-list.js +1 -1
  74. package/dist/components/va-progress-bar.js +1 -1
  75. package/dist/components/va-radio-option.js +1 -1
  76. package/dist/components/va-radio.js +1 -1
  77. package/dist/components/va-search-input.js +1 -1
  78. package/dist/components/va-select2.js +1 -1
  79. package/dist/components/va-statement-of-truth.js +1 -1
  80. package/dist/components/va-summary-box.js +1 -1
  81. package/dist/components/va-table-inner2.js +1 -1
  82. package/dist/components/va-table-row.js +1 -1
  83. package/dist/components/va-table.js +1 -1
  84. package/dist/components/va-telephone2.js +1 -1
  85. package/dist/components/va-textarea.js +1 -1
  86. package/package.json +2 -2
@@ -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$7}from"./va-button2.js";import{d as defineCustomElement$6}from"./va-button-icon2.js";import{d as defineCustomElement$5}from"./va-card2.js";import{d as defineCustomElement$4}from"./va-file-input2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-modal2.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", "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{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:1.06rem;padding:0 8px;display:block}: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(.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}.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.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 r;if(o){const e=this.findFileByKey(t);e.file?e.file=o:(e.file=o,e.content=this.getAdditionalContent(),this.fileKeyCounter++,this.files.push({file:null,key:this.fileKeyCounter,content:null})),r=this.buildFilesArray(this.files.map((e=>e.file)),!1,this.findIndexByKey(t))}else{this.files.splice(i,1);const e=this.el.shadowRoot.querySelector("#statusMessage");e.textContent="",setTimeout((()=>{e.textContent="File removed."}),1e3),r=this.buildFilesArray(this.files.map((e=>e.file)),!0)}this.vaMultipleChange.emit(r),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.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:r,name:s,accept:a,errors:n,enableAnalytics:l,readOnly:d}=this,m=this.isEmpty()?"":"outer-wrap",f=this.hasErrors()?"has-error":"";return h(Host,{key:"06cd4e09aca0eb50c49cfb3cd7dfc8b33edc2da4",class:f},e&&!d&&this.renderLabelOrHeader(e,t,i),o&&!d&&h("div",{key:"39bf14a76a9052f5395370851d91bd10e50368bd",class:"usa-hint",id:"input-hint-message"},o),h("div",{key:"7a41d0eb3ba735778bf7917292d0d90590563ca2",class:m},h("div",{key:"33ac0acb8d06f912aade26f912b58aea133fcbef",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),!this.isEmpty()&&h("div",{key:"ca6c6463a2d427a8902549d5b35f4c208fc7416a",class:"selected-files-label"},d?"Files you uploaded":"Selected files"),r.map(((i,r)=>h("va-file-input",Object.assign({key:i.key,headless:!0,label:e,hint:o,name:`${s}-${i.key}`,accept:a,required:t},r>0?{uploadMessage:this.additionalFileUploadMessage}:{},{error:n[r],onVaChange:e=>this.handleChange(e,i.key,r),"enable-analytics":l,value:i.file,readOnly:d,class:i.file?"has-file":"no-file"}))))),h("slot",{key:"6c76f634704b1b1194965e3101b60a0cc9e2f597"}))}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"],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"].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$7();break;case"va-button-icon":customElements.get(e)||defineCustomElement$6();break;case"va-card":customElements.get(e)||defineCustomElement$5();break;case"va-file-input":customElements.get(e)||defineCustomElement$4();break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-modal":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$7}from"./va-button2.js";import{d as defineCustomElement$6}from"./va-button-icon2.js";import{d as defineCustomElement$5}from"./va-card2.js";import{d as defineCustomElement$4}from"./va-file-input2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-modal2.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", "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(.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}.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:"077494a14d9c32921c0da569f8a738ffdb1b630d",class:f},e&&!d&&this.renderLabelOrHeader(e,t,i),o&&!d&&h("div",{key:"f61a1355e17734e98c73fa02d8a826b358bb304d",class:"usa-hint",id:"input-hint-message"},o),h("div",{key:"8276798a5d2e05250bd2af9eed0a6af990dc47b1",class:m},h("div",{key:"82fc33990a0e85a40c39546f06c8deb7e51c1842",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),!this.isEmpty()&&h("div",{key:"9eef6703e7b852c37895f94ad948333c5091d8e4",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:"451a62070b04fba7a8c8542ae4acf46d9452e45b"}))}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"].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$7();break;case"va-button-icon":customElements.get(e)||defineCustomElement$6();break;case"va-card":customElements.get(e)||defineCustomElement$5();break;case"va-file-input":customElements.get(e)||defineCustomElement$4();break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-modal":customElements.get(e)||defineCustomElement$2()}}))}const VaFileInputMultiple=VaFileInputMultiple$1,defineCustomElement=defineCustomElement$1;export{VaFileInputMultiple,defineCustomElement};
@@ -1 +1 @@
1
- import{proxyCustomElement,HTMLElement,createEvent,h,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$5}from"./va-button2.js";import{d as defineCustomElement$4}from"./va-button-icon2.js";import{d as defineCustomElement$3}from"./va-card2.js";import{d as defineCustomElement$2}from"./va-icon2.js";import{d as defineCustomElement$1}from"./va-modal2.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", "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{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:1.06rem;padding:0 8px;display:block}: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(.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}',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.")}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.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.uploadMessage=h("span",null,"Drag a file here or"," ",h("span",{class:"file-input-choose-text"},"choose from folder")),this.enableAnalytics=!1,this.headerSize=void 0,this.headless=!1,this.readOnly=!1}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)}render(){const{label:e,name:t,required:i,accept:a,error:s,hint:o,file:n,uploadStatus:r,headerSize:l,fileContents:d,fileType:c,headless:f,value:p,readOnly:m}=this;p&&this.handleFile(p,!1);const u=this.error||this.internalError,b=`${o?"input-hint-message":""} ${u?"input-error-message":""}`.trim()||null,g=("file-input-target "+(u?"file-input-target-error":"")).trim();let v=h("div",{key:"8ed47f9b347c3f9f6dbe4ab4d28ab9d7ea9991a7",class:"thumbnail-container"},h("svg",{key:"9cedc82f6938c38e13f5a9419eb7e6b056f4abaf",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"#07648d",width:"40px",height:"40px"},h("path",{key:"7fefeb7c4f3bb2f2ea2998f72e635612d7c14346",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?v=h("div",{key:"2f14ec281c0a5992d43e45d959ac130742139475",class:"thumbnail-container"},h("va-icon",{key:"b559c1209ed6806259ccc08f7c826f9b8f25cb0e",icon:"error",size:3,class:"thumbnail-preview thumbnail-error"})):d&&(c.startsWith("image/")?v=h("div",{key:"0997c756cbf5d171d435e936105ce8b166bb0a85",class:"thumbnail-container","aria-hidden":"true"},h("img",{key:"192b292f9f600aff8fe505c3189692da328b57a1",class:"thumbnail-preview",src:d,alt:"image"})):"application/pdf"===c&&(v=h("div",{key:"8375aacf3338323e499fbae98111af72fc7720f9",class:"thumbnail-container","aria-hidden":"true"},h("object",{key:"516b485c619a70d1b2a2d60a8373e77bec39b4aa",class:"thumbnail-preview",data:d,type:"application/pdf"}))));let E=f?"headless-selected-files-wrapper":"selected-files-wrapper";const S="usa-hint"+(f?" usa-sr-only":"");return h(Host,{key:"90d87831dd85382006e6e00c0cb72e62e7bb9ee6",class:{"has-error":!!u}},!m&&h("span",{key:"938462ff15a624eab529bde1bda6ee541eaedb2d",class:{"usa-sr-only":!!f}},e&&this.renderLabelOrHeader(e,i,l)),o&&!m&&h("div",{key:"64ef6ab4d8ad8c00156e4080d83ffe46b73458bc",class:S,id:"input-hint-message"},o),h("div",{key:"2702e265618684866d88406ebe840e9658987f1b",class:"file-input-wrapper",onDrop:this.handleDrop},h("input",{key:"942e1ff2da74f8203dcc0a2c96bd4f31db32379b",id:"fileInputField",class:"file-input",style:{visibility:"success"===this.uploadStatus?"hidden":"unset"},type:"file",ref:e=>this.fileInputRef=e,name:t,accept:a,"aria-describedby":b,onChange:this.handleChange}),"idle"===r&&h("div",{key:"6345e84c5337787105063d32dcfce0c770206875"},h("span",{key:"6567ff47783ff8332e6b3d6f73c5dac746e9a78f",id:"file-input-error-alert",role:"alert"},u&&h(Fragment,{key:"b85f9dfadf0dfa04b5dd0cc47f64abb5fa53507c"},h("span",{key:"c9bb5153186e303f032c3bd939ae3505b92f29f8",class:"usa-sr-only"},instance.t("error")),h("span",{key:"7aae0b7637928ea42fc5c33c54e6d23b1bf0944c",class:"usa-error-message"},u))),h("div",{key:"dc247ee867dc7166847b518dd242d2793f6e550c",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("div",{key:"7dcff1803b47650caed854978e7d3c1da4912d75",class:g},h("div",{key:"ae5e42feae71d73f5c9d35166d5a38464d07b0e4",class:"file-input-box"}),h("div",{key:"8a7655f35af9cedc51d662161986b8ae1342be27",class:"file-input-instructions"},this.uploadMessage))),"idle"!==r&&h("div",{key:"46d67a6ba6337d067db5cd29786480dc99c47657",class:E},!f&&h("div",{key:"e36eec35ea37d8f1312f3e811cf6bdfd5d694a36",class:"selected-files-label"},m?"Files you uploaded":"Selected files"),h("div",{key:"c9e9591fd5329679539daacda6dc33057d5f652f",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("va-card",{key:"a851e4c8ae91bdf478607ff590c2d7647aee5708",class:"va-card"},h("div",{key:"ad7bf67b1c4065b10e3a837475757ee972850f79",class:"file-info-section"},v,h("div",{key:"e80f05ee24450b0b05f29983b94a1254b8096d74",class:"file-info-group vads-u-line-height--2"},h("span",{key:"49526a68ff44770e7ee8496ffb892300bc590e97",class:"file-label"},n.name),u&&h("span",{key:"efa95acd17b9bfb36068b1ff96af9d01ee021673",id:"input-error-message",role:"alert"},h("span",{key:"b1eaccdebd29e72021846c8076838372286c8810",class:"usa-sr-only"},instance.t("error")),h("span",{key:"9c77e72000af834eb9ec0424ce49e76212b0dab7",class:"usa-error-message"},u)),h("span",{key:"1cc0f7b93e046fca08c2bbe8a9ade79abc83b0c3",class:"file-size-label"},this.formatFileSize(n.size)))),(n||p)&&h("div",{key:"33812075a292523c49713d0543cceffbce2ec49b"},this.showSeparator&&h("hr",{key:"afcd1c5da760da25e476b14480d55dc9dac111cb",class:"separator"}),h("div",{key:"3d8f17df9e3c40bee8884cb6a5a941412dc17a66",class:"additional-info-slot"},h("slot",{key:"6fc4240acf7cd7d06d4f12e01200244a9b804191"})),!m&&h(Fragment,{key:"3c3d853dd861acc2017b00a6b3146c47eb208a16"},h("div",{key:"c95d7463df342b9e04dc2aed87255cdd7838e665",class:"file-button-section"},h("va-button-icon",{key:"a2f051916e62de4969c61437fa964919a91877b0",buttonType:"change-file",onClick:this.changeFile,label:"Change file","aria-label":"change file "+n.name}),h("va-button-icon",{key:"8e2d8e0b6b4a27257d1421d0d63880507d6661de",buttonType:"delete",onClick:this.openModal,"aria-label":"delete file "+n.name,label:"Delete"})),h("va-modal",{key:"34c4ec4532b3673ed94a2afaec7bc994639fa9f2",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",{key:"0691bcff16cc99133dfc7505024171de2e3260d5",class:"file-label"},n.name))))))))}get el(){return this}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],uploadMessage:[16],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],headless:[4],readOnly:[4,"read-only"],file:[32],fileContents:[32],internalError:[32],showModal:[32],showSeparator:[32]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-file-input","va-button","va-button-icon","va-card","va-icon","va-modal"].forEach((e=>{switch(e){case"va-file-input":customElements.get(e)||customElements.define(e,VaFileInput);break;case"va-button":customElements.get(e)||defineCustomElement$5();break;case"va-button-icon":customElements.get(e)||defineCustomElement$4();break;case"va-card":customElements.get(e)||defineCustomElement$3();break;case"va-icon":customElements.get(e)||defineCustomElement$2();break;case"va-modal":customElements.get(e)||defineCustomElement$1()}}))}export{VaFileInput as V,defineCustomElement as d};
1
+ import{proxyCustomElement,HTMLElement,createEvent,h,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$5}from"./va-button2.js";import{d as defineCustomElement$4}from"./va-button-icon2.js";import{d as defineCustomElement$3}from"./va-card2.js";import{d as defineCustomElement$2}from"./va-icon2.js";import{d as defineCustomElement$1}from"./va-modal2.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 a=t.querySelector(INPUT);return{dropZoneEl:t,inputEl:a}},disable=e=>{const{dropZoneEl:t,inputEl:a}=getFileInputContext(e);a.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:a}=getFileInputContext(e);a.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"),a=document.createElement("div"),i=document.createElement("div");return e.classList.remove(DROPZONE_CLASS),e.classList.add(INPUT_CLASS),t.classList.add(DROPZONE_CLASS),i.classList.add(BOX_CLASS),a.classList.add(TARGET_CLASS),a.prepend(i),e.parentNode.insertBefore(a,e),e.parentNode.insertBefore(t,a),a.appendChild(e),t.appendChild(a),a},createVisibleInstructions=e=>{const t=e.closest(DROPZONE),a=getItemsLabel(e),i=document.createElement("div"),s=`Drag ${a} here or`,o="choose from folder";return DEFAULT_ARIA_LABEL_TEXT=`${s} ${o}`,i.classList.add(INSTRUCTIONS_CLASS),i.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT),i.innerHTML=Sanitizer.escapeHTML(`<span class="${DRAG_TEXT_CLASS}">${s}</span> <span class="${CHOOSE_CLASS}">${o}</span>`),e.parentNode.insertBefore(i,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${DRAG_TEXT_CLASS}`).outerHTML=""),i},createSROnlyStatus=e=>{const t=document.createElement("div"),a=getItemsLabel(e),i=e.closest(DROPZONE),s=e.closest(`.${TARGET_CLASS}`);DEFAULT_FILE_STATUS_TEXT=`No ${a} selected.`,t.classList.add("usa-sr-only"),t.setAttribute("aria-live","polite"),t.textContent=DEFAULT_FILE_STATUS_TEXT,i.insertBefore(t,s)},enhanceFileInput=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),a=createTargetArea(e),i=createVisibleInstructions(e),{dropZoneEl:s}=getFileInputContext(e);return t?s.classList.add(DISABLED_CLASS):createSROnlyStatus(e),{instructions:i,dropTarget:a}},removeOldPreviews=(e,t)=>{const a=e.querySelectorAll(`.${PREVIEW_CLASS}`),i=e.querySelector(`.${PREVIEW_HEADING_CLASS}`),s=e.querySelector(`.${ACCEPTED_FILE_MESSAGE_CLASS}`);i&&(i.outerHTML=""),s&&(s.outerHTML="",e.classList.remove("has-invalid-file")),null!==a&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(a,(e=>{e.parentNode.removeChild(e)})))},updateStatusMessage=(e,t,a)=>{const i=e;let s=DEFAULT_FILE_STATUS_TEXT;1===t.length?s=`You have selected the file: ${a}`:t.length>1&&(s=`You have selected ${t.length} files: ${a.join(", ")}`),setTimeout((()=>{i.textContent=s}),1e3)},addPreviewHeading=(e,t)=>{const a=document.createElement("div"),i=e.closest(`.${TARGET_CLASS}`),s=i.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"),a.classList.add(PREVIEW_HEADING_CLASS),a.innerHTML=n,i.insertBefore(a,s),e.setAttribute("aria-label",o)},handleChange=(e,t,a,i)=>{const s=t.getAttribute("multiple")?e.target.files:[e.target.files[0]],o=i.closest(`.${DROPZONE_CLASS}`).querySelector(".usa-sr-only"),n=[];removeOldPreviews(i,a);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)),a.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=i.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,a,i)=>{const s=t.getAttribute("accept");i.classList.remove("has-invalid-file");const o=(e,t)=>{let a=!1;return e.indexOf(t)>=0&&(a=!0),a};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 a=n[e];if(l=t.name.indexOf(a)>0||o(t.type,a.replace(/\*/g,"")),l){TYPE_IS_VALID=!0;break}}}l||(removeOldPreviews(i,a),t.value="",i.insertBefore(r,t),r.textContent=t.dataset.errormessage||"This is not a valid file type.",r.classList.add(ACCEPTED_FILE_MESSAGE_CLASS),i.classList.add("has-invalid-file"),TYPE_IS_VALID=!1,e.preventDefault(),e.stopPropagation())}},handleUpload=(e,t,a,i)=>{preventInvalidFiles(e,t,a,i),!0===TYPE_IS_VALID&&handleChange(e,t,a,i)},fileInput={init(e){selectOrMatches(DROPZONE,e).forEach((e=>{const{instructions:t,dropTarget:a}=enhanceFileInput(e);a.addEventListener("dragover",(function(){this.classList.add(DRAG_CLASS)}),!1),a.addEventListener("dragleave",(function(){this.classList.remove(DRAG_CLASS)}),!1),a.addEventListener("drop",(function(i){i.preventDefault(),this.classList.remove(DRAG_CLASS);const s=i.dataTransfer;if(i.target.files=s.files,s.files.length>1)return;handleUpload(i,e,t,a);const o=new CustomEvent("change",{detail:{files:s.files}});e.dispatchEvent(o)}),!1),e.addEventListener("input",(i=>handleUpload(i,e,t,a)),!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", "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(.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}',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.defaultUploadMessage=h("span",null,"Drag a file here or"," ",h("span",{class:"file-input-choose-text"},"choose from folder")),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.")}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 a=Math.floor(Math.log(e)/Math.log(1024));return 0===a?`${e} ${t[a]}`:`${(e/Math.pow(1024,a)).toFixed(a<2?0:1)} ${t[a]}`},this.normalizeAcceptProp=e=>e.split(",").map((e=>(e=e.trim()).startsWith(".")?extensionToMimeType[e]:e)),this.isAcceptedFileType=(e,t)=>{for(const a of t){if(a===e)return!0;if(a.endsWith("/*")&&e.startsWith(a.slice(0,-1)))return!0}return!1},this.renderLabelOrHeader=(e,t,a)=>{const i=t?h("span",{class:"required"}," ",instance.t("required")):null;return h("div",{class:"label-header"},a&&a>=1&&a<=6?h(`h${a}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,i):h("label",{htmlFor:"fileInputField",part:"label",class:"usa-label"},e,i))},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=this.defaultUploadMessage,this.enableAnalytics=!1,this.headerSize=void 0,this.headless=!1,this.readOnly=!1,this.uploadedFile=void 0}handleValueChange(e){setTimeout((()=>{this.updateStatusMessage(e)}))}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)}render(){const{label:e,name:t,required:a,accept:i,error:s,hint:o,file:n,uploadStatus:r,headerSize:l,fileContents:d,fileType:c,headless:f,value:p,readOnly:u,statusText:m,uploadedFile:b}=this;p&&!this.file&&this.handleFile(p,!1);const g=this.error||this.internalError,v=`${o?"input-hint-message":""} ${g?"input-error-message":""}`.trim()||null,E=("file-input-target "+(g?"file-input-target-error":"")).trim();let S=h("div",{key:"496a83db888503a529906a71f0576477c01247d8",class:"thumbnail-container"},h("svg",{key:"d9e84288a3a9f83b5821424a7d931d764f71251a",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"#07648d",width:"40px",height:"40px"},h("path",{key:"1995dddaca15435c338347bf5beb95367c6cba0c",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?S=h("div",{key:"d35d609122919da7d11c778121da54214a2f4c5f",class:"thumbnail-container"},h("va-icon",{key:"56f4e2b6529a36c3ae9251baf6a70398e194f69e",icon:"error",size:3,class:"thumbnail-preview thumbnail-error"})):d&&(c.startsWith("image/")?S=h("div",{key:"2dd2a777bf05a24713f48498ada5d94fa158bba3",class:"thumbnail-container","aria-hidden":"true"},h("img",{key:"400d3c6c1535f0149b049ad85e9a337c858cb4a8",class:"thumbnail-preview",src:d,alt:"image"})):"application/pdf"===c&&(S=h("div",{key:"774ee2e461079defd6fefa99bdddf0d6cff3ca35",class:"thumbnail-container","aria-hidden":"true"},h("object",{key:"226df8e35e81dee2e3105dd6158a49cf7948e2fa",class:"thumbnail-preview",data:d,type:"application/pdf"}))));let A=f?"headless-selected-files-wrapper":"selected-files-wrapper";const _="usa-hint"+(f?" usa-sr-only":"");return this.uploadMessage||(this.uploadMessage=this.defaultUploadMessage),h(Host,{key:"820a69fa6a590f4a55c5dd3de6e378e649c4db28",class:{"has-error":!!g}},!u&&h("span",{key:"a647092bdb331aa18462b9463b8284721eef77bd",class:{"usa-sr-only":!!f}},e&&this.renderLabelOrHeader(e,a,l)),o&&!u&&h("div",{key:"eca7741f326bc8b167fc275eb1183e46382e08cc",class:_,id:"input-hint-message"},o),h("div",{key:"5c26ade4064d147b28e29754b97f42c472aaea5b",class:"file-input-wrapper",onDrop:this.handleDrop},h("input",{key:"dadd634971b22f2553af42006eb4ae1af2c30f5a",id:"fileInputField",class:"file-input",style:{visibility:"success"===this.uploadStatus||b?"hidden":"unset"},type:"file",ref:e=>this.fileInputRef=e,name:t,accept:i,"aria-describedby":v,onChange:this.handleChange}),"idle"===r&&!b&&h("div",{key:"07af61756a4b80bc4706b8ed31a603ca1ab25d4e"},h("span",{key:"e828be34d1814546f9a529872a9a108f1ea40334",id:"file-input-error-alert",role:"alert"},g&&h(Fragment,{key:"a91d50734a6d9752d28e3b081d746695d0c784b0"},h("span",{key:"1c329986e7d9a6f0b90caa0d80b8ef364f0e55ff",class:"usa-sr-only"},instance.t("error")),h("span",{key:"385cab81a1e3465ca02da5b6c7a09a7942db10af",class:"usa-error-message"},g))),h("div",{key:"144601a5d993f8284f8ca8792c7fd5a3c09f1bbc",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("div",{key:"30aaacf21e81bd3f8b1597311efc1ec1087526e1",class:E},h("div",{key:"ebffb6ed87acc46144c30367fcc013b06af92494",class:"file-input-box"}),h("div",{key:"ad86c94326c2ffd8f6199cb2f5c935e03e4f762c",class:"file-input-instructions"},this.uploadMessage))),("idle"!==r||b)&&h("div",{key:"5e4a6489c911d0878dca78fad93fdb1d10507abf",class:A},!f&&h("div",{key:"89a2cd4a71c9c156d9417cba8bae9f38fe767d41",class:"selected-files-label"},u?"Files you uploaded":"Selected files"),h("div",{key:"9b9b2c0fc4dca8ade39f69af3e005c670a51c371",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("va-card",{key:"d75735d2691f1a3e4102595e5e83ec96af3fb767",class:"va-card"},h("div",{key:"784fff5ce44056669d6f4b15f87507b635e2d6d1",class:"file-info-section"},S,h("div",{key:"e4f35d1b01d3ee78bed4fbd29e15deb1c1eb8af3",class:"file-info-group vads-u-line-height--2"},h("span",{key:"7baab14912f62d7223ce2dd9ecfca8ce885a64e1",class:"file-label"},n?n.name:b.name),g&&h("span",{key:"8f6e15f8dabad3adf16b880d5f6ec37c7dcb96c0",id:"input-error-message",role:"alert"},h("span",{key:"32756cf9cff0d04e23e43dc5149c86df94de9ba6",class:"usa-sr-only"},instance.t("error")),h("span",{key:"40cd353100dfc6f5f25c36c2ee65e4ed21afcc83",class:"usa-error-message"},g)),h("span",{key:"6435ef4a8624723b95c0661baa324a2d5039892a",class:"file-size-label"},this.formatFileSize(n?n.size:b.size)),h("span",{key:"8cedd9443a11454cb3ba6307e3bf5329dd06b1db",class:"file-status-label","aria-live":"polite"},m))),(n||p||b)&&h("div",{key:"7bd3225a8b536cda2e38e92521b53a3d021e3fc6"},this.showSeparator&&h("hr",{key:"56107c7b5becd3900ac2463a36a11d0ba219d45b",class:"separator"}),h("div",{key:"e4cf046dead718fadb0242b75b4c980d25ea2fa0",class:"additional-info-slot"},h("slot",{key:"8da5534d2f8361a5c668bb50f8db67f2e217f876"})),!u&&h(Fragment,{key:"bd303615d89ff1648d7da379bbaf54091f63ce6d"},h("div",{key:"91afa558e0a478e409e0136be8c762f80c5d76c3",class:"file-button-section"},h("va-button-icon",{key:"247b4720e13d996d520fd656f1ef5a99c96cde19",buttonType:"change-file",onClick:this.changeFile,label:"Change file","aria-label":`change file ${n?n.name:b.name}`}),h("va-button-icon",{key:"9998c86585ad9a04461e67f3c724bef8b7185f37",buttonType:"delete",onClick:this.openModal,"aria-label":`delete file ${n?n.name:b.name}`,label:"Delete"})),h("va-modal",{key:"63ac1ca9bd72cfd6a7b38816edeec4030f80230a",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",{key:"65e10cce39682618bc72a039f03865c3cdac821b",class:"file-label"},n?n.name:b.name))))))))}get el(){return this}static get watchers(){return{statusText:["handleValueChange"]}}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],file:[32],fileContents:[32],internalError:[32],showModal:[32],showSeparator:[32]},void 0,{statusText:["handleValueChange"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-file-input","va-button","va-button-icon","va-card","va-icon","va-modal"].forEach((e=>{switch(e){case"va-file-input":customElements.get(e)||customElements.define(e,VaFileInput);break;case"va-button":customElements.get(e)||defineCustomElement$5();break;case"va-button-icon":customElements.get(e)||defineCustomElement$4();break;case"va-card":customElements.get(e)||defineCustomElement$3();break;case"va-icon":customElements.get(e)||defineCustomElement$2();break;case"va-modal":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:"0dfe9ac8486aaea23a6250fbff2033442006a13e",role:"banner"},h("va-official-gov-banner",{key:"bcf7039e35f70294cf59ce4f8d78c532336563f0"}),h("va-crisis-line-modal",{key:"16ead2df61a8070f70a4f5fab0b1f4a299f465a0"}),h("div",{key:"dbc00c626ea1250570cb1cc9a1d1e1fe1815edc8",onFocusin:()=>this.trapFocus(),class:"va-header"},h("a",{key:"e3d3167dbafd1fecbc0fb3f819c309424ef02c8c",href:"/",title:"Go to VA.gov",class:"va-logo-link"},h("img",{key:"d3dc72842e8770da72e06ebf198000ed278fed88",class:"va-logo",src:vaSealSvg,alt:"VA logo and Seal, U.S. Department of Veterans Affairs"})),h("div",{key:"0ff41815c599864a9435b34faa827b90cb0d3a51",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:"fff5c9525f45d3b13e713faf38ca5f23d230ad3c",role:"banner"},h("va-official-gov-banner",{key:"5409c9abd6843ad2e5545b58e4850743ec44691a"}),h("va-crisis-line-modal",{key:"ca53e041c36ac2f4e1b8dd034fc88fb3d9080a54"}),h("div",{key:"69fe758673c1d0be65ead8a07d2f825b11929b8b",onFocusin:()=>this.trapFocus(),class:"va-header"},h("a",{key:"0534d9a723cad8a34a6a475840bcb0bf7687d361",href:"/",title:"Go to VA.gov",class:"va-logo-link"},h("img",{key:"7b5bf670fc3cc7421028176b2e69cbcdf295f41f",class:"va-logo",src:vaSealSvg,alt:"VA logo and Seal, U.S. Department of Veterans Affairs"})),h("div",{key:"0482797d5f9680874d580b21d9de84524a3ab3e0",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:"cb454d092cd78fb71bf1167a4e387ad9fd416d69"},h("svg",{key:"e82fb46722673b1dc3d22bb854cd135f7fa93b08",class:s,"aria-labelledby":i?"icon-title":null,"aria-hidden":i?null:"true",focusable:"false",role:"img"},i&&h("title",{key:"c1c7b442de1eea21a2fabe4376d57f19833535d3",id:"icon-title"},i),h("use",{key:"8435ef0fb1a54d143c2820d9fe895dc5279cd803",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:"44c6167ae6d70ecbd3cb552e896ecb7926642f8c"},h("svg",{key:"34cc78499de815dc46692f86144f8524cc9c8fa2",class:s,"aria-labelledby":i?"icon-title":null,"aria-hidden":i?null:"true",focusable:"false",role:"img"},i&&h("title",{key:"2f168aaa28f610c147ed78c198065a175bad16d9",id:"icon-title"},i),h("use",{key:"01f31d67a6ac76097fc718b144ba739025e23fba",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 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}:host div va-link.is-current-lang{font-weight:var(--font-weight-bold)}",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:"1ff0b40d3a954638107042c016b8a4a6b823a98b"},h("div",{key:"0b483d200c3e556aef36a88b9ac855069f85769b"},t.map((({href:a,lang:n,label:s},l)=>{const i=classnames({"is-current-lang":n===e}),o=classnames({"inner-div":l<t.length-1});return h("div",{class:o},h("va-link",{class:i,href:a,language:n,onClick:e=>this.handleToggle(e,n,s),text:s,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 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}:host div va-link.is-current-lang{font-weight:var(--font-weight-bold)}",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:"d5131a0ff95d1ceb34493800f5a00f5f45b9176d"},h("div",{key:"183b96e321bf1d31985d4c69036ae8aaad0ddff5"},t.map((({href:a,lang:n,label:s},l)=>{const i=classnames({"is-current-lang":n===e}),o=classnames({"inner-div":l<t.length-1});return h("div",{class:o},h("va-link",{class:i,href:a,language:n,onClick:e=>this.handleToggle(e,n,s),text:s,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 +1 @@
1
- import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$2}from"./va-icon2.js";const vaLinkActionCss="/* From the USWDS styles: */\n/* https://github.com/uswds/uswds/blob/3dc296ec56cd621fe52d918701fd94621d96a198/src/stylesheets/core/mixins/_focus.scss#L12-L13 */\nbutton:not([disabled]):focus,\nselect:not([disabled]):focus,\na:not([disabled]):focus,\nh1:focus,\ninput:not([disabled]):focus,\ntextarea:not([disabled]):focus,\n#form-question\n[role='option']:focus,\n*[tabindex]:focus {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n}\n\n\na {\n text-decoration: none;\n color: var(--vads-color-link);\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\na:hover {\n background-color: rgba(0, 0, 0, 0.05);\n color: inherit;\n}\n\na:visited {\n color: var(--vads-color-link-visited);\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute !important;\n width: 1px;\n /* Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1241631 */\n word-wrap: normal !important;\n}\n\n\n:host {\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n\n:host a {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: start;\n align-items: flex-start;\n cursor: pointer;\n text-decoration: underline;\n font-weight: 700;\n font-size: 1.06rem;\n padding: 0.5rem 0;\n &:active {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n }\n}\n\n:host a.va-link--primary,\n:host a.va-link--secondary {\n &:hover, &:active {\n color: var(--vads-color-link) !important;\n }\n}\n\n:host a.va-link--reverse {\n color: var(--vads-color-white);\n\n &:hover, &:active {\n color: var(--vads-color-action-focus-on-light);\n background-color: transparent;\n }\n}\n\n:host a.va-link--reverse va-icon {\n &:hover, &:active {\n background-color: var(--vads-color-action-focus-on-light);\n }\n}\n\n.link-icon--left {\n margin-right: 8px;\n vertical-align: baseline;\n position: relative;\n}\n\n.link-icon {\n border-radius: 50%;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n color: white;\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\n.va-link--primary {\n va-icon {\n background-color: var(--vads-color-success-dark);\n }\n}\n\n.va-link--secondary {\n va-icon {\n background-color: var(--vads-color-primary);\n }\n}\n\n.link-icon--reverse {\n background-color: var(--vads-color-white);\n color: var(--vads-color-black);\n}\n\n:host a.va-link--reverse:hover va-icon,\n:host a.va-link--reverse:active va-icon {\n background-color: var(--vads-color-action-focus-on-light) !important;\n}\n\n.link-text {\n display: inline-block;\n vertical-align: top;\n max-width: calc(100% - 24px);\n white-space: pre-wrap;\n}",VaLinkActionStyle0=vaLinkActionCss,VaLinkAction$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=n=>{if(!this.disableAnalytics){const n={componentName:"va-link-action",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(n)}},this.disableAnalytics=!1,this.href=void 0,this.text=void 0,this.messageAriaDescribedby=void 0,this.type="primary",this.label=void 0,this.isSingleLine=!0}componentWillLoad(){this.checkTextLines()}checkTextLines(){if(this.linkRef){const n=getComputedStyle(this.linkRef),i=parseFloat(n.lineHeight),e=this.linkRef.clientHeight;this.isSingleLine=e<=i}}render(){const{handleClick:n,href:i,text:e,messageAriaDescribedby:o,type:t,label:a}=this,s=classnames({"va-link--reverse":"reverse"===t,"va-link--primary":"primary"===t,"va-link--secondary":"secondary"===t}),r=classnames("link-icon--left","link-icon",{"link-icon--reverse":"reverse"===t});return h(Host,{key:"e31764692d2f8115d9aeb57e49a9d7a84273f7aa"},h("a",{key:"07b8817436505730f6cf136cfcfdd1ed10675a03",href:i,class:s,"aria-label":a,"aria-describedby":o?"link-description":null,onClick:n,ref:n=>this.linkRef=n},h("va-icon",{key:"de34e7195412bd4980a27ad79a7c7f82e5e75a04",class:r,icon:"chevron_right",size:3}),h("span",{key:"949dd1af555b1526340cccf35eef1c78eb635b36",class:"link-text"},e)),o&&h("span",{key:"a888058e2d4b04ce916350699689c0b94d046752",id:"link-description",class:"sr-only"},o))}static get watchers(){return{text:["checkTextLines"]}}static get style(){return VaLinkActionStyle0}},[1,"va-link-action",{disableAnalytics:[4,"disable-analytics"],href:[1],text:[1],messageAriaDescribedby:[1,"message-aria-describedby"],type:[1],label:[1],isSingleLine:[32]},void 0,{text:["checkTextLines"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-link-action","va-icon"].forEach((n=>{switch(n){case"va-link-action":customElements.get(n)||customElements.define(n,VaLinkAction$1);break;case"va-icon":customElements.get(n)||defineCustomElement$2()}}))}const VaLinkAction=VaLinkAction$1,defineCustomElement=defineCustomElement$1;export{VaLinkAction,defineCustomElement};
1
+ import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$2}from"./va-icon2.js";const vaLinkActionCss="/* From the USWDS styles: */\n/* https://github.com/uswds/uswds/blob/3dc296ec56cd621fe52d918701fd94621d96a198/src/stylesheets/core/mixins/_focus.scss#L12-L13 */\nbutton:not([disabled]):focus,\nselect:not([disabled]):focus,\na:not([disabled]):focus,\nh1:focus,\ninput:not([disabled]):focus,\ntextarea:not([disabled]):focus,\n#form-question\n[role='option']:focus,\n*[tabindex]:focus {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n}\n\n\na {\n text-decoration: none;\n color: var(--vads-color-link);\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\na:hover {\n background-color: rgba(0, 0, 0, 0.05);\n color: inherit;\n}\n\na:visited {\n color: var(--vads-color-link-visited);\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute !important;\n width: 1px;\n /* Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1241631 */\n word-wrap: normal !important;\n}\n\n\n:host {\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n\n:host a {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: start;\n align-items: flex-start;\n cursor: pointer;\n text-decoration: underline;\n font-weight: 700;\n font-size: 1.06rem;\n padding: 0.5rem 0;\n &:active {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n }\n}\n\n:host a.va-link--primary,\n:host a.va-link--secondary {\n &:hover, &:active {\n color: var(--vads-color-link) !important;\n }\n}\n\n:host a.va-link--reverse {\n color: var(--vads-color-white);\n\n &:hover, &:active {\n color: var(--vads-color-action-focus-on-light);\n background-color: transparent;\n }\n}\n\n:host a.va-link--reverse va-icon {\n &:hover, &:active {\n background-color: var(--vads-color-action-focus-on-light);\n }\n}\n\n.link-icon--left {\n margin-right: 8px;\n vertical-align: baseline;\n position: relative;\n}\n\n.link-icon {\n border-radius: 50%;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n color: white;\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\n.va-link--primary {\n va-icon {\n background-color: var(--vads-color-success-dark);\n }\n}\n\n.va-link--secondary {\n va-icon {\n background-color: var(--vads-color-primary);\n }\n}\n\n.link-icon--reverse {\n background-color: var(--vads-color-white);\n color: var(--vads-color-black);\n}\n\n:host a.va-link--reverse:hover va-icon,\n:host a.va-link--reverse:active va-icon {\n background-color: var(--vads-color-action-focus-on-light) !important;\n}\n\n.link-text {\n display: inline-block;\n vertical-align: top;\n max-width: calc(100% - 24px);\n white-space: pre-wrap;\n}",VaLinkActionStyle0=vaLinkActionCss,VaLinkAction$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=n=>{if(!this.disableAnalytics){const n={componentName:"va-link-action",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(n)}},this.disableAnalytics=!1,this.href=void 0,this.text=void 0,this.messageAriaDescribedby=void 0,this.type="primary",this.label=void 0,this.isSingleLine=!0}componentWillLoad(){this.checkTextLines()}checkTextLines(){if(this.linkRef){const n=getComputedStyle(this.linkRef),i=parseFloat(n.lineHeight),e=this.linkRef.clientHeight;this.isSingleLine=e<=i}}render(){const{handleClick:n,href:i,text:e,messageAriaDescribedby:o,type:t,label:a}=this,s=classnames({"va-link--reverse":"reverse"===t,"va-link--primary":"primary"===t,"va-link--secondary":"secondary"===t}),r=classnames("link-icon--left","link-icon",{"link-icon--reverse":"reverse"===t});return h(Host,{key:"3b7c269f90ff125a13306b97b5ea8e15d37043f1"},h("a",{key:"adfba83d9529085a343c0b897c8b4b821b2159b8",href:i,class:s,"aria-label":a,"aria-describedby":o?"link-description":null,onClick:n,ref:n=>this.linkRef=n},h("va-icon",{key:"a2cf89e37c3cf163bfb3ef60b130c3b8e78acca7",class:r,icon:"chevron_right",size:3}),h("span",{key:"be915e95d8ef093f877d9dcbf1bc0046b6146363",class:"link-text"},e)),o&&h("span",{key:"a899b04f238cc2244d574d4e2131edb294bf55d8",id:"link-description",class:"sr-only"},o))}static get watchers(){return{text:["checkTextLines"]}}static get style(){return VaLinkActionStyle0}},[1,"va-link-action",{disableAnalytics:[4,"disable-analytics"],href:[1],text:[1],messageAriaDescribedby:[1,"message-aria-describedby"],type:[1],label:[1],isSingleLine:[32]},void 0,{text:["checkTextLines"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-link-action","va-icon"].forEach((n=>{switch(n){case"va-link-action":customElements.get(n)||customElements.define(n,VaLinkAction$1);break;case"va-icon":customElements.get(n)||defineCustomElement$2()}}))}const VaLinkAction=VaLinkAction$1,defineCustomElement=defineCustomElement$1;export{VaLinkAction,defineCustomElement};
@@ -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$1}from"./va-icon2.js";const vaLinkCss='p,a,ol,ul,li,dl,dt,dd,form,label,button{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.5}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}a{text-decoration:none;color:var(--vads-color-link);-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:color, background-color, border-color;transition-property:color, background-color, border-color}a:hover{background-color:rgba(0, 0, 0, 0.05);color:inherit}a:visited{color:var(--vads-color-link-visited)}.usa-sr-only{position:absolute;left:-999em;right:auto}:host{display:inline}:host([href]:focus){outline:none !important}:host a{cursor:pointer;text-decoration:underline;font:inherit}:host a.va-link--reverse,:host a.va-link--reverse .link-icon--back{color:var(--vads-color-white)}:host a.va-link--reverse:hover,:host a.va-link--reverse:active,:host a.va-link--reverse:hover .link-icon--back,:host a.va-link--reverse:active .link-icon--back,:host a.va-link--reverse .link-icon--back:hover,:host a.va-link--reverse .link-icon--back:active,:host a.va-link--reverse .link-icon--back:hover .link-icon--back,:host a.va-link--reverse .link-icon--back:active .link-icon--back{color:var(--vads-color-action-focus-on-light);background-color:transparent}:host([active]:not([active=false])) a{font-weight:700}:host([icon-name]) va-icon{margin-right:4px}.link-icon--active{vertical-align:baseline;position:relative;top:3px}.link-icon--left{margin-right:4px;vertical-align:baseline;position:relative;top:3px}.link-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.link-icon--back{color:var(--vads-color-gray-medium);-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:color, background-color, border-color;transition-property:color, background-color, border-color}.link--center{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}dfn{font-style:normal}abbr{text-decoration:none}.external-link-icon{margin-left:4px}',VaLinkStyle0=vaLinkCss,VaLink=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=e=>{if(!this.disableAnalytics){const e={componentName:"va-link",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(e)}},this.getAbbreviationTitle=()=>{const{abbrTitle:e,filetype:i}=this;return"PDF"===i?"Portable Document Format":e},this.abbrTitle=void 0,this.active=!1,this.back=!1,this.calendar=!1,this.channel=!1,this.disableAnalytics=!1,this.download=!1,this.href=void 0,this.filename=void 0,this.filetype=void 0,this.pages=void 0,this.text=void 0,this.video=!1,this.reverse=!1,this.external=!1,this.label=null,this.iconName=null,this.iconSize=3,this.language=void 0}render(){const{active:e,back:i,calendar:n,channel:o,download:t,filetype:a,filename:l,getAbbreviationTitle:r,handleClick:s,href:c,pages:d,text:u,video:v,reverse:b,external:k,iconName:f,iconSize:m,language:p}=this,g=classnames({"va-link--reverse":b,"link--center":f||k});if(e)return h(Host,null,h("a",{href:c,class:g,onClick:s,"aria-label":this.label},u,h("va-icon",{class:"link-icon--active",icon:"chevron_right"})));if(i){const e=h("va-icon",{icon:"arrow_back",class:"link-icon--left link-icon--back"});return h(Host,null,h("div",{class:"link-container"},e,h("a",{href:c,class:g,onClick:s,"aria-label":this.label},u)))}if(o||v)return h(Host,null,h("a",{href:c,class:g,onClick:s,rel:"noopener",target:"_blank"},h("va-icon",{class:"link-icon--left",icon:o?"youtube":"play_circle"}),u," ",h("dfn",null,o?"YouTube":"on YouTube")));if(n)return h(Host,null,h("a",{href:c,class:g,download:l,onClick:s},h("va-icon",{class:"link-icon--left",icon:"calendar_today"}),u));if(t)return h(Host,null,h("a",{href:c,class:g,download:l,onClick:s},h("va-icon",{class:"link-icon--left",icon:"file_download"}),u," ",a&&h("dfn",null,"(",h("abbr",{title:r()},a),d&&`, ${d} pages`,")")));if(f)return h(Host,null,h("a",{href:c,class:g,onClick:s},h("va-icon",{icon:f,size:m,part:"icon"}),u));if(k)return h(Host,null,h("a",{href:c,rel:"noreferrer",class:g,onClick:s,target:"_blank"},u," (opens in a new tab)",h("span",{class:"usa-sr-only"},"opens in a new tab")));const y=p||null;return h(Host,null,h("a",{href:c,class:g,onClick:s,"aria-label":this.label,part:"anchor",lang:y,hrefLang:y},u))}static get style(){return VaLinkStyle0}},[1,"va-link",{abbrTitle:[1,"abbr-title"],active:[516],back:[4],calendar:[4],channel:[4],disableAnalytics:[4,"disable-analytics"],download:[4],href:[1],filename:[1],filetype:[1],pages:[2],text:[1],video:[4],reverse:[4],external:[4],label:[1],iconName:[1,"icon-name"],iconSize:[2,"icon-size"],language:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-link","va-icon"].forEach((e=>{switch(e){case"va-link":customElements.get(e)||customElements.define(e,VaLink);break;case"va-icon":customElements.get(e)||defineCustomElement$1()}}))}export{VaLink as V,defineCustomElement as d};
1
+ import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$1}from"./va-icon2.js";const vaLinkCss='p,a,ol,ul,li,dl,dt,dd,form,label,button{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.5}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}a{text-decoration:none;color:var(--vads-color-link);-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:color, background-color, border-color;transition-property:color, background-color, border-color}a:hover{background-color:rgba(0, 0, 0, 0.05);color:inherit}a:visited{color:var(--vads-color-link-visited)}.usa-sr-only{position:absolute;left:-999em;right:auto}:host{display:inline}:host([href]:focus){outline:none !important}:host a{cursor:pointer;text-decoration:underline;font:inherit}:host a.va-link--reverse,:host a.va-link--reverse .link-icon--back{color:var(--vads-color-white)}:host a.va-link--reverse:hover,:host a.va-link--reverse:active,:host a.va-link--reverse:hover .link-icon--back,:host a.va-link--reverse:active .link-icon--back,:host a.va-link--reverse .link-icon--back:hover,:host a.va-link--reverse .link-icon--back:active,:host a.va-link--reverse .link-icon--back:hover .link-icon--back,:host a.va-link--reverse .link-icon--back:active .link-icon--back{color:var(--vads-color-action-focus-on-light);background-color:transparent}:host([active]:not([active=false])) a{font-weight:700}:host([icon-name]) va-icon{margin-right:4px}.link-icon--active{vertical-align:baseline;position:relative;top:3px}.link-icon--left{margin-right:4px;vertical-align:baseline;position:relative;top:3px}.link-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.link-icon--back{color:var(--vads-color-gray-medium);-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:color, background-color, border-color;transition-property:color, background-color, border-color}.link--center{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}dfn{font-style:normal}abbr{text-decoration:none}.external-link-icon{margin-left:4px}',VaLinkStyle0=vaLinkCss,VaLink=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=e=>{if(!this.disableAnalytics){const e={componentName:"va-link",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(e)}},this.getAbbreviationTitle=()=>{const{abbrTitle:e,filetype:i}=this;return"PDF"===i?"Portable Document Format":e},this.abbrTitle=void 0,this.active=!1,this.back=!1,this.calendar=!1,this.channel=!1,this.disableAnalytics=!1,this.download=!1,this.href=void 0,this.filename=void 0,this.filetype=void 0,this.pages=void 0,this.text=void 0,this.video=!1,this.reverse=!1,this.external=!1,this.label=null,this.iconName=null,this.iconSize=3,this.language=void 0}render(){const{active:e,back:i,calendar:n,channel:o,download:t,filetype:a,filename:l,getAbbreviationTitle:r,handleClick:s,href:c,pages:d,text:u,video:v,reverse:b,external:k,iconName:f,iconSize:m,language:p,label:g}=this,y=classnames({"va-link--reverse":b,"link--center":f||k});if(e)return h(Host,null,h("a",{href:c,class:y,onClick:s,"aria-label":g},u,h("va-icon",{class:"link-icon--active",icon:"chevron_right"})));if(i){const e=h("va-icon",{icon:"arrow_back",class:"link-icon--left link-icon--back"});return h(Host,null,h("div",{class:"link-container"},e,h("a",{href:c,class:y,onClick:s,"aria-label":g},u)))}if(o||v)return h(Host,null,h("a",{href:c,class:y,"aria-label":g,onClick:s,rel:"noopener",target:"_blank"},h("va-icon",{class:"link-icon--left",icon:o?"youtube":"play_circle"}),u," ",h("dfn",null,o?"YouTube":"on YouTube")));if(n)return h(Host,null,h("a",{href:c,class:y,download:l,"aria-label":g,onClick:s},h("va-icon",{class:"link-icon--left",icon:"calendar_today"}),u));if(t)return h(Host,null,h("a",{href:c,class:y,download:l,"aria-label":g,onClick:s},h("va-icon",{class:"link-icon--left",icon:"file_download"}),u," ",a&&h("dfn",null,"(",h("abbr",{title:r()},a),d&&`, ${d} pages`,")")));if(f)return h(Host,null,h("a",{href:c,class:y,"aria-label":g,onClick:s},h("va-icon",{icon:f,size:m,part:"icon"}),u));if(k)return h(Host,null,h("a",{href:c,rel:"noreferrer",class:y,onClick:s,"aria-label":g,target:"_blank"},u," (opens in a new tab)",h("span",{class:"usa-sr-only"},"opens in a new tab")));const x=p||null;return h(Host,null,h("a",{href:c,class:y,onClick:s,"aria-label":g,part:"anchor",lang:x,hrefLang:x},u))}static get style(){return VaLinkStyle0}},[1,"va-link",{abbrTitle:[1,"abbr-title"],active:[516],back:[4],calendar:[4],channel:[4],disableAnalytics:[4,"disable-analytics"],download:[4],href:[1],filename:[1],filetype:[1],pages:[2],text:[1],video:[4],reverse:[4],external:[4],label:[1],iconName:[1,"icon-name"],iconSize:[2,"icon-size"],language:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-link","va-icon"].forEach((e=>{switch(e){case"va-link":customElements.get(e)||customElements.define(e,VaLink);break;case"va-icon":customElements.get(e)||defineCustomElement$1()}}))}export{VaLink as V,defineCustomElement as d};
@@ -1 +1 @@
1
- import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";var isChromatic=function(t){const e=t||"undefined"!=typeof window&&window;return!(!e||!e.navigator.userAgent.match(/Chromatic/)&&!e.location.href.match(/chromatic=true/))};const vaLoadingIndicatorCss=":host{display:block;font-size:1.06rem;text-align:center}.loading-indicator{display:block;height:4rem;margin-top:1rem}.loading-indicator:after{content:' ';display:inline-block;width:2.1875rem;height:2.1875rem;margin:1px;border-radius:50%;border:8px solid var(--vads-color-primary);border-color:var(--vads-color-primary) transparent var(--vads-color-primary)\n transparent;-webkit-animation:spin 1.5s linear infinite;animation:spin 1.5s linear infinite}.loading-indicator.chromatic:after{-webkit-animation:none;animation:none}.loading-indicator:focus{outline:none}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}",VaLoadingIndicatorStyle0=vaLoadingIndicatorCss,VaLoadingIndicator$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.loadingStartTime=null,this.observer=null,this.message=void 0,this.label="Loading",this.setFocus=!1,this.enableAnalytics=!1}componentDidLoad(){this.setFocus&&this.spinner&&this.spinner.focus(),this.loadingStartTime=Date.now();const t=this.el.parentNode;this.observer=new MutationObserver((e=>{for(const i of e)if("childList"===i.type){const e=Array.from(i.removedNodes.values()).filter((t=>{var e;return"va-loading-indicator"===(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())})).length>0;if(this.enableAnalytics&&e){const e=new CustomEvent("component-library-analytics",{bubbles:!0,composed:!0,detail:{componentName:"va-loading-indicator",action:"displayed",details:{displayTime:Date.now()-this.loadingStartTime,message:this.message}}});t.dispatchEvent(e)}}})),this.observer.observe(t,{childList:!0})}render(){const{message:t,label:e}=this;let i="loading-indicator";return isChromatic()&&(i+=" chromatic"),h(Host,{key:"f4478073f996319d0098ef203cbf751d5c0e7a7f","aria-live":"polite"},h("div",{key:"fe2a5bace94092363623df699b4043474e3218a2",ref:t=>this.spinner=t,class:i,role:"progressbar","aria-label":e,"aria-valuetext":t,tabindex:"-1"}),t)}get el(){return this}static get style(){return VaLoadingIndicatorStyle0}},[1,"va-loading-indicator",{message:[1],label:[1],setFocus:[4,"set-focus"],enableAnalytics:[4,"enable-analytics"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-loading-indicator"].forEach((t=>{"va-loading-indicator"===t&&(customElements.get(t)||customElements.define(t,VaLoadingIndicator$1))}))}const VaLoadingIndicator=VaLoadingIndicator$1,defineCustomElement=defineCustomElement$1;export{VaLoadingIndicator,defineCustomElement};
1
+ import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";var isChromatic=function(t){const e=t||"undefined"!=typeof window&&window;return!(!e||!e.navigator.userAgent.match(/Chromatic/)&&!e.location.href.match(/chromatic=true/))};const vaLoadingIndicatorCss=":host{display:block;font-size:1.06rem;text-align:center}.loading-indicator{display:block;height:4rem;margin-top:1rem}.loading-indicator:after{content:' ';display:inline-block;width:2.1875rem;height:2.1875rem;margin:1px;border-radius:50%;border:8px solid var(--vads-color-primary);border-color:var(--vads-color-primary) transparent var(--vads-color-primary)\n transparent;-webkit-animation:spin 1.5s linear infinite;animation:spin 1.5s linear infinite}.loading-indicator.chromatic:after{-webkit-animation:none;animation:none}.loading-indicator:focus{outline:none}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}",VaLoadingIndicatorStyle0=vaLoadingIndicatorCss,VaLoadingIndicator$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.loadingStartTime=null,this.observer=null,this.message=void 0,this.label="Loading",this.setFocus=!1,this.enableAnalytics=!1}componentDidLoad(){this.setFocus&&this.spinner&&this.spinner.focus(),this.loadingStartTime=Date.now();const t=this.el.parentNode;this.observer=new MutationObserver((e=>{for(const i of e)if("childList"===i.type){const e=Array.from(i.removedNodes.values()).filter((t=>{var e;return"va-loading-indicator"===(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())})).length>0;if(this.enableAnalytics&&e){const e=new CustomEvent("component-library-analytics",{bubbles:!0,composed:!0,detail:{componentName:"va-loading-indicator",action:"displayed",details:{displayTime:Date.now()-this.loadingStartTime,message:this.message}}});t.dispatchEvent(e)}}})),this.observer.observe(t,{childList:!0})}render(){const{message:t,label:e}=this;let i="loading-indicator";return isChromatic()&&(i+=" chromatic"),h(Host,{key:"7211c80f7ef96413b2212342bffc0dd91180fbf0","aria-live":"polite"},h("div",{key:"64c3dfc29f24874f7521155098b3a78edb045c83",ref:t=>this.spinner=t,class:i,role:"progressbar","aria-label":e,"aria-valuetext":t,tabindex:"-1"}),t)}get el(){return this}static get style(){return VaLoadingIndicatorStyle0}},[1,"va-loading-indicator",{message:[1],label:[1],setFocus:[4,"set-focus"],enableAnalytics:[4,"enable-analytics"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-loading-indicator"].forEach((t=>{"va-loading-indicator"===t&&(customElements.get(t)||customElements.define(t,VaLoadingIndicator$1))}))}const VaLoadingIndicator=VaLoadingIndicator$1,defineCustomElement=defineCustomElement$1;export{VaLoadingIndicator,defineCustomElement};