| Server IP : 52.25.153.185 / Your IP : 216.73.216.222 Web Server : Apache System : Linux ip-172-26-6-158 5.10.0-45-cloud-amd64 #1 SMP Debian 5.10.259-1 (2026-07-02) x86_64 User : daemon ( 1) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/fluent-crm/assets/ |
Upload File : |
import{aw as e,aF as t,a_ as i,ar as s,Q as l,aL as a}from"./vendor-element-plus.js?ver=3.2.0";import{Y as o,a2 as d,a5 as n,aa as r,Z as p,a4 as m,P as h,aA as c,ae as f,ac as _,a3 as u,ad as y,a7 as w}from"./vendor.js?ver=3.2.0";import{_ as g}from"./fc-bits-ui.js?ver=3.2.0";const v={class:"w-full"},V=["textContent"],b={class:"fcrm_option_selector d-flex items-center gap-8"},k={key:0,class:"fcrm_field_inline_help"};const $=g({name:"OptionSelector",props:["modelValue","field","placement","effect","popper_class"],emits:["element_ready","renew_options","update:modelValue"],data(){return{options:{},model:this.modelValue&&Array.isArray(this.modelValue)?this.modelValue.map(String):this.modelValue,element_ready:!1,new_item:"",creating:!1,isInternalUpdate:!1}},watch:{model(e){this.isInternalUpdate||this.$emit("update:modelValue",e)},modelValue(e){const t=e&&Array.isArray(e)?e.map(String):e;JSON.stringify(this.model)!==JSON.stringify(t)&&(this.isInternalUpdate=!0,this.model=t,this.$nextTick(()=>{this.isInternalUpdate=!1}))}},methods:{getOptions(){this.app_ready=!1;const e={fields:"editable_statuses,"+this.field.option_key};this.$get("reports/options",e).then(e=>{window.fc_options_cache=e.options,this.options=e.options,this.element_ready=!0,this.$emit("element_ready")}).catch(e=>{this.handleError(e)}).finally(()=>{})},createNewItem(){if(this.creating=!0,!this.new_item.length)return this.$notify.error("Provide name Field is required"),!1;this.$post(this.field.option_key+"/bulk",{items:[{title:this.new_item}]}).then(e=>{this.$notify.success(e.message),this.getOptions(),e.ids&&e.ids[0]&&(this.field.is_multiple?this.model=[...this.model,String(e.ids[0])]:this.model=String(e.ids[0])),this.new_item="","tags"==this.field.option_key?this.$bus.emit("renew_options","tag"):"lists"==this.field.option_key&&this.$bus.emit("renew_options","list")}).catch(e=>{this.handleError(e)}).finally(()=>{this.creating=!1})}},mounted(){this.field.is_multiple&&"object"!=typeof this.modelValue&&(this.model=[]),"tags"==this.field.option_key?(this.options[this.field.option_key]=this.appVars.available_tags,this.element_ready=!0,this.$emit("element_ready")):"lists"==this.field.option_key?(this.options[this.field.option_key]=this.appVars.available_lists,this.element_ready=!0,this.$emit("element_ready")):window.fc_options_cache&&window.fc_options_cache[this.field.option_key]?(this.options=window.fc_options_cache,this.element_ready=!0,this.$emit("element_ready")):this.getOptions()}},[["render",function(g,$,x,S,I,O){const A=t,H=i,N=s,U=l,j=a,C=e;return o(),d("div",v,[n("div",{class:w(["fcrm_options_selector",x.field.creatable?"fcrm_option_creatable":""])},[r((o(),p(H,{disabled:x.field.disabled,size:x.field.size,modelValue:I.model,"onUpdate:modelValue":$[0]||($[0]=e=>I.model=e),class:"fcrm_options","value-key":"id",multiple:x.field.is_multiple,placeholder:x.field.placeholder,clearable:"",filterable:"",effect:x.effect||x.field.effect,"popper-class":x.popper_class||x.field.popper_class||x.field.popperClass,teleported:!1!==x.field.teleported},{default:m(()=>[I.element_ready?(o(!0),d(h,{key:0},c(I.options[x.field.option_key],e=>(o(),p(A,{key:e.id,value:Number.isInteger(e.id)?String(e.id):e.id,label:e.title},{default:m(()=>[n("span",{textContent:f(e.title)},null,8,V)],void 0,!0),_:2},1032,["value","label"]))),128)):_("",!0)],void 0),_:1},8,["disabled","size","modelValue","multiple","placeholder","effect","popper-class","teleported"])),[[C,!I.element_ready]]),x.field.creatable&&!x.field.disabled?(o(),p(j,{key:0,placement:x.placement?x.placement:"left",width:250,trigger:"click"},{reference:m(()=>[u(U,{class:"fcrm_with_select",type:"info"},{default:m(()=>[...$[3]||($[3]=[n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[n("path",{d:"M9.25 9.25V4.75H10.75V9.25H15.25V10.75H10.75V15.25H9.25V10.75H4.75V9.25H9.25Z",fill:"var(--fc-secondary-text)"})],-1)])],void 0,!0),_:1})]),default:m(()=>[n("div",b,[u(N,{placeholder:g.$t("Provide Name"),modelValue:I.new_item,"onUpdate:modelValue":$[1]||($[1]=e=>I.new_item=e)},null,8,["placeholder","modelValue"]),u(U,{onClick:$[2]||($[2]=e=>O.createNewItem()),type:"primary"},{default:m(()=>[y(f(g.$t("Add")),1)],void 0,!0),_:1})])],void 0),_:1},8,["placement"])):_("",!0)],2),x.field.inline_help?(o(),d("span",k,f(x.field.inline_help),1)):_("",!0)])}]]);export{$ as O};