import{u as f,j as r,r as u,H as h}from"./index-731ec1e3.js";const a=o=>{const e="[/| |:]",n=new RegExp(e,"g");return o.replace(n,"_")},v=o=>{const{t:e}=f("zigbee"),{device:n}=o;if(n.supported&&n.definition){const t=`https://www.zigbee2mqtt.io/supported-devices/#v=${encodeURIComponent(n.definition.vendor)}`;return r.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:t,children:n.definition.vendor})}return r.jsx(u.Fragment,{children:e("unsupported")})},g=o=>{var d,s,c,p,l;const{device:e,anchor:n}=o;let t=e.model_id,i=h;if(e.supported&&e.definition){const m=[encodeURIComponent((s=(d=e.definition)==null?void 0:d.vendor)==null?void 0:s.toLowerCase()),encodeURIComponent((p=(c=e.definition)==null?void 0:c.model)==null?void 0:p.toLowerCase())].join("-");i=`https://www.zigbee2mqtt.io/devices/${encodeURIComponent(a((l=e.definition)==null?void 0:l.model))}.html#${encodeURIComponent(a(n||m))}`,t=e.definition.model}return r.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:i,children:t})};export{g as M,v as V};
