(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{kkqv:function(e,t,n){"use strict";n.r(t),n.d(t,"ComplianceTaskModule",function(){return un});var a=n("3Pt+"),i=n("gfTr"),c=n("t34c"),r=n("ofXK"),l=n("AytR"),s=n("fXoL"),o=n("tyNb"),u=n("o0su");let d=(()=>{class e{constructor(e,t,n,a,i){this.router=e,this.commonService=t,this.requestTrackingService=n,this.interceptor=a,this.companyFormationService=i,this.isSideBarOpen=!1,this.environment=l.a}ngAfterViewInit(){this.loadJs()}ngOnInit(){}loadJs(){setTimeout(()=>{$(".company-formation-sidebar-select").select2({minimumResultsForSearch:-1})},10),$(".company-formation-sidebar-select").change(function(){this.currentPage&&this.currentPage!=$(this).val()&&($(".company-formation-sidebar-select").val(this.currentPage),$(".company-formation-sidebar-select").trigger("change"))})}manageNavigation(e){this.router.navigate([e])}handleSidebar(){this.isSideBarOpen=!this.isSideBarOpen,setTimeout(()=>{this.handleCount()},100)}handleCount(){let e,t=1;$(".progressUl.mobile li").each(function(n){$(this).hasClass("hide")||(e=t,$(this).find(".number span").html(e),++t)})}}return e.\u0275fac=function(t){return new(t||e)(s.Xb(o.d),s.Xb(u.b),s.Xb(u.j),s.Xb(u.g),s.Xb(u.c))},e.\u0275cmp=s.Rb({type:e,selectors:[["app-sidebar"]],decls:13,vars:3,consts:[[1,"db-left"],[1,"logo"],["href","#","onclick","return false;",3,"click"],["alt","Logo","title","Logo",3,"src"],[1,"your-progress"],[1,"progressUl","web"],["href","#","onclick","return false;"],[1,"material-icons"]],template:function(e,t){1&e&&(s.dc(0,"aside",0),s.dc(1,"div",1),s.dc(2,"a",2),s.kc("click",function(){return t.manageNavigation("/customer/dashboard")}),s.Yb(3,"img",3),s.cc(),s.cc(),s.dc(4,"div",4),s.dc(5,"h3"),s.Rc(6,"Your progress"),s.cc(),s.dc(7,"ul",5),s.dc(8,"li"),s.dc(9,"a",6),s.dc(10,"i",7),s.Rc(11,"done"),s.cc(),s.Rc(12," 'Compliance Questionnaire' "),s.cc(),s.cc(),s.cc(),s.cc(),s.cc()),2&e&&(s.Lb(3),s.uc("src",t.commonService.selectedThemeImages+"/logo-white.svg",s.Jc),s.Lb(5),s.Nb("active"))},styles:[".progress-box[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{position:absolute;left:-6px;top:-8px;width:70px;transform:rotateY(180deg)}.progress-svg[_ngcontent-%COMP%] .line-bar[_ngcontent-%COMP%]{-webkit-mask:url(#mask);mask:url(#mask)}.dashboard-progress-count[_ngcontent-%COMP%] .pie[_ngcontent-%COMP%]{display:none}.your-progress[_ngcontent-%COMP%] ul.progressUl[_ngcontent-%COMP%] li.active[_ngcontent-%COMP%] a[_ngcontent-%COMP%] .number[_ngcontent-%COMP%]{z-index:100;background:none;border:none;line-height:57px}"]}),e})();const m={title:"About the business",id:"companyLevelFirstManagerFields",elements:[{key:"business_objectives",title:"What are the business objectives? ",value:"",required:!0,visible:!0,type:"text",disabled:!1,condition:""},{key:"product_service_intend_offer",title:"What are the products and/or services you intend to offer?",value:"",required:!0,visible:!0,type:"text",disabled:!1,condition:""},{key:"customer_payment_method",title:"What payment methods will you be using to transact with customers?",value:["1"],required:!0,visible:!0,type:"multi-select",disabled:!1,condition:"",className:"",options:"PaymentMethods",custom_rule:{validatons:[{advance_action:"6",advance_condition:"1",advance_controls:"customer_other_payment_method",advance_minmax:"",advance_value:"4"},{advance_action:"3",advance_condition:"1",advance_controls:"customer_other_payment_method",advance_minmax:"",advance_value:"4"}]}},{key:"customer_other_payment_method",title:"if Others, Specify ?",value:"",required:!1,visible:!1,type:"text",disabled:!1,condition:"Show and Mandatory, If others selected from Above 1.3, else hide"},{key:"supplier_payment_method",title:"What payment methods will you be using to transact with suppliers?",value:"1",required:!0,visible:!0,type:"multi-select",disabled:!1,condition:"",className:"",options:"PaymentMethods",custom_rule:{validatons:[{advance_action:"6",advance_condition:"1",advance_controls:"supplier_other_payment_method",advance_minmax:"",advance_value:"4"},{advance_action:"3",advance_condition:"1",advance_controls:"supplier_other_payment_method",advance_minmax:"",advance_value:"4"}]}},{key:"supplier_other_payment_method",title:"if Others, Specify ?",value:"",required:!1,visible:!1,type:"text",disabled:!1,condition:"Show and Mandatory, If others selected from Above (1.5) else hide"},{key:"relevant_key_competitor",title:"Who are your relevant key competitors you are aware of ?",value:"",required:!0,visible:!0,type:"text",disabled:!1,condition:""},{key:"want_business_dealing_any_country",title:"Do you have any interest or business dealing in any Countries or Activities deemed as High Risk?",value:"1",required:!0,visible:!0,type:"select",disabled:!1,condition:"",className:"",options:"HighRiskOptions",custom_rule:{validatons:[{advance_action:"6",advance_condition:"1",advance_controls:"interest_business_dealing",advance_minmax:"",advance_value:"2"},{advance_action:"3",advance_condition:"1",advance_controls:"interest_business_dealing",advance_minmax:"",advance_value:"2"}]}},{key:"interest_business_dealing",title:"Select Interest or Business dealing",value:"",required:!1,visible:!1,type:"multi-select",disabled:!1,condition:"Show and Mandatory, If Yes selected from Above 1.7",className:"",options:"InterestBusinessDealingOptions",custom_rule:{validatons:[{advance_action:"6",advance_condition:"1",advance_controls:"business_dealing_country",advance_minmax:"",advance_value:"1"},{advance_action:"3",advance_condition:"1",advance_controls:"business_dealing_country",advance_minmax:"",advance_value:"1"},{advance_action:"6",advance_condition:"1",advance_controls:"business_dealing_activity",advance_minmax:"",advance_value:"2"},{advance_action:"3",advance_condition:"1",advance_controls:"business_dealing_activity",advance_minmax:"",advance_value:"2"}]}},{key:"business_dealing_country",title:"Please indicate Country(s)",value:"",required:!1,visible:!1,type:"text",disabled:!1,condition:"Show and Mandatory, If option 1 selected from Above 1.7.1, else hide"},{key:"business_dealing_activity",title:"Please indicate Activity(s)",value:"",required:!1,visible:!1,type:"text",disabled:!1,condition:"Show and Mandatory, If option 2 selected from Above 1.7.1, else hide"}]},b={title:"About the Stakeholder",id:"shareholderOrDirectorFields",elements:[{key:"your_background",title:"Provide a brief about your background (area of expertise)",value:"",required:!0,visible:!0,type:"text-area",disabled:!1,condition:""}]},g={title:"Source of fund",id:"shareholderFields",elements:[{key:"sources_of_funds",title:"Sources of funds refer to the different ways money can be obtained to finance the business. Select multiple if applicable",value:"",required:!0,visible:!0,type:"multi-select",disabled:!1,condition:"",options:"SourcesOfFunds",custom_rule:{validatons:[{advance_action:"6",advance_condition:"1",advance_controls:"business_trade_license",advance_minmax:"",advance_value:"1"},{advance_action:"3",advance_condition:"1",advance_controls:"business_trade_license",advance_minmax:"",advance_value:"1"},{advance_action:"6",advance_condition:"1",advance_controls:"business_certified_accountant_letter",advance_minmax:"",advance_value:"1"},{advance_action:"6",advance_condition:"1",advance_controls:"savings_document",advance_minmax:"",advance_value:"2"},{advance_action:"6",advance_condition:"1",advance_controls:"investments_document",advance_minmax:"",advance_value:"3"},{advance_action:"6",advance_condition:"1",advance_controls:"loan_document",advance_minmax:"",advance_value:"4"},{advance_action:"6",advance_condition:"1",advance_controls:"inheritance_document",advance_minmax:"",advance_value:"5"},{advance_action:"6",advance_condition:"1",advance_controls:"gift_donated_document",advance_minmax:"",advance_value:"6"},{advance_action:"3",advance_condition:"1",advance_controls:"gift_donated_document",advance_minmax:"",advance_value:"6"},{advance_action:"6",advance_condition:"1",advance_controls:"donor_passport_document",advance_minmax:"",advance_value:"6"},{advance_action:"3",advance_condition:"1",advance_controls:"donor_passport_document",advance_minmax:"",advance_value:"6"},{advance_action:"6",advance_condition:"1",advance_controls:"signed_letter_from_certified_accountant",advance_minmax:"",advance_value:"7"},{advance_action:"6",advance_condition:"1",advance_controls:"bank_statement_or_alternative_document",advance_minmax:"",advance_value:"7"},{advance_action:"6",advance_condition:"1",advance_controls:"source_of_other_funds",advance_minmax:"",advance_value:"7"}]}},{key:"business_trade_license",title:"Copy of Trade License",value:"",required:!1,visible:!1,type:"file",disabled:!1},{key:"business_certified_accountant_letter",title:"copy of certified profit/loss statement(s) or letter from a certified accountant",value:"",required:!1,visible:!1,type:"file",disabled:!1},{key:"savings_document",title:"Please attach the document",value:"",required:!1,visible:!1,type:"file",disabled:!1,condition:'Mandatory if "savings" is selected from the section 3.1, else hide'},{key:"investments_document",title:"Please attach the document",value:"",required:!1,visible:!1,type:"file",disabled:!1,condition:'Mandatory if "Investments" is selected from the section 3.1, else hide'},{key:"loan_document",title:"Please attach the document",value:"",required:!1,visible:!1,type:"file",disabled:!1,condition:'Mandatory if "Loan" is selected from the section 3.1, else hide'},{key:"inheritance_document",title:"Please attach the document",value:"",required:!1,visible:!1,type:"file",disabled:!1,condition:'Mandatory if "Inheritance" is selected from the section 3.1, else hide'},{key:"gift_donated_document",title:"Source of donated funds",value:"",required:!1,visible:!1,type:"file",disabled:!1,condition:'Mandatory if "Gift" is selected from the section 3.1, else hide'},{key:"donor_passport_document",title:"passport copy of the donor",value:"",required:!1,visible:!1,type:"file",disabled:!1,condition:'Mandatory if "Gift" is selected from the section 3.1, else hide'},{key:"signed_letter_from_certified_accountant",title:"signed letter from a certified accountant",value:"",required:!1,visible:!1,type:"file",disabled:!1,condition:'Mandatory if "Others" is selected from the section 3.1, else hide'},{key:"bank_statement_or_alternative_document",title:"bank statement or alternative document to prove the transaction",value:"",required:!1,visible:!1,type:"file",disabled:!1,condition:'Mandatory if "Others" is selected from the section 3.1, else hide'},{key:"source_of_other_funds",title:"Source of Fund Others",value:"",required:!1,visible:!1,type:"text",disabled:!1,condition:"Show and Mandatory, If others selected from Above 3.1 else hide"},{key:"confirmation_of_investments_meydan",title:"I hereby confirm that investments made into the Meydan Free Zone entity",value:"",required:!0,visible:!0,type:"checkbox",disabled:!1,condition:""}]},p={title:"About the Stakeholder",id:"managerFiles",elements:[{key:"number_of_companies_you_worked",title:"What is the number of companies you worked at?",value:"",required:!0,visible:!0,type:"select",disabled:!1,condition:"",className:"",options:"NumberOfCompanies",custom_rule:{validatons:[]}}],subElements:[{key:"company_name",title:"Company Name",value:"",required:!0,visible:!0,type:"text",disabled:!1,condition:"",className:"",options:"",custom_rule:{validatons:[]}},{key:"role",title:"Role",value:"",required:!0,visible:!0,type:"select",disabled:!1,condition:"",className:"",options:"Roles",custom_rule:{validatons:[]}},{key:"job_title",title:"Job title",value:"",required:!0,visible:!0,type:"text",disabled:!1,condition:"",className:"",options:"",custom_rule:{validatons:[]}},{key:"nature_of_business",title:"Nature of Business",value:"",required:!0,visible:!0,type:"select",disabled:!1,condition:"",className:"",options:"NatureOfBusiness",custom_rule:{validatons:[{advance_action:"6",advance_condition:"1",advance_controls:"nature_of_business_others",advance_minmax:"",advance_value:"4"},{advance_action:"3",advance_condition:"1",advance_controls:"nature_of_business_others",advance_minmax:"",advance_value:"4"}]}},{key:"nature_of_business_others",title:"Nature of Business Others",value:"",required:!1,visible:!1,type:"text",disabled:!1,condition:"",className:"",options:"",custom_rule:{validatons:[]}},{key:"start_date",title:"Start Date",value:"",required:!0,visible:!0,type:"date",disabled:!1,condition:"",className:"",options:"",custom_rule:{validatons:[]}},{key:"end_date",title:"End Date",value:"",required:!0,visible:!0,type:"date",disabled:!1,condition:"",className:"",options:"",custom_rule:{validatons:[]}},{key:"address",title:"Address",value:"",required:!0,visible:!0,type:"text",disabled:!1,condition:"",className:"",options:"",custom_rule:{validatons:[]}},{key:"telephone",title:"Telephone",value:"",required:!0,visible:!0,type:"phone",disabled:!1,condition:"",className:"",options:"",custom_rule:{validatons:[]}},{key:"email",title:"Email",value:"",required:!0,visible:!0,type:"email",disabled:!1,condition:"",className:"",options:"",custom_rule:{validatons:[]}},{key:"website",title:"Website",value:"",required:!0,visible:!0,type:"text",disabled:!1,condition:"",className:"",options:"",custom_rule:{validatons:[]}}]},h={title:"Proof of Address",id:"allStakeholdersFields",elements:[{key:"are_you_the_primary_resident",title:"Are you the primary resident",value:"",required:!0,visible:!0,type:"select",disabled:!1,condition:"",className:"",options:"YesNoOptions",custom_rule:{validatons:[{advance_action:"6",advance_condition:"1",advance_controls:"proof_of_current_address",advance_minmax:"",advance_value:"1"},{advance_action:"3",advance_condition:"1",advance_controls:"proof_of_current_address",advance_minmax:"",advance_value:"1"},{advance_action:"6",advance_condition:"1",advance_controls:"proof_of_address_confirmation",advance_minmax:"",advance_value:"2"},{advance_action:"3",advance_condition:"1",advance_controls:"proof_of_address_confirmation",advance_minmax:"",advance_value:"2"},{advance_action:"6",advance_condition:"1",advance_controls:"proof_of_identification",advance_minmax:"",advance_value:"2"},{advance_action:"3",advance_condition:"1",advance_controls:"proof_of_identification",advance_minmax:"",advance_value:"2"}]}},{key:"proof_of_current_address",title:"Please attach proof of current address",value:"",required:!1,visible:!1,type:"file",disabled:!1,condition:"Show and Mandatory if yes selected from 5.1, else hide"},{key:"proof_of_address_confirmation",title:"Please attach proof of address confirmation",value:"",required:!1,visible:!1,type:"file",disabled:!1,condition:"Show and Mandatory if No selected from 5.1, else hide"},{key:"proof_of_identification",title:"Please attach proof of identification",value:"",required:!1,visible:!1,type:"file",disabled:!1,condition:"Show and Mandatory if No selected from 5.1, else hide"}]},v={PaymentMethods:[{value:1,label:"Credit Card",disabled:!1},{value:2,label:"Bank Transfer",disabled:!1},{value:3,label:"Cash",disabled:!1},{value:4,label:"Others",disabled:!1}],YesNoOptions:[{value:"1",label:"Yes",disabled:!1},{value:"2",label:"No",disabled:!1}],HighRiskOptions:[{value:"1",label:"No",disabled:!1},{value:"2",label:"Yes",disabled:!1}],NumberOfCompanies:[{value:"1",label:"1",disabled:!1},{value:"2",label:"2",disabled:!1},{value:"3",label:"3",disabled:!1},{value:"4",label:"4",disabled:!1},{value:"5",label:"5",disabled:!1}],InterestBusinessDealingOptions:[{value:"1",label:"Country ",disabled:!1},{value:"2",label:"Activity",disabled:!1}],SourcesOfFunds:[{value:"1",label:"Income from Business",disabled:!1},{value:"2",label:"Savings",disabled:!1},{value:"3",label:"Investments",disabled:!1},{value:"4",label:"Loan",disabled:!1},{value:"5",label:"Inheritance",disabled:!1},{value:"6",label:"Gift",disabled:!1},{value:"7",label:"Others[specify]",disabled:!1}],Roles:[{value:"1",label:"Employee",disabled:!1},{value:"2",label:"Business Owner",disabled:!1}],NatureOfBusiness:[{value:"1",label:"Trading",disabled:!1},{value:"2",label:"Manufacturing",disabled:!1},{value:"3",label:"Service",disabled:!1},{value:"4",label:"Others",disabled:!1}],NatureOfBusiness:[{value:"1",label:"Trading",disabled:!1},{value:"2",label:"Manufacturing",disabled:!1},{value:"3",label:"Service",disabled:!1},{value:"4",label:"Others",disabled:!1}]};var _=n("wd/R"),f=n("++gc"),P=n("RYOh"),O=n("SKq1");function E(e,t){if(1&e&&(s.dc(0,"div",2),s.dc(1,"div",3),s.Yb(2,"img",4),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(2),s.uc("src",e.commonService.selectedThemeImages+"/spinner-loader.svg",s.Jc),s.Lb(2),s.Tc("Loading ",e.content,"")}}function y(e,t){if(1&e&&(s.dc(0,"div",5),s.dc(1,"div",3),s.Yb(2,"img",4),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(2),s.uc("src",e.commonService.selectedThemeImages+"/spinner-loader.svg",s.Jc),s.Lb(2),s.Tc("Loading ",e.content,"")}}let j=(()=>{class e{constructor(e){this.commonService=e,this.content="section",this.loaderType="page",this.showLoader=!0}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)(s.Xb(f.a))},e.\u0275cmp=s.Rb({type:e,selectors:[["app-loader"]],inputs:{content:"content",loaderType:"loaderType",showLoader:"showLoader"},decls:2,vars:2,consts:[["class","page-level-loader",4,"ngIf"],["class","content-loader",4,"ngIf"],[1,"page-level-loader"],[1,"loader-item"],["alt","Loading","title","Loading",3,"src"],[1,"content-loader"]],template:function(e,t){1&e&&(s.Pc(0,E,5,2,"div",0),s.Pc(1,y,5,2,"div",1)),2&e&&(s.uc("ngIf",t.showLoader&&"page"===t.loaderType),s.Lb(1),s.uc("ngIf",t.showLoader&&"content"===t.loaderType))},directives:[r.n],styles:[""]}),e})();function k(e,t){if(1&e&&(s.dc(0,"span",7),s.dc(1,"button",8),s.dc(2,"i",9),s.Rc(3,"help_outline"),s.cc(),s.cc(),s.Yb(4,"span",10),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.uc("innerHtml",e.currentPageElementObj.custom_rule.link.page_content,s.Hc)}}function S(e,t){1&e&&(s.dc(0,"div",11),s.Rc(1," AED"),s.cc())}function x(e,t){if(1&e&&(s.dc(0,"span",12),s.dc(1,"i",9),s.Rc(2,"info_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Sc(e.currentPageElementObj.custom_rule.attributes["data-desc"])}}function w(e,t){if(1&e&&(s.dc(0,"span",13),s.dc(1,"i",9),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Sc(e.currentPageElementObj["validation-error-msg"]?e.currentPageElementObj["validation-error-msg"]:e.validateMessage?e.validateMessage:"Please enter valid "+e.currentPageElementObj.title+".")}}function L(e,t){if(1&e){const e=s.ec();s.dc(0,"div"),s.Pc(1,k,5,1,"span",2),s.dc(2,"div"),s.Pc(3,S,2,0,"div",3),s.dc(4,"input",4),s.kc("ngModelChange",function(t){return s.Gc(e),s.oc().currentPageElementObj.value=t})("change",function(t){return s.Gc(e),s.oc().onChange(t.target.value)}),s.cc(),s.dc(5,"label"),s.Rc(6),s.cc(),s.cc(),s.Pc(7,x,5,1,"span",5),s.Pc(8,w,5,1,"span",6),s.cc()}if(2&e){const e=s.oc();s.Nb((!e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus?" error ":"")+(e.currentPageElementObj.custom_rule.link?"form-group help-info":"form-group")),s.Lb(1),s.uc("ngIf",e.currentPageElementObj.custom_rule.link),s.Lb(1),s.Nb((e.currentPageElementObj.element_class&&e.currentPageElementObj.element_class.includes("currency")?"currency-wrapper ":"")+"material_input_block"),s.Lb(1),s.uc("ngIf",e.currentPageElementObj.element_class&&e.currentPageElementObj.element_class.includes("currency")),s.Lb(1),s.Nb(e.currentPageElementObj.element_class+" "+e.currentPageElementObj.custom_rule.attributes.class+" form-control material_input"),s.uc("type",e.currentPageElementObj.custom_rule.attributes.type)("id",e.currentPageElementObj.custom_rule.attributes.id)("ngModel",e.currentPageElementObj.value)("minlength",e.currentPageElementObj.custom_rule.attributes.minlength)("maxlength",e.currentPageElementObj.custom_rule.attributes.maxlength)("disabled",e.currentPageElementObj.disabled)("required",e.currentPageElementObj.required)("min",e.currentPageElementObj.custom_rule.attributes.min)("max",e.currentPageElementObj.custom_rule.attributes.max),s.Lb(2),s.Sc(e.currentPageElementObj.title),s.Lb(1),s.uc("ngIf",!(!e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus)&&e.currentPageElementObj.custom_rule.attributes["data-desc"]),s.Lb(1),s.uc("ngIf",!e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus||e.currentPageElementObj.value&&e.submitStatus&&!e.currentPageElementObj.isValidate||e.currentPageElementObj.value&&!e.submitStatus&&!e.currentPageElementObj.isValidate)}}function I(e,t){if(1&e){const e=s.ec();s.dc(0,"a",16),s.kc("click",function(){return s.Gc(e),s.oc(2).onSelectVisas("6")}),s.Rc(1,"6 "),s.cc()}if(2&e){const e=s.oc(2);s.Nb(e.showVisasInput||6!=e.currentPageElementObj.value?"":"active")}}function C(e,t){if(1&e){const e=s.ec();s.dc(0,"a",16),s.kc("click",function(){return s.Gc(e),s.oc(2).onSelectVisas("6",!0)}),s.Rc(1,"6+"),s.cc()}if(2&e){const e=s.oc(2);s.Nb(e.showVisasInput||6!=e.currentPageElementObj.value?"":"active")}}function T(e,t){if(1&e){const e=s.ec();s.dc(0,"li"),s.dc(1,"a",16),s.kc("click",function(){return s.Gc(e),s.oc(2).onSelectVisas("7")}),s.Rc(2,"7+"),s.cc(),s.cc()}if(2&e){const e=s.oc(2);s.Nb(e.currentPageElementObj.disabled?"pointer-events-none":""),s.Lb(1),s.Nb(e.showVisasInput?"active":"")}}function q(e,t){if(1&e){const e=s.ec();s.dc(0,"span"),s.dc(1,"div",22),s.dc(2,"div",23),s.dc(3,"div",24),s.dc(4,"div",25),s.dc(5,"input",26),s.kc("ngModelChange",function(t){return s.Gc(e),s.oc(2).currentPageElementObj.value=t})("focusout",function(t){return s.Gc(e),s.oc(2).onSelectVisas(t.target.value)}),s.cc(),s.dc(6,"label"),s.Rc(7),s.cc(),s.cc(),s.cc(),s.cc(),s.cc(),s.cc()}if(2&e){const e=s.oc(2);s.Lb(5),s.Nb(e.currentPageElementObj.element_class+" "+e.currentPageElementObj.custom_rule.attributes.class+" form-control material_input"),s.uc("id",e.currentPageElementObj.custom_rule.attributes.id)("ngModel",e.currentPageElementObj.value)("minlength",e.currentPageElementObj.custom_rule.attributes.minlength)("maxlength",e.currentPageElementObj.custom_rule.attributes.maxlength)("disabled",e.currentPageElementObj.disabled)("required",e.currentPageElementObj.required)("min",e.currentPageElementObj.custom_rule.attributes.min)("max",e.currentPageElementObj.custom_rule.attributes.max),s.Lb(2),s.Sc(e.currentPageElementObj.title)}}function D(e,t){if(1&e&&(s.dc(0,"span",13),s.dc(1,"i",9),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Tc("Please select valid ",e.currentPageElementObj.title,".")}}function F(e,t){if(1&e&&(s.dc(0,"span",13),s.dc(1,"i",9),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Sc(e.validateMessage?e.validateMessage:"Please enter valid "+e.currentPageElementObj.title+".")}}function R(e,t){if(1&e&&(s.dc(0,"div"),s.dc(1,"div",27),s.dc(2,"div",28),s.dc(3,"h5",29),s.Rc(4,"Error - Action Required"),s.cc(),s.dc(5,"p"),s.Rc(6),s.cc(),s.cc(),s.cc(),s.cc()),2&e){const e=s.oc().$implicit,t=s.oc(2);s.Nb("col-md-"+t.currentPageElementObj.childElements[t.currentPageElementObj.childElements.length-1].columns+" col-xs-12"),s.Lb(6),s.Sc(null==e||null==e.log?null:e.log.comment)}}function V(e,t){if(1&e&&(s.bc(0),s.Pc(1,R,7,3,"div",0),s.ac()),2&e){const e=t.$implicit;s.Lb(1),s.uc("ngIf","1"===(null==e||null==e.log?null:e.log.visible_on_front)&&(null==e||null==e.log?null:e.log.comment))}}function N(e,t){if(1&e){const e=s.ec();s.dc(0,"div"),s.dc(1,"div",14),s.dc(2,"ul",15),s.dc(3,"li"),s.dc(4,"a",16),s.kc("click",function(){return s.Gc(e),s.oc().onSelectVisas("0")}),s.Rc(5,"0"),s.cc(),s.cc(),s.dc(6,"li"),s.dc(7,"a",16),s.kc("click",function(){return s.Gc(e),s.oc().onSelectVisas("1")}),s.Rc(8,"1"),s.cc(),s.cc(),s.dc(9,"li"),s.dc(10,"a",16),s.kc("click",function(){return s.Gc(e),s.oc().onSelectVisas("2")}),s.Rc(11,"2"),s.cc(),s.cc(),s.dc(12,"li"),s.dc(13,"a",16),s.kc("click",function(){return s.Gc(e),s.oc().onSelectVisas("3")}),s.Rc(14,"3"),s.cc(),s.cc(),s.dc(15,"li"),s.dc(16,"a",16),s.kc("click",function(){return s.Gc(e),s.oc().onSelectVisas("4")}),s.Rc(17,"4"),s.cc(),s.cc(),s.dc(18,"li"),s.dc(19,"a",16),s.kc("click",function(){return s.Gc(e),s.oc().onSelectVisas("5")}),s.Rc(20,"5"),s.cc(),s.cc(),s.dc(21,"li"),s.Pc(22,I,2,2,"a",17),s.Pc(23,C,2,2,"a",17),s.cc(),s.Pc(24,T,3,4,"li",0),s.cc(),s.dc(25,"div",18),s.dc(26,"input",19),s.kc("ngModelChange",function(t){return s.Gc(e),s.oc().currentPageElementObj.value=t})("input",function(t){return s.Gc(e),s.oc().onSelectVisas(t.target.value)}),s.cc(),s.cc(),s.Yb(27,"span",20),s.Pc(28,q,8,11,"span",1),s.Pc(29,D,5,1,"span",6),s.Pc(30,F,5,1,"span",6),s.cc(),s.Pc(31,V,2,1,"ng-container",21),s.cc()}if(2&e){const e=s.oc();s.Lb(3),s.Nb(e.currentPageElementObj.disabled?"pointer-events-none":""),s.Lb(1),s.Nb(e.showVisasInput||0!=e.currentPageElementObj.value?"":"active"),s.Lb(2),s.Nb(e.currentPageElementObj.disabled?"pointer-events-none":""),s.Lb(1),s.Nb(e.showVisasInput||1!=e.currentPageElementObj.value?"":"active"),s.Lb(2),s.Nb(e.currentPageElementObj.disabled?"pointer-events-none":""),s.Lb(1),s.Nb(e.showVisasInput||2!=e.currentPageElementObj.value?"":"active"),s.Lb(2),s.Nb(e.currentPageElementObj.disabled?"pointer-events-none":""),s.Lb(1),s.Nb(e.showVisasInput||3!=e.currentPageElementObj.value?"":"active"),s.Lb(2),s.Nb(e.currentPageElementObj.disabled?"pointer-events-none":""),s.Lb(1),s.Nb(e.showVisasInput||4!=e.currentPageElementObj.value?"":"active"),s.Lb(2),s.Nb(e.currentPageElementObj.disabled?"pointer-events-none":""),s.Lb(1),s.Nb(e.showVisasInput||5!=e.currentPageElementObj.value?"":"active"),s.Lb(2),s.Nb(e.currentPageElementObj.disabled?"pointer-events-none":""),s.Lb(1),s.uc("ngIf",-1===(null==e.currentPageElementObj.element_class?null:e.currentPageElementObj.element_class.indexOf("only-6"))),s.Lb(1),s.uc("ngIf",(null==e.currentPageElementObj.element_class?null:e.currentPageElementObj.element_class.indexOf("only-6"))>-1),s.Lb(1),s.uc("ngIf",-1===(null==e.currentPageElementObj.element_class?null:e.currentPageElementObj.element_class.indexOf("only-6"))),s.Lb(2),s.vc("max",-1===(null==e.currentPageElementObj.element_class?null:e.currentPageElementObj.element_class.indexOf("only-6"))?7:6),s.uc("disabled",e.currentPageElementObj.disabled)("value",e.currentPageElementObj.value)("ngModel",e.currentPageElementObj.value),s.Lb(2),s.uc("ngIf",e.showVisasInput),s.Lb(1),s.uc("ngIf",null==e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus),s.Lb(1),s.uc("ngIf",!e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus||e.currentPageElementObj.value&&e.submitStatus&&!e.currentPageElementObj.isValidate),s.Lb(1),s.uc("ngForOf",null==e.currentPageElementObj?null:e.currentPageElementObj.childElements)}}let M=(()=>{class e{constructor(e,t){this.commonService=e,this.companyService=t,this.onChangeValue=new s.q,this.showVisasInput=!1,this.validateMessage="",this.showInput=!0,this.visaCounterInfo={allocated_visa:0,available_visa:0,used_visa:0,no_downgrade:!1}}ngOnInit(){var e,t,n;this.currentPageElementObj.custom_rule.default.value&&!this.currentPageElementObj.value&&(this.currentPageElementObj.value=this.currentPageElementObj.custom_rule.default.value),(null===(e=this.currentPageElementObj.element_class)||void 0===e?void 0:e.indexOf("visa-requirements"))>-1&&(this.showInput=!1,(-1===(null===(t=this.currentPageElementObj.element_class)||void 0===t?void 0:t.indexOf("only-6"))&&parseInt(this.currentPageElementObj.value)>=7||(null===(n=this.currentPageElementObj.element_class)||void 0===n?void 0:n.indexOf("only-6"))>-1&&parseInt(this.currentPageElementObj.value)>=6)&&(this.showVisasInput=!0),!this.currentPageElementObj.value&&$(window).width()<=768&&(this.currentPageElementObj.value=0)),this.currentPageElementObj.element_class&&this.currentPageElementObj.element_class.includes("no-downgrade")&&this.currentPageElementObj.element_class.indexOf("no-downgrade")>-1&&this.getVisaCounter()}ngAfterViewInit(){setTimeout(()=>{this.commonService.loadDefaultInputAnimation(),this.currentPageElementObj.value?$(".slider").val(parseInt(this.currentPageElementObj.value)).rangeslider():$(".slider").val(0).rangeslider()},1)}onChange(e,t){let n=this.currentPageElementObj.custom_rule.attributes.maximum;this.rowClass&&this.rowClass.includes("share-quantity-value")?this.onChangeValue.emit({value:e,rowIndex:this.rowIndex,rowType:this.rowType,savedShareHolderUsers:!1,currentPageElementObj:this.currentPageElementObj}):this.onChangeValue.emit({value:e,rowIndex:this.rowIndex,rowType:this.rowType,currentPageElementObj:this.currentPageElementObj}),e?(this.currentPageElementObj.custom_rule&&this.currentPageElementObj.custom_rule.attributes&&"email"===this.currentPageElementObj.custom_rule.attributes.type&&(this.currentPageElementObj.isValidate=!!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e.toLowerCase())),this.currentPageElementObj.minimum||this.currentPageElementObj.maximum?"number"===this.currentPageElementObj.custom_rule.attributes.type&&(this.currentPageElementObj.minimum&&parseFloat(e)parseFloat(this.currentPageElementObj.maximum)?(this.validateMessage="Maximum "+this.currentPageElementObj.title+" can be "+this.currentPageElementObj.maximum+" only.",this.currentPageElementObj.isValidate=!1):(this.validateMessage="",this.currentPageElementObj.isValidate=!0)):this.currentPageElementObj.custom_rule&&this.currentPageElementObj.custom_rule.attributes&&"number"===this.currentPageElementObj.custom_rule.attributes.type&&(this.currentPageElementObj.custom_rule.attributes.min&&parseFloat(e)parseFloat(n)?(this.validateMessage="Maximum "+this.currentPageElementObj.title+" can be "+n+" only.",this.currentPageElementObj.isValidate=!1):(this.validateMessage="",this.currentPageElementObj.isValidate=!0)),this.currentPageElementObj.custom_rule&&this.currentPageElementObj.custom_rule.attributes&&this.currentPageElementObj.custom_rule.attributes["data-regex"]&&this.currentPageElementObj.custom_rule.attributes.pattern&&(/^[A-Za-z .-]*$/.test(e.toLowerCase())?this.currentPageElementObj.isValidate=!0:(this.currentPageElementObj.isValidate=!1,this.validateMessage=this.currentPageElementObj.custom_rule.attributes.title?this.currentPageElementObj.custom_rule.attributes.title:"special characters are not allowed."))):(this.validateMessage="",this.currentPageElementObj.isValidate=!0),(this.showVisasInput&&e<7&&!t||this.showVisasInput&&e<6&&t)&&(this.showVisasInput=!1)}getVisaCounter(){let e={company_id:!0,jurisdiction:"1"===localStorage.getItem(l.a.LOCAL_STORAGE.IS_JURISDICTION)?localStorage.getItem(l.a.LOCAL_STORAGE.JURISDICTION_ID):1};this.companyService.getVisaCounter(e).subscribe(e=>{if(200==e.status){let t=e.data.result;this.visaCounterInfo={allocated_visa:t.allocated_visa?t.allocated_visa:0,available_visa:t.availed_visa?t.availed_visa:0,used_visa:t.used_visa?t.used_visa:0,no_downgrade:!0}}})}onSelectVisas(e,t){parseInt(e)>=7||t?(this.visaCounterInfo.no_downgrade&&this.applyVisaValidation(e,t),this.showVisasInput=!0,setTimeout(()=>{this.commonService.loadDefaultInputAnimation()},1)):this.showVisasInput=!1,this.visaCounterInfo.no_downgrade&&this.applyVisaValidation(e,t),this.saveSelectedVisa(e,t)}applyVisaValidation(e,t){if(this.visaCounterInfo.used_visa>e)return this.currentPageElementObj.value="",this.commonService.showToaster("error","Total active visa count is greater than the requested visa allocation; please complete the visa cancellation process before proceeding.");this.saveSelectedVisa(e,t)}saveSelectedVisa(e,t){this.onChange(e,t),this.currentPageElementObj.value=e}}return e.\u0275fac=function(t){return new(t||e)(s.Xb(u.b),s.Xb(u.d))},e.\u0275cmp=s.Rb({type:e,selectors:[["app-text"]],inputs:{rowType:"rowType",rowIndex:"rowIndex",detectedChange:"detectedChange",submitStatus:"submitStatus",currentPageElementObj:"currentPageElementObj",rowClass:"rowClass"},outputs:{onChangeValue:"onChangeValue"},decls:2,vars:2,consts:[[3,"class",4,"ngIf"],[4,"ngIf"],["class","input-info",4,"ngIf"],["class","currency-label",4,"ngIf"],[3,"type","id","ngModel","minlength","maxlength","disabled","required","min","max","ngModelChange","change"],["class","input-required description",4,"ngIf"],["class","input-required",4,"ngIf"],[1,"input-info"],["type","button","data-container","body","data-toggle","popover","data-placement","right","data-content","Tooltip text example",1,"btn-0"],[1,"material-icons"],[1,"tooltips",3,"innerHtml"],[1,"currency-label"],[1,"input-required","description"],[1,"input-required"],[1,"service-rating-module"],[1,"rating-list","hidden-xs"],["href","#","onclick","return false;",3,"click"],["href","#","onclick","return false;",3,"class","click",4,"ngIf"],[1,"range-slider","slider-gradient","visible-xs"],["min","0","step","1","type","range",1,"slider","slider-orange",3,"disabled","value","ngModel","max","ngModelChange","input"],[1,"clearfix"],[4,"ngFor","ngForOf"],[1,"row"],[1,"col-sm-6","col-xs-12"],[1,"form-group"],[1,"material_input_block"],["type","number","onkeydown","if(event.key==='.'){event.preventDefault();}else if(event.which === 86) {event.preventDefault();}",3,"id","ngModel","minlength","maxlength","disabled","required","min","max","ngModelChange","focusout"],[1,"alert"],[1,"alert-danger","error-comment-box"],[1,"error-comment-text-danger"]],template:function(e,t){1&e&&(s.Pc(0,L,9,20,"div",0),s.Pc(1,N,32,37,"div",1)),2&e&&(s.uc("ngIf",t.showInput),s.Lb(1),s.uc("ngIf",!t.showInput))},directives:[r.n,a.b,c.a,a.n,a.q,a.j,a.i,a.x,a.v,r.m,a.s],styles:[""]}),e})();function A(e,t){if(1&e&&(s.dc(0,"div",8),s.Rc(1),s.cc()),2&e){const e=s.oc(2);s.Lb(1),s.Tc(" ",e.currentPageElementObj.title,"")}}function Y(e,t){if(1&e){const e=s.ec();s.dc(0,"label",9),s.dc(1,"input",10),s.kc("ngModelChange",function(t){return s.Gc(e),s.oc(2).currentPageElementObj.value=t})("change",function(){s.Gc(e);const n=t.$implicit;return s.oc(2).onSelectValue(n)}),s.cc(),s.Yb(2,"span",11),s.dc(3,"span",12),s.Rc(4),s.cc(),s.dc(5,"p"),s.Rc(6),s.cc(),s.cc()}if(2&e){const e=t.$implicit,n=s.oc(2);s.Lb(1),s.Nb(n.currentPageElementObj.element_class+" material_radiobox material_input"),s.uc("name",e.attributes.name)("id",e.attributes.id)("value",e.attributes.value)("ngModel",n.currentPageElementObj.value)("disabled",n.currentPageElementObj.disabled||e.textDisabled)("required",n.currentPageElementObj.required),s.Lb(3),s.Sc(e.text),s.Lb(2),s.Sc(e.attributes["data-text"])}}function G(e,t){if(1&e&&(s.dc(0,"span",13),s.dc(1,"i",14),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}function J(e,t){if(1&e&&(s.dc(0,"div",4),s.Pc(1,A,2,1,"div",5),s.Pc(2,Y,7,10,"label",6),s.Pc(3,G,5,1,"span",7),s.cc()),2&e){const e=s.oc();s.Lb(1),s.uc("ngIf",e.currentPageElementObj.element_class&&e.currentPageElementObj.element_class.includes("radio_design_vertical")&&!e.currentPageElementObj.element_class.includes("shareholder_domicile_risk")||!e.currentPageElementObj.element_class),s.Lb(1),s.uc("ngForOf",e.currentPageElementObj.custom_rule.siblings),s.Lb(1),s.uc("ngIf",!e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus)}}function B(e,t){if(1&e){const e=s.ec();s.dc(0,"div"),s.dc(1,"label",9),s.dc(2,"input",10),s.kc("ngModelChange",function(t){return s.Gc(e),s.oc(2).currentPageElementObj.value=t})("change",function(){s.Gc(e);const n=t.$implicit;return s.oc(2).onSelectValue(n)}),s.cc(),s.Yb(3,"span",11),s.dc(4,"strong"),s.Rc(5),s.cc(),s.dc(6,"p"),s.Rc(7),s.cc(),s.cc(),s.cc()}if(2&e){const e=t.$implicit,n=s.oc(2);s.Nb(n.currentPageElementObj.value==e.attributes.value?"shareholder-block active":"shareholder-block"),s.Lb(2),s.Nb(n.currentPageElementObj.element_class+" material_radiobox material_input"),s.uc("name",e.attributes.name)("id",e.attributes.id)("value",e.attributes.value)("ngModel",n.currentPageElementObj.value)("disabled",n.currentPageElementObj.disabled||e.textDisabled)("required",n.currentPageElementObj.required),s.Lb(3),s.Sc(e.text),s.Lb(2),s.Sc(e.attributes["data-text"])}}function z(e,t){if(1&e&&(s.dc(0,"span",13),s.dc(1,"i",14),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}function H(e,t){if(1&e&&(s.dc(0,"div"),s.dc(1,"div",15),s.Pc(2,B,8,12,"div",16),s.cc(),s.Yb(3,"div",17),s.Pc(4,z,5,1,"span",7),s.cc()),2&e){const e=s.oc();s.Lb(2),s.uc("ngForOf",e.currentPageElementObj.custom_rule.siblings),s.Lb(2),s.uc("ngIf",!e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus)}}function U(e,t){if(1&e&&s.Yb(0,"img",20),2&e){const e=s.oc().$implicit;s.uc("src",e.attributes["data-icon"],s.Jc)("alt",e.attributes["data-text"])}}function X(e,t){if(1&e){const e=s.ec();s.dc(0,"div"),s.dc(1,"label",9),s.dc(2,"input",10),s.kc("ngModelChange",function(t){return s.Gc(e),s.oc(2).currentPageElementObj.value=t})("change",function(){s.Gc(e);const n=t.$implicit;return s.oc(2).onSelectValue(n)}),s.cc(),s.dc(3,"div",18),s.Pc(4,U,1,2,"img",19),s.cc(),s.Yb(5,"span",11),s.dc(6,"strong"),s.Rc(7),s.cc(),s.dc(8,"p"),s.Rc(9),s.cc(),s.cc(),s.cc()}if(2&e){const e=t.$implicit,n=s.oc(2);s.Nb(n.currentPageElementObj.value==e.attributes.value?"shareholder-block active":"shareholder-block"),s.Lb(2),s.Nb(n.currentPageElementObj.element_class+" material_radiobox material_input"),s.uc("name",e.attributes.name)("id",e.attributes.id)("value",e.attributes.value)("ngModel",n.currentPageElementObj.value)("disabled",n.currentPageElementObj.disabled||e.textDisabled)("required",n.currentPageElementObj.required),s.Lb(2),s.uc("ngIf",e.attributes["data-icon"]),s.Lb(3),s.Sc(e.text),s.Lb(2),s.Sc(e.attributes["data-text"])}}function W(e,t){if(1&e&&(s.dc(0,"span",13),s.dc(1,"i",14),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}function K(e,t){if(1&e&&(s.dc(0,"div"),s.dc(1,"div",15),s.Pc(2,X,10,13,"div",16),s.cc(),s.Yb(3,"div",17),s.Pc(4,W,5,1,"span",7),s.cc()),2&e){const e=s.oc();s.Lb(2),s.uc("ngForOf",e.currentPageElementObj.custom_rule.siblings),s.Lb(2),s.uc("ngIf",!e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus)}}function Z(e,t){if(1&e&&s.Yb(0,"img",20),2&e){const e=s.oc().$implicit;s.uc("src",e.attributes["data-icon"],s.Jc)("alt",e.attributes["data-text"])}}function Q(e,t){if(1&e){const e=s.ec();s.dc(0,"div",24),s.dc(1,"div",25),s.dc(2,"label",9),s.dc(3,"div",26),s.dc(4,"div",27),s.Pc(5,Z,1,2,"img",19),s.cc(),s.dc(6,"div",28),s.dc(7,"input",10),s.kc("ngModelChange",function(t){return s.Gc(e),s.oc(2).currentPageElementObj.value=t})("change",function(){s.Gc(e);const n=t.$implicit;return s.oc(2).onSelectValue(n)}),s.cc(),s.Yb(8,"span",11),s.cc(),s.cc(),s.dc(9,"div",29),s.dc(10,"h4"),s.Rc(11),s.cc(),s.dc(12,"p"),s.Rc(13),s.cc(),s.cc(),s.cc(),s.cc(),s.cc()}if(2&e){const e=t.$implicit,n=s.oc(2);s.Lb(5),s.uc("ngIf",e.attributes["data-icon"]),s.Lb(2),s.Nb(n.currentPageElementObj.element_class+" material_radiobox material_input"),s.uc("name",e.attributes.name)("id",e.attributes.id)("value",e.attributes.value)("ngModel",n.currentPageElementObj.value)("disabled",n.currentPageElementObj.disabled||e.textDisabled)("required",n.currentPageElementObj.required),s.Lb(4),s.Sc(e.text),s.Lb(2),s.Sc(e.attributes["data-text"])}}function ee(e,t){if(1&e&&(s.dc(0,"span",13),s.dc(1,"i",14),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}function te(e,t){if(1&e&&(s.dc(0,"div",21),s.dc(1,"div",22),s.Pc(2,Q,14,11,"div",23),s.cc(),s.Pc(3,ee,5,1,"span",7),s.cc()),2&e){const e=s.oc();s.Lb(2),s.uc("ngForOf",e.currentPageElementObj.custom_rule.siblings),s.Lb(1),s.uc("ngIf",!e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus)}}function ne(e,t){if(1&e){const e=s.ec();s.dc(0,"label",9),s.dc(1,"input",10),s.kc("ngModelChange",function(t){return s.Gc(e),s.oc(2).currentPageElementObj.value=t})("change",function(){s.Gc(e);const n=t.$implicit;return s.oc(2).onSelectValue(n)}),s.cc(),s.Yb(2,"span",11),s.dc(3,"span",12),s.Rc(4),s.cc(),s.dc(5,"p"),s.Rc(6),s.cc(),s.cc()}if(2&e){const e=t.$implicit,n=s.oc(2);s.Lb(1),s.Nb(n.currentPageElementObj.element_class+" material_radiobox material_input"),s.uc("name",e.attributes.name)("id",e.attributes.id)("value",e.attributes.value)("ngModel",n.currentPageElementObj.value)("disabled",n.currentPageElementObj.disabled||e.textDisabled)("required",n.currentPageElementObj.required),s.Lb(3),s.Sc(e.text),s.Lb(2),s.Sc(e.attributes["data-text"])}}function ae(e,t){if(1&e&&(s.dc(0,"span",13),s.dc(1,"i",14),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}function ie(e,t){if(1&e&&(s.dc(0,"div",30),s.Pc(1,ne,7,10,"label",6),s.Pc(2,ae,5,1,"span",7),s.cc()),2&e){const e=s.oc();s.Lb(1),s.uc("ngForOf",e.currentPageElementObj.custom_rule.siblings),s.Lb(1),s.uc("ngIf",!e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus)}}function ce(e,t){if(1&e){const e=s.ec();s.dc(0,"label",9),s.dc(1,"input",10),s.kc("ngModelChange",function(t){return s.Gc(e),s.oc(2).currentPageElementObj.value=t})("change",function(){s.Gc(e);const n=t.$implicit;return s.oc(2).onSelectValue(n)}),s.cc(),s.Yb(2,"span",11),s.dc(3,"span",12),s.Rc(4),s.cc(),s.dc(5,"p"),s.Rc(6),s.cc(),s.cc()}if(2&e){const e=t.$implicit,n=s.oc(2);s.Lb(1),s.Nb(n.currentPageElementObj.element_class+" material_radiobox material_input"),s.uc("name",e.attributes.name)("id",e.attributes.id)("value",e.attributes.value)("ngModel",n.currentPageElementObj.value)("disabled",n.currentPageElementObj.disabled||e.textDisabled)("required",n.currentPageElementObj.required),s.Lb(3),s.Sc(e.text),s.Lb(2),s.Sc(e.attributes["data-text"])}}function re(e,t){if(1&e&&(s.dc(0,"span",13),s.dc(1,"i",14),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}function le(e,t){if(1&e&&(s.dc(0,"div",30),s.Pc(1,ce,7,10,"label",6),s.Pc(2,re,5,1,"span",7),s.cc()),2&e){const e=s.oc();s.Lb(1),s.uc("ngForOf",e.currentPageElementObj.custom_rule.siblings),s.Lb(1),s.uc("ngIf",!e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus)}}function se(e,t){if(1&e){const e=s.ec();s.dc(0,"label",9),s.dc(1,"input",10),s.kc("ngModelChange",function(t){return s.Gc(e),s.oc(2).currentPageElementObj.value=t})("change",function(){s.Gc(e);const n=t.$implicit;return s.oc(2).onSelectValue(n)}),s.cc(),s.Yb(2,"span",11),s.dc(3,"span",12),s.Rc(4),s.cc(),s.dc(5,"p"),s.Rc(6),s.cc(),s.cc()}if(2&e){const e=t.$implicit,n=s.oc(2);s.Lb(1),s.Nb(n.currentPageElementObj.element_class+" material_radiobox material_input"),s.uc("name",e.attributes.name)("id",e.attributes.id)("value",e.attributes.value)("ngModel",n.currentPageElementObj.value)("disabled",n.currentPageElementObj.disabled||e.textDisabled)("required",n.currentPageElementObj.required),s.Lb(3),s.Sc(e.text),s.Lb(2),s.Sc(e.attributes["data-text"])}}function oe(e,t){if(1&e&&(s.dc(0,"span",13),s.dc(1,"i",14),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}function ue(e,t){if(1&e&&(s.dc(0,"div",30),s.dc(1,"h4"),s.Rc(2),s.cc(),s.Pc(3,se,7,10,"label",6),s.Pc(4,oe,5,1,"span",7),s.cc()),2&e){const e=s.oc();s.Lb(2),s.Sc(e.currentPageElementObj.title),s.Lb(1),s.uc("ngForOf",e.currentPageElementObj.custom_rule.siblings),s.Lb(1),s.uc("ngIf",!e.currentPageElementObj.value&&e.currentPageElementObj.required&&e.submitStatus)}}let de=(()=>{class e{constructor(e){this.commonService=e,this.onChangeValue=new s.q,this.selectedElement=""}ngOnInit(){this.currentPageElementObj.custom_rule.default.value&&!this.currentPageElementObj.value&&(this.currentPageElementObj.value=this.currentPageElementObj.custom_rule.default.value),"number"==typeof this.currentPageElementObj.value&&(this.currentPageElementObj.value=this.currentPageElementObj.value.toString()),this.currentPageElementObj.custom_rule.siblings.map(e=>{e.textDisabled="disabled"===e.attributes["option-disabled"],e.allowed_shareholder_type&&(e.textDisabled=!0)}),this.currentPageElementObj.custom_rule.siblings.map((e,t)=>{var n,a;"discontinued"===e.attributes["option-discontinued"]&&((null===(a=null===(n=this.currentPageElementObj)||void 0===n?void 0:n.value)||void 0===a?void 0:a.includes(e.attributes.value))?e.textDisabled=!0:e.isDelete=!0,this.currentPageElementObj.custom_rule.siblings=this.currentPageElementObj.custom_rule.siblings.filter(e=>!(null==e?void 0:e.isDelete)))}),this.selectedElement=this.currentPageElementObj.value,""!=this.selectedElement&&this.onChangeValue.emit({value:this.currentPageElementObj.value,rowIndex:this.rowIndex,rowType:this.rowType,currentPageElementObj:this.currentPageElementObj}),setTimeout(()=>{$(".shareholder-row .shareholder-block").matchHeight()},200)}onSelectValue(e){this.selectedElement=e.attributes.value,this.currentPageElementObj.value=e.attributes.value,this.onChangeValue.emit({value:this.currentPageElementObj.value,rowIndex:this.rowIndex,rowType:this.rowType,currentPageElementObj:this.currentPageElementObj})}}return e.\u0275fac=function(t){return new(t||e)(s.Xb(u.b))},e.\u0275cmp=s.Rb({type:e,selectors:[["app-radio"]],inputs:{rowType:"rowType",rowIndex:"rowIndex",detectedChange:"detectedChange",submitStatus:"submitStatus",currentPageElementObj:"currentPageElementObj"},outputs:{onChangeValue:"onChangeValue"},decls:7,vars:7,consts:[["class","radiobox-module",4,"ngIf"],[4,"ngIf"],["class","card-module",4,"ngIf"],["class","resident-info",4,"ngIf"],[1,"radiobox-module"],["class","title",4,"ngIf"],["class","material_radio_group",4,"ngFor","ngForOf"],["class","input-required p-l-0",4,"ngIf"],[1,"title"],[1,"material_radio_group"],["type","radio",3,"name","id","value","ngModel","disabled","required","ngModelChange","change"],[1,"material_check_radio"],[1,"radio-label"],[1,"input-required","p-l-0"],[1,"material-icons"],[1,"shareholder-row"],[3,"class",4,"ngFor","ngForOf"],[1,"clearfix"],[1,"flag"],[3,"src","alt",4,"ngIf"],[3,"src","alt"],[1,"card-module"],[1,"row"],["class","col-sm-12 col-md-3",4,"ngFor","ngForOf"],[1,"col-sm-12","col-md-3"],[1,"card-wrapper"],[1,"card-img"],[1,"cardimg"],[1,"radio-bg"],[1,"card-detail"],[1,"resident-info"]],template:function(e,t){1&e&&(s.Pc(0,J,4,3,"div",0),s.Pc(1,H,5,2,"div",1),s.Pc(2,K,5,2,"div",1),s.Pc(3,te,4,2,"div",2),s.Pc(4,ie,3,2,"div",3),s.Pc(5,le,3,2,"div",3),s.Pc(6,ue,5,3,"div",3)),2&e&&(s.uc("ngIf",t.currentPageElementObj.element_class&&t.currentPageElementObj.element_class.includes("radio_design_vertical")||!t.currentPageElementObj.element_class),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.element_class&&(t.currentPageElementObj.element_class.includes("radio_design_horizontal")||!t.currentPageElementObj.element_class.includes("radio_design_image_horizontal")&&(null==t.currentPageElementObj.element_class?null:t.currentPageElementObj.element_class.includes("ubo_options"))||!t.currentPageElementObj.element_class.includes("radio_design_image_horizontal")&&t.currentPageElementObj.element_class.includes("nominee_options"))),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.element_class&&t.currentPageElementObj.element_class.includes("radio_design_image_horizontal")),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.element_class&&t.currentPageElementObj.element_class.includes("radio_design_banner")),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.element_class&&t.currentPageElementObj.element_class.includes("radio_design_simple_horizontal")),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.element_class&&!t.currentPageElementObj.element_class.includes("radio_design_simple_horizontal")&&!t.currentPageElementObj.element_class.includes("radio_design_simple_label_horizontal")&&!t.currentPageElementObj.element_class.includes("radio_design_banner")&&!t.currentPageElementObj.element_class.includes("radio_design_image_horizontal")&&!t.currentPageElementObj.element_class.includes("radio_design_horizontal")&&!t.currentPageElementObj.element_class.includes("nominee_options")&&!t.currentPageElementObj.element_class.includes("ubo_options")&&!t.currentPageElementObj.element_class.includes("radio_design_vertical")),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.element_class&&t.currentPageElementObj.element_class.includes("radio_design_simple_label_horizontal")))},directives:[r.n,r.m,a.u,a.b,c.a,a.n,a.q,a.x],styles:[""]}),e})();function me(e,t){if(1&e&&(s.dc(0,"span",5),s.dc(1,"button",6),s.dc(2,"i",3),s.Rc(3,"help_outline"),s.cc(),s.cc(),s.Yb(4,"span",7),s.cc()),2&e){const e=s.oc();s.Lb(4),s.uc("innerHtml",e.currentPageElementObj.custom_rule.link.page_content,s.Hc)}}function be(e,t){if(1&e&&(s.dc(0,"span",8),s.dc(1,"i",3),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(4),s.Tc("Please enter valid ",e.currentPageElementObj.title,".")}}let ge=(()=>{class e{constructor(){this.onChangeValue=new s.q,this.allowPastDate=!1,this.allowFutureDate=!1}ngOnInit(){var e,t,n,a,i,c,r,l,s,o,u,d,m,b,g,p,h,v,f,P,O;this.currentPageElementObj.custom_rule.default.value&&!this.currentPageElementObj.value&&(this.currentPageElementObj.value=this.currentPageElementObj.custom_rule.default.value);let E="dd/mm/yyyy",y="",j="";if(null===(t=null===(e=this.currentPageElementObj)||void 0===e?void 0:e.custom_rule)||void 0===t?void 0:t.extra_validation){switch(null===(n=this.currentPageElementObj.custom_rule.extra_validation)||void 0===n?void 0:n.date_format){case"1":E="dd/mm/yyyy";break;case"2":E="mm-dd-yyyy";break;case"3":E="yyyy-mm-dd";break;case"4":E="dd-M-yyyy";break;default:E="dd/mm/yyyy"}y=null===(c=null===(i=null===(a=this.currentPageElementObj)||void 0===a?void 0:a.custom_rule)||void 0===i?void 0:i.extra_validation)||void 0===c?void 0:c.date_from,j=null===(s=null===(l=null===(r=this.currentPageElementObj)||void 0===r?void 0:r.custom_rule)||void 0===l?void 0:l.extra_validation)||void 0===s?void 0:s.date_to;let e="days";"d"===(null===(o=this.currentPageElementObj.custom_rule.extra_validation)||void 0===o?void 0:o.till_date_unit)?e="days":"m"===(null===(u=this.currentPageElementObj.custom_rule.extra_validation)||void 0===u?void 0:u.till_date_unit)?e="months":"y"===this.currentPageElementObj.custom_rule.extra_validation.till_date_unit&&(e="years");let t="days";"d"===(null===(d=this.currentPageElementObj.custom_rule.extra_validation)||void 0===d?void 0:d.from_date_unit)?t="days":"m"===(null===(m=this.currentPageElementObj.custom_rule.extra_validation)||void 0===m?void 0:m.from_date_unit)?t="months":"y"===this.currentPageElementObj.custom_rule.extra_validation.from_date_unit&&(t="years"),this.allowPastDate=!1,this.allowFutureDate=!1,this.currentPageElementObj.custom_rule.extra_validation.hasOwnProperty("past_date")&&(this.allowPastDate=!0,(null===(b=this.currentPageElementObj.custom_rule.extra_validation)||void 0===b?void 0:b.till_date_counter)&&(y=_().subtract(this.currentPageElementObj.custom_rule.extra_validation.till_date_counter,e).format()),(null===(g=this.currentPageElementObj.custom_rule.extra_validation)||void 0===g?void 0:g.from_date_counter)&&(j=_().subtract(this.currentPageElementObj.custom_rule.extra_validation.from_date_counter,t).format()),(null===(p=this.currentPageElementObj.custom_rule.extra_validation)||void 0===p?void 0:p.till_date_counter)&&(null===(h=this.currentPageElementObj.custom_rule.extra_validation)||void 0===h?void 0:h.from_date_counter)&&(j=_().subtract(this.currentPageElementObj.custom_rule.extra_validation.from_date_counter,t).format(),y=_(j).subtract(this.currentPageElementObj.custom_rule.extra_validation.till_date_counter,e).format())),this.currentPageElementObj.custom_rule.extra_validation.hasOwnProperty("future_date")&&(this.allowFutureDate=!0,(null===(v=this.currentPageElementObj.custom_rule.extra_validation)||void 0===v?void 0:v.till_date_counter)&&(j=_().add(this.currentPageElementObj.custom_rule.extra_validation.till_date_counter,e).format()),(null===(f=this.currentPageElementObj.custom_rule.extra_validation)||void 0===f?void 0:f.from_date_counter)&&(y=_().add(this.currentPageElementObj.custom_rule.extra_validation.from_date_counter,t).format()),(null===(P=this.currentPageElementObj.custom_rule.extra_validation)||void 0===P?void 0:P.till_date_counter)&&(null===(O=this.currentPageElementObj.custom_rule.extra_validation)||void 0===O?void 0:O.from_date_counter)&&(y=_().add(this.currentPageElementObj.custom_rule.extra_validation.from_date_counter,t).format(),j=_(y).add(this.currentPageElementObj.custom_rule.extra_validation.till_date_counter,e).format()))}setTimeout(()=>{this.loadJs(this.currentPageElementObj.value,E,y,j)},100)}loadJs(e,t,n,a){var i=this;let c="",r="";n||a||this.allowPastDate||this.allowFutureDate||(c=""),n||a||this.allowPastDate||this.allowFutureDate||(r="");let l=t.toUpperCase();"DD-M-YYYY"===l&&(l="DD-MMM-YYYY"),this.allowPastDate&&(r=_().format(l)),this.allowFutureDate&&(c=_().format(l)),n&&a?(c=_(n).format(l),r=_(a).format(l)):n&&!a?c=_(n).format(l):!n&&a&&(r=_(a).format(l)),i.currentPageElementObj.value=e,$("#"+this.currentPageElementObj.custom_rule.attributes.id).datepicker({autoclose:!0,format:t,startDate:c,endDate:r,todayHighlight:!0}).datepicker("update",e).on("changeDate",function(){let e=$(this).datepicker("getFormattedDate");i.currentPageElementObj.value=e,i.onChangeValue.emit({value:e,rowIndex:i.rowIndex,rowType:i.rowType,currentPageElementObj:i.currentPageElementObj})})}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=s.Rb({type:e,selectors:[["app-date"]],inputs:{rowType:"rowType",rowIndex:"rowIndex",detectedChange:"detectedChange",submitStatus:"submitStatus",currentPageElementObj:"currentPageElementObj"},outputs:{onChangeValue:"onChangeValue"},decls:10,vars:10,consts:[["class","input-info",4,"ngIf"],["type","text","readonly","",1,"form-control","material_input",3,"id","disabled","required"],[1,"input-group-addon"],[1,"material-icons"],["class","input-required",4,"ngIf"],[1,"input-info"],["type","button","data-container","body","data-toggle","popover","data-placement","right","data-content","Tooltip text example",1,"btn-0"],[1,"tooltips",3,"innerHtml"],[1,"input-required"]],template:function(e,t){1&e&&(s.dc(0,"div"),s.Pc(1,me,5,1,"span",0),s.dc(2,"div"),s.dc(3,"label"),s.Rc(4),s.cc(),s.Yb(5,"input",1),s.dc(6,"span",2),s.dc(7,"span",3),s.Rc(8," calendar_today "),s.cc(),s.cc(),s.cc(),s.Pc(9,be,5,1,"span",4),s.cc()),2&e&&(s.Nb("datepicker-block form-group "+(!t.currentPageElementObj.value&&t.currentPageElementObj.required&&t.submitStatus?" error ":"")+(t.currentPageElementObj.custom_rule.link?"help-info":"")),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.custom_rule.link),s.Lb(1),s.Nb(t.currentPageElementObj.element_class+" datepicker input-group date material_input_block"),s.Lb(2),s.Sc(t.currentPageElementObj.title),s.Lb(1),s.uc("id",t.currentPageElementObj.custom_rule.attributes.id)("disabled",t.currentPageElementObj.disabled)("required",t.currentPageElementObj.required),s.Lb(4),s.uc("ngIf",!t.currentPageElementObj.value&&t.currentPageElementObj.required&&t.submitStatus))},directives:[r.n],styles:[""]}),e})();function pe(e,t){if(1&e&&(s.dc(0,"span",8),s.dc(1,"button",9),s.dc(2,"i",10),s.Rc(3,"help_outline"),s.cc(),s.cc(),s.Yb(4,"span",11),s.cc()),2&e){const e=s.oc();s.Lb(4),s.uc("innerHtml",e.currentPageElementObj.custom_rule.link.page_content,s.Hc)}}function he(e,t){if(1&e&&(s.dc(0,"span",12),s.dc(1,"i",10),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(4),s.Tc("Please enter valid ",e.currentPageElementObj.title,".")}}let ve=(()=>{class e{constructor(){this.onChangeValue=new s.q}ngOnInit(){this.currentPageElementObj.custom_rule.default.value&&!this.currentPageElementObj.value&&(this.currentPageElementObj.value=parseInt(this.currentPageElementObj.custom_rule.default.value)),setTimeout(()=>{this.loadJs(this.currentPageElementObj.value,this.currentPageElementObj.custom_rule.extra_validation?this.currentPageElementObj.custom_rule.extra_validation.time_from:"",this.currentPageElementObj.custom_rule.extra_validation?this.currentPageElementObj.custom_rule.extra_validation.time_to:"")},500)}loadJs(e,t,n){var a=this;let i=$("#"+this.currentPageElementObj.custom_rule.attributes.id).pickatime({min:t?t.split(":"):"",max:n?n.split(":"):"",onSet:function(e){a.currentPageElementObj.value=e.select.toString(),a.onChangeValue.emit({value:_().startOf("day").add(e.select.toString(),"minutes").format("HH:mm"),rowIndex:a.rowIndex,rowType:a.rowType,currentPageElementObj:a.currentPageElementObj})}}).pickatime("picker");e&&i.set("select",parseInt(e))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=s.Rb({type:e,selectors:[["app-time"]],inputs:{rowType:"rowType",rowIndex:"rowIndex",detectedChange:"detectedChange",submitStatus:"submitStatus",currentPageElementObj:"currentPageElementObj"},outputs:{onChangeValue:"onChangeValue"},decls:13,vars:11,consts:[[1,"timepicker-input"],["class","input-info",4,"ngIf"],[1,"material_input_block","time-label"],[1,"title"],["type","time",3,"id","disabled","required"],["href","#","onclick","return false;",1,"fa"],[1,"material-icons","link-primary"],["class","input-required",4,"ngIf"],[1,"input-info"],["type","button","data-container","body","data-toggle","popover","data-placement","right","data-content","Tooltip text example",1,"btn-0"],[1,"material-icons"],[1,"tooltips",3,"innerHtml"],[1,"input-required"]],template:function(e,t){1&e&&(s.dc(0,"div",0),s.dc(1,"div"),s.Pc(2,pe,5,1,"span",1),s.dc(3,"div",2),s.dc(4,"label",3),s.Rc(5),s.cc(),s.Yb(6,"input",4),s.dc(7,"label"),s.Rc(8),s.cc(),s.dc(9,"a",5),s.dc(10,"i",6),s.Rc(11,"access_time"),s.cc(),s.cc(),s.cc(),s.Pc(12,he,5,1,"span",7),s.cc(),s.cc()),2&e&&(s.Lb(1),s.Nb("form-group "+(!t.currentPageElementObj.value&&t.currentPageElementObj.required&&t.submitStatus?" error ":"")+(t.currentPageElementObj.custom_rule.link?"help-info":"")),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.custom_rule.link),s.Lb(3),s.Sc(t.currentPageElementObj.title),s.Lb(1),s.Nb(t.currentPageElementObj.element_class+" form-control material_input timepicker"),s.uc("id",t.currentPageElementObj.custom_rule.attributes.id)("disabled",t.currentPageElementObj.disabled)("required",t.currentPageElementObj.required),s.Lb(2),s.Sc(t.currentPageElementObj.title),s.Lb(4),s.uc("ngIf",!t.currentPageElementObj.value&&t.currentPageElementObj.required&&t.submitStatus))},directives:[r.n],styles:[""]}),e})();var _e=n("1RE4");function fe(e,t){if(1&e&&(s.dc(0,"span",4),s.dc(1,"button",5),s.dc(2,"i",6),s.Rc(3,"help_outline"),s.cc(),s.cc(),s.Yb(4,"span",7),s.cc()),2&e){const e=s.oc();s.Lb(4),s.uc("innerHtml",e.currentPageElementObj.custom_rule.link.page_content,s.Hc)}}function Pe(e,t){if(1&e&&(s.dc(0,"span",8),s.dc(1,"i",6),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(4),s.Tc("Please enter valid ",e.currentPageElementObj.title,".")}}const Oe=function(){return["ae"]};let Ee=(()=>{class e{constructor(e){this.commonService=e,this.currentPageElementObj={},this.onChangeValue=new s.q,this.selectedCountry=""}ngOnInit(){this.currentPageElementObj.custom_rule.default.value&&!this.currentPageElementObj.value&&(this.currentPageElementObj.value=this.currentPageElementObj.custom_rule.default.value),this.currentPageElementObj.value&&this.currentPageElementObj.value.hasOwnProperty("internationalNumber")&&(this.currentPageElementObj.value=this.currentPageElementObj.value.internationalNumber);let e=this.currentPageElementObj.value?Object(_e.a)(this.currentPageElementObj.value):"";e&&(this.selectedCountry=e.country,this.currentPageElementObj.value=e.nationalNumber)}onChange(e){this.onChangeValue.emit({value:e,rowIndex:this.rowIndex,rowType:this.rowType,currentPageElementObj:this.currentPageElementObj})}ngAfterViewInit(){setTimeout(()=>{var e;this.commonService.loadDefaultInputAnimation();for(var t=null===(e=document.getElementsByTagName("app-phone")[0])||void 0===e?void 0:e.childNodes,n=0;n{class e{constructor(e){this.commonService=e,this.onChangeValue=new s.q}ngOnInit(){this.currentPageElementObj.custom_rule.default.value&&!this.currentPageElementObj.value&&(this.currentPageElementObj.value=this.currentPageElementObj.custom_rule.default.value),setTimeout(()=>{this.commonService.loadDefaultInputAnimation()},500)}onChange(e){this.onChangeValue.emit({value:e,rowIndex:this.rowIndex,rowType:this.rowType,currentPageElementObj:this.currentPageElementObj})}}return e.\u0275fac=function(t){return new(t||e)(s.Xb(u.b))},e.\u0275cmp=s.Rb({type:e,selectors:[["app-textarea"]],inputs:{rowType:"rowType",rowIndex:"rowIndex",detectedChange:"detectedChange",submitStatus:"submitStatus",currentPageElementObj:"currentPageElementObj"},outputs:{onChangeValue:"onChangeValue"},decls:8,vars:12,consts:[["class","input-info",4,"ngIf"],[1,"material_input_block"],[1,"form-control","material_input","material_textarea",3,"ngModel","rows","cols","disabled","required","maxlength","ngModelChange","change"],["class","text-area-length-count",4,"ngIf"],["class","input-required",4,"ngIf"],[1,"input-info"],["type","button","data-container","body","data-toggle","popover","data-placement","right","data-content","Tooltip text example",1,"btn-0"],[1,"material-icons"],[1,"tooltips",3,"innerHtml"],[1,"text-area-length-count"],[1,"input-required"]],template:function(e,t){1&e&&(s.dc(0,"div"),s.Pc(1,ye,5,1,"span",0),s.dc(2,"div",1),s.dc(3,"textarea",2),s.kc("ngModelChange",function(e){return t.currentPageElementObj.value=e})("change",function(e){return t.onChange(e.target.value)}),s.cc(),s.dc(4,"label"),s.Rc(5),s.cc(),s.Pc(6,je,2,2,"span",3),s.cc(),s.Pc(7,ke,5,1,"span",4),s.cc()),2&e&&(s.Nb((!t.currentPageElementObj.value&&t.currentPageElementObj.required&&t.submitStatus?"form-group error ":"form-group")+(t.currentPageElementObj.custom_rule.link?" help-info":"")),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.custom_rule.link),s.Lb(2),s.uc("ngModel",t.currentPageElementObj.value)("rows",t.currentPageElementObj.custom_rule.attributes.rows)("cols",t.currentPageElementObj.custom_rule.attributes.cols)("disabled",t.currentPageElementObj.disabled)("required",t.currentPageElementObj.required)("maxlength",t.currentPageElementObj.custom_rule.attributes.maxlength),s.Lb(2),s.Sc(t.currentPageElementObj.custom_rule.attributes.placeholder),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.custom_rule.attributes.maxlength),s.Lb(1),s.uc("ngIf",!t.currentPageElementObj.value&&t.currentPageElementObj.required&&t.submitStatus))},directives:[r.n,a.b,c.a,a.n,a.q,a.x,a.i],styles:[""]}),e})();function xe(e,t){if(1&e&&(s.dc(0,"span",3),s.dc(1,"button",4),s.dc(2,"i",5),s.Rc(3,"help_outline"),s.cc(),s.cc(),s.Yb(4,"span",6),s.cc()),2&e){const e=s.oc();s.Lb(4),s.uc("innerHtml",e.currentPageElementObj.custom_rule.link.page_content,s.Hc)}}function we(e,t){if(1&e&&(s.dc(0,"option",11),s.Rc(1),s.cc()),2&e){const e=t.$implicit;s.uc("value",e.id)("disabled",e.textDisabled),s.Lb(1),s.Sc(e.nationality)}}function Le(e,t){if(1&e&&(s.dc(0,"div",7),s.dc(1,"label",8),s.Rc(2),s.cc(),s.dc(3,"select",9),s.Yb(4,"option"),s.Pc(5,we,2,3,"option",10),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(2),s.Sc(e.currentPageElementObj.title),s.Lb(1),s.Nb(e.currentPageElementObj.element_id+" select2 material_input"),s.uc("id",e.currentPageElementObj.element_id)("disabled",e.currentPageElementObj.disabled),s.Lb(2),s.uc("ngForOf",e.countryList)}}function Ie(e,t){if(1&e&&(s.dc(0,"option",11),s.Rc(1),s.cc()),2&e){const e=t.$implicit;s.uc("value",e.id)("disabled",e.textDisabled),s.Lb(1),s.Sc(e.nationality_ar)}}function Ce(e,t){if(1&e&&(s.dc(0,"div",7),s.dc(1,"label",8),s.Rc(2),s.cc(),s.dc(3,"select",9),s.Yb(4,"option"),s.Pc(5,Ie,2,3,"option",10),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(2),s.Sc(e.currentPageElementObj.title),s.Lb(1),s.Nb(e.currentPageElementObj.element_id+" select2 material_input"),s.uc("id",e.currentPageElementObj.element_id)("disabled",e.currentPageElementObj.disabled),s.Lb(2),s.uc("ngForOf",e.countryListAr)}}function Te(e,t){if(1&e&&(s.dc(0,"option",11),s.Rc(1),s.cc()),2&e){const e=t.$implicit;s.uc("value",e.key)("disabled",e.textDisabled),s.Lb(1),s.Sc(e.value)}}function qe(e,t){if(1&e&&(s.dc(0,"div",7),s.dc(1,"label",8),s.Rc(2),s.cc(),s.dc(3,"select",9),s.Yb(4,"option"),s.Pc(5,Te,2,3,"option",10),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(2),s.Sc(e.currentPageElementObj.title),s.Lb(1),s.Nb(e.currentPageElementObj.element_id+" select2 material_input"),s.uc("id",e.currentPageElementObj.element_id)("disabled",e.currentPageElementObj.disabled),s.Lb(2),s.uc("ngForOf",e.currentPageElementObj.custom_rule.options)}}function De(e,t){if(1&e&&(s.dc(0,"span",12),s.dc(1,"i",5),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}let Fe=(()=>{class e{constructor(e,t,n){this.companyFormationService=e,this.commonService=t,this.interceptorService=n,this.onChangeValue=new s.q,this.countryList=[],this.countryListAr=[],this.isCountrySelector=!1,this.isArabicCountrySelector=!1}ngOnInit(){var e,t,n=this;if(!n.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-country")||!0!==n.currentPageElementObj.custom_rule.attributes["data-country"]&&"true"!==n.currentPageElementObj.custom_rule.attributes["data-country"])if(!n.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-arabic-country")||!0!==n.currentPageElementObj.custom_rule.attributes["data-arabic-country"]&&"true"!==n.currentPageElementObj.custom_rule.attributes["data-arabic-country"])if(!n.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_branches")||!0!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_branches"]&&"true"!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_branches"])if(!n.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_products")||!0!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_products"]&&"true"!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_products"])if(!n.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_addons")||!0!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_addons"]&&"true"!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_addons"])if(!n.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_source_of_funds")||!0!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_source_of_funds"]&&"true"!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_source_of_funds"])if(!n.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_primary_line_of_business")||!0!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_primary_line_of_business"]&&"true"!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_primary_line_of_business"])if(!n.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_trade_license_authorities")||!0!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_trade_license_authorities"]&&"true"!==n.currentPageElementObj.custom_rule.attributes["data-mashreqbank_trade_license_authorities"]){if(n.isCountrySelector=!1,(null===(t=null===(e=n.currentPageElementObj)||void 0===e?void 0:e.custom_rule)||void 0===t?void 0:t.options)&&n.currentPageElementObj.custom_rule.options.constructor!==Array){let e=Object.entries(n.currentPageElementObj.custom_rule.options),t=[];e.forEach(([e,n])=>{t.push({key:e,value:n})}),n.currentPageElementObj.custom_rule.options=t}this.loadSelectData(),setTimeout(()=>{$("#"+n.currentPageElementObj.element_id).select2()},100)}else n.isCountrySelector=!1,n.getData("license"),setTimeout(()=>{$("#"+n.currentPageElementObj.element_id).select2()},100);else n.isCountrySelector=!1,n.getData("primary"),setTimeout(()=>{$("#"+n.currentPageElementObj.element_id).select2()},100);else n.isCountrySelector=!1,n.getData("source"),setTimeout(()=>{$("#"+n.currentPageElementObj.element_id).select2()},100);else n.isCountrySelector=!1,n.getData("addOns"),setTimeout(()=>{$("#"+n.currentPageElementObj.element_id).select2()},100);else n.isCountrySelector=!1,n.getData("products"),setTimeout(()=>{$("#"+n.currentPageElementObj.element_id).select2()},100);else n.isCountrySelector=!1,n.getData("branches"),setTimeout(()=>{$("#"+n.currentPageElementObj.element_id).select2()},100);else n.isArabicCountrySelector=!0,n.getCountryList(!0),setTimeout(()=>{$("#"+n.currentPageElementObj.element_id).select2()},100);else n.isCountrySelector=!0,n.getCountryList(!1),setTimeout(()=>{$("#"+n.currentPageElementObj.element_id).select2()},100);if(this.currentPageElementObj.custom_rule["option-disabled"]){let e=Object.values(this.currentPageElementObj.custom_rule["option-disabled"]);this.currentPageElementObj.custom_rule.options.map(t=>{t.textDisabled=e.indexOf(t.value)>-1})}this.currentPageElementObj.custom_rule["option-discontinued"]&&(this.currentPageElementObj.custom_rule.options.map((e,t)=>{var n;let a=Object.values(this.currentPageElementObj.custom_rule["option-discontinued"]);(null===(n=this.currentPageElementObj)||void 0===n?void 0:n.value)==e.key&&(e.textDisabled=a.indexOf(e.value)>-1),a.includes(e.value)&&((null==e?void 0:e.textDisabled)||(e.isDelete=!0))}),this.currentPageElementObj.custom_rule.options=this.currentPageElementObj.custom_rule.options.filter(e=>!(null==e?void 0:e.isDelete)))}getCountryList(e){let t=window.location.href.split("/"),n=t[0]+"//"+t[2];const a=this;if(n.includes("spc")||n.includes("meydan")||n.includes("meydanfz")){e?a.countryListAr=localStorage.getItem("countryListAr")?JSON.parse(localStorage.getItem("countryListAr")):[]:a.countryList=localStorage.getItem("countryList")?JSON.parse(localStorage.getItem("countryList")):[];let t={};t.process_request_id=a.commonService.processRequestId,e&&(t.lang_code="ar"),a.companyFormationService.getCountryListInstantLicense(t).subscribe(t=>{200===t.status?(e?(a.countryListAr=t.data,localStorage.setItem("countryListAr",JSON.stringify(a.countryListAr))):(a.countryList=t.data,localStorage.setItem("countryList",JSON.stringify(a.countryList))),a.loadSelectData()):this.commonService.showToaster("error",t.message)},e=>{this.commonService.showToaster("error","Something went wrong. Please try again.")})}else if(e?a.countryListAr=localStorage.getItem("countryListAr")?JSON.parse(localStorage.getItem("countryListAr")):[]:a.countryList=localStorage.getItem("countryList")?JSON.parse(localStorage.getItem("countryList")):[],!e&&0===a.countryList.length||e&&0===a.countryListAr.length){let t={};e&&(t={lang_code:"ar"}),a.companyFormationService.getCountryListIsArabic(t).subscribe(t=>{200===t.status?(e?(a.countryListAr=t.data,localStorage.setItem("countryListAr",JSON.stringify(a.countryListAr))):(a.countryList=t.data,localStorage.setItem("countryList",JSON.stringify(a.countryList))),a.loadSelectData()):this.commonService.showToaster("error",t.message)},e=>{this.commonService.showToaster("error","Something went wrong. Please try again.")})}else a.loadSelectData()}loadSelectData(){var e=this,t=e.currentPageElementObj.value?e.currentPageElementObj.value:e.currentPageElementObj.custom_rule.default.value;t&&(e.currentPageElementObj.value=t,setTimeout(()=>{$("#"+e.currentPageElementObj.element_id).val(t),$("#"+e.currentPageElementObj.element_id).change(),this.commonService.loadDefaultSelectAnimation()},100)),$(document).off("change","#"+e.currentPageElementObj.element_id),$(document).on("change","#"+e.currentPageElementObj.element_id,function(){e.currentPageElementObj.value=$(this).val(),e.onChangeValue.emit({value:e.currentPageElementObj.value,rowIndex:e.rowIndex,rowType:e.rowType,currentPageElementObj:e.currentPageElementObj})})}getData(e){let t;switch(this.currentPageElementObj.custom_rule.options=[],e){case"branches":t=this.companyFormationService.getMashreqBankBranches();break;case"products":t=this.companyFormationService.getMashreqBankProducts();break;case"addOns":t=this.companyFormationService.getMashreqBankAddOns();break;case"primary":t=this.companyFormationService.getMashreqBankPrimaryLineofBusiness();break;case"source":t=this.companyFormationService.getMashreqBankSourceofFunds();break;case"license":t=this.companyFormationService.getMashreqBankTradeLicenseAuthorities()}t.subscribe(t=>{t.data.forEach(t=>{switch(e){case"branches":this.currentPageElementObj.custom_rule.options.push({key:t.code,value:t.name});break;case"products":this.currentPageElementObj.custom_rule.options.push({key:t.productId,value:t.productName});break;case"addOns":this.currentPageElementObj.custom_rule.options.push({key:t.code,value:t.name});break;case"primary":this.currentPageElementObj.custom_rule.options.push({key:t.natureOfBusiness,value:t.natureOfBusiness});break;case"source":this.currentPageElementObj.custom_rule.options.push({key:t.name,value:t.name});break;case"license":this.currentPageElementObj.custom_rule.options.push({key:t.authCode,value:t.tlAuthName})}}),this.loadSelectData()})}}return e.\u0275fac=function(t){return new(t||e)(s.Xb(u.c),s.Xb(u.b),s.Xb(u.g))},e.\u0275cmp=s.Rb({type:e,selectors:[["app-select"]],inputs:{rowType:"rowType",rowIndex:"rowIndex",submitStatus:"submitStatus",detectedChange:"detectedChange",currentPageElementObj:"currentPageElementObj"},outputs:{onChangeValue:"onChangeValue"},decls:8,vars:10,consts:[["class","input-info",4,"ngIf"],["class","material_input_block select2-label",4,"ngIf"],["class","input-required",4,"ngIf"],[1,"input-info"],["type","button","data-container","body","data-toggle","popover","data-placement","right","data-content","Tooltip text example",1,"btn-0"],[1,"material-icons"],[1,"tooltips",3,"innerHtml"],[1,"material_input_block","select2-label"],[1,"title"],["tabindex","-1","aria-hidden","true",3,"id","disabled"],[3,"value","disabled",4,"ngFor","ngForOf"],[3,"value","disabled"],[1,"input-required"]],template:function(e,t){1&e&&(s.dc(0,"div"),s.Pc(1,xe,5,1,"span",0),s.Pc(2,Le,6,6,"div",1),s.Pc(3,Ce,6,6,"div",1),s.Pc(4,qe,6,6,"div",1),s.Pc(5,De,5,1,"span",2),s.cc(),s.Rc(6),s.pc(7,"json")),2&e&&(s.Nb("form-group "+(!t.currentPageElementObj.value&&t.currentPageElementObj.required&&t.submitStatus?" error ":"")+(t.currentPageElementObj.custom_rule.link?"help-info":"")),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.custom_rule.link),s.Lb(1),s.uc("ngIf",t.isCountrySelector),s.Lb(1),s.uc("ngIf",t.isArabicCountrySelector),s.Lb(1),s.uc("ngIf",!t.isCountrySelector&&!t.isArabicCountrySelector),s.Lb(1),s.uc("ngIf",!t.currentPageElementObj.value&&t.currentPageElementObj.required&&t.submitStatus),s.Lb(1),s.Tc("\n",s.qc(7,8,t.currentPageElementObj),"1\n"))},directives:[r.n,a.r,a.B,r.m],pipes:[r.g],styles:[""]}),e})();function Re(e,t){if(1&e&&(s.dc(0,"span",3),s.dc(1,"button",4),s.dc(2,"i",5),s.Rc(3,"help_outline"),s.cc(),s.cc(),s.Yb(4,"span",6),s.cc()),2&e){const e=s.oc();s.Lb(4),s.uc("innerHtml",e.currentPageElementObj.custom_rule.link.page_content,s.Hc)}}function Ve(e,t){if(1&e&&(s.dc(0,"option",11),s.Rc(1),s.cc()),2&e){const e=t.$implicit;s.uc("value",e.id)("disabled",e.textDisabled),s.Lb(1),s.Sc(e.nationality)}}function Ne(e,t){if(1&e&&(s.dc(0,"div",7),s.dc(1,"label",8),s.Rc(2),s.cc(),s.dc(3,"select",9),s.Yb(4,"option"),s.Pc(5,Ve,2,3,"option",10),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(2),s.Sc(e.currentPageElementObj.title),s.Lb(1),s.Nb(e.currentPageElementObj.element_id+" select2 material_input"),s.uc("id",e.currentPageElementObj.element_id)("disabled",e.currentPageElementObj.disabled),s.Lb(2),s.uc("ngForOf",e.countryList)}}function Me(e,t){if(1&e&&(s.dc(0,"option",11),s.Rc(1),s.cc()),2&e){const e=t.$implicit;s.uc("value",e.key)("disabled",e.textDisabled),s.Lb(1),s.Sc(e.value)}}function $e(e,t){if(1&e&&(s.dc(0,"div",7),s.dc(1,"label",8),s.Rc(2),s.cc(),s.dc(3,"select",12),s.Yb(4,"option"),s.Pc(5,Me,2,3,"option",10),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(2),s.Sc(e.currentPageElementObj.title),s.Lb(1),s.uc("id",e.currentPageElementObj.element_id)("disabled",e.currentPageElementObj.disabled),s.Lb(2),s.uc("ngForOf",e.currentPageElementObj.custom_rule.options)}}function Ae(e,t){if(1&e&&(s.dc(0,"span",13),s.dc(1,"i",5),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}let Ye=(()=>{class e{constructor(e,t){this.companyFormationService=e,this.commonService=t,this.onChangeValue=new s.q,this.countryList=[],this.isCountrySelector=!1}ngOnInit(){var e,t;if(!this.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-country")||!0!==this.currentPageElementObj.custom_rule.attributes["data-country"]&&"true"!==this.currentPageElementObj.custom_rule.attributes["data-country"])if(!this.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_branches")||!0!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_branches"]&&"true"!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_branches"])if(!this.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_products")||!0!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_products"]&&"true"!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_products"])if(!this.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_addons")||!0!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_addons"]&&"true"!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_addons"])if(!this.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_source_of_funds")||!0!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_source_of_funds"]&&"true"!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_source_of_funds"])if(!this.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_primary_line_of_business")||!0!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_primary_line_of_business"]&&"true"!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_primary_line_of_business"])if(!this.currentPageElementObj.custom_rule.attributes.hasOwnProperty("data-mashreqbank_trade_license_authorities")||!0!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_trade_license_authorities"]&&"true"!==this.currentPageElementObj.custom_rule.attributes["data-mashreqbank_trade_license_authorities"]){if(this.isCountrySelector=!1,(null===(t=null===(e=this.currentPageElementObj)||void 0===e?void 0:e.custom_rule)||void 0===t?void 0:t.options)&&this.currentPageElementObj.custom_rule.options.constructor!==Array){let e=Object.entries(this.currentPageElementObj.custom_rule.options),t=[];e.forEach(([e,n])=>{t.push({key:e,value:n})}),this.currentPageElementObj.custom_rule.options=t}this.loadSelectData(),setTimeout(()=>{$("#"+this.currentPageElementObj.element_id).select2()},10)}else this.isCountrySelector=!1,this.getData("license"),setTimeout(()=>{$("#"+this.currentPageElementObj.element_id).select2({minimumResultsForSearch:0})},10);else this.isCountrySelector=!1,this.getData("primary"),setTimeout(()=>{$("#"+this.currentPageElementObj.element_id).select2({minimumResultsForSearch:0})},10);else this.isCountrySelector=!1,this.getData("source"),setTimeout(()=>{$("#"+this.currentPageElementObj.element_id).select2({minimumResultsForSearch:0})},10);else this.isCountrySelector=!1,this.getData("addOns"),setTimeout(()=>{$("#"+this.currentPageElementObj.element_id).select2({minimumResultsForSearch:0})},10);else this.isCountrySelector=!1,this.getData("products"),setTimeout(()=>{$("#"+this.currentPageElementObj.element_id).select2({minimumResultsForSearch:0})},10);else this.isCountrySelector=!1,this.getData("branches"),setTimeout(()=>{$("#"+this.currentPageElementObj.element_id).select2({minimumResultsForSearch:0})},10);else this.isCountrySelector=!0,this.getCountryList(),setTimeout(()=>{$("#"+this.currentPageElementObj.element_id).select2({minimumResultsForSearch:0})},10);let n=this.currentPageElementObj.custom_rule["option-disabled"]?Object.values(this.currentPageElementObj.custom_rule["option-disabled"]):[];this.currentPageElementObj.custom_rule.options.map(e=>{e.textDisabled=n.indexOf(e.value)>-1}),this.currentPageElementObj.custom_rule["option-discontinued"]&&(this.currentPageElementObj.custom_rule.options.map((e,t)=>{var n,a;let i=Object.values(this.currentPageElementObj.custom_rule["option-discontinued"]);(null===(a=null===(n=this.currentPageElementObj)||void 0===n?void 0:n.value)||void 0===a?void 0:a.includes(e.key))&&(e.textDisabled=i.indexOf(e.value)>-1),i.includes(e.value)&&((null==e?void 0:e.textDisabled)||(e.isDelete=!0))}),this.currentPageElementObj.custom_rule.options=this.currentPageElementObj.custom_rule.options.filter(e=>!(null==e?void 0:e.isDelete)))}getCountryList(){const e=this;e.countryList=localStorage.getItem("countryList")?JSON.parse(localStorage.getItem("countryList")):[],0===e.countryList.length?e.companyFormationService.getCountryList().subscribe(t=>{200===t.status&&(e.countryList=t.data,localStorage.setItem("countryList",JSON.stringify(e.countryList)),e.loadSelectData())},e=>{this.commonService.showToaster("error","Something went wrong. Please try again.")}):e.loadSelectData()}loadSelectData(){var e=this,t=e.currentPageElementObj.value?e.currentPageElementObj.value:e.currentPageElementObj.custom_rule.default.value;setTimeout(()=>{t&&($("#"+e.currentPageElementObj.element_id).val(t),$("#"+e.currentPageElementObj.element_id).change(),e.commonService.loadDefaultSelectAnimation()),e.currentPageElementObj.value=$("#"+e.currentPageElementObj.element_id).val(),$(document).off("change","#"+e.currentPageElementObj.element_id),$(document).on("change","#"+e.currentPageElementObj.element_id,function(){e.currentPageElementObj.value=$(this).val(),e.onChangeValue.emit({value:e.currentPageElementObj.value,rowIndex:e.rowIndex,rowType:e.rowType,currentPageElementObj:e.currentPageElementObj})})},100)}getData(e){let t;switch(this.currentPageElementObj.custom_rule.options=[],e){case"branches":t=this.companyFormationService.getMashreqBankBranches();break;case"products":t=this.companyFormationService.getMashreqBankProducts();break;case"addOns":t=this.companyFormationService.getMashreqBankAddOns();break;case"primary":t=this.companyFormationService.getMashreqBankPrimaryLineofBusiness();break;case"source":t=this.companyFormationService.getMashreqBankSourceofFunds();break;case"license":t=this.companyFormationService.getMashreqBankTradeLicenseAuthorities()}t.subscribe(t=>{t.data.forEach(t=>{switch(e){case"branches":this.currentPageElementObj.custom_rule.options.push({key:t.code,value:t.name});break;case"products":this.currentPageElementObj.custom_rule.options.push({key:t.productId,value:t.productName});break;case"addOns":this.currentPageElementObj.custom_rule.options.push({key:t.code,value:t.name});break;case"primary":this.currentPageElementObj.custom_rule.options.push({key:t.natureOfBusiness,value:t.natureOfBusiness});break;case"source":this.currentPageElementObj.custom_rule.options.push({key:t.name,value:t.name});break;case"license":this.currentPageElementObj.custom_rule.options.push({key:t.authCode,value:t.tlAuthName})}}),this.loadSelectData()})}}return e.\u0275fac=function(t){return new(t||e)(s.Xb(u.c),s.Xb(u.b))},e.\u0275cmp=s.Rb({type:e,selectors:[["app-select-multi"]],inputs:{rowType:"rowType",rowIndex:"rowIndex",detectedChange:"detectedChange",submitStatus:"submitStatus",currentPageElementObj:"currentPageElementObj"},outputs:{onChangeValue:"onChangeValue"},decls:5,vars:6,consts:[["class","input-info",4,"ngIf"],["class","material_input_block select2-label",4,"ngIf"],["class","input-required",4,"ngIf"],[1,"input-info"],["type","button","data-container","body","data-toggle","popover","data-placement","right","data-content","Tooltip text example",1,"btn-0"],[1,"material-icons"],[1,"tooltips",3,"innerHtml"],[1,"material_input_block","select2-label"],[1,"title"],["tabindex","-1","aria-hidden","true","multiple","multiple",3,"id","disabled"],[3,"value","disabled",4,"ngFor","ngForOf"],[3,"value","disabled"],["tabindex","-1","aria-hidden","true","multiple","multiple",1,"select2","material_input",3,"id","disabled"],[1,"input-required"]],template:function(e,t){1&e&&(s.dc(0,"div"),s.Pc(1,Re,5,1,"span",0),s.Pc(2,Ne,6,6,"div",1),s.Pc(3,$e,6,4,"div",1),s.Pc(4,Ae,5,1,"span",2),s.cc()),2&e&&(s.Nb("form-group "+(!t.currentPageElementObj.value&&t.currentPageElementObj.required&&t.submitStatus?" error ":"")+(t.currentPageElementObj.custom_rule.link?"help-info":"")),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.custom_rule.link),s.Lb(1),s.uc("ngIf",t.isCountrySelector),s.Lb(1),s.uc("ngIf",!t.isCountrySelector),s.Lb(1),s.uc("ngIf",!t.currentPageElementObj.value&&t.currentPageElementObj.required&&t.submitStatus))},directives:[r.n,a.r,a.B,r.m],styles:[""]}),e})();function Ge(e,t){if(1&e){const e=s.ec();s.dc(0,"div",5),s.dc(1,"input",6),s.kc("change",function(){s.Gc(e);const n=t.$implicit;return s.oc(2).manageCheckboxClick(n.attributes.value)}),s.cc(),s.dc(2,"label",7),s.Rc(3),s.cc(),s.dc(4,"p"),s.Rc(5),s.cc(),s.cc()}if(2&e){const e=t.$implicit,n=s.oc(2);s.Lb(1),s.Nb(n.currentPageElementObj.element_class+" material_checkbox material_checkbox_info material_input"),s.uc("type",e.attributes.type)("id",e.attributes.id)("checked",n.checkSelected(e.attributes.value))("disabled",n.currentPageElementObj.disabled||e.textDisabled)("required",n.currentPageElementObj.required),s.Lb(1),s.uc("for",e.attributes.id),s.Lb(1),s.Tc(" ",e.text," "),s.Lb(2),s.Sc(e.attributes["data-text"])}}function Je(e,t){if(1&e&&(s.dc(0,"span",8),s.dc(1,"i",9),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}function Be(e,t){if(1&e&&(s.dc(0,"span"),s.dc(1,"div",1),s.dc(2,"div",2),s.Rc(3),s.cc(),s.Pc(4,Ge,6,10,"div",3),s.Pc(5,Je,5,1,"span",4),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(3),s.Sc(e.currentPageElementObj.title),s.Lb(1),s.uc("ngForOf",e.currentPageElementObj.custom_rule.siblings),s.Lb(1),s.uc("ngIf",(!e.currentPageElementObj.value||0===e.currentPageElementObj.value.length)&&e.currentPageElementObj.required&&e.submitStatus)}}function ze(e,t){if(1&e){const e=s.ec();s.dc(0,"div",13),s.dc(1,"div",1),s.dc(2,"div",5),s.dc(3,"input",14),s.kc("change",function(){s.Gc(e);const n=t.$implicit;return s.oc(2).manageCheckboxClick(n.attributes.value)}),s.cc(),s.dc(4,"label",7),s.Rc(5),s.cc(),s.dc(6,"p"),s.Rc(7),s.cc(),s.cc(),s.cc(),s.cc()}if(2&e){const e=t.$implicit,n=s.oc(2);s.Lb(3),s.Nb(n.currentPageElementObj.element_class+" material_checkbox material_checkbox_info material_input"),s.uc("type",e.attributes.type)("id",e.attributes.id)("checked",n.checkSelected(e.attributes.value))("disabled",n.currentPageElementObj.disabled||e.textDisabled)("required",n.currentPageElementObj.required),s.Lb(1),s.uc("for",e.attributes.id),s.Lb(1),s.Sc(e.text),s.Lb(2),s.Sc(e.attributes["data-text"])}}function He(e,t){if(1&e&&(s.dc(0,"span",8),s.dc(1,"i",9),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}function Ue(e,t){if(1&e&&(s.dc(0,"span"),s.dc(1,"div",10),s.Pc(2,ze,8,10,"div",11),s.cc(),s.dc(3,"div",10),s.dc(4,"div",12),s.Pc(5,He,5,1,"span",4),s.cc(),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(2),s.uc("ngForOf",e.currentPageElementObj.custom_rule.siblings),s.Lb(3),s.uc("ngIf",(!e.currentPageElementObj.value||0===e.currentPageElementObj.value.length)&&e.currentPageElementObj.required&&e.submitStatus)}}let Xe=(()=>{class e{constructor(){this.onChangeValue=new s.q}ngOnInit(){this.currentPageElementObj.custom_rule.default.value&&!this.currentPageElementObj.value&&(this.currentPageElementObj.value=this.currentPageElementObj.custom_rule.default.value),this.currentPageElementObj.custom_rule.siblings.map(e=>{e.textDisabled="disabled"===e.attributes["option-disabled"]}),this.currentPageElementObj.custom_rule.siblings.map((e,t)=>{var n,a;"discontinued"===e.attributes["option-discontinued"]&&((null===(a=null===(n=this.currentPageElementObj)||void 0===n?void 0:n.value)||void 0===a?void 0:a.includes(e.attributes.value))?e.textDisabled=!0:e.isDelete=!0,this.currentPageElementObj.custom_rule.siblings=this.currentPageElementObj.custom_rule.siblings.filter(e=>!(null==e?void 0:e.isDelete)))})}manageCheckboxClick(e){this.currentPageElementObj.value=this.currentPageElementObj.value?this.currentPageElementObj.value:[],this.currentPageElementObj.value&&this.currentPageElementObj.value.indexOf(e)>-1?this.currentPageElementObj.value.splice(this.currentPageElementObj.value.indexOf(e),1):this.currentPageElementObj.value.push(e),this.onChangeValue.emit({value:e,rowIndex:this.rowIndex,rowType:this.rowType,currentPageElementObj:this.currentPageElementObj})}checkSelected(e){return!!(this.currentPageElementObj.value&&this.currentPageElementObj.value.indexOf(e)>-1)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=s.Rb({type:e,selectors:[["app-checkbox"]],inputs:{rowType:"rowType",rowIndex:"rowIndex",detectedChange:"detectedChange",submitStatus:"submitStatus",currentPageElementObj:"currentPageElementObj"},outputs:{onChangeValue:"onChangeValue"},decls:2,vars:2,consts:[[4,"ngIf"],[1,"checkbox-module"],[1,"title"],["class","material_checkbox_group",4,"ngFor","ngForOf"],["class","input-required p-l-0",4,"ngIf"],[1,"material_checkbox_group"],[3,"type","id","checked","disabled","required","change"],[1,"material_label_checkbox",3,"for"],[1,"input-required","p-l-0"],[1,"material-icons"],[1,"row"],["class","col-sm-6",4,"ngFor","ngForOf"],[1,"col-sm-12"],[1,"col-sm-6"],["name","checkbox",3,"type","id","checked","disabled","required","change"]],template:function(e,t){1&e&&(s.Pc(0,Be,6,3,"span",0),s.Pc(1,Ue,6,2,"span",0)),2&e&&(s.uc("ngIf",!t.currentPageElementObj.element_class||t.currentPageElementObj.element_class.includes("checkbox_design_vertical")||t.currentPageElementObj.element_class.includes("check_ic_valid")),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.element_class&&t.currentPageElementObj.element_class.includes("checkbox_design_horizontal")))},directives:[r.n,r.m],styles:[""]}),e})();function We(e,t){if(1&e&&(s.dc(0,"label",14),s.Rc(1),s.cc()),2&e){const e=s.oc();s.Lb(1),s.Sc(e.currentPageElementObj.title)}}function Ke(e,t){if(1&e&&(s.dc(0,"span",15),s.dc(1,"button",16),s.dc(2,"i",17),s.Rc(3,"help_outline"),s.cc(),s.cc(),s.Yb(4,"span",18),s.cc()),2&e){const e=s.oc();s.Lb(4),s.uc("innerHtml",e.currentPageElementObj.custom_rule.link.page_content,s.Hc)}}function Ze(e,t){if(1&e){const e=s.ec();s.dc(0,"div",27),s.dc(1,"a",28),s.kc("click",function(){return s.Gc(e),s.oc(2).cancelSelectedFile()}),s.dc(2,"i",29),s.Rc(3,"delete"),s.cc(),s.cc(),s.cc()}}function Qe(e,t){if(1&e&&(s.dc(0,"div",19),s.dc(1,"div",20),s.dc(2,"div",21),s.dc(3,"span",22),s.dc(4,"i",23),s.Rc(5,"content_copy"),s.cc(),s.cc(),s.dc(6,"div",24),s.Rc(7),s.cc(),s.dc(8,"div",25),s.Rc(9,"Complete"),s.cc(),s.cc(),s.Pc(10,Ze,4,0,"div",26),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(7),s.Sc(e.currentPageElementObj.value.file_title),s.Lb(3),s.uc("ngIf",!e.currentPageElementObj.disabled)}}function et(e,t){if(1&e&&(s.dc(0,"span",30),s.dc(1,"i",17),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(4),s.Tc("Please upload ",e.currentPageElementObj.title,".")}}function tt(e,t){if(1&e){const e=s.ec();s.dc(0,"li",63),s.kc("click",function(){s.Gc(e);const n=t.$implicit;return s.oc(2).manageHamBurgerClick(n.id)}),s.dc(1,"a",64),s.Rc(2),s.cc(),s.cc()}if(2&e){const e=t.$implicit;s.Lb(2),s.Sc(e.name)}}function nt(e,t){if(1&e){const e=s.ec();s.dc(0,"button",68),s.kc("click",function(n){s.Gc(e);const a=t.$implicit;return s.oc(3).openTab(n,a.id,a.name)}),s.Rc(1),s.cc()}if(2&e){const e=t.$implicit;s.Lb(1),s.Sc(e.name)}}function at(e,t){if(1&e&&(s.dc(0,"div",65),s.dc(1,"div",66),s.Pc(2,nt,2,1,"button",67),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(2),s.uc("ngForOf",e.directoryList)}}function it(e,t){if(1&e){const e=s.ec();s.dc(0,"li"),s.dc(1,"a",71),s.kc("click",function(){s.Gc(e);const n=t.$implicit;return s.oc(3).openSubDirectory(n.id,n.name)}),s.dc(2,"i",17),s.Rc(3,"folder"),s.cc(),s.Rc(4),s.cc(),s.cc()}if(2&e){const e=t.$implicit;s.Nb(e.flag?"hide":""),s.Lb(4),s.Tc(" ",e.name," ")}}function ct(e,t){if(1&e&&(s.dc(0,"ul",69),s.Pc(1,it,5,3,"li",70),s.cc()),2&e){const e=s.oc(2);s.Lb(1),s.uc("ngForOf",e.subDirectoryList)}}function rt(e,t){if(1&e&&s.Yb(0,"img",82),2&e){const e=s.oc().$implicit,t=s.oc(3);s.uc("src",e.file_path?e.file_path:t.commonService.selectedThemeImages+"/No-Image-Found.png",s.Jc)}}function lt(e,t){if(1&e&&s.Yb(0,"img",83),2&e){const e=s.oc(4);s.uc("src",e.commonService.selectedThemeImages+"/gif.png",s.Jc)}}function st(e,t){if(1&e&&s.Yb(0,"img",84),2&e){const e=s.oc(4);s.uc("src",e.commonService.selectedThemeImages+"/ppt.png",s.Jc)}}function ot(e,t){if(1&e&&s.Yb(0,"img",85),2&e){const e=s.oc(4);s.uc("src",e.commonService.selectedThemeImages+"/xls.png",s.Jc)}}function ut(e,t){if(1&e&&s.Yb(0,"img",86),2&e){const e=s.oc(4);s.uc("src",e.commonService.selectedThemeImages+"/doc.png",s.Jc)}}function dt(e,t){if(1&e&&s.Yb(0,"img",87),2&e){const e=s.oc(4);s.uc("src",e.commonService.selectedThemeImages+"/pdf.png",s.Jc)}}function mt(e,t){if(1&e&&s.Yb(0,"img",88),2&e){const e=s.oc(4);s.uc("src",e.commonService.selectedThemeImages+"/zip.png",s.Jc)}}function bt(e,t){if(1&e&&s.Yb(0,"img",89),2&e){const e=s.oc(4);s.uc("src",e.commonService.selectedThemeImages+"/No-Image-Found.png",s.Jc)}}function gt(e,t){if(1&e){const e=s.ec();s.dc(0,"li"),s.dc(1,"a",71),s.kc("click",function(){s.Gc(e);const n=t.$implicit;return s.oc(3).selectFile(n)}),s.dc(2,"div",73),s.Pc(3,rt,1,1,"img",74),s.Pc(4,lt,1,1,"img",75),s.Pc(5,st,1,1,"img",76),s.Pc(6,ot,1,1,"img",77),s.Pc(7,ut,1,1,"img",78),s.Pc(8,dt,1,1,"img",79),s.Pc(9,mt,1,1,"img",80),s.Pc(10,bt,1,1,"img",81),s.cc(),s.dc(11,"p"),s.Rc(12),s.cc(),s.cc(),s.cc()}if(2&e){const e=t.$implicit,n=s.oc(3);s.Nb(e.flag?n.currentPageElementObj.value===e.id?"active":"":"hide"),s.Lb(3),s.uc("ngIf",e.file_path.split(".").pop()&&("jpeg"===e.file_path.split(".").pop()||"jpg"===e.file_path.split(".").pop()||"png"===e.file_path.split(".").pop()||"svg"===e.file_path.split(".").pop())),s.Lb(1),s.uc("ngIf",e.file_path.split(".").pop()&&"gif"===e.file_path.split(".").pop()),s.Lb(1),s.uc("ngIf",e.file_path.split(".").pop()&&"ppt"===e.file_path.split(".").pop()),s.Lb(1),s.uc("ngIf",e.file_path.split(".").pop()&&"xls"===e.file_path.split(".").pop()),s.Lb(1),s.uc("ngIf",e.file_path.split(".").pop()&&"doc"===e.file_path.split(".").pop()),s.Lb(1),s.uc("ngIf",e.file_path.split(".").pop()&&"pdf"===e.file_path.split(".").pop()),s.Lb(1),s.uc("ngIf",e.file_path.split(".").pop()&&"zip"===e.file_path.split(".").pop()),s.Lb(1),s.uc("ngIf",!e.file_path),s.Lb(2),s.Sc(e.title)}}function pt(e,t){if(1&e&&(s.dc(0,"ul",72),s.Pc(1,gt,13,11,"li",70),s.cc()),2&e){const e=s.oc(2);s.Lb(1),s.uc("ngForOf",e.subDirectoryList)}}function ht(e,t){1&e&&(s.dc(0,"div"),s.Rc(1,"No data found."),s.cc())}function vt(e,t){if(1&e&&(s.dc(0,"span",30),s.dc(1,"i",17),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(4),s.Sc(e.validateMessage)}}const _t=function(){return["file_url"]};function ft(e,t){if(1&e&&s.Yb(0,"img",82),2&e){const e=s.oc(3);s.uc("src",e.selectedFile.new_file_url?e.selectedFile.new_file_url:e.selectedFile&&s.yc(1,_t)?e.selectedFile.file_url:e.commonService.selectedThemeImages+"/No-Image-Found.png",s.Jc)}}function Pt(e,t){if(1&e&&s.Yb(0,"img",83),2&e){const e=s.oc(3);s.uc("src",e.commonService.selectedThemeImages+"/gif.png",s.Jc)}}function Ot(e,t){if(1&e&&s.Yb(0,"img",84),2&e){const e=s.oc(3);s.uc("src",e.commonService.selectedThemeImages+"/ppt.png",s.Jc)}}function Et(e,t){if(1&e&&s.Yb(0,"img",85),2&e){const e=s.oc(3);s.uc("src",e.commonService.selectedThemeImages+"/xls.png",s.Jc)}}function yt(e,t){if(1&e&&s.Yb(0,"img",86),2&e){const e=s.oc(3);s.uc("src",e.commonService.selectedThemeImages+"/doc.png",s.Jc)}}function jt(e,t){if(1&e&&s.Yb(0,"img",87),2&e){const e=s.oc(3);s.uc("src",e.commonService.selectedThemeImages+"/pdf.png",s.Jc)}}function kt(e,t){if(1&e&&s.Yb(0,"img",88),2&e){const e=s.oc(3);s.uc("src",e.commonService.selectedThemeImages+"/zip.png",s.Jc)}}function St(e,t){if(1&e&&s.Yb(0,"img",89),2&e){const e=s.oc(3);s.uc("src",e.commonService.selectedThemeImages+"/No-Image-Found.png",s.Jc)}}function xt(e,t){if(1&e&&(s.dc(0,"div",90),s.dc(1,"a",64),s.dc(2,"div",73),s.Pc(3,ft,1,2,"img",74),s.Pc(4,Pt,1,1,"img",75),s.Pc(5,Ot,1,1,"img",76),s.Pc(6,Et,1,1,"img",77),s.Pc(7,yt,1,1,"img",78),s.Pc(8,jt,1,1,"img",79),s.Pc(9,kt,1,1,"img",80),s.Pc(10,St,1,1,"img",81),s.cc(),s.cc(),s.cc()),2&e){const e=s.oc(2);s.Lb(3),s.uc("ngIf","image"===e.fileType),s.Lb(1),s.uc("ngIf","gif"===e.fileType),s.Lb(1),s.uc("ngIf","ppt"===e.fileType),s.Lb(1),s.uc("ngIf","xls"===e.fileType),s.Lb(1),s.uc("ngIf","doc"===e.fileType),s.Lb(1),s.uc("ngIf","pdf"===e.fileType),s.Lb(1),s.uc("ngIf","zip"===e.fileType),s.Lb(1),s.uc("ngIf",!e.fileType)}}const wt=function(){return{standalone:!0}};function Lt(e,t){if(1&e){const e=s.ec();s.dc(0,"span"),s.dc(1,"div",31),s.dc(2,"button",32),s.kc("click",function(){return s.Gc(e),s.oc().closeModal()}),s.dc(3,"span",33),s.Rc(4,"\xd7"),s.cc(),s.cc(),s.dc(5,"div",34),s.dc(6,"div",35),s.dc(7,"div",36),s.dc(8,"h2"),s.Rc(9),s.cc(),s.cc(),s.dc(10,"div",37),s.dc(11,"div",38),s.dc(12,"form",39),s.kc("submit",function(){return s.Gc(e),s.oc().getSubDirectory()}),s.dc(13,"div",40),s.dc(14,"div",41),s.dc(15,"input",42),s.kc("ngModelChange",function(t){return s.Gc(e),s.oc().search_keyword=t}),s.cc(),s.dc(16,"label"),s.Rc(17,"Search"),s.cc(),s.dc(18,"a",43),s.kc("click",function(){return s.Gc(e),s.oc().getSubDirectory()}),s.dc(19,"i",5),s.Yb(20,"small",44),s.cc(),s.cc(),s.cc(),s.cc(),s.cc(),s.cc(),s.cc(),s.cc(),s.cc(),s.cc(),s.dc(21,"div",45),s.dc(22,"nav",46),s.dc(23,"ol",47),s.Pc(24,tt,3,1,"li",48),s.cc(),s.cc(),s.dc(25,"div",49),s.Pc(26,at,3,1,"div",50),s.dc(27,"div"),s.dc(28,"div",51),s.dc(29,"h4"),s.Rc(30,"Selected Directory : "),s.dc(31,"span"),s.Rc(32),s.cc(),s.cc(),s.dc(33,"span",52),s.Pc(34,ct,2,1,"ul",53),s.Pc(35,pt,2,1,"ul",54),s.Pc(36,ht,2,0,"div",12),s.cc(),s.dc(37,"div",55),s.dc(38,"ngx-file-drop",56),s.kc("onFileDrop",function(t){return s.Gc(e),s.oc().dropped(t)}),s.cc(),s.cc(),s.Pc(39,vt,5,1,"span",8),s.Pc(40,xt,11,8,"div",57),s.cc(),s.cc(),s.cc(),s.cc(),s.dc(41,"div",58),s.dc(42,"div",59),s.dc(43,"span",60),s.Rc(44,"Browse File"),s.cc(),s.dc(45,"input",61),s.kc("change",function(t){return s.Gc(e),s.oc().uploadImage(t)}),s.cc(),s.cc(),s.dc(46,"a",62),s.kc("click",function(){return s.Gc(e),s.oc().manageSelectFiles()}),s.dc(47,"span",60),s.Rc(48,"Select"),s.cc(),s.cc(),s.cc(),s.cc()}if(2&e){const e=s.oc();s.Lb(9),s.Sc(e.currentPageElementObj.title),s.Lb(6),s.uc("ngModel",e.search_keyword)("ngModelOptions",s.yc(13,wt)),s.Lb(9),s.uc("ngForOf",e.directoryPath),s.Lb(2),s.uc("ngIf",e.directoryList.length>0),s.Lb(1),s.Nb(e.directoryList.length>0?"tab-content-container":"tab-content-container full-width"),s.Lb(5),s.Sc(e.selectedDirectoryName),s.Lb(2),s.uc("ngIf",e.subDirectoryList.length>0),s.Lb(1),s.uc("ngIf",e.subDirectoryList.length>0),s.Lb(1),s.uc("ngIf",0===e.subDirectoryList.length),s.Lb(3),s.uc("ngIf",!e.currentPageElementObj.isValidate),s.Lb(1),s.uc("ngIf",e.selectedFile&&(e.selectedFile.new_file_url||e.selectedFile.file_url))}}function It(e,t){if(1&e&&(s.dc(0,"div",91),s.dc(1,"div",92),s.Yb(2,"img",93),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(2),s.uc("src",e.commonService.selectedThemeImages+"/animation.gif",s.Jc)}}let Ct=(()=>{class e{constructor(e,t){this.companyFormationService=e,this.commonService=t,this.handleValidationOnPageChange=new s.q,this.directoryList=[],this.subDirectoryList=[],this.directoryPath=[{id:0,name:"Root"}],this.selectedDirectoryName="",this.selectedDirectoryId="",this.search_keyword="",this.fileUploaded=!1,this.showLoader=!1,this.validateMessage="",this.fileType="",this.selectedFile={},this.countryList=[]}ngOnInit(){}ngAfterViewInit(){this.commonService.loadDefaultInputAnimation()}getDirectory(){this.companyFormationService.getDirectory({user_id:!0,directory_id:0,search_keyword:this.search_keyword}).subscribe(e=>{200===e.status&&(this.directoryList=e.data,setTimeout(()=>{this.tabsMobileDropdown()},500))},e=>{this.commonService.showToaster("error","Something went wrong. Please try again.")})}openTab(e,t,n){let a=document.getElementsByClassName("tablinks");for(let i=0;i{200===e.status?(this.subDirectoryList=e.data,$(".colm li a").matchHeight()):this.subDirectoryList=[]},e=>{this.commonService.showToaster("error","Something went wrong. Please try again.")})}openSubDirectory(e,t){this.selectedDirectoryId=e,this.search_keyword="",this.directoryPath.push({id:e,name:t}),this.getSubDirectory()}manageHamBurgerClick(e){this.selectedDirectoryId=e;let t=this.directoryPath.findIndex(t=>t.id===e);this.directoryPath.splice(t+1,this.directoryPath.length-(t+1)),this.getSubDirectory()}selectFile(e){this.selectedFile={value:e.id,file_title:e.title,file_url:e.file_path},this.getFileType(!0),this.fileUploaded=!1}uploadImage(e){if(e.target.files&&e.target.files[0])if(!this.currentPageElementObj.custom_rule.extra_validation||this.currentPageElementObj.custom_rule.extra_validation&&this.currentPageElementObj.custom_rule.extra_validation.upload_ext.indexOf(e.target.files[0].name.split(".").pop())>-1)if(this.currentPageElementObj.custom_rule&&this.currentPageElementObj.custom_rule.extra_validation&&this.currentPageElementObj.custom_rule.extra_validation.upload_maxsize&&parseInt(this.currentPageElementObj.custom_rule.extra_validation.upload_maxsize)e.target.files[0].size/1e3)this.currentPageElementObj.isValidate=!1,this.validateMessage="The minimum file size allowed is "+this.currentPageElementObj.custom_rule.extra_validation.upload_maxsize+" KB.",this.fileUploaded=!1;else{this.currentPageElementObj.file=e.target.files[0],this.fileUploaded=!0;var t=new FileReader;this.getFileType(),t.readAsDataURL(e.target.files[0]),t.onload=e=>{this.selectedFile&&this.selectedFile.value?(this.selectedFile.new_file_url=e.target.result,console.log("\ud83d\ude80 ~ file: file.component.ts:166 ~ FileComponent ~ uploadImage ~ this.selectedFile in if:",this.selectedFile)):(this.selectedFile={new_file_url:e.target.result},console.log("\ud83d\ude80 ~ file: file.component.ts:169 ~ FileComponent ~ uploadImage ~ this.selectedFile in else :",this.selectedFile))},this.currentPageElementObj.isValidate=!0,this.validateMessage=""}else this.currentPageElementObj.isValidate=!1,this.validateMessage="File types allowed - "+this.currentPageElementObj.custom_rule.extra_validation.upload_ext.toString().split(",").filter(e=>e).join(", ")}getFileType(e=!1){this.fileType="";let t="";t=e?this.selectedFile.file_url:this.currentPageElementObj.file.name,this.fileType=t&&t.split(".").pop()&&["jpeg","jpg","png","svg"].includes(t.split(".").pop())?"image":t&&t.split(".").pop()&&"gif"===t.split(".").pop()?"gif":t&&t.split(".").pop()&&"ppt"===t.split(".").pop()?"ppt":t&&t.split(".").pop()&&"xls"===t.split(".").pop()||"xlsx"===t.split(".").pop()?"xls":t&&t.split(".").pop()&&"doc"===t.split(".").pop()||"docx"===t.split(".").pop()?"doc":t&&t.split(".").pop()&&"pdf"===t.split(".").pop()?"pdf":"image"}dropped(e){for(const t of e)t.fileEntry.isFile&&t.fileEntry.file(e=>{if(!this.currentPageElementObj.custom_rule.extra_validation||this.currentPageElementObj.custom_rule.extra_validation&&this.currentPageElementObj.custom_rule.extra_validation.upload_ext.indexOf(e.name.split(".").pop())>-1)if(this.currentPageElementObj.custom_rule&&this.currentPageElementObj.custom_rule.extra_validation&&this.currentPageElementObj.custom_rule.extra_validation.upload_maxsize&&parseInt(this.currentPageElementObj.custom_rule.extra_validation.upload_maxsize)e.size/1e3)this.currentPageElementObj.isValidate=!1,this.validateMessage="The minimum file size allowed is "+this.currentPageElementObj.custom_rule.extra_validation.upload_maxsize+" KB.",this.fileUploaded=!1;else{this.currentPageElementObj.file=e,this.fileUploaded=!0;var t=new FileReader;this.getFileType(),t.readAsDataURL(e),t.onload=e=>{this.selectedFile&&this.selectedFile.value?(this.selectedFile.new_file_url=e.target.result,console.log("\ud83d\ude80 ~ file: file.component.ts:238 ~ FileComponent ~ fileEntry.file ~ this.selectedFile: in if : ",this.selectedFile)):(this.selectedFile={new_file_url:e.target.result},console.log("\ud83d\ude80 ~ file: file.component.ts:240 ~ FileComponent ~ fileEntry.file ~ this.selectedFile: in else : ",this.selectedFile))},this.currentPageElementObj.isValidate=!0,this.validateMessage=""}else this.currentPageElementObj.isValidate=!1,this.validateMessage="File types allowed - "+this.currentPageElementObj.custom_rule.extra_validation.upload_ext.toString().split(",").filter(e=>e).join(", ")})}manageSelectFiles(){if(this.showLoader=!0,this.fileUploaded){var e={file:this.currentPageElementObj.file,user_id:!0,company_name:!0,process_id:parseInt(this.processId),attr_id:this.currentPageElementObj.id,process_request_id:this.process_request_id?this.process_request_id:0};this.companyFormationService.uploadDocument(e).subscribe(e=>{200===e.status?(this.selectedFile={value:e.data.id,file_title:e.data.title,file_url:e.data.file_path},this.fileUploaded=!1,this.currentPageElementObj.custom_rule&&this.currentPageElementObj.custom_rule.attributes&&this.currentPageElementObj.custom_rule.attributes["data-ispixlabapi"]&&"true"===this.currentPageElementObj.custom_rule.attributes["data-ispixlabapi"]?this.getPassportDetails():(this.commonService.showToaster("success",e.message),this.showLoader=!1,this.currentPageElementObj.value=this.selectedFile,setTimeout(()=>{$(".close").click(),this.selectedFile={}},100))):(this.selectedFile="",this.showLoader=!1,this.commonService.showToaster("error",e.message)),this.clearSelectedFile()},e=>{this.showLoader=!1,this.commonService.showToaster("error","Something went wrong. Please try again.")})}else this.currentPageElementObj.value=this.selectedFile,this.currentPageElementObj.custom_rule&&this.currentPageElementObj.custom_rule.attributes&&this.currentPageElementObj.custom_rule.attributes["data-ispixlabapi"]&&"true"===this.currentPageElementObj.custom_rule.attributes["data-ispixlabapi"]?this.getPassportDetails():($(".close").click(),this.selectedFile={},this.showLoader=!1,this.clearSelectedFile())}clearSelectedFile(){this.subDirectoryList=[],this.directoryPath=[{id:0,name:"Root"}],this.selectedDirectoryName="",this.selectedDirectoryId="",this.search_keyword=""}getPassportDetails(){this.companyFormationService.getPassportDetails({passport_copy_id:this.selectedFile.value}).subscribe(e=>{this.showLoader=!1,200===e.status?(this.currentPageElementObj.value=this.selectedFile,this.commonService.showToaster("success",e.message),setTimeout(()=>{$(".close").click(),this.selectedFile={}},10),this.updateValueOfFields(e.data)):(this.currentPageElementObj.value=this.selectedFile,setTimeout(()=>{$(".close").click(),this.selectedFile={}},10),this.commonService.showToaster("error",e.data&&e.data.message?e.data.message:"Please upload valid file.")),this.clearSelectedFile()},e=>{this.showLoader=!1,this.currentPageElementObj.value="",this.selectedFile={},this.commonService.showToaster("error","Something went wrong. Please try again.")})}updateValueOfFields(e){let t=this;t.countryList=localStorage.getItem("countryList")?JSON.parse(localStorage.getItem("countryList")):[],void 0!==t.rowIndex?t.currentPageRowElementObj.childElements[t.rowIndex]&&t.currentPageRowElementObj.childElements[t.rowIndex].map(n=>{if(n.custom_rule&&n.custom_rule.attributes&&n.custom_rule.attributes["data-ispixlabfield"]){if(n.value=e[n.custom_rule.attributes["data-ispixlabfield"]],"select_basic"===n.type){if(e[n.custom_rule.attributes["data-ispixlabfield"]])if("nationality"===n.custom_rule.attributes["data-ispixlabfield"]){let a=!1;t.countryList.forEach(t=>{t.country_title==e[n.custom_rule.attributes["data-ispixlabfield"]]&&(n.value=t.id,a=!0)}),a||(n.value="")}else n.value=JSON.stringify(e[n.custom_rule.attributes["data-ispixlabfield"]]);$("#"+n.element_id).val(e[n.custom_rule.attributes["data-ispixlabfield"]]),n.custom_rule.attributes.hasOwnProperty("data-country"),$("#"+n.element_id).select2()}"date"!==n.type&&"expiry_date"!==n.type||("passport_expiry_date"===n.custom_rule.attributes["data-ispixlabfield"]?new Date(e[n.custom_rule.attributes["data-ispixlabfield"]])>new Date?$("#"+n.custom_rule.attributes.id).datepicker("update",e[n.custom_rule.attributes["data-ispixlabfield"]]):($("#"+n.custom_rule.attributes.id).datepicker("update",null),n.value=null):$("#"+n.custom_rule.attributes.id).datepicker("update",e[n.custom_rule.attributes["data-ispixlabfield"]]))}}):t.pageFormationElementsList&&t.pageFormationElementsList.map(t=>{t.stepElements&&t.stepElements.map(t=>{t.childElements&&t.childElements.map(t=>{t.custom_rule&&t.custom_rule.attributes&&t.custom_rule.attributes["data-ispixlabfield"]&&(t.value=e[t.custom_rule.attributes["data-ispixlabfield"]],"select_basic"===t.type&&(t.value=JSON.stringify(e[t.custom_rule.attributes["data-ispixlabfield"]]),$("#"+t.element_id).val(e[t.custom_rule.attributes["data-ispixlabfield"]]),t.custom_rule.attributes.hasOwnProperty("data-country"),$("#"+t.element_id).select2()),"date"!==t.type&&"expiry_date"!==t.type||$("#"+t.custom_rule.attributes.id).datepicker("update",e[t.custom_rule.attributes["data-ispixlabfield"]]))})})}),setTimeout(()=>{t.handleValidationOnPageChange.emit(),t.commonService.loadDefaultInputAnimation()},100)}cancelSelectedFile(){this.currentPageElementObj.value=""}closeModal(){this.selectedFile={}}tabsMobileDropdown(){let e=this;$(window).width()<="991"&&(0===$(".tabs-mobile-dropdown").find(".dropdown-toggle").length&&$("").appendTo(".tabs-mobile-dropdown"),$(".tabs-mobile-dropdown").addClass("material_dropdown"),$(".tabs-mobile-dropdown .tab").addClass("dropdown-menu material_dropdown_menu").hide(),$(".tabs-mobile-dropdown").each(function(){$(this).children(".dropdown-toggle").children("label").text(e.selectedTabMobile($(this)));var t=$(this);$(this).children(".dropdown-menu").children(".tablinks").click(function(){$(t).children(".dropdown-toggle").children("label").text(e.selectedTabMobile($(t)))})}))}selectedTabMobile(e){return $(e).children(".tab").children(".tablinks.active").text()}}return e.\u0275fac=function(t){return new(t||e)(s.Xb(u.c),s.Xb(u.b))},e.\u0275cmp=s.Rb({type:e,selectors:[["app-file"]],inputs:{submitStatus:"submitStatus",processId:"processId",process_request_id:"process_request_id",detectedChange:"detectedChange",rowIndex:"rowIndex",currentPageRowElementObj:"currentPageRowElementObj",pageFormationElementsList:"pageFormationElementsList",currentPageElementObj:"currentPageElementObj"},outputs:{handleValidationOnPageChange:"handleValidationOnPageChange"},decls:18,vars:12,consts:[[1,"upload-module"],["class","full-width",4,"ngIf"],["class","input-info",4,"ngIf"],["data-toggle","modal",1,"input-file-container",3,"click"],["tabindex","0","for","my-file",1,"input-file-trigger"],[1,"material-icons","link-primary"],[1,"file-return"],["class","upload-progress",4,"ngIf"],["class","input-required",4,"ngIf"],["data-keyboard","false","data-backdrop","static","tabindex","-1","role","dialog","aria-labelledby","myModalLabel","aria-hidden","true",1,"modal","fade","file-modal",3,"id"],[1,"modal-dialog","material_modal_dialog"],[1,"modal-content"],[4,"ngIf"],["class","page-level-loader",4,"ngIf"],[1,"full-width"],[1,"input-info"],["type","button","data-container","body","data-toggle","popover","data-placement","right","data-content","Tooltip text example",1,"btn-0"],[1,"material-icons"],[1,"tooltips",3,"innerHtml"],[1,"upload-progress"],[1,"upload-label","completed"],[1,"file-info"],[1,"file-icon"],[1,"material-icons","link-secondary"],[1,"file-name"],[1,"file-progress"],["class","file-action",4,"ngIf"],[1,"file-action"],["href","#","onclick","return false;",1,"file-close",3,"click"],["title","Delete",1,"material-icons","link-primary"],[1,"input-required"],[1,"modal-header"],["type","button","data-dismiss","modal","aria-label","Close",1,"close",3,"click"],["aria-hidden","true"],[1,"header-with-action","type2","clearfix"],[1,"heading-divider"],[1,"title"],[1,"gear-link"],[1,"search-input","d-block",2,"display","none"],[3,"submit"],[1,"form-group"],[1,"material_input_block"],["type","search",1,"form-control","material_input",3,"ngModel","ngModelOptions","ngModelChange"],["href","#","onclick","return false;",1,"fa",3,"click"],["data-material-icon","\ue8b6"],[1,"modal-body"],["aria-label","breadcrumb",1,"breadcrumbDiv"],[1,"breadcrumb"],["class","breadcrumb-item",3,"click",4,"ngFor","ngForOf"],[1,"tabs-container"],["class","tabs-mobile-dropdown",4,"ngIf"],[1,"tabcontent",2,"display","block"],[1,"file-list-container"],["class","list",4,"ngIf"],["class","colm",4,"ngIf"],[1,"drop-here"],["dropZoneLabel","Drop Here",3,"onFileDrop"],["class","preview-images",4,"ngIf"],[1,"modal-footer"],[1,"btn","close-modal","btn-primary","btn-sm","float-left"],[1,"button-text"],["type","file",3,"change"],["href","#","onclick","return false;","aria-label","Select",1,"close-modal","btn","btn-primary",3,"click"],[1,"breadcrumb-item",3,"click"],["href","#","onclick","return false;"],[1,"tabs-mobile-dropdown"],[1,"tab","file"],["class","tablinks","id","defaultOpen",3,"click",4,"ngFor","ngForOf"],["id","defaultOpen",1,"tablinks",3,"click"],[1,"list"],[3,"class",4,"ngFor","ngForOf"],["href","#","onclick","return false;",3,"click"],[1,"colm"],[1,"img"],["alt","Image",3,"src",4,"ngIf"],["alt","GIF","title","GIF",3,"src",4,"ngIf"],["alt","PPT","title","PPT",3,"src",4,"ngIf"],["alt","XLS","title","XLS",3,"src",4,"ngIf"],["alt","DOC","title","DOC",3,"src",4,"ngIf"],["alt","PDF","title","PDF",3,"src",4,"ngIf"],["alt","ZIP","title","ZIP",3,"src",4,"ngIf"],["alt","No Image Found","title","No Image Found",3,"src",4,"ngIf"],["alt","Image",3,"src"],["alt","GIF","title","GIF",3,"src"],["alt","PPT","title","PPT",3,"src"],["alt","XLS","title","XLS",3,"src"],["alt","DOC","title","DOC",3,"src"],["alt","PDF","title","PDF",3,"src"],["alt","ZIP","title","ZIP",3,"src"],["alt","No Image Found","title","No Image Found",3,"src"],[1,"preview-images"],[1,"page-level-loader"],[1,"loader-item"],["alt","Logo","title","Logo",3,"src"]],template:function(e,t){1&e&&(s.dc(0,"div",0),s.dc(1,"div"),s.Pc(2,We,2,1,"label",1),s.dc(3,"div"),s.Pc(4,Ke,5,1,"span",2),s.dc(5,"div",3),s.kc("click",function(){return t.getDirectory()}),s.dc(6,"label",4),s.dc(7,"i",5),s.Rc(8,"file_upload"),s.cc(),s.Rc(9," Upload new file "),s.cc(),s.cc(),s.Yb(10,"p",6),s.cc(),s.Pc(11,Qe,11,2,"div",7),s.cc(),s.cc(),s.Pc(12,et,5,1,"span",8),s.dc(13,"div",9),s.dc(14,"div",10),s.dc(15,"div",11),s.Pc(16,Lt,49,14,"span",12),s.Pc(17,It,3,1,"div",13),s.cc(),s.cc(),s.cc()),2&e&&(s.Lb(1),s.Nb("form-group "+(t.currentPageElementObj.custom_rule.link?"help-info":"")),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.title),s.Lb(1),s.Nb(t.currentPageElementObj.disabled?"upload-wrapper pointer-events-none":"upload-wrapper"),s.Lb(1),s.uc("ngIf",t.currentPageElementObj.custom_rule.link),s.Lb(1),s.Mb("data-target","#select-file_"+t.currentPageElementObj.custom_rule.attributes.id),s.Lb(6),s.uc("ngIf",t.currentPageElementObj.value&&t.currentPageElementObj.value.value),s.Lb(1),s.uc("ngIf",(!t.currentPageElementObj.value||t.currentPageElementObj.value&&!t.currentPageElementObj.value.value)&&t.currentPageElementObj.required&&t.submitStatus),s.Lb(1),s.uc("id","select-file_"+t.currentPageElementObj.custom_rule.attributes.id),s.Lb(3),s.uc("ngIf",!t.showLoader),s.Lb(1),s.uc("ngIf",t.showLoader))},directives:[r.n,a.A,a.o,a.p,a.b,c.a,a.n,a.q,r.m,i.a],styles:[""]}),e})(),Tt=(()=>{class e{constructor(){}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=s.Rb({type:e,selectors:[["app-image"]],inputs:{currentPageElementObj:"currentPageElementObj"},decls:1,vars:7,consts:[[3,"src","alt","height","width","id"]],template:function(e,t){1&e&&s.Yb(0,"img",0),2&e&&(s.Nb(t.currentPageElementObj.custom_rule.attributes["data-element-class"]),s.uc("src",t.currentPageElementObj.custom_rule.attributes.src,s.Jc)("alt",t.currentPageElementObj.title)("height",t.currentPageElementObj.custom_rule.attributes.height)("width",t.currentPageElementObj.custom_rule.attributes.width)("id",t.currentPageElementObj.custom_rule.attributes.id))},styles:[""]}),e})();var qt=n("cfFl");function Dt(e,t){if(1&e&&(s.dc(0,"option",6),s.Rc(1),s.cc()),2&e){const e=t.$implicit;s.uc("value",e.key)("disabled",e.textDisabled),s.Lb(1),s.Sc(e.value)}}function Ft(e,t){if(1&e&&(s.dc(0,"span",7),s.dc(1,"i",8),s.Rc(2,"error_outline"),s.cc(),s.dc(3,"span"),s.Rc(4),s.cc(),s.cc()),2&e){const e=s.oc();s.Lb(4),s.Tc("Please select ",e.currentPageElementObj.title,".")}}let Rt=(()=>{class e{constructor(e,t){this.companyFormationService=e,this.commonService=t,this.onChangeValue=new s.q,this.pivotKey="",this.responseType="",this.optionArray=[]}ngOnInit(){this.currentPageElementObj.custom_rule.dependent&&this.currentPageElementObj.custom_rule.dependent.pivot&&this.currentPageElementObj.custom_rule.dependent.pivot.length>0&&(this.pivotKey=this.currentPageElementObj.custom_rule.dependent.pivot[0].pivot_name),this.responseType=this.currentPageElementObj.custom_rule&&this.currentPageElementObj.custom_rule.dependent&&this.currentPageElementObj.custom_rule.dependent.responce_type,this.optionArray=Object.values(this.currentPageElementObj.custom_rule["option-disabled"]);let e=Object.values(this.currentPageElementObj.custom_rule.options),t=Object.keys(this.currentPageElementObj.custom_rule.options);this.currentPageElementObj.custom_rule["new-options"]=[];for(let n=0;n-1}loadSelectData(){var e=this;const t=e.currentPageElementObj.custom_rule&&e.currentPageElementObj.custom_rule.dependent&&e.currentPageElementObj.custom_rule.dependent.bind_url,n=e.currentPageElementObj.custom_rule&&e.currentPageElementObj.custom_rule.dependent&&e.currentPageElementObj.custom_rule.dependent&&e.currentPageElementObj.custom_rule.dependent.method;var a=e.currentPageElementObj.value?e.currentPageElementObj.value:e.currentPageElementObj.custom_rule.default.value;a&&($("#"+e.currentPageElementObj.element_id).val(a),$("#"+e.currentPageElementObj.element_id).change(),e.commonService.loadDefaultSelectAnimation()),e.currentPageElementObj.value=$("#"+e.currentPageElementObj.element_id).val(),$(document).off("change","#"+e.currentPageElementObj.element_id),$(document).on("change","#"+e.currentPageElementObj.element_id,function(){e.currentPageElementObj.value=$(this).val(),e.onChangeValue.emit({value:e.currentPageElementObj.value,rowIndex:e.rowIndex,rowType:e.rowType,currentPageElementObj:e.currentPageElementObj}),e.currentPageElementObj.value.trim()&&e.callAPI(t,n)})}callAPI(e,t){var n=this;if(t===l.a.API_METHOD.GET)n.companyFormationService.apiBuilderGet(e).subscribe(e=>{n.manageApiResponse(e)},e=>{this.commonService.showToaster("error","Something went wrong. Please try again.")});else if(t===l.a.API_METHOD.POST){let t={};qt.forEachOf(n.currentPageElementObj.custom_rule.dependent.param,function(e,a,i){n.getElementValue(e.param_controls,n=>{t[e.param_name]=n,i()})},()=>{qt.forEachOf(n.currentPageElementObj.custom_rule.dependent.custom,function(e,n,a){t[e.custom_name]=e.custom_value,a()},()=>{n.companyFormationService.apiBuilderPOST(e,t).subscribe(e=>{n.manageApiResponse(e)},e=>{this.commonService.showToaster("error","Something went wrong. Please try again.")})})})}}getElementValue(e,t){this.pageFormationElementsList.map(n=>{n.stepElements.map(n=>{if(n.childElements&&n.childElements.length>0){let a=n.childElements.filter(t=>t.element_id===e);if(a.length>0)return t(a[0].value)}})})}manageApiResponse(e){let t,n=this,a={};Array.isArray(e[n.currentPageElementObj.custom_rule.dependent.criteria])?t=e[n.currentPageElementObj.custom_rule.dependent.criteria]:(t=[],t.push(e[n.currentPageElementObj.custom_rule.dependent.criteria])),qt.forEachOf(n.pageFormationElementsList,function(e,t,i){qt.forEachOf(e.stepElements,function(e,t,i){let c=e.childElements.filter(e=>e.element_id===n.currentPageElementObj.custom_rule.dependent.dependent_id);c.length>0&&(a=c[0]),i()},()=>{i()})},()=>{if(Object.keys(a).length>0){let e=[];qt.forEachOf(t,function(t,a,i){e.push(n.pivotKey?t[n.pivotKey]:t),i()},()=>{a.custom_rule.options=Object.assign({},e)})}})}}return e.\u0275fac=function(t){return new(t||e)(s.Xb(u.c),s.Xb(u.b))},e.\u0275cmp=s.Rb({type:e,selectors:[["app-select-dependent"]],inputs:{rowType:"rowType",rowIndex:"rowIndex",detectedChange:"detectedChange",submitStatus:"submitStatus",pageFormationElementsList:"pageFormationElementsList",currentPageElementObj:"currentPageElementObj"},outputs:{onChangeValue:"onChangeValue"},decls:8,vars:5,consts:[[1,"form-group"],[1,"material_input_block","select2-label"],[1,"title"],["tabindex","-1","aria-hidden","true",1,"select2",3,"id","disabled"],[3,"value","disabled",4,"ngFor","ngForOf"],["class","input-required",4,"ngIf"],[3,"value","disabled"],[1,"input-required"],[1,"material-icons"]],template:function(e,t){1&e&&(s.dc(0,"div",0),s.dc(1,"div",1),s.dc(2,"label",2),s.Rc(3),s.cc(),s.dc(4,"select",3),s.Yb(5,"option"),s.Pc(6,Dt,2,3,"option",4),s.cc(),s.Pc(7,Ft,5,1,"span",5),s.cc(),s.cc()),2&e&&(s.Lb(3),s.Sc(t.currentPageElementObj.title),s.Lb(1),s.uc("id",t.currentPageElementObj.element_id)("disabled",t.currentPageElementObj.disabled),s.Lb(2),s.uc("ngForOf",t.currentPageElementObj.custom_rule["new-options"]),s.Lb(1),s.uc("ngIf",!t.currentPageElementObj.value&&t.currentPageElementObj.required&&t.submitStatus))},directives:[a.r,a.B,r.m,r.n],styles:[""]}),e})();function Vt(e,t){if(1&e&&(s.dc(0,"h2"),s.Rc(1),s.cc()),2&e){const e=s.oc(3).$implicit;s.Lb(1),s.Sc(e.header)}}function Nt(e,t){if(1&e&&(s.dc(0,"p"),s.Rc(1),s.cc()),2&e){const e=s.oc(3).$implicit;s.Lb(1),s.Sc(e.description)}}function Mt(e,t){if(1&e){const e=s.ec();s.dc(0,"app-text",31),s.kc("onChangeValue",function(t){return s.Gc(e),s.oc(7).onChangeValue(t)}),s.cc()}if(2&e){const e=s.oc(2).$implicit,t=s.oc(3),n=t.index,a=t.$implicit,i=s.oc(2);s.uc("rowIndex",n)("hidden",e.element_class&&e.element_class.includes("ubo_count"))("detectedChange",i.detectedChange)("currentPageElementObj",e)("submitStatus",i.submitStatus)("rowType",a.type)("rowClass",a.class)}}function $t(e,t){if(1&e){const e=s.ec();s.dc(0,"app-radio",32),s.kc("onChangeValue",function(t){return s.Gc(e),s.oc(7).onChangeValue(t)}),s.cc()}if(2&e){const e=s.oc(2).$implicit,t=s.oc(3),n=t.index,a=t.$implicit,i=s.oc(2);s.uc("currentPageElementObj",e)("rowIndex",n)("detectedChange",i.detectedChange)("rowType",a.type)("submitStatus",i.submitStatus)}}function At(e,t){if(1&e){const e=s.ec();s.dc(0,"app-date",32),s.kc("onChangeValue",function(t){return s.Gc(e),s.oc(7).onChangeValue(t)}),s.cc()}if(2&e){const e=s.oc(2).$implicit,t=s.oc(3),n=t.index,a=t.$implicit,i=s.oc(2);s.uc("currentPageElementObj",e)("rowIndex",n)("detectedChange",i.detectedChange)("rowType",a.type)("submitStatus",i.submitStatus)}}function Yt(e,t){if(1&e){const e=s.ec();s.dc(0,"app-time",32),s.kc("onChangeValue",function(t){return s.Gc(e),s.oc(7).onChangeValue(t)}),s.cc()}if(2&e){const e=s.oc(2).$implicit,t=s.oc(3),n=t.index,a=t.$implicit,i=s.oc(2);s.uc("currentPageElementObj",e)("rowIndex",n)("detectedChange",i.detectedChange)("rowType",a.type)("submitStatus",i.submitStatus)}}function Gt(e,t){if(1&e){const e=s.ec();s.dc(0,"app-phone",32),s.kc("onChangeValue",function(t){return s.Gc(e),s.oc(7).onChangeValue(t)}),s.cc()}if(2&e){const e=s.oc(2).$implicit,t=s.oc(3),n=t.index,a=t.$implicit,i=s.oc(2);s.uc("currentPageElementObj",e)("rowIndex",n)("detectedChange",i.detectedChange)("rowType",a.type)("submitStatus",i.submitStatus)}}function Jt(e,t){if(1&e){const e=s.ec();s.dc(0,"app-textarea",32),s.kc("onChangeValue",function(t){return s.Gc(e),s.oc(7).onChangeValue(t)}),s.cc()}if(2&e){const e=s.oc(2).$implicit,t=s.oc(3),n=t.index,a=t.$implicit,i=s.oc(2);s.uc("currentPageElementObj",e)("rowIndex",n)("detectedChange",i.detectedChange)("rowType",a.type)("submitStatus",i.submitStatus)}}function Bt(e,t){if(1&e){const e=s.ec();s.dc(0,"app-select",32),s.kc("onChangeValue",function(t){return s.Gc(e),s.oc(7).onChangeValue(t)}),s.cc()}if(2&e){const e=s.oc(2).$implicit,t=s.oc(3),n=t.index,a=t.$implicit,i=s.oc(2);s.uc("currentPageElementObj",e)("rowIndex",n)("detectedChange",i.detectedChange)("rowType",a.type)("submitStatus",i.submitStatus)}}function zt(e,t){if(1&e){const e=s.ec();s.dc(0,"app-select-multi",32),s.kc("onChangeValue",function(t){return s.Gc(e),s.oc(7).onChangeValue(t)}),s.cc()}if(2&e){const e=s.oc(2).$implicit,t=s.oc(3),n=t.index,a=t.$implicit,i=s.oc(2);s.uc("currentPageElementObj",e)("rowIndex",n)("detectedChange",i.detectedChange)("rowType",a.type)("submitStatus",i.submitStatus)}}function Ht(e,t){if(1&e){const e=s.ec();s.dc(0,"app-checkbox",32),s.kc("onChangeValue",function(t){return s.Gc(e),s.oc(7).onChangeValue(t)}),s.cc()}if(2&e){const e=s.oc(2).$implicit,t=s.oc(3),n=t.index,a=t.$implicit,i=s.oc(2);s.uc("currentPageElementObj",e)("rowIndex",n)("detectedChange",i.detectedChange)("rowType",a.type)("submitStatus",i.submitStatus)}}function Ut(e,t){if(1&e){const e=s.ec();s.dc(0,"app-file",33),s.kc("handleValidationOnPageChange",function(){return s.Gc(e),s.oc(7).handleValidationOnPageChange()}),s.cc()}if(2&e){const e=s.oc(2).$implicit,t=s.oc(5);s.uc("detectedChange",t.detectedChange)("processId",t.processId)("currentPageElementObj",e)("pageFormationElementsList",t.pageFormationElementsList)("process_request_id",t.process_request_id)("submitStatus",t.submitStatus)}}function Xt(e,t){if(1&e&&s.Yb(0,"app-image",34),2&e){const e=s.oc(2).$implicit;s.uc("currentPageElementObj",e)}}function Wt(e,t){if(1&e){const e=s.ec();s.dc(0,"app-select-dependent",35),s.kc("onChangeValue",function(t){return s.Gc(e),s.oc(7).onChangeValue(t)}),s.cc()}if(2&e){const e=s.oc(2).$implicit,t=s.oc(3),n=t.index,a=t.$implicit,i=s.oc(2);s.uc("pageFormationElementsList",i.pageFormationElementsList)("currentPageElementObj",e)("rowIndex",n)("rowType",a.type)("detectedChange",i.detectedChange)("submitStatus",i.submitStatus)}}function Kt(e,t){if(1&e&&(s.dc(0,"div"),s.Pc(1,Mt,1,7,"app-text",26),s.Pc(2,$t,1,5,"app-radio",27),s.Pc(3,At,1,5,"app-date",27),s.Pc(4,Yt,1,5,"app-time",27),s.Pc(5,Gt,1,5,"app-phone",27),s.Pc(6,Jt,1,5,"app-textarea",27),s.Pc(7,Bt,1,5,"app-select",27),s.Pc(8,zt,1,5,"app-select-multi",27),s.Pc(9,Ht,1,5,"app-checkbox",27),s.Pc(10,Ut,1,6,"app-file",28),s.Pc(11,Xt,1,1,"app-image",29),s.Pc(12,Wt,1,6,"app-select-dependent",30),s.cc()),2&e){const e=s.oc().$implicit;s.Nb("col-md-"+e.columns+" col-xs-12"),s.Lb(1),s.uc("ngIf","text"===e.type),s.Lb(1),s.uc("ngIf","radio"===e.type||"user_type"===e.type),s.Lb(1),s.uc("ngIf","date"===e.type||"expiry_date"===e.type),s.Lb(1),s.uc("ngIf","time"===e.type),s.Lb(1),s.uc("ngIf","mobile"===e.type),s.Lb(1),s.uc("ngIf","textarea"===e.type),s.Lb(1),s.uc("ngIf","select_basic"===e.type),s.Lb(1),s.uc("ngIf","select_multiple"===e.type),s.Lb(1),s.uc("ngIf","checkbox"===e.type),s.Lb(1),s.uc("ngIf","upload"===e.type),s.Lb(1),s.uc("ngIf","image"===e.type),s.Lb(1),s.uc("ngIf","select_dependent"===e.type)}}function Zt(e,t){if(1&e&&(s.bc(0),s.Pc(1,Kt,13,14,"div",25),s.ac()),2&e){const e=t.$implicit;s.Lb(1),s.uc("ngIf",e.is_visible)}}function Qt(e,t){if(1&e&&(s.dc(0,"div"),s.dc(1,"div",36),s.dc(2,"div",37),s.dc(3,"i",38),s.Rc(4,"info"),s.cc(),s.Yb(5,"span",39),s.cc(),s.cc(),s.cc()),2&e){const e=s.oc(3).$implicit;s.Nb("col-md-"+e.childElements[e.childElements.length-1].columns+" col-xs-12"),s.Lb(5),s.uc("innerHtml",e.custom_rule.link.page_content,s.Hc)}}function en(e,t){if(1&e&&(s.dc(0,"div",41),s.dc(1,"div",36),s.dc(2,"div",42),s.dc(3,"h5",43),s.Rc(4,"Error - Action Required"),s.cc(),s.dc(5,"p"),s.Rc(6),s.cc(),s.cc(),s.cc(),s.cc()),2&e){const e=s.oc().$implicit;s.Lb(6),s.Sc(null==e||null==e.log?null:e.log.comment)}}function tn(e,t){if(1&e&&(s.bc(0),s.Pc(1,en,7,1,"div",40),s.ac()),2&e){const e=t.$implicit;s.Lb(1),s.uc("ngIf","1"===(null==e||null==e.log?null:e.log.visible_on_front)&&(null==e||null==e.log?null:e.log.comment))}}function nn(e,t){if(1&e&&(s.dc(0,"div",20),s.dc(1,"div"),s.dc(2,"div",21),s.Yb(3,"span"),s.cc(),s.Pc(4,Vt,2,1,"h2",22),s.Pc(5,Nt,2,1,"p",22),s.dc(6,"div",23),s.Pc(7,Zt,2,1,"ng-container",15),s.cc(),s.Yb(8,"div",24),s.dc(9,"div",23),s.Pc(10,Qt,6,3,"div",25),s.Pc(11,tn,2,1,"ng-container",15),s.cc(),s.cc(),s.cc()),2&e){const e=s.oc(2).$implicit;s.Lb(1),s.Nb(e.class+" business-activities"),s.Lb(3),s.uc("ngIf",e.header),s.Lb(1),s.uc("ngIf",e.description),s.Lb(2),s.uc("ngForOf",e.childElements),s.Lb(3),s.uc("ngIf",e.custom_rule&&e.custom_rule.link),s.Lb(1),s.uc("ngForOf",null==e?null:e.childElements)}}function an(e,t){1&e&&s.Yb(0,"div",44)}function cn(e,t){if(1&e&&(s.dc(0,"div",17),s.Pc(1,nn,12,7,"div",18),s.Pc(2,an,1,0,"div",19),s.cc()),2&e){const e=s.oc(),t=e.$implicit,n=e.index,a=s.oc(2);s.Lb(1),s.uc("ngIf","shareholder-details"!==t.class&&"ai-details"!==t.class&&"manager-details"!==t.class&&"director-details"!==t.class&&"legal-representative-details"!==t.class&&"spo-details"!==t.class&&"lsa-details"!==t.class&&"activity"!==t.class&&"activity-ded"!==t.class&&"activity-mydn"!==t.class&&"activity-fujairah"!==t.class&&!t.class.includes("activity-spc")&&"ubo-details"!==t.class&&"nominee-details"!==t.class),s.Lb(1),s.uc("ngIf",a.currentPageElements.stepElements.length-1!==n)}}function rn(e,t){if(1&e&&(s.dc(0,"span"),s.Pc(1,cn,3,2,"div",16),s.cc()),2&e){const e=t.$implicit;s.Lb(1),s.uc("ngIf",e.is_visible)}}function ln(e,t){if(1&e&&(s.dc(0,"span",14),s.Pc(1,rn,2,1,"span",15),s.cc()),2&e){const e=s.oc();s.Lb(1),s.uc("ngForOf",e.currentPageElements.stepElements)}}const sn=[{path:"",component:(()=>{class e{constructor(e,t,n,a,i){this.router=e,this.commonService=t,this.interceptor=n,this.activatedRoute=a,this.companyFormationService=i,this.showElementsLoader=!0,this.currentPage="",this.currentPageElements={},this.pageFormationElementsList=[],this.process_name="Compliance Questionnaire",this.dropDownList=v,this.fileBaseUrl="",this.isError=!1,this.submitStatus=!1,this.fileUploaded=!1,this.showLoader=!1,this.fileType="",this.selectedFile={},this.taskList=[],this.activatedRoute.queryParams.subscribe(e=>{e&&e.data&&(this.data=this.interceptor.xyz(e.data),this.handleFormElements())})}ngOnInit(){}ngAfterViewInit(){setTimeout(()=>{this.commonService.loadDefaultInputAnimation(),this.loadJs()},100)}loadJs(e="dd-mm-yyyy",t,n,a){let i="",c="",r=e.toUpperCase();"DD-M-YYYY"===r&&(r="DD-MM-YYYY"),"DD-MMM-YYYY"===r&&(r="DD-MM-YYYY"),n&&a?(i=_(n).format(r),c=_(a).format(r)):n&&!a?i=_(n).format(r):!n&&a&&(c=_(a).format(r)),this.taskList.forEach((t,n)=>{let a=this;t.elements.forEach(l=>{"date"==l.type?(l.value=_(l.value,"DD-MMM-YYYY",!0).isValid()?""==l.value?"":_(l.value,"DD-MMM-YYYY").format(r):_(l.value,"DD-MM-YYYY",!0).isValid()?""==l.value?"":_(l.value,"DD-MM-YYYY").format(r):""==l.value?"":_(l.value).format(r),$("#date"+l.key+n).datepicker({autoclose:!0,format:e,startDate:i,endDate:c,todayHighlight:!0}).datepicker("update",l.value?l.value:"").on("changeDate",function(){let e=$(this).datepicker("getFormattedDate");l.value=e})):"select"==l.type?($("#"+l.key+n).select2(),$(document).off("change","#"+l.key+n),$(document).on("change","#"+l.key+n,function(){let e=$(this).val();e&&(l.value=e,a.handleoptionsChange(l,t))}),$("#"+l.key+n).val(l.value).change()):"multi-select"==l.type&&($("#"+l.key+n).select2(),$(document).off("change","#"+l.key+n),$(document).on("change","#"+l.key+n,function(){let e=$(this).val();e&&e.length>0&&(l.value=e,a.handleoptionsChange(l,t))}),$("#"+l.key+n).val(l.value).change())})})}handleFormElements(){this.CompanyLevelFirstManagerFields=m,this.CompanyLevelFirstManagerFields.elements.map(e=>{e.default_visible=e.visible,e.default_required=e.required,e.default_disabled=e.disabled}),this.ShareholderOrDirectorFields=b,this.ShareholderOrDirectorFields.elements.map(e=>{e.default_visible=e.visible,e.default_required=e.required,e.default_disabled=e.disabled}),this.ShareholderFields=g,this.ShareholderFields.elements.map(e=>{e.default_visible=e.visible,e.default_required=e.required,e.default_disabled=e.disabled}),this.ManagerFields=p,this.ManagerFields.elements.map(e=>{e.default_visible=e.visible,e.default_required=e.required,e.default_disabled=e.disabled}),this.AllStakeholdersFields=h,this.AllStakeholdersFields.elements.map(e=>{e.default_visible=e.visible,e.default_required=e.required,e.default_disabled=e.disabled}),this.handleTaskVisibility()}getTaskDetails(){this.companyFormationService.getRiskQuestionerDetails({user_id:!0,company_id:!0,process_request_id:this.data.process_request_id,record_id:this.data.record_id,designation:this.data.designation}).subscribe(e=>{200==e.status?(this.mappingData=e.data,this.fieldDataMapping(e.data)):this.commonService.showToaster("error",e.message?e.message:"Something went wrong. Please try after some time!!")},e=>{this.commonService.showToaster("error","Something went wrong. Please try after some time!!")})}fieldDataMapping(e){this.fileBaseUrl=e.riskDocumentsURL,this.taskList.map(t=>{null==t||t.elements.map(t=>{if("multi-select"==t.type){let n=e[t.key],a=null==n?void 0:n.split(",");t.value=a}else t.value=e[t.key]})}),setTimeout(()=>{this.loadJs(),this.subElementsList&&this.subElementsList.length>0&&this.loadSubElementJs()},50)}handleTaskVisibility(){3==this.data.questionnaire_type&&4==this.data.designation||2==this.data.questionnaire_type&&4==this.data.designation?(this.taskList.push(this.CompanyLevelFirstManagerFields),this.taskList.push(this.ManagerFields),this.taskList.push(this.AllStakeholdersFields)):2==this.data.questionnaire_type&&2==this.data.designation||3==this.data.questionnaire_type&&2==this.data.designation?(this.taskList.push(this.CompanyLevelFirstManagerFields),this.taskList.push(this.AllStakeholdersFields),this.taskList.push(this.ShareholderOrDirectorFields)):(2==this.data.questionnaire_type&&3==this.data.designation||3==this.data.questionnaire_type&&3==this.data.designation||1==this.data.questionnaire_type&&3==this.data.designation)&&(this.taskList.push(this.CompanyLevelFirstManagerFields),this.taskList.push(this.ShareholderFields),this.taskList.push(this.ShareholderOrDirectorFields),this.taskList.push(this.AllStakeholdersFields)),this.getTaskDetails()}handleoptionsChange(e,t,n=!1,a=0){var i,c,r;this.currentObj=t,"number_of_companies_you_worked"===e.key?this.handleNumberOfCompaniesWorked(e):(n?null===(i=this.subElementsList[a])||void 0===i||i.map(e=>{e.visible=e.default_visible,e.required=e.default_required,e.disabled=e.default_disabled}):null===(r=null===(c=this.currentObj)||void 0===c?void 0:c.elements)||void 0===r||r.map(e=>{e.visible=e.default_visible,e.required=e.default_required,e.disabled=e.default_disabled}),this.handleValidation(n,a))}handleNumberOfCompaniesWorked(e){var t;let n=parseInt(e.value),a=[];for(let i=0;iObject.assign(Object.assign({},e),{id:e.key+i+t,rowIndex:i,default_visible:e.visible,default_required:e.required,default_disabled:e.disabled})));this.subElementsList=a,this.subElementsList&&this.subElementsList.length>0&&this.mappingData&&(null===(t=this.subElementsList)||void 0===t||t.map((e,t)=>{null==e||e.map(e=>{if("multi-select"==e.type){let n=this.mappingData.manager_company_details[t][e.key],a=null==n?void 0:n.split(",");e.value=a}else e.value=this.mappingData.manager_company_details[t][e.key]})})),setTimeout(()=>{this.loadSubElementJs()},100)}loadSubElementJs(e="dd-mm-yyyy",t,n,a){let i=this,c="",r="",l=e.toUpperCase();"DD-M-YYYY"===l&&(l="DD-MM-YYYY"),"DD-MMM-YYYY"===l&&(l="DD-MM-YYYY"),n&&a?(c=_(n).format(l),r=_(a).format(l)):n&&!a?c=_(n).format(l):!n&&a&&(r=_(a).format(l));for(let s=0;s0&&(a.value=e,i.handleoptionsChange(a,null,!0,a.rowIndex))}),$("#"+a.id).val(a.value).change())}}}handleSave(){var e;this.isError=!1,this.submitStatus=!0;let t=/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/;if(this.taskList.forEach((e,n)=>{var a;for(let i=0;i0)for(let n=0;n{for(let a=0;a0){let a=[];for(let n=0;n{200===e.status?(this.commonService.showToaster("success",e.message),this.router.navigate(["/customer/dashboard"])):this.commonService.showToaster("error",e.message)},e=>{this.commonService.showToaster("error","Something went wrong. Please try again.")})}hanleRiskAcceptance(){this.companyFormationService.riskAcceptance({user_id:!0,process_request_id:this.data.process_request_id?this.data.process_request_id:"0",record_id:this.data.record_id,designation:this.data.designation}).subscribe(e=>{200===e.status?(this.commonService.showToaster("success",e.message),this.router.navigate(["/customer/dashboard"])):this.commonService.showToaster("error",e.message)},e=>{this.commonService.showToaster("error","Something went wrong. Please try again.")})}handleAcceptRequest(){var e,t;let n={record_id:this.data.record_id,email:this.data.email?this.data.email:"",process_request_id:this.data.process_request_id?this.data.process_request_id:"0",designation:this.data.designation,questionnaire_type:this.data.questionnaire_type,typeRisk:this.data.typeRisk,user_id:!0,company_id:!0,accept_reject:1};if(this.taskList.forEach((e,t)=>{for(let a=0;a0){let a=[];for(let n=0;n{200===e.status?(this.commonService.showToaster("success",e.message),this.router.navigate(["/customer/dashboard"])):this.commonService.showToaster("error",e.message)},e=>{this.commonService.showToaster("error","Something went wrong. Please try again.")})}handleValidation(e,t){var n,a,i;e?null===(n=this.subElementsList[t])||void 0===n||n.map(n=>{n.visible&&this.handleConditionCheck(n,e,t)}):null===(i=null===(a=this.currentObj)||void 0===a?void 0:a.elements)||void 0===i||i.map(n=>{n.visible&&this.handleConditionCheck(n,e,t)})}handleConditionCheck(e,t,n){var a,i;let c=e.value,r=e.key;null===(i=null===(a=null==e?void 0:e.custom_rule)||void 0===a?void 0:a.validatons)||void 0===i||i.map(e=>{let a=e.advance_action,i=e.advance_controls,s=e.advance_minmax,o=e.advance_value;switch(e.advance_condition){case l.a.ADVANCED_CONDITION.EQUAL:(c==o||c&&Array.isArray(c)&&c.toString().includes(o))&&this.handleConditionAction(a,i,t,r,s,n);break;case l.a.ADVANCED_CONDITION.NOT_EQUAL:(c!=o||c&&Array.isArray(c)&&!c.toString().includes(o))&&this.handleConditionAction(a,i,t,r,s,n);break;case l.a.ADVANCED_CONDITION.GRATER_THEN:c>parseFloat(o)&&this.handleConditionAction(a,i,t,r,s,n);break;case l.a.ADVANCED_CONDITION.LESS_THEN:c{t&&t.key.includes(e)&&this.handleConditionApply(a,n,t,i)}):null===(s=null===(l=this.currentObj)||void 0===l?void 0:l.elements)||void 0===s||s.map(t=>{t&&t.key.includes(e)&&this.handleConditionApply(a,n,t,i)})}handleConditionApply(e,t,n,a){"showHide"===e?"hide"===t?(n.visible=!1,n.value=""):n.visible=!0:"enableDisable"===e?n.disabled="disabled"===t:"requiredNotRequired"===e?n.required="required"===t:"minimumMaximum"===e&&("minimum"===t?n.minimum=a:n.maximum=a)}manageNavigation(e){this.router.navigate([e])}handleFileChange(e,t){if(e.target.files&&e.target.files[0]){t.file=e.target.files[0],this.fileUploaded=!0;var n=new FileReader;if(this.getFileType(),n.readAsDataURL(e.target.files[0]),n.onload=e=>{this.selectedFile&&this.selectedFile.value?this.selectedFile.new_file_url=e.target.result:this.selectedFile={new_file_url:e.target.result}},this.fileUploaded){var a={user_id:!0};a[t.key]=t.file,this.companyFormationService.uploadRiskDocument(a).subscribe(e=>{200===e.status?(t.value=e.data.file_name,this.fileUploaded=!1,this.commonService.showToaster("success",e.data.message),this.showLoader=!1):(this.selectedFile="",this.showLoader=!1,this.commonService.showToaster("error",e.message))},e=>{this.showLoader=!1,this.commonService.showToaster("error","Something went wrong. Please try again.")})}}}deleteSelectedFile(){}getFileType(e=!1){this.fileType="";let t="";e&&(t=this.selectedFile.file_url),this.fileType=t&&t.split(".").pop()&&["jpeg","jpg","png","svg"].includes(t.split(".").pop())?"image":t&&t.split(".").pop()&&"gif"===t.split(".").pop()?"gif":t&&t.split(".").pop()&&"ppt"===t.split(".").pop()?"ppt":t&&t.split(".").pop()&&"xls"===t.split(".").pop()||"xlsx"===t.split(".").pop()?"xls":t&&t.split(".").pop()&&"doc"===t.split(".").pop()||"docx"===t.split(".").pop()?"doc":t&&t.split(".").pop()&&"pdf"===t.split(".").pop()?"pdf":"image"}}return e.\u0275fac=function(t){return new(t||e)(s.Xb(o.d),s.Xb(f.a),s.Xb(P.a),s.Xb(o.a),s.Xb(O.a))},e.\u0275cmp=s.Rb({type:e,selectors:[["app-compliance-task"]],viewQuery:function(e,t){if(1&e&&s.Wc(d,1),2&e){let e;s.Cc(e=s.lc())&&(t.sidebarComponent=e.first)}},decls:20,vars:3,consts:[["id","wrapper",1,"bg-blue","company-formation","min-height"],[1,"db-wrapper","clearfix"],[1,"db-right"],[1,"shadow-card-wrapper","thumbnail","next-bottom"],[1,"divider-left"],[1,"formation-block"],[1,"section-wrapper"],["class","row-wrapper",4,"ngIf"],["content","Elements","loaderType","page",3,"showLoader"],[1,"next-row"],[1,"button-wrapper"],["type","submit",1,"next-button","material_input",3,"click"],[1,"button-text"],[1,"previous-button","material_input",3,"click"],[1,"row-wrapper"],[4,"ngFor","ngForOf"],["class","element-row",4,"ngIf"],[1,"element-row"],["class","formation-block element-column-rows",4,"ngIf"],["class","step-divider",4,"ngIf"],[1,"formation-block","element-column-rows"],[1,"number"],[4,"ngIf"],[1,"row"],[1,"clearfix"],[3,"class",4,"ngIf"],[3,"rowIndex","hidden","detectedChange","currentPageElementObj","submitStatus","rowType","rowClass","onChangeValue",4,"ngIf"],[3,"currentPageElementObj","rowIndex","detectedChange","rowType","submitStatus","onChangeValue",4,"ngIf"],[3,"detectedChange","processId","currentPageElementObj","pageFormationElementsList","process_request_id","submitStatus","handleValidationOnPageChange",4,"ngIf"],[3,"currentPageElementObj",4,"ngIf"],[3,"pageFormationElementsList","currentPageElementObj","rowIndex","rowType","detectedChange","submitStatus","onChangeValue",4,"ngIf"],[3,"rowIndex","hidden","detectedChange","currentPageElementObj","submitStatus","rowType","rowClass","onChangeValue"],[3,"currentPageElementObj","rowIndex","detectedChange","rowType","submitStatus","onChangeValue"],[3,"detectedChange","processId","currentPageElementObj","pageFormationElementsList","process_request_id","submitStatus","handleValidationOnPageChange"],[3,"currentPageElementObj"],[3,"pageFormationElementsList","currentPageElementObj","rowIndex","rowType","detectedChange","submitStatus","onChangeValue"],[1,"alert"],[1,"alert-danger"],[1,"material-icons"],[3,"innerHtml"],["class","col-sm-12",4,"ngIf"],[1,"col-sm-12"],[1,"alert-danger","error-comment-box"],[1,"error-comment-text-danger"],[1,"step-divider"]],template:function(e,t){1&e&&(s.dc(0,"div",0),s.dc(1,"section",1),s.Yb(2,"app-sidebar"),s.dc(3,"main",2),s.dc(4,"section",3),s.Yb(5,"div",4),s.dc(6,"div",5),s.dc(7,"h1"),s.Rc(8),s.cc(),s.cc(),s.dc(9,"div",6),s.Pc(10,ln,2,1,"span",7),s.Yb(11,"app-loader",8),s.cc(),s.dc(12,"div",9),s.dc(13,"span",10),s.dc(14,"button",11),s.kc("click",function(){return t.handleSave()}),s.dc(15,"span",12),s.Rc(16,"Submit"),s.cc(),s.cc(),s.cc(),s.dc(17,"button",13),s.kc("click",function(){return t.manageNavigation("/customer/dashboard")}),s.dc(18,"span",12),s.Rc(19,"cancel"),s.cc(),s.cc(),s.cc(),s.cc(),s.cc(),s.cc(),s.cc()),2&e&&(s.Lb(8),s.Sc(t.process_name),s.Lb(2),s.uc("ngIf",!t.showElementsLoader),s.Lb(1),s.uc("showLoader",t.showElementsLoader))},directives:[d,r.n,j,r.m,M,de,ge,ve,Ee,Se,Fe,Ye,Xe,Ct,Tt,Rt],styles:[""]}),e})(),canActivate:[u.a],data:{title:"Compliance Task"}}];let on=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=s.Vb({type:e}),e.\u0275inj=s.Ub({imports:[[o.f.forChild(sn)],o.f]}),e})(),un=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=s.Vb({type:e}),e.\u0275inj=s.Ub({imports:[[r.c,on,c.c,i.b,a.h]]}),e})()}}]);