export function getEnvironmentColor(_0x242444){let _0x1cfc38=0x0;for(let _0x472aae=0x0;_0x472aae<_0x242444['length'];_0x472aae++){_0x1cfc38=_0x242444['charCodeAt'](_0x472aae)+((_0x1cfc38<<0x5)-_0x1cfc38);}const _0x2548d8=Math['abs'](_0x1cfc38)%0x168;return'hsl('+_0x2548d8+',\x2055%,\x2048%)';}export function getEnvironmentInitials(_0x4e7a83){const _0x8ec874=_0x4e7a83['split'](/[-_.\s]+/)['filter'](Boolean);if(_0x8ec874['length']>=0x2)return(_0x8ec874[0x0][0x0]+_0x8ec874[0x1][0x0])['toUpperCase']();return _0x4e7a83['substring'](0x0,0x2)['toUpperCase']();}const ICON_REPO_SVG='<svg\x20class=\x22env-meta-icon\x22\x20width=\x2213\x22\x20height=\x2213\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M22\x2019a2\x202\x200\x200\x201-2\x202H4a2\x202\x200\x200\x201-2-2V5a2\x202\x200\x200\x201\x202-2h5l2\x203h9a2\x202\x200\x200\x201\x202\x202z\x22></path></svg>',ICON_TEMPLATE_SVG='<svg\x20class=\x22env-meta-icon\x22\x20width=\x2213\x22\x20height=\x2213\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M14\x202H6a2\x202\x200\x200\x200-2\x202v16a2\x202\x200\x200\x200\x202\x202h12a2\x202\x200\x200\x200\x202-2V8z\x22></path><polyline\x20points=\x2214\x202\x2014\x208\x2020\x208\x22></polyline></svg>';export function renderEnvironmentOption(_0xdf5f89,_0x251025){const _0x1fa683=_0x251025['value'];if(!_0x1fa683){_0xdf5f89['textContent']=_0x251025['textContent'];return;}const _0x1cf873=_0x251025['getAttribute']('data-description')||'',_0x42502d=parseInt(_0x251025['getAttribute']('data-repo-count')||'0',0xa),_0x2d44b5=parseInt(_0x251025['getAttribute']('data-template-count')||'0',0xa),_0x114104=_0x251025['getAttribute']('data-custom-color')||getEnvironmentColor(_0x1fa683),_0x180061=_0x251025['getAttribute']('data-custom-initials')||getEnvironmentInitials(_0x1fa683);_0xdf5f89['classList']['add']('env-rich-option');const _0x2ba374=document['createElement']('span');_0x2ba374['className']='env-option-avatar',_0x2ba374['style']['background']=_0x114104,_0x2ba374['textContent']=_0x180061,_0xdf5f89['appendChild'](_0x2ba374);const _0x5eb601=document['createElement']('span');_0x5eb601['className']='env-option-content';const _0x4b0f3d=document['createElement']('span');_0x4b0f3d['className']='env-option-name',_0x4b0f3d['textContent']=_0x1fa683,_0x5eb601['appendChild'](_0x4b0f3d);if(_0x1cf873){const _0x31190c=document['createElement']('span');_0x31190c['className']='env-option-desc',_0x31190c['textContent']=_0x1cf873,_0x5eb601['appendChild'](_0x31190c);}const _0x3123ae=document['createElement']('span');_0x3123ae['className']='env-option-meta';const _0xb55349=[];if(_0x42502d>0x0)_0xb55349['push'](ICON_REPO_SVG+'\x20'+_0x42502d+'\x20repo'+(_0x42502d!==0x1?'s':''));if(_0x2d44b5>0x0)_0xb55349['push'](ICON_TEMPLATE_SVG+'\x20'+_0x2d44b5+'\x20template'+(_0x2d44b5!==0x1?'s':''));_0xb55349['length']>0x0&&(_0x3123ae['innerHTML']=_0xb55349['join']('<span\x20class=\x22env-meta-sep\x22></span>'),_0x5eb601['appendChild'](_0x3123ae)),_0xdf5f89['appendChild'](_0x5eb601);}export function renderEnvironmentTrigger(_0x31e020,_0x515e55){const _0x16e0d3=_0x515e55['value'];if(!_0x16e0d3){_0x31e020['textContent']=_0x515e55['textContent'];return;}const _0x3ccea3=_0x515e55['getAttribute']('data-custom-color')||getEnvironmentColor(_0x16e0d3),_0x560ab0=_0x515e55['getAttribute']('data-custom-initials')||getEnvironmentInitials(_0x16e0d3),_0x13efc0=document['createElement']('span');_0x13efc0['className']='env-trigger-avatar',_0x13efc0['style']['background']=_0x3ccea3,_0x13efc0['textContent']=_0x560ab0;const _0x146131=document['createElement']('span');_0x146131['className']='env-trigger-name',_0x146131['textContent']=_0x16e0d3,_0x31e020['appendChild'](_0x13efc0),_0x31e020['appendChild'](_0x146131);}