import{r as u,g as C,aq as E,j as e,a as K,i as q,A as S,_ as d,U as z,bm as B,M as b,aV as U,aF as V,I as G,f as h,bD as x}from"./main-343.js";import"./bf-649-79.js";import{F as J,t as y}from"./bf-689-322.js";import{F as l}from"./bf-838-284.js";import{a as R}from"./bf-603-251.js";import{F as Q,a as W,S as X,A as Y,b as Z,H as D,c as ee,E as te}from"./bf-622-233.js";import{F as n,I as se}from"./bf-505-323.js";import{R as ie}from"./bf-276-389.js";import{S as oe}from"./bf-711-253.js";import"./bf-697-110.js";import"./bf-90-70.js";import"./bf-594-113.js";import"./bf-983-247.js";import"./bf-810-248.js";import"./bf-914-249.js";import"./bf-870-250.js";import"./bf-411-252.js";import"./bf-901-254.js";import"./bf-656-255.js";import"./bf-806-256.js";import"./bf-519-87.js";import"./bf-190-88.js";import"./bf-318-257.js";import"./bf-437-78.js";import"./bf-123-272.js";import"./bf-453-86.js";import"./bf-772-285.js";import"./bf-209-80.js";import"./bf-529-105.js";import"./bf-730-282.js";import"./bf-623-283.js";import"./bf-498-326.js";import"./bf-794-390.js";function le(){const{fieldKey:t}=C(),O=E(U),[F,f]=u.useState(!1);if(!t)return e.jsx(e.Fragment,{children:"No field exist with this field key"});const{css:r}=K(),[m,v]=q(V),[j,w]=u.useState(!1),s=S(m[t]),L=S(m[t].opt),_=(s==null?void 0:s.showReviewLblOnHover)||!1,M=(s==null?void 0:s.showReviewLblOnSelect)||!1,P=s.adminLbl||"",N=(s==null?void 0:s.ratingPos)||"start",I=[{name:d("Left"),value:"start"},{name:d("Center"),value:"center"},{name:d("Right"),value:"end"}],H=()=>{w(!0)},$=i=>{if(!G)return;const o=h(m,a=>{a[t].opt=i});v(o),x({event:`Modify Option: ${s.lbl||P||t}`,type:"modify_options_list",state:{fields:o,fldKey:t}})},k=({target:i})=>{const{checked:o}=i,a=h(m,p=>{const c=p[t];o?c.showReviewLblOnHover=!0:c.showReviewLblOnHover=!1}),g=o?"show":"hide";v(a),x({event:`Review Label ${g}`,type:"review_lbl_show_hide",state:{fields:a,fldKey:t}})},T=({target:i})=>{const{checked:o}=i,a=h(m,p=>{const c=p[t];o?c.showReviewLblOnSelect=!0:c.showReviewLblOnSelect=!1}),g=o?"show":"hide";v(a),x({event:`Review Label ${g}`,type:"review_lbl_show_hovsr_hide",state:{fields:a,fldKey:t}})},A=({target:i})=>{const{value:o}=i,a=h(m,p=>{p[t].ratingPos=o});O(p=>h(p,c=>{c.fields[t].classes[`.${t}-inp-fld-wrp`]["justify-content"]=o,o==="end"?c.fields[t].classes[`.${t}-inp-fld-wrp`]["flex-direction"]="row-reverse":delete c.fields[t].classes[`.${t}-inp-fld-wrp`]["flex-direction"]}));const g=o;v(a),x({event:`Review start position change to ${g}`,type:"review_start_pos",state:{fields:a,fldKey:t}})};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"",children:[e.jsx(Q,{title:"Field Settings",subtitle:s.typ,fieldKey:t}),e.jsx(W,{}),e.jsx(n,{}),e.jsx(X,{}),e.jsx(n,{}),e.jsx(Y,{}),e.jsx(n,{}),e.jsx(Z,{}),e.jsx(n,{}),e.jsx(oe,{id:"rating-algn",title:d("Rating Position"),className:r(l.fieldSection),isPro:!0,children:e.jsx("div",{className:r(l.placeholder),children:e.jsx("select",{"data-testid":"rating-algn-slct",className:r(l.input),name:"",id:"",value:N,onChange:A,children:I.map(i=>e.jsx("option",{value:i.value,children:i.name},`btcd-k-${i.name}`))})})}),e.jsx(n,{}),e.jsx("div",{className:r(l.fieldSection,l.hover_tip,l.singleOption,{fw:700}),children:e.jsx(J,{label:"Rating Icon",iconSrc:s.opt[0].img,styleRoute:"rating-img",setIcon:()=>f(!0),isPro:!0,proProperty:"ratingIcon"})}),e.jsx(n,{}),e.jsx("div",{className:r(l.fieldSection),children:e.jsxs(z,{dataTestId:"edt-opt-stng",variant:"primary-outline",size:"sm",className:r({mt:10}),onClick:H,children:[d("Add/Edit Rating Options"),e.jsx("span",{className:r(ne.plsIcn),children:e.jsx(B,{size:"13",stroke:"3"})})]})}),e.jsx(n,{}),e.jsx("div",{className:r(l.fieldSection,l.hover_tip,l.singleOption),children:e.jsx(R,{id:"fld-rating-lbl-hover",tip:y.ratingLbl,title:d("Show Rating Message On hover"),action:k,isChecked:_,isPro:!0,proProperty:"ratingMsgOnHover"})}),e.jsx(n,{}),e.jsx("div",{className:r(l.fieldSection,l.hover_tip,l.singleOption),children:e.jsx(R,{id:"fld-rating-lbl-select",tip:y.ratingSelectTip,title:d("Show Rating Message On Selected"),action:T,isChecked:M,isPro:!0,proProperty:"ratingMsgOnSelect"})}),e.jsx(n,{}),e.jsx(D,{}),e.jsx(n,{}),e.jsx(ie,{}),e.jsx(n,{}),e.jsx(ee,{}),e.jsx(n,{})]}),e.jsx(b,{md:!0,autoHeight:!0,show:j,setModal:()=>w(!1),className:"o-v ",title:d("Options"),width:"740px",children:e.jsx("div",{className:"pos-rel",children:e.jsx(te,{optionMdl:j,options:L,setOptions:i=>$(i),lblKey:"lbl",valKey:"val",imgKey:"img",isRating:s.typ,type:"rating",showUpload:!0,onlyVisualOptionsTab:!0,isPro:!0})})}),e.jsxs(b,{md:!0,autoHeight:!0,show:F,setModal:f,className:"o-v",title:d("Icons"),children:[e.jsx("div",{className:"pos-rel"}),e.jsx(se,{iconType:"opt",setModal:f})]})]})}var Ke=u.memo(le);const ne={dotBtn:{b:0,brs:5,mr:15,curp:1},button:{dy:"block",w:"100%",ta:"left",b:0,bd:"none",p:3,curp:1,"&:hover":{bd:"var(--white-0-95)",cr:"var(--black-0)",brs:8},fs:11},plsIcn:{ml:8,mt:3,tm:"rotate(45deg)"}};export{Ke as default};
