(m(),K(u(Ee),{text:"Select multiple icons to import",class:"right bottom"},{default:ue(()=>[L(u(Lg),{value:u(t),"onUpdate:value":s[0]||(s[0]=o=>Fe(t)?t.value=o:null),text:u(Ae).compactWidth?"Multiple":"Select Multiple Icons"},null,8,["value","text"])]),_:1}))}}),pv={key:0,class:"if-icon-set-footer-controls"},gv={class:"if-tooltip"},ki=J({__name:"PaginationMultiSelect",props:{range:{},selectVisibleIcons:{type:Function}},setup(e){const{multiSelect:t,selectedIcons:n,resetSelectedIcons:s}=gi(Ce);return(o,i)=>u(t)||u(n).length>1?(m(),w("div",pv,[x("div",{class:re(["if-tooltip-wrapper bottom",[!u(n).length&&"empty"]])},[x("div",null,Z((u(Wr)[u(n).length]??u(Wr)[2]).replace("{n}",`${u(n).length}`)),1),x("div",gv,Z(u(n).slice(0,30).join(`
`))+" "+Z(u(n).length>30?`
-...`:""),1)],2),x("div",null,[L(u($e),{class:"pretty",icon:u(fe).selectNone||u(fe).reset,text:u(ag),color:6,disabled:!u(n).length,onClick:u(s)},null,8,["icon","text","disabled","onClick"]),u(n)&&o.range.pages>0?(m(),K(u($e),{key:0,class:"pretty",icon:u(fe).checkbox.checked,text:o.range.pages===1?u(lg):u(cg),color:2,onClick:o.selectVisibleIcons},null,8,["icon","text","onClick"])):E("",!0)])])):E("",!0)}});function mv(e,t){const n=We.value.iconNode;if(n){const s=vi({[e]:t},{changeColor:!0,forceSize:n.height});ze({type:"ui:replace-icon",node:n.id,data:s})}}function yv(e,t,n){const s=Tn.value||We.value.defaultNode,o=vi(e,{changeColor:!0,changeSize:!0});ze({type:"ui:import-icons",node:s,data:o,component:n})}const vv=x("dt",null,"Import to:",-1),bv={class:"plugin-target-layer"},_v=J({__name:"FooterNodes",setup(e){const t=O(()=>Tn.value||We.value.defaultNode),n=O(()=>We.value.defaultNode),s=O(()=>{const l=t.value,c=We.value.nodes.find(a=>a.id===l);return c?mo[c.type]:""}),o=O(()=>We.value.nodes.filter(l=>!l.icon).map(l=>({type:"option",value:l.id,text:l.name,icon:mo[l.type],iconStyle:`padding-left: ${(l.depth||0)*4}px`})));function i(l){const c=We.value.nodes.find(a=>a.id===l);return c?c.name:l||""}function r(l){Tn.value=l}return(l,c)=>u(We).nodes.length>1?(m(),w(ie,{key:0},[vv,x("dd",bv,[L(u(Ee),{text:"Layer to import icon(s) to"},{default:ue(()=>[L(u(Fg),{icon:s.value,value:t.value,"onUpdate:value":r,defaultValue:n.value,options:o.value,textForValue:i,bottom:""},null,8,["icon","value","defaultValue","options"])]),_:1})])],64)):E("",!0)}}),kv={class:"if-selected-icon-customisations"},wv={key:0,class:"if-notices-item info relative"},xv={class:"if-form-container"},Iv=["icon"],Cv=["value"],Sv={class:"if-selected-icon-buttons"},$v=["href"],Ov=["icon"],wi=J({__name:"Footer",props:{icons:{}},setup(e){const t=e,n=O(()=>{const $=t.icons;let C=!1,b=0,A=!1;const q=[],R=new Set,F=new Set,W=Object.create(null);for(const Y in $){const ee=$[Y];if(q.push(Y),F.add(Y.split(":")[0]),!ee){b++,W[Y]=null;continue}R.add(ee.height??16);const le=Xc(ee.body);le?(A=!0,W[Y]={...ee,body:le}):W[Y]=ee,ee.body.includes("currentColor")&&(C=!0)}const U=Ml(Array.from(R));return{data:W,length:q.length,names:q,prefixes:F,pending:b,hasCurrentColor:C,removedAnimations:A,sizeOptions:U}}),{colorValue:s,colorPickerColor:o,colorInputIcon:i,updateInput:r,colorStyleOptions:l,recentColors:c}=gy(),a=O(()=>{const $=[],C=c.value;C.length&&($.push({type:"section",section:"Recently used colors:"}),$.push({type:"colors",colors:C}));const b=l.value;return b.length&&($.push({type:"section",section:"Color styles:"}),$.push({type:"colors",colors:b})),$.push({type:"section",section:"FigJam colors:"}),$.push({type:"colors",colors:hy}),$}),f=z();function d(){f.value&&f.value.showPicker()}function h($){et.value=$}const p=O(()=>{const $=n.value.length;return $>1?`Import ${$} icons`:"Import icon"}),_=O(()=>n.value.length>1?"s":"");function I(){const $=n.value,C=$.names[0],b=$.data[C];b&&mv(C,b)}function k($){yv(n.value.data,{color:s.value,size:xt.value||void 0},$)}return($,C)=>(m(),w("div",{class:re(["if-selected-icon",[n.value.length>1&&"if-selected-icon--multiple"]])},[L(u(dy),{data:n.value.data},null,8,["data"]),x("div",kv,[n.value.removedAnimations?(m(),w("div",wv," Figma does not support SVG animations. Animations were removed. ")):E("",!0),x("div",xv,[x("dl",null,[x("dt",null," Size"+Z(n.value.hasCurrentColor?" and color":"")+": ",1),x("dd",null,[L(u(Ee),{text:"Icon height"},{default:ue(()=>[L(u(Bg),En({bottom:!0,value:u(xt),"onUpdate:value":C[0]||(C[0]=b=>Le(xt)?xt.value=b:null)},n.value.sizeOptions),null,16,["value"])]),_:1}),n.value.hasCurrentColor?(m(),K(u(Ee),{key:0,class:"if-input--color",text:"Change icon color"},{default:ue(()=>[L(u(nn),{bottom:!0,value:u(i).value,"onUpdate:value":u(r),icon:u(i).icon,iconStyle:u(i).style,class:"fixed-width tiny",options:a.value},{dropdown:ue(()=>[x("button",{class:"if-dropdown-option if-dropdown-option--color",onClick:d},[x("iconify-icon",{icon:u(fe).expand},null,8,Iv),x("span",null,Z(u(rg)),1),x("input",{type:"color",ref_key:"colorPickerNode",ref:f,tabindex:"-1",value:u(o),onInput:C[1]||(C[1]=b=>h(b.target.value))},null,40,Cv)])]),_:1},8,["value","onUpdate:value","icon","iconStyle","options"])]),_:1})):E("",!0)]),L(_v)])])]),x("div",Sv,[n.value.length===1&&u(We).iconNode?(m(),K(u(Ee),{key:0,text:`Replace ${u(We).iconNode.name}
+...`:""),1)],2),x("div",null,[L(u($e),{class:"pretty",icon:u(fe).selectNone||u(fe).reset,text:u(ag),color:6,disabled:!u(n).length,onClick:u(s)},null,8,["icon","text","disabled","onClick"]),u(n)&&o.range.pages>0?(m(),K(u($e),{key:0,class:"pretty",icon:u(fe).checkbox.checked,text:o.range.pages===1?u(lg):u(cg),color:2,onClick:o.selectVisibleIcons},null,8,["icon","text","onClick"])):E("",!0)])])):E("",!0)}});function mv(e,t){const n=We.value.iconNode;if(n){const s=vi({[e]:t},{changeColor:!0,forceSize:n.height});ze({type:"ui:replace-icon",node:n.id,data:s})}}function yv(e,t,n){const s=Tn.value||We.value.defaultNode,o=vi(e,{changeColor:!0,changeSize:!0});ze({type:"ui:import-icons",node:s,data:o,component:n})}const vv=x("dt",null,"Import to:",-1),bv={class:"plugin-target-layer"},_v=J({__name:"FooterNodes",setup(e){const t=O(()=>Tn.value||We.value.defaultNode),n=O(()=>We.value.defaultNode),s=O(()=>{const l=t.value,c=We.value.nodes.find(a=>a.id===l);return c?mo[c.type]:""}),o=O(()=>We.value.nodes.filter(l=>!l.icon).map(l=>({type:"option",value:l.id,text:l.name,icon:mo[l.type],iconStyle:`padding-left: ${(l.depth||0)*4}px`})));function i(l){const c=We.value.nodes.find(a=>a.id===l);return c?c.name:l||""}function r(l){Tn.value=l}return(l,c)=>u(We).nodes.length>1?(m(),w(ie,{key:0},[vv,x("dd",bv,[L(u(Ee),{text:"Layer to import icon(s) to"},{default:ue(()=>[L(u(Fg),{icon:s.value,value:t.value,"onUpdate:value":r,defaultValue:n.value,options:o.value,textForValue:i,bottom:""},null,8,["icon","value","defaultValue","options"])]),_:1})])],64)):E("",!0)}}),kv={class:"if-selected-icon-customisations"},wv={key:0,class:"if-notices-item info relative"},xv={class:"if-form-container"},Iv=["icon"],Cv=["value"],Sv={class:"if-selected-icon-buttons"},$v=["href"],Ov=["icon"],wi=J({__name:"Footer",props:{icons:{}},setup(e){const t=e,n=O(()=>{const $=t.icons;let C=!1,b=0,A=!1;const q=[],R=new Set,F=new Set,W=Object.create(null);for(const Y in $){const ee=$[Y];if(q.push(Y),F.add(Y.split(":")[0]),!ee){b++,W[Y]=null;continue}R.add(ee.height??16);const le=Xc(ee.body);le?(A=!0,W[Y]={...ee,body:le}):W[Y]=ee,ee.body.includes("currentColor")&&(C=!0)}const U=Ml(Array.from(R));return{data:W,length:q.length,names:q,prefixes:F,pending:b,hasCurrentColor:C,removedAnimations:A,sizeOptions:U}}),{colorValue:s,colorPickerColor:o,colorInputIcon:i,updateInput:r,colorStyleOptions:l,recentColors:c}=gy(),a=O(()=>{const $=[],C=c.value;C.length&&($.push({type:"section",section:"Recently used colors:"}),$.push({type:"colors",colors:C}));const b=l.value;return b.length&&($.push({type:"section",section:"Color styles:"}),$.push({type:"colors",colors:b})),$.push({type:"section",section:"FigJam colors:"}),$.push({type:"colors",colors:hy}),$}),f=z();function d(){f.value&&f.value.showPicker()}function h($){et.value=$}const p=O(()=>{const $=n.value.length;return $>1?`Import ${$} icons`:"Import icon"}),_=O(()=>n.value.length>1?"s":"");function I(){const $=n.value,C=$.names[0],b=$.data[C];b&&mv(C,b)}function k($){yv(n.value.data,{color:s.value,size:xt.value||void 0},$)}return($,C)=>(m(),w("div",{class:re(["if-selected-icon",[n.value.length>1&&"if-selected-icon--multiple"]])},[L(u(dy),{data:n.value.data},null,8,["data"]),x("div",kv,[n.value.removedAnimations?(m(),w("div",wv," Figma does not support SVG animations. Animations were removed. ")):E("",!0),x("div",xv,[x("dl",null,[x("dt",null," Size"+Z(n.value.hasCurrentColor?" and color":"")+": ",1),x("dd",null,[L(u(Ee),{text:"Icon height"},{default:ue(()=>[L(u(Bg),En({bottom:!0,value:u(xt),"onUpdate:value":C[0]||(C[0]=b=>Fe(xt)?xt.value=b:null)},n.value.sizeOptions),null,16,["value"])]),_:1}),n.value.hasCurrentColor?(m(),K(u(Ee),{key:0,class:"if-input--color",text:"Change icon color"},{default:ue(()=>[L(u(nn),{bottom:!0,value:u(i).value,"onUpdate:value":u(r),icon:u(i).icon,iconStyle:u(i).style,class:"fixed-width tiny",options:a.value},{dropdown:ue(()=>[x("button",{class:"if-dropdown-option if-dropdown-option--color",onClick:d},[x("iconify-icon",{icon:u(fe).expand},null,8,Iv),x("span",null,Z(u(rg)),1),x("input",{type:"color",ref_key:"colorPickerNode",ref:f,tabindex:"-1",value:u(o),onInput:C[1]||(C[1]=b=>h(b.target.value))},null,40,Cv)])]),_:1},8,["value","onUpdate:value","icon","iconStyle","options"])]),_:1})):E("",!0)]),L(_v)])])]),x("div",Sv,[n.value.length===1&&u(We).iconNode?(m(),K(u(Ee),{key:0,text:`Replace ${u(We).iconNode.name}
Note: size and color are
-reused from current icon`},{default:ue(()=>[n.value.length===1&&u(We).iconNode?(m(),K(u($e),{key:0,text:"Replace",icon:u(mo)[u(We).iconNode.type],onClick:I},null,8,["icon"])):E("",!0)]),_:1},8,["text"])):E("",!0),L(u(Ee),{text:`${p.value} as frame${_.value}`},{default:ue(()=>[L(u($e),{text:"Import",selected:!0,icon:u(jl),onClick:C[2]||(C[2]=b=>k(!1))},null,8,["icon"])]),_:1},8,["text"]),L(u(Ee),{text:`${p.value} as component${_.value}`},{default:ue(()=>[L(u($e),{text:"Import",icon:u(Bl),onClick:C[3]||(C[3]=b=>k(!0))},null,8,["icon"])]),_:1},8,["text"]),L(u(Ee),{text:"Icon code and more customisation options"},{default:ue(()=>[n.value.length===1?(m(),w("a",{key:0,class:"if-button",target:"_blank",href:"https://iconify.design/icon-sets/"+n.value.names[0].replace(":","/")+"/"},[x("iconify-icon",{icon:u(Lf)},null,8,Ov)],8,$v)):E("",!0)]),_:1})])],2))}}),Mv={class:"plugin-icons-header"},Tv={key:0,class:"plugin-grid-footer"},Av=J({__name:"Render",props:{route:{},data:{}},setup(e){var le;const{route:t,data:n}=e,s=t.prefix,o=Ce.convertedIconSetsCache,{gridColumns:i,gridLayout:r}=yi(),l=n.info??o.info[s],{keyword:c,icons:a,categories:f,prefixes:d,suffixes:h,filters:p}=fv(n);(le=t.parent)!=null&&le.list||Ue.recent.add(s),dv(t,{keyword:c,filters:p});const{scroll:_}=hv(t,a),I=z({start:0,end:n.total,pages:1});function k(Q,te,V){I.value={start:Q,end:te,pages:V}}const{multiSelect:$,selectedIcons:C,selectedIconsData:b,selectIcon:A,selectIcons:q}=mi(Ce),R=O(()=>C.value.map(Q=>{const te=Q.split(":");return te[0]===s?te[1]:""}).filter(Q=>Q!==""));function F(){const{start:Q,end:te}=I.value;q(a.value.slice(Q,te).map(V=>`${s}:${V}`))}function W(Q){A(`${s}:${Q}`)}const U=z(!1);let Y;if(at.value){const Q=at.value;at.value=null,A(Q);const te=Q.split(":");if(te[0]===s){const V=a.value.indexOf(te[1]);V>0&&(Y=V)}}function ee(Q,te,V){const de=`${s}:${te}`,ce=Ce.getIconData(de);if(!ce){Q.preventDefault();return}bi(V,Q,{[de]:ce})}return(Q,te)=>(m(),w("div",{class:re(["plugin-content icons",u(Fe).compactWidth&&"compact"])},[x("div",Mv,[L(u(ty),{prefix:u(s),info:u(l),favorite:U.value,"onUpdate:favorite":te[0]||(te[0]=V=>U.value=V),canToggleFavorite:!0},null,8,["prefix","info","favorite"]),L(u(ay),{filters:u(p),categories:u(f),prefixes:u(d),suffixes:u(h),keyword:u(c),"onUpdate:keyword":te[1]||(te[1]=V=>Le(c)?c.value=V:null)},null,8,["filters","categories","prefixes","suffixes","keyword"])]),L(u(di),{columns:u(i),items:u(a),layout:u(r),paginationText:u(a).length===1?u(ai):u(ci),emptyPaginationText:u(ui),hasPaginationSlot:!0,startIndex:u(Y),onRange:k,onScroll:u(_)},{default:ue(V=>{var de;return[(m(),K(u(pi),{key:V.item,loader:u(Ce),prefix:u(s),name:V.item,align:V.align,side:V.side,iconSetData:Q.data,iconSetInfo:u(l),hidden:(de=Q.data.items[Q.data.map[V.item]])==null?void 0:de.hidden,selected:R.value.includes(V.item),selecting:u($),onClick:ce=>W(V.item),draggable:!0,onDragstart:ce=>ee(ce,V.item,!0),onDragend:ce=>ee(ce,V.item,!1)},null,8,["loader","prefix","name","align","side","iconSetData","iconSetInfo","hidden","selected","selecting","onClick","onDragstart","onDragend"]))]}),pagination:ue(()=>[L(_i)]),afterPagination:ue(()=>[u($)||u(C).length?(m(),w("div",Tv,[u($)||u(C).length>1?(m(),K(ki,{key:0,range:I.value,selectVisibleIcons:F},null,8,["range"])):E("",!0),u(C).length?(m(),K(wi,{key:1,icons:u(b)},null,8,["icons"])):E("",!0)])):E("",!0)]),_:1},8,["columns","items","layout","paginationText","emptyPaginationText","startIndex","onScroll"])],2))}}),Pv={key:0,class:"plugin-content placeholder"},Lv=J({__name:"Loader",props:{route:{}},setup(e){const{route:t}=e,n=uv(Ce,t.prefix);return(s,o)=>u(n)?(m(),K(Av,{key:1,route:s.route,data:u(n)},null,8,["route","data"])):(m(),w("div",Pv,Z(u(n)===null?u(sa):u(na)),1))}});function Fv(e,t){return hi(e.loadSearch,t,void 0)}function _a(e,t){const n=er(ct(t)),s=z(n.icons),o=z(n.prefixes);ye(()=>t,f=>{const d=er(ct(f));s.value=wn(d.icons,s.value);const h=wn(d.prefixes,o.value);o.value=h},{deep:!0});const i=O(()=>Object.keys(s.value)),r=qc(),l=va(e,o,o,r),c=O(()=>{const f=s.value,d=i.value,h=new Set(l.prefixes.value);return d.filter(_=>h.has(f[_].prefix))}),a=O(()=>{const f=s.value,d=c.value;return Object.fromEntries(d.map(h=>[h,f[h]]))});return{allPrefixes:o,...l,icons:a,iconNames:c}}const Ev={class:"plugin-icons-header"},Rv={key:0,class:"if-panel if-panel--right"},Nv={key:0,class:"plugin-grid-footer"},jv=J({__name:"Render",props:{route:{},data:{}},setup(e){const{data:t}=e,n=Ce.convertedIconSetsCache,{gridColumns:s,gridLayout:o}=yi(),{icons:i,iconNames:r,filters:l,categories:c,licenses:a,grids:f,tags:d,prefixFilters:h,canSelectPalette:p,canSelectCommercial:_,canSelectAttribution:I,hasActiveFilters:k}=_a(n,t.icons);ks.value=!!h.value,ye(k,le=>{ws.value=le});function $(){Al(Ht,l)}const C=z({start:0,end:r.value.length,pages:1});function b(le,Q,te){C.value={start:le,end:Q,pages:te}}const{multiSelect:A,selectedIcons:q,selectedIconsData:R,selectIcon:F,selectIcons:W}=mi(Ce);function U(){const{start:le,end:Q}=C.value;W(r.value.slice(le,Q))}let Y;if(at.value){const le=at.value;at.value=null,F(le);const Q=r.value.indexOf(le);Q>0&&(Y=Q)}function ee(le,Q,te){const V=Ce.getIconData(Q);if(!V){le.preventDefault();return}bi(te,le,{[Q]:V})}return(le,Q)=>(m(),w("div",{class:re(["plugin-content icons",u(Fe).compactWidth&&"compact"])},[x("div",Ev,[u(h)&&u(Nt)?(m(),w("div",Rv,[L(u(fa),{onReset:$,canReset:u(k),filters:u(l),prefixes:u(h),categories:u(c),tags:u(d),palette:u(p),licenses:u(a),attribution:u(I),commercial:u(_),grids:u(f)},null,8,["canReset","filters","prefixes","categories","tags","palette","licenses","attribution","commercial","grids"])])):E("",!0)]),L(u(di),{columns:u(s),items:u(r),layout:u(o),paginationText:u(r).length===1?u(ai):u(ci),emptyPaginationText:u(ui),hasPaginationSlot:!0,startIndex:u(Y),onRange:b},{default:ue(te=>[(m(),K(u(pi),{key:te.item,loader:u(Ce),prefix:u(i)[te.item].prefix,name:u(i)[te.item].name,align:te.align,side:te.side,iconSetInfo:u(n).info[u(i)[te.item].prefix],selected:u(q).includes(te.item),selecting:u(A),onClick:V=>u(F)(te.item),draggable:!0,onDragstart:V=>ee(V,te.item,!0),onDragend:V=>ee(V,te.item,!1)},null,8,["loader","prefix","name","align","side","iconSetInfo","selected","selecting","onClick","onDragstart","onDragend"]))]),pagination:ue(()=>[L(_i)]),afterPagination:ue(()=>[u(A)||u(q).length?(m(),w("div",Nv,[u(A)||u(q).length>1?(m(),K(ki,{key:0,range:C.value,selectVisibleIcons:U},null,8,["range"])):E("",!0),u(q).length?(m(),K(wi,{key:1,icons:u(R)},null,8,["icons"])):E("",!0)])):E("",!0)]),_:1},8,["columns","items","layout","paginationText","emptyPaginationText","startIndex"])],2))}}),Bv={key:0,class:"plugin-content placeholder"},Dv=J({__name:"Loader",props:{route:{}},setup(e){const{route:t}=e;ks.value=!1,Nt.value=!1,ws.value=!1;const n=Fv(Ce,t);return(s,o)=>u(n)?(m(),K(jv,{key:1,route:s.route,data:u(n)},null,8,["route","data"])):(m(),w("div",Bv,Z(u(n)===null?u(sa):u(na)),1))}});function Hv(){const e=Ao.value;return e==="figjam"?"FigJam":e.slice(0,1).toUpperCase()+e.slice(1)}const zv=()=>`
+reused from current icon`},{default:ue(()=>[n.value.length===1&&u(We).iconNode?(m(),K(u($e),{key:0,text:"Replace",icon:u(mo)[u(We).iconNode.type],onClick:I},null,8,["icon"])):E("",!0)]),_:1},8,["text"])):E("",!0),L(u(Ee),{text:`${p.value} as frame${_.value}`},{default:ue(()=>[L(u($e),{text:"Import",selected:!0,icon:u(jl),onClick:C[2]||(C[2]=b=>k(!1))},null,8,["icon"])]),_:1},8,["text"]),L(u(Ee),{text:`${p.value} as component${_.value}`},{default:ue(()=>[L(u($e),{text:"Import",icon:u(Bl),onClick:C[3]||(C[3]=b=>k(!0))},null,8,["icon"])]),_:1},8,["text"]),L(u(Ee),{text:"Icon code and more customisation options"},{default:ue(()=>[n.value.length===1?(m(),w("a",{key:0,class:"if-button",target:"_blank",href:"https://iconify.design/icon-sets/"+n.value.names[0].replace(":","/")+"/"},[x("iconify-icon",{icon:u(Lf)},null,8,Ov)],8,$v)):E("",!0)]),_:1})])],2))}}),Mv={class:"plugin-icons-header"},Tv={key:0,class:"plugin-grid-footer"},Av=J({__name:"Render",props:{route:{},data:{}},setup(e){var le;const{route:t,data:n}=e,s=t.prefix,o=Ce.convertedIconSetsCache,{gridColumns:i,gridLayout:r}=yi(),l=n.info??o.info[s],{keyword:c,icons:a,categories:f,prefixes:d,suffixes:h,filters:p}=fv(n);(le=t.parent)!=null&&le.list||Ue.recent.add(s),dv(t,{keyword:c,filters:p});const{scroll:_}=hv(t,a),I=z({start:0,end:n.total,pages:1});function k(Q,te,V){I.value={start:Q,end:te,pages:V}}const{multiSelect:$,selectedIcons:C,selectedIconsData:b,selectIcon:A,selectIcons:q}=mi(Ce),R=O(()=>C.value.map(Q=>{const te=Q.split(":");return te[0]===s?te[1]:""}).filter(Q=>Q!==""));function F(){const{start:Q,end:te}=I.value;q(a.value.slice(Q,te).map(V=>`${s}:${V}`))}function W(Q){A(`${s}:${Q}`)}const U=z(!1);let Y;if(at.value){const Q=at.value;at.value=null,A(Q);const te=Q.split(":");if(te[0]===s){const V=a.value.indexOf(te[1]);V>0&&(Y=V)}}function ee(Q,te,V){const de=`${s}:${te}`,ce=Ce.getIconData(de);if(!ce){Q.preventDefault();return}bi(V,Q,{[de]:ce})}return(Q,te)=>(m(),w("div",{class:re(["plugin-content icons",u(Ae).compactWidth&&"compact"])},[x("div",Mv,[L(u(ty),{prefix:u(s),info:u(l),favorite:U.value,"onUpdate:favorite":te[0]||(te[0]=V=>U.value=V),canToggleFavorite:!0},null,8,["prefix","info","favorite"]),L(u(ay),{filters:u(p),categories:u(f),prefixes:u(d),suffixes:u(h),keyword:u(c),"onUpdate:keyword":te[1]||(te[1]=V=>Fe(c)?c.value=V:null)},null,8,["filters","categories","prefixes","suffixes","keyword"])]),L(u(di),{columns:u(i),items:u(a),layout:u(r),paginationText:u(a).length===1?u(ai):u(ci),emptyPaginationText:u(ui),hasPaginationSlot:!0,startIndex:u(Y),onRange:k,onScroll:u(_)},{default:ue(V=>{var de;return[(m(),K(u(pi),{key:V.item,loader:u(Ce),prefix:u(s),name:V.item,align:V.align,side:V.side,iconSetData:Q.data,iconSetInfo:u(l),hidden:(de=Q.data.items[Q.data.map[V.item]])==null?void 0:de.hidden,selected:R.value.includes(V.item),selecting:u($),onClick:ce=>W(V.item),draggable:!0,onDragstart:ce=>ee(ce,V.item,!0),onDragend:ce=>ee(ce,V.item,!1)},null,8,["loader","prefix","name","align","side","iconSetData","iconSetInfo","hidden","selected","selecting","onClick","onDragstart","onDragend"]))]}),pagination:ue(()=>[L(_i)]),afterPagination:ue(()=>[u($)||u(C).length?(m(),w("div",Tv,[u($)||u(C).length>1?(m(),K(ki,{key:0,range:I.value,selectVisibleIcons:F},null,8,["range"])):E("",!0),u(C).length?(m(),K(wi,{key:1,icons:u(b)},null,8,["icons"])):E("",!0)])):E("",!0)]),_:1},8,["columns","items","layout","paginationText","emptyPaginationText","startIndex","onScroll"])],2))}}),Pv={key:0,class:"plugin-content placeholder"},Lv=J({__name:"Loader",props:{route:{}},setup(e){const{route:t}=e,n=uv(Ce,t.prefix);return(s,o)=>u(n)?(m(),K(Av,{key:1,route:s.route,data:u(n)},null,8,["route","data"])):(m(),w("div",Pv,Z(u(n)===null?u(sa):u(na)),1))}});function Fv(e,t){return hi(e.loadSearch,t,void 0)}function _a(e,t){const n=er(ct(t)),s=z(n.icons),o=z(n.prefixes);ye(()=>t,f=>{const d=er(ct(f));s.value=wn(d.icons,s.value);const h=wn(d.prefixes,o.value);o.value=h},{deep:!0});const i=O(()=>Object.keys(s.value)),r=qc(),l=va(e,o,o,r),c=O(()=>{const f=s.value,d=i.value,h=new Set(l.prefixes.value);return d.filter(_=>h.has(f[_].prefix))}),a=O(()=>{const f=s.value,d=c.value;return Object.fromEntries(d.map(h=>[h,f[h]]))});return{allPrefixes:o,...l,icons:a,iconNames:c}}const Ev={class:"plugin-icons-header"},Rv={key:0,class:"if-panel if-panel--right"},Nv={key:0,class:"plugin-grid-footer"},jv=J({__name:"Render",props:{route:{},data:{}},setup(e){const{data:t}=e,n=Ce.convertedIconSetsCache,{gridColumns:s,gridLayout:o}=yi(),{icons:i,iconNames:r,filters:l,categories:c,licenses:a,grids:f,tags:d,prefixFilters:h,canSelectPalette:p,canSelectCommercial:_,canSelectAttribution:I,hasActiveFilters:k}=_a(n,t.icons);ks.value=!!h.value,ye(k,le=>{ws.value=le});function $(){Al(Ht,l)}const C=z({start:0,end:r.value.length,pages:1});function b(le,Q,te){C.value={start:le,end:Q,pages:te}}const{multiSelect:A,selectedIcons:q,selectedIconsData:R,selectIcon:F,selectIcons:W}=mi(Ce);function U(){const{start:le,end:Q}=C.value;W(r.value.slice(le,Q))}let Y;if(at.value){const le=at.value;at.value=null,F(le);const Q=r.value.indexOf(le);Q>0&&(Y=Q)}function ee(le,Q,te){const V=Ce.getIconData(Q);if(!V){le.preventDefault();return}bi(te,le,{[Q]:V})}return(le,Q)=>(m(),w("div",{class:re(["plugin-content icons",u(Ae).compactWidth&&"compact"])},[x("div",Ev,[u(h)&&u(Nt)?(m(),w("div",Rv,[L(u(fa),{onReset:$,canReset:u(k),filters:u(l),prefixes:u(h),categories:u(c),tags:u(d),palette:u(p),licenses:u(a),attribution:u(I),commercial:u(_),grids:u(f)},null,8,["canReset","filters","prefixes","categories","tags","palette","licenses","attribution","commercial","grids"])])):E("",!0)]),L(u(di),{columns:u(s),items:u(r),layout:u(o),paginationText:u(r).length===1?u(ai):u(ci),emptyPaginationText:u(ui),hasPaginationSlot:!0,startIndex:u(Y),onRange:b},{default:ue(te=>[(m(),K(u(pi),{key:te.item,loader:u(Ce),prefix:u(i)[te.item].prefix,name:u(i)[te.item].name,align:te.align,side:te.side,iconSetInfo:u(n).info[u(i)[te.item].prefix],selected:u(q).includes(te.item),selecting:u(A),onClick:V=>u(F)(te.item),draggable:!0,onDragstart:V=>ee(V,te.item,!0),onDragend:V=>ee(V,te.item,!1)},null,8,["loader","prefix","name","align","side","iconSetInfo","selected","selecting","onClick","onDragstart","onDragend"]))]),pagination:ue(()=>[L(_i)]),afterPagination:ue(()=>[u(A)||u(q).length?(m(),w("div",Nv,[u(A)||u(q).length>1?(m(),K(ki,{key:0,range:C.value,selectVisibleIcons:U},null,8,["range"])):E("",!0),u(q).length?(m(),K(wi,{key:1,icons:u(R)},null,8,["icons"])):E("",!0)])):E("",!0)]),_:1},8,["columns","items","layout","paginationText","emptyPaginationText","startIndex"])],2))}}),Bv={key:0,class:"plugin-content placeholder"},Dv=J({__name:"Loader",props:{route:{}},setup(e){const{route:t}=e;ks.value=!1,Nt.value=!1,ws.value=!1;const n=Fv(Ce,t);return(s,o)=>u(n)?(m(),K(jv,{key:1,route:s.route,data:u(n)},null,8,["route","data"])):(m(),w("div",Bv,Z(u(n)===null?u(sa):u(na)),1))}});function Hv(){const e=Ao.value;return e==="figjam"?"FigJam":e.slice(0,1).toUpperCase()+e.slice(1)}const zv=()=>`
Drag icon to ${Hv()} or
-click icon for more options...`,Uv={class:"plugin-icons-header recent"},Vv={class:"plugin-recent-reset"},Kv=x("div",{class:"plugin-page-title"},"Recently imported icons:",-1),Wv={key:0,class:"plugin-grid-footer"},qv=J({__name:"RecentIcons",setup(e){const t=Ce.convertedIconSetsCache,{gridColumns:n,gridLayout:s}=yi(),{icons:o,iconNames:i}=_a(t,Yt);ye(Yt,$=>{$.length||(me.value="")});const r=z({start:0,end:i.value.length,pages:1});function l($,C,b){r.value={start:$,end:C,pages:b}}const{multiSelect:c,selectedIcons:a,selectedIconsData:f,selectIcon:d,selectIcons:h}=mi(Ce);function p(){const{start:$,end:C}=r.value;h(i.value.slice($,C))}let _;if(at.value){const $=at.value;at.value=null,d($);const C=i.value.indexOf($);C>0&&(_=C)}function I($,C,b){const A=Ce.getIconData(C);if(!A){$.preventDefault();return}bi(b,$,{[C]:A})}function k(){Yt.value=[],ze({type:"ui:reset-recent-icons"})}return($,C)=>(m(),w("div",{class:re(["plugin-content icons",u(Fe).compactWidth&&"compact"])},[x("div",Uv,[x("div",Vv,[L(u($e),{class:"large",icon:u(fe).reset,text:"Clear recent icons list",onClick:k},null,8,["icon"])]),Kv]),L(u(di),{columns:u(n),items:u(i),layout:u(s),paginationText:u(i).length===1?u(ai):u(ci),emptyPaginationText:u(ui),hasPaginationSlot:!0,startIndex:u(_),onRange:l},{default:ue(b=>[(m(),K(u(pi),{key:b.item,loader:u(Ce),prefix:u(o)[b.item].prefix,name:u(o)[b.item].name,align:b.align,side:b.side,iconSetInfo:u(t).info[u(o)[b.item].prefix],selected:u(a).includes(b.item),selecting:u(c),afterHint:u(zv)(),onClick:A=>u(d)(b.item),draggable:!0,onDragstart:A=>I(A,b.item,!0),onDragend:A=>I(A,b.item,!1)},null,8,["loader","prefix","name","align","side","iconSetInfo","selected","selecting","afterHint","onClick","onDragstart","onDragend"]))]),pagination:ue(()=>[L(_i)]),afterPagination:ue(()=>[u(c)||u(a).length?(m(),w("div",Wv,[u(c)||u(a).length>1?(m(),K(ki,{key:0,range:r.value,selectVisibleIcons:p},null,8,["range"])):E("",!0),u(a).length?(m(),K(wi,{key:1,icons:u(f)},null,8,["icons"])):E("",!0)])):E("",!0)]),_:1},8,["columns","items","layout","paginationText","emptyPaginationText","startIndex"])],2))}}),Gv={class:"plugin-content page"},Jv=Uc('New features
- New compact UI, which takes less space.
- Tooltips everywhere. To show more information in limited space, most UI elements use tooltips.
- Detailed license information for icon sets and icons. You can see which icons can be used in commercial applications and require attribution.
- Advanced filters. You can filter icon sets by license, grid, palette.
- Infinite scrolling for icon lists. No more pagination.
- Support for color styles. You can select color styles in color picker. Due to Figma limitations, the plugin can see only local styles. However, styles shared from other documents are visible to the plugin if you select a layer that uses that style.
- Improved drag and drop. Drop is now more precise, however, there are some limitations: cannot drop to component instances or locked layers. Dropping to group with auto-layout will import the icon as the first node, not necessary where you drop it.
- When replacing an icon, the new icon will keep the old icon's size and paint.
- Option to select all visible icons, which you can batch import.
',2),Yv=x("h1",null,"Old version / Feedback",-1),Qv=x("p",null,[Ae(" If you prefer the previous version of the plugin, it is "),x("a",{href:"https://github.com/iconify/iconify-figma/tree/archive/v3-dist",target:"_blank"},"available on GitHub"),Ae(". ")],-1),Xv=x("p",null,"See readme for installation instructions.",-1),Zv=J({__name:"V4",setup(e){function t(n){me.value=n}return(n,s)=>(m(),w("div",Gv,[Jv,x("section",null,[Yv,Qv,Xv,x("p",null,[Ae(" Better yet, please "),x("a",{href:"#",onClick:s[0]||(s[0]=oi(o=>t("feedback"),["prevent"]))},"send your feedback"),Ae(". Please tell me why you prefer the older version, maybe your concern could be addressed in the new version. ")])])]))}}),eb={},tb={class:"plugin-content page"},nb=Uc('Feedback / Support
If you have any questions or suggestions, you can contact me on:
For developers, support is also available at GitHub repository for plugin.
Updates
Updates for plugin and other parts of the Iconify project are posted on X (Twitter) and Mastodon.
',2),sb=[nb];function ob(e,t){return m(),w("div",tb,sb)}const ib=ga(eb,[["render",ob]]),rb={class:"plugin-content page"},lb=x("h1",null,"About Iconify",-1),cb=x("p",null," With Iconify you can use icons from many different icon sets in the same projects using the same plugins, libraries and icon components. ",-1),ab=J({__name:"About",setup(e){return(t,n)=>(m(),w("div",rb,[x("section",null,[lb,cb,L(ba)])]))}}),ub={key:5,class:"plugin-content placeholder dimmed"},fb=J({__name:"Index",setup(e){const t=O(()=>_e.value),n=O(()=>ii(_e.value));function s(o){return JSON.stringify({keyword:o.keyword,prefixes:o.prefixes})}return(o,i)=>(m(),w(ie,null,[u(me)?u(me)==="recent-icons"?(m(),K(qv,{key:1})):u(me)==="v4"?(m(),K(Zv,{key:2})):u(me)==="feedback"?(m(),K(ib,{key:3})):u(me)==="about"?(m(),K(ab,{key:4})):(m(),w("div",ub," This page is under development... ")):(m(),w(ie,{key:0},[t.value.type==="icon-set"?(m(),K(Lv,{key:t.value.prefix,route:t.value},null,8,["route"])):t.value.type==="search"?(m(),K(Dv,{key:s(t.value),route:t.value},null,8,["route"])):(m(),K(av,{key:2,route:n.value},null,8,["route"]))],64)),L(u(Tm),{class:"absolute top"})],64))}}),db={key:0,class:"plugin-content loading placeholder dimmed"},hb=J({__name:"App",setup(e){const{started:t,config:n}=yy(),s=O(()=>{const o=me.value;return o?o!=="recent-icons":_e.value.type==="icon-sets"});return(o,i)=>(m(),w("div",{class:re(["plugin-wrapper",s.value&&"scrollable-wrapper"])},[u(t)?(m(),w(ie,{key:1},[L(Ky,Jf(zc(u(n))),null,16),L(fb)],64)):(m(),w("div",db," Loading plugin data... "))],2))}});console.log("Starting UI...");function il(){function e(){ze({type:"ui:fatal-error",error:"Error connecting to Iconify API. This plugin cannot work offline."})}async function t(){await Sa(()=>import("https://code.iconify.design/samples.js"),void 0,import.meta.url);let n;try{n=await Ce.loadConvertedIconSets()}catch{}if(!n)return e();Jc(n),np(hb).mount("#app"),ze({type:"ui:loaded",innerHeight:window.innerHeight,outerHeight:window.outerHeight})}t().catch(e)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",il):il();
+click icon for more options...`,Uv={class:"plugin-icons-header recent"},Vv={class:"plugin-recent-reset"},Kv=x("div",{class:"plugin-page-title"},"Recently imported icons:",-1),Wv={key:0,class:"plugin-grid-footer"},qv=J({__name:"RecentIcons",setup(e){const t=Ce.convertedIconSetsCache,{gridColumns:n,gridLayout:s}=yi(),{icons:o,iconNames:i}=_a(t,Yt);ye(Yt,$=>{$.length||(me.value="")});const r=z({start:0,end:i.value.length,pages:1});function l($,C,b){r.value={start:$,end:C,pages:b}}const{multiSelect:c,selectedIcons:a,selectedIconsData:f,selectIcon:d,selectIcons:h}=mi(Ce);function p(){const{start:$,end:C}=r.value;h(i.value.slice($,C))}let _;if(at.value){const $=at.value;at.value=null,d($);const C=i.value.indexOf($);C>0&&(_=C)}function I($,C,b){const A=Ce.getIconData(C);if(!A){$.preventDefault();return}bi(b,$,{[C]:A})}function k(){Yt.value=[],ze({type:"ui:reset-recent-icons"})}return($,C)=>(m(),w("div",{class:re(["plugin-content icons",u(Ae).compactWidth&&"compact"])},[x("div",Uv,[x("div",Vv,[L(u($e),{class:"large",icon:u(fe).reset,text:"Clear recent icons list",onClick:k},null,8,["icon"])]),Kv]),L(u(di),{columns:u(n),items:u(i),layout:u(s),paginationText:u(i).length===1?u(ai):u(ci),emptyPaginationText:u(ui),hasPaginationSlot:!0,startIndex:u(_),onRange:l},{default:ue(b=>[(m(),K(u(pi),{key:b.item,loader:u(Ce),prefix:u(o)[b.item].prefix,name:u(o)[b.item].name,align:b.align,side:b.side,iconSetInfo:u(t).info[u(o)[b.item].prefix],selected:u(a).includes(b.item),selecting:u(c),afterHint:u(zv)(),onClick:A=>u(d)(b.item),draggable:!0,onDragstart:A=>I(A,b.item,!0),onDragend:A=>I(A,b.item,!1)},null,8,["loader","prefix","name","align","side","iconSetInfo","selected","selecting","afterHint","onClick","onDragstart","onDragend"]))]),pagination:ue(()=>[L(_i)]),afterPagination:ue(()=>[u(c)||u(a).length?(m(),w("div",Wv,[u(c)||u(a).length>1?(m(),K(ki,{key:0,range:r.value,selectVisibleIcons:p},null,8,["range"])):E("",!0),u(a).length?(m(),K(wi,{key:1,icons:u(f)},null,8,["icons"])):E("",!0)])):E("",!0)]),_:1},8,["columns","items","layout","paginationText","emptyPaginationText","startIndex"])],2))}}),Gv={class:"plugin-content page"},Jv=Uc('New features
- New compact UI, which takes less space.
- Tooltips everywhere. To show more information in limited space, most UI elements use tooltips.
- Detailed license information for icon sets and icons. You can see which icons can be used in commercial applications and require attribution.
- Advanced filters. You can filter icon sets by license, grid, palette.
- Infinite scrolling for icon lists. No more pagination.
- Support for color styles. You can select color styles in color picker. Due to Figma limitations, the plugin can see only local styles. However, styles shared from other documents are visible to the plugin if you select a layer that uses that style.
- Improved drag and drop. Drop is now more precise, however, there are some limitations: cannot drop to component instances or locked layers. Dropping to group with auto-layout will import the icon as the first node, not necessary where you drop it.
- When replacing an icon, the new icon will keep the old icon's size and paint.
- Option to select all visible icons, which you can batch import.
',2),Yv=x("h1",null,"Old version / Feedback",-1),Qv=x("p",null,[Pe(" If you prefer the previous version of the plugin, it is "),x("a",{href:"https://github.com/iconify/iconify-figma/tree/archive/v3-dist",target:"_blank"},"available on GitHub"),Pe(". ")],-1),Xv=x("p",null,"See readme for installation instructions.",-1),Zv=J({__name:"V4",setup(e){function t(n){me.value=n}return(n,s)=>(m(),w("div",Gv,[Jv,x("section",null,[Yv,Qv,Xv,x("p",null,[Pe(" Better yet, please "),x("a",{href:"#",onClick:s[0]||(s[0]=oi(o=>t("feedback"),["prevent"]))},"send your feedback"),Pe(". Please tell me why you prefer the older version, maybe your concern could be addressed in the new version. ")])])]))}}),eb={},tb={class:"plugin-content page"},nb=Uc('Feedback / Support
If you have any questions or suggestions, you can contact me on:
For developers, support is also available at GitHub repository for plugin.
Updates
Updates for plugin and other parts of the Iconify project are posted on X (Twitter) and Mastodon.
',2),sb=[nb];function ob(e,t){return m(),w("div",tb,sb)}const ib=ga(eb,[["render",ob]]),rb={class:"plugin-content page"},lb=x("h1",null,"About Iconify",-1),cb=x("p",null," With Iconify you can use icons from many different icon sets in the same projects using the same plugins, libraries and icon components. ",-1),ab=J({__name:"About",setup(e){return(t,n)=>(m(),w("div",rb,[x("section",null,[lb,cb,L(ba)])]))}}),ub={key:5,class:"plugin-content placeholder dimmed"},fb=J({__name:"Index",setup(e){const t=O(()=>_e.value),n=O(()=>ii(_e.value));function s(o){return JSON.stringify({keyword:o.keyword,prefixes:o.prefixes})}return(o,i)=>(m(),w(ie,null,[u(me)?u(me)==="recent-icons"?(m(),K(qv,{key:1})):u(me)==="v4"?(m(),K(Zv,{key:2})):u(me)==="feedback"?(m(),K(ib,{key:3})):u(me)==="about"?(m(),K(ab,{key:4})):(m(),w("div",ub," This page is under development... ")):(m(),w(ie,{key:0},[t.value.type==="icon-set"?(m(),K(Lv,{key:t.value.prefix,route:t.value},null,8,["route"])):t.value.type==="search"?(m(),K(Dv,{key:s(t.value),route:t.value},null,8,["route"])):(m(),K(av,{key:2,route:n.value},null,8,["route"]))],64)),L(u(Tm),{class:"absolute top"})],64))}}),db={key:0,class:"plugin-content loading placeholder dimmed"},hb=J({__name:"App",setup(e){const{started:t,config:n}=yy(),s=O(()=>{const o=me.value;return o?o!=="recent-icons":_e.value.type==="icon-sets"});return(o,i)=>(m(),w("div",{class:re(["plugin-wrapper",s.value&&"scrollable-wrapper"])},[u(t)?(m(),w(ie,{key:1},[L(Ky,Jf(zc(u(n))),null,16),L(fb)],64)):(m(),w("div",db," Loading plugin data... "))],2))}});console.log("Starting UI...");function il(){function e(){ze({type:"ui:fatal-error",error:"Error connecting to Iconify API. This plugin cannot work offline."})}async function t(){await Sa(()=>import("https://code.iconify.design/samples.js"),void 0,import.meta.url);let n;try{n=await Ce.loadConvertedIconSets()}catch{}if(!n)return e();Jc(n),np(hb).mount("#app"),ze({type:"ui:loaded",innerHeight:window.innerHeight,outerHeight:window.outerHeight})}t().catch(e)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",il):il();
diff --git a/dist/plugin.js b/dist/plugin.js
index deed6e3..4867e02 100644
--- a/dist/plugin.js
+++ b/dist/plugin.js
@@ -1 +1 @@
-const T={compactWidth:!1,v4Notice:!1},m=Object.assign({},T);function ae(e){var o;m.v4Notice=!0;const t=["compactWidth","windowAction","selectAfterImport","customizeDrop","dropToFrame"];for(const n of t){const i=(o=e.options)==null?void 0:o[n];i!==void 0&&(m[n]=i)}return m}async function le(){try{const e=await figma.clientStorage.getAsync("config");switch(e==null?void 0:e.version){case 2:ae(e);break;case 3:Object.assign(m,e);break}}catch(e){}return m}function z(){const e={version:3};let t;for(t in T){const o=m[t],n=T[t];n!==void 0&&n!==o&&(e[t]=o)}figma.clientStorage.setAsync("config",e).catch()}function fe(){const e=figma;try{const t=e.editorType;switch(t){case"figma":case"figjam":return t}}catch(t){console.error(t)}try{if(typeof e.createSticky=="function")return"figjam"}catch(t){console.error(t)}return"figma"}const p={app:fe(),loaded:!1,minimized:!1,config:m};function F(){const e=p.app;return e==="figjam"?"FigJam":e.slice(0,1).toUpperCase()+e.slice(1)}const E=24,b={mini:{width:200,height:88+E},full:{width:464+E,min:580,max:720},compact:{width:336+E,min:520,max:640},innerDiff:90,outerDiff:150};function x(){const e=p.config.compactWidth,t=b[e?"compact":"full"];let o;if(p.windowInnerHeight){const n=p.windowOuterHeight?p.windowOuterHeight-b.outerDiff:p.windowInnerHeight-b.innerDiff;o=Math.max(Math.min(n,t.max),t.min)}else o=t.max;return{width:t.width,height:o}}function y(e){figma.ui.postMessage(e)}function ue(e){switch(e.type){case"PAGE":case"COMPONENT":case"FRAME":case"SECTION":case"GROUP":return e}}function ge(e){switch(e.type){case"FRAME":case"COMPONENT":return e}}function G(e){return{type:"icon-set",prefix:e,parent:{type:"icon-sets"}}}function de(e){function t(){if(e.getSharedPluginData("iconify","source")==="iconify"){const n=JSON.parse(e.getSharedPluginData("iconify","props")),c=n.name.split(":");if(c.length===2)switch(n.version){case 3:{const r=n.route||G(c[0]);return Object.assign(n,{route:r})}default:{const r=n.props;let s;return typeof n.color=="string"?s=n.color:typeof r=="object"&&(s=r.color),{version:3,name:n.name,props:{color:s},route:G(c[0])}}}}}try{return t()}catch(o){}}function L(e){return{nodes:e.nodes||Object.create(null),ignoreIconNode:e.ignoreIconNode||!1,iconNodeID:e.iconNodeID||null,iconNodeData:e.iconNodeData||null}}function A(e,t,o){function n(i,c,r){const s=i.id,l=t.nodes[s];if(l)return r&&l.children.push(r),l;let a="invalid",h=!1,g,f;const u=ge(i);u&&(g=de(u),g&&(f=u.height,t.iconNodeID?t.ignoreIconNode=!0:(t.iconNodeID=s,t.iconNodeData=g)));const d=ue(i);d?d.type==="PAGE"?(a="valid",h=!0):(d.locked||(a="valid"),(!c||d.locked)&&(t.ignoreIconNode=!0),h=d.type!=="FRAME"):i.type==="COMPONENT_SET"?a="ignored":t.ignoreIconNode=!0;const w={type:i.type,id:s,name:i.name,target:a,children:r?[r]:[],primary:c,relative:h,icon:g,height:f};return t.nodes[s]=w,i.parent&&i.type!=="PAGE"&&n(i.parent,c,i.id),w}return n(e,o)}const he=16;function _(){const e=figma.currentPage,t=e.selection,o=L({}),n=A(e,o,!1);t.forEach((d,w)=>{A(d,o,!w)});const{nodes:i,iconNodeData:c,iconNodeID:r,ignoreIconNode:s}=o,l=[];let a=n.id,h;function g(d,w=0){switch(d.target){case"ignored":{d.children.forEach(I=>{g(i[I],w)});break}case"valid":switch(d.type){case"PAGE":case"COMPONENT":case"FRAME":case"SECTION":case"GROUP":const I={id:d.id,name:d.name,depth:w,type:d.type};!s&&c&&r===d.id&&(I.icon=c,I.height=d.height,h=I),d.icon||(l.push(I),d.primary&&!d.icon&&(a=d.id),d.children.forEach(se=>{g(i[se],w+1)}))}}}g(n);let f=!1,u=he;for(;l.length>u;)l.pop()===h&&(f=!0,u--);return f&&h&&l.push(h),{nodes:l,defaultNode:a,iconNode:h}}let Y=_();function X(){return Y}function pe(e){Y=e}const D="style:";function q(e){function t(o){const n=Math.round(o*255).toString(16);return n.length<2?"0"+n:n}return"#"+t(e.r)+t(e.g)+t(e.b)}function H(e){const t=e.paints[0].color;return{id:e.id,name:e.name,color:q(t),remote:e.remote}}function W(e){return e.type==="SOLID"&&e.visible!==!1&&e.blendMode==="NORMAL"&&e.opacity===1?e:void 0}function k(e){if(e.paints.length===1)return W(e.paints[0])}function Q(e){const t=figma.getStyleById(e);if((t==null?void 0:t.type)==="PAINT"&&k(t))return t.id}const v=new Set;async function me(){const e=[];return(await figma.getLocalPaintStylesAsync()).forEach(t=>{try{v.add(t.id),k(t)&&e.push(H(t))}catch(o){console.log("Error parsing color style:",o)}}),e}function Z(){const e=figma.getSelectionColors(),t=[];return e==null||e.styles.forEach(o=>{const n=o.id;v.has(n)||(v.add(n),k(o)&&t.push(H(o)))}),t.length?t:void 0}function ye(e){async function t(o){const n=[];for(const i of o)if(i.startsWith(D)){const c=i.slice(D.length);if(!v.has(c)){v.add(c);const r=await figma.getStyleByIdAsync(c);(r==null?void 0:r.type)==="PAINT"&&k(r)&&n.push(H(r))}}n.length&&y({type:"plugin:color-styles",styles:n})}e&&setTimeout(()=>{t(e).catch(console.error)})}let C=!1;function Ne(){const e=_();if(JSON.stringify(e)!==JSON.stringify(X())){pe(e);const t=Z();y({type:"plugin:nodes",nodes:e,styles:t})}}function O(){C||(C=!0,setTimeout(()=>{C=!1,Ne()},250))}async function S(e,t=void 0,o){try{const n=await figma.clientStorage.getAsync(e);if(n)return o?o(n):n}catch(n){}return t}function P(e,t){figma.clientStorage.setAsync(e,t).catch()}const ee="recent";let N=[];const we=64;async function Ie(){const e=await S(ee);return e&&(N=e),e}let M=!1;function te(){M||(M=!0,setTimeout(()=>{M=!1,P(ee,N),y({type:"plugin:recent-icons",icons:N})},1e3))}function ne(e){for(const t of e){const o=N.indexOf(t);o!==-1&&N.splice(o,1),N.unshift(t),N.length>we&&N.pop(),te()}}function Se(){N=[],te()}async function oe(e,t){function o(c){try{if(c.length===1){const r=c[0];if(W(c[0]))return!0}}catch(r){}}async function n(c){o(c.fills)&&(typeof t=="string"?await c.setFillStyleIdAsync(t):c.fills=[t]),o(c.strokes)&&(typeof t=="string"?await c.setStrokeStyleIdAsync(t):c.strokes=[t])}async function i(c){const r=c;if(r.locked||r.isMask)return;try{await n(r)}catch(l){}const s=c.children;if(s)for(const l of s)await i(l)}for(const c of e.children)await i(c)}const Pe={replace:"Replace icon",code:"Icon code"};function ie(e,t,o,n){e.name=t,e.setSharedPluginData("iconify","source","iconify");const i={version:3,name:t,props:o,route:n};e.setSharedPluginData("iconify","props",JSON.stringify(i)),e.setRelaunchData(Pe)}function ce(e,t){const o=figma.createNodeFromSvg(e);let n;if(t.replace?n=t.replace:t.component&&(n=figma.createComponent()),n){for(;n.children.length>0;)n.children[0].remove();n.resizeWithoutConstraints(o.width,o.height);for(const c of o.children)n.appendChild(c);if(o.remove(),t.replace)return n}const i=n||o;if(t.parent){const c=t.parent;let r=!0;const s=c.layoutMode;s&&s!=="NONE"&&(r=!1),r?c.appendChild(i):c.insertChild(0,i),t.x&&(i.x=t.x),t.y&&(i.y=t.y)}return i.constrainProportions=!0,i}function U(e,t,o,n){if(e.type==="PAGE")return t;let i=0,c=n?e.width:e.height;if(e.type==="GROUP"&&(i=n?e.x:e.y),tr?Math.max(i,r):t}function re(e,t,o){const n=t.icons.reduce((s,l)=>s+Math.ceil(l.width),0);let i=U(e,Math.round(o.targetX-n/2),n,!0),c;t.props.style&&(c=Q(t.props.style));const r=[];for(const s of t.icons){const l=U(e,Math.round(o.targetY-s.height/2),s.height,!1),a=ce(s.content,{parent:e,x:i,y:l,component:o.component});ie(a,s.name,t.props,t.route),i+=Math.ceil(s.width),r.push(a),s.monotone&&c&&oe(a,c).catch(console.error)}return ne(t.icons.map(s=>s.name)),y({type:"plugin:notice",color:"success",text:`Imported ${t.icons.length>1?t.icons.length+" icons":t.icons[0].name} to ${F()}`}),figma.currentPage.selection=r,O(),r}function j(){y({type:"plugin:notice",color:"error",text:"Error dropping icon(s) to "+F()})}function ve(e){try{if(e.dropMetadata.source!=="iconify")return!0}catch(f){return!0}let t=e.x,o=e.y;const n=e.node;n.type==="GROUP"&&(t+=n.x,o+=n.y);const i=L({});A(n,i,!0);const c=i.nodes[figma.currentPage.id];if(!c)return console.error("Cannot find current page item in scanned nodes list"),j(),!0;let r=0,s=0,l=!0,a=c,h=c;for(;a.children.length;){const f=a.children[0];if(a=i.nodes[f],a.icon||a.target==="invalid"?l=!1:l&&a.target==="valid"&&(h=a),!l&&a.relative){const u=figma.getNodeById(a.id);u&&(r+=u.x||0,s+=u.y||0)}}const g=figma.getNodeById(h.id);return g?(re(g,e.dropMetadata,{targetX:r+t,targetY:s+o}),!1):(console.error("Failed to get target node"),j(),!0)}function R(){y({type:"plugin:notice",color:"error",text:"Error importing icon(s) to "+F()})}function ke(e,t){const o=figma.getNodeById(e);if(!o){R();return}const n=o.name;let i,c;const r=figma.currentPage.selection;if(r.length===1&&r[0].id===o.id){const s=figma.getSelectionColors();if(s){const l=s.paints,a=s.styles;l.length+a.length===1?(a.length&&k(a[0])&&(i=a[0].id,c=D+i),l.length&&(i=W(l[0]),i&&(c=q(i.color)))):t.props.style&&(i=Q(t.props.style))}}for(const s of t.icons){const l=s.name,a=ce(s.content,{replace:o,x:o.x,y:o.y});ie(a,l,t.props,t.route),ne([l]),y({type:"plugin:notice",color:"success",text:`Replaced ${n} with ${l}`}),figma.currentPage.selection=[a],O(),s.monotone&&i&&oe(a,i).catch(console.error),s.monotone&&c&&y({type:"plugin:recent-color",color:c});return}R()}function De(e,t,o){const n=figma.getNodeById(e);if(!n){R();return}let i,c;switch(n.type){case"PAGE":{const r=figma.viewport.center;i=r.x,c=r.y;break}case"GROUP":{i=n.x+n.width/2,c=n.y+n.height/2;break}default:{i=n.width/2,c=n.height/2;break}}re(n,t,{component:o,targetX:i,targetY:c})}const B="icon-sets",K="route-v3",V="icon-sets-filters",$="recent-colors",J="customisations";(async()=>{var h;console.log("Starting plugin..."),await le();const e=await S(B,void 0,g=>g.version===3?g.data:void 0);let t=await S(K);const o=await Ie(),n=await S(V),i=await S($);let c=await S(J);const r=X(),s=Z();let l;if(figma.command==="replace"){const g=(h=r.iconNode)==null?void 0:h.icon;if(g){l=g.name,g.route&&(t=g.route);const f=g.props;f&&(c={size:f.size,color:f.style?D+f.style:f.color})}}figma.on("selectionchange",O),figma.on("currentpagechange",O),figma.on("drop",ve),figma.ui.onmessage=g=>{try{if(typeof g.type!="string")return}catch(u){console.error(u)}const f=g;switch(f.type){case"ui:fatal-error":{figma.closePlugin(f.error);break}case"ui:loaded":{if(f.innerHeight||f.outerHeight){p.windowInnerHeight=f.innerHeight,p.windowOuterHeight=f.outerHeight;const u=x();u.height!==p.lastWindowHeight&&(p.lastWindowHeight=u.height,figma.ui.resize(u.width,u.height))}y({type:"plugin:starting",app:p.app,command:figma.command,config:m,nodes:r,styles:s,lists:e,recent:o,route:t,filters:n,selectIcon:l,recentColors:i,custom:c}),me().then(u=>{u.length&&y({type:"plugin:color-styles",styles:u})}).catch(console.error),ye(i);break}case"ui:close":{figma.closePlugin();break}case"ui:compact":{m.compactWidth=!m.compactWidth;const u=x();u.height!==p.lastWindowHeight&&(p.lastWindowHeight=u.height,figma.ui.resize(u.width,u.height)),y({type:"plugin:resize",compactWidth:m.compactWidth,minimized:!1}),z();break}case"ui:dismiss-v4":{m.v4Notice=!1,z();break}case"ui:lists":{const u={version:3,data:f.lists};P(B,u);break}case"ui:route":{P(K,f.route);break}case"ui:filters":{P(V,f.filters);break}case"ui:replace-icon":{ke(f.node,f.data);break}case"ui:import-icons":{De(f.node,f.data,f.component||!1);break}case"ui:recent-colors":{P($,f.colors);break}case"ui:customisations":{P(J,f.custom);break}case"ui:reset-recent-icons":{Se();break}}};const a=x();p.lastWindowHeight=a.height,figma.showUI(__html__,Object.assign({themeColors:!1},a))})();
+const M={compactWidth:!1,v4Notice:!1},m=Object.assign({},M);function fe(e){var o;m.v4Notice=!0;const t=["compactWidth","windowAction","selectAfterImport","customizeDrop","dropToFrame"];for(const n of t){const i=(o=e.options)==null?void 0:o[n];i!==void 0&&(m[n]=i)}return m}async function ue(){try{const e=await figma.clientStorage.getAsync("config");switch(e==null?void 0:e.version){case 2:fe(e);break;case 3:Object.assign(m,e);break}}catch(e){}return m}function z(){const e={version:3};let t;for(t in M){const o=m[t],n=M[t];n!==void 0&&n!==o&&(e[t]=o)}figma.clientStorage.setAsync("config",e).catch()}function ge(){const e=figma;try{const t=e.editorType;switch(t){case"figma":case"figjam":return t}}catch(t){console.error(t)}try{if(typeof e.createSticky=="function")return"figjam"}catch(t){console.error(t)}return"figma"}const p={app:ge(),loaded:!1,minimized:!1,config:m};function F(){const e=p.app;return e==="figjam"?"FigJam":e.slice(0,1).toUpperCase()+e.slice(1)}const _=24,T=10,de=4,he=8,G=de*2*T+_+he*2,O={mini:{width:200,height:88+_},full:{width:48*T+G,min:580,max:720},compact:{width:32*T+G,min:520,max:640},innerDiff:90,outerDiff:150};function x(){const e=p.config.compactWidth,t=O[e?"compact":"full"];let o;if(p.windowInnerHeight){const n=p.windowOuterHeight?p.windowOuterHeight-O.outerDiff:p.windowInnerHeight-O.innerDiff;o=Math.max(Math.min(n,t.max),t.min)}else o=t.max;return{width:t.width,height:o}}function y(e){figma.ui.postMessage(e)}function pe(e){switch(e.type){case"PAGE":case"COMPONENT":case"FRAME":case"SECTION":case"GROUP":return e}}function me(e){switch(e.type){case"FRAME":case"COMPONENT":return e}}function U(e){return{type:"icon-set",prefix:e,parent:{type:"icon-sets"}}}function ye(e){function t(){if(e.getSharedPluginData("iconify","source")==="iconify"){const n=JSON.parse(e.getSharedPluginData("iconify","props")),c=n.name.split(":");if(c.length===2)switch(n.version){case 3:{const r=n.route||U(c[0]);return Object.assign(n,{route:r})}default:{const r=n.props;let s;return typeof n.color=="string"?s=n.color:typeof r=="object"&&(s=r.color),{version:3,name:n.name,props:{color:s},route:U(c[0])}}}}}try{return t()}catch(o){}}function Y(e){return{nodes:e.nodes||Object.create(null),ignoreIconNode:e.ignoreIconNode||!1,iconNodeID:e.iconNodeID||null,iconNodeData:e.iconNodeData||null}}function A(e,t,o){function n(i,c,r){const s=i.id,l=t.nodes[s];if(l)return r&&l.children.push(r),l;let a="invalid",h=!1,g,f;const u=me(i);u&&(g=ye(u),g&&(f=u.height,t.iconNodeID?t.ignoreIconNode=!0:(t.iconNodeID=s,t.iconNodeData=g)));const d=pe(i);d?d.type==="PAGE"?(a="valid",h=!0):(d.locked||(a="valid"),(!c||d.locked)&&(t.ignoreIconNode=!0),h=d.type!=="FRAME"):i.type==="COMPONENT_SET"?a="ignored":t.ignoreIconNode=!0;const w={type:i.type,id:s,name:i.name,target:a,children:r?[r]:[],primary:c,relative:h,icon:g,height:f};return t.nodes[s]=w,i.parent&&i.type!=="PAGE"&&n(i.parent,c,i.id),w}return n(e,o)}const Ne=16;function X(){const e=figma.currentPage,t=e.selection,o=Y({}),n=A(e,o,!1);t.forEach((d,w)=>{A(d,o,!w)});const{nodes:i,iconNodeData:c,iconNodeID:r,ignoreIconNode:s}=o,l=[];let a=n.id,h;function g(d,w=0){switch(d.target){case"ignored":{d.children.forEach(I=>{g(i[I],w)});break}case"valid":switch(d.type){case"PAGE":case"COMPONENT":case"FRAME":case"SECTION":case"GROUP":const I={id:d.id,name:d.name,depth:w,type:d.type};!s&&c&&r===d.id&&(I.icon=c,I.height=d.height,h=I),d.icon||(l.push(I),d.primary&&!d.icon&&(a=d.id),d.children.forEach(le=>{g(i[le],w+1)}))}}}g(n);let f=!1,u=Ne;for(;l.length>u;)l.pop()===h&&(f=!0,u--);return f&&h&&l.push(h),{nodes:l,defaultNode:a,iconNode:h}}let q=X();function Q(){return q}function we(e){q=e}const D="style:";function Z(e){function t(o){const n=Math.round(o*255).toString(16);return n.length<2?"0"+n:n}return"#"+t(e.r)+t(e.g)+t(e.b)}function H(e){const t=e.paints[0].color;return{id:e.id,name:e.name,color:Z(t),remote:e.remote}}function W(e){return e.type==="SOLID"&&e.visible!==!1&&e.blendMode==="NORMAL"&&e.opacity===1?e:void 0}function k(e){if(e.paints.length===1)return W(e.paints[0])}function ee(e){const t=figma.getStyleById(e);if((t==null?void 0:t.type)==="PAINT"&&k(t))return t.id}const v=new Set;async function Ie(){const e=[];return(await figma.getLocalPaintStylesAsync()).forEach(t=>{try{v.add(t.id),k(t)&&e.push(H(t))}catch(o){console.log("Error parsing color style:",o)}}),e}function te(){const e=figma.getSelectionColors(),t=[];return e==null||e.styles.forEach(o=>{const n=o.id;v.has(n)||(v.add(n),k(o)&&t.push(H(o)))}),t.length?t:void 0}function Pe(e){async function t(o){const n=[];for(const i of o)if(i.startsWith(D)){const c=i.slice(D.length);if(!v.has(c)){v.add(c);const r=await figma.getStyleByIdAsync(c);(r==null?void 0:r.type)==="PAINT"&&k(r)&&n.push(H(r))}}n.length&&y({type:"plugin:color-styles",styles:n})}e&&setTimeout(()=>{t(e).catch(console.error)})}let b=!1;function Se(){const e=X();if(JSON.stringify(e)!==JSON.stringify(Q())){we(e);const t=te();y({type:"plugin:nodes",nodes:e,styles:t})}}function E(){b||(b=!0,setTimeout(()=>{b=!1,Se()},250))}async function P(e,t=void 0,o){try{const n=await figma.clientStorage.getAsync(e);if(n)return o?o(n):n}catch(n){}return t}function S(e,t){figma.clientStorage.setAsync(e,t).catch()}const ne="recent";let N=[];const ve=64;async function ke(){const e=await P(ne);return e&&(N=e),e}let C=!1;function oe(){C||(C=!0,setTimeout(()=>{C=!1,S(ne,N),y({type:"plugin:recent-icons",icons:N})},1e3))}function ie(e){for(const t of e){const o=N.indexOf(t);o!==-1&&N.splice(o,1),N.unshift(t),N.length>ve&&N.pop(),oe()}}function De(){N=[],oe()}async function ce(e,t){function o(c){try{if(c.length===1){const r=c[0];if(W(c[0]))return!0}}catch(r){}}async function n(c){o(c.fills)&&(typeof t=="string"?await c.setFillStyleIdAsync(t):c.fills=[t]),o(c.strokes)&&(typeof t=="string"?await c.setStrokeStyleIdAsync(t):c.strokes=[t])}async function i(c){const r=c;if(r.locked||r.isMask)return;try{await n(r)}catch(l){}const s=c.children;if(s)for(const l of s)await i(l)}for(const c of e.children)await i(c)}const Ee={replace:"Replace icon",code:"Icon code"};function re(e,t,o,n){e.name=t,e.setSharedPluginData("iconify","source","iconify");const i={version:3,name:t,props:o,route:n};e.setSharedPluginData("iconify","props",JSON.stringify(i)),e.setRelaunchData(Ee)}function se(e,t){const o=figma.createNodeFromSvg(e);let n;if(t.replace?n=t.replace:t.component&&(n=figma.createComponent()),n){for(;n.children.length>0;)n.children[0].remove();n.resizeWithoutConstraints(o.width,o.height);for(const c of o.children)n.appendChild(c);if(o.remove(),t.replace)return n}const i=n||o;if(t.parent){const c=t.parent;let r=!0;const s=c.layoutMode;s&&s!=="NONE"&&(r=!1),r?c.appendChild(i):c.insertChild(0,i),t.x&&(i.x=t.x),t.y&&(i.y=t.y)}return i.constrainProportions=!0,i}function j(e,t,o,n){if(e.type==="PAGE")return t;let i=0,c=n?e.width:e.height;if(e.type==="GROUP"&&(i=n?e.x:e.y),tr?Math.max(i,r):t}function ae(e,t,o){const n=t.icons.reduce((s,l)=>s+Math.ceil(l.width),0);let i=j(e,Math.round(o.targetX-n/2),n,!0),c;t.props.style&&(c=ee(t.props.style));const r=[];for(const s of t.icons){const l=j(e,Math.round(o.targetY-s.height/2),s.height,!1),a=se(s.content,{parent:e,x:i,y:l,component:o.component});re(a,s.name,t.props,t.route),i+=Math.ceil(s.width),r.push(a),s.monotone&&c&&ce(a,c).catch(console.error)}return ie(t.icons.map(s=>s.name)),y({type:"plugin:notice",color:"success",text:`Imported ${t.icons.length>1?t.icons.length+" icons":t.icons[0].name} to ${F()}`}),figma.currentPage.selection=r,E(),r}function B(){y({type:"plugin:notice",color:"error",text:"Error dropping icon(s) to "+F()})}function Oe(e){try{if(e.dropMetadata.source!=="iconify")return!0}catch(f){return!0}let t=e.x,o=e.y;const n=e.node;n.type==="GROUP"&&(t+=n.x,o+=n.y);const i=Y({});A(n,i,!0);const c=i.nodes[figma.currentPage.id];if(!c)return console.error("Cannot find current page item in scanned nodes list"),B(),!0;let r=0,s=0,l=!0,a=c,h=c;for(;a.children.length;){const f=a.children[0];if(a=i.nodes[f],a.icon||a.target==="invalid"?l=!1:l&&a.target==="valid"&&(h=a),!l&&a.relative){const u=figma.getNodeById(a.id);u&&(r+=u.x||0,s+=u.y||0)}}const g=figma.getNodeById(h.id);return g?(ae(g,e.dropMetadata,{targetX:r+t,targetY:s+o}),!1):(console.error("Failed to get target node"),B(),!0)}function R(){y({type:"plugin:notice",color:"error",text:"Error importing icon(s) to "+F()})}function xe(e,t){const o=figma.getNodeById(e);if(!o){R();return}const n=o.name;let i,c;const r=figma.currentPage.selection;if(r.length===1&&r[0].id===o.id){const s=figma.getSelectionColors();if(s){const l=s.paints,a=s.styles;l.length+a.length===1?(a.length&&k(a[0])&&(i=a[0].id,c=D+i),l.length&&(i=W(l[0]),i&&(c=Z(i.color)))):t.props.style&&(i=ee(t.props.style))}}for(const s of t.icons){const l=s.name,a=se(s.content,{replace:o,x:o.x,y:o.y});re(a,l,t.props,t.route),ie([l]),y({type:"plugin:notice",color:"success",text:`Replaced ${n} with ${l}`}),figma.currentPage.selection=[a],E(),s.monotone&&i&&ce(a,i).catch(console.error),s.monotone&&c&&y({type:"plugin:recent-color",color:c});return}R()}function be(e,t,o){const n=figma.getNodeById(e);if(!n){R();return}let i,c;switch(n.type){case"PAGE":{const r=figma.viewport.center;i=r.x,c=r.y;break}case"GROUP":{i=n.x+n.width/2,c=n.y+n.height/2;break}default:{i=n.width/2,c=n.height/2;break}}ae(n,t,{component:o,targetX:i,targetY:c})}const K="icon-sets",V="route-v3",$="icon-sets-filters",J="recent-colors",L="customisations";(async()=>{var h;console.log("Starting plugin..."),await ue();const e=await P(K,void 0,g=>g.version===3?g.data:void 0);let t=await P(V);const o=await ke(),n=await P($),i=await P(J);let c=await P(L);const r=Q(),s=te();let l;if(figma.command==="replace"){const g=(h=r.iconNode)==null?void 0:h.icon;if(g){l=g.name,g.route&&(t=g.route);const f=g.props;f&&(c={size:f.size,color:f.style?D+f.style:f.color})}}figma.on("selectionchange",E),figma.on("currentpagechange",E),figma.on("drop",Oe),figma.ui.onmessage=g=>{try{if(typeof g.type!="string")return}catch(u){console.error(u)}const f=g;switch(f.type){case"ui:fatal-error":{figma.closePlugin(f.error);break}case"ui:loaded":{if(f.innerHeight||f.outerHeight){p.windowInnerHeight=f.innerHeight,p.windowOuterHeight=f.outerHeight;const u=x();u.height!==p.lastWindowHeight&&(p.lastWindowHeight=u.height,figma.ui.resize(u.width,u.height))}y({type:"plugin:starting",app:p.app,command:figma.command,config:m,nodes:r,styles:s,lists:e,recent:o,route:t,filters:n,selectIcon:l,recentColors:i,custom:c}),Ie().then(u=>{u.length&&y({type:"plugin:color-styles",styles:u})}).catch(console.error),Pe(i);break}case"ui:close":{figma.closePlugin();break}case"ui:compact":{m.compactWidth=!m.compactWidth;const u=x();u.height!==p.lastWindowHeight&&(p.lastWindowHeight=u.height,figma.ui.resize(u.width,u.height)),y({type:"plugin:resize",compactWidth:m.compactWidth,minimized:!1}),z();break}case"ui:dismiss-v4":{m.v4Notice=!1,z();break}case"ui:lists":{const u={version:3,data:f.lists};S(K,u);break}case"ui:route":{S(V,f.route);break}case"ui:filters":{S($,f.filters);break}case"ui:replace-icon":{xe(f.node,f.data);break}case"ui:import-icons":{be(f.node,f.data,f.component||!1);break}case"ui:recent-colors":{S(J,f.colors);break}case"ui:customisations":{S(L,f.custom);break}case"ui:reset-recent-icons":{De();break}}};const a=x();p.lastWindowHeight=a.height,figma.showUI(__html__,Object.assign({themeColors:!1},a))})();