import{a as Y,g as Z,i as V,dQ as _,dU as K,j as o,cA as f,l as n,h as t,cp as ee,cD as re,f as oe,bD as te,cr as se,cs as ae,ch as le,aV as de,cg as ie}from"./main-343.js";import{c as ne}from"./bf-711-253.js";import{S as be}from"./bf-914-249.js";import{h as E}from"./bf-697-110.js";import"./bf-453-86.js";import"./bf-649-79.js";import"./bf-190-88.js";import"./bf-603-251.js";import"./bf-519-87.js";import"./bf-90-70.js";import"./bf-594-113.js";import"./bf-810-248.js";import"./bf-870-250.js";import"./bf-983-247.js";import"./bf-411-252.js";import"./bf-901-254.js";import"./bf-656-255.js";import"./bf-806-256.js";import"./bf-318-257.js";import"./bf-437-78.js";function Ae({objectPaths:s,hslaPaths:O,id:y}){var D;const{css:l}=Y(),{"*":F}=Z(),[b,I]=V(le),[m,k]=V(de),[R,$]=V(ie),[H,v,c]=F.split("/"),T=(D=m==null?void 0:m.fields)==null?void 0:D[c],W=_(v==="multi-step"?c:v,c);let a;try{if(!T&&H==="theme-customize")a=K[W].properties.border;else{const{fieldType:e}=T;a=K[e][W].properties.border}}catch(e){return o.jsx(o.Fragment,{})}const w=Object.keys(a),i=e=>ee(e,{themeVars:b,styles:m,themeColors:R});let p,u,h,x;const r={border:"",borderColor:"",borderWidth:"",borderRadius:""};if(Array.isArray(s)){const[e,d]=s;r.border=e.object,r.borderColor=d.object,r.borderWidth=e.object,r.borderRadius=e.object,p=e.paths[w[0]],u=d.paths["border-color"],h=e.paths["border-width"],x=e.paths["border-radius"]}else{const{paths:e}=s;p=e[w[0]],u=e["border-color"],h=e["border-width"],x=e["border-radius"],r.border=s.object,r.borderColor=s.object,r.borderWidth=s.object,r.borderRadius=s.object}const N=f(b,n(i(r.border),p)),P=f(R,n(i(r.borderColor),u)),U=f(b,n(i(r.borderWidth),h)),z=f(b,n(i(r.borderRadius),x)),C=(e,d,S,L)=>{var A;const B=((A=n(i(e),d))==null?void 0:A.indexOf("!important"))>=0?`${S} !important`:S;if(re(e,d,B,{setThemeVars:I,setThemeColors:$,setStyles:k}),L==="borderColor"&&O){const g=S.match(/[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)/gi),{h:M,s:Q,l:q,a:J}=O;$(X=>oe(X,j=>{j[M]=g[0],j[Q]=`${g[1]}%`,j[q]=`${g[2]}%`,j[J]=`${g[3]}%`}))}te(se(v,c,d,B,{[e]:ae(e)}))},G=[{label:"Solid",value:"solid"},{label:"Dashed",value:"dashed"},{label:"Dotted",value:"dotted"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"},{label:"None",value:"none"}];return o.jsxs(o.Fragment,{children:[a[w[0]]&&o.jsxs("div",{className:l(t.flxcb,t.mb2),children:[o.jsx("span",{className:l(t.fs12,t.fw500),children:"Type"}),o.jsx(ne,{options:G,value:N.replace("!important","").trim(),onChange:e=>C(r.border,p,e),w:130,h:30,id:`${y}-style`})]}),a["border-color"]&&o.jsxs("div",{className:l(t.flxcb,t.mb2),children:[o.jsx("span",{className:l(t.fs12,t.fs12,t.fw500),children:"Color"}),o.jsx(be,{action:{onChange:e=>C(r.borderColor,u,e,"borderColor")},value:P})]}),a["border-width"]&&o.jsx(E,{value:U,className:l(t.mb2),onChange:e=>C(r.borderWidth,h,e),title:"Width",unitOption:["px","em","rem"],min:"0",max:"10",width:"128px",dataTestId:`${y}-wdth`}),a["border-radius"]&&o.jsx(E,{value:z,className:l(t.mb2),onChange:e=>C(r.borderRadius,x,e),title:"Radius",unitOption:["px","em","rem","%"],min:"0",max:"20",width:"128px",dataTestId:`${y}-rdus`,radius:!0})]})}export{Ae as default};
