import{a as Y,w as Z,h as O,d6 as _,da as A,j as o,bq as y,ba as n,x as t,b9 as ee,bt as re,g as oe,aU as te,bd as se,be as ae,b0 as le,aq as de,a$ as ie}from"./main-40.js";import{e as ne,m as E}from"./bf-95-84.js";import{S as be}from"./bf-175-110.js";import"./bf-586-70.js";import"./bf-141-80.js";import"./bf-613-108.js";import"./bf-755-109.js";import"./bf-142-111.js";import"./bf-376-112.js";import"./bf-547-83.js";import"./bf-683-113.js";import"./bf-928-114.js";import"./bf-232-115.js";import"./bf-236-125.js";import"./bf-642-124.js";import"./bf-829-79.js";import"./bf-285-116.js";import"./bf-695-117.js";import"./bf-866-72.js";function De({objectPaths:s,hslaPaths:R,id:v}){var B;const{css:l}=Y(),{"*":F}=Z(),[b,I]=O(le),[m,k]=O(de),[V,$]=O(ie),[q,c,p]=F.split("/"),T=(B=m==null?void 0:m.fields)==null?void 0:B[p],W=_(c==="multi-step"?p:c,p);let a;try{if(!T&&q==="theme-customize")a=A[W].properties.border;else{const{fieldType:e}=T;a=A[e][W].properties.border}}catch(e){return console.log(e.message),console.error(`😅 no style object found according to this field "${c}"`),o.jsx(o.Fragment,{})}const w=Object.keys(a),i=e=>ee(e,{themeVars:b,styles:m,themeColors:V});let u,h,x,g;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,u=e.paths[w[0]],h=d.paths["border-color"],x=e.paths["border-width"],g=e.paths["border-radius"]}else{const{paths:e}=s;u=e[w[0]],h=e["border-color"],x=e["border-width"],g=e["border-radius"],r.border=s.object,r.borderColor=s.object,r.borderWidth=s.object,r.borderRadius=s.object}const H=y(b,n(i(r.border),u)),N=y(V,n(i(r.borderColor),h)),P=y(b,n(i(r.borderWidth),x)),U=y(b,n(i(r.borderRadius),g)),C=(e,d,S,G)=>{var K;const D=((K=n(i(e),d))==null?void 0:K.indexOf("!important"))>=0?`${S} !important`:S;if(re(e,d,D,{setThemeVars:I,setThemeColors:$,setStyles:k}),G==="borderColor"&&R){const j=S.match(/[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)/gi),{h:L,s:M,l:J,a:Q}=R;$(X=>oe(X,f=>{f[L]=j[0],f[M]=j[1],f[J]=j[2],f[Q]=j[3]}))}te(se(c,p,d,D,{[e]:ae(e)}))},z=[{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:z,value:H.replace("!important","").trim(),onChange:e=>C(r.border,u,e),w:130,h:30,id:`${v}-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,h,e,"borderColor")},value:N})]}),a["border-width"]&&o.jsx(E,{value:P,className:l(t.mb2),onChange:e=>C(r.borderWidth,x,e),title:"Width",unitOption:["px","em","rem"],min:"0",max:"10",width:"128px",dataTestId:`${v}-wdth`}),a["border-radius"]&&o.jsx(E,{value:U,className:l(t.mb2),onChange:e=>C(r.borderRadius,g,e),title:"Radius",unitOption:["px","em","rem","%"],min:"0",max:"20",width:"128px",dataTestId:`${v}-rdus`,radius:!0})]})}export{De as default};
