import{u as m,j as r,r as f,H as u}from"./index-d7144f09.js";const p=o=>{const e="[/| |:]",n=new RegExp(e,"g");return o.replace(n,"_")},b=o=>{const{t:e}=m("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(f.Fragment,{children:e("unsupported")})},g=o=>{var s,a,l,d,c;const{device:e,anchor:n}=o;let t=e.model_id,i=u;if(e.supported&&e.definition){const h=[encodeURIComponent((a=(s=e.definition)==null?void 0:s.vendor)==null?void 0:a.toLowerCase()),encodeURIComponent((d=(l=e.definition)==null?void 0:l.model)==null?void 0:d.toLowerCase())].join("-");i=`https://www.zigbee2mqtt.io/devices/${encodeURIComponent(p((c=e.definition)==null?void 0:c.model))}.html#${encodeURIComponent(p(n||h))}`,t=e.definition.model}return r.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:i,children:t})},v=o=>{var i,s,a,l;const{device:e}=o;let n="";const t=e.software_build_id??"N/A";switch((i=e==null?void 0:e.definition)==null?void 0:i.vendor){case"IKEA":n="https://ww8.ikea.com/ikeahomesmart/releasenotes/releasenotes.html";break;case"Inovelli":n="https://help.inovelli.com/en/articles/8503774-what-is-the-latest-firmware-version-for-your-device#h_b74c1e7dc6";break;case"Philips":n=`https://www.philips-hue.com/en-us/support/release-notes/${(s=e.definition)!=null&&s.exposes.find(d=>d.type==="light")?"lamps":"accessories"}`;break;case"Ubisys":n=`https://www.ubisys.de/en/support/firmware/change-logs-${(l=(a=e.definition)==null?void 0:a.model)==null?void 0:l.replace(/[-]/g,"").toLowerCase()}/`;break}return n!=""?r.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:n,children:t}):r.jsx(r.Fragment,{children:t})};export{g as M,v as O,b as V};
