1import{_ as M}from"./C0Ya_OBV.js";import{_ as X}from"./DvOdQEDA.js";import{q as G}from"./CQYBuK0D.js";import{t as J,d as _}from"./CEp89hE0.js";import{i as Q}from"./zCJagV37.js";import{b as q}from"./DWCBBslP.js";import{r as Y,V as Z,W as ee,x as te,a7 as oe,o as s,c as a,a as f,A as e,a4 as i,B as r,t as h,a8 as y,z as g,ah as E,af as $,C as k,b as w,w as F,a9 as K,F as se,y as ae,I as m,aW as le,av as j,aC as ie}from"./E4wIjeAY.js";import"./Dx8Jabvz.js";import"./Bp8qykg5.js";import"./DxyaNNSA.js";import"./Bc-0F0ao.js";import"./CmwXoQr8.js";import"./CeT11JyB.js";const re={class:"relative flex w-full flex-col items-start gap-1"},ne={key:0,class:"flex w-full items-end justify-between gap-4"},ue={key:0,class:"flex gap-1 whitespace-nowrap text-vs font-medium text-gray-900"},de=["title"],ce=["disabled"],me={key:0},pe=["disabled"],fe={class:"truncate text-sm"},be={key:0,class:"p-4 pb-0"},ve=["onClick"],he={key:2,class:"p-4"},ye={class:"text-sm text-gray-400"},Fe=Y({__name:"IconField",props:{modelValue:{},options:{},fieldKey:{},errors:{},disabled:{type:Boolean},ignoreAutofocus:{type:Boolean}},emits:["update:modelValue"],async setup(t,{emit:z}){let V,C;const u=t,I=z,A=J(),b=m([]),D=m(),d=m([]),x=Object.fromEntries(Object.entries(Q).map(([l,o])=>[l,o==null?void 0:o()])),B=m(""),p=m(!1),c=m(""),N=_.InputError(),R=_.Popup();[V,C]=Z(()=>ee("pruvious-dashboard")),await V,C(),te(()=>u.options,()=>{b.value=G.filter(l=>{let o=!0;return j(u.options.allow)&&(o=u.options.allow.includes(l)),o&&j(u.options.exclude)&&(o=!u.options.exclude.includes(l)),o}).map(l=>({name:l,label:ie(l,!1)})),d.value=b.value},{immediate:!0});function T(l){I("update:modelValue",l)}function P(){d.value=le(b.value,c.value,"label")}function O(){I("update:modelValue",null)}function U(){B.value=u.modelValue?i("pruvious-dashboard","Change icon"):i("pruvious-dashboard","Select icon"),p.value=!0,c.value="",P()}function W(){p.value=!1}return(l,o)=>{const H=M,L=X,v=oe("pruvious-tooltip");return s(),a("div",null,[f("div",re,[t.options.label||t.options.description?(s(),a("div",ne,[t.options.label?(s(),a("div",ue,[t.options.required?(s(),a("span",{key:0,title:e(i)("pruvious-dashboard","Required"),
1class:"text-red-500"},"*",8,de)):r("",!0),f("span",null,h(e(i)("pruvious-dashboard",t.options.label)),1)])):r("",!0),t.options.description?y((s(),g(H,{key:1,class:"mb-0.5 h-4 w-4 shrink-0 text-gray-400"},null,512)),[[v,e(i)("pruvious-dashboard",t.options.description)]]):r("",!0)])):r("",!0),f("div",{ref_key:"containerEl",ref:D,class:"relative flex w-full gap-1.5"},[y((s(),a("button",{disabled:t.disabled,onClick:o[0]||(o[0]=n=>U()),type:"button",class:$(["button button-white",{"button-square after:absolute after:inset-0 after:bg-gray-900 after:opacity-0 after:transition hover:after:opacity-50":t.modelValue}]),style:E({backgroundImage:t.modelValue?`url(${e(q)})`:void 0})},[t.modelValue?r("",!0):(s(),a("span",me,h(e(i)("pruvious-dashboard","Select icon")),1)),t.modelValue&&e(x)[t.modelValue]?(s(),g(k(e(x)[t.modelValue]),{key:1,class:"relative z-10 h-4 w-4"})):r("",!0)],14,ce)),[[v,t.modelValue?e(i)("pruvious-dashboard","Change"):void 0]]),t.modelValue?y((s(),a("button",{key:0,disabled:t.disabled,onClick:o[1]||(o[1]=n=>O()),type:"button",class:"button button-white-red button-square"},[w(L)],8,pe)),[[v,e(i)("pruvious-dashboard","Remove")]]):r("",!0)],512),w(e(N),{errors:t.errors,fieldKey:t.fieldKey},null,8,["errors","fieldKey"])]),w(e(R),{visible:e(p),"onUpdate:visible":o[4]||(o[4]=n=>K(p)?p.value=n:null)},{header:F(()=>[f("h2",fe,h(e(B)),1)]),default:F(()=>[e(b).length?(s(),a("div",be,[(s(),g(k(e(A)),{modelValue:e(c),"onUpdate:modelValue":[o[2]||(o[2]=n=>K(c)?c.value=n:null),o[3]||(o[3]=n=>P())],options:{placeholder:e(i)("pruvious-dashboard","Search icons..."),clearable:!0}},null,8,["modelValue","options"]))])):r("",!0),e(d).length?(s(),a("div",{key:1,class:$(["grid gap-4 p-4 text-vs",{filtered:e(c),"grid-cols-[repeat(auto-fill,minmax(6rem,1fr))]":e(d).length}])},[(s(!0),a(se,null,ae(e(d),({label:n,name:S})=>y((s(),a("button",{onClick:ge=>(T(S),W()),class:"relative flex aspect-square items-center justify-center overflow-hidden rounded-md border p-2 transition before:absolute before:inset-0 before:bg-gray-900 before:opacity-0 before:transition hover:before:opacity-50 hocus:border-primary-700",style:E({backgroundImage:`url(${e(q)})`})},[(s(),g(k(e(x)[S]),{class:"relative !h-4/5 !w-full shrink-0"}))],12,ve)),[[v,n]])),256))],2)):r("",!0),e(d).length?r("",!0):(s(),a("div",he,[f("p",ye,h(e(i)("pruvious-dashboard","No icons found")),1)]))]),_:1},8,["visible"])])}}});export{Fe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.