2 lines
23 KiB
JavaScript
2 lines
23 KiB
JavaScript
import{_ as e}from"./fc-bits.js?ver=3.1.8";import{a3 as l,k as a,e as o,aw as t,aE as d,aF as s,aK as i,aL as c,aG as m,az as n,aY as r,ax as u,E as p,aT as _,ay as f,aD as h,aA as y}from"./vendor-element-plus.js?ver=3.1.8";import{c2 as v,bW as g,aQ as w,W as b,X as V,_ as $,ab as k,a5 as C,Z as M,a9 as x,aa as U,a8 as N,Y as G,J as A,az as F,a0 as E,b2 as L,a6 as S,$ as H}from"./vendor.js?ver=3.1.8";import{_ as O,I as j}from"./fc-bits-ui.js?ver=3.1.8";const I=g(()=>e(()=>import("./v3app/src/Modules/Settings/parts/CustomContactFields.js?ver=3.1.8"),[],import.meta.url)),P={name:"ProfileCustomFields",props:{custom_values:{type:Object,required:!0},show_header:{type:Boolean,default:!0}},components:{CustomFields:I,Edit:l,Icons:j},data(){return{direction:"rtl",app_ready:!1,showingCustomFieldsConfig:!1,custom_fields:this.appVars.company_custom_fields,updatedGroupName:"",editingGroupName:null,updatingGroupName:!1}},computed:{fieldGroups(){const e={};return this.each(this.custom_fields,l=>{v(this.custom_values,l.slug)&&(l.is_disabled=!0),l.group||(l.group=""),e[l.group]||(e[l.group]={}),e[l.group][l.slug]=l}),e}},methods:{clickGroupNameToEdit(e){this.updatedGroupName=e,this.editingGroupName=e,this.$nextTick(()=>{const e=Array.isArray(this.$refs.groupNameInput)?this.$refs.groupNameInput[0]:this.$refs.groupNameInput;e&&e.focus&&e.focus()})},handleGroupNameUpdate(){if(this.updatingGroupName)return;const e=this.editingGroupName,l=this.updatedGroupName.trim();if(!l||l===e)return this.updatedGroupName="",void(this.editingGroupName=null);this.updatingGroupName=!0,this.$put("companies/custom-fields/update_group_name",{old_name:e,new_name:l}).then(a=>{const o=Array.isArray(a.fields)?a.fields:this.custom_fields.map(a=>a.group===e?{...a,group:l}:a);this.custom_fields=o,this.appVars.company_custom_fields=o,this.$notify.success({title:this.$t("Great!"),message:a.message,offset:19})}).catch(e=>{this.handleError(e)}).finally(()=>{this.updatedGroupName="",this.editingGroupName=null,this.updatingGroupName=!1})},openConfig(){this.showingCustomFieldsConfig=!0},onFieldsUpdated(e){this.custom_fields=e,this.appVars.company_custom_fields=e}},mounted(){window.fcAdmin&&window.fcAdmin.is_rtl&&(this.direction="ltr"),this.each(this.custom_fields,e=>{let l="";-1!==["select-multi","checkbox"].indexOf(e.type)&&(l=[]),v(this.custom_values,e.slug)||(this.custom_values[e.slug]=l)}),this.app_ready=!0}},T={class:"fcrm_custom_field_wrapper fcrm_company_custom_field_wrapper"},Y={key:0,class:"fcrm_custom_data_header"},B={class:"icon"},R={key:1,class:"fluentcrm_custom_fields fcrm_custom_data_fields"},z={key:0,class:"fcrm_custom_data_group_head"},D={key:0},q=["onClick"],W={class:"fcrm_custom_data_grid"},Z={key:2,class:"fcrm_no_custom_fields_btn fcrm_custom_data_empty"};const K=O(P,[["render",function(e,l,f,h,y,v){const g=w("Icons"),S=a,H=o,O=s,j=d,I=c,P=i,K=n,J=m,Q=r,X=t,ee=u,le=w("Edit"),ae=p,oe=w("custom-fields"),te=_;return b(),V("div",T,[f.show_header?(b(),V("div",Y,[$(e.$slots,"header-title"),k(S,{link:"",onClick:l[0]||(l[0]=e=>v.openConfig())},{default:C(()=>[M("span",B,[k(g,{"icon-name":"EditPen"})]),x(" "+U(y.custom_fields.length?e.$t("Configure"):e.$t("Add Custom Field")),1)],void 0),_:1})])):N("",!0),y.custom_fields.length?(b(),V("div",R,[y.app_ready?(b(),G(ee,{key:0,model:f.custom_values,"label-position":"top",class:"fcrm_custom_data_form"},{default:C(()=>[(b(!0),V(A,null,F(v.fieldGroups,(a,o)=>(b(),V("section",{key:o||"ungrouped",class:E([{fcrm_custom_data_group_plain:!o},"fcrm_custom_data_group"])},[o?(b(),V("div",z,[y.editingGroupName!==o?(b(),V("h4",D,[x(U(o)+" ",1),M("span",{class:"icon cursor_pointer",onClick:e=>v.clickGroupNameToEdit(o)},[k(g,{"icon-name":"EditPen"})],8,q)])):(b(),G(H,{key:1,ref_for:!0,ref:"groupNameInput",modelValue:y.updatedGroupName,"onUpdate:modelValue":l[1]||(l[1]=e=>y.updatedGroupName=e),type:"text",onBlur:v.handleGroupNameUpdate,onKeyup:L(v.handleGroupNameUpdate,["enter"])},null,8,["modelValue","onBlur","onKeyup"])),M("span",null,U(e.$_n("%d field","%d fields",Object.keys(a).length)),1)])):N("",!0),M("div",W,[(b(!0),V(A,null,F(a,(l,a)=>(b(),G(X,{key:a,label:l.label,class:"fcrm_custom_data_item"},{default:C(()=>["text"==l.type||"number"==l.type||"textarea"==l.type?(b(),G(H,{key:0,placeholder:l.label,rows:"textarea"==l.type?2:void 0,type:l.type,modelValue:f.custom_values[a],"onUpdate:modelValue":e=>f.custom_values[a]=e},null,8,["placeholder","rows","type","modelValue","onUpdate:modelValue"])):"radio"==l.type?(b(),G(j,{key:1,modelValue:f.custom_values[a],"onUpdate:modelValue":e=>f.custom_values[a]=e,class:"fcrm_custom_data_options"},{default:C(()=>[(b(!0),V(A,null,F(l.options,e=>(b(),G(O,{key:e,value:e},{default:C(()=>[x(U(e),1)],void 0,!0),_:2},1032,["value"]))),128))],void 0,!0),_:2},1032,["modelValue","onUpdate:modelValue"])):"select-one"==l.type||"select-multi"==l.type?(b(),G(P,{key:2,placeholder:e.$t("Select")+" "+l.label,clearable:"",filterable:"",multiple:"select-multi"==l.type,modelValue:f.custom_values[a],"onUpdate:modelValue":e=>f.custom_values[a]=e},{default:C(()=>[(b(!0),V(A,null,F(l.options,e=>(b(),G(I,{key:e,value:e,label:e},null,8,["value","label"]))),128))],void 0,!0),_:2},1032,["placeholder","multiple","modelValue","onUpdate:modelValue"])):"checkbox"==l.type?(b(),G(J,{key:3,modelValue:f.custom_values[a],"onUpdate:modelValue":e=>f.custom_values[a]=e,class:"fcrm_custom_data_options"},{default:C(()=>[(b(!0),V(A,null,F(l.options,e=>(b(),G(K,{key:e,value:e},{default:C(()=>[x(U(e),1)],void 0,!0),_:2},1032,["value"]))),128))],void 0,!0),_:2},1032,["modelValue","onUpdate:modelValue"])):"date"==l.type?(b(),G(Q,{key:4,"value-format":"YYYY-MM-DD",modelValue:f.custom_values[a],"onUpdate:modelValue":e=>f.custom_values[a]=e,type:"date",placeholder:e.$t("Pick a date")},null,8,["modelValue","onUpdate:modelValue","placeholder"])):"date_time"==l.type?(b(),G(Q,{key:5,"value-format":"YYYY-MM-DD HH:mm:ss",modelValue:f.custom_values[a],"onUpdate:modelValue":e=>f.custom_values[a]=e,type:"datetime",placeholder:e.$t("Pick a date and time")},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(b(),V(A,{key:6},[x(U(l),1)],64))],void 0,!0),_:2},1032,["label"]))),128))])],2))),128))],void 0),_:1},8,["model"])):N("",!0)])):(b(),V("div",Z,[M("p",null,U(e.$t("No custom fields configured for companies yet.")),1),f.show_header?(b(),G(S,{key:0,onClick:l[2]||(l[2]=e=>v.openConfig())},{default:C(()=>[k(ae,null,{default:C(()=>[k(le)],void 0,!0),_:1}),M("span",null,U(e.$t("Add Custom Field")),1)],void 0),_:1})):N("",!0)])),k(te,{direction:y.direction,"append-to-body":!0,title:e.$t("Configure Company Custom Field"),modelValue:y.showingCustomFieldsConfig,"onUpdate:modelValue":l[3]||(l[3]=e=>y.showingCustomFieldsConfig=e),size:"50%"},{default:C(()=>[y.showingCustomFieldsConfig?(b(),G(oe,{key:0,is_pop:!0,default_tab:"companies",onFieldsUpdated:v.onFieldsUpdated},null,8,["onFieldsUpdated"])):N("",!0)],void 0),_:1},8,["direction","title","modelValue"])])}]]),J={name:"photo_widget",props:{modelValue:{type:String,default:""},value:{type:String,default:""},btn_mode:{type:Boolean,default:()=>!1},btn_text:{type:String,default:()=>"+ Upload"},btn_type:{type:String,default:()=>"default"}},emits:["update:modelValue","input","changed","update:value"],data:()=>({app_ready:!1}),computed:{displayValue(){return this.modelValue||this.value||""}},methods:{initUploader(){var e;const l=null==(e=null==window?void 0:window.wp)?void 0:e.media,a=null==l?void 0:l.editor;if(!(a&&"function"==typeof a.open&&l&&l.model&&l.view))return console.warn("PhotoWidget: wp.media.editor is not available. Ensure wp_enqueue_media() is called on the page."),!1;const o=a.send.attachment;a.send.attachment=(e,l)=>{if(l&&l.url){const e=l.url;this.$emit("update:modelValue",e),this.$emit("update:value",e),this.$emit("input",e),this.$emit("changed",e)}a.send.attachment=o};const t=window.wpActiveEditor;window.wpActiveEditor="photo_widget",a.open();const d=a.frame;return d&&"function"==typeof d.on?d.on("close",()=>{window.wpActiveEditor=t}):window.wpActiveEditor=t,!1},getThumb:e=>e.url},mounted(){this.app_ready=!0}},Q={class:"fcrm_fluentcrm_photo_card"},X={key:0,class:"fcrm_fluentcrm_photo_holder"},ee={key:0,class:"fcrm_photo_image_wrapper"},le=["src"];const ae={class:"fcrm_company_summary_shared"},oe={class:"fcrm_company_summary_logo_section"},te={class:"fcrm_logo_placeholder"},de={key:1,class:"fcrm_logo_empty"},se={class:"fcrm_logo_info"},ie={class:"fcrm_logo_title"},ce={class:"fcrm_logo_subtitle"},me={class:"fcrm_company_summary_section"},ne={class:"fcrm_company_section_divider"},re={class:"fcrm_company_summary_section"},ue={class:"fcrm_company_section_divider"};const pe={class:"fcrm_company_edit_shared"},_e={class:"fcrm_company_edit_section"},fe={key:0,class:"fcrm_company_optional_toggle"},he={key:1,class:"fcrm_company_section_divider"},ye={class:"fcrm_secondary_text font-regular"},ve=["innerHTML"],ge=["innerHTML"],we={class:"fcrm_company_edit_section"},be={key:0,class:"fcrm_company_optional_toggle"},Ve={key:1,class:"fcrm_company_section_divider"},$e={key:2,class:"fcrm_company_edit_social_grid"},ke={key:0,class:"fcrm_company_edit_section fcrm_company_custom_section"};const Ce=O({name:"CompanyEditForm",components:{CompanySummaryForm:O({name:"CompanySummaryForm",components:{PhotoWidget:O(J,[["render",function(e,l,o,t,d,s){const i=a;return b(),V("div",Q,[d.app_ready?(b(),V("div",X,[s.displayValue&&!o.btn_mode?(b(),V("div",ee,[M("img",{src:s.displayValue,class:"fcrm_photo_image"},null,8,le)])):N("",!0),o.btn_mode?(b(),G(i,{key:1,size:"small",onClick:s.initUploader,type:o.btn_type},{default:C(()=>[x(U(o.btn_text),1)],void 0),_:1},8,["onClick","type"])):N("",!0),$(e.$slots,"after")])):N("",!0)])}]]),ContactSelector:O({name:"ContactSelector",props:["field","modelValue"],emits:["contactSelected","update:modelValue"],data(){return{model:this.modelValue,loading:!1,options:{},appReady:!1}},watch:{model(e){this.$emit("update:modelValue",e),this.$emit("contactSelected",this.options[e])}},methods:{fetchOptions(e){this.loading=!0,this.$get("subscribers/search-contacts",{search:e,values:this.model}).then(e=>{this.options=e.contacts}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1})}},mounted(){this.model&&"0"!=this.model||this.field.is_multiple||(this.model=""),this.field.pre_options&&this.field.pre_options.length&&this.each(this.field.pre_options,e=>{e&&e.id&&(e.id=e.id.toString(),this.options[e.id]=e)}),this.appReady=!0,this.model&&"object"!=typeof this.model&&!this.options[this.model]&&this.fetchOptions("")}},[["render",function(e,l,a,o,t,d){const s=c,m=i,n=f;return t.appReady?S((b(),G(m,{key:0,modelValue:t.model,"onUpdate:modelValue":l[0]||(l[0]=e=>t.model=e),multiple:a.field.is_multiple,filterable:"",remote:!a.field.cacheable,clearable:a.field.clearable,disabled:a.field.disabled,"reserve-keyword":"",size:a.field.size,placeholder:a.field.placeholder||e.$t("Search contact"),"remote-method":d.fetchOptions},{default:C(()=>[(b(!0),V(A,null,F(t.options,e=>(b(),G(s,{key:e.id,label:e.full_name+" ("+e.email+")",value:e.id},null,8,["label","value"]))),128))],void 0),_:1},8,["modelValue","multiple","remote","clearable","disabled","size","placeholder","remote-method"])),[[n,t.loading]]):N("",!0)}]])},emits:["avatarChanged"],props:{model:{type:Object,required:!0},company:{type:Object,required:!0},descriptionRows:{type:Number,default:2}},data(){return{localModel:this.model,localCompany:this.company}},watch:{model(e){this.localModel=e},company(e){this.localCompany=e}}},[["render",function(e,l,a,d,s,m){const n=w("photo-widget"),r=o,p=t,_=y,f=h,v=c,g=i,$=w("contact-selector"),x=u;return b(),V("div",ae,[M("div",oe,[M("div",te,[s.localCompany.logo?(b(),V("div",{key:0,class:"fcrm_logo_img",style:H({backgroundImage:"url("+s.localCompany.logo+")"})},null,4)):(b(),V("div",de,[...l[11]||(l[11]=[M("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"presentation","aria-hidden":"true"},[M("path",{d:"M12 2L2 7V22H22V7L12 2Z",fill:"white",opacity:"0.3"}),M("rect",{x:"5",y:"10",width:"2.5",height:"2.5",fill:"white"}),M("rect",{x:"9",y:"10",width:"2.5",height:"2.5",fill:"white"}),M("rect",{x:"13",y:"10",width:"2.5",height:"2.5",fill:"white"}),M("rect",{x:"17",y:"10",width:"2.5",height:"2.5",fill:"white"}),M("rect",{x:"5",y:"14",width:"2.5",height:"2.5",fill:"white"}),M("rect",{x:"9",y:"14",width:"2.5",height:"2.5",fill:"white"}),M("rect",{x:"13",y:"14",width:"2.5",height:"2.5",fill:"white"}),M("rect",{x:"17",y:"14",width:"2.5",height:"2.5",fill:"white"}),M("rect",{x:"5",y:"18",width:"2.5",height:"2.5",fill:"white"}),M("rect",{x:"9",y:"18",width:"2.5",height:"2.5",fill:"white"}),M("rect",{x:"13",y:"18",width:"2.5",height:"2.5",fill:"white"}),M("rect",{x:"17",y:"18",width:"2.5",height:"2.5",fill:"white"})],-1)])]))]),M("div",se,[M("div",ie,U(e.$t("Upload Logo")),1),M("div",ce,U(e.$t("Min 400x400px, PNG or JPEG")),1),k(n,{class:"fcrm_photo_widget",btn_type:"default",btn_text:e.$t("Upload"),btn_mode:!0,onChanged:l[0]||(l[0]=l=>e.$emit("avatarChanged",l)),modelValue:s.localCompany.logo,"onUpdate:modelValue":l[1]||(l[1]=e=>s.localCompany.logo=e)},null,8,["btn_text","modelValue"])])]),k(x,{class:"fcrm_company_summary_form","label-position":"top",model:s.localModel},{default:C(()=>[M("section",me,[M("div",ne,[M("span",null,U(e.$t("Basic Information")),1)]),k(f,{gutter:16},{default:C(()=>[k(_,{span:24},{default:C(()=>[k(p,{label:e.$t("Company Name"),class:"fcrm_company_form_item"},{default:C(()=>[k(r,{placeholder:e.$t("e.g. Acme Corp"),modelValue:s.localModel.name,"onUpdate:modelValue":l[2]||(l[2]=e=>s.localModel.name=e),class:"fcrm_company_input"},null,8,["placeholder","modelValue"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1}),k(_,{md:12,sm:24,xs:24},{default:C(()=>[k(p,{label:e.$t("Company Email"),class:"fcrm_company_form_item"},{default:C(()=>[k(r,{type:"email",placeholder:e.$t("you@example.com"),modelValue:s.localModel.email,"onUpdate:modelValue":l[3]||(l[3]=e=>s.localModel.email=e),class:"fcrm_company_input"},null,8,["placeholder","modelValue"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1}),k(_,{md:12,sm:24,xs:24},{default:C(()=>[k(p,{label:e.$t("Company Phone Number"),class:"fcrm_company_form_item"},{default:C(()=>[k(r,{placeholder:e.$t("+155555555"),modelValue:s.localModel.phone,"onUpdate:modelValue":l[4]||(l[4]=e=>s.localModel.phone=e),class:"fcrm_company_input"},null,8,["placeholder","modelValue"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1})],void 0,!0),_:1})]),M("section",re,[M("div",ue,[M("span",null,U(e.$t("About this company")),1)]),k(f,{gutter:16},{default:C(()=>[k(_,{md:12,sm:24,xs:24},{default:C(()=>[k(p,{label:e.$t("Website"),class:"fcrm_company_form_item"},{default:C(()=>[k(r,{type:"url",placeholder:e.$t("https://example.com"),modelValue:s.localModel.website,"onUpdate:modelValue":l[5]||(l[5]=e=>s.localModel.website=e),class:"fcrm_company_input"},null,8,["placeholder","modelValue"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1}),k(_,{md:12,sm:24,xs:24},{default:C(()=>[k(p,{label:e.$t("Number of Employees"),class:"fcrm_company_form_item"},{default:C(()=>[k(r,{min:0,type:"number",autocomplete:"new-password",placeholder:e.$t("e.g. 5000"),modelValue:s.localModel.employees_number,"onUpdate:modelValue":l[6]||(l[6]=e=>s.localModel.employees_number=e),class:"fcrm_company_input"},null,8,["placeholder","modelValue"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1}),k(_,{md:12,sm:24,xs:24},{default:C(()=>[k(p,{label:e.$t("Industry"),class:"fcrm_company_form_item"},{default:C(()=>[k(g,{modelValue:s.localModel.industry,"onUpdate:modelValue":l[7]||(l[7]=e=>s.localModel.industry=e),"allow-create":"",clearable:"",filterable:"",placeholder:e.$t("Company industry"),class:"fcrm_company_input"},{default:C(()=>[(b(!0),V(A,null,F(e.appVars.company_categories,e=>(b(),G(v,{key:e,label:e,value:e},null,8,["label","value"]))),128))],void 0,!0),_:1},8,["modelValue","placeholder"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1}),k(_,{md:12,sm:24,xs:24},{default:C(()=>[k(p,{label:e.$t("Type"),class:"fcrm_company_form_item"},{default:C(()=>[k(g,{modelValue:s.localModel.type,"onUpdate:modelValue":l[8]||(l[8]=e=>s.localModel.type=e),clearable:"",filterable:"",placeholder:e.$t("Relationship type"),class:"fcrm_company_input"},{default:C(()=>[(b(!0),V(A,null,F(e.appVars.company_types,e=>(b(),G(v,{key:e,label:e,value:e},null,8,["label","value"]))),128))],void 0,!0),_:1},8,["modelValue","placeholder"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1}),k(_,{span:24},{default:C(()=>[k(p,{label:e.$t("Company Owner"),class:"fcrm_company_form_item"},{default:C(()=>[k($,{modelValue:s.localModel.owner_id,"onUpdate:modelValue":l[9]||(l[9]=e=>s.localModel.owner_id=e),field:{clearable:!0,pre_options:[s.localCompany.owner]}},null,8,["modelValue","field"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1}),k(_,{span:24},{default:C(()=>[k(p,{label:e.$t("Description"),class:"fcrm_company_form_item"},{default:C(()=>[k(r,{type:"textarea",rows:a.descriptionRows,placeholder:e.$t("Briefly describe what company does.."),modelValue:s.localModel.description,"onUpdate:modelValue":l[10]||(l[10]=e=>s.localModel.description=e),class:"fcrm_company_textarea"},null,8,["rows","placeholder","modelValue"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1})],void 0,!0),_:1})])],void 0),_:1},8,["model"])])}]])},emits:["avatarChanged"],props:{model:{type:Object,required:!0},company:{type:Object,required:!0},mode:{type:String,default:"edit",validator:e=>["create","edit"].includes(e)}},data(){return{localModel:this.model,localCompany:this.company,showAddressFields:"create"!==this.mode,showSocialFields:"create"!==this.mode}},computed:{isCreateMode(){return"create"===this.mode}},watch:{model(e){this.localModel=e},company(e){this.localCompany=e}}},[["render",function(e,l,a,d,s,m){const r=w("company-summary-form"),p=n,_=o,f=t,v=y,g=c,E=i,L=h,S=u;return b(),V("div",pe,[k(r,{model:s.localModel,company:s.localCompany,onAvatarChanged:l[0]||(l[0]=l=>e.$emit("avatarChanged",l))},null,8,["model","company"]),M("section",_e,[m.isCreateMode?(b(),V("div",fe,[k(p,{modelValue:s.showAddressFields,"onUpdate:modelValue":l[1]||(l[1]=e=>s.showAddressFields=e),class:"fcrm_company_checkbox"},{default:C(()=>[x(U(e.$t("Add Address Info")),1)],void 0),_:1},8,["modelValue"])])):(b(),V("div",he,[M("span",null,U(e.$t("Address")),1)])),s.showAddressFields?(b(),G(S,{key:2,class:"fcrm_company_summary_form","label-position":"top",model:s.localModel},{default:C(()=>[k(L,{gutter:16},{default:C(()=>[k(v,{md:12,sm:24,xs:24},{default:C(()=>[k(f,{label:e.$t("Address Line 1"),class:"fcrm_company_form_item"},{default:C(()=>[k(_,{placeholder:e.$t("Enter street address"),autocomplete:"new-password",modelValue:s.localModel.address_line_1,"onUpdate:modelValue":l[2]||(l[2]=e=>s.localModel.address_line_1=e),class:"fcrm_company_input"},null,8,["placeholder","modelValue"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1}),k(v,{md:12,sm:24,xs:24},{default:C(()=>[k(f,{class:"fcrm_company_form_item"},{label:C(()=>[M("span",null,[x(U(e.$t("Address Line 2"))+" ",1),M("span",ye,"("+U(e.$t("Optional"))+")",1)])]),default:C(()=>[k(_,{placeholder:e.$t("Enter apartment, suite, unit"),autocomplete:"new-password",modelValue:s.localModel.address_line_2,"onUpdate:modelValue":l[3]||(l[3]=e=>s.localModel.address_line_2=e),class:"fcrm_company_input"},null,8,["placeholder","modelValue"])],void 0,!0),_:1})],void 0,!0),_:1}),k(v,{md:12,sm:24,xs:24},{default:C(()=>[k(f,{label:e.$t("City"),class:"fcrm_company_form_item"},{default:C(()=>[k(_,{placeholder:e.$t("Enter city"),autocomplete:"new-password",modelValue:s.localModel.city,"onUpdate:modelValue":l[4]||(l[4]=e=>s.localModel.city=e),class:"fcrm_company_input"},null,8,["placeholder","modelValue"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1}),k(v,{md:12,sm:24,xs:24},{default:C(()=>[k(f,{label:e.$t("State"),class:"fcrm_company_form_item"},{default:C(()=>[k(_,{placeholder:e.$t("Enter state / province"),autocomplete:"new-password",modelValue:s.localModel.state,"onUpdate:modelValue":l[5]||(l[5]=e=>s.localModel.state=e),class:"fcrm_company_input"},null,8,["placeholder","modelValue"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1}),k(v,{md:12,sm:24,xs:24},{default:C(()=>[k(f,{label:e.$t("Postal Code"),class:"fcrm_company_form_item"},{default:C(()=>[k(_,{placeholder:e.$t("Enter postal code"),autocomplete:"new-password",modelValue:s.localModel.postal_code,"onUpdate:modelValue":l[6]||(l[6]=e=>s.localModel.postal_code=e),class:"fcrm_company_input"},null,8,["placeholder","modelValue"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1}),k(v,{md:12,sm:24,xs:24},{default:C(()=>[k(f,{label:e.$t("Country"),class:"fcrm_company_form_item"},{default:C(()=>[k(E,{modelValue:s.localModel.country,"onUpdate:modelValue":l[7]||(l[7]=e=>s.localModel.country=e),clearable:"",filterable:"",autocomplete:"off",placeholder:e.$t("Select country"),class:"fcrm_company_input"},{label:C(({label:e})=>[M("span",{innerHTML:e},null,8,ve)]),default:C(()=>[(b(!0),V(A,null,F(e.appVars.countries,e=>(b(),G(g,{key:e.code,value:e.code,label:e.title},{default:C(()=>[M("span",{innerHTML:e.title},null,8,ge)],void 0,!0),_:2},1032,["value","label"]))),128))],void 0,!0),_:1},8,["modelValue","placeholder"])],void 0,!0),_:1},8,["label"])],void 0,!0),_:1})],void 0,!0),_:1})],void 0),_:1},8,["model"])):N("",!0)]),M("section",we,[m.isCreateMode?(b(),V("div",be,[k(p,{modelValue:s.showSocialFields,"onUpdate:modelValue":l[8]||(l[8]=e=>s.showSocialFields=e),class:"fcrm_company_checkbox"},{default:C(()=>[x(U(e.$t("Add Social Media URL")),1)],void 0),_:1},8,["modelValue"])])):(b(),V("div",Ve,[M("span",null,U(e.$t("Social Links")),1)])),s.showSocialFields?(b(),V("div",$e,[k(_,{type:"url",placeholder:e.$t("https://www.linkedin.com/company/example"),modelValue:s.localModel.linkedin_url,"onUpdate:modelValue":l[9]||(l[9]=e=>s.localModel.linkedin_url=e),class:"fcrm_company_social_input"},{prefix:C(()=>[...l[12]||(l[12]=[M("span",{class:"dashicons dashicons-linkedin fcrm_social_icon"},null,-1)])]),_:1},8,["placeholder","modelValue"]),k(_,{type:"url",placeholder:e.$t("https://x.com/example"),modelValue:s.localModel.twitter_url,"onUpdate:modelValue":l[10]||(l[10]=e=>s.localModel.twitter_url=e),class:"fcrm_company_social_input"},{prefix:C(()=>[...l[13]||(l[13]=[M("svg",{class:"fcrm_social_icon fcrm_social_icon_svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[M("path",{d:"M2.5365 3.125L8.32782 10.709L2.5 16.875H3.81171L8.91408 11.4765L13.0365 16.875H17.5L11.3827 8.86448L16.8073 3.125H15.4956L10.7967 8.09678L7 3.125H2.5365ZM4.46543 4.07143H6.51594L15.5708 15.9288H13.5203L4.46543 4.07143Z",fill:"currentColor"})],-1)])]),_:1},8,["placeholder","modelValue"]),k(_,{type:"url",placeholder:e.$t("https://www.facebook.com/example"),modelValue:s.localModel.facebook_url,"onUpdate:modelValue":l[11]||(l[11]=e=>s.localModel.facebook_url=e),class:"fcrm_company_social_input fcrm_company_edit_social_full"},{prefix:C(()=>[...l[14]||(l[14]=[M("span",{class:"dashicons dashicons-facebook-alt fcrm_social_icon"},null,-1)])]),_:1},8,["placeholder","modelValue"])])):N("",!0)]),e.$slots["custom-fields"]?(b(),V("section",ke,[$(e.$slots,"custom-fields")])):N("",!0)])}]]);export{Ce as C,K as a};
|