import{a as q,w as R,h as y,bq as h,j as o,x as c,bs as $,br as v,ba as G,bt as L,aU as M,bd as W,be as J,bu as P,bv as Q,b0 as X,aq as Y,a$ as Z,b9 as _}from"./main-40.js";import{B}from"./bf-928-114.js";import{S as V}from"./bf-175-110.js";import{e as tt}from"./bf-95-84.js";import{b as T}from"./bf-142-111.js";import"./bf-586-70.js";import"./bf-141-80.js";import"./bf-755-109.js";import"./bf-613-108.js";import"./bf-376-112.js";import"./bf-547-83.js";import"./bf-683-113.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 gt({objectPaths:d,id:x}){const{css:l}=q(),{"*":j}=R(),[k,F]=y(X),[H,z]=y(Y),[D,K]=y(Z),[E,I]=j.split("/"),p=e=>_(e,{themeVars:k,styles:H,themeColors:D}),u=e=>h(p(e.object),G(p(e.object),e.path)),i=[];if(Array.isArray(d))d.forEach(e=>{const{paths:s,object:n}=e;Object.keys(e.paths).forEach(r=>{i[r]={object:n,path:s[r]}})});else{const{paths:e,object:s}=d;Object.keys(e).forEach(a=>{i[a]={object:s,path:e[a]}})}const t={"outline-color":"","outline-width":"","outline-offset":"","outline-style":""},f=Object.keys(i);for(let e=0;e<f.length;e+=1){const s=f[e];if(f.length===2&&s==="outline"){const n=u(i[s]),a=n==null?void 0:n.split(/(?!\(.*)\s(?![^(]*?\))/g);t["outline-width"]=h(i[s],a[0])||"",t["outline-style"]=h(i[s],a[1])||"",t["outline-color"]=h(i[s],a[2])||"";break}s!=="outline-offset"&&(t[s]=u(i[s]))}t["outline-offset"]=u(i["outline-offset"]);const g=(e,s)=>{if(e==="outline-width")return s||"0px";if(e==="outline-style")return s||"solid";if(e==="outline-color")return s||"hsla(0, 0%, 0%, 0.5)"},w=(e,s)=>{var C;let n,a=s;if(f.length===2&&Object.keys(i).includes("outline")&&s!=="outline-offset"){a="outline";const A=st(u(i.outline));n=Object.entries(A).map(([S,U])=>S===s?g(s,e):g(S,U)).join(" ")}Object.keys(i).includes("outline-offset")&&s==="outline-offset"&&(n=e);const{object:r,path:O}=i[a];n=((C=u(i[a]))==null?void 0:C.indexOf("!important"))>=0?`${e} !important`:n,L(r,O,n,{setThemeVars:F,setThemeColors:K,setStyles:z}),M(W(E,I,a,n,{[r]:J(r)}))},m=({unit:e,value:s,prop:n,oldVal:a})=>{if(s){const r=v(a),N=`${P(e,s,r)}${e||"px"}`;w(N,n)}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:l(c.flxcb,c.mb2,{w:200}),children:[o.jsx("span",{className:l(c.fs12,c.fw500),children:"Type"}),o.jsx(tt,{options:et,value:t==null?void 0:t["outline-style"],onChange:e=>w(e,"outline-style"),w:130,h:30,id:`${x}-style`})]}),o.jsxs("div",{className:l(c.flxcb,c.mb2,{w:200}),children:[o.jsx("span",{className:l(c.fs12,c.fs12,c.fw500),children:"Color"}),o.jsx(V,{action:{onChange:e=>w(e,"outline-color")},value:t==null?void 0:t["outline-color"]})]}),o.jsx("div",{className:l(c.mb2,{w:200}),children:o.jsxs("div",{className:l(b.titleContainer),children:[o.jsx("span",{className:l(b.title),children:"Width"}),o.jsx("span",{className:l(c.flxc)}),o.jsx("div",{className:l({p:2}),children:o.jsx(T,{min:"0",inputHandler:({unit:e,value:s})=>m({unit:e,value:s,prop:"outline-width"}),sizeHandler:({unitKey:e,unitValue:s})=>m({value:s,unit:e,prop:"outline-width",oldVal:t==null?void 0:t["outline-width"]}),id:"0",label:o.jsx(B,{size:14}),value:(t==null?void 0:t["outline-width"])&&$(t==null?void 0:t["outline-width"]),unit:(t==null?void 0:t["outline-width"])&&v(t==null?void 0:t["outline-width"]),options:["px","em","rem","%"],width:"128px",dataTestId:"outline-width-control"})})]})}),o.jsx("div",{className:l(c.mb2,{w:200}),children:o.jsxs("div",{className:l(b.titleContainer),children:[o.jsx("span",{className:l(b.title),children:"Offset"}),o.jsx("span",{className:l(c.flxc)}),o.jsx("div",{className:l({p:2}),children:o.jsx(T,{min:"0",inputHandler:({value:e,unit:s})=>m({value:e,unit:s,prop:"outline-offset"}),sizeHandler:({unitKey:e,unitValue:s})=>m({value:s,unit:e,prop:"outline-offset",oldVal:t==null?void 0:t["outline-offset"]}),id:"0",label:o.jsx(B,{size:14}),value:(t==null?void 0:t["outline-offset"])&&$(t==null?void 0:t["outline-offset"]),unit:(t==null?void 0:t["outline-offset"])&&v(t==null?void 0:t["outline-offset"]),options:["px","em","rem","%"],width:"128px",dataTestId:"outline-width-control"})})]})})]})}const b={titleContainer:{flx:"center-between"},title:{fs:12,fw:500}},et=[{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"}],st=d=>{const[x,l,j]=Q(d);return{"outline-width":x,"outline-style":l,"outline-color":j}};export{gt as default};
