1"use strict";(self.webpackChunkaccount_settings=self.webpackChunkaccount_settings||[]).push([[6489],{44687:(F,x,l)=>{l.d(x,{g:()=>v});var c=l(19212),p=l(24438),T=l(96814);function _(e,b){if(1&e&&(c.TgZ(0,"div",1)(1,"div",2)(2,"div",3),c._uU(3),c.qZA()()()),2&e){const d=c.oxw();c.xp6(3),c.Oqu(d.errorMsg)}}let v=(()=>{class e{constructor(d){this.csrfTokenService=d,this.isUnauthorized=!1,this.isUnauthorizedFormName=null,this.errorMsg="This session has expired. Please refresh and try again.",this.formName=null}ngOnInit(){this.csrfTokenService.isUnauthorized$.subscribe(d=>{"boolean"==typeof d?this.isUnauthorized=d:"object"==typeof d&&d&&(this.isUnauthorized=d.isUnauthorized,this.isUnauthorizedFormName=d.isUnauthorizedFormName)})}static{this.\u0275fac=function(f){return new(f||e)(c.Y36(p.A))}}static{this.\u0275cmp=c.Xpm({type:e,selectors:[["account-csrf-error-message"]],inputs:{errorMsg:"errorMsg",formName:"formName"},decls:1,vars:1,consts:[["class","csrf-error-message-container site-alert-danger alert alert-info","role","alert",4,"ngIf"],["role","alert",1,"csrf-error-message-container","site-alert-danger","alert","alert-info"],[1,"alert-content"],[1,"alert-description"]],template:function(f,g){1&f&&c.YNc(0,_,4,1,"div",0),2&f&&c.Q6J("ngIf",g.isUnauthorized&&!g.formName||g.isUnauthorized&&g.formName&&g.formName==g.isUnauthorizedFormName)},dependencies:[T.O5],encapsulation:2})}}return e})()},73555:(F,x,l)=>{l.d(x,{E:()=>T});var c=l(19212),p=l(40285);let T=(()=>{class _{constructor(e){this.ngControl=e,this.el=e}onChange(){this.el.control.patchValue(this.el.control.value.trim())}static{this.\u0275fac=function(b){return new(b||_)(c.Y36(p.a5))}}static{this.\u0275dir=c.lG2({type:_,selectors:[["","no-whitespace",""]],hostBindings:function(b,d){1&b&&c.NdJ("change",function(){return d.onChange()})}})}}return _})()},16489:(F,x,l)=>{l.r(x),l.d(x,{TaxExemptStatusModule:()=>ve});var c=l(96814),p=l(40285),T=l(87677),_=l(3609),v=l(7902),e=l(19212),b=l(35565),d=l(72786),f=l(98152),g=l(69862),C=l(39346);let A=(()=>{class s{constructor(t,i){this.Http=t,this.ConfigManagerService=i,this.taxExemptRequests=new f.xQ,this.taxExemptRequests$=this.taxExemptRequests.asObservable(),this.taxExemptionFiles=new f.xQ,this.taxExemptionFiles$=this.taxExemptionFiles.asObservable(),this.states=new f.xQ,this.states$=this.states.asObservable(),this.submit=new f.xQ,this.submit$=this.submit.asObservable(),this.resellerConfig=this.ConfigManagerService.getConfig("reseller_file"),this.appConfig=this.ConfigManagerService.getConfig("app"),this.serverlessEndpoints=i.getConfig("serverless_endpoints")}processEcwResellerApplication(t){const i=this.ConfigManagerService.getConfig("submodule");return this.Http.post(this.appConfig.submodule_api_url+i.reseller.ecw_reseller_resource,t)}getTaxExemptRequests(){this.Http.get(this.serverlessEndpoints.get_customer_reseller_characteristic_file).subscribe(i=>{i&&this.taxExemptRequests.next(i.customer_reseller_characteristic_files)})}submitTaxExemptForms(t,i=null){const n=this.serverlessEndpoints.save_tax_exempt;let r={tax_exemption_files:t};const a=t.map(m=>m.state);i&&(r={...r,...i}),this.Http.post(n,r).subscribe(m=>{m.success&&(this.submit.next(!0),this.states.next(a))},m=>{this.submit.error(m)})}static{this.\u0275fac=function(i){return new(i||s)(e.LFG(g.eN),e.LFG(C.Q))}}static{this.\u0275prov=e.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var y=l(30900),E=l(24438),k=l(14687);let U=(()=>{class s{constructor(t,i,n){this.httpClient=t,this.configManagerService=i,this.storageService=n,this.validFileTypes=["pdf","jpg","jpeg","psd","png","tif","tiff","eps","ai","pub","docx","doc","xls","xlsx","ppt","pptx","txt","csv","tif","tiff","ind","indd","zip","sit"],this.maxFileSize=200,this.maxFilenameLength=185,this.errorLabel="Error",this.invalidFileErrorMessage="",this.fileExtenstionDelimeter="; .",this.resellerFileConfig=this.configManagerService.getConfig("reseller_file"),this.appConfig=this.configManagerService.getConfig("app"),this.serverlessEndpoints=this.configManagerService.getConfig("serverless_endpoints")}get visitorId(){const t=this.configManagerService.getConfig("storage_keys");return this.storageService.getItem(t.visitor_id)}fileToBase64(t){return new Promise((i,n)=>{const r=new FileReader;r.onloadend=()=>{"string"==typeof r.result?i(r.result.split(",")[1]):n(new Error("Unexpected result type: "+typeof r.result))}
1,r.onerror=n,r.readAsDataURL(t)})}upload(t,i={}){const n=this.serverlessEndpoints.save_customer_characteristic_file,r=new FormData;return r.append("file",t,t.name),r.append("fileSize",t.size.toString()),r.append("vid",this.visitorId),this.httpClient.post(n,r,{headers:{"Visitor-Id":this.visitorId,...i}})}delete(t,i=null){const n=this.serverlessEndpoints.delete_customer_characteristic_file,r={body:{vid:this.visitorId,customer_characteristic_file_id:t}};return i&&(r.body={...r.body,...i}),this.httpClient.delete(n,r)}getResellerFileTypes(t=3){return this.httpClient.get(this.serverlessEndpoints.get_customer_characteristic_file_type+"?customer_characteristic_id="+t)}setValidFileTypes(t){if(Array.isArray(t)&&t.length){this.validFileTypes=[];for(const i of t)this.validFileTypes.push(i.toLowerCase())}}setMaxFilenameLength(t){this.maxFilenameLength=t}setMaxFileSize(t){this.maxFileSize=t}validate(t){if(t){const i=t.name.toLowerCase().split(".").pop();return t.name.length>this.maxFilenameLength?{valid:!1,error:"file",label:this.errorLabel,message:`Filename should not exceed ${this.maxFilenameLength} characters.`}:this.validFileTypes.indexOf(i)<0?{valid:!1,error:"file_type",label:this.errorLabel,message:this.invalidFileErrorMessage?this.invalidFileErrorMessage:'Unsupported file format. Please upload one of the following formats: <br><span class="file-extensions"><span class="start-delimeter">.</span>'+this.validFileTypes.join(this.fileExtenstionDelimeter)+'<span class="end-delimeter">;</span></span><div class="file-recommendation-action">If your file type isn\u2019t listed above, please contact customer service for additional support.</div>'}:(t.size||t.bytes)/1048576>this.maxFileSize?{valid:!1,error:"file_size",label:this.errorLabel,message:`Problem encountered. Please check if your file exceeds the maximum upload size\n of ${this.maxFileSize}MB and try again.`}:{valid:!0,error:null,label:"",message:""}}return{valid:!1,error:"file",label:"Error",message:"Invalid file parameter."}}static{this.\u0275fac=function(i){return new(i||s)(e.LFG(g.eN),e.LFG(C.Q),e.LFG(k.V))}}static{this.\u0275prov=e.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var M=l(44687),N=l(73555);let w=(()=>{class s{constructor(t){this.ngControl=t,this.el=t}onInput(){const t=this.el.control.value,i=(new DOMParser).parseFromString(t,"text/html").documentElement.textContent;this.el.control.patchValue(i)}static{this.\u0275fac=function(i){return new(i||s)(e.Y36(p.a5))}}static{this.\u0275dir=e.lG2({type:s,selectors:[["","strip-tags",""]],hostBindings:function(i,n){1&i&&e.NdJ("change",function(){return n.onInput()})}})}}return s})();var P=l(22823);const q=["uploader"];function J(s,o){if(1&s&&e._UZ(0,"p",16),2&s){const t=e.oxw();e.Q6J("innerHTML",t.fileUploadError,e.oJD)}}function I(s,o){if(1&s&&(e.ynx(0),e.TgZ(1,"option",37),e._uU(2),e.qZA(),e.BQk()),2&s){const t=o.$implicit;e.xp6(),e.Q6J("value",t.customer_characteristic_file_type_id),e.xp6(),e.hij(" ",t.customer_characteristic_file_type," ")}}function R(s,o){1&s&&(e.TgZ(0,"span",38),e._uU(1," Please select file type. "),e.qZA())}function Q(s,o){1&s&&(e.TgZ(0,"span",41),e._uU(1," Please enter permit no. "),e.qZA())}function z(s,o){1&s&&(e.TgZ(0,"span",41),e._uU(1," Please provide a valid permit no. "),e.qZA())}function Y(s,o){if(1&s&&(e.TgZ(0,"div",39),e.YNc(1,Q,2,0,"span",40)(2,z,2,0,"span",40),e.qZA()),2&s){e.oxw();const t=e.MAs(15);e.xp6(),e.Q6J("ngIf",null==t.errors?null:t.errors.required),e.xp6(),e.Q6J("ngIf",null==t.errors?null:t.errors.pattern)}}function O(s,o){if(1&s){const t=e.EpF();e.TgZ(0,"i",42),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().index,r=e.oxw(2);return e.KtG(r.deleteUploadedFile(n))})("keydown.enter",function(){e.CHM(t);const n=e.oxw().index,r=e.oxw(2);return e.KtG(r.deleteUploadedFile(n))}),e.qZA()}}function H(s,o){1&s&&e._UZ(0,"i",43)}const Z=s=>({error:s});function B(s,o){if(1&s){const t=e.EpF();e.TgZ(0,"div",19)(1,"p",20),e._uU(2),e.qZA(),e.TgZ(3,"div",21)(4,"div",22)(5,"select",23,24),e.NdJ("ngModelChange",function(n){const a=e.CHM(t).$implicit;return e.KtG(a.permit_type=n)}),e.TgZ(7,"option",25),e._uU(8,"Select File Type"),e.qZA(),e.YNc(9,I,3,2,"ng-container",26),e.qZA(),e.TgZ(10,"div",27),e._UZ(11,"div",28),e.qZA(),e.YNc(12,R,2,0,"span",29),e.qZA(),e.TgZ(13,"div",30)(14,"input",31,32),e.NdJ("ngModelChange",function(n){const a=e.CHM(t).$implicit;return e.KtG(a.permit=n)}),e.qZA(),e.YNc(16,Y,3,2,"div",33),e.qZA(),e.TgZ(17,"p",34),e.YNc(18,O,1,0,"i",35)(19,H,
11,0,"i",36),e.qZA()()()}if(2&s){const t=o.$implicit,i=o.index,n=e.MAs(6),r=e.MAs(15),a=e.oxw(2);e.xp6(2),e.hij(" ",null==t?null:t.file_name," "),e.xp6(2),e.Q6J("ngClass",e.VKq(12,Z,(n.touched||a.isTaxExemptSubmitted)&&n.invalid)),e.xp6(),e.MGl("name","permitType-",i,""),e.Q6J("ngModel",t.permit_type),e.xp6(4),e.Q6J("ngForOf",a.fileTypes),e.xp6(3),e.Q6J("ngIf",(n.touched||a.isTaxExemptSubmitted)&&(null==n.errors?null:n.errors.required)),e.xp6(),e.Q6J("ngClass",e.VKq(14,Z,(r.touched||a.isTaxExemptSubmitted)&&r.invalid)),e.xp6(),e.MGl("name","permitNo-",i,""),e.Q6J("ngModel",t.permit),e.xp6(2),e.Q6J("ngIf",(r.touched||a.isTaxExemptSubmitted)&&r.invalid),e.xp6(2),e.Q6J("ngIf",!t.uploading),e.xp6(),e.Q6J("ngIf",t.uploading)}}function D(s,o){if(1&s&&(e.TgZ(0,"div",17),e.YNc(1,B,20,16,"div",18),e.qZA()),2&s){const t=e.oxw();e.xp6(),e.Q6J("ngForOf",t.resellerCertificates)}}function G(s,o){if(1&s){const t=e.EpF();e.TgZ(0,"div",44)(1,"button",45),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.finishUploadingPermit())})("keydown.enter",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.finishUploadingPermit())}),e._uU(2,"Done"),e.qZA()()}if(2&s){const t=e.oxw();e.xp6(),e.Q6J("disabled",t.uploading)}}let K=(()=>{class s{constructor(t,i,n,r,a,m){this.bsModalRef=t,this.AccessibilityService=i,this.elementRef=n,this.configManagerService=r,this.resellerFileService=a,this.csrfTokenService=m,this.onChange=new e.vpe,this.onSubmit=new e.vpe,this.resellerCertificates=[],this.fileTypes=[],this.csrfToken=null,this.csrfTokenFormName="settings-tax-exempt-upload-delete",this.resellerFileConfig=this.configManagerService.getConfig("reseller_file")}ngOnInit(){this.resellerFileService.setValidFileTypes(this.resellerFileConfig.valid_file_types),this.resellerFileService.setMaxFileSize(this.resellerFileConfig.max_file_size),this.resellerFileService.getResellerFileTypes(3).subscribe(t=>this.fileTypes=t.customer_characteristic_file_types),this.csrfTokenService.emitUnauthorized({isUnauthorized:!1,isUnauthorizedFormName:this.csrfTokenFormName}),this.csrfTokenService.getToken(this.csrfTokenFormName).subscribe(t=>{this.csrfToken=t})}handleFileInput(t){if(!t||!t.length)return;if(this.resellerCertificates.length>=this.resellerFileConfig.max_file_per_state)return void(this.fileUploadError="You have reached the maximum file per state.");const i=t.item(0),n=this.resellerFileService.validate(i);if(n.valid)if(this.isFileExists(i))this.fileUploadError=`${i.name} is already uploaded.`;else{if(this.fileUploadError="",this.resellerCertificates.unshift({permit:"",permit_type:"",file_name:i.name,file_size:i.size,file_type:i.type,uploading:!0}),this.csrfTokenService.emitUnauthorized({isUnauthorized:!1,isUnauthorizedFormName:this.csrfTokenFormName}),!this.csrfToken)return this.csrfTokenService.emitUnauthorized({isUnauthorized:!0,isUnauthorizedFormName:this.csrfTokenFormName}),!1;this.resellerFileService.upload(i,null).subscribe(a=>{const m=a.customer_characteristic_file_data,h=this.resellerCertificates.findIndex(S=>S.file_name==m.file_name&&S.uploading);m.permit_type=this.resellerCertificates[h].permit_type,m.permit=this.resellerCertificates[h].permit,m.expiration_date=this.resellerCertificates[h].expiryDate,m.isNewlyUploaded=!0,this.resellerCertificates[h]=m},a=>{403==a.status&&this.csrfTokenService.emitUnauthorized({isUnauthorized:!0,isUnauthorizedFormName:this.csrfTokenFormName})})}else this.fileUploadError=n.message;setTimeout(()=>{this.uploader.nativeElement.value=""},100)}isFileExists(t){return this.resellerCertificates.some(i=>t.name===i.file_name&&t.size===i.file_size&&t.type===i.file_type)}deleteUploadedFile(t){const i=this.resellerCertificates[t];if(i){if(this.csrfTokenService.emitUnauthorized({isUnauthorized:!1,isUnauthorizedFormName:this.csrfTokenFormName}),!this.csrfToken)return this.csrfTokenService.emitUnauthorized({isUnauthorized:!0,isUnauthorizedFormName:this.csrfTokenFormName}),!1;const n={csrfToken:this.csrfToken,csrfTokenFormName:this.csrfTokenFormName};this.resellerCertificates.splice(t,1),this.onChange.emit(this.resellerCertificates),this.resellerFileService.delete(i.customer_characteristic_file_id,n).subscribe(),this.AccessibilityService.focusOnElement(".file-type",!0)}}get uploading(){return this.resellerCertificates.some(t=>t.uploading)}selectFile(){this.uploader.nativeElement.click()}validateCertificates(){return!this.resellerCertificates.some(t=>!t.permit||!t.permit_type||!/^[a-zA-Z0-9]+$/.test(t.permit))}
1closeUploadPermitModal(){this.resellerCertificates.forEach(t=>{t.isNewlyUploaded&&this.resellerFileService.delete(t.customer_characteristic_file_id).subscribe()}),this.bsModalRef.hide()}finishUploadingPermit(){this.isTaxExemptSubmitted=!0,this.validateCertificates()&&(this.onChange.emit(this.resellerCertificates),this.onSubmit.emit(!0),this.bsModalRef.hide())}static{this.\u0275fac=function(i){return new(i||s)(e.Y36(d.UZ),e.Y36(y.A),e.Y36(e.SBq),e.Y36(C.Q),e.Y36(U),e.Y36(E.A))}}static{this.\u0275cmp=e.Xpm({type:s,selectors:[["upload-permit-modal"]],viewQuery:function(i,n){if(1&i&&e.Gf(q,7),2&i){let r;e.iGM(r=e.CRH())&&(n.uploader=r.first)}},decls:20,vars:10,consts:[["focusTrap","",3,"firstFocusableElementSelector","lastFocusableElementSelector"],[1,"modal-header","heading-container"],["tabindex","0",1,"title"],["aria-label","Close","type","button",1,"close","modal-close-btn",3,"click","keydown.enter"],["aria-hidden","true","tabindex","-1",1,"modal-close-icon","account-i-close"],[1,"modal-body"],["type","file",1,"file-upload-input","hidden",3,"change"],["uploader",""],[3,"formName"],[1,"upload-permit-content"],[1,"file-selector-container"],["tabindex","0",1,"file-type"],["tabindex","0","type","button",1,"account-btn-primary","file-selector-button",3,"click","keydown.enter"],["class","file-upload-error",3,"innerHTML",4,"ngIf"],["class","file-uploaded-list",4,"ngIf"],["class","modal-btn-group right-aligned-buttons",4,"ngIf"],[1,"file-upload-error",3,"innerHTML"],[1,"file-uploaded-list"],["class","file-uploaded-item",4,"ngFor","ngForOf"],[1,"file-uploaded-item"],["tabindex","0",1,"file-name"],[1,"form-fields"],[1,"account-input","account-custom-select",3,"ngClass"],["tabindex","0","required","",1,"custom-select",3,"ngModel","name","ngModelChange"],["permitType","ngModel"],["value",""],[4,"ngFor","ngForOf"],[1,"custom-select-icon"],[1,"account-i-arrow-down"],["class","account-input-message","role","alert","tabindex","0",4,"ngIf"],[1,"account-input",3,"ngClass"],["placeholder","Permit No","no-whitespace","","strip-tags","","maxlength","20","pattern","^[a-zA-Z0-9]+$","required","",3,"ngModel","name","ngModelChange"],["permitNo","ngModel"],["tabindex","0","role","alert","class","account-input-message",4,"ngIf"],[1,"action-icon"],["class","account-i-delete delete-icon","tabindex","0","role","button","aria-label","delete",3,"click","keydown.enter",4,"ngIf"],["class","fa fa-spinner fa-spin uploading-icon",4,"ngIf"],[3,"value"],["role","alert","tabindex","0",1,"account-input-message"],["tabindex","0","role","alert",1,"account-input-message"],["class","input-error-message",4,"ngIf"],[1,"input-error-message"],["tabindex","0","role","button","aria-label","delete",1,"account-i-delete","delete-icon",3,"click","keydown.enter"],[1,"fa","fa-spinner","fa-spin","uploading-icon"],[1,"modal-btn-group","right-aligned-buttons"],["tabindex","0","type","button",1,"account-btn-secondary","js-end-trap",3,"disabled","click","keydown.enter"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"h3",2),e._uU(3),e.qZA(),e.TgZ(4,"button",3),e.NdJ("click",function(){return n.closeUploadPermitModal()})("keydown.enter",function(){return n.closeUploadPermitModal()}),e._UZ(5,"span",4),e.qZA()(),e.TgZ(6,"div",5)(7,"input",6,7),e.NdJ("change",function(a){return n.handleFileInput(a.target.files)}),e.qZA(),e._UZ(9,"account-csrf-error-message",8),e.TgZ(10,"div",9)(11,"div",10)(12,"p",11),e._uU(13),e.ALo(14,"uppercase"),e.qZA(),e.TgZ(15,"button",12),e.NdJ("click",function(){return n.selectFile()})("keydown.enter",function(){return n.selectFile()}),e._uU(16," CHOOSE FILE "),e.qZA(),e.YNc(17,J,1,1,"p",13),e.qZA(),e.YNc(18,D,2,1,"div",14),e.qZA(),e.YNc(19,G,3,1,"div",15),e.qZA()()),2&i&&(e.Q6J("firstFocusableElementSelector",".title")("lastFocusableElementSelector",".js-end-trap"),e.xp6(3),e.hij("Upload ",n.stateName," Tax Exempt Form"),e.xp6(6),e.Q6J("formName",n.csrfTokenFormName),e.xp6(4),e.hij("You can upload: ",e.lcZ(14,8,n.resellerFileConfig.valid_file_types.join(", ")),""),e.xp6(4),e.Q6J("ngIf",n.fileUploadError),e.xp6(),e.Q6J("ngIf",n.resellerCertificates.length),e.xp6(),e.Q6J("ngIf",n.resellerCertificates.length))},dependencies:[c.mk,c.sg,c.O5,M.g,N.E,w,P.w,p.YN,p.Kr,p.Fj,p.EJ,p.JJ,p.Q7,p.nD,p.c5,p.On,c.gd],encapsulation:2})}}return s})();function L(s,o){if(1&s&&(e.TgZ(0,"option",11),e._uU(1),e.qZA()),2&s){const t=e.oxw().$implicit;e.Q6J("value",t.state_code),e.xp6(),e.Oqu(t.state)}}function $(s,o){if(1&s&&(e.ynx(0),e.YNc(1,L,2,2,"option",10),e.BQk()),2&s){const t=o.$implicit,i=e.oxw();e.xp6(),e.Q6J("ngIf",!i.isStateSelected(t.state_code))}}function j(s,o){1&s&&(e.TgZ(0,"span",12),e._uU(1," Please add at least 1 state. "),e.qZA())}function V(s,o){1&s&&(e.TgZ(0,"p",21),e._uU(1,"Please upload at least 1 certificate."),e.qZA())}function W(s,o){if(1&s){const t=e.EpF();e.TgZ(0,"div",13)(1,"p",14),e._uU(2),e.qZA(),e.TgZ(3,"div",15)(4,"button",16),e.NdJ("click",function(){const r=e.CHM(t).index,a=e.oxw();return e.KtG(a.openUploadCertModal(r))})("keydown.enter",function(){const r=e.CHM(t).index,a=e.oxw();return e.KtG(a.openUploadCertModal(r))}),e._uU(5," Upload Certificate "),e.qZA(),e.TgZ(6,"span",17),e._uU(7),e.qZA(),e.TgZ(8,"span",18),e.NdJ("click",function(){const r=e.CHM(t).index,a=e.oxw();return e.KtG(a.removeState(r))})("keydown.enter",function(){const r=e.CHM(t).index,a=e.oxw();return e.KtG(a.removeState(r))}
1),e._UZ(9,"i",19),e.qZA(),e.YNc(10,V,2,0,"p",20),e.qZA()()}if(2&s){const t=o.$implicit,i=e.oxw();let n;e.xp6(2),e.hij("",null==(n=i.getStateByCode(t.state))?null:n.state," Reseller Permit "),e.xp6(5),e.AsE("",null==t?null:t.certificates.length," file",(null==t?null:t.certificates.length)>1?"s":""," uploaded"),e.xp6(3),e.Q6J("ngIf",i.isTaxExemptSubmitted&&!(null!=t&&t.certificates.length))}}const X=s=>({error:s});let ee=(()=>{class s{constructor(t,i,n){this.AccessibilityService=t,this.modalService=i,this.resellerFileService=n,this.permits=[],this.permitsChange=new e.vpe,this.isPermitSubmitted=new e.vpe,this.selectedState="",this.subs=new v.w}openUploadCertModal(t){const i=this.permits[t],n={initialState:{stateCode:i.state,stateName:this.getStateByCode(i.state).state,resellerCertificates:JSON.parse(JSON.stringify(i.certificates))},class:"comp-upload-permit-modal-container account-modal",ignoreBackdropClick:!1};this.modalAccessibilitySub("comp-upload-permit-modal-container","title"),this.bsModalRef=this.modalService.show(K,n),this.subs.add(this.bsModalRef.content.onChange.subscribe(m=>{i.certificates=m.map(h=>(delete h.isNewlyUploaded,h.state=i.state,h)),this.onChangePermit()})),this.subs.add(this.bsModalRef.content.onSubmit.subscribe(()=>{this.onPermitSubmit()}))}modalAccessibilitySub(t,i){this.modalShowSub=this.modalService.onShown.subscribe(()=>{this.AccessibilityService.onModalShown(t,i)}),this.modalHideSub=this.modalService.onHidden.subscribe(()=>{null!=this.modalShowSub&&this.modalShowSub.unsubscribe(),null!=this.modalHideSub&&this.modalHideSub.unsubscribe()})}getStateByCode(t){return this.states.find(i=>i.state_code===t)}addState(t){-1===this.permits.findIndex(n=>n.state===t)&&(this.permits.unshift({state:t,certificates:[]}),this.onChangePermit()),setTimeout(()=>{this.selectedState=""})}removeState(t){this.permits[t]&&(this.permits[t].certificates.forEach(i=>{this.resellerFileService.delete(i.customer_characteristic_file_id).subscribe()}),this.permits.splice(t,1),this.AccessibilityService.focusOnElement(".second-focus-element",!0))}isStateSelected(t){return this.permits.findIndex(i=>i.state===t)>-1}trackByFn(t){return t}onChangePermit(){this.permitsChange.emit(this.permits)}onPermitSubmit(){this.isPermitSubmitted.emit(!0)}ngOnDestroy(){this.subs.unsubscribe()}static{this.\u0275fac=function(i){return new(i||s)(e.Y36(y.A),e.Y36(d.tT),e.Y36(U))}}static{this.\u0275cmp=e.Xpm({type:s,selectors:[["reseller-permit"]],inputs:{states:"states",isTaxExemptSubmitted:"isTaxExemptSubmitted",permits:"permits"},outputs:{permitsChange:"permitsChange",isPermitSubmitted:"isPermitSubmitted"},decls:12,vars:8,consts:[[1,"comp-reseller-permit-container"],[1,"account-input","account-custom-select","required",3,"ngClass"],["tabindex","0",1,"account-input-label"],[1,"custom-select",3,"ngModel","ngModelChange"],["value",""],[4,"ngFor","ngForOf"],[1,"custom-select-icon"],[1,"account-i-arrow-down"],["class","account-input-message state-error-msg","role","alert","tabindex","0",4,"ngIf"],["class","permit-modal-button-container",4,"ngFor","ngForOf","ngForTrackBy"],[3,"value",4,"ngIf"],[3,"value"],["role","alert","tabindex","0",1,"account-input-message","state-error-msg"],[1,"permit-modal-button-container"],["tabindex","0",1,"permit-modal-button-label"],[1,"permit-modal-button-content"],["tabindex","0","type","button",1,"account-btn-secondary","upload-cert-btn",3,"click","keydown.enter"],["tabindex","0",1,"upload-count"],["tabindex","0","role","button","aria-label","delete",1,"account-secondary-icon-link","delete-button",3,"click","keydown.enter"],[1,"link-icon","account-i-delete"],["tabindex","0","class","file-upload-error",4,"ngIf"],["tabindex","0",1,"file-upload-error"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"label",2),e._uU(3," Reseller State "),e.qZA(),e.TgZ(4,"select",3),e.NdJ("ngModelChange",function(a){return n.selectedState=a})("ngModelChange",function(a){return n.addState(a)}),e.TgZ(5,"option",4),e._uU(6,"Add State"),e.qZA(),e.YNc(7,$,2,1,"ng-container",5),e.qZA(),e.TgZ(8,"div",6),e._UZ(9,"div",7),e.qZA(),e.YNc(10,j,2,0,"span",8),e.qZA(),e.YNc(11,W,11,4,"div",9),e.qZA()),2&i&&(e.xp6(),e.Q6J("ngClass",e.VKq(6,X,n.isTaxExemptSubmitted&&!n.permits.length)),e.xp6(3),e.Q6J("ngModel",n.selectedState),e.xp6(3),e.Q6J("ngForOf",n.states),e.xp6(3),e.Q6J("ngIf",n.isTaxExemptSubmitted&&!n.permits.length),e.xp6(),e.Q6J("ngForOf",n.permits)("ngForTrackBy",n.trackByFn))},dependencies:[c.mk,c.sg,c.O5,p.YN,p.Kr,p.EJ,p.JJ,p.On],encapsulation:2})}}return s})();function te(s,o){if(1&s&&(e.TgZ(0,"div",11)(1,"div",12)(2,"div",13),e._uU(3),e.qZA()()()),2&s){const t=e.oxw(2);e.xp6(3),e.Oqu(t.errorMessage)}}function ie(s,o){1&s&&e._UZ(0,"i",14)}function se(s,o){if(1&s){const t=e.EpF();e.ynx(0),e._UZ(1,"account-csrf-error-message",5),e.YNc(2,te,4,1,"div",6),e.TgZ(3,"p",7),e._uU(4,"Please upload your tax exemption file here"),e.qZA(),e.TgZ(5,"reseller-permit",8),e.NdJ("permitsChange",function(n){e.CHM(t);const r=e.oxw();return e.KtG(r.setPermits(n))})("isPermitSubmitted",function(n){e.CHM(t);const r=e.oxw();return e.KtG(r.isPermitSubmitted(n))}),e.qZA(),e.TgZ(6,"button",9),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.submit())}),e._uU(7," Submit "),e.YNc(8,ie,1,0,"i",10),e.qZA(),e.BQk()}if(2&s){const t=e.oxw();e.xp6(),e.Q6J("formName",t.csrfTokenFormName),e.xp6(),e.Q6J("ngIf",t.submitError&&t.errorMessage),e.xp6(3),e.Q6J("states",t.states)("isTaxExemptSubmitted",t.isTaxExemptSubmitted),e.xp6(),e.Q6J("disabled",t.processing||t.permits.length<=0||!t.permitDone),e.xp6(2),e.Q6J("ngIf",t.processing)}}function ne(s,o){1&s&&(e.TgZ(0,"span"),e._uU(1,"\xa0and"),e.qZA())}function re(s,o){1&s&&(e.TgZ(0,"span"),e._uU(1,","),e.qZA())}function oe(s,o){if(1&s&&(e.TgZ(0,"span"),e.YNc(1,ne,2,0,"span",22),e._uU(2),e.YNc(3,re,2,0,"span",22),e.qZA()),2&s){const t=o.$implicit,i=o.last,n=o.index,r=e.oxw(3);e.xp6(),e.Q6J("ngIf",i&&r.statesApplied.length>1),e.xp6(),e.hij(" ",r.getStateName(t),""),e.xp6(),e.Q6J("ngIf",!i&&r.statesApplied.length>2&&n<r.statesApplied.length-2)}}function ae(s,o){if(1&s&&(e.TgZ(0,"p",20),e._uU(1," Your tax exemption request for the following state/s "),e.YNc(2,oe,4,3,"span",21),e._uU(3," is pending for approval. "),e.qZA()),2&s){const t=e.oxw(2);e.xp6(2),e.Q6J("ngForOf",t.statesApplied)}}function le(s,o){1&s&&(e.TgZ(0,"p",23),e._uU(1," You will be notified once your tax exemption is verified. "),e.qZA())}function ce(s,o){1&s&&(e.TgZ(0,"p",24),e._uU(1," No tax exemption status available. "),e.qZA())}function pe(s,o){if(1&s&&(e.ynx(0),e.TgZ(1,"h3",15),e._uU(2,"Your request has been submitted"),e.qZA(),e.TgZ(3,"p",16),e._uU(4," Thank You "),e.qZA(),e.YNc(5,ae,4,1,"p",17)(6,le,2,0,"p",18)(7,ce,2,0,"p",19),e.BQk()),2&s){const t=e.oxw();e.xp6(5),e.Q6J("ngIf",t.statesApplied),e.xp6(),e.Q6J("ngIf",t.statesApplied),e.xp6(),e.Q6J("ngIf",!t.statesApplied)}}function de(s,o){if(1&s){const t=e.EpF();e.ynx(0),e.TgZ(1,"a",25),e.NdJ("click",function(){e.CHM(t);const n=e.oxw(),r=e.MAs(8);return e.KtG(n.openTaxStatusModal(r))})("keydown.enter",function(){e.CHM(t);const n=e.oxw(),r=e.MAs(8);return e.KtG(n.openTaxStatusModal(r))}),e._uU(2,"Tax exemption requests status "),e._UZ(3,"i",26),e.qZA(),e.TgZ(4,"button",27),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.goToRequestTaxExempt())})("keydown.enter",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.goToRequestTaxExempt())}),e._uU(5," Request Tax Exemption "),e.qZA(),e.BQk()}}function me(s,o){1&s&&e._UZ(0,"i",39)}function ue(s,o){1&s&&(e.TgZ(0,"p",24),e._uU(1," No tax exemption status available. "),e.qZA())}function _e(s,o){1&s&&(e.TgZ(0,"div",40)(1,"span",41),e._uU(2,"State"),e.qZA(),e.TgZ(3,"span",42),e._uU(4,"Status"),e.qZA(),e.TgZ(5,"span",43),e._uU(6,"Expiration"),e.qZA()())}function fe(s,o){if(1&s&&(e.TgZ(0,"div",44)(1,"span",41),e._uU(2),e.qZA(),e.TgZ(3,"span",1),e.ALo(4,"lowercase"),e._uU(5),e.qZA(),e.TgZ(6,"span",45),e._uU(7),e.qZA()()),2&s){const t=o.$implicit;e.xp6(2),e.Oqu(t.state_or_province),e.xp6(),e.Gre("status\n ",e.lcZ(4,6,t.customer_reseller_characteristic_file_status.replace(" ","_")),""),e.xp6(2),e.hij(" ",t.customer_reseller_characteristic_file_status," "),e.xp6(2),e.hij(" ",t.expiration_date?t.expiration_date:"NA"," ")}}const he=s=>({loading:s});function ge(s,o){if(1&s){const t=e.EpF();e.TgZ(0,"div",28)(1,"div",29)(2,"h3",30),e._uU(3,"Tax exemption requests status"),e.qZA(),e.TgZ(4,"button",31),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.BsModalRef.hide())})("keydown.enter",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.BsModalRef.hide())}),e._UZ(5,"span",32),e.qZA()(),e.TgZ(6,"div",33),e.YNc(7,me,1,0,"i",34)(8,ue,2,0,"p",35)(9,_e,7,0,"div",36),e.TgZ(10,"div",37),e.YNc(11,fe,8,8,"div",38),e.qZA()()()}if(2&s){const t=e.oxw();e.Q6J("firstFocusableElementSelector",".title")("lastFocusableElementSelector",".js-end-trap"),e.xp6(6),e.Q6J("ngClass",e.VKq(7,he,t.loading)),e.xp6(),e.Q6J("ngIf",t.loading),e.xp6(),e.Q6J("ngIf",(!t.taxExemptRequests||t.taxExemptRequests.length<=0)&&!t.loading),e.xp6(),e.Q6J("ngIf",!t.loading&&t.taxExemptRequests&&t.taxExemptRequests.length>0),e.xp6(2),e.Q6J("ngForOf",t.taxExemptRequests)}}const xe=[{path:"",component:(()=>{class s{constructor(t,i,n,r,a,m,h,S){this.AddressService=t,this.BsModalRef=i,this.Router=n,this.ResellerService=r,this.ModalService=a,this.AccessibilityService=m,this.ConfigManagerService=h,this.csrfTokenService=S,this.states=[],this.statesAll=[],this.statesApplied=[],this.tabContent="landing",this.taxExemptRequests=[],this.loading=!1,this.processing=!1,this.isTaxExemptRequested=!1,this.permits=[],this.isTaxExemptSubmitted=!1,this.permitDone=!1,this.csrfToken=null,this.csrfTokenFormName="settings-tax-exempt-permit",this.submitError=!1,this.subscriptions=new v.w;const Ce=this.Router.events.subscribe(u=>{u instanceof _.m2&&this.resetToLanding()});this.subscriptions.add(Ce);const Se=this.ResellerService.taxExemptRequests$.subscribe(u=>{u&&u.length&&(this.taxExemptRequests=u),this.loading=!1,this.isTaxExemptRequested=!0});this.subscriptions.add(Se);const ye=this.ResellerService.submit$.subscribe(u=>{!0===u&&(this.submitError=!1,this.panelTitle="Tax exempt form submission",this.tabContent="confirmation",this.AccessibilityService.focusOnElement(".success-focus-element",!0))},u=>{403==u.status?this.csrfTokenService.emitUnauthorized({isUnauthorized:!0,isUnauthorizedFormName:this.csrfTokenFormName}):(this.submitError=!0,this.errorMessage=u.error.message)});this.subscriptions.add(ye);const Fe=this.ResellerService.states$.subscribe(u=>{this.statesApplied=u});this.subscriptions.add(Fe);const Ee=this.AddressService.getStates("US").subscribe(u=>{this.states=u.states,this.statesAll=Object.assign([],u.states)});this.subscriptions.add(Ee)}ngOnInit(){this.panelTitle=this.ConfigManagerService.getConfig("settings").tax_exempt_status.label,this.ResellerService.getTaxExemptRequests(),this.csrfTokenService.emitUnauthorized({isUnauthorized:!1,isUnauthorizedFormName:this.csrfTokenFormName}),this.csrfTokenService.getToken(this.csrfTokenFormName).subscribe(t=>{this.csrfToken=t})}goToRequestTaxExempt(){this.panelTitle="Tax exempt submission form",this.tabContent="submit",this.AccessibilityService.focusOnElement(".first-focus-element",!0)}setPermits(t){this.permits=t}isPermitSubmitted(t){this.permitDone=t}get areResellerPermitsValid(){return!(!this.permits||!this.permits.length)&&this.permits.every(t=>t.certificates&&t.certificates.length)}submit(){if(this.isTaxExemptSubmitted=!0,this.areResellerPermitsValid){if(this.csrfTokenService.emitUnauthorized({isUnauthorized:!1,isUnauthorizedFormName:this.csrfTokenFormName}),!this.csrfToken)return this.csrfTokenService.emitUnauthorized({isUnauthorized:!0,isUnauthorizedFormName:this.csrfTokenFormName}),!1;const t={csrfToken:this.csrfToken,csrfTokenFormName:this.csrfTokenFormName};this.processing=!0,this.ResellerService.submitTaxExemptForms(this.permits,t)}}getStateName(t){for(const i of this.statesAll)if(i.state_code===t)return i.state}openTaxStatusModal(t){this.taxExemptRequests.length<=0&&!this.isTaxExemptRequested&&(this.loading=!0),this.modalAccessibilitySub("comp-tax-exempt-status-modal-container","title"),this.BsModalRef=this.ModalService.show(t,{class:"comp-tax-exempt-status-modal-container account-modal"})}resetToLanding(){this.panelTitle="Tax Exempt Status",this.tabContent="landing"}modalAccessibilitySub(t,i){this.modalShowSub=this.ModalService.onShown.subscribe(()=>{this.AccessibilityService.onModalShown(t,i)}),this.modalHideSub=this.ModalService.onHidden.subscribe(()=>{null!=this.modalShowSub&&this.modalShowSub.unsubscribe(),null!=this.modalHideSub&&this.modalHideSub.unsubscribe()})}static{this.\u0275fac=function(i){return new(i||s)(e.Y36(b.D),e.Y36(d.UZ),e.Y36(_.F0),e.Y36(A),e.Y36(d.tT),e.Y36(y.A),e.Y36(C.Q),e.Y36(E.A))}}static{this.\u0275cmp=e.Xpm({type:s,selectors:[["app-tax-exempt-status"]],decls:9,vars:8,consts:[[1,"page-tax-exempt-container"],["tabindex","0"],[1,"tax-exempt-content",3,"ngSwitch"],[4,"ngSwitchCase"],["statusModal",""],[3,"formName"],["role","alert","class","site-alert-danger alert alert-info",4,"ngIf"],["tabindex","0",1,"submit-message","second-focus-element"],[3,"states","isTaxExemptSubmitted","permitsChange","isPermitSubmitted"],["tabindex","0","role","button",1,"site-btn-primary","submit-btn",3,"disabled","click"],["class","fa fa-spinner fa-spin",4,"ngIf"],["role","alert",1,"site-alert-danger","alert","alert-info"],[1,"alert-content"],[1,"alert-description"],[1,"fa","fa-spinner","fa-spin"],["tabindex","0",1,"request-submitted-lbl","success-focus-element"],["tabindex","0",1,"thank-you"],["class","receipt-reminder","tabindex","0",4,"ngIf"],["class","notification-reminder","tabindex","0",4,"ngIf"],["class","input-error-message","tabindex","0",4,"ngIf"],["tabindex","0",1,"receipt-reminder"],[4,"ngFor","ngForOf"],[4,"ngIf"],["tabindex","0",1,"notification-reminder"],["tabindex","0",1,"input-error-message"],["tabindex","0",1,"account-primary-link","tax-status-lnk",3,"click","keydown.enter"],["tabindex","0","aria-label","Tax Status icon",1,"tax-status-icon","account-i-tax-status"],["tabindex","0","role","button",1,"account-btn-primary","request-btn",3,"click","keydown.enter"],["focusTrap","",3,"firstFocusableElementSelector","lastFocusableElementSelector"],[1,"modal-header","tax-status-modal-header"],["tabindex","0",1,"title"],["aria-label","Close","type","button",1,"close","modal
1-close-btn",3,"click","keydown.enter"],["aria-hidden","true","tabindex","-1",1,"modal-close-icon","account-i-close"],[1,"modal-body","tax-status-modal-body",3,"ngClass"],["class","fa fa-spinner fa-spin uploading-icon",4,"ngIf"],["tabindex","0","class","input-error-message",4,"ngIf"],["class","tax-status-table-heading",4,"ngIf"],[1,"tax-status-table-body"],["class","tax-status-table-row",4,"ngFor","ngForOf"],[1,"fa","fa-spinner","fa-spin","uploading-icon"],[1,"tax-status-table-heading"],["tabindex","0",1,"state"],["tabindex","0",1,"status"],["tabindex","0",1,"expiration"],[1,"tax-status-table-row"],["tabindex","0",1,"expiration","js-end-trap"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"h3",1),e._uU(2),e.qZA(),e.TgZ(3,"div",2),e.YNc(4,se,9,6,"ng-container",3)(5,pe,8,3,"ng-container",3)(6,de,6,0,"ng-container",3),e.qZA()(),e.YNc(7,ge,12,9,"ng-template",null,4,e.W1O)),2&i&&(e.xp6(),e.Gre("tax-exempt-label ",n.tabContent," first-focus-element"),e.xp6(),e.Oqu(n.panelTitle),e.xp6(),e.Q6J("ngSwitch",n.tabContent),e.xp6(),e.Q6J("ngSwitchCase","submit"),e.xp6(),e.Q6J("ngSwitchCase","confirmation"),e.xp6(),e.Q6J("ngSwitchCase","landing"))},dependencies:[c.mk,c.sg,c.O5,c.RF,c.n9,ee,M.g,c.i8],encapsulation:2})}}return s})()}];let be=(()=>{class s{static{this.\u0275fac=function(i){return new(i||s)}}static{this.\u0275mod=e.oAB({type:s})}static{this.\u0275inj=e.cJS({imports:[_.Bz.forChild(xe),_.Bz]})}}return s})();var Te=l(38168);let ve=(()=>{class s{static{this.\u0275fac=function(i){return new(i||s)}}static{this.\u0275mod=e.oAB({type:s})}static{this.\u0275inj=e.cJS({imports:[p.u5,c.ez,be,T.e,Te.r]})}}return s})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.