PageSourceSearch

https://app.freightoscope.com/2446.903fb6884f5305df.js

js freightoscope.com collected 2026-09-24 10:59:17 UTC 63,626 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkWebApplication1=self.webpackChunkWebApplication1||[]).push([[2446],{22446:(Nt,ct,h)=>{h.d(ct,{C:()=>Jt});var e=h(5e3),k=h(80870),at=h(73135),Ct=h(77432),mt=h(3318),ut=h(91439),E=h(23189),et=h(91355),f=h(45179),It=h(78826),Et=h(57028),it=h(31628),st=h(90083),ft=h(11141),m=h(13585),ot=h(57274),rt=h(70760),_t=h(40971),nt=h(45475),dt=h(93958),gt=h(73514),lt=h(25441),ht=h(14383),U=h(70505),X=h(73431),pt=h(6094),At=h(1119),K=h(21373),yt=h(49683),s=h(3624),t=h(1394),_=h(45122),p=h(6934),i=h(91465),r=h(7981),v=h(7754),C=h(97667),y=h(30836),x=h.n(y),L=h(6018),V=h(59649),w=h(90994),J=h(56564),H=h(25995),q=h(74775),M=h(67889),Q=h(64598),Dt=h(69808),Ot=h(22395),bt=h(28692),St=h(41496),Tt=function(A,R,n,d){return new(n||(n=Promise))(function(u,g){function O(N){try{D(d.next(N))}catch(j){g(j)}}function l(N){try{D(d.throw(N))}catch(j){g(j)}}function D(N){N.done?u(N.value):function c(u){return u instanceof n?u:new n(function(g){g(u)})}(N.value).then(O,l)}D((d=d.apply(A,R||[])).next())})};const Rt=["modalRef"],vt=["fileInput"];function Mt(A,R){1&A&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&A&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"modules.Others.importdataWindow.labels.lblSelectFile")))}function Pt(A,R){1&A&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&A&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"modules.Others.importdataWindow.labels.lblSelectXlsxFile")))}function Lt(A,R){if(1&A&&(e.TgZ(0,"dd"),e._uU(1),e.qZA()),2&A){const n=R.$implicit,d=R.index;e.xp6(1),e.AsE("(",d+1,") ",n.Id,"")}}function wt(A,R){if(1&A&&(e.TgZ(0,"div",9)(1,"div",27)(2,"h2"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"p",28),e._uU(6),e.ALo(7,"translate"),e.TgZ(8,"mark"),e._uU(9),e.ALo(10,"translate"),e.qZA()(),e.TgZ(11,"p",28),e._uU(12),e.ALo(13,"translate"),e.TgZ(14,"mark"),e._uU(15),e.ALo(16,"translate"),e.qZA()(),e.TgZ(17,"div",19)(18,"dl",29),e.YNc(19,Lt,2,2,"dd",30),e.qZA()(),e.TgZ(20,"p",31)(21,"strong"),e._uU(22),e.ALo(23,"translate"),e.qZA(),e._uU(24," CUSTOMER,SHIPPER,CONSIGNEE "),e.qZA()()()),2&A){const n=e.oxw();e.xp6(3),e.hij(" ",e.lcZ(4,7,"modules.Others.importdataWindow.labels.lblNote")," "),e.xp6(3),e.hij(" ",e.lcZ(7,9,"modules.Others.importdataWindow.labels.lblFLValues")," "),e.xp6(3),e.Oqu(e.lcZ(10,11,"modules.Others.importdataWindow.labels.lblFLValues3")),e.xp6(3),e.hij(" ",e.lcZ(13,13,"modules.Others.importdataWindow.labels.lblFLValues2")," "),e.xp6(3),e.Oqu(e.lcZ(16,15,"modules.Others.importdataWindow.labels.lblFLValues4")),e.xp6(4),e.Q6J("ngForOf",n.companyTypes),e.xp6(3),e.hij("",e.lcZ(23,17,"modules.Others.importdataWindow.labels.lblExample")," -")}}function Wt(A,R){1&A&&(e.TgZ(0,"div")(1,"div",32)(2,"strong"),e._uU(3,"NB: Input valid 2 character country code (e.g., US, CA) in Flag column"),e.qZA()()())}function Bt(A,R){1&A&&(e.TgZ(0,"div")(1,"h3"),e._uU(2,"Note:"),e.qZA(),e.TgZ(3,"div"),e._uU(4,"Category should be any numeric value from below"),e.qZA(),e._UZ(5,"br"),e.TgZ(6,"ul")(7,"li"),e._uU(8,"1 - Quotation"),e.qZA(),e.TgZ(9,"li"),e._uU(10,"2 - Billing"),e.qZA(),e.TgZ(11,"li"),e._uU(12,"3 - Marks & No."),e.qZA(),e.TgZ(13,"li"),e._uU(14,"4 - Good Description"),e.qZA(),e.TgZ(15,"li"),e._uU(16,"5 - Handling Information"),e.qZA()()())}function Ut(A,R){1&A&&e._UZ(0,"div",33),2&A&&e.Q6J("innerHtml",R.element.Content,e.oJD)}function Yt(A,R){if(1&A){const n=e.EpF();e.TgZ(0,"div",34)(1,"button",35),e.NdJ("click",function(){return e.CHM(n),e.oxw().reset()}),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"button",35),e.NdJ("click",function(){return e.CHM(n),e.oxw().close()}),e._uU(5),e.ALo(6,"translate"),e.qZA(),e.TgZ(7,"button",36),e.NdJ("dbclick",function(){return e.CHM(n),e.oxw().onSubmit()}),e._uU(8),e.ALo(9,"translate"),e.qZA()()}if(2&A){const n=e.oxw();e.xp6(2),e.hij(" ",e.lcZ(3,4,"commonControls.buttons.btnReset")," "),e.xp6(3),e.hij(" ",e.lcZ(6,6,"commonControls.buttons.btnCancel")," "),e.xp6(2),e.Q6J("disabled",n.DisabledSubmitBtn),e.xp6(1),e.hij(" ",e.lcZ(9,8,"commonControls.buttons.btnSubmit")," ")}}
1function xt(A,R){1&A&&(e.TgZ(0,"div",34)(1,"div",37)(2,"span",38),e._uU(3),e.ALo(4,"translate"),e.qZA()()()),2&A&&(e.xp6(3),e.hij(" ",e.lcZ(4,1,"commonControls.labels.lblLoading")," "))}const Ft=function(A,R){return{"zi-2":A,"zi-3":R}},Zt=function(A,R){return{"modal-2":A,"modal-3":R}};let Jt=(()=>{class A extends s.o{constructor(n,d){super(k.H.IMPORT_DATA),this.papa=n,this.exceljsLoader=d,this.AIRPORTS="AIRPORTS",this.PORTS="PORTS",this.TERMINALS="TERMINALS",this.COUNTRY="COUNTRY",this.CITY="CITY",this.REGION="REGION",this.TC="TC",this.VESSEL="VESSEL",this.COMMODITY="COMMODITY",this.CONTAINERSIZE="CONTAINERSIZE",this.CHARGES="CHARGES",this.AIRLINE="AIRLINE",this.SHIPPING_LINE="SHIPPING_LINE",this.CURRENCY="CURRENCY",this.CHARGETAX="CHARGETAX",this.MILESTONE="MILESTONES",this.PAYMENT_TYPE="PAYMENT_TYPE",this.INLAND_CARRIER="INLAND_CARRIER",this.USER_VALUE_DETAIL="USER_VALUE_DETAIL",this.STATE="STATE",this.modalLevel=1,this.importdataInput=new nt.E,this.import=new e.vpe,this.submited=new e.vpe,this.master=dt.Q.getInstance(),this.countries=[],this.cities=[],this.states=[],this.chargeList=[],this.chargeTaxes=[],this.airlines=[],this.inlandcarrs=[],this.milestons=[],this.paymenttypes=[],this.valueDetails=[],this.pristine=!0,this.loading=!1,this.filetemplateURL="",this.nameAlreadyExists=!1,this.hasDuplicateCode=!1,this.hasDuplicateName=!1,this.hasIncorrectFormat=!1,this.hasIncorrectDate=!1,this.hasDataOverflow=!1,this.minimumLenthRequiredMsgs=[],this.missingRequired=!1,this.maxAllowedLength=[],this.missedRequiredFields=[],this.invalidDataFields=[],this.existingDataFields=[],this.TC_Categories=[1,2,3,4,5],this.invalidCategory=!1,this.catMissing=!1,this.nameMissing=!1,this.codeMissing=!1,this.countryMissing=!1,this.mandatoryFieldMissing=!1,this.duplicateTaxCodePerCountry=!1,this.invalidCodeLength=!1,this.contentMissing=!1,this.companyTypes=[],this.otherCodes=[],this.importData=new nt.E,this.languages=[],this.selectedFileName=f.J.translate.instant("modules.Others.importdataWindow.labels.lblNoFileChosen")}getModalRef(){return this.modalRef}get loginUser(){return Et.Z.getInstance().LoginUser}ngOnDestroy(){}ngOnInit(){this.partyImportdata={title:"",data:[],type:this.importData.Type,columns:[]}}initialize(){this.pristine=!0,this.preload(),this.partyImportdata.data=[],this.selectedFileName=f.J.translate.instant("modules.Others.importdataWindow.labels.lblNoFileChosen"),this.setValueDetails()}preload(){this.cities=[],this.states=[],this.chargeList=[],this.chargeTaxes=[],this.countries=[],this.airlines=[],this.inlandcarrs=[],this.milestons=[],this.paymenttypes=[],this.valueDetails=[],this.importData=this.importdataInput.clone(),this.reset(),this.fillGrid(null),this.filetemplateURL=this.importData.getTemplateURL(this.importData.Type)}setValueDetails(){this.importData.Type==this.TC&&(this.valueDetails=this.master.ClausesAndDescriptions.ValueDetails),this.companyTypes=m.YD.CompanyTypes,this.companyTypes=this.companyTypes.filter(n=>n.Id!=m.YD.COLOAD),this.companyTypes=this.companyTypes.filter(n=>n.Id!=this.importData.Type),this.companyTypes=this.companyTypes.sort((0,V.M)("Id")),this.languages=L.S.getInstance().parasMaster.languages}handleUpload(n){this.parseCsvFile(n.srcElement.files[0]);const c=n.target;this.selectedFileName=c.files&&c.files.length>0?c.files[0].name:f.J.translate.instant("modules.Others.importdataWindow.labels.lblNoFileChosen")}get filterByBranch(){return"branch"==L.S.getInstance().systemParameter.DefaultPartyVisibility}prepareList(n){switch(this.hasDuplicateCode=!1,this.hasDuplicateName=!1,this.hasIncorrectFormat=!1,this.hasIncorrectDate=!1,this.hasDataOverflow=!1,this.missingRequired=!1,this.maxAllowedLength=[],this.missedRequiredFields=[],this.otherCodes=[],this.invalidDataFields=[],this.minimumLenthRequiredMsgs=[],this.importData.Type){case this.VESSEL:this.otherCodes=[],n.data.forEach(a=>{if(this.otherCodes.some(o=>o==a.Code)&&(this.hasDuplicateCode=!0),this.otherCodes.push(a.Code),console.log("element.Flag before",a.Flag),a.Flag){let o=E.g.getInstance().getByCode(a.Flag.trim());a.Flag=o?o.Id:0}else a.Flag=0});break;case this.CURRENCY:this.otherCodes=[],n.data.forEach(a=>{if(this.otherCodes.some(o=>o==a["Currency Code"])&&(this.hasDuplicateCode=!0),a.AsOnDate&&a.AsOnDate instanceof Date){let o=new Date(a.AsOnDate),I=new Date;o.setHours(0,0,0,0),I.setHours(0,0,0,0),o<I&&(this.hasIncorrectDate=!0)}else this.hasIncorrectFormat=!0;this.otherCodes.push(a["Currency Code"])});break;case this.CONTAINERSIZE:this.otherCodes=[];let g=ot.B.ColumnModel;n.data.forEach(a=>{this.otherCodes.some(o=>o==a.Code)&&(this.hasDuplicateCode=!0),this.otherCodes.push(a.Code),g.forEach(o=>{if(o.MaxLen&&o.MaxLen>0&&a[o.PropertyName].length>o.MaxLen){this.hasDataOverflow=!0;let I=o.Title+" : "+o.MaxLen;-1===this.maxAllowedLength.indexOf(I)&&this.maxAllowedLength.push(I)}})});break;
1case m.YD.AGENT:case m.YD.CUSTOMER:case m.YD.SHIPPER:case m.YD.CONSIGNEE:case m.YD.CHA:case m.YD.ROAD_TRANSPORT:case m.YD.BANK:case m.YD.COLOAD:case m.YD.WAREHOUSE:case m.YD.CFS:case m.YD.LEADS:case m.YD.VENDOR:console.log("list.data",n.data);let O=m.YD.ColumnModel(this.importData.Type);var d=this.master.countries.map(a=>a.Code);this.missedRequiredFields=[],this.existingDataFields=[],this.nameAlreadyExists=!1,n.data.forEach(a=>{if(null!=a.Name&&null!=a.Name&&(a.Name=a.Name.trim().substring(0,100),a.Name.length<3&&null==this.minimumLenthRequiredMsgs.find(T=>"Name"==T.field))){var o=f.J.translate.instant("modules.Others.importdataWindow.Msgs.nameMinimumLength");this.minimumLenthRequiredMsgs.push({field:"Name",msg:o})}null!=a["Short Name"]&&null!=a["Short Name"]&&(a["Short Name"]=a["Short Name"].trim().substring(0,100)),null!=a["Legal Name"]&&null!=a["Legal Name"]&&(a["Legal Name"]=a["Legal Name"].trim().substring(0,200)),null!=a.Code&&null!=a.Code&&(a.Code=a.Code.trim().substring(0,50),0==a.Code.length&&(a.Code=w.iy.newGuid().substring(0,6).toUpperCase()),this.otherCodes.some(T=>T==a.Code)&&(this.hasDuplicateCode=!0),this.otherCodes.push(a.Code)),null!=a.Website&&null!=a.Website&&(a.Website=a.Website.trim().substring(0,100)),null!=a.Email&&null!=a.Email&&(a.Email=a.Email.trim().substring(0,100),a.Email.length>0&&null==v.qI.validateEmail(a.Email)&&this.invalidDataFields.push("Email")),null!=a.Phone&&null!=a.Phone&&(a.Phone=a.Phone.trim().substring(0,20)),0==v.qI.getStrWithoutWhiteSpace(a["Address*"]).length||(a["Address*"]=a["Address*"].trim().substring(0,200));var b=a["CountryCode*"];if(0!=v.qI.getStrWithoutWhiteSpace(b).length)if(b=b.trim().toUpperCase(),null==d.find(T=>T.toUpperCase()==b))this.invalidDataFields.push("CountryCode");else{let T=d.find(B=>B.toUpperCase()==b);a["CountryCode*"]=T}var S=a["eAWB Country"];if(null!=S&&""!==S.toString().trim())if(S=S.trim().toUpperCase(),null==d.find(T=>T.toUpperCase()==S))this.invalidDataFields.push("Eawb CountryCode");else{let T=d.find(B=>B.toUpperCase()==S);a["eAWB Country"]=T}if(0==v.qI.getStrWithoutWhiteSpace(a["City*"]).length||(a["City*"]=a["City*"].trim().substring(0,50)),null!=a.Zipcode&&null!=a.Zipcode&&(a.Zipcode=a.Zipcode.trim().substring(0,20)),null!=a.Description&&null!=a.Description&&(a.Description=a.Description.trim().substring(0,500)),null!=a.PrintField&&null!=a.PrintField&&(a.PrintField=a.PrintField.trim().substring(0,1e3)),null!=a["Primary Contact"]&&null!=a["Primary Contact"]&&(a["Primary Contact"]=a["Primary Contact"].trim().substring(0,50)),null!=a.Language&&null!=a.Language&&a.Language.length>0){var Z=a.Language;let T=this.languages.find(B=>B.Code.toUpperCase()==Z.toUpperCase()||Z.toUpperCase()==B.NormalizedName.toUpperCase());T?a.Language=T.Code:this.invalidDataFields.push("Language")}var Y=a["Other Party Roles"];if(v.qI.getStrWithoutWhiteSpace(Y).length>0){var z=Y.split(",");z.length>0&&z.forEach(T=>{this.companyTypes.map(tt=>tt.Id).includes(T.trim())||this.invalidDataFields.push("Other Party Roles")})}O.forEach(T=>{var B,tt;T.Title&&T.IsRequired&&((null===(B=a[T.PropertyName])||void 0===B?void 0:B.trim().length)<1||(null===(tt=a[T.PropertyNameExcel])||void 0===tt?void 0:tt.trim().length)<1)&&(this.missingRequired=!0,-1===this.missedRequiredFields.indexOf(T.Title)&&this.missedRequiredFields.push(T.Title))}),this.master.InNetworkCompanies.filter(T=>!this.filterByBranch||this.filterByBranch&&T.CompanyReferenceId>0&&T.CompanyReferenceId==this.loginUser.CompanyId).some(T=>T.Name==a["Name*"]&&T.City==a["City*"]&&T.CountryCode==a["CountryCode*"])&&(this.nameAlreadyExists=!0,-1===this.existingDataFields.indexOf(a["Name*"])&&this.existingDataFields.push(a["Name*"]))}),this.missedRequiredFields=x()(this.missedRequiredFields),this.invalidDataFields=x()(this.invalidDataFields);break;case this.TC:if(this.invalidCategory=!1,this.nameMissing=!1,this.catMissing=!1,this.contentMissing=!1,this.otherCodes=[],n.data.forEach(a=>{if(this.otherCodes.some(S=>S==a.Name)&&(this.hasDuplicateName=!0),this.otherCodes.push(a.Name),0==v.qI.getStrWithoutWhiteSpace(a.Name).length&&(this.nameMissing=!0),0==v.qI.getStrWithoutWhiteSpace(a.Content).length&&(this.contentMissing=!0),a.Category="1"==a.Category?"Quotation":"2"==a.Category?"Billing":"3"==a.Category?"Marks & No":"4"==a.Category?"Good Description":"Handling Information",0==v.qI.getStrWithoutWhiteSpace(a.Category).length)this.catMissing=!0;else{var I=a.Category.trim(),b=Number(I);"number"==typeof b&&"NaN"!=b.toString()&&(this.invalidCategory=!0)}}),this.nameMissing||this.catMissing||this.invalidCategory||this.hasDuplicateName||this.contentMissing){var c="";this.nameMissing&&(c+="|"+f.J.translate.instant("modules.Others.importdataWindow.Msgs.TC.nameMissing")),this.contentMissing&&(c+="|"+f.J.translate.instant("modules.Others.importdataWindow.Msgs.TC.contentMissing")),this.catMissing&&(c+="|"+f.J.translate.instant("modules.Others.importdataWindow.Msgs.TC.categoryMissing")),this.invalidCategory&&(c+="|"+f.J.translate.instant("modules.Others.importdataWindow.Msgs.TC.invalidCategory")),this.hasDuplicateName&&(c+="|"+f.J.translate.instant("modules.Others.importdataWindow.Msgs.duplicateNameInFile")),c=c.substring(1),this.master.alertCustomTitle(C._.getActivitiesRString(c),"error","Error")}break;case this.AIRLINE:this.otherCodes=[];let l=at.J.ColumnModel;n.data.forEach(a=>{this.otherCodes.some(o=>o==a.AlphaCode)&&(this.hasDuplicateCode=!0),this.otherCodes.push(a.AlphaCode),l.forEach(o=>{if(o.IsRequired&&a[o.PropertyName].trim().length<1&&(this.missingRequired=!0,-1===this.missedRequiredFields.indexOf(o.Title)&&this.missedRequiredFields.push(o.Title)),o.MaxLen&&o.MaxLen>0&&a[o.PropertyName].length>o.MaxLen){this.hasDataOverflow=!0;let I=o.Title+" : "+o.MaxLen;-1===this.maxAllowedLength.indexOf(I)&&this.maxAllowedLength.push(I)}})});break;case this.SHIPPING_LINE:this.otherCodes=[],n.data.forEach(a=>{this.otherCodes.some(o=>o==a.SCACCode)&&(this.hasDuplicateCode=!0),this.otherCodes.push(a.SCACCode)});break;case this.INLAND_CARRIER:this.otherCodes=[],n.data.forEach(a=>{this.otherCodes.some(o=>o==a.Code)&&(this.hasDuplicateCode=!0),this.otherCodes.push(a.Code)});break;case this.COUNTRY:this.countries=[],n.data.forEach(a=>{let o=new rt.c;o.Code=a.Code,o.Name=a.Name,o.CompanyId=this.loginUser.CompanyId,o.CreatedBy=this.loginUser.Id;let I=this.master.Regions.find(b=>b.Code.toLowerCase()==a.RegionCode.toLowerCase());o.RegionId=I.Id,this.countries.push(o)});break;case this.CITY:this.cities=[],n.data.forEach(a=>{let o=new st.j;o.Name=a.Name,o.Code=a.Code,o.State=a.State,o.CompanyId=this.loginUser.CompanyId,o.CreatedBy=this.loginUser.Id;let I=E.g.getInstance().getByCode(a.Country.toLowerCase());o.CountryId=I.Id,this.cities.push(o)});break;case this.STATE:this.states=[],this.nameMissing=!1,this.codeMissing=!1,this.countryMissing=!1,this.hasDuplicateName=!1,this.hasDuplicateCode=!1,this.invalidCodeLength=!1,this.duplicateTaxCodePerCountry=!1;let D=new Map,N=[],j=new Map,P="",G=!1;if(n.data.forEach(a=>{var o,I,b,S;let F=null===(o=a.Name)||void 0===o?void 0:o.trim(),Z=null===(I=a.Co
1de)||void 0===I?void 0:I.trim(),Y=null===(b=a.Country)||void 0===b?void 0:b.trim(),z=null===(S=a.StateTaxCode)||void 0===S?void 0:S.trim();0===v.qI.getStrWithoutWhiteSpace(F).length&&(this.nameMissing=!0,G=!0),0===v.qI.getStrWithoutWhiteSpace(Z).length&&(this.codeMissing=!0,G=!0),0===v.qI.getStrWithoutWhiteSpace(Y).length&&(this.countryMissing=!0,G=!0),Z&&Z.length>5&&(this.invalidCodeLength=!0,G=!0);let W=`${F}_${Y}`;D.has(W)?(this.hasDuplicateName=!0,G=!0):D.set(W,Y),N.includes(Z)?(this.hasDuplicateCode=!0,G=!0):N.push(Z),z&&(j.has(Y)?(this.duplicateTaxCodePerCountry=!0,G=!0):j.set(Y,!0))}),G)return this.nameMissing&&(P+="|Name is missing"),this.codeMissing&&(P+="|Code is missing"),this.countryMissing&&(P+="|Country is missing"),this.hasDuplicateName&&(P+="|Duplicate state name for same country"),this.hasDuplicateCode&&(P+="|Duplicate state code"),this.invalidCodeLength&&(P+="|Code must be maximum 5 characters"),this.duplicateTaxCodePerCountry&&(P+="|Only one State Tax Code allowed per country"),P=P.substring(1),void this.master.alertCustomTitle(C._.getActivitiesRString(P),"error","Error");n.data.forEach(a=>{var o,I,b,S;let F=null===(o=a.Name)||void 0===o?void 0:o.trim(),Z=null===(I=a.Code)||void 0===I?void 0:I.trim(),Y=null===(b=a.Country)||void 0===b?void 0:b.trim(),z=null===(S=a.StateTaxCode)||void 0===S?void 0:S.trim(),W=new H.Z;W.Name=F,W.Code=Z,W.Country=Y,W.TaxCode=z,W.CreatedBy=this.loginUser.Id,W.CompanyId=this.loginUser.CompanyId;let T=E.g.getInstance().getByCodeOrName(Y,!0);T&&(W.CountryId=T.Id),this.states.push(W)});break;case this.PAYMENT_TYPE:this.paymenttypes=[],n.data.forEach(a=>{let o=new yt.M;o.Name=a.Name,o.Code=a.Code,o.CreatedBy=this.loginUser.Id,o.IsDefault=null!=a.IsDefault&&""!=a.IsDefault&&("true"==a.IsDefault.toLowerCase()||"yes"==a.IsDefault.toLowerCase()),o.Value=null==a.Value||""==a.Value?0:parseInt(a.Value),this.paymenttypes.push(o)});break;case this.CHARGES:this.chargeList=[],n.data.forEach(a=>{let o=new it.M;if(o.CompanyId=this.loginUser.CompanyId,o.CreatedBy=this.loginUser.Id,o.Code=a.Code,o.Name=a.Name,o.Remark=a.Description,o.IsAir=this.strToBool(a.IsAir),o.IsAirExport=this.strToBool(a.IsAirExport),o.IsAirImport=this.strToBool(a.IsAirImport),o.IsSea=this.strToBool(a.IsSea),o.IsSeaExport=this.strToBool(a.IsSeaExport),o.IsSeaImport=this.strToBool(a.IsSeaImport),o.IsInland=this.strToBool(a.IsInland),o.IsInlandExport=this.strToBool(a.IsInlandExport),o.IsInlandImport=this.strToBool(a.IsInlandImport),o.AutoDisplayReceivable=this.strToBool(a.IsReceivable),o.AutoDisplayPayable=this.strToBool(a.IsPayable),o.AutoDisplayQuotation=this.strToBool(a.IsQuotation),o.OtherCharge=this.strToBool(a.IsOtherCharge),o.ExternalAcctRefReceivable=a.ExternalAcctRefReceivable,o.ExternalAcctRefPayable=a.ExternalAcctRefPayable,o.AWBDefaultDueType=a.DueType,o.TmsChargeCode=a.TmsChargeCode,null!=a.IataChargeCode&&0!=a.IataChargeCode.length){let I=this.master.iatacharges.find(b=>b.ChargeCode.toLowerCase()==a.IataChargeCode.toLowerCase());I&&(o.IataChargeCode=I.Id)}if(null!=a.ChargeGroup&&0!=a.ChargeGroup.length){let I=[];a.ChargeGroup.split(",").forEach(b=>{let S=this.master.chargegroups.find(F=>F.GroupCode.toLowerCase()==b.toLowerCase().trim());S&&I.push(S.Id)}),o.ChargeGroup=Object.values(I).join(",")}if(null!=a.ChargeCategories&&0!=a.ChargeCategories.length){let I=[];a.ChargeCategories.split(",").forEach(b=>{let S=this.master.chargeCategories.find(F=>F.Label.toLowerCase()==b.toLowerCase().trim());S&&I.push(S.Id)}),o.ChargeCategory=Object.values(I).join(","),o.ChargeCategoryList=I}if(null!=a.CurrencyReceivable&&0!=a.CurrencyReceivable.length){let I=et.k.getInstance().getByCode(a.CurrencyReceivable);I&&(o.DefaultCurrReceivable=I.Id)}if(null!=a.CurrencyPayable&&0!=a.CurrencyPayable.length){let I=et.k.getInstance().getByCode(a.CurrencyPayable);I&&(o.DefaultCurrPayable=I.Id)}if(null!=a.MeasurementUnit&&0!=a.MeasurementUnit.length){let I=_.P.getInstance().getUOM(a.MeasurementUnit.trim());I&&(o.DefaultUOM=I.Id)}o.DefaultOrder=a.DefaultOrder?parseInt(a.DefaultOrder):null,this.chargeList.some(I=>I.Code==a.Code)&&(this.hasDuplicateCode=!0),this.chargeList.push(o)});break;case this.CHARGETAX:this.chargeTaxes=[],n.data.forEach(a=>{let o=new U.l;if(o.IsActive=null!=a.Active&&""!=a.Active&&"true"==a.Active.toLowerCase(),null!=a.ChargeCode&&0!=a.ChargeCode.length){let I=mt.q.getInstance().getByCode(a.ChargeCode.trim());null!=I?(o.ChargeId=I.Id,o.ChargeCode=I.Code):(this.missingRequired=!0,this.missedRequiredFields.push("ChargeCode"))}if(null!=a.TaxCode&&0!=a.TaxCode.length){let I=It.S.getInstance().getByCode(a.TaxCode.trim());null!=I&&(o.TaxId=I.Id)}this.chargeTaxes.some(I=>I.ChargeId==o.ChargeId)&&(this.hasDuplicateCode=!0),this.chargeTaxes.push(o)});break;case this.MILESTONE:this.milestons=[],n.data.forEach(a=>{let o=new K.r;o.Code=a.Code,o.Name=a.Name,o.Active=null!=a.Active&&""!=a.Active&&("true"==a.Active.toLowerCase()||"yes"==a.Active.toLowerCase()),o.IsAir=null!=a.IsAir&&""!=a.IsAir&&("true"==a.IsAir.toLowerCase()||"yes"==a.IsAir.toLowerCase()),o.IsAirExport=null!=a.IsAirExport&&""!=a.IsAirExport&&("true"==a.IsAirExport.toLowerCase()||"yes"==a.IsAirExport.toLowerCase()),o.IsAirImport=null!=a.IsAirImport&&""!=a.IsAirImport&&("true"==a.IsAirImport.toLowerCase()||"yes"==a.IsAirImport.toLowerCase()),o.IsSea=null!=a.IsSea&&""!=a.IsSea&&("true"==a.IsSea.toLowerCase()||"yes"==a.IsSea.toLowerCase()),o.IsSeaExport=null!=a.IsSeaExport&&""!=a.IsSeaExport&&("true"==a.IsSeaExport.toLowerCase()||"yes"==a.IsSeaExport.toLowerCase()),o.IsSeaImport=null!=a.IsSeaImport&&""!=a.IsSeaImport&&("true"==a.IsSeaImport.toLowerCase()||"yes"==a.IsSeaImport.toLowerCase()),o.IsInland=null!=a.IsInland&&""!=a.IsInland&&("true"==a.IsInland.toLowerCase()||"yes"==a.IsInland.toLowerCase()),o.IsInlandExport=null!=a.IsInlandExport&&""!=a.IsInlandExport&&("true"==a.IsInlandExport.toLowerCase()||"yes"==a.IsInlandExport.toLowerCase()),o.IsInlandImport=null!=a.IsInlandImport&&""!=a.IsInlandImport&&("true"==a.IsInlandImport.toLowerCase()||"yes"==a.IsInlandImport.toLowerCase()),o.ShowDefault=null!=a.ShowDefault&&""!=a.ShowDefault&&("true"==a.ShowDefault.toLowerCase()||"yes"==a.ShowDefault.toLowerCase()),this.milestons.some(I=>I.Code==a.Code)&&(this.hasDuplicateCode=!0),this.milestons.push(o)})}if(this.importData.Type!=this.TC){if(this.nameAlreadyExists&&(c="Party by following name already exists: ",c+=this.existingDataFields.length>3?this.existingDataFields.slice(0,3).join():this.existingDataFields.join(),f.J.formMessagesService.showErrorByMsg(c)),this.hasDuplicateCode){var u=f.J.translate.instant("modules.Others.importdataWindow.Msgs.duplicateCodeInFile");f.J.formMessagesService.showErrorByMsg(u)}else this.hasDuplicateName&&(u=f.J.translate.instant("modules.Others.importdataWindow.Msgs.duplicateNameInFile"),f.J.formMessagesService.showErrorByMsg(u));this.hasIncorrectFormat&&(u=f.J.translate.instant("modules.Others.importdataWindow.Msgs.DateFormatIsWrong"),f.J.formMessagesService.showErrorByMsg(u)),this.hasIncorrectDate&&(u=f.J.translate.instant("modules.Others.importdataWindow.Msgs.DateIsWrong"),f.J.formMessagesService.showErrorByMsg(u)),this.hasDataOverflow&&(u=f.J.translate.instant("modules.Others.importdataWindow.Msgs.DataOverflowErr"),u+="<br /><br />"+this.maxAllowedLength.join(", "),f.J.formMessagesService.showErrorByMsg(u)),this.missingRequired&&(u=f.J.translate.instant("modules.Others.importdataWindow.Msgs.MissingRequiredFields"),u+="<br /><br />"+this.missedRequiredFields.join(", "),f.J.formMessagesService.showErrorByMsg(u)),this.invalidDataFields.length>0&&(u=f.J.translate.instant("modules.Others.importdataWindow.Msgs.invalidDataFound"),u+="<br /><br />"+this.invalidDataFields.join(", "),f.J.formMessagesService.showErrorByMsg(u))}return n}getParsedDataFromSheet(n){var d=[],c=[],u=null;try{n.columns.forEach(l=>{l.values&&l.values.length>1&&(console.log(l.values),d.push(l.values[1].toString()))}),n.rowCount>
11&&n.getRows(2,n.rowCount-1).forEach(l=>{for(var D={},N=0;N<d.length;N++)D[d[N]]=l.values[N+1];c.push(D)}),u={data:c=c.filter(l=>{var D=!1;return d.forEach(N=>{null!=l[N]&&(D=!0)}),D}),meta:{delimiter:null,linebreak:null,aborted:!1,fields:d,truncated:!1},errors:null}}catch(l){console.log(l)}return u}parseCsvFile(n){return Tt(this,void 0,void 0,function*(){let d=new FileReader;d.onload=c=>Tt(this,void 0,void 0,function*(){var u,g;if(this.exceljs||(this.exceljs=yield this.exceljsLoader.loadExceljs()),this.IsExcelFile){let D=null===(u=c.target)||void 0===u?void 0:u.result;const N=new this.exceljs.Workbook;yield N.xlsx.load(D),console.log(N);var l=this.getParsedDataFromSheet(N.worksheets[0]);this.validateCSV(l)?this.fillGrid(this.prepareList(l)):this.reset()}else{let D=null===(g=c.target)||void 0===g?void 0:g.result,j=new TextDecoder("utf-8").decode((new TextEncoder).encode(D));this.papa.parse(j,{header:!0,skipEmptyLines:"greedy",complete:P=>{this.validateCSV(P)?this.fillGrid(this.prepareList(P)):this.reset()},error:P=>{f.J.formMessagesService.showErrorByMsg("Error parsing CSV")}})}}),this.IsExcelFile?d.readAsArrayBuffer(n):d.readAsText(n,"ISO-8859-1")})}get IsExcelFile(){return this.importData.Type==this.CURRENCY||this.importData.Type==this.TC}strToBool(n){return!!n&&"true"===n.toLowerCase()}validateCSV(n){let u=this.importData.getHeaders(this.importData.Type),g=!0,O=!0;
1if(u.forEach(D=>{0==n.meta.fields.filter(N=>N==D).length&&O&&(O=!1)}),g=O,!g){var l=f.J.translate.instant("modules.Others.importdataWindow.Msgs.incorrectColumnFound");f.J.formMessagesService.showErrorByMsg(l)}return g}cancel(){this.partyImportdata.data=[],this.selectedFileName=f.J.translate.instant("modules.Others.importdataWindow.labels.lblNoFileChosen")}reset(){this.fileInput&&(this.fileInput.nativeElement.value=""),this.cancel()}isValid(){return null!=this.partyImportdata.data&&0!=this.partyImportdata.data.length}getCodes(n){let d=[];if(n&&n.length>0)if(n[0]instanceof X.TC)for(let c of n){let u=c.getDataName();u&&u.length&&d.push(u)}else for(let c of n){let u=c.getCode();u&&u.length&&d.push(u)}return d}duplicate(n,d){if(n[0]instanceof U.l)for(let c of n){let u=d.find(g=>g.ChargeId==c.ChargeId);if(u)return u.ChargeName}else{let c=this.getCodes(n),u=this.getCodes(d);for(let g of c)if(null!=u.find(O=>O.toLowerCase()==g.toLowerCase()))return g}return null}typicalFlow(){return[this.REGION,this.TC,this.VESSEL,this.COMMODITY,this.CONTAINERSIZE,this.AIRPORTS,this.PORTS,this.TERMINALS,this.AIRLINE,this.INLAND_CARRIER,this.SHIPPING_LINE,this.CURRENCY,this.CHARGETAX,this.MILESTONE,this.PAYMENT_TYPE,this.CHARGES].includes(this.importdataInput.Type)}onSubmit(){return Tt(this,void 0,void 0,function*(){if(this.pristine=!1,!this.isValid()){var n=f.J.translate.instant("modules.Others.importdataWindow.Msgs.noRecordsFound");return void f.J.formMessagesService.showErrorByMsg(n)}this.loading=!0;let d=[],c=this.importdataInput.clone(),u=this.importdataInput.Type,g=i.A.getInstance().getBC(u);this.typicalFlow()?this.partyImportdata.data.forEach(l=>{l.CompanyId=this.loginUser.CompanyId,l.CreatedBy=this.loginUser.Id,(u==this.AIRLINE||u==this.INLAND_CARRIER)&&(l.LogoId=0),d.push(l),g=l.getBC()}):u==this.USER_VALUE_DETAIL?this.partyImportdata.data.forEach(l=>{l.CompanyId=this.loginUser.CompanyId;let D=dt.Q.getInstance().values.find(N=>N.Name.toLowerCase().trim()==l.Category.toLowerCase().trim());l.ValueId=D?D.Id:0,d.push(l),g=l.getBC()}):u==this.CHARGES?d=this.chargeList:u==this.COUNTRY?d=this.countries:u==this.CITY?d=this.cities:u==this.STATE&&(yield q.G.getInstance().insertlist(this.partyImportdata.data));let O=null==g?void 0:g.getMasterEntities();if(u==this.CHARGETAX&&(O=yield J.q.getInstance().getFullByCompany()),console.log("getBC",g,u,O),d.length>0){u==this.CURRENCY&&(O=[]);let l=this.duplicate(d,O);if(l&&l.length)this.loading=!1,f.J.formMessagesService.showErrorByMsg(f.J.translate.instant("modules.Others.importdataWindow.Msgs.dup")+": "+l);else{let D=yield g.insertlist(d);"already_exists"==D.Status?f.J.notificationService.error(f.J.translate.instant(D.Message)):f.J.notificationService.Alert(D.Status.toLowerCase(),f.J.translate.instant(D.Message)),this.logAction(k.H.IMPORT,D.DataObject,c,u),this.loading=!1,this.submited.emit(D.DataObject),this.close()}}else{if((this.importData.Type==m.YD.CUSTOMER||this.importData.Type==m.YD.SHIPPER||this.importData.Type==m.YD.CONSIGNEE||this.importData.Type==m.YD.PARTY_AGENT||this.importData.Type==m.YD.AGENT||this.importData.Type==m.YD.CHA||this.importData.Type==m.YD.CFS||this.importData.Type==m.YD.ROAD_TRANSPORT||this.importData.Type==m.YD.BANK||this.importData.Type==m.YD.LEADS||this.importData.Type==m.YD.COLOAD||this.importData.Type==m.YD.WAREHOUSE||this.importData.Type==m.YD.VENDOR||this.importData.Type==m.YD.NETWORK)&&(this.partyImportdata.data.forEach(l=>{l.CompanyId=this.loginUser.CompanyId,l.CompanyReferenceId=this.loginUser.CompanyId,l.CompanyType=this.importData.Type,l.CreatedByUserId=this.loginUser.Id,l.AvailableRoles=l.downgradeRoleName;let D=[];l.AvailableRoles&&l.AvailableRoles.split(",").forEach(N=>{D.push(N)}),l.AvailableRolesList=D,l.AvailableRoles=Object.values(D).join(","),l.WL_Position=l.WL_Position?l.WL_Position:0,this.importData.Type==m.YD.VENDOR&&(l.VendorType="GENERAL"),l.eawb={EawbName:l.EawbName,EawbAddressLine1:l.EawbAddressLine1,EawbAddressLine2:l.EawbAddressLine2,EawbCity:l.EawbCity,EawbState:l.EawbState,EawbZipCode:l.EawbZipCode,EawbPhone:l.EawbPhone,EawbCountryCode:l.EawbCountryCode,EawbType:"COMPANY"},d.push(l)}),d.length>0)){O=this.master.companies;let l=this.duplicate(d,O);if(console.log("dupVal",l),l&&l.length)this.loading=!1,f.J.formMessagesService.showErrorByMsg(f.J.translate.instant("modules.Others.importdataWindow.Msgs.dup")+": "+l);else{if(!this.checkEawbFields(d))return this.loading=!1,void this.close();let D=yield ut.C.getInstance().insertlist(d);f.J.notificationService.Alert(D.Status,D.Message),this.logAction(k.H.IMPORT,D.DataObject,c,this.importData.Type)}}this.loading=!1,this.submited.emit(this.importdataInput),this.close()}})}checkEawbFields(n){for(let d=0;d<n.length;d++){const c=this.validateEawb(n[d].eawb,d);if(c.hasError)return f.J.notificationService.error(c.message),!1}return!0}validateEawb(n,d){const c=`at row ${d+1}`;if(n.EawbName&&n.EawbName.length>35)return{hasError:!0,message:`EawbName should not exceed 35 characters ${c}`};if(n.EawbAddressLine1&&n.EawbAddressLine1.length>35)return{hasError:!0,message:`EawbAddressLine1 should not exceed 35 characters ${c}`};if(n.EawbAddressLine2&&n.EawbAddressLine2.length>35)return{hasError:!0,message:`EawbAddressLine2 should not exceed 35 characters ${c}`};if(n.EawbCity&&n.EawbCity.length>17)return{hasError:!0,message:`EawbCity should not exceed 17 characters ${c}`};if(n.EawbState&&n.EawbState.length>9)return{hasError:!0,message:`EawbState should not exceed 9 characters ${c}`};if(n.EawbZipCode){if(n.EawbZipCode.length>9)return{hasError:!0,message:`EawbZipCode should not exceed 9 characters ${c}`};if(!/^[0-9A-Za-z\- ]+$/.test(n.EawbZipCode))return{hasError:!0,message:`The value entered doesn\u2019t match the required format \u2014 EawbZipCode ${c}`}}if(n.EawbCountryCode){if(n.EawbCountryCode.length>2)return{hasError:!0,message:`EawbCountryCode should not exceed 2 characters ${c}`};if(!/^[A-Za-z]+$/.test(n.EawbCountryCode))return{hasError:!0,message:`The value entered doesn\u2019t match the required format \u2014 EawbCountryCode ${c}`}}if(n.EawbPhone){if(n.EawbPhone.length>25)return{hasError:!0,message:`EawbPhone should not exceed 25 characters ${c}`};if(!/^[0-9]+$/.test(n.EawbPhone))return{hasError:!0,message:`The value entered doesn\u2019t match the required format \u2014 EawbPhone ${c}`}}return{hasError:!1,message:""}}fillGrid(n){switch(this.importData.Type){case this.REGION:this.partyImportdata={title:"Regions",data:this.importData.getDatalist(this.importData.Type,n),type:this.REGION,columns:lt.y.ColumnModel};break;case this.TC:this.partyImportdata={title:"Clauses",data:this.importData.getDatalist(this.importData.Type,n),type:this.TC,columns:X.TC.ColumnModel};break;case this.VESSEL:this.partyImportdata={title:"Vessel",data:this.importData.getDatalist(this.importData.Type,n),type:this.VESSEL,columns:At.F.ColumnModel};break;case this.USER_VALUE_DETAIL:this.partyImportdata={title:"User Value Detail",data:this.importData.getDatalist(this.importData.Type,n),type:this.USER_VALUE_DETAIL,columns:p.Z.ColumnModel};break;case this.COMMODITY:this.partyImportdata={title:"Commodity",data:this.importData.getDatalist(this.importData.Type,n),type:this.COMMODITY,columns:ft.e.ColumnModel};break;case this.CONTAINERSIZE:this.partyImportdata={title:"Container Sizes",data:this.importData.getDatalist(this.importData.Type,n),type:this.CONTAINERSIZE,columns:ot.B.ColumnModel};break;case this.CHARGES:this.partyImportdata={title:"Charges",data:this.chargeList,type:this.CHARGES,columns:it.M.ColumnModel};break;case this.COUNTRY:this.partyImportdata={title:"Countries",data:this.countries,type:this.COUNTRY,columns:rt.c.ColumnModel};break;case this.STATE:this.partyImportdata={title:"States",data:this.states,type:this.STATE,columns:H.Z.ColumnModel};break;case this.AIRPORTS:this.partyImportdata={title:"Airports",data:this.importData.getDatalist(this.importData.Type,n),type:this.AIRPORTS,columns:Ct.v.ColumnModel};break;case this.INLAND_CARRIER:this.partyImportdata={title:"Inland Carriers",data:this.importData.getDatalist(this.importData.Type,n),type:this.INLAND_CARRIER,columns:t.h.ColumnModel};break;case this.PORTS:this.partyImportdata={title:"Ports",data:this.importData.getDatalist(this.importData.Type,n),type:this.PORTS,columns:gt.G.ColumnModel};break;case this.TERMINALS:this.partyImportdata={title:"Terminals",data:this.importData.getDatalist(this.importData.Type,n),type:this.TERMINALS,columns:pt.o.ColumnModel};break;case this.CITY:this.partyImportdata={title:"City",data:this.cities,type:this.CITY,columns:st.j.ColumnModel};break;case this.AIRLINE:let c=at.J.ColumnModel.filter(l=>"geteAWB"!=l.PropertyName&&"geteBooking"!=l.PropertyName&&"MainContactName"!=l.PropertyName&&"MainContactNumber"!=l.PropertyName&&"IATAAccountNumber"!=l.PropertyName);c=[...c,{Title:f.J.translate.instant("modules.Master.Carriers.screens.AIRLINE.TableCols.PrimaryContact"),PropertyName:"MainContactName",IsSelected:!0},{Title:f.J.translate.instant("modules.Master.Carriers.screens.AIRLINE.TableCols.ContactNumber"),PropertyName:"MainContactNumber",IsSelected:!0},{Title:f.J.translate.instant("modules.Master.Carriers.screens.AIRLINE.TableCols.IATAAccountNumber"),PropertyName:"IATAAccountNumber",IsSelected:!0}];var d=this.importData.getDatalist(this.importData.Type,n);d&&d.forEach(l=>{l.CompanyId=this.loginUser.CompanyId}),this.partyImportdata={title:"Airlines",data:d,type:this.AIRLINE,columns:c};break;case this.SHIPPING_LINE:this.partyImportdata={title:"Shipping Lines",data:this.importData.getDatalist(this.importData.Type,n),type:this.SHIPPING_LINE,columns:ht.d.ColumnModel};break;case this.CURRENCY:let u=_t.F.ColumnModel;this.partyImportdata={title:"Currency",data:this.importData.getDatalist(this.importData.Type,n),type:this.CURRENCY,columns:u};break;case this.CHARGETAX:this.partyImportdata={title:"Charge Tax Master",data:this.chargeTaxes,type:this.CHARGETAX,columns:U.l.ColumnModel};break;case this.MILESTONE:this.partyImportdata={title:"Milestone",data:this.milestons,type:this.MILESTONE,columns:K.r.ColumnModel};break;case this.PAYMENT_TYPE:this.partyImportdata={title:"Payment Term",data:this.paymenttypes,type:this.PAYMENT_TYPE,c
1olumns:yt.M.ColumnModel};break;case m.YD.CUSTOMER:case m.YD.AGENT:let g=m.YD.ColumnModel(this.importData.Type);g=g.filter(l=>"modifiedUserName"!=l.PropertyName&&"CreatedByName"!=l.PropertyName&&"RegisteredBranchName"!=l.PropertyName),g=[...g,{Title:"VAT Number",PropertyName:"VATNumber",IsSelected:!0},{Title:"eAWB Name",PropertyName:(0,r.$0)("EawbName"),IsSelected:!0},{Title:"eAWB Address 1",PropertyName:(0,r.$0)("EawbAddressLine1"),IsSelected:!0},{Title:"eAWB Address 2",PropertyName:(0,r.$0)("EawbAddressLine2"),IsSelected:!0},{Title:"eAWB City",PropertyName:(0,r.$0)("EawbCity"),IsSelected:!0},{Title:"eAWB State",PropertyName:(0,r.$0)("EawbState"),IsSelected:!0},{Title:"eAWB Country",PropertyName:(0,r.$0)("EawbCountryCode"),IsSelected:!0},{Title:"eAWB Zipcode",PropertyName:(0,r.$0)("EawbZipCode"),IsSelected:!0},{Title:"eAWB Phone",PropertyName:(0,r.$0)("EawbPhone"),IsSelected:!0}],this.partyImportdata={title:this.importData.Type,data:this.importData.getDatalist(this.importData.Type,n),type:this.importData.Type+"_IMP",columns:g};break;case m.YD.SHIPPER:case m.YD.CONSIGNEE:case m.YD.PARTY_AGENT:case m.YD.CHA:case m.YD.CFS:case m.YD.ROAD_TRANSPORT:case m.YD.BANK:case m.YD.LEADS:case m.YD.COLOAD:case m.YD.WAREHOUSE:case m.YD.VENDOR:case m.YD.NETWORK:let O=m.YD.ColumnModel(this.importData.Type);O=O.filter(l=>"modifiedUserName"!=l.PropertyName&&"CreatedByName"!=l.PropertyName&&"RegisteredBranchName"!=l.PropertyName),O=[...O,{Title:"VAT Number",PropertyName:"VATNumber",IsSelected:!0},{Title:"eAWB Name",PropertyName:(0,r.$0)("EawbName"),IsSelected:!0},{Title:"eAWB Address 1",PropertyName:(0,r.$0)("EawbAddressLine1"),IsSelected:!0},{Title:"eAWB Address 2",PropertyName:(0,r.$0)("EawbAddressLine2"),IsSelected:!0},{Title:"eAWB City",PropertyName:(0,r.$0)("EawbCity"),IsSelected:!0},{Title:"eAWB State",PropertyName:(0,r.$0)("EawbState"),IsSelected:!0},{Title:"eAWB Country",PropertyName:(0,r.$0)("EawbCountryCode"),IsSelected:!0},{Title:"eAWB Zipcode",PropertyName:(0,r.$0)("EawbZipCode"),IsSelected:!0},{Title:"eAWB Phone",PropertyName:(0,r.$0)("EawbPhone"),IsSelected:!0}],this.partyImportdata={title:this.importData.Type,data:this.importData.getDatalist(this.importData.Type,n),type:this.importData.Type,columns:O}}}get showPartyInfo(){return this.importData.Type==m.YD.CUSTOMER||this.importData.Type==m.YD.SHIPPER||this.importData.Type==m.YD.CONSIGNEE||this.importData.Type==m.YD.PARTY_AGENT||this.importData.Type==m.YD.AGENT||this.importData.Type==m.YD.CHA||this.importData.Type==m.YD.CFS||this.importData.Type==m.YD.ROAD_TRANSPORT||this.importData.Type==m.YD.BANK||this.importData.Type==m.YD.LEADS||this.importData.Type==m.YD.COLOAD||this.importData.Type==m.YD.WAREHOUSE||this.importData.Type==m.YD.VENDOR||this.importData.Type==m.YD.NETWORK}get DisabledSubmitBtn(){if(this.importData.Type!=this.TC){if(this.hasDuplicateCode||this.hasDuplicateName||this.nameAlreadyExists||this.hasIncorrectFormat||this.hasIncorrectDate||this.hasDataOverflow||this.missingRequired||this.invalidDataFields.length>0||this.minimumLenthRequiredMsgs.length>0)return!0}else if(this.hasDuplicateName||this.invalidCategory||this.catMissing||this.nameMissing||this.contentMissing)return!0;return!1}}return A.\u0275fac=function(n){return new(n||A)(e.Y36(M.N),e.Y36(Q.K))},A.\u0275cmp=e.Xpm({type:A,selectors:[["app-importmasterdata-window"]],viewQuery:function(n,d){if(1&n&&(e.Gf(Rt,7),e.Gf(vt,7)),2&n){let c;e.iGM(c=e.CRH())&&(d.modalRef=c.first),e.iGM(c=e.CRH())&&(d.fileInput=c.first)}},inputs:{modalLevel:"modalLevel",importdataInput:"importdataInput"},outputs:{import:"import",submited:"submited"},features:[e.qOj],decls:46,vars:38,consts:[["tabindex","-1","role","dialog","aria-labelledby","ImportDataFileWindowLabel","aria-hidden","true","data-backdrop","static","data-keyboard","false",1,"modal","fade","bd-example-modal-sm",3,"ngClass"],["modalRef",""],[1,"modal-dialog","modal
1-lg","modal-dialog-scrollable",3,"ngClass"],[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"modal-body"],[1,"row"],[1,"form-group","required","col-md-12"],["target","_blank",3,"href"],[1,"col-sm-4","required","mt-2"],["for","fileInput"],[4,"ngIf"],[1,"col-sm-4"],[1,"btn","btn-primary",3,"click"],["type","file",2,"display","none",3,"change"],["fileInput",""],[1,"ml-2"],["class","row",4,"ngIf"],[1,"row","mt-2"],[1,"col"],[1,"table-panel","col"],[3,"type","columns","data","showActions","enableSort","showImportButton","showColumnReOrderButton","enableHorizontalScroll","templateRef1"],["template1",""],["class","modal-footer",4,"ngIf"],[1,"col-md-12"],[1,"m-2"],[1,"mb-0"],[4,"ngFor","ngForOf"],[1,"ml-1","mb-1"],["role","alert",1,"alert","alert-info"],[3,"innerHtml"],[1,"modal-footer"],["type","button",1,"btn","btn-light",3,"click"],["type","button","dbclick","",1,"btn","btn-primary",3,"disabled","dbclick"],["role","status",1,"spinner-border","text-primary"],[1,"sr-only"]],template:function(n,d){if(1&n){const c=e.EpF();e.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"h5",5),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"button",6),e.NdJ("click",function(){return d.close()}),e.TgZ(9,"span",7),e._uU(10,"\xd7"),e.qZA()()(),e.TgZ(11,"div",8)(12,"div",9)(13,"div",10)(14,"a",11),e._uU(15),e.ALo(16,"translate"),e.qZA()()(),e.TgZ(17,"div",9)(18,"div",12)(19,"label",13),e.YNc(20,Mt,3,3,"span",14),e.YNc(21,Pt,3,3,"span",14),e.qZA()(),e.TgZ(22,"div",15)(23,"label")(24,"button",16),e.NdJ("click",function(){e.CHM(c);const g=e.MAs(28);return g.click(),g.value=""}),e._uU(25),e.ALo(26,"translate"),e.qZA(),e.TgZ(27,"input",17,18),e.NdJ("change",function(g){return d.handleUpload(g)}),e.qZA()(),e.TgZ(29,"span",19),e._uU(30),e.qZA()()(),e.YNc(31,wt,25,19,"div",20),e.TgZ(32,"div",21)(33,"div",22),e.YNc(34,Wt,4,0,"div",14),e.TgZ(35,"h4"),e._uU(36),e.ALo(37,"translate"),e.qZA(),e.YNc(38,Bt,17,0,"div",14),e.qZA()(),e.TgZ(39,"div",21)(40,"div",23),e._UZ(41,"app-common-table",24),e.YNc(42,Ut,1,1,"ng-template",null,25,e.W1O),e.qZA()()(),e.YNc(44,Yt,10,10,"div",26),e.YNc(45,xt,5,3,"div",26),e.qZA()()()}if(2&n){const c=e.MAs(43);e.Q6J("ngClass",e.WLB(32,Ft,2==d.modalLevel,3==d.modalLevel)),e.xp6(2),e.Q6J("ngClass",e.WLB(35,Zt,2==d.modalLevel,3==d.modalLevel)),e.xp6(4),e.hij(" ",e.lcZ(7,24,"modules.Others.importdataWindow.labels.lblTitle")," "),e.xp6(8),e.s9C("href",d.filetemplateURL,e.LSH),e.xp6(1),e.hij(" ",e.lcZ(16,26,"modules.Others.importdataWindow.labels.lblDownloadTemplate")," "),e.xp6(5),e.Q6J("ngIf",!d.IsExcelFile),e.xp6(1),e.Q6J("ngIf",d.IsExcelFile),e.xp6(4),e.hij(" ",e.lcZ(26,28,"modules.Others.importdataWindow.labels.lblBrowseFile")," "),e.xp6(5),e.Oqu(d.selectedFileName),e.xp6(1),e.Q6J("ngIf",d.showPartyInfo),e.xp6(3),e.Q6J("ngIf","VESSEL"==d.importData.Type),e.xp6(2),e.hij(" ",e.lcZ(37,30,"modules.Others.importdataWindow.labels.lblDataProcessed")," "),e.xp6(2),e.Q6J("ngIf","TC"==d.importData.Type),e.xp6(3),e.Q6J("type",d.partyImportdata.type)("columns",d.partyImportdata.columns)("data",d.partyImportdata.data)("showActions",!1)("enableSort",!1)("showImportButton",!1)("showColumnReOrderButton",!0)("enableHorizontalScroll",!0)("templateRef1",c),e.xp6(3),e.Q6J("ngIf",!d.loading),e.xp6(1),e.Q6J("ngIf",d.loading)}},directives:[Dt.mk,Dt.O5,Dt.sg,Ot.u,bt.J],pipes:[St.X$],styles:[""]}),A})()},45475:(Nt,ct,h)=>{h.d(ct,{E:()=>K});var e=h(73135),k=h(77432),at=h(7981),Ct=h(31628),mt=h(90083),ut=h(11141),E=h(13585),et=h(57274),f=h(70760),It=h(40971),Et=h(49683),it=h(73514),st=h(25441),ft=h(14383),m=h(70505),ot=h(73431),rt=h(6094),_t=h(21373),nt=h(1119),dt=h(1394),gt=h(6934),lt=h(91439),ht=h(50409),U=h(93958),X=h(96944),pt=h(6018),At=h(7754);class K extends at.eO{constructor(){super(...arguments),this.REGION="REGION",this.TC="TC",this.VESSEL="VESSEL",this.COMMODITY="COMMODITY",this.CONTAINERSIZE="CONTAINERSIZE",this.CHARGES="CHARGES",this.COUNTRY="COUNTRY",this.CITY="CITY",this.AIRPORTS="AIRPORTS",this.PORTS="PORTS",this.TERMINALS="TERMINALS",this.AIRLINE="AIRLINE",this.SHIPPING_LINE="SHIPPING_LINE",this.CURRENCY="CURRENCY",this.CHARGETAX="CHARGETAX",this.MILESTONE="MILESTONES",this.PAYMENT_TYPE="PAYMENT_TYPE",this.INLAND_CARRIER="INLAND_CARRIER",this.USER_VALUE_DETAIL="USER_VALUE_DETAIL",this.STATE="STATE"}getBC(){return null}newEntity(){return new K}className(){return"ImportData"}getHeaders(s){let t=[];return s==this.REGION?t=["Code","Name"]:s==this.USER_VALUE_DETAIL?t=["Category","ListValue","ListCode","Order"]:s==this.TC?t=["Name","Content","Category"]:s==this.VESSEL?t=["Code","Name","IMO","Flag","Remark"]:s==this.COMMODITY?t=["Code","Name","Group"]:s==this.CONTAINERSIZE?t=["Name","Code","TEU","Description"]:s==this.CHARGES?t=["Code","Name","ChargeCategories","ChargeGroup","IsAir","IsAirExport","IsAirImport","IsSea","IsSeaExport","IsSeaImport","IsInland","IsInlandExport","IsInlandImport","CurrencyReceivable","CurrencyPayable","IsReceivable","IsPayable","IsQuotation","IsOtherCharge","MeasurementUnit","DefaultOrder","Description","DueType","IataChargeCode","ReceivableReference","PayableReference","TmsChargeCode"]:s==this.CHARGETAX?t=["ChargeCode","TaxCode","Active"]:s==this.COUNTRY?t=["Code","Name","RegionCode"]:s==this.AIRPORTS||s==this.PORTS||s==this.TERMINALS?t=["Code","Name","Address","Country"]:s==this.CITY?t=["Code","Name","State","Country"]:s==this.AIRLINE?t=["Name","AlphaCode","NumericCode","MainContactName","MainContactNumber","Website","IATAAccountNumber","Address","Payable Carrier","Receivable Carrier"]:s==this.SHIPPING_LINE?t=["Name","SCACCode","FMCCode","MainContactName","MainContactNumber","Website","Address","Payable Carrier","Receivable Carrier"]:s==this.CURRENCY?t=["Currency Code","
1Exchange rate to Branch Curr","Symbol","AsOnDate"]:s==E.YD.CUSTOMER||s==E.YD.AGENT?t=["Name*","Code","Short Name","Legal Name","Website","Email","Phone","Address*","CountryCode*","City*","Zipcode","Other Party Roles","Description","PrintField","BusinessId","Language","VAT Number","Group","Salesperson Email id","Primary Contact","Payable Party","Receivable Party"]:s==E.YD.SHIPPER||s==E.YD.CONSIGNEE||s==E.YD.PARTY_AGENT||s==E.YD.CHA||s==E.YD.CFS||s==E.YD.ROAD_TRANSPORT||s==E.YD.BANK||s==E.YD.LEADS||s==E.YD.COLOAD||s==E.YD.WAREHOUSE||s==E.YD.VENDOR||s==E.YD.NETWORK?t=["Name*","Code","Short Name","Legal Name","Website","Email","Phone","Address*","CountryCode*","City*","Zipcode","Other Party Roles","Description","PrintField","BusinessId","Language","VAT Number","Primary Contact","Payable Party","Receivable Party"]:s==this.PAYMENT_TYPE?t=["Code","Name","IsDefault","Value"]:s==this.MILESTONE?t=["Code","Name","Active","IsAir","IsAirExport","IsAirImport","IsSea","IsSeaExport","IsSeaImport","IsInland","IsInlandExport","IsInlandImport","ShowDefault"]:s==this.INLAND_CARRIER?t=["Code","Name","MainContactName","MainContactNumber","Website","Address","Payable Carrier","Receivable Carrier"]:s==this.STATE&&(t=["Name","Code","Country","StateTaxCode"]),t}getTemplateURL(s){return s==this.REGION?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/RegionTemplate_1.0.0.csv":s==this.USER_VALUE_DETAIL?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/ValueDetailTemplate_v1.0.csv":s==this.TC?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/TCTemplate_3.0.0.xlsx":s==this.VESSEL?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/VesselTemplate_2.0.csv":s==this.COMMODITY?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/CommodityTemplate_1.0.0.csv":s==this.CONTAINERSIZE?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/ContainerSizeTemplate_1.0.0.csv":s==this.CHARGES?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/ChargeTemplate_v2.0.csv":s==this.COUNTRY?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/CountryTemplate.csv":s==this.STATE?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/StateTemplate.csv":s==this.AIRPORTS?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/AirportTemplate.csv":s==this.PORTS?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/PortTemplate.csv":s==this.TERMINALS?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/TerminalTemplate_1.0.0.csv":s==this.CITY?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/CityTemplate.csv":s==this.AIRLINE?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/AirlineTemplate_v1061.csv":s==this.SHIPPING_LINE?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/ShippingLineTemplate_v1061.csv":s==this.CURRENCY?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/CurrencyTemplate_v1.1.xlsx":s==this.CHARGETAX?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/ChargeTaxTemplate.csv":s==E.YD.CUSTOMER||s==E.YD.AGENT?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/CustomerAgentTemplate_v1062.csv":s==E.YD.SHIPPER||s==E.YD.CONSIGNEE||s==E.YD.PARTY_AGENT||s==E.YD.CHA||s==E.YD.CFS||s==E.YD.ROAD_TRANSPORT||s==E.YD.BANK||s==E.YD.LEADS||s==E.YD.COLOAD||s==E.YD.WAREHOUSE||s==E.YD.VENDOR||s==E.YD.NETWORK?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/PartyTemplate_v1062.csv":s==this.PAYMENT_TYPE?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/PaymentTermTemplate.csv":s==this.MILESTONE?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/MilestoneTemplate.csv":s==this.INLAND_CARRIER?"https://fileserve.blob.core.windows.net/files/FMS/resources/upload_templates/InlandTemplate_v1061.csv":void 0}getDatalist(s,t){let _;if(null!=t&&0!=t.data.length)if(s==this.REGION){let p=[];for(let i=0;i<t.data.length;i++){let r=new st.y;r.mapServiceObj(JSON.parse(JSON.stringify({Code:t.data[i].Code,Name:t.data[i].Name}))),p.push(r)}_=p}else if(s==this.TC){let p=[];for(let i=0;i<t.data.length;i++){let r=new ot.TC;r.mapServiceObj(JSON.parse(JSON.stringify({Name:t.data[i].Name,Content:t.data[i].Content,Category:t.data[i].Category}))),console.log("TC obj:",r),p.push(r)}_=p}else if(s==this.USER_VALUE_DETAIL){let p=[];for(let i=0;i<t.data.length;i++){let r=new gt.Z;r.mapServiceObj(JSON.parse(JSON.stringify({Category:t.data[i].Category.trim(),Name:t.data[i].ListV
1alue.trim(),Code:t.data[i].ListCode,Order:t.data[i].Order}))),p.push(r)}_=p,console.log("valueDetailList",p)}else if(s==this.VESSEL){let p=[];for(let i=0;i<t.data.length;i++){let r=new nt.F;r.mapServiceObj(JSON.parse(JSON.stringify({Code:t.data[i].Code,Name:t.data[i].Name,IMO:t.data[i].IMO,Flag:t.data[i].Flag,Remark:t.data[i].Remark}))),p.push(r)}_=p}else if(s==this.COMMODITY){let p=[];for(let i=0;i<t.data.length;i++){let r=new ut.e;r.mapServiceObj(JSON.parse(JSON.stringify({Code:t.data[i].Code,Name:t.data[i].Name,Group:t.data[i].Group}))),p.push(r)}_=p}else if(s==this.CONTAINERSIZE){let p=[];for(let i=0;i<t.data.length;i++){let r=new et.B;r.mapServiceObj(JSON.parse(JSON.stringify({Name:t.data[i].Name,Code:t.data[i].Code,TEU:t.data[i].TEU,Description:t.data[i].Description}))),p.push(r)}_=p}else if(s==this.CHARGES){let p=[];for(let i=0;i<t.data.length;i++){let r=new Ct.M;r.Name=t.data[i].Name,r.Code=t.data[i].Code,r.Remark=t.data[i].Description,r.IataChargeCode=t.data[i].IataChargeCode,r.ChargeGroup=t.data[i].ChargeGroup,r.ChargeCategories=t.data[i].ChargeCategories,r.ChargeCategoryList=[],r.IsAir=this.strToBool(t.data[i].IsAir),r.IsAirExport=this.strToBool(t.data[i].IsAirExport),r.IsAirImport=this.strToBool(t.data[i].IsAirImport),r.IsSea=this.strToBool(t.data[i].IsSea),r.IsSeaExport=this.strToBool(t.data[i].IsSeaExport),r.IsSeaImport=this.strToBool(t.data[i].IsSeaImport),r.IsInland=this.strToBool(t.data[i].IsInland),r.IsInlandExport=this.strToBool(t.data[i].IsInlandExport),r.IsInlandImport=this.strToBool(t.data[i].IsInlandImport),r.CurrencyReceivable=t.data[i].CurrencyReceivable,r.CurrencyPayable=t.data[i].CurrencyPayable,r.AutoDisplayReceivable=this.strToBool(t.data[i].IsReceivable),r.AutoDisplayPayable=this.strToBool(t.data[i].IsPayable),r.AutoDisplayQuotation=this.strToBool(t.data[i].IsQuotation),r.OtherCharge=this.strToBool(t.data[i].IsOtherCharge),r.MeasurementUnit=t.data[i].MeasurementUnit,r.DefaultOrder=t.data[i].DefaultOrder?parseInt(t.data[i].DefaultOrder):null,r.AWBDefaultDueType=t.data[i].DueType,r.ExternalAcctRefReceivable=t.data[i].ReceivableReference,r.ExternalAcctRefPayable=t.data[i].PayableReference,r.TmsChargeCode=t.data[i].TmsChargeCode,p.push(r)}_=p,console.log("after list ready charges:",p)}else if(s==this.COUNTRY){let p=[];for(let i=0;i<t.data.length;i++){let r=new f.c;r.mapServiceObj(JSON.parse(JSON.stringify({Name:t.data[i].Name,Code:t.data[i].Code,RegionCode:t.data[i].RegionCode}))),p.push(r)}_=p}else if(s==this.AIRPORTS){let p=[];for(let i=0;i<t.data.length;i++){let r=new k.v;r.mapServiceObj(JSON.parse(JSON.stringify({Name:t.data[i].Name,Code:t.data[i].Code,Address:t.data[i].Address,Country:t.data[i].Country}))),p.push(r)}_=p}else if(s==this.PORTS){let p=[];for(let i=0;i<t.data.length;i++){let r=new it.G;r.mapServiceObj(JSON.parse(JSON.stringify({Name:t.data[i].Name,Code:t.data[i].Code,Address:t.data[i].Address,Country:t.data[i].Country}))),p.push(r)}_=p}else if(s==this.TERMINALS){let p=[];for(let i=0;i<t.data.length;i++){let r=new rt.o;r.mapServiceObj(JSON.parse(JSON.stringify({Name:t.data[i].Name,Code:t.data[i].Code,Address:t.data[i].Address,Country:t.data[i].Country}))),p.push(r)}_=p}else if(s==this.CITY){let p=[];for(let i=0;i<t.data.length;i++){let r=new mt.j;r.mapServiceObj(JSON.parse(JSON.stringify({Name:t.data[i].Name,Code:t.data[i].Code,State:t.data[i].State,Country:t.data[i].Country}))),p.push(r)}_=p}else if(s==this.AIRLINE){let p=[];for(let i=0;i<t.data.length;i++){let r=new e.J;r.mapServiceObj(JSON.parse(JSON.stringify({Name:t.data[i].Name,AlphaCode:t.data[i].AlphaCode,NumericCode:t.data[i].NumericCode,MainContactName:t.data[i].MainContactName,MainContactNumber:t.data[i].MainContactNumber,Website:t.data[i].Website,IATAAccountNumber:t.data[i].IATAAccountNumber,Address:t.data[i].Address,eAWB:!1,eBooking:!1,IsReceivableCarrier:!(!t.data[i]["Receivable Carrier"]||"true"!=t.data[i]["Receivable Carrier"].toLowerCase()),IsPayableCarrier:!(!t.data[i]["Payable Carrier"]||"true"!=t.data[i]["Payable Carrier"].toLowerCase())}))),p.push(r)}_=p}else if(s==this.SHIPPING_LINE){let p=[];for(let i=0;i<t.data.length;i++){let r=new ft.d;r.mapServiceObj(JSON.parse(JSON.stringify({Name:t.data[i].Name,MainContactName:t.data[i].MainContactName,MainContactNumber:t.data[i].MainContactNumber,Website:t.data[i].Website,Address:t.data[i].Address,SCACCode:t.data[i].SCACCode,FMCCode:t.data[i].FMCCode,IsReceivableCarrier:!(!t.data[i]["Receivable Carrier"]||"true"!=t.data[i]["Receivable Carrier"].toLowerCase()),IsPayableCarrier:!(!t.data[i]["Payable Carrier"]||"true"!=t.data[i]["Payable Carrier"].toLowerCase())}))),p.push(r)}_=p}else if(s==this.CURRENCY){let p=[];for(let i=0;i<t.data.length;i++){let r=new It.F;r.mapServiceObj(JSON.parse(JSON.stringify({Code:t.data[i]["Currency Code"],RateToUSD:t.data[i]["Exchange rate to Branch Curr"],Symbol:t.data[i].Symbol,AsOnDate:t.data[i].AsOnDate}))),+r.RateToUSD&&(r.Code=r.Code.toString().trim(),r.Symbol=r.Symbol.toString().trim(),(!r.Symbol||r.Symbol&&""==r.Symbol.trim())&&(r.Symbol=r.Code),(!r.AsOnDate||r.AsOnDate&&""==r.AsOnDate.trim())&&(new Date,r.AsOnDate=At.qI.formatDateToMMDDYYYY(new Date)),p.push(r))}_=p}else if(s==this.INLAND_CARRIER){let p=[];for(let i=0;i<t.data.length;i++){let r=new dt.h;r.mapServiceObj(JSON.parse(JSON.stringify({Code:t.data[i].Code,Name:t.data[i].Name,MainContactName:t.data[i].MainContactName,MainContactNumber:t.data[i].MainContactNumber,Website:t.data[i].Website,Address:t.data[i].Address,IsReceivableCarrier:!(!t.data[i]["Receivable Carrier"]||"true"!=t.data[i]["Receivable Carrier"].toLowerCase()),IsPayableCarrier:!(!t.data[i]["Payable Carrier"]||"true"!=t.data[i]["Payable Carrier"].toLowerCase())}))),p.push(r)}_=p}else if(s==this.CHARGETAX){let p=[];for(let i=0;i<t.data.length;i++){let r=new m.l;r.mapServiceObj(JSON.parse(JSON.stringify({ChargeCode:t.data[i].ChargeCode,TaxCode:t.data[i].TaxCode,Active:t.data[i].Active}))),p.push(r)}_=p}else if(s==E.YD.CUSTOMER||s==E.YD.AGENT){let p=[],i=U.Q.getInstance().values.find(C=>C.Code==X.B.COMPANY_REFERENCES).Id,r=U.Q.getInstance().valueDetails.find(C=>"B"==C.Code&&C.ValueId==i).Id,v=pt.S.getInstance().parasMaster.languages;for(let C=0;C<t.data.length;C++){let y=new E.YD;y.mapServiceObj(JSON.parse(JSON.stringify(Object.assign({Code:t.data[C].Code,Name:t.data[C]["Name*"],ShortName:t.data[C]["Short Name"],LegalName:t.data[C]["Legal Name"],Website:t.data[C].Website,Email:t.data[C].Email,Phone:t.data[C].Phone,Address:t.data[C]["Address*"],CountryCode:t.data[C]["CountryCode*"],City:t.data[C]["City*"],ZipCode:t.data[C].Zipcode,Description:t.data[C].Description,AvailableRoles:t.data[C]["Other Party Roles"],AvailableBranches:this.getBranches(),PrintField:t.data[C].PrintField,PersonInContact:t.data[C]["Primary Contact"],IsReceivableParty:!(!t.data[C]["Receivable Party"]||"true"!=t.data[C]["Receivable Party"].toLowerCase()),IsPayableParty:!(!t.data[C]["Payable Party"]||"true"!=t.data[C]["Payable Party"].toLowerCase())},this.buildEawbObject(t.data[C]))))),y.PrintField||y.printDetailsClicked();let x=t.data[C].BusinessId.trim();if(x&&x.length>0){let M=new ht.s;M.Type=r,M.Number=x,y.references.push(M)}let L=t.data[C].Language.trim();if(L&&L.length>0){let M=v.find(Q=>Q.Code==L||L.toUpperCase()==Q.NormalizedName.toUpperCase());if(M){if(null==y.companyAccountingInfo){let Q=new E.YY;y.companyAccountingInfo=Q}y.companyAccountingInfo.LanguageId=M.Id}}let V=t.data[C]["VAT Number"].trim();if(null==y.companyAccountingInfo){let M=new E.YY;y.companyAccountingInfo=M}y.companyAccountingInfo.Vatno=V;let w=t.data[C].Group.trim();y.CustomerGroup=0;let J=U.Q.getInstance().Group.find(M=>M.Name==w);J&&(y.CustomerGroup=+J.Code);let q,H=t.data[C]["Salesperson Email id"].trim();null!=H&&""!=H&&(q=U.Q.getInstance().users.find(M=>M.Email==H),console.log(U.Q.getInstance().users)),q&&(y.SalesPerson=q.Id),p.push(y)}_=p}else if(s==E.YD.SHIPPER||s==E.YD.CONSIGNEE||s==E.YD.PARTY_AGENT||s==E.YD.CHA||s==E.YD.CFS||s==E.YD.ROAD_TRANSPORT||s==E.YD.BANK||s==E.YD.LEADS||s==E.YD.COLOAD||s==E.YD.WAREHOUSE||s==E.YD.VENDOR||s==E.YD.NETWORK){let p=[],i=U.Q.getInstance().values.find(C=>C.Code==X.B.COMPANY_REFERENCES).Id,r=U.Q.getInstance().valueDetails.find(C=>"B"==C.Code&&C.ValueId==i).Id,v=pt.S.getInstance().parasMaster.languages;for(let C=0;C<t.data.length;C++){let y=new E.YD;y.mapServiceObj(JSON.parse(JSON.stringify(Object.assign({Code:t.data[C].Code,Name:t.data[C]["Name*"],ShortName:t.data[C]["Short Name"],LegalName:t.data[C]["Legal Name"],Website:t.data[C].Website,Email:t.data[C].Email,Phone:t.data[C].Phone,Address:t.data[C]["Address*"],CountryCode:t.data[C]["CountryCode*"],City:t.data[C]["City*"],ZipCode:t.data[C].Zipcode,Description:t.data[C].Description,AvailableRoles:t.data[C]["Other Party Roles"],AvailableBranches:this.getBranches(),PrintField:t.data[C].PrintField,PersonInContact:t.data[C]["Primary Contact"],IsReceivableParty:!(!t.data[C]["Receivable Party"]||"true"!=t.data[C]["Receivable Party"].toLowerCase()),IsPayableParty:!(!t.data[C]["Payable Party"]||"true"!=t.data[C]["Payable Party"].toLowerCase())},this.buildEawbObject(t.data[C]))))),y.PrintField||y.printDetailsClicked();let x=t.data[C].BusinessId.trim();if(x&&x.length>0){let w=new ht.s;w.Type=r,w.Number=x,y.references.push(w)}let L=t.data[C].Language.trim();if(L&&L.length>0){let w=v.find(J=>J.Code==L||L.toUpperCase()==J.NormalizedName.toUpperCase());if(w){if(null==y.companyAccountingInfo){let J=new E.YY;y.companyAccountingInfo=J}y.companyAccountingInfo.LanguageId=w.Id}}let V=t.data[C]["VAT Number"].trim();if(V&&V.length>0){if(null==y.companyAccountingInfo){let w=new E.YY;y.companyAccountingInfo=w}y.companyAccountingInfo.Vatno=V}p.push(y)}_=p}else if(s==this.PAYMENT_TYPE){let p=[];for(let i=0;i<t.data.length;i++){let r=new Et.M;r.mapServiceObj(JSON.parse(JSON.stringify({Name:t.data[i].Name,Code:t.data[i].Code,Value:null==t.data[i].Value||""==t.data[i].Value?0:parseInt(t.data[i].Value),IsDefault:!(null==t.data[i].IsDefault||""==t.data[i].IsDefault||"false"==t.data[i].IsDefault.toLowerCase()||"no"==t.data[i].IsDefault.toLowerCase())}))),p.push(r)}_=p}else if(s==this.MILESTONE){let p=[];for(let i=0;i<t.data.length;i++){let r=new _t.r;r.mapServiceObj(JSON.parse(JSON.stringify({Name:t.data[i].Name,Code:t.data[i].Code,Active:!(null==t.data[i].Active||""==t.data[i].Active||"false"==t.data[i].Active.toLowerCase()||"no"==t.data[i].Active.toLowerCase()),IsAir:!(null==t.data[i].IsAir||""==t.data[i].IsAir||"false"==t.data[i].IsAir.toLowerCase()||"no"==t.data[i].IsAir.toLowerCase()),IsAirExport:!(null==t.data[i].IsAirExport||""==t.data[i].IsAirExport||"false"==t.data[i].IsAirExport.toLowerCase()||"no"==t.data[i].IsAirExport.toLowerCase()),IsAirImport:!(null==t.data[i].IsAirImport||""==t.data[i].IsAirImport||"false"==t.data[i].IsAirImport.toLowerCase()||"no"==t.data[i].IsAirImport.toLowerCase()),IsSea:!(null==t.data[i].IsSea||""==t.data[i].IsSea||"false"==t.data[i].IsSea.toLowerCase()||"no"==t.data[i].IsSea.toLowerCase()),IsSeaExport:!(null==t.data[i].IsSeaExport||""==t.data[i].IsSeaExport||"false"==t.data[i].IsSeaExport.toLowerCase()||"no"==t.data[i].IsSeaExport.toLowerCase()),IsSeaImport:!(null==t.data[i].IsSeaImport||""==t.data[i].IsSeaImport||"false"==t.data[i].IsSeaImport.toLowerCase()||"no"==t.data[i].IsSeaImport.toLowerCase()),IsInland:!(null==t.data[i].IsInland||""==t.data[i].IsInland||"false"==t.data[i].IsInland.toLowerCase()||"no"==t.data[i].IsInland.toLowerCase()),IsInlandExport:!(null==t.data[i].IsInlandExport||""==t.data[i].IsInlandExport||"false"==t.data[i].IsInlandExport.toLowerCase()||"no"==t.data[i].IsInlandExport.toLowerCase()),IsInlandImport:!(null==t.data[i].IsInlandImport||""==t.data[i].IsInlandImport||"false"==t.data[i].IsInlandImport.toLowerCase()||"no"==t.data[i].IsInlandImport.toLowerCase()),ShowDefault:!(null==t.data[i].ShowDefault||""==t.data[i].ShowDefault||"false"==t.data[i].ShowDefault.toLowerCase()||"no"==t.data[i].ShowDefault.toLowerCase())}))),p.push(r)}_=p}return _}mapServiceObj(s){$.extend(this,s)}strToBool(s){return!!s&&"true"===s.toLowerCase()}clone(){let s=JSON.stringify(this),t=JSON.parse(s),_=new K;return _.mapServiceObj(t),_}getBranches(){let s=lt.C.getInstance().getForwarders();s=s.filter(_=>_.IsActive);let t=lt.C.getInstance().getForwarder();if(t)return s=s.filter(_=>_.Id!=t.Id),s.map(_=>_.Id)}buildEawbObject(s){let t=((s["eAWB Address 1"]||"")+" "+(s["eAWB Address 2"]||"")).toString().replace(/(\r\n|\n|\r)/gm,""),_=(s["Address*"]||"").toString().replace(/(\r\n|\n|\r)/gm,"").trim();const p=t.substring(0,35),i=t.substring(35,70),r=_.substring(0,35),v=_.substring(35,70);return{EawbName:this.configureEawbFields("eAWB Name",s["eAWB Name"],s["Name*"]),EawbAddressLine1:this.configureEawbFields("eAWB Address 1",p,r),EawbAddressLine2:this.configureEawbFields("eAWB Address 2",i,v),EawbCity:this.configureEawbFields("eAWB City",s["eAWB City"],s["City*"]),EawbState:this.configureEawbFields("eAWB State",s["eAWB State"]),EawbZipCode:this.configureEawbFields("eAWB Zipcode",s["eAWB Zipcode"],s.Zipcode),EawbPhone:this.configureEawbFields("eAWB Phone",s["eAWB Phone"],s.Phone),EawbCountryCode:this.configureEawbFields("eAWB Country",s["eAWB Country"],s["CountryCode*"])}}configureEawbFields(s,t,_=""){const p=null!=t&&""!==t.trim()?t:_;switch(s){case"eAWB Name":case"eAWB Address 1":case"eAWB Address 2":return this.formatField(p,35);case"eAWB City":return this.formatField(p,17);case"eAWB State":case"eAWB Zipcode":return this.formatField(p,9);case"eAWB Phone":return this.formatField(p,25);case"eAWB Country":return this.formatField(p,3);default:return p?p.toString().trim():""}}formatField(s,t){if(!s)return"";let _=s.toString().trim();if(/^\d+(\.\d+)?e[+\-]?\d+$/i.test(_)){let p=Number(_);
1isNaN(p)||(_=p.toLocaleString("en-US",{useGrouping:!1}))}return _.length>t?_.substring(0,t):_}}}}]);

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.