2 lines
19 KiB
JavaScript
2 lines
19 KiB
JavaScript
import{c as e,aq as t,ar as i,L as a,a3 as s,a6 as o,a4 as n,D as l,E as d,e as r,k as c,az as h,aL as p,aK as _,aT as g}from"../../../../vendor-element-plus.js?ver=3.1.8";import{aQ as m,W as u,X as f,Z as v,aa as y,ab as k,a5 as w,b2 as b,a8 as N,Y as C,a0 as $,a9 as x,J as L,az as D,ax as M,a6 as A,ac as S,aE as z,bK as T}from"../../../../vendor.js?ver=3.1.8";import{C as q}from"../../../../Confirm2.js?ver=3.1.8";import{F as P}from"../../../../_FormBuilder.js?ver=3.1.8";import{F as j}from"../../../../FloatingBulkActionShell.js?ver=3.1.8";import{c as V}from"../../../../clipboard.js?ver=3.1.8";import{_ as B,I as E}from"../../../../fc-bits-ui.js?ver=3.1.8";import"../../../../_OptionSelector.js?ver=3.1.8";import"../../../../input-popover-dropdown2.js?ver=3.1.8";import"../../../../CustomIcon.js?ver=3.1.8";import"../../../../data_config.js?ver=3.1.8";z.extend(T);const I={class:"fcrm_act_wrap"},U={class:"fcrm_act_card"},F={class:"fcrm_act_head"},Y={class:"fcrm_act_head_inner"},R={class:"fcrm_act_title_wrap"},H={class:"fcrm_act_title"},K={key:0,class:"fcrm_act_actions"},Z={key:0,class:"fcrm_act_search_wrap"},O={class:"icon"},Q={class:"icon"},G={key:0,class:"fcrm_notes_list"},J=["data-note-id"],W=["onClick"],X={class:"fcrm_note_header_left"},ee={class:"fcrm_note_avatar"},te=["src","alt"],ie={key:1,class:"fcrm_note_avatar_initials"},ae={class:"fcrm_note_info"},se={class:"fcrm_note_title"},oe={class:"fcrm_note_meta"},ne={key:0},le={key:1},de=["title"],re={class:"fcrm_note_header_right"},ce={class:"icon"},he={class:"icon"},pe=["innerHTML"],_e={key:1,class:"fcrm_empty_state"},ge={class:"fcrm_empty_state_text"},me={key:2,class:"fcrm_pg"},ue={class:"fcrm_pg_left"},fe={class:"fcrm_pg_text"},ve={class:"fcrm_pg_right"},ye={class:"fcrm_pg_page"},ke={class:"fcrm_pg_page_num"},we={class:"fcrm_bulk_action_bar"},be={class:"fcrm_bulk_action_left"},Ne={class:"icon"},Ce={class:"fc_bulk_selection_count"},$e={key:0,class:"fcrm_bulk_divider"},xe={class:"icon"},Le={class:"fcrm_drawer_body"},De={class:"dialog-footer justify-end"};const Me=B({name:"CompanyActivities",props:["company_id"],emits:["added","deleted","updated"],components:{Icons:E,Confirm:q,FormBuilder:P,FloatingBulkActionShell:j,Search:l,Download:n,Delete:o,Edit:s,Plus:a,ArrowLeft:i,ArrowRight:t,DArrowLeft:{name:"DArrowLeft",template:'\n <svg viewBox="0 0 1024 1024" width="20" height="20" fill="currentColor">\n <path d="M529 747q9 8 21 8t21 -9t9 -21t-9 -21l-312 -320l312 -320q9 -9 9 -21.5t-9 -21t-21 -8.5t-21 8l-331 341q-9 10 -9 22.5t9 21.5zM785 747q9 8 21 8t21 -9t9 -21t-9 -21l-312 -320l312 -320q9 -9 9 -21.5t-9 -21t-21 -8.5t-21 8l-331 341q-9 10 -9 22.5t9 21.5z" transform="scale(1,-1) translate(0,-896)" />\n </svg>\n '},DArrowRight:{name:"DArrowRight",template:'\n <svg viewBox="0 0 1024 1024" width="20" height="20" fill="currentColor">\n <path d="M453 747q9 8 21 8t21 -8l331 -341q9 -9 9 -22t-9 -22l-331 -341q-9 -8 -21 -8t-21 9t-9 21t9 21l312 320l-312 320q-9 9 -9 21t9 22zM197 747q9 8 21 8t21 -8l331 -341q9 -9 9 -22t-9 -22l-331 -341q-9 -8 -21 -8t-21 9t-9 21t9 21l312 320l-312 320q-9 9 -9 21t9 22z" transform="scale(1,-1) translate(0,-896)" />\n </svg>\n '},Close:e},data:()=>({direction:"rtl",loading:!1,notes:[],types:window.fcAdmin.activity_types,pagination:{total:0,per_page:10,current_page:1},editing_note:{title:"",description:"",type:"note",created_at:""},is_editing_note:!1,search:"",showSearch:!1,updating:!1,is_changed:!1,note_syncing_fields:{},expandedNotes:{},targetedNoteId:null,bulkMode:!1,selectedNotes:[]}),computed:{allSelected(){return this.notes.length>0&&this.selectedNotes.length===this.notes.length},someSelected(){return this.selectedNotes.length>0&&this.selectedNotes.length<this.notes.length},page_sizes(){const e=[];this.pagination.per_page<10&&e.push(this.pagination.per_page);return[...e,10,20,50,80,100,120,150]}},watch:{"editing_note.type"(e,t){this.handleValueUpdate(e,t)},"editing_note.title"(e,t){this.handleValueUpdate(e,t)},"editing_note.description"(e,t){this.handleValueUpdate(e,t)},"editing_note.created_at"(e,t){this.handleValueUpdate(e,t)}},methods:{toggleNote(e){this.expandedNotes={...this.expandedNotes,[e]:!this.expandedNotes[e]}},toggleAllNotes(){const e=this.notes.every(e=>this.expandedNotes[e.id]),t={};this.notes.forEach(i=>{t[i.id]=!e}),this.expandedNotes=t},toggleBulkMode(){this.bulkMode=!this.bulkMode,this.bulkMode||(this.selectedNotes=[])},toggleNoteSelection(e){if(!this.bulkMode)return;const t=this.selectedNotes.indexOf(e);-1===t?this.selectedNotes.push(e):this.selectedNotes.splice(t,1)},toggleAllSelection(){this.bulkMode&&(this.allSelected?this.selectedNotes=[]:this.selectedNotes=this.notes.map(e=>e.id))},bulkDelete(){this.selectedNotes.length&&this.$confirm(this.$t("Are you sure you want to delete the selected notes? This action cannot be undone."),this.$t("Delete Notes"),{confirmButtonText:this.$t("Yes, Delete"),cancelButtonText:this.$t("Cancel"),type:"warning"}).then(()=>{this.loading=!0,this.$post(`companies/${this.company_id}/notes/bulk-delete`,{note_ids:this.selectedNotes}).then(e=>{this.$notify.success({title:this.$t("Done!"),message:e.message,offset:19}),this.selectedNotes=[],this.bulkMode=!1,this.fetch(),this.$emit("deleted",null)}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1})}).catch(()=>{})},getInitials:e=>e&&e.display_name?e.display_name.split(" ").map(e=>e[0]).join("").toUpperCase().substring(0,2):"A",handleSearchClear(){this.search="",this.showSearch=!1,this.fetch()},handleValueUpdate(e,t){e!==t&&(this.is_changed=!0)},handleClose(e){this.is_changed?this.$confirm(this.$t("You have unsaved data, proceed?")).then(t=>{this.is_changed=!1,this.is_editing_note=!1,this.resetNoteData(),e()}).catch(e=>{console.log(e)}):e()},cancelNote(){this.is_changed?this.$confirm(this.$t("You have unsaved data, proceed?")).then(e=>{this.is_changed=!1,this.is_editing_note=!1,this.resetNoteData()}).catch(e=>{console.log(e)}):(this.is_editing_note=!1,this.resetNoteData())},fetch(){this.loading=!0;const e={per_page:this.pagination.per_page,page:this.pagination.current_page,search:this.search},t=this.$route&&this.$route.query?this.$route.query.note_id:null;t&&1===this.pagination.current_page&&!this.search&&(e.include_id=t),this.$get(`companies/${this.company_id}/notes`,e).then(e=>{if(this.notes=e.notes.data,this.selectedNotes=[],this.pagination.total=e.notes.total,this.note_syncing_fields=e.fields,this.resetNoteData(),this.is_editing_note=!1,e.included_note&&this.notes.unshift(e.included_note),t){const e=parseInt(t);this.notes.some(t=>t.id===e)&&(this.expandedNotes={...this.expandedNotes,[e]:!0},this.targetedNoteId=e,this.$nextTick(()=>{const t=this.$el.querySelector('[data-note-id="'+e+'"]');t&&t.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{this.targetedNoteId=null},3e3)}))}}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1})},initAddNote(){this.resetNoteData(),this.is_changed=!1,this.is_editing_note=!0},resetNoteData(){this.editing_note={title:"",description:"",type:"note",created_at:""},this.is_changed=!1},saveNote(){this.$post(`companies/${this.company_id}/notes`,{note:this.editing_note}).then(e=>{this.$notify.success(e.message),this.fetch(),this.$emit("added",e.note),this.is_changed=!1,this.resetNoteData(),this.is_editing_note=!1}).catch(e=>{e.title&&this.$notify.error({title:this.$t("Error"),message:e.title.required}),e.description&&this.$notify.error({title:this.$t("Error"),message:e.description.required})}).finally(()=>{this.loading=!1})},remove(e){this.$del(`companies/${this.company_id}/notes/${e}`).then(t=>{this.fetch(),this.$notify.success({title:this.$t("Great!"),message:t.message,offset:19}),this.$emit("deleted",e)}).catch(e=>{this.handleError(e)})},editNote(e){this.editing_note=e,this.is_editing_note=!0},updateNote(){this.updating=!0,this.$put(`companies/${this.company_id}/notes/${this.editing_note.id}`,{note:this.editing_note}).then(e=>{this.$notify.success(e.message),this.is_changed=!1,this.is_editing_note=!1,this.resetNoteData(),this.fetch(),this.$emit("updated",e.note)}).catch(e=>{this.handleError(e)}).finally(()=>{this.updating=!1})},copyNoteLink(e){const t=window.location.href.split("#")[0]+"#/companies/"+this.company_id+"/activities?note_id="+e;V(t)&&this.$notify.success(this.$t("Copied to clipboard"))},exportNotes(){if(!this.has_campaign_pro)return this.$notify.error(this.$t("Notes export feature is only available on pro version")),!1;location.href=window.ajaxurl+"?"+jQuery.param({action:"fluentcrm_export_notes",route_prefix:"companies",subscriber_id:this.company_id})},formatTime(e){return e?window.fcAdmin&&window.fcAdmin.disable_time_diff?z(e).format(window.fcAdmin.wp_date_time_format):this.nsHumanDiffTime?this.nsHumanDiffTime(e):z(e).fromNow():""},changePerPage(e){this.pagination.per_page=e,this.pagination.current_page=1,this.fetch()},goToFirstPage(){this.pagination.current_page>1&&(this.pagination.current_page=1,this.fetch())},goToPrevPage(){this.pagination.current_page>1&&(this.pagination.current_page--,this.fetch())},goToNextPage(){const e=Math.ceil(this.pagination.total/this.pagination.per_page);this.pagination.current_page<e&&(this.pagination.current_page++,this.fetch())},goToLastPage(){const e=Math.ceil(this.pagination.total/this.pagination.per_page);this.pagination.current_page<e&&(this.pagination.current_page=e,this.fetch())}},mounted(){window.fcAdmin&&window.fcAdmin.is_rtl&&(this.direction="ltr"),this.fetch(),this.changeTitle(this.$t("Notes"))}},[["render",function(e,t,i,a,s,o){const n=m("Search"),l=d,z=r,T=m("Icons"),q=c,P=m("Download"),j=h,V=m("confirm"),B=m("icons"),E=p,Me=_,Ae=m("DArrowLeft"),Se=m("ArrowLeft"),ze=m("ArrowRight"),Te=m("DArrowRight"),qe=m("floating-bulk-action-shell"),Pe=m("form-builder"),je=g;return u(),f("div",I,[v("div",U,[v("div",F,[v("div",Y,[v("div",R,[v("h3",H,y(e.$t("Contacts Notes and Activity")),1)]),e.hasPermission("fcrm_manage_contacts")?(u(),f("div",K,[s.showSearch?(u(),f("div",Z,[k(z,{onKeyup:b(o.fetch,["enter"]),onClear:o.handleSearchClear,clearable:"",size:"small",placeholder:e.$t("Search"),modelValue:s.search,"onUpdate:modelValue":t[0]||(t[0]=e=>s.search=e)},{prefix:w(()=>[k(l,{class:"fcrm_act_search_icon"},{default:w(()=>[k(n)],void 0,!0),_:1})]),_:1},8,["onKeyup","onClear","placeholder","modelValue"])])):N("",!0),s.showSearch?N("",!0):(u(),C(q,{key:1,onClick:t[1]||(t[1]=e=>s.showSearch=!0),class:"only-icon-btn small",size:"small"},{default:w(()=>[v("span",O,[k(T,{"icon-name":"search"})])],void 0),_:1})),s.notes.length?(u(),C(q,{key:2,onClick:t[2]||(t[2]=e=>o.toggleAllNotes()),class:"only-icon-btn small",size:"small","aria-label":e.$t("Toggle all notes"),title:e.$t("Toggle all notes")},{default:w(()=>[...t[20]||(t[20]=[v("span",{class:"icon"},[v("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[v("path",{d:"M5 4L10 9L15 4M5 11L10 16L15 11",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)])],void 0),_:1},8,["aria-label","title"])):N("",!0),s.notes.length?(u(),C(q,{key:3,size:"small",class:$(["only-icon-btn small",{"is-active":s.bulkMode}]),onClick:t[3]||(t[3]=e=>o.toggleBulkMode()),"aria-label":e.$t("Select notes"),title:e.$t("Select notes")},{default:w(()=>[...t[21]||(t[21]=[v("span",{class:"icon"},[v("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[v("rect",{x:"3",y:"3",width:"6",height:"6",rx:"1",stroke:"currentColor","stroke-width":"1.5"}),v("rect",{x:"11",y:"3",width:"6",height:"6",rx:"1",stroke:"currentColor","stroke-width":"1.5"}),v("rect",{x:"3",y:"11",width:"6",height:"6",rx:"1",stroke:"currentColor","stroke-width":"1.5"}),v("path",{d:"M11 14L13 16L17 12",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)])],void 0),_:1},8,["class","aria-label","title"])):N("",!0),k(q,{onClick:t[4]||(t[4]=e=>o.exportNotes()),class:"only-icon-btn small",size:"small"},{default:w(()=>[k(l,null,{default:w(()=>[k(P)],void 0,!0),_:1})],void 0),_:1}),k(q,{onClick:t[5]||(t[5]=e=>o.initAddNote()),type:"primary",size:"small"},{default:w(()=>[v("span",Q,[k(T,{"icon-name":"plus"})]),x(" "+y(e.$t("Add Notes")),1)],void 0),_:1})])):N("",!0)])]),s.pagination.total?(u(),f("div",G,[(u(!0),f(L,null,D(s.notes,i=>(u(),f("div",{key:i.id,class:$(["fcrm_note_row",{"is-expanded":s.expandedNotes[i.id],"is-targeted":s.targetedNoteId===i.id}]),"data-note-id":i.id},[v("div",{class:"fcrm_note_header",onClick:e=>s.bulkMode?o.toggleNoteSelection(i.id):o.toggleNote(i.id)},[v("div",X,[s.bulkMode?(u(),C(j,{key:0,"model-value":s.selectedNotes.includes(i.id),onClick:M(e=>o.toggleNoteSelection(i.id),["stop"]),class:"fcrm_note_select_checkbox"},null,8,["model-value","onClick"])):N("",!0),t[23]||(t[23]=v("svg",{class:"fcrm_note_chevron",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[v("path",{d:"M10.4001 8L5.6001 12V4L10.4001 8Z",fill:"var(--fc-secondary-text)"})],-1)),v("div",ee,[i.added_by&&i.added_by.photo?(u(),f("img",{key:0,src:i.added_by.photo,alt:i.added_by.display_name},null,8,te)):(u(),f("span",ie,y(o.getInitials(i.added_by)),1))]),v("div",ae,[v("div",se,y(i.title||s.types[i.type]||i.type),1),v("div",oe,[i.added_by&&i.added_by.display_name?(u(),f("span",ne,y(i.added_by.display_name),1)):(u(),f("span",le,"Admin")),t[22]||(t[22]=v("span",{class:"fcrm_note_meta_dot"},"·",-1)),v("span",{title:i.created_at},y(o.formatTime(i.created_at)),9,de)])])]),v("div",re,[e.hasPermission("fcrm_manage_contacts")?(u(),f("div",{key:0,class:"fcrm_note_actions",onClick:t[6]||(t[6]=M(()=>{},["stop"]))},[k(q,{onClick:e=>o.copyNoteLink(i.id),size:"small",title:e.$t("Copy")},{default:w(()=>[...t[24]||(t[24]=[v("span",{class:"icon"},[v("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[v("path",{fill:"currentColor",d:"M5.993,12.781 C4.748,10.564 5.068,7.706 6.954,5.82 L9.82,2.954 C12.092,0.682 15.775,0.682 18.046,2.954 C20.318,5.225 20.318,8.908 18.046,11.18 L18.007,11.219 C19.252,13.436 18.932,16.294 17.046,18.18 L14.18,21.046 C11.908,23.318 8.225,23.318 5.954,21.046 C3.682,18.775 3.682,15.092 5.954,12.82 Z M10.881,4.014 L8.014,6.881 C6.329,8.566 6.329,11.3 8.014,12.986 C9.7,14.672 12.434,14.672 14.119,12.986 L14.326,12.779 L15.387,13.839 L15.18,14.046 C12.908,16.318 9.225,16.318 6.954,14.046 C6.937,14.029 6.92,14.012 6.904,13.995 C5.329,15.689 5.366,18.338 7.014,19.986 C8.7,21.671 11.434,21.671 13.119,19.986 L15.986,17.119 C17.671,15.434 17.671,12.7 15.986,11.014 C14.3,9.329 11.566,9.329 9.881,11.014 L9.674,11.221 L8.613,10.161 L8.82,9.954 C11.092,7.682 14.775,7.682 17.046,9.954 C17.063,9.971 17.08,9.987 17.096,10.005 C18.671,8.312 18.634,5.662 16.986,4.014 C15.3,2.329 12.566,2.329 10.881,4.014 Z"})])],-1)])],void 0),_:1},8,["onClick","title"]),k(q,{onClick:e=>o.editNote(i),size:"small","aria-label":e.$t("Edit")},{default:w(()=>[v("span",ce,[k(T,{"icon-name":"eye"})])],void 0),_:1},8,["onClick","aria-label"]),k(V,{onYes:e=>o.remove(i.id)},{reference:w(()=>[k(q,{size:"small","aria-label":e.$t("Delete")},{default:w(()=>[v("span",he,[k(T,{"icon-name":"delete"})])],void 0,!0),_:1},8,["aria-label"])]),_:1},8,["onYes"])])):N("",!0)])],8,W),A(v("div",{class:"fcrm_note_description",innerHTML:i.description},null,8,pe),[[S,s.expandedNotes[i.id]]])],10,J))),128))])):(u(),f("div",_e,[k(B,{"icon-name":"common-empty-state"}),v("div",ge,[v("span",null,y(e.$t("Pro_No_NfPatfn")),1)])])),s.pagination.total?(u(),f("div",me,[v("div",ue,[v("p",fe,y(e.$t("Page"))+" "+y(s.pagination.current_page)+" "+y(e.$t("of"))+" "+y(Math.ceil(s.pagination.total/s.pagination.per_page)),1),k(Me,{modelValue:s.pagination.per_page,"onUpdate:modelValue":t[7]||(t[7]=e=>s.pagination.per_page=e),class:"fcrm_pg_per_page",onChange:o.changePerPage,size:"small","popper-class":"fcrm_pg_popper"},{default:w(()=>[(u(!0),f(L,null,D(o.page_sizes,t=>(u(),C(E,{key:t,label:`${t} / ${e.$t("page")}`,value:t},null,8,["label","value"]))),128))],void 0),_:1},8,["modelValue","onChange"])]),v("div",ve,[k(q,{onClick:t[8]||(t[8]=e=>o.goToFirstPage()),disabled:1===s.pagination.current_page,class:"fcrm_pg_btn",size:"small"},{default:w(()=>[k(l,null,{default:w(()=>[k(Ae)],void 0,!0),_:1})],void 0),_:1},8,["disabled"]),k(q,{onClick:t[9]||(t[9]=e=>o.goToPrevPage()),disabled:1===s.pagination.current_page,class:"fcrm_pg_btn",size:"small"},{default:w(()=>[k(l,null,{default:w(()=>[k(Se)],void 0,!0),_:1})],void 0),_:1},8,["disabled"]),v("div",ye,[v("span",ke,y(s.pagination.current_page),1)]),k(q,{onClick:t[10]||(t[10]=e=>o.goToNextPage()),disabled:s.pagination.current_page>=Math.ceil(s.pagination.total/s.pagination.per_page),class:"fcrm_pg_btn",size:"small"},{default:w(()=>[k(l,null,{default:w(()=>[k(ze)],void 0,!0),_:1})],void 0),_:1},8,["disabled"]),k(q,{onClick:t[11]||(t[11]=e=>o.goToLastPage()),disabled:s.pagination.current_page>=Math.ceil(s.pagination.total/s.pagination.per_page),class:"fcrm_pg_btn",size:"small"},{default:w(()=>[k(l,null,{default:w(()=>[k(Te)],void 0,!0),_:1})],void 0),_:1},8,["disabled"])])])):N("",!0)]),k(qe,{visible:s.bulkMode,"custom-layout":!0},{default:w(()=>[v("div",we,[v("div",be,[k(q,{link:"","aria-label":e.$t("Deselect"),onClick:t[12]||(t[12]=e=>o.toggleBulkMode())},{default:w(()=>[v("span",Ne,[k(T,{"icon-name":"close"})])],void 0,!0),_:1},8,["aria-label"]),v("span",Ce,[v("strong",null,y(s.selectedNotes.length),1),x(" "+y(e.$t("selected")),1)]),t[25]||(t[25]=v("div",{class:"fcrm_bulk_divider"},null,-1)),k(j,{"model-value":o.allSelected,indeterminate:o.someSelected,onChange:t[13]||(t[13]=e=>o.toggleAllSelection())},{default:w(()=>[x(y(e.$t("Select all")),1)],void 0,!0),_:1},8,["model-value","indeterminate"]),s.selectedNotes.length?(u(),f("div",$e)):N("",!0),s.selectedNotes.length?(u(),C(q,{key:1,size:"small",type:"danger",plain:"",onClick:t[14]||(t[14]=e=>o.bulkDelete())},{default:w(()=>[v("span",xe,[k(T,{"icon-name":"delete"})]),x(" "+y(e.$t("Delete selected")),1)],void 0,!0),_:1})):N("",!0)])])],void 0),_:1},8,["visible"]),k(je,{direction:s.direction,class:"fcrm_note_drawer","with-header":!0,size:e.globalDrawerSize,"append-to-body":!0,"before-close":o.handleClose,title:s.editing_note.id?e.$t("Edit Note"):e.$t("Create a note"),onClose:t[18]||(t[18]=e=>o.cancelNote()),modelValue:s.is_editing_note,"onUpdate:modelValue":t[19]||(t[19]=e=>s.is_editing_note=e)},{footer:w(()=>[v("div",De,[k(q,{onClick:t[15]||(t[15]=e=>o.cancelNote())},{default:w(()=>[x(y(e.$t("Cancel")),1)],void 0,!0),_:1}),s.editing_note.id?(u(),C(q,{key:0,onClick:t[16]||(t[16]=e=>o.updateNote()),type:"primary",loading:s.updating},{default:w(()=>[x(y(e.$t("Update Note")),1)],void 0,!0),_:1},8,["loading"])):(u(),C(q,{key:1,onClick:t[17]||(t[17]=e=>o.saveNote()),type:"primary",loading:s.loading},{default:w(()=>[x(y(e.$t("Create")),1)],void 0,!0),_:1},8,["loading"]))])]),default:w(()=>[s.is_editing_note?(u(),f("div",{key:0,class:$(["fcrm_note_type_"+s.editing_note.type,"fcrm_drawer_content"])},[v("div",Le,[k(Pe,{formData:s.editing_note,fields:s.note_syncing_fields.fields},null,8,["formData","fields"])])],2)):N("",!0)],void 0),_:1},8,["direction","size","before-close","title","modelValue"])])}]]);export{Me as default};
|