@camstack/addon-admin-ui 1.2.607 → 1.2.609
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/assets/{Addons-EHIv0Vx1.js → Addons-BFxeCNAR.js} +1 -1
- package/dist/assets/{AdminPage-qR6elCnl.js → AdminPage-CN1M6UZ4.js} +1 -1
- package/dist/assets/{AdminSectionedPage-Cn25ANFf.js → AdminSectionedPage-ByDJLqaY.js} +1 -1
- package/dist/assets/{AiProfiles-d1sjn8dZ.js → AiProfiles-Dzwi1Fy5.js} +1 -1
- package/dist/assets/{Authentication-Dr3Ns4fl.js → Authentication-BBQnP-Wy.js} +1 -1
- package/dist/assets/Build-bXZZIPAp.js +39 -0
- package/dist/assets/{Calendars-A6e9js-P.js → Calendars-BYgSS8GL.js} +1 -1
- package/dist/assets/{CameraGrids-B6vI_N8F.js → CameraGrids-B6zMPkgA.js} +1 -1
- package/dist/assets/{Cluster-DZDbP9CG.js → Cluster-nmyC-5_B.js} +1 -1
- package/dist/assets/CompositionBlockEditor-CEHUfg88.js +2 -0
- package/dist/assets/{CompositionEditorPage-D3o52kVO.js → CompositionEditorPage-CB_mvcO_.js} +1 -1
- package/dist/assets/Data-BqGqagS2.js +2 -0
- package/dist/assets/DeviceDetail-Cq10isMd.js +2 -0
- package/dist/assets/{DeviceDoActionFields-BclDWtxp.js → DeviceDoActionFields-BUYFwU0z.js} +1 -1
- package/dist/assets/{Devices-BNoJwQ15.js → Devices-B2TIc4iW.js} +1 -1
- package/dist/assets/{EditTemplateButton-Bvizsarm.js → EditTemplateButton-DGQyzrn5.js} +1 -1
- package/dist/assets/{EmbedPlayerPage--uqLrJXG.js → EmbedPlayerPage-DS-MCVT_.js} +1 -1
- package/dist/assets/{History-D6PlYB-R.js → History-lESy3MP3.js} +1 -1
- package/dist/assets/{Identity-DtkkYJoi.js → Identity-CQL5geAH.js} +1 -1
- package/dist/assets/{InstancesTable-DA1HTI3W.js → InstancesTable-A0I2fC4x.js} +1 -1
- package/dist/assets/{IntegrationDetail-imfcaSiS.js → IntegrationDetail-CHXefwhx.js} +1 -1
- package/dist/assets/{IntegrationHub-D5cT4B23.js → IntegrationHub-C8tNL25o.js} +1 -1
- package/dist/assets/{Integrations-DS2LHxGf.js → Integrations-6JUMdYxT.js} +1 -1
- package/dist/assets/Integrations-B9WX-DoF.js +2 -0
- package/dist/assets/Library-DxDzc96c.js +1 -0
- package/dist/assets/{Locations-CcpHXoJ_.js → Locations-CwiENy5O.js} +1 -1
- package/dist/assets/{Logs-Az28oEEp.js → Logs-DN3qDokO.js} +1 -1
- package/dist/assets/{MaskShapeCanvas-D1jjdVSr.js → MaskShapeCanvas-BS-uGEi7.js} +1 -1
- package/dist/assets/{MotionZonesSettings-DiIPf88t.js → MotionZonesSettings-DYW-5t38.js} +1 -1
- package/dist/assets/{MyAccess-DX6g3L66.js → MyAccess-q4wT3Gj9.js} +1 -1
- package/dist/assets/{Network-Dmd_IgCU.js → Network-Cag4IB4d.js} +1 -1
- package/dist/assets/{NodeAddonsSettingsPanel-BZD1zEkn.js → NodeAddonsSettingsPanel-BN1rOp6t.js} +1 -1
- package/dist/assets/Notifications-Dz9dhE9S.js +1 -0
- package/dist/assets/{Pipeline--oyybpvL.js → Pipeline-CviU9o4K.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-tg9GXaVS.js → PrivacyMaskSettings-BH67CESJ.js} +1 -1
- package/dist/assets/{Recordings-0U8caRVI.js → Recordings-BakzW9AU.js} +1 -1
- package/dist/assets/{ScanSubnetEditor-DN3Ie7Og.js → ScanSubnetEditor-DxjiHfEb.js} +1 -1
- package/dist/assets/{SceneMonitorEditor-CINJ-4Mp.js → SceneMonitorEditor-DzBMI5ZF.js} +1 -1
- package/dist/assets/{SessionsList-JLulcxls.js → SessionsList-CIy47IrP.js} +1 -1
- package/dist/assets/{Showroom-Cyi0_JuJ.js → Showroom-BRg96hl4.js} +1 -1
- package/dist/assets/{StorageLocationsTable-C5I-cX2f.js → StorageLocationsTable-Bx4BNXOY.js} +1 -1
- package/dist/assets/{System-DMrs86Bd.js → System-DQmn0cvm.js} +1 -1
- package/dist/assets/Templates-DknEbt7m.js +1 -0
- package/dist/assets/{Terminal-DHW1dXtm.js → Terminal-D6zR4uXe.js} +1 -1
- package/dist/assets/{TrainingProviders-Dr6yM1FJ.js → TrainingProviders-BdKGyQPQ.js} +1 -1
- package/dist/assets/{Viewer-D8XgtpH4.js → Viewer-Dz-YS30N.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Dx3SvE4V.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-D1B03T4y.js} +1 -1
- package/dist/assets/{addon-icons-context-DihpM3HF.js → addon-icons-context-vNuH_Qnv.js} +1 -1
- package/dist/assets/{ai-page.helpers-DBvqNYn1.js → ai-page.helpers-DeJr0FK5.js} +1 -1
- package/dist/assets/{archive-B2eCCknS.js → archive-CACBifJW.js} +1 -1
- package/dist/assets/{assignment-candidates-Da2Mps85.js → assignment-candidates-7Ltc_NAB.js} +1 -1
- package/dist/assets/{authed-media-C1aRt5ci.js → authed-media-1IBvRqSW.js} +1 -1
- package/dist/assets/{bell-off-CHS3Aly3.js → bell-off-DaptuG2C.js} +1 -1
- package/dist/assets/{board-model-DMWHBivw.js → board-model-CLSE8V6_.js} +1 -1
- package/dist/assets/{boxes-DftcHvx4.js → boxes-BMGVI06T.js} +1 -1
- package/dist/assets/{calendar-clock-DHLZaiyj.js → calendar-clock-ClkWjege.js} +1 -1
- package/dist/assets/circle-slash-DJL9iYoo.js +1 -0
- package/dist/assets/client-DDfmis6s.js +809 -0
- package/dist/assets/{create-composition-B0NsnVZ5.js → create-composition-gUPeU-fh.js} +2 -2
- package/dist/assets/crop-BwQkH2qz.js +1 -0
- package/dist/assets/{database-zap-B8fphlJj.js → database-zap-DmvPI7WG.js} +1 -1
- package/dist/assets/{device-integration-icon-D9fnwBoc.js → device-integration-icon-C7ZXUKQ-.js} +1 -1
- package/dist/assets/device-picker-model-Gb8kSp8V.js +1 -0
- package/dist/assets/{dist-CIX_FLwE.js → dist-D2xfOl5a.js} +1 -1
- package/dist/assets/dist-jpGt81zI.js +809 -0
- package/dist/assets/{eraser-DnVOOBJ7.js → eraser-DxqE1cuz.js} +1 -1
- package/dist/assets/{file-up-CS3QVGu0.js → file-up-BUxetIpi.js} +1 -1
- package/dist/assets/{format-BXQmKHiy.js → format-3gap9qLz.js} +1 -1
- package/dist/assets/{grip-vertical-Dx0Aqv-v.js → grip-vertical-BaflvEVj.js} +1 -1
- package/dist/assets/{hard-drive-download-BL7h_atC.js → hard-drive-download-DuBpWHNe.js} +1 -1
- package/dist/assets/{hostInit-BpnP417g.js → hostInit-CYSA1uQA.js} +1 -1
- package/dist/assets/i18n-C-ZuqT0u.js +1 -0
- package/dist/assets/{icons-C5yBX8zj.js → icons-Ci6wTHzR.js} +1 -1
- package/dist/assets/{index-Bia4P5Aw.css → index-DkUsDe0n.css} +1 -1
- package/dist/assets/{index-RgDw12BV.js → index-tVCZ0Ciq.js} +3 -3
- package/dist/assets/{key-KMleps0f.js → key-B_StsvmD.js} +1 -1
- package/dist/assets/{key-square-CknpM0L_.js → key-square-BiZZaYF4.js} +1 -1
- package/dist/assets/{layers-CA0xrUXV.js → layers-Cq6BLvAx.js} +1 -1
- package/dist/assets/{link-2-off-I79TL553.js → link-2-off-BweSCbbu.js} +1 -1
- package/dist/assets/{linked-devices-model-CioAoX2b.js → linked-devices-model-CAQzz1C5.js} +1 -1
- package/dist/assets/{list-ordered-H5cpKqfQ.js → list-ordered-myBcF32p.js} +1 -1
- package/dist/assets/{memory-stick-BYu3Pl2-.js → memory-stick-C5Yt7QJa.js} +1 -1
- package/dist/assets/{message-square-plus-C-VzE-nz.js → message-square-plus-CN3RGa5P.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-9dcd2f9c.js → mf-entry-bootstrap-0-2563a517.js} +2 -2
- package/dist/assets/{mic-off-BB0y3SKK.js → mic-off-DyL_bK5T.js} +1 -1
- package/dist/assets/{monitor-off-CeTiFn5M.js → monitor-off-DROyWuBT.js} +1 -1
- package/dist/assets/{monitor-smartphone-DiwqWkLr.js → monitor-smartphone-DXXBIJKP.js} +1 -1
- package/dist/assets/mount-Gb8kSp8V.js +1 -0
- package/dist/assets/{notification-rule-status-C0qabUH7.js → notification-rule-status-RmDwzfG-.js} +1 -1
- package/dist/assets/{player-overlays-BDeIsXux.js → player-overlays-D5PuUVGx.js} +1 -1
- package/dist/assets/remoteEntry-BP9XW9BC.js +1 -0
- package/dist/assets/{ruler-Cuy2zovK.js → ruler-DpdMZDbl.js} +1 -1
- package/dist/assets/{scan-eye-BuWxqByv.js → scan-eye-DaEhUyo3.js} +1 -1
- package/dist/assets/{scissors-BJTb03-b.js → scissors-k-txA_Ta.js} +1 -1
- package/dist/assets/{search-x-D8VnLXBR.js → search-x-DTKP7R6g.js} +1 -1
- package/dist/assets/{send-B00RXUVi.js → send-CjwxdtWi.js} +1 -1
- package/dist/assets/{settings-2-C90cMzQT.js → settings-2-B-k-LPP_.js} +1 -1
- package/dist/assets/{shapes-CBF9943U.js → shapes-D8i9579Q.js} +1 -1
- package/dist/assets/{sigma-CJJT2Cam.js → sigma-p_PPuMYs.js} +1 -1
- package/dist/assets/{speaker-B5S7k0DT.js → speaker-BlIjlZin.js} +1 -1
- package/dist/assets/src-kgyauwxD.js +100 -0
- package/dist/assets/{sso-popup-CUCydLcv.js → sso-popup-Dt_Vzh3t.js} +1 -1
- package/dist/assets/{step-inspector-model-BHcZO5h2.js → step-inspector-model-B3gllf-t.js} +1 -1
- package/dist/assets/{table-2-l7PUi3h6.js → table-2-QGOqxHnt.js} +1 -1
- package/dist/assets/{timer-reset-DqOUz58T.js → timer-reset-BgLYKIXr.js} +1 -1
- package/dist/assets/{unlink-Bj6T0cfp.js → unlink-B_JkAfPv.js} +1 -1
- package/dist/assets/{usb-7d2iIO7E.js → usb-RrGQPjOo.js} +1 -1
- package/dist/assets/{use-device-bound-caps-Davivnb7.js → use-device-bound-caps-Dnf6QFDN.js} +1 -1
- package/dist/assets/{use-scenes-feed-DpaATilO.js → use-scenes-feed-C2Ax7QVi.js} +1 -1
- package/dist/assets/{use-stationary-objects-Cu-P84Mj.js → use-stationary-objects-CV1wAJKz.js} +1 -1
- package/dist/assets/{useAdminDeviceRemoval-Cm6Gj6PO.js → useAdminDeviceRemoval-39R8KAnR.js} +1 -1
- package/dist/assets/useEventInvalidation-Gb8kSp8V.js +1 -0
- package/dist/assets/{useNodeUrlSelection-zT-4DnZQ.js → useNodeUrlSelection-B6F0O9xq.js} +1 -1
- package/dist/assets/user-round-D18UTvSy.js +1 -0
- package/dist/assets/{user-x-CK_55Ufn.js → user-x-QqdI9XGf.js} +1 -1
- package/dist/assets/{variable-qhs89ABT.js → variable-DvMlG3sr.js} +1 -1
- package/dist/assets/{video-BMbZ77OA.js → video-y3iyn_B3.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-tmFYPP3M.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-CNP8q5YO.js} +2 -2
- package/dist/index.html +11 -11
- package/dist/server/addon.js +1 -1
- package/package.json +2 -2
- package/dist/assets/Build-CI7jwumR.js +0 -39
- package/dist/assets/CompositionBlockEditor-BT5ESlVA.js +0 -2
- package/dist/assets/Data-LMmcG11Z.js +0 -2
- package/dist/assets/DeviceDetail-CmSx-wcr.js +0 -2
- package/dist/assets/Integrations-hnU3rVRc.js +0 -2
- package/dist/assets/Library-U7UehtuJ.js +0 -1
- package/dist/assets/Notifications-DaqEVjuf.js +0 -1
- package/dist/assets/Templates-CiQI_yaN.js +0 -1
- package/dist/assets/circle-slash-C5yZWtgS.js +0 -1
- package/dist/assets/client-DTyBaAoV.js +0 -809
- package/dist/assets/crop-CvVxDKo4.js +0 -1
- package/dist/assets/device-picker-model-DgL25n41.js +0 -1
- package/dist/assets/dist-B57q2s8O.js +0 -809
- package/dist/assets/i18n-D-yIzM1J.js +0 -1
- package/dist/assets/mount-DgL25n41.js +0 -1
- package/dist/assets/remoteEntry-C_e5pzbe.js +0 -1
- package/dist/assets/src-Da4HIMZv.js +0 -100
- package/dist/assets/useEventInvalidation-DgL25n41.js +0 -1
- package/dist/assets/user-round-BvKrqouP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,S as t}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Xn as n,dt as r}from"./player-overlays-BDeIsXux.js";import{Cr as i,Er as a,Sr as o,br as s,cr as c,lr as l,or as u,sr as d,ur as f,xr as p}from"./client-DTyBaAoV.js";import{t as m}from"./grip-vertical-Dx0Aqv-v.js";import{Sf as h,vi as g}from"./src-Da4HIMZv.js";import{t as _}from"./useTranslation-BJr-n0es.js";import{Fr as v}from"./index-RgDw12BV.js";function y(){return{columns:3,rows:4,buttons:[]}}var b=e=>({status:`refused`,reason:e}),x=e=>({status:`ok`,grid:e});function S(e,t){return t.row>=0&&t.col>=0&&t.row+t.rowSpan<=e.rows&&t.col+t.colSpan<=e.columns}var C=p;function w(e,t){return t.row>=e.row&&t.col>=e.col&&t.row+t.rowSpan<=e.row+e.rowSpan&&t.col+t.colSpan<=e.col+e.colSpan}function T(e){return e.groups??[]}function E(e,t){return T(e).find(e=>e.id===t)}function ee(e,t){return e.buttons.filter(e=>e.groupId===t)}function D(e,t){let{groups:n,...r}=e;return t.length===0?r:{...r,groups:[...t]}}function O(e,t){let{groupId:n,...r}=t;for(let n of T(e))if(C(n,t))return n.frame===`divider`||!w(n,t)?`overlap`:{...r,groupId:n.id};return r}function k(e,t,n){if(t.rowSpan<1||t.colSpan<1)return`invalid-size`;if(!S(e,t))return`outside`;if(e.buttons.some(e=>e.id!==n&&C(e,t)))return`overlap`;let r=O(e,t);return typeof r==`string`?r:null}function A(e,t){let n=k(e,t,t.id);if(n!==null)return b(n);let r=O(e,t);return typeof r==`string`?b(r):x({...e,buttons:e.buttons.map(e=>e.id===t.id?r:e)})}function j(e,t){return e.buttons.find(e=>e.id===t)}function te(e){let t=new Set(e.buttons.map(e=>e.id));for(let n=e.buttons.length+1;;n+=1)if(!t.has(`b${n}`))return`b${n}`}function ne(e){for(let t=0;t<e.rows;t+=1)for(let n=0;n<e.columns;n+=1){let r={id:``,row:t,col:n,rowSpan:1,colSpan:1,role:`power`};if(!T(e).some(e=>C(e,r))&&k(e,r,null)===null)return{row:t,col:n}}return null}function re(e,t){if(e.buttons.length>=200)return b(`outside`);let n=ne(e);if(n===null)return b(`outside`);let r=O(e,{id:te(e),row:n.row,col:n.col,rowSpan:1,colSpan:1,role:t});return typeof r==`string`?b(r):x({...e,buttons:[...e.buttons,r]})}function M(e,t,n,r){let i=j(e,t);return i===void 0?b(`unknown-button`):A(e,{...i,row:n,col:r})}function ie(e,t,n,r){let i=j(e,t);return i===void 0?b(`unknown-button`):M(e,t,i.row+n,i.col+r)}function ae(e,t,n,r){let i=j(e,t);return i===void 0?b(`unknown-button`):A(e,{...i,rowSpan:n,colSpan:r})}function oe(e,t,n){let r=j(e,t);if(r===void 0)return b(`unknown-button`);let i=n.icon===void 0?r.icon:n.icon??void 0,a=n.label===void 0?r.label:n.label??void 0,o=a===void 0||a.trim()===``?void 0:a,{icon:s,label:c,...l}=r,u={...l,role:n.role??r.role,...i===void 0?{}:{icon:i},...o===void 0?{}:{label:o}};return x({...e,buttons:e.buttons.map(e=>e.id===t?u:e)})}function se(e,t,n){let r=j(e,t);if(r===void 0)return b(`unknown-button`);let{shape:i,tone:a,...o}=r,s=n.shape===void 0?r.shape:n.shape??void 0,c=n.tone===void 0?r.tone:n.tone??void 0,l={...o,...s===void 0?{}:{shape:s},...c===void 0?{}:{tone:c}};return x({...e,buttons:e.buttons.map(e=>e.id===t?l:e)})}function ce(e,t){return{...e,buttons:e.buttons.filter(e=>e.id!==t)}}var N=e=>e.ok?x(e.layout):b(e.reason);function le(e,t,n,r){return N(u(e,t,{row:n,col:r}))}function ue(e,t,n){return N(d(e,t,{keepButtons:n}))}function de(e,t,n){let r=E(e,t);if(r===void 0)return b(`unknown-group`);let{title:i,...a}=r,o=n.trim()===``?a:{...a,title:n.slice(0,40)};return x(D(e,T(e).map(e=>e.id===t?o:e)))}function fe(e){return e.frame===`divider`&&e.rowSpan===1&&e.size!==`normal`}function P(e){let t=new Set,n=T(e);for(let r of n){if(!fe(r))continue;let i=r.row;e.buttons.some(e=>e.row<=i&&i<e.row+e.rowSpan)||n.some(e=>e!==r&&e.row<=i&&i<e.row+e.rowSpan)||t.add(i)}return t}function F(e){let t=P(e);return Array.from({length:e.rows},(e,n)=>(t.has(n)?1:2.75)+.375)}function I(e,t,n){let r=E(e,t);if(r===void 0)return b(`unknown-group`);let{size:i,hideTitle:a,...o}=r,s=n.size??r.size,c=n.hideTitle??r.hideTitle,l={...o,...s===`normal`?{size:s}:{},...c===!0?{hideTitle:c}:{}};return x(D(e,T(e).map(e=>e.id===t?l:e)))}function L(e,t,n){let r=e=>!Number.isInteger(e)||e<1||e>24;if(r(t)||r(n))return b(`invalid-size`);let i={...e,columns:t,rows:n};return e.buttons.some(e=>!S(i,e))||T(e).some(e=>!S(i,e))?b(`would-drop-buttons`):x(i)}function R(e){let t=s.safeParse(e);return t.success?t.data:null}function z(e){let t=s.safeParse(e);return t.success?t.data:y()}var B=[`power`,`volume`,`channel`,`navigation`,`playback`,`digits`,`other`];function V(e){return e.startsWith(`power`)?`power`:e.startsWith(`volume`)||e===`mute`?`volume`:e.startsWith(`channel`)?`channel`:e.startsWith(`digit_`)?`digits`:[`up`,`down`,`left`,`right`,`ok`,`back`,`home`,`menu`,`exit`].includes(e)?`navigation`:[`play`,`pause`,`play_pause`,`stop`,`next`,`previous`,`fast_forward`,`rewind`].includes(e)?`playback`:`other`}function pe(e){return o.filter(t=>V(t)===e)}function me(e){let t=i(e),n=(t??e).replace(/_/g,` `);return t===null?n.charAt(0).toUpperCase()+n.slice(1):n}function he(e){return i(e)!==null&&!a(e)}function ge(e,t,n){let r={columns:e,rows:t,buttons:[]};for(let e of n){let t={id:e.id,row:e.row,col:e.col,rowSpan:e.rowSpan??1,colSpan:e.colSpan??1,role:e.role,...e.icon===void 0?{}:{icon:e.icon},...e.label===void 0?{}:{label:e.label}},n=k(r,t,null);if(n!==null||r.buttons.some(t=>t.id===e.id))throw Error(`layout button "${e.id}": ${n??`duplicate id`}`);r={...r,buttons:[...r.buttons,t]}}return r}var H=`"/></svg>`,_e={title:`Apple Music`,slug:`applemusic`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Apple Music</title><path d="`+this.path+H},path:`M23.994 6.124a9.23 9.23 0 00-.24-2.19c-.317-1.31-1.062-2.31-2.18-3.043a5.022 5.022 0 00-1.877-.726 10.496 10.496 0 00-1.564-.15c-.04-.003-.083-.01-.124-.013H5.986c-.152.01-.303.017-.455.026-.747.043-1.49.123-2.193.4-1.336.53-2.3 1.452-2.865 2.78-.192.448-.292.925-.363 1.408-.056.392-.088.785-.1 1.18 0 .032-.007.062-.01.093v12.223c.01.14.017.283.027.424.05.815.154 1.624.497 2.373.65 1.42 1.738 2.353 3.234 2.801.42.127.856.187 1.293.228.555.053 1.11.06 1.667.06h11.03a12.5 12.5 0 001.57-.1c.822-.106 1.596-.35 2.295-.81a5.046 5.046 0 001.88-2.207c.186-.42.293-.87.37-1.324.113-.675.138-1.358.137-2.04-.002-3.8 0-7.595-.003-11.393zm-6.423 3.99v5.712c0 .417-.058.827-.244 1.206-.29.59-.76.962-1.388 1.14-.35.1-.706.157-1.07.173-.95.045-1.773-.6-1.943-1.536a1.88 1.88 0 011.038-2.022c.323-.16.67-.25 1.018-.324.378-.082.758-.153 1.134-.24.274-.063.457-.23.51-.516a.904.904 0 00.02-.193c0-1.815 0-3.63-.002-5.443a.725.725 0 00-.026-.185c-.04-.15-.15-.243-.304-.234-.16.01-.318.035-.475.066-.76.15-1.52.303-2.28.456l-2.325.47-1.374.278c-.016.003-.032.01-.048.013-.277.077-.377.203-.39.49-.002.042 0 .086 0 .13-.002 2.602 0 5.204-.003 7.805 0 .42-.047.836-.215 1.227-.278.64-.77 1.04-1.434 1.233-.35.1-.71.16-1.075.172-.96.036-1.755-.6-1.92-1.544-.14-.812.23-1.685 1.154-2.075.357-.15.73-.232 1.108-.31.287-.06.575-.116.86-.177.383-.083.583-.323.6-.714v-.15c0-2.96 0-5.922.002-8.882 0-.123.013-.25.042-.37.07-.285.273-.448.546-.518.255-.066.515-.112.774-.165.733-.15 1.466-.296 2.2-.444l2.27-.46c.67-.134 1.34-.27 2.01-.403.22-.043.442-.088.663-.106.31-.025.523.17.554.482.008.073.012.148.012.223.002 1.91.002 3.822 0 5.732z`,source:`https://www.apple.com/itunes/marketing-on-music/identity-guidelines.html#apple-music-icon`,hex:`FA243C`},ve={title:`Apple TV`,slug:`appletv`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Apple TV</title><path d="`+this.path+H},path:`M20.57 17.735h-1.815l-3.34-9.203h1.633l2.02 5.987c.075.231.273.9.586 2.012l.297-.997.33-1.006 2.094-6.004H24zm-5.344-.066a5.76 5.76 0 0 1-1.55.207c-1.23 0-1.84-.693-1.84-2.087V9.646h-1.063V8.532h1.121V7.081l1.476-.602v2.062h1.707v1.113H13.38v5.805c0 .446.074.75.214.932.14.182.396.264.75.264.207 0 .495-.041.883-.115zm-7.29-5.343c.017 1.764 1.55 2.358 1.567 2.366-.017.042-.248.842-.808 1.658-.487.71-.99 1.418-1.79 1.435-.783.016-1.03-.462-1.93-.462-.89 0-1.17.445-1.913.478-.758.025-1.344-.775-1.838-1.484-.998-1.451-1.765-4.098-.734-5.88.51-.89 1.426-1.451 2.416-1.46.75-.016 1.468.512 1.93.512.461 0 1.327-.627 2.234-.536.38.016 1.452.157 2.136 1.154-.058.033-1.278.743-1.27 2.219M6.468 7.988c.404-.495.685-1.18.61-1.864-.585.025-1.294.388-1.723.883-.38.437-.71 1.138-.619 1.806.652.05 1.328-.338 1.732-.825Z`,source:`https://en.wikipedia.org/wiki/File:Apple_TV_(logo).svg`,hex:`000000`},ye={title:`Crunchyroll`,slug:`crunchyroll`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Crunchyroll</title><path d="`+this.path+H},path:`M2.909 13.436C2.914 7.61 7.642 2.893 13.468 2.898c5.576.005 10.137 4.339 10.51 9.819q.021-.351.022-.706C24.007 5.385 18.64.006 12.012 0S.007 5.36 0 11.988 5.36 23.994 11.988 24q.412 0 .815-.027c-5.526-.338-9.9-4.928-9.894-10.538Zm16.284.155a4.1 4.1 0 0 1-4.095-4.103 4.1 4.1 0 0 1 2.712-3.855 8.95 8.95 0 0 0-4.187-1.037 9.007 9.007 0 1 0 8.997 9.016q-.001-.847-.15-1.651a4.1 4.1 0 0 1-3.278 1.63Z`,source:`https://www.crunchyroll.com`,hex:`FF5E00`},be={title:`DAZN`,slug:`dazn`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>DAZN</title><path d="`+this.path+H},path:`M14.774 8.291l.772-2.596.79 2.596zm3.848 2.268l-2.025-6.128c-.045-.135-.097-.224-.154-.266-.059-.041-.152-.063-.28-.063h-1.12a.485.485 0 0 0-.284.068c-.06.045-.11.132-.149.261l-2.045 6.128c-.025.032-.038.096-.038.192 0 .149.09.223.27.223h.84c.076 0 .139-.003.187-.01a.207.207 0 0 0 .116-.048.326.326 0 0 0 .077-.116c.022-.051.046-.119.072-.202l.318-1.071h2.306l.327 1.051c.026.09.051.16.077.213a.395.395 0 0 0 .087.12c.031.028.07.047.114.053h.002c.045.006.103.01.173.01h.897c.18 0 .27-.074.27-.223a.59.59 0 0 0-.005-.09.878.878 0 0 0-.036-.108l.003.006zm-.994 2.467h-.646c-.168 0-.279.024-.333.072-.055.049-.082.147-.082.295v3.638l-1.91-3.647c-.076-.155-.152-.253-.226-.295-.074-.041-.204-.063-.39-.063h-.599c-.167 0-.278.025-.332.073-.055.048-.082.147-.082.294v6.138c0 .148.025.246.077.294.052.048.16.072.328.072h.656c.167 0 .278-.024.332-.072.055-.048.082-.146.082-.294v-3.648l1.91 3.657c.077.155.152.253.227.295.073.042.204.062.39.062h.598c.167 0 .278-.024.333-.072.054-.048.082-.146.082-.294v-6.138c0-.148-.028-.246-.082-.294-.055-.048-.166-.073-.333-.073zm3.203-.581l1.665 1.665v8.385H1.505V14.11l1.663-1.664a.63.63 0 0 0 0-.89L1.504 9.891V1.505h20.991v8.384l-1.665 1.666a.63.63 0 0 0 0 .89zM24 0H0v10.613L1.387 12 0 13.387V24h24V13.387L22.613 12 24 10.613zM10.67 18.469H7.96l2.855-4.014a.67.67 0 0 0 .087-.155.425.425 0 0 0 .019-.135v-.772c0-.148-.028-.246-.082-.294-.055-.048-.166-.073-.334-.073H6.382c-.149 0-.245.028-.29.082-.045.055-.068.169-.068.343v.58c0 .172.023.287.068.341.045.055.141.083.29.083h2.545L6.11 18.469a.438.438 0 0 0-.107.27v.792c0 .148.027.245.082.294.055.048.167.072.334.072h4.25c.148 0 .245-.027.29-.081.045-.055.068-.17.068-.344v-.579c0-.173-.023-.287-.068-.342-.045-.055-.142-.082-.29-.082zM9.408 8.233c0 .264-.017.484-.052.661-.036.177-.093.32-.174.43a.648.648 0 0 1-.318.231 1.523 1.523 0 0 1-.487.068h-.79v-4.17h.79c.366 0 .63.11.79.324.16.215.241.571.241 1.067v1.389zm1.38-2.789c-.225-.457-.533-.795-.921-1.013-.39-.219-.88-.328-1.47-.328H6.418c-.167 0-.278.024-.333.072-.054.049-.082.147-.082.294v6.138c0 .148.028.246.082.295.055.048.166.072.333.072h2.218c1.048 0 1.765-.447 2.15-1.342.09-.205.153-.413.188-.622a4.91 4.91 0 0 0 .054-.796V6.911c0-.367-.018-.656-.054-.868a2.2 2.2 0 0 0-.193-.612l.006.013z`,source:`https://media.dazn.com/en/assets/`,hex:`F8F8F5`},xe={title:`Kodi`,slug:`kodi`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Kodi</title><path d="`+this.path+H},path:`M12.03.047c-.226 0-.452.107-.669.324-.922.922-1.842 1.845-2.763 2.768-.233.233-.455.48-.703.695-.31.267-.405.583-.399.988.02 1.399.008 2.799.008 4.198 0 1.453-.002 2.907 0 4.36 0 .11.002.223.03.327.087.337.303.393.546.15 1.31-1.31 2.618-2.622 3.928-3.933l4.449-4.453c.43-.431.43-.905 0-1.336L12.697.37c-.216-.217-.442-.324-.668-.324zm7.224 7.23c-.223 0-.445.104-.65.309L14.82 11.37c-.428.429-.427.895 0 1.322l3.76 3.766c.44.44.908.44 1.346.002 1.215-1.216 2.427-2.433 3.644-3.647.182-.18.353-.364.43-.615v-.33c-.077-.251-.246-.436-.428-.617-1.224-1.22-2.443-2.445-3.666-3.668-.205-.205-.429-.307-.652-.307zM4.18 7.611c-.086.014-.145.094-.207.157L.209 11.572c-.28.284-.278.677.004.96l2.043 2.046c.59.59 1.177 1.182 1.767 1.772.169.168.33.139.416-.084.044-.114.062-.242.063-.364.004-1.283.004-2.567.004-3.851h-.002V8.184c0-.085-.01-.169-.022-.252-.019-.135-.072-.258-.207-.309a.186.186 0 0 0-.095-.012zm7.908 6.838c-.224 0-.447.106-.656.315L7.66 18.537c-.433.434-.433.899.002 1.334 1.215 1.216 2.43 2.43 3.643 3.649.18.18.361.354.611.433h.33c.244-.069.423-.226.598-.402 1.222-1.23 2.45-2.453 3.676-3.68.43-.43.427-.905-.004-1.338l-3.772-3.773c-.208-.208-.432-.311-.656-.31z`,source:`https://kodi.tv`,hex:`17B2E7`},Se={title:`Max`,slug:`max`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Max</title><path d="`+this.path+H},path:`M1.769 0A1.77 1.77 0 0 0 0 1.769V22.23A1.77 1.77 0 0 0 1.769 24H22.23A1.77 1.77 0 0 0 24 22.231V1.77A1.77 1.77 0 0 0 22.231 0zm12.485 3.28a4.301 4.301 0 0 1 4.3 4.302 4.301 4.301 0 0 1-1.993 3.63 6.085 6.085 0 0 1 1.054 3.422 6.085 6.085 0 0 1-6.085 6.085 6.085 6.085 0 0 1-6.085-6.085 6.085 6.085 0 0 1 4.66-5.916 4.301 4.301 0 0 1-.152-1.136 4.301 4.301 0 0 1 4.301-4.301zm0 1.849a2.453 2.453 0 0 0-2.453 2.453 2.453 2.453 0 0 0 2.453 2.453 2.453 2.453 0 0 0 2.453-2.453 2.453 2.453 0 0 0-2.453-2.453zm-2.724 5.268a4.237 4.237 0 0 0-4.237 4.237 4.237 4.237 0 0 0 4.237 4.237 4.237 4.237 0 0 0 4.237-4.237 4.237 4.237 0 0 0-4.237-4.237zm.032 2.54a1.781 1.781 0 1 1 0 3.562 1.781 1.781 0 0 1 0-3.562Z`,source:`https://cycling74.com`,hex:`525252`},Ce={title:`Netflix`,slug:`netflix`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Netflix</title><path d="`+this.path+H},path:`m5.398 0 8.348 23.602c2.346.059 4.856.398 4.856.398L10.113 0H5.398zm8.489 0v9.172l4.715 13.33V0h-4.715zM5.398 1.5V24c1.873-.225 2.81-.312 4.715-.398V14.83L5.398 1.5z`,source:`https://brand.netflix.com/en/assets/logos`,hex:`E50914`,guidelines:`https://brand.netflix.com/en/assets/logos`},we={title:`NOW`,slug:`now`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>NOW</title><path d="`+this.path+H},path:`M8.8009 11.9974c0-.974.7878-1.7634 1.7596-1.7634.9718 0 1.7596.7895 1.7596 1.7634 0 .9738-.7878 1.7634-1.7596 1.7634-.9718 0-1.7596-.7896-1.7596-1.7634zm13.0277-2.896l-1.2166 2.4524-.7878-2.3188-.0015-.0003c-.1566-.4505-.5822-.7737-1.0829-.7737-.399 0-.7505.2054-.956.517-.5255.8015-1.0497 1.6094-1.5735 2.414l-.2785-1.956c-.0963-.6296-.6807-1.0587-1.3048-.9624-.6249.096-1.0538.6778-.958 1.304l.0488.328c-.6427-1.0749-1.8162-1.7945-3.1575-1.7945-1.353 0-2.5352.7324-3.174 1.823l.07-.3434c.1223-.6008-.2645-1.1873-.864-1.31-.5993-.1223-1.1848.265-1.307.8659l-.4763 2.3382-1.752-2.7177c-.198-.3042-.5399-.5053-.9284-.5053-.5317 0-.976.3765-1.084.879l-1.0217 5.012c-.1223.6007.257 1.1846.8575 1.3121.0747.0159.1556.0235.2291.024.5139.0036.9763-.3579 1.0844-.892l.4763-2.3383c.5924.9217 1.1845 1.844 1.779 2.7641.196.2777.5281.4662.9018.4662.5462 0 1.0002-.398 1.0915-.9219l.469-2.302c.2292 1.815 1.7755 3.2187 3.6488 3.2187 1.7257 0 3.1736-1.191 3.5705-2.7972l.2613 1.759c.0736.579.5474 1.0371 1.1411 1.0371.4272 0 .7756-.2445.9972-.5841l1.8844-2.8942.905 2.6645c.1622.4752.5808.8138 1.0961.8138.4788 0 .855-.288 1.0609-.7155l2.402-4.845c.2834-.568.0528-1.2551-.5123-1.5403-.5647-.285-1.2558-.0524-1.5379.5196Z`,source:`https://www.nowtv.com`,hex:`001211`},Te={title:`Paramount+`,slug:`paramountplus`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Paramount+</title><path d="`+this.path+H},path:`M16.347 21.373c.057-.084.151-.314-.025-.74l-.53-1.428c-.073-.182.084-.293.19-.173 0 0 1.004 1.157 1.264 1.64l.495.822c.425.028 1.6.06 2.732.06a3.26 3.26 0 0 1-.316-.364c-1.93-2.392-3.154-3.724-3.166-3.737-.391-.426-.572-.508-.87-.643a4.82 4.82 0 0 1-.138-.065v.364c0 .047-.057.073-.086.022l-2.846-5.001a1.598 1.598 0 0 0-.508-.587l-.277-.194-1.354 3.123c.212 0 .354.216.27.409l-1.25 2.893h1.147c.443 0 .883.087 1.294.255l.302.125s-.913 1.878-.913 2.867c0 .181.028.362.075.534h2.104l-.096-.595s1.266.294 2.502.413M12 2.437c-6.627 0-12 5.373-12 12 0 2.669.873 5.133 2.346 7.126.503-.218.783-.542.983-.791l2.234-2.858a.467.467 0 0 1 .179-.138l.336-.146 3.674-4.659.534-.417 1.094-1.524a.482.482 0 0 1 .101-.102l.478-.347a.34.34 0 0 1 .398-.004l.578.407c.308.216.557.504.726.84l2.322 4.077c.051.09.09.129.182.174.454.227.732.268 1.33.913.277.304 1.495 1.666 3.203 3.784.236.318.538.588.963.783A11.948 11.948 0 0 0 24 14.437c0-6.627-5.373-12-12-12M3.236 15.1l-.778-.253-.48.662v-.818l-.778-.253.778-.253v-.818l.48.662.778-.253-.48.662Zm-.185 2.676-.252.778-.253-.778h-.818l.661-.481-.253-.777.663.48.66-.48-.252.777.662.481Zm.156-6.195.253.778-.661-.48-.663.48.253-.778-.66-.48h.817l.253-.778.252.777h.818Zm1.314-1.76L4.04 9.16l-.778.253.48-.661-.48-.663.778.254.48-.662v.818l.778.253-.777.252Zm2.045-2.862-.253.777-.252-.777h-.818l.662-.48-.253-.778.661.48.661-.48-.252.777.662.48Zm2.577-1.313-.48.661V5.49l-.779-.254.778-.253v-.817l.48.66.78-.253-.481.663.48.66zm3.265-.75.253.778-.661-.48-.662.48.252-.777-.66-.481h.818L12 3.637l.252.778h.818zm2.93.595v.816l-.481-.661-.777.252.48-.662-.48-.662.777.253.48-.66v.817l.779.252zm5.426 8.285.778.253.48-.662v.818l.778.253-.778.253v.818l-.48-.662-.778.253.48-.662zm-3.077-6.04-.253-.777h-.818l.662-.48-.253-.778.662.48.662-.48-.254.778.662.48h-.818zm1.792 2.086v-.818l-.777-.252.777-.253V7.68l.481.662.777-.254-.48.663.48.66-.777-.252zm1.469 1.278.253-.777.254.777h.816l-.66.481.252.778-.662-.48-.661.48.253-.778-.662-.48zm.506 6.676-.253.778-.253-.778h-.817l.662-.481-.253-.777.66.48.663-.48-.253.777.661.481zm-12.08-.615.76-1.588c.024-.048-.032-.108-.067-.067l-.664.668c-.313.329-.847 1.25-.95 1.421l-.808 1.335a.109.109 0 0 1 .1.162l-.739 1.238c-.18.309.145.523.189.452 1.157-1.868 1.832-1.719 1.832-1.719l.387-.897c.022-.047-.001-.1-.05-.12-.12-.05-.316-.27.01-.885z`,source:`https://www.paramount.com/brand/paramount-plus`,hex:`0064FF`},Ee={title:`Plex`,slug:`plex`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Plex</title><path d="`+this.path+H},path:`M3.987 8.409c-.96 0-1.587.28-2.12.933v-.72H0v8.88s.038.018.127.037c.138.03.821.187 1.331-.249.441-.377.542-.814.542-1.318v-1.283c.533.573 1.147.813 2 .813 1.84 0 3.253-1.493 3.253-3.48 0-2.12-1.36-3.613-3.266-3.613Zm16.748 5.595.406.591c.391.614.894.906 1.492.908.621-.012 1.064-.562 1.226-.755 0 0-.307-.27-.686-.72-.517-.614-1.214-1.755-1.24-1.803l-1.198 1.779Zm-3.205-1.955c0-2.08-1.52-3.64-3.52-3.64s-3.467 1.587-3.467 3.573a3.48 3.48 0 0 0 3.507 3.52c1.413 0 2.626-.84 3.253-2.293h-2.04l-.093.093c-.427.4-.72.533-1.227.533-.787 0-1.373-.506-1.453-1.266h4.986c.04-.214.054-.307.054-.52Zm-7.671-.219c0 .769.11 1.701.868 2.722l.056.069c-.306.526-.742.88-1.248.88-.399 0-.814-.211-1.138-.579a2.177 2.177 0 0 1-.538-1.441V6.409H9.86l-.001 5.421Zm9.283 3.46h-2.39l2.247-3.332-2.247-3.335h2.39l2.248 3.335-2.248 3.332Zm1.593-1.286Zm-17.162-.342c-.933 0-1.68-.773-1.68-1.72s.76-1.666 1.68-1.666c.92 0 1.68.733 1.68 1.68 0 .946-.733 1.706-1.68 1.706Zm18.361-1.974L24 8.622h-2.391l-.87 1.293 1.195 1.773Zm-9.404-.466c.16-.706.72-1.133 1.493-1.133.773 0 1.373.467 1.507 1.133h-3Z`,source:`https://brand.plex.tv`,hex:`EBAF00`,guidelines:`https://brand.plex.tv`},De={title:`Sky`,slug:`sky`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Sky</title><path d="`+this.path+H},path:`M7.387 13.656c0 1.423-.933 2.454-2.823 2.675-1.35.147-3.337-.025-4.294-.148-.025-.147-.074-.343-.074-.49 0-1.252.663-1.522 1.3-1.522.664 0 1.694.123 2.455.123.834 0 1.104-.295 1.104-.565 0-.368-.343-.515-1.006-.638l-1.767-.343C.785 12.453 0 11.423 0 10.343c0-1.325.933-2.454 2.798-2.65 1.398-.148 3.116.024 4.049.122.024.172.049.32.049.491 0 1.252-.663 1.522-1.276 1.522-.491 0-1.227-.099-2.086-.099-.884 0-1.227.246-1.227.54 0 .32.343.442.883.54l1.718.32c1.742.294 2.479 1.3 2.479 2.527m3.092 1.521c0 .761-.295 1.203-1.792 1.203-.196 0-.368-.025-.54-.05V6.22c0-.76.27-1.57 1.767-1.57.196 0 .393.024.565.049zm6.085 3.927c.197.098.59.22 1.105.245.859.025 1.325-.319 1.693-1.08L24 7.913a2.5 2.5 0 0 0-.957-.22c-.589 0-1.399.122-1.914 1.325l-1.497 3.534-2.945-4.81c-.196-.05-.662-.148-1.006-.148-1.03 0-1.62.393-2.233 1.031l-2.871 3.141 2.306 3.632c.418.663.982 1.006 1.89 1.006.589 0 1.104-.147 1.325-.245l-2.773-4.196 1.963-2.086 3.24 5.08Z`,source:`https://www.skysports.com`,hex:`0072C9`},Oe={title:`Spotify`,slug:`spotify`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Spotify</title><path d="`+this.path+H},path:`M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z`,source:`https://developer.spotify.com/documentation/general/design-and-branding/#using-our-logo`,hex:`1ED760`,guidelines:`https://developer.spotify.com/documentation/general/design-and-branding/#using-our-logo`},ke={title:`Twitch`,slug:`twitch`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Twitch</title><path d="`+this.path+H},path:`M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z`,source:`https://brand.twitch.tv`,hex:`9146FF`,guidelines:`https://brand.twitch.tv`},Ae={title:`YouTube`,slug:`youtube`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>YouTube</title><path d="`+this.path+H},path:`M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z`,source:`https://www.youtube.com/howyoutubeworks/resources/brand-resources/#logos-icons-and-colors`,hex:`FF0000`,guidelines:`https://www.youtube.com/howyoutubeworks/resources/brand-resources/#logos-icons-and-colors`},je={title:`YouTube Music`,slug:`youtubemusic`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>YouTube Music</title><path d="`+this.path+H},path:`M12 0C5.376 0 0 5.376 0 12s5.376 12 12 12 12-5.376 12-12S18.624 0 12 0zm0 19.104c-3.924 0-7.104-3.18-7.104-7.104S8.076 4.896 12 4.896s7.104 3.18 7.104 7.104-3.18 7.104-7.104 7.104zm0-13.332c-3.432 0-6.228 2.796-6.228 6.228S8.568 18.228 12 18.228s6.228-2.796 6.228-6.228S15.432 5.772 12 5.772zM9.684 15.54V8.46L15.816 12l-6.132 3.54z`,source:`https://partnermarketinghub.withgoogle.com/#/brands`,hex:`FF0000`},Me=`app:`,U=(e,t,n)=>({key:e,label:t,mark:{kind:`glyph`,path:n.path,hex:n.hex}}),W=(e,t,n)=>({key:e,label:t,mark:{kind:`lettermark`,text:n}}),G=[U(`netflix`,`Netflix`,Ce),U(`youtube`,`YouTube`,Ae),W(`primevideo`,`Prime Video`,`prime`),W(`disneyplus`,`Disney+`,`D+`),U(`spotify`,`Spotify`,Oe),U(`plex`,`Plex`,Ee),U(`appletv`,`Apple TV`,ve),U(`dazn`,`DAZN`,be),W(`raiplay`,`RaiPlay`,`Rai`),W(`mediasetinfinity`,`Mediaset Infinity`,`MI`),U(`now`,`NOW`,we),U(`twitch`,`Twitch`,ke),U(`max`,`Max`,Se),U(`paramountplus`,`Paramount+`,Te),U(`crunchyroll`,`Crunchyroll`,ye),U(`sky`,`Sky`,De),U(`youtubemusic`,`YouTube Music`,je),U(`applemusic`,`Apple Music`,_e),U(`kodi`,`Kodi`,xe)],Ne=new Map(G.map(e=>[e.key,e]));function Pe(e){return`${Me}${e}`}function K(e){if(!(e===void 0||!e.startsWith(`app:`)))return Ne.get(e.slice(4))}function Fe(e){if(!/^[0-9a-fA-F]{6}$/.test(e))return null;let t=t=>{let n=Number.parseInt(e.slice(t,t+2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*t(0)+.7152*t(2)+.0722*t(4)}var Ie=.011,Le=.91,q=2.2;function J(e,t){let[n,r]=e>t?[e,t]:[t,e];return(n+.05)/(r+.05)}function Re(e){if(e.kind!==`glyph`)return null;let t=Fe(e.hex);return t===null?null:J(t,Ie)>=q&&J(t,Le)>=q?`#${e.hex}`:null}function ze({brand:e}){if(e.mark.kind===`lettermark`)return t(`span`,{className:`text-[11px] font-semibold leading-none`,"aria-hidden":!0,children:e.mark.text});let n=Re(e.mark);return t(`svg`,{viewBox:`0 0 24 24`,className:`h-4 w-4 fill-current`,"aria-hidden":!0,style:n===null?void 0:{fill:n},children:t(`path`,{d:e.mark.path})})}function Be(e){return e.toLowerCase().startsWith(`it`)?`it`:`en`}function Y(e,t){return l(e,Be(t))}function Ve(e){switch(e){case`rect`:return`rounded-sm`;case`rounded`:return`rounded-xl`;case`round`:return`aspect-square h-full w-auto justify-self-center rounded-full`;case`pill`:return`rounded-full`;default:return``}}function He(e){switch(e){case`accent`:return`border-primary bg-primary text-primary-foreground hover:bg-primary/90`;case`danger`:return`border-danger bg-danger-fill text-danger-on hover:bg-danger-fill/90`;case`red`:return`border-danger/40 bg-danger/15 text-danger hover:bg-danger/25`;case`green`:return`border-success/40 bg-success/15 text-success hover:bg-success/25`;case`yellow`:return`border-warning/40 bg-warning/15 text-warning hover:bg-warning/25`;case`blue`:return`border-info/40 bg-info/15 text-info hover:bg-info/25`;default:return``}}function Ue(e){switch(e){case`panel`:return`rounded-lg border border-border bg-surface/40`;case`dpad`:return`rounded-3xl border border-border bg-surface`;case`rocker-v`:case`rocker-h`:return`rounded-full border border-border bg-surface`;case`keypad`:return`rounded-lg border border-border-subtle bg-surface/60`;default:return``}}function We(e){return e===`divider`}function X(e,t){let n=Math.min(Math.max(t.row,0),e.rows-1),r=Math.min(Math.max(t.col,0),e.columns-1),i=Math.min(Math.max(t.row+t.rowSpan,n+1),e.rows),a=Math.min(Math.max(t.col+t.colSpan,r+1),e.columns);return{row:n,col:r,rowSpan:i-n,colSpan:a-r}}var Ge=`2.75rem`,Ke=`1.25rem`,qe=`1rem`;function Je(e){let t=new Set;for(let n of e.buttons)for(let e=n.row;e<n.row+n.rowSpan;e+=1)for(let r=n.col;r<n.col+n.colSpan;r+=1)t.add(`${e}:${r}`);return t}var Z=new Set([`red`,`green`,`yellow`,`blue`]);function Ye(e,t){return e.label??K(e.icon)?.label??t}function Xe(e){return e.label===void 0||K(e.icon)!==void 0?!1:e.tone===void 0||!Z.has(e.tone)}function Ze(e){if(e.icon!==void 0)return e.icon;if(!(e.tone!==void 0&&Z.has(e.tone)))return c(e.role)}function Qe({button:n,compact:r}){let i=h(),a=K(n.icon),o=Ze(n),s=n.icon===void 0?f(n.role):void 0,c=o===void 0||a!==void 0||s!==void 0?void 0:i(o),l=Xe(n)?n.label:void 0;return e(`span`,{className:`flex flex-col items-center justify-center gap-0.5 leading-none`,children:[a!==void 0&&t(ze,{brand:a}),c!==void 0&&t(c,{className:`h-4 w-4`,"aria-hidden":!0}),s!==void 0&&t(`span`,{className:`text-sm font-medium`,children:s}),l!==void 0&&!r&&t(`span`,{className:`max-w-full truncate text-[11px]`,children:l})]})}function Q(e){return{gridRow:`${e.row+1} / span ${e.rowSpan}`,gridColumn:`${e.col+1} / span ${e.colSpan}`}}function $e({group:n,selected:i,dragging:a,compact:o,editable:s,onSelect:c,onPointerDown:l,onKeyDown:u}){let{t:d}=_(),f=We(n.frame),p=!s||o||n.hideTitle===!0?void 0:n.title;return e(`div`,{"data-testid":`remote-group-${n.id}`,"data-frame":n.frame,className:r(`relative -m-0.5 flex`,Ue(n.frame),a&&`opacity-40`,i&&`ring-2 ring-primary`),style:Q(n),children:[f?e(`div`,{className:`flex w-full items-center gap-2 px-1 text-[10px] uppercase tracking-wide text-foreground-muted`,children:[t(`span`,{className:`h-px flex-1 bg-border`,"aria-hidden":!0}),p!==void 0&&t(`span`,{className:`truncate`,children:p}),p!==void 0&&t(`span`,{className:`h-px flex-1 bg-border`,"aria-hidden":!0})]}):p!==void 0&&t(`span`,{className:`absolute -top-1.5 left-3 max-w-[70%] truncate bg-background-elevated px-1 text-[10px] uppercase leading-none tracking-wide text-foreground-muted`,children:p}),s&&t(`button`,{type:`button`,"aria-label":d(`remote.layout.groupHandle`,{name:n.title??n.componentId}),"aria-pressed":i,"data-testid":`remote-group-handle-${n.id}`,className:`absolute -right-1 -top-2.5 z-20 flex h-4 w-4 touch-none cursor-grab items-center justify-center rounded-full border border-border bg-surface-hover text-foreground-muted hover:text-foreground`,onClick:c,onPointerDown:l,onKeyDown:u,children:t(m,{className:`h-3 w-3`,"aria-hidden":!0})})]})}function et({grid:n,label:i,selectedId:a=null,onSelect:o,boundRoles:s,showEmptyCells:c=!1,compact:l=!1,gridRef:u,selectedGroupId:d=null,onSelectGroup:f,onItemPointerDown:p,onItemKeyDown:m,drag:h=null}){let{i18n:v}=_(),y=p!==void 0,b=h!==null,x=Je(n),S=P(n),C=[];if(c||b)for(let e=0;e<n.rows;e+=1)for(let t=0;t<n.columns;t+=1)(b||!x.has(`${e}:${t}`)&&!S.has(e))&&C.push({row:e,col:t});let w=h?.preview??null;return e(`div`,{role:`group`,"aria-label":i,"data-testid":`remote-grid`,ref:u,className:r(`grid gap-1.5`,l?`auto-rows-[1.25rem] gap-0.5`:`auto-rows-[2.75rem]`),style:{gridTemplateColumns:`repeat(${n.columns}, minmax(0, 1fr))`,...S.size===0?{}:{gridTemplateRows:Array.from({length:n.rows},(e,t)=>S.has(t)?qe:l?Ke:Ge).join(` `)}},children:[C.map(({row:e,col:n})=>t(`div`,{"aria-hidden":!0,"data-testid":`remote-grid-cell`,className:r(`rounded-md border border-dashed`,b?`border-border`:`border-border-subtle`),style:{gridRow:`${e+1}`,gridColumn:`${n+1}`}},`e${e}:${n}`)),(n.groups??[]).map(e=>t($e,{group:e,selected:e.id===d,dragging:h?.item.kind===`group`&&h.item.id===e.id,compact:l,editable:y,onSelect:f===void 0?void 0:()=>f(e.id),onPointerDown:p===void 0?void 0:t=>p({kind:`group`,id:e.id},t),onKeyDown:m===void 0?void 0:t=>m({kind:`group`,id:e.id},t)},e.id)),n.buttons.map(e=>{let n=e.id===a,i=s===void 0||s.has(e.role),c=h?.item.kind===`button`&&h.item.id===e.id,u={kind:`button`,id:e.id},d=Ye(e,Y(e.role,v.language));return t(g,{type:`button`,size:`sm`,variant:i?`secondary`:`outline`,"aria-pressed":o===void 0?void 0:n,"aria-label":d,title:d,"data-testid":`remote-grid-button-${e.id}`,"data-shape":e.shape,"data-tone":e.tone,className:r(`z-10 h-full min-w-0 overflow-hidden border border-border px-1`,l&&`px-0`,Ve(e.shape),He(e.tone),y&&`touch-none`,c&&`opacity-40`,n&&`ring-2 ring-primary ring-offset-1 ring-offset-background`),style:Q(e),onClick:o===void 0?void 0:()=>o(e.id),onPointerDown:p===void 0?void 0:e=>p(u,e),onKeyDown:m===void 0?void 0:e=>m(u,e),children:t(Qe,{button:e,compact:l})},e.id)}),w!==null&&t(`div`,{"aria-hidden":!0,"data-testid":`remote-drop-target`,"data-valid":w.valid,className:r(`pointer-events-none z-30 rounded-md border-2 border-dashed`,w.valid?`border-success bg-success/20`:`border-danger bg-danger/20`),style:Q(X(n,w.rect))})]})}var $=`edit`;function tt(e){return`/system/templates?${$}=${encodeURIComponent(e)}`}function nt({templateId:r,testId:i}){let{t:a}=_(),o=v();return e(g,{size:`sm`,variant:`ghost`,onClick:()=>o(tt(r)),"data-testid":i??`remote-edit-template`,children:[t(n,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),a(`remote.editTemplate`)]})}export{ie as A,ae as C,se as D,oe as E,de as O,ce as S,F as T,pe as _,G as a,M as b,B as c,R as d,ue as f,he as g,me as h,Y as i,I as k,re as l,E as m,$ as n,Pe as o,y as p,et as r,K as s,nt as t,ge as u,z as v,L as w,le as x,ee as y};
|
|
1
|
+
import{C as e,S as t}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Xn as n,dt as r}from"./player-overlays-D5PuUVGx.js";import{Cr as i,Dr as a,Sr as o,cr as s,dr as c,lr as l,sr as u,ur as d,wr as f,xr as p}from"./client-DDfmis6s.js";import{t as m}from"./grip-vertical-BaflvEVj.js";import{Sf as h,vi as g}from"./src-kgyauwxD.js";import{t as _}from"./useTranslation-BJr-n0es.js";import{Fr as v}from"./index-tVCZ0Ciq.js";function y(){return{columns:3,rows:4,buttons:[]}}var b=e=>({status:`refused`,reason:e}),x=e=>({status:`ok`,grid:e});function S(e,t){return t.row>=0&&t.col>=0&&t.row+t.rowSpan<=e.rows&&t.col+t.colSpan<=e.columns}var C=o;function w(e,t){return t.row>=e.row&&t.col>=e.col&&t.row+t.rowSpan<=e.row+e.rowSpan&&t.col+t.colSpan<=e.col+e.colSpan}function T(e){return e.groups??[]}function E(e,t){return T(e).find(e=>e.id===t)}function ee(e,t){return e.buttons.filter(e=>e.groupId===t)}function D(e,t){let{groups:n,...r}=e;return t.length===0?r:{...r,groups:[...t]}}function O(e,t){let{groupId:n,...r}=t;for(let n of T(e))if(C(n,t))return n.frame===`divider`||!w(n,t)?`overlap`:{...r,groupId:n.id};return r}function k(e,t,n){if(t.rowSpan<1||t.colSpan<1)return`invalid-size`;if(!S(e,t))return`outside`;if(e.buttons.some(e=>e.id!==n&&C(e,t)))return`overlap`;let r=O(e,t);return typeof r==`string`?r:null}function A(e,t){let n=k(e,t,t.id);if(n!==null)return b(n);let r=O(e,t);return typeof r==`string`?b(r):x({...e,buttons:e.buttons.map(e=>e.id===t.id?r:e)})}function j(e,t){return e.buttons.find(e=>e.id===t)}function te(e){let t=new Set(e.buttons.map(e=>e.id));for(let n=e.buttons.length+1;;n+=1)if(!t.has(`b${n}`))return`b${n}`}function ne(e){for(let t=0;t<e.rows;t+=1)for(let n=0;n<e.columns;n+=1){let r={id:``,row:t,col:n,rowSpan:1,colSpan:1,role:`power`};if(!T(e).some(e=>C(e,r))&&k(e,r,null)===null)return{row:t,col:n}}return null}function re(e,t){if(e.buttons.length>=200)return b(`outside`);let n=ne(e);if(n===null)return b(`outside`);let r=O(e,{id:te(e),row:n.row,col:n.col,rowSpan:1,colSpan:1,role:t});return typeof r==`string`?b(r):x({...e,buttons:[...e.buttons,r]})}function M(e,t,n,r){let i=j(e,t);return i===void 0?b(`unknown-button`):A(e,{...i,row:n,col:r})}function ie(e,t,n,r){let i=j(e,t);return i===void 0?b(`unknown-button`):M(e,t,i.row+n,i.col+r)}function ae(e,t,n,r){let i=j(e,t);return i===void 0?b(`unknown-button`):A(e,{...i,rowSpan:n,colSpan:r})}function oe(e,t,n){let r=j(e,t);if(r===void 0)return b(`unknown-button`);let i=n.icon===void 0?r.icon:n.icon??void 0,a=n.label===void 0?r.label:n.label??void 0,o=a===void 0||a.trim()===``?void 0:a,{icon:s,label:c,...l}=r,u={...l,role:n.role??r.role,...i===void 0?{}:{icon:i},...o===void 0?{}:{label:o}};return x({...e,buttons:e.buttons.map(e=>e.id===t?u:e)})}function se(e,t,n){let r=j(e,t);if(r===void 0)return b(`unknown-button`);let{shape:i,tone:a,...o}=r,s=n.shape===void 0?r.shape:n.shape??void 0,c=n.tone===void 0?r.tone:n.tone??void 0,l={...o,...s===void 0?{}:{shape:s},...c===void 0?{}:{tone:c}};return x({...e,buttons:e.buttons.map(e=>e.id===t?l:e)})}function ce(e,t){return{...e,buttons:e.buttons.filter(e=>e.id!==t)}}var N=e=>e.ok?x(e.layout):b(e.reason);function le(e,t,n,r){return N(u(e,t,{row:n,col:r}))}function ue(e,t,n){return N(s(e,t,{keepButtons:n}))}function de(e,t,n){let r=E(e,t);if(r===void 0)return b(`unknown-group`);let{title:i,...a}=r,o=n.trim()===``?a:{...a,title:n.slice(0,40)};return x(D(e,T(e).map(e=>e.id===t?o:e)))}function fe(e){return e.frame===`divider`&&e.rowSpan===1&&e.size!==`normal`}function P(e){let t=new Set,n=T(e);for(let r of n){if(!fe(r))continue;let i=r.row;e.buttons.some(e=>e.row<=i&&i<e.row+e.rowSpan)||n.some(e=>e!==r&&e.row<=i&&i<e.row+e.rowSpan)||t.add(i)}return t}function F(e){let t=P(e);return Array.from({length:e.rows},(e,n)=>(t.has(n)?1:2.75)+.375)}function I(e,t,n){let r=E(e,t);if(r===void 0)return b(`unknown-group`);let{size:i,hideTitle:a,...o}=r,s=n.size??r.size,c=n.hideTitle??r.hideTitle,l={...o,...s===`normal`?{size:s}:{},...c===!0?{hideTitle:c}:{}};return x(D(e,T(e).map(e=>e.id===t?l:e)))}function L(e,t,n){let r=e=>!Number.isInteger(e)||e<1||e>24;if(r(t)||r(n))return b(`invalid-size`);let i={...e,columns:t,rows:n};return e.buttons.some(e=>!S(i,e))||T(e).some(e=>!S(i,e))?b(`would-drop-buttons`):x(i)}function R(e){let t=p.safeParse(e);return t.success?t.data:null}function z(e){let t=p.safeParse(e);return t.success?t.data:y()}var B=[`power`,`volume`,`channel`,`navigation`,`playback`,`digits`,`other`];function V(e){return e.startsWith(`power`)?`power`:e.startsWith(`volume`)||e===`mute`?`volume`:e.startsWith(`channel`)?`channel`:e.startsWith(`digit_`)?`digits`:[`up`,`down`,`left`,`right`,`ok`,`back`,`home`,`menu`,`exit`].includes(e)?`navigation`:[`play`,`pause`,`play_pause`,`stop`,`next`,`previous`,`fast_forward`,`rewind`].includes(e)?`playback`:`other`}function pe(e){return i.filter(t=>V(t)===e)}function me(e){let t=f(e),n=(t??e).replace(/_/g,` `);return t===null?n.charAt(0).toUpperCase()+n.slice(1):n}function he(e){return f(e)!==null&&!a(e)}function ge(e,t,n){let r={columns:e,rows:t,buttons:[]};for(let e of n){let t={id:e.id,row:e.row,col:e.col,rowSpan:e.rowSpan??1,colSpan:e.colSpan??1,role:e.role,...e.icon===void 0?{}:{icon:e.icon},...e.label===void 0?{}:{label:e.label}},n=k(r,t,null);if(n!==null||r.buttons.some(t=>t.id===e.id))throw Error(`layout button "${e.id}": ${n??`duplicate id`}`);r={...r,buttons:[...r.buttons,t]}}return r}var H=`"/></svg>`,_e={title:`Apple Music`,slug:`applemusic`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Apple Music</title><path d="`+this.path+H},path:`M23.994 6.124a9.23 9.23 0 00-.24-2.19c-.317-1.31-1.062-2.31-2.18-3.043a5.022 5.022 0 00-1.877-.726 10.496 10.496 0 00-1.564-.15c-.04-.003-.083-.01-.124-.013H5.986c-.152.01-.303.017-.455.026-.747.043-1.49.123-2.193.4-1.336.53-2.3 1.452-2.865 2.78-.192.448-.292.925-.363 1.408-.056.392-.088.785-.1 1.18 0 .032-.007.062-.01.093v12.223c.01.14.017.283.027.424.05.815.154 1.624.497 2.373.65 1.42 1.738 2.353 3.234 2.801.42.127.856.187 1.293.228.555.053 1.11.06 1.667.06h11.03a12.5 12.5 0 001.57-.1c.822-.106 1.596-.35 2.295-.81a5.046 5.046 0 001.88-2.207c.186-.42.293-.87.37-1.324.113-.675.138-1.358.137-2.04-.002-3.8 0-7.595-.003-11.393zm-6.423 3.99v5.712c0 .417-.058.827-.244 1.206-.29.59-.76.962-1.388 1.14-.35.1-.706.157-1.07.173-.95.045-1.773-.6-1.943-1.536a1.88 1.88 0 011.038-2.022c.323-.16.67-.25 1.018-.324.378-.082.758-.153 1.134-.24.274-.063.457-.23.51-.516a.904.904 0 00.02-.193c0-1.815 0-3.63-.002-5.443a.725.725 0 00-.026-.185c-.04-.15-.15-.243-.304-.234-.16.01-.318.035-.475.066-.76.15-1.52.303-2.28.456l-2.325.47-1.374.278c-.016.003-.032.01-.048.013-.277.077-.377.203-.39.49-.002.042 0 .086 0 .13-.002 2.602 0 5.204-.003 7.805 0 .42-.047.836-.215 1.227-.278.64-.77 1.04-1.434 1.233-.35.1-.71.16-1.075.172-.96.036-1.755-.6-1.92-1.544-.14-.812.23-1.685 1.154-2.075.357-.15.73-.232 1.108-.31.287-.06.575-.116.86-.177.383-.083.583-.323.6-.714v-.15c0-2.96 0-5.922.002-8.882 0-.123.013-.25.042-.37.07-.285.273-.448.546-.518.255-.066.515-.112.774-.165.733-.15 1.466-.296 2.2-.444l2.27-.46c.67-.134 1.34-.27 2.01-.403.22-.043.442-.088.663-.106.31-.025.523.17.554.482.008.073.012.148.012.223.002 1.91.002 3.822 0 5.732z`,source:`https://www.apple.com/itunes/marketing-on-music/identity-guidelines.html#apple-music-icon`,hex:`FA243C`},ve={title:`Apple TV`,slug:`appletv`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Apple TV</title><path d="`+this.path+H},path:`M20.57 17.735h-1.815l-3.34-9.203h1.633l2.02 5.987c.075.231.273.9.586 2.012l.297-.997.33-1.006 2.094-6.004H24zm-5.344-.066a5.76 5.76 0 0 1-1.55.207c-1.23 0-1.84-.693-1.84-2.087V9.646h-1.063V8.532h1.121V7.081l1.476-.602v2.062h1.707v1.113H13.38v5.805c0 .446.074.75.214.932.14.182.396.264.75.264.207 0 .495-.041.883-.115zm-7.29-5.343c.017 1.764 1.55 2.358 1.567 2.366-.017.042-.248.842-.808 1.658-.487.71-.99 1.418-1.79 1.435-.783.016-1.03-.462-1.93-.462-.89 0-1.17.445-1.913.478-.758.025-1.344-.775-1.838-1.484-.998-1.451-1.765-4.098-.734-5.88.51-.89 1.426-1.451 2.416-1.46.75-.016 1.468.512 1.93.512.461 0 1.327-.627 2.234-.536.38.016 1.452.157 2.136 1.154-.058.033-1.278.743-1.27 2.219M6.468 7.988c.404-.495.685-1.18.61-1.864-.585.025-1.294.388-1.723.883-.38.437-.71 1.138-.619 1.806.652.05 1.328-.338 1.732-.825Z`,source:`https://en.wikipedia.org/wiki/File:Apple_TV_(logo).svg`,hex:`000000`},ye={title:`Crunchyroll`,slug:`crunchyroll`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Crunchyroll</title><path d="`+this.path+H},path:`M2.909 13.436C2.914 7.61 7.642 2.893 13.468 2.898c5.576.005 10.137 4.339 10.51 9.819q.021-.351.022-.706C24.007 5.385 18.64.006 12.012 0S.007 5.36 0 11.988 5.36 23.994 11.988 24q.412 0 .815-.027c-5.526-.338-9.9-4.928-9.894-10.538Zm16.284.155a4.1 4.1 0 0 1-4.095-4.103 4.1 4.1 0 0 1 2.712-3.855 8.95 8.95 0 0 0-4.187-1.037 9.007 9.007 0 1 0 8.997 9.016q-.001-.847-.15-1.651a4.1 4.1 0 0 1-3.278 1.63Z`,source:`https://www.crunchyroll.com`,hex:`FF5E00`},be={title:`DAZN`,slug:`dazn`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>DAZN</title><path d="`+this.path+H},path:`M14.774 8.291l.772-2.596.79 2.596zm3.848 2.268l-2.025-6.128c-.045-.135-.097-.224-.154-.266-.059-.041-.152-.063-.28-.063h-1.12a.485.485 0 0 0-.284.068c-.06.045-.11.132-.149.261l-2.045 6.128c-.025.032-.038.096-.038.192 0 .149.09.223.27.223h.84c.076 0 .139-.003.187-.01a.207.207 0 0 0 .116-.048.326.326 0 0 0 .077-.116c.022-.051.046-.119.072-.202l.318-1.071h2.306l.327 1.051c.026.09.051.16.077.213a.395.395 0 0 0 .087.12c.031.028.07.047.114.053h.002c.045.006.103.01.173.01h.897c.18 0 .27-.074.27-.223a.59.59 0 0 0-.005-.09.878.878 0 0 0-.036-.108l.003.006zm-.994 2.467h-.646c-.168 0-.279.024-.333.072-.055.049-.082.147-.082.295v3.638l-1.91-3.647c-.076-.155-.152-.253-.226-.295-.074-.041-.204-.063-.39-.063h-.599c-.167 0-.278.025-.332.073-.055.048-.082.147-.082.294v6.138c0 .148.025.246.077.294.052.048.16.072.328.072h.656c.167 0 .278-.024.332-.072.055-.048.082-.146.082-.294v-3.648l1.91 3.657c.077.155.152.253.227.295.073.042.204.062.39.062h.598c.167 0 .278-.024.333-.072.054-.048.082-.146.082-.294v-6.138c0-.148-.028-.246-.082-.294-.055-.048-.166-.073-.333-.073zm3.203-.581l1.665 1.665v8.385H1.505V14.11l1.663-1.664a.63.63 0 0 0 0-.89L1.504 9.891V1.505h20.991v8.384l-1.665 1.666a.63.63 0 0 0 0 .89zM24 0H0v10.613L1.387 12 0 13.387V24h24V13.387L22.613 12 24 10.613zM10.67 18.469H7.96l2.855-4.014a.67.67 0 0 0 .087-.155.425.425 0 0 0 .019-.135v-.772c0-.148-.028-.246-.082-.294-.055-.048-.166-.073-.334-.073H6.382c-.149 0-.245.028-.29.082-.045.055-.068.169-.068.343v.58c0 .172.023.287.068.341.045.055.141.083.29.083h2.545L6.11 18.469a.438.438 0 0 0-.107.27v.792c0 .148.027.245.082.294.055.048.167.072.334.072h4.25c.148 0 .245-.027.29-.081.045-.055.068-.17.068-.344v-.579c0-.173-.023-.287-.068-.342-.045-.055-.142-.082-.29-.082zM9.408 8.233c0 .264-.017.484-.052.661-.036.177-.093.32-.174.43a.648.648 0 0 1-.318.231 1.523 1.523 0 0 1-.487.068h-.79v-4.17h.79c.366 0 .63.11.79.324.16.215.241.571.241 1.067v1.389zm1.38-2.789c-.225-.457-.533-.795-.921-1.013-.39-.219-.88-.328-1.47-.328H6.418c-.167 0-.278.024-.333.072-.054.049-.082.147-.082.294v6.138c0 .148.028.246.082.295.055.048.166.072.333.072h2.218c1.048 0 1.765-.447 2.15-1.342.09-.205.153-.413.188-.622a4.91 4.91 0 0 0 .054-.796V6.911c0-.367-.018-.656-.054-.868a2.2 2.2 0 0 0-.193-.612l.006.013z`,source:`https://media.dazn.com/en/assets/`,hex:`F8F8F5`},xe={title:`Kodi`,slug:`kodi`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Kodi</title><path d="`+this.path+H},path:`M12.03.047c-.226 0-.452.107-.669.324-.922.922-1.842 1.845-2.763 2.768-.233.233-.455.48-.703.695-.31.267-.405.583-.399.988.02 1.399.008 2.799.008 4.198 0 1.453-.002 2.907 0 4.36 0 .11.002.223.03.327.087.337.303.393.546.15 1.31-1.31 2.618-2.622 3.928-3.933l4.449-4.453c.43-.431.43-.905 0-1.336L12.697.37c-.216-.217-.442-.324-.668-.324zm7.224 7.23c-.223 0-.445.104-.65.309L14.82 11.37c-.428.429-.427.895 0 1.322l3.76 3.766c.44.44.908.44 1.346.002 1.215-1.216 2.427-2.433 3.644-3.647.182-.18.353-.364.43-.615v-.33c-.077-.251-.246-.436-.428-.617-1.224-1.22-2.443-2.445-3.666-3.668-.205-.205-.429-.307-.652-.307zM4.18 7.611c-.086.014-.145.094-.207.157L.209 11.572c-.28.284-.278.677.004.96l2.043 2.046c.59.59 1.177 1.182 1.767 1.772.169.168.33.139.416-.084.044-.114.062-.242.063-.364.004-1.283.004-2.567.004-3.851h-.002V8.184c0-.085-.01-.169-.022-.252-.019-.135-.072-.258-.207-.309a.186.186 0 0 0-.095-.012zm7.908 6.838c-.224 0-.447.106-.656.315L7.66 18.537c-.433.434-.433.899.002 1.334 1.215 1.216 2.43 2.43 3.643 3.649.18.18.361.354.611.433h.33c.244-.069.423-.226.598-.402 1.222-1.23 2.45-2.453 3.676-3.68.43-.43.427-.905-.004-1.338l-3.772-3.773c-.208-.208-.432-.311-.656-.31z`,source:`https://kodi.tv`,hex:`17B2E7`},Se={title:`Max`,slug:`max`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Max</title><path d="`+this.path+H},path:`M1.769 0A1.77 1.77 0 0 0 0 1.769V22.23A1.77 1.77 0 0 0 1.769 24H22.23A1.77 1.77 0 0 0 24 22.231V1.77A1.77 1.77 0 0 0 22.231 0zm12.485 3.28a4.301 4.301 0 0 1 4.3 4.302 4.301 4.301 0 0 1-1.993 3.63 6.085 6.085 0 0 1 1.054 3.422 6.085 6.085 0 0 1-6.085 6.085 6.085 6.085 0 0 1-6.085-6.085 6.085 6.085 0 0 1 4.66-5.916 4.301 4.301 0 0 1-.152-1.136 4.301 4.301 0 0 1 4.301-4.301zm0 1.849a2.453 2.453 0 0 0-2.453 2.453 2.453 2.453 0 0 0 2.453 2.453 2.453 2.453 0 0 0 2.453-2.453 2.453 2.453 0 0 0-2.453-2.453zm-2.724 5.268a4.237 4.237 0 0 0-4.237 4.237 4.237 4.237 0 0 0 4.237 4.237 4.237 4.237 0 0 0 4.237-4.237 4.237 4.237 0 0 0-4.237-4.237zm.032 2.54a1.781 1.781 0 1 1 0 3.562 1.781 1.781 0 0 1 0-3.562Z`,source:`https://cycling74.com`,hex:`525252`},Ce={title:`Netflix`,slug:`netflix`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Netflix</title><path d="`+this.path+H},path:`m5.398 0 8.348 23.602c2.346.059 4.856.398 4.856.398L10.113 0H5.398zm8.489 0v9.172l4.715 13.33V0h-4.715zM5.398 1.5V24c1.873-.225 2.81-.312 4.715-.398V14.83L5.398 1.5z`,source:`https://brand.netflix.com/en/assets/logos`,hex:`E50914`,guidelines:`https://brand.netflix.com/en/assets/logos`},we={title:`NOW`,slug:`now`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>NOW</title><path d="`+this.path+H},path:`M8.8009 11.9974c0-.974.7878-1.7634 1.7596-1.7634.9718 0 1.7596.7895 1.7596 1.7634 0 .9738-.7878 1.7634-1.7596 1.7634-.9718 0-1.7596-.7896-1.7596-1.7634zm13.0277-2.896l-1.2166 2.4524-.7878-2.3188-.0015-.0003c-.1566-.4505-.5822-.7737-1.0829-.7737-.399 0-.7505.2054-.956.517-.5255.8015-1.0497 1.6094-1.5735 2.414l-.2785-1.956c-.0963-.6296-.6807-1.0587-1.3048-.9624-.6249.096-1.0538.6778-.958 1.304l.0488.328c-.6427-1.0749-1.8162-1.7945-3.1575-1.7945-1.353 0-2.5352.7324-3.174 1.823l.07-.3434c.1223-.6008-.2645-1.1873-.864-1.31-.5993-.1223-1.1848.265-1.307.8659l-.4763 2.3382-1.752-2.7177c-.198-.3042-.5399-.5053-.9284-.5053-.5317 0-.976.3765-1.084.879l-1.0217 5.012c-.1223.6007.257 1.1846.8575 1.3121.0747.0159.1556.0235.2291.024.5139.0036.9763-.3579 1.0844-.892l.4763-2.3383c.5924.9217 1.1845 1.844 1.779 2.7641.196.2777.5281.4662.9018.4662.5462 0 1.0002-.398 1.0915-.9219l.469-2.302c.2292 1.815 1.7755 3.2187 3.6488 3.2187 1.7257 0 3.1736-1.191 3.5705-2.7972l.2613 1.759c.0736.579.5474 1.0371 1.1411 1.0371.4272 0 .7756-.2445.9972-.5841l1.8844-2.8942.905 2.6645c.1622.4752.5808.8138 1.0961.8138.4788 0 .855-.288 1.0609-.7155l2.402-4.845c.2834-.568.0528-1.2551-.5123-1.5403-.5647-.285-1.2558-.0524-1.5379.5196Z`,source:`https://www.nowtv.com`,hex:`001211`},Te={title:`Paramount+`,slug:`paramountplus`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Paramount+</title><path d="`+this.path+H},path:`M16.347 21.373c.057-.084.151-.314-.025-.74l-.53-1.428c-.073-.182.084-.293.19-.173 0 0 1.004 1.157 1.264 1.64l.495.822c.425.028 1.6.06 2.732.06a3.26 3.26 0 0 1-.316-.364c-1.93-2.392-3.154-3.724-3.166-3.737-.391-.426-.572-.508-.87-.643a4.82 4.82 0 0 1-.138-.065v.364c0 .047-.057.073-.086.022l-2.846-5.001a1.598 1.598 0 0 0-.508-.587l-.277-.194-1.354 3.123c.212 0 .354.216.27.409l-1.25 2.893h1.147c.443 0 .883.087 1.294.255l.302.125s-.913 1.878-.913 2.867c0 .181.028.362.075.534h2.104l-.096-.595s1.266.294 2.502.413M12 2.437c-6.627 0-12 5.373-12 12 0 2.669.873 5.133 2.346 7.126.503-.218.783-.542.983-.791l2.234-2.858a.467.467 0 0 1 .179-.138l.336-.146 3.674-4.659.534-.417 1.094-1.524a.482.482 0 0 1 .101-.102l.478-.347a.34.34 0 0 1 .398-.004l.578.407c.308.216.557.504.726.84l2.322 4.077c.051.09.09.129.182.174.454.227.732.268 1.33.913.277.304 1.495 1.666 3.203 3.784.236.318.538.588.963.783A11.948 11.948 0 0 0 24 14.437c0-6.627-5.373-12-12-12M3.236 15.1l-.778-.253-.48.662v-.818l-.778-.253.778-.253v-.818l.48.662.778-.253-.48.662Zm-.185 2.676-.252.778-.253-.778h-.818l.661-.481-.253-.777.663.48.66-.48-.252.777.662.481Zm.156-6.195.253.778-.661-.48-.663.48.253-.778-.66-.48h.817l.253-.778.252.777h.818Zm1.314-1.76L4.04 9.16l-.778.253.48-.661-.48-.663.778.254.48-.662v.818l.778.253-.777.252Zm2.045-2.862-.253.777-.252-.777h-.818l.662-.48-.253-.778.661.48.661-.48-.252.777.662.48Zm2.577-1.313-.48.661V5.49l-.779-.254.778-.253v-.817l.48.66.78-.253-.481.663.48.66zm3.265-.75.253.778-.661-.48-.662.48.252-.777-.66-.481h.818L12 3.637l.252.778h.818zm2.93.595v.816l-.481-.661-.777.252.48-.662-.48-.662.777.253.48-.66v.817l.779.252zm5.426 8.285.778.253.48-.662v.818l.778.253-.778.253v.818l-.48-.662-.778.253.48-.662zm-3.077-6.04-.253-.777h-.818l.662-.48-.253-.778.662.48.662-.48-.254.778.662.48h-.818zm1.792 2.086v-.818l-.777-.252.777-.253V7.68l.481.662.777-.254-.48.663.48.66-.777-.252zm1.469 1.278.253-.777.254.777h.816l-.66.481.252.778-.662-.48-.661.48.253-.778-.662-.48zm.506 6.676-.253.778-.253-.778h-.817l.662-.481-.253-.777.66.48.663-.48-.253.777.661.481zm-12.08-.615.76-1.588c.024-.048-.032-.108-.067-.067l-.664.668c-.313.329-.847 1.25-.95 1.421l-.808 1.335a.109.109 0 0 1 .1.162l-.739 1.238c-.18.309.145.523.189.452 1.157-1.868 1.832-1.719 1.832-1.719l.387-.897c.022-.047-.001-.1-.05-.12-.12-.05-.316-.27.01-.885z`,source:`https://www.paramount.com/brand/paramount-plus`,hex:`0064FF`},Ee={title:`Plex`,slug:`plex`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Plex</title><path d="`+this.path+H},path:`M3.987 8.409c-.96 0-1.587.28-2.12.933v-.72H0v8.88s.038.018.127.037c.138.03.821.187 1.331-.249.441-.377.542-.814.542-1.318v-1.283c.533.573 1.147.813 2 .813 1.84 0 3.253-1.493 3.253-3.48 0-2.12-1.36-3.613-3.266-3.613Zm16.748 5.595.406.591c.391.614.894.906 1.492.908.621-.012 1.064-.562 1.226-.755 0 0-.307-.27-.686-.72-.517-.614-1.214-1.755-1.24-1.803l-1.198 1.779Zm-3.205-1.955c0-2.08-1.52-3.64-3.52-3.64s-3.467 1.587-3.467 3.573a3.48 3.48 0 0 0 3.507 3.52c1.413 0 2.626-.84 3.253-2.293h-2.04l-.093.093c-.427.4-.72.533-1.227.533-.787 0-1.373-.506-1.453-1.266h4.986c.04-.214.054-.307.054-.52Zm-7.671-.219c0 .769.11 1.701.868 2.722l.056.069c-.306.526-.742.88-1.248.88-.399 0-.814-.211-1.138-.579a2.177 2.177 0 0 1-.538-1.441V6.409H9.86l-.001 5.421Zm9.283 3.46h-2.39l2.247-3.332-2.247-3.335h2.39l2.248 3.335-2.248 3.332Zm1.593-1.286Zm-17.162-.342c-.933 0-1.68-.773-1.68-1.72s.76-1.666 1.68-1.666c.92 0 1.68.733 1.68 1.68 0 .946-.733 1.706-1.68 1.706Zm18.361-1.974L24 8.622h-2.391l-.87 1.293 1.195 1.773Zm-9.404-.466c.16-.706.72-1.133 1.493-1.133.773 0 1.373.467 1.507 1.133h-3Z`,source:`https://brand.plex.tv`,hex:`EBAF00`,guidelines:`https://brand.plex.tv`},De={title:`Sky`,slug:`sky`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Sky</title><path d="`+this.path+H},path:`M7.387 13.656c0 1.423-.933 2.454-2.823 2.675-1.35.147-3.337-.025-4.294-.148-.025-.147-.074-.343-.074-.49 0-1.252.663-1.522 1.3-1.522.664 0 1.694.123 2.455.123.834 0 1.104-.295 1.104-.565 0-.368-.343-.515-1.006-.638l-1.767-.343C.785 12.453 0 11.423 0 10.343c0-1.325.933-2.454 2.798-2.65 1.398-.148 3.116.024 4.049.122.024.172.049.32.049.491 0 1.252-.663 1.522-1.276 1.522-.491 0-1.227-.099-2.086-.099-.884 0-1.227.246-1.227.54 0 .32.343.442.883.54l1.718.32c1.742.294 2.479 1.3 2.479 2.527m3.092 1.521c0 .761-.295 1.203-1.792 1.203-.196 0-.368-.025-.54-.05V6.22c0-.76.27-1.57 1.767-1.57.196 0 .393.024.565.049zm6.085 3.927c.197.098.59.22 1.105.245.859.025 1.325-.319 1.693-1.08L24 7.913a2.5 2.5 0 0 0-.957-.22c-.589 0-1.399.122-1.914 1.325l-1.497 3.534-2.945-4.81c-.196-.05-.662-.148-1.006-.148-1.03 0-1.62.393-2.233 1.031l-2.871 3.141 2.306 3.632c.418.663.982 1.006 1.89 1.006.589 0 1.104-.147 1.325-.245l-2.773-4.196 1.963-2.086 3.24 5.08Z`,source:`https://www.skysports.com`,hex:`0072C9`},Oe={title:`Spotify`,slug:`spotify`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Spotify</title><path d="`+this.path+H},path:`M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z`,source:`https://developer.spotify.com/documentation/general/design-and-branding/#using-our-logo`,hex:`1ED760`,guidelines:`https://developer.spotify.com/documentation/general/design-and-branding/#using-our-logo`},ke={title:`Twitch`,slug:`twitch`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Twitch</title><path d="`+this.path+H},path:`M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z`,source:`https://brand.twitch.tv`,hex:`9146FF`,guidelines:`https://brand.twitch.tv`},Ae={title:`YouTube`,slug:`youtube`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>YouTube</title><path d="`+this.path+H},path:`M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z`,source:`https://www.youtube.com/howyoutubeworks/resources/brand-resources/#logos-icons-and-colors`,hex:`FF0000`,guidelines:`https://www.youtube.com/howyoutubeworks/resources/brand-resources/#logos-icons-and-colors`},je={title:`YouTube Music`,slug:`youtubemusic`,get svg(){return`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>YouTube Music</title><path d="`+this.path+H},path:`M12 0C5.376 0 0 5.376 0 12s5.376 12 12 12 12-5.376 12-12S18.624 0 12 0zm0 19.104c-3.924 0-7.104-3.18-7.104-7.104S8.076 4.896 12 4.896s7.104 3.18 7.104 7.104-3.18 7.104-7.104 7.104zm0-13.332c-3.432 0-6.228 2.796-6.228 6.228S8.568 18.228 12 18.228s6.228-2.796 6.228-6.228S15.432 5.772 12 5.772zM9.684 15.54V8.46L15.816 12l-6.132 3.54z`,source:`https://partnermarketinghub.withgoogle.com/#/brands`,hex:`FF0000`},Me=`app:`,U=(e,t,n)=>({key:e,label:t,mark:{kind:`glyph`,path:n.path,hex:n.hex}}),W=(e,t,n)=>({key:e,label:t,mark:{kind:`lettermark`,text:n}}),G=[U(`netflix`,`Netflix`,Ce),U(`youtube`,`YouTube`,Ae),W(`primevideo`,`Prime Video`,`prime`),W(`disneyplus`,`Disney+`,`D+`),U(`spotify`,`Spotify`,Oe),U(`plex`,`Plex`,Ee),U(`appletv`,`Apple TV`,ve),U(`dazn`,`DAZN`,be),W(`raiplay`,`RaiPlay`,`Rai`),W(`mediasetinfinity`,`Mediaset Infinity`,`MI`),U(`now`,`NOW`,we),U(`twitch`,`Twitch`,ke),U(`max`,`Max`,Se),U(`paramountplus`,`Paramount+`,Te),U(`crunchyroll`,`Crunchyroll`,ye),U(`sky`,`Sky`,De),U(`youtubemusic`,`YouTube Music`,je),U(`applemusic`,`Apple Music`,_e),U(`kodi`,`Kodi`,xe)],Ne=new Map(G.map(e=>[e.key,e]));function Pe(e){return`${Me}${e}`}function K(e){if(!(e===void 0||!e.startsWith(`app:`)))return Ne.get(e.slice(4))}function Fe(e){if(!/^[0-9a-fA-F]{6}$/.test(e))return null;let t=t=>{let n=Number.parseInt(e.slice(t,t+2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*t(0)+.7152*t(2)+.0722*t(4)}var Ie=.011,Le=.91,q=2.2;function J(e,t){let[n,r]=e>t?[e,t]:[t,e];return(n+.05)/(r+.05)}function Re(e){if(e.kind!==`glyph`)return null;let t=Fe(e.hex);return t===null?null:J(t,Ie)>=q&&J(t,Le)>=q?`#${e.hex}`:null}function ze({brand:e}){if(e.mark.kind===`lettermark`)return t(`span`,{className:`text-[11px] font-semibold leading-none`,"aria-hidden":!0,children:e.mark.text});let n=Re(e.mark);return t(`svg`,{viewBox:`0 0 24 24`,className:`h-4 w-4 fill-current`,"aria-hidden":!0,style:n===null?void 0:{fill:n},children:t(`path`,{d:e.mark.path})})}function Be(e){return e.toLowerCase().startsWith(`it`)?`it`:`en`}function Y(e,t){return d(e,Be(t))}function Ve(e){switch(e){case`rect`:return`rounded-sm`;case`rounded`:return`rounded-xl`;case`round`:return`aspect-square h-full w-auto justify-self-center rounded-full`;case`pill`:return`rounded-full`;default:return``}}function He(e){switch(e){case`accent`:return`border-primary bg-primary text-primary-foreground hover:bg-primary/90`;case`danger`:return`border-danger bg-danger-fill text-danger-on hover:bg-danger-fill/90`;case`red`:return`border-danger/40 bg-danger/15 text-danger hover:bg-danger/25`;case`green`:return`border-success/40 bg-success/15 text-success hover:bg-success/25`;case`yellow`:return`border-warning/40 bg-warning/15 text-warning hover:bg-warning/25`;case`blue`:return`border-info/40 bg-info/15 text-info hover:bg-info/25`;default:return``}}function Ue(e){switch(e){case`panel`:return`rounded-lg border border-border bg-surface/40`;case`dpad`:return`rounded-3xl border border-border bg-surface`;case`rocker-v`:case`rocker-h`:return`rounded-full border border-border bg-surface`;case`keypad`:return`rounded-lg border border-border-subtle bg-surface/60`;default:return``}}function We(e){return e===`divider`}function X(e,t){let n=Math.min(Math.max(t.row,0),e.rows-1),r=Math.min(Math.max(t.col,0),e.columns-1),i=Math.min(Math.max(t.row+t.rowSpan,n+1),e.rows),a=Math.min(Math.max(t.col+t.colSpan,r+1),e.columns);return{row:n,col:r,rowSpan:i-n,colSpan:a-r}}var Ge=`2.75rem`,Ke=`1.25rem`,qe=`1rem`;function Je(e){let t=new Set;for(let n of e.buttons)for(let e=n.row;e<n.row+n.rowSpan;e+=1)for(let r=n.col;r<n.col+n.colSpan;r+=1)t.add(`${e}:${r}`);return t}var Z=new Set([`red`,`green`,`yellow`,`blue`]);function Ye(e,t){return e.label??K(e.icon)?.label??t}function Xe(e){return e.label===void 0||K(e.icon)!==void 0?!1:e.tone===void 0||!Z.has(e.tone)}function Ze(e){if(e.icon!==void 0)return e.icon;if(!(e.tone!==void 0&&Z.has(e.tone)))return l(e.role)}function Qe({button:n,compact:r}){let i=h(),a=K(n.icon),o=Ze(n),s=n.icon===void 0?c(n.role):void 0,l=o===void 0||a!==void 0||s!==void 0?void 0:i(o),u=Xe(n)?n.label:void 0;return e(`span`,{className:`flex flex-col items-center justify-center gap-0.5 leading-none`,children:[a!==void 0&&t(ze,{brand:a}),l!==void 0&&t(l,{className:`h-4 w-4`,"aria-hidden":!0}),s!==void 0&&t(`span`,{className:`text-sm font-medium`,children:s}),u!==void 0&&!r&&t(`span`,{className:`max-w-full truncate text-[11px]`,children:u})]})}function Q(e){return{gridRow:`${e.row+1} / span ${e.rowSpan}`,gridColumn:`${e.col+1} / span ${e.colSpan}`}}function $e({group:n,selected:i,dragging:a,compact:o,editable:s,onSelect:c,onPointerDown:l,onKeyDown:u}){let{t:d}=_(),f=We(n.frame),p=!s||o||n.hideTitle===!0?void 0:n.title;return e(`div`,{"data-testid":`remote-group-${n.id}`,"data-frame":n.frame,className:r(`relative -m-0.5 flex`,Ue(n.frame),a&&`opacity-40`,i&&`ring-2 ring-primary`),style:Q(n),children:[f?e(`div`,{className:`flex w-full items-center gap-2 px-1 text-[10px] uppercase tracking-wide text-foreground-muted`,children:[t(`span`,{className:`h-px flex-1 bg-border`,"aria-hidden":!0}),p!==void 0&&t(`span`,{className:`truncate`,children:p}),p!==void 0&&t(`span`,{className:`h-px flex-1 bg-border`,"aria-hidden":!0})]}):p!==void 0&&t(`span`,{className:`absolute -top-1.5 left-3 max-w-[70%] truncate bg-background-elevated px-1 text-[10px] uppercase leading-none tracking-wide text-foreground-muted`,children:p}),s&&t(`button`,{type:`button`,"aria-label":d(`remote.layout.groupHandle`,{name:n.title??n.componentId}),"aria-pressed":i,"data-testid":`remote-group-handle-${n.id}`,className:`absolute -right-1 -top-2.5 z-20 flex h-4 w-4 touch-none cursor-grab items-center justify-center rounded-full border border-border bg-surface-hover text-foreground-muted hover:text-foreground`,onClick:c,onPointerDown:l,onKeyDown:u,children:t(m,{className:`h-3 w-3`,"aria-hidden":!0})})]})}function et({grid:n,label:i,selectedId:a=null,onSelect:o,boundRoles:s,showEmptyCells:c=!1,compact:l=!1,gridRef:u,selectedGroupId:d=null,onSelectGroup:f,onItemPointerDown:p,onItemKeyDown:m,drag:h=null}){let{i18n:v}=_(),y=p!==void 0,b=h!==null,x=Je(n),S=P(n),C=[];if(c||b)for(let e=0;e<n.rows;e+=1)for(let t=0;t<n.columns;t+=1)(b||!x.has(`${e}:${t}`)&&!S.has(e))&&C.push({row:e,col:t});let w=h?.preview??null;return e(`div`,{role:`group`,"aria-label":i,"data-testid":`remote-grid`,ref:u,className:r(`grid gap-1.5`,l?`auto-rows-[1.25rem] gap-0.5`:`auto-rows-[2.75rem]`),style:{gridTemplateColumns:`repeat(${n.columns}, minmax(0, 1fr))`,...S.size===0?{}:{gridTemplateRows:Array.from({length:n.rows},(e,t)=>S.has(t)?qe:l?Ke:Ge).join(` `)}},children:[C.map(({row:e,col:n})=>t(`div`,{"aria-hidden":!0,"data-testid":`remote-grid-cell`,className:r(`rounded-md border border-dashed`,b?`border-border`:`border-border-subtle`),style:{gridRow:`${e+1}`,gridColumn:`${n+1}`}},`e${e}:${n}`)),(n.groups??[]).map(e=>t($e,{group:e,selected:e.id===d,dragging:h?.item.kind===`group`&&h.item.id===e.id,compact:l,editable:y,onSelect:f===void 0?void 0:()=>f(e.id),onPointerDown:p===void 0?void 0:t=>p({kind:`group`,id:e.id},t),onKeyDown:m===void 0?void 0:t=>m({kind:`group`,id:e.id},t)},e.id)),n.buttons.map(e=>{let n=e.id===a,i=s===void 0||s.has(e.role),c=h?.item.kind===`button`&&h.item.id===e.id,u={kind:`button`,id:e.id},d=Ye(e,Y(e.role,v.language));return t(g,{type:`button`,size:`sm`,variant:i?`secondary`:`outline`,"aria-pressed":o===void 0?void 0:n,"aria-label":d,title:d,"data-testid":`remote-grid-button-${e.id}`,"data-shape":e.shape,"data-tone":e.tone,className:r(`z-10 h-full min-w-0 overflow-hidden border border-border px-1`,l&&`px-0`,Ve(e.shape),He(e.tone),y&&`touch-none`,c&&`opacity-40`,n&&`ring-2 ring-primary ring-offset-1 ring-offset-background`),style:Q(e),onClick:o===void 0?void 0:()=>o(e.id),onPointerDown:p===void 0?void 0:e=>p(u,e),onKeyDown:m===void 0?void 0:e=>m(u,e),children:t(Qe,{button:e,compact:l})},e.id)}),w!==null&&t(`div`,{"aria-hidden":!0,"data-testid":`remote-drop-target`,"data-valid":w.valid,className:r(`pointer-events-none z-30 rounded-md border-2 border-dashed`,w.valid?`border-success bg-success/20`:`border-danger bg-danger/20`),style:Q(X(n,w.rect))})]})}var $=`edit`;function tt(e){return`/system/templates?${$}=${encodeURIComponent(e)}`}function nt({templateId:r,testId:i}){let{t:a}=_(),o=v();return e(g,{size:`sm`,variant:`ghost`,onClick:()=>o(tt(r)),"data-testid":i??`remote-edit-template`,children:[t(n,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),a(`remote.editTemplate`)]})}export{ie as A,ae as C,se as D,oe as E,de as O,ce as S,F as T,pe as _,G as a,M as b,B as c,R as d,ue as f,he as g,me as h,Y as i,I as k,re as l,E as m,$ as n,Pe as o,y as p,et as r,K as s,nt as t,ge as u,z as v,L as w,le as x,ee as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,K as t,S as n,V as r,Y as i,d as a,et as o,u as s}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{pt as c}from"./player-overlays-
|
|
1
|
+
import{C as e,K as t,S as n,V as r,Y as i,d as a,et as o,u as s}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{pt as c}from"./player-overlays-D5PuUVGx.js";import{Ho as l}from"./client-DDfmis6s.js";import{D as u,F as d,N as f,O as p,T as m,y as h}from"./__vite-browser-external-BCAtXlNQ.js";import{Bn as g,Pf as _,Pn as v,Sn as y,vn as b}from"./src-kgyauwxD.js";import{t as x}from"./useTranslation-BJr-n0es.js";o();var S=d([p({kind:m(`adaptive`)}),p({kind:m(`profile`),profile:l})]),C=p({serverUrl:f().min(1),token:f().min(1),deviceId:u().int().nonnegative(),target:S,muted:h()});function w(e,t){let n=t===void 0?{type:`state`,state:e}:{type:`state`,state:e,message:t};window.ReactNativeWebView?.postMessage(JSON.stringify(n))}function T(e){switch(e){case`playing`:return`playing`;case`error`:return`error`;case`connecting`:case`disconnected`:case`idle`:return`connecting`}}function E(e){return e.kind===`adaptive`?{kind:`adaptive`}:{kind:`profile`,profile:e.profile}}function D(e){return e.kind===`adaptive`?`embed:adaptive`:`embed:profile:${e.profile}`}function O(){let e=window.__CAMSTACK_EMBED__;if(e==null)return{ok:!1,error:`window.__CAMSTACK_EMBED__ is not set`};let t=C.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}: ${e.message}`).join(`; `)}}function k({message:t}){let{t:n}=x();return r(()=>{w(`error`,t)},[t]),e(`div`,{style:{position:`fixed`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#000`,color:`#f87171`,fontFamily:`system-ui, sans-serif`,fontSize:13,padding:16,textAlign:`center`},children:[n(`embedPlayerPage.embedConfigError`,`Embed config error:`),` `,t]})}function A({system:e,deviceId:a,initialTarget:o,initialMuted:s}){let[c,l]=i(o),[u,d]=i(s),{handleOffer:f,getIceServers:p,addIceCandidate:m,getIceCandidates:h,closeSession:_,getSessionState:y,getSessionDebug:b,applyDownlinkProbe:x}=v(e.trpcClient,a),C=t(()=>E(c),[c]),O=t(()=>(e,t)=>f(C,e,t),[f,C]),k=t(()=>(e,t,n)=>f(n,t,e),[f]);r(()=>(window.__camstackEmbed={setMuted:e=>d(e),setTarget:e=>{let t=S.safeParse(e);t.success&&l(t.data)}},()=>{window.__camstackEmbed&&delete window.__camstackEmbed}),[]);let A=D(c);return n(`div`,{style:{position:`fixed`,inset:0,width:`100vw`,height:`100vh`,background:`#000`},children:n(g,{serverUrl:e.serverUrl,streamKey:A,autoPlay:!0,muted:u,showControls:!1,className:`w-full h-full`,getSessionDebug:b,applyDownlinkProbe:x,handleOffer:O,reoffer:k,getSessionState:y,getIceServers:p,addIceCandidate:m,getIceCandidates:h,closeSession:_,onStateChange:e=>w(T(e)),onError:e=>w(`error`,e)},A)})}function j(){let{t:e}=x(),i=t(()=>O(),[]),o=t(()=>{if(!i.ok)return null;let e=y({serverUrl:i.config.serverUrl,token:i.config.token}),t=new a({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});return b(t),{system:e,queryClient:t}},[i]);return r(()=>{if(o)return()=>{o.system.close()}},[o]),i.ok?o?n(c,{system:o.system,children:n(s,{client:o.queryClient,children:n(_.Provider,{client:o.system.trpcClient,queryClient:o.queryClient,children:n(A,{system:o.system,deviceId:i.config.deviceId,initialTarget:i.config.target,initialMuted:i.config.muted})})})}):n(k,{message:e(`embedPlayerPage.failedToInitialiseTheEmbed`,`Failed to initialise the embed player`)}):n(k,{message:i.error})}export{j as EmbedPlayerPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,K as t,S as n,Y as r,et as i,i as a,x as o}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Dn as s,Fn as c,Kt as l,Pr as u,Ri as d,Sa as f,bt as p,ct as m,ht as h,lt as g,xr as _}from"./player-overlays-BDeIsXux.js";import{fo as v,zr as y}from"./client-DTyBaAoV.js";import{A as b,B as x,Br as S,C,D as w,E as T,Ei as E,F as D,Fr as O,H as k,I as A,In as j,Ir as ee,Jr as M,Ko as N,Kr as te,L as ne,M as re,N as ie,On as ae,Pr as oe,R as se,Rn as P,Rr as ce,U as le,V as F,Xr as ue,Yr as I,Zr as L,b as de,bo as fe,j as pe,k as R,kf as me,kn as he,oi as z,ri as ge,td as _e,ui as B,vi as V,w as ve,x as ye,y as be,yo as xe,z as Se,zn as H,zr as Ce}from"./src-Da4HIMZv.js";import{t as U}from"./useTranslation-BJr-n0es.js";import{Lr as we}from"./index-RgDw12BV.js";import{t as Te}from"./AdminPage-qR6elCnl.js";i();function W(e,t){return e.scope===``?e.displayName:`${e.displayName} · ${t?.(e)??e.scope}`}function Ee(e,t,n){let r=[];for(let{device:t,series:i}of e)for(let e of i){let i={subject:{kind:`device`,deviceId:t.id},key:e.key,scope:e.scope};r.push({id:b(i),ref:i,info:e,subjectName:t.name,location:t.location??``,nodeId:``,metric:W(e,n)})}for(let{node:e,series:i}of t)for(let t of i){let i={subject:{kind:`node`,nodeId:e.id},key:t.key,scope:t.scope};r.push({id:b(i),ref:i,info:t,subjectName:e.name,location:``,nodeId:e.id,metric:W(t,n)})}return r}function De(e){return[e.subjectName,e.location,e.metric,e.info.key,e.info.unit??``,e.nodeId].join(` `)}function G(e,t,n){if(e.ref.subject.kind!==`device`||t===null)return e.subjectName;let r=t.byId.get(e.ref.subject.deviceId);return r===void 0?e.subjectName:ge(r,`compact`,t,n)}var Oe=[`energy`,`temperatures`,`nodes`,`storage`],ke=new Set([`cap:temperature-sensor.temperature`,`cap:climate-control.currentTemp`]),K=[`addon:metrics-native/node-cpu-percent`,`addon:metrics-native/node-memory-percent`],Ae=`addon:storage-orchestrator/location-used-percent`;function je(e,t){let n=(e,n)=>{let r=t.filter(e);return R((n?[...r].sort(n):r).map(e=>e.ref))};switch(e){case`energy`:return n(e=>e.ref.subject.kind===`device`&&e.info.key===`derived:energy.kwh`);case`temperatures`:return n(e=>e.ref.subject.kind===`device`&&ke.has(e.info.key)&&e.info.scope===``,(e,t)=>e.location.localeCompare(t.location)||e.subjectName.localeCompare(t.subjectName));case`nodes`:return n(e=>e.ref.subject.kind===`node`&&K.includes(e.info.key)&&e.info.scope===``,(e,t)=>K.indexOf(e.info.key)-K.indexOf(t.info.key)||e.subjectName.localeCompare(t.subjectName));case`storage`:return n(e=>e.ref.subject.kind===`node`&&e.info.key===Ae)}}function Me(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[],i=[],a=[],o=[];for(let t of R(e)){let e=n.get(b(t));if(e===void 0){o.push(t);continue}e.info.key===`derived:energy.kwh`?a.push(e):e.info.kind===`boolean`||e.info.kind===`enum`?i.push(e):r.push(e)}return{lines:r,states:i,energy:a,missing:o}}function q(e){return e.subject.kind===`device`?{deviceId:e.subject.deviceId,key:e.key,scope:e.scope}:{forNodeId:e.subject.nodeId,key:e.key,scope:e.scope}}var J=`history-page`;function Ne({part:r,window:i}){let{t:a}=U(),o=f(),s=B(),c=z(),l=e=>`${G(e,s,c)} · ${e.metric}`,u=t(()=>[...r.lines,...r.states,...r.energy],[r]),p=C(t(()=>u.map(e=>q(e.ref)),[u]),i,!1),m=e=>p.status===`ok`?p.data.current.get(ye(q(e.ref))):void 0,h=e=>{let t=m(e);return t?.ok?t.result:void 0};if(u.length===0)return n(I,{icon:d,title:a(`history.page.emptyTitle`,`Pick series to compare`),description:a(`history.page.emptyHint`,`Choose up to 24 series on the left, or start from a panel above.`)});if(p.status===`error`)return n(M,{title:a(`history.page.readFailed`,`History could not be read`),message:p.error});let g=p.status===`pending`,_=u.map(e=>({c:e,e:m(e)})).filter(e=>e.e?.ok===!1),v=r.lines.map((e,t)=>{let n=h(e),r=A(e.info,n,i.from);return{id:e.id,label:l(e),unit:e.info.unit,colorIndex:t,points:r.points,gapMs:r.gapMs,interpolation:r.held&&n?.resolution===`raw`?`step`:`linear`}}),y=r.states.map((e,t)=>{let n=ne(e.info,h(e),i.from,i.to),r=ie(e.info.key,o);return{id:e.id,label:l(e),kind:e.info.kind===`boolean`?`boolean`:`enum`,colorIndex:e.info.kind===`boolean`?t:0,states:n.states,segments:n.segments,totals:n.totals,stateLabel:e.info.kind===`boolean`?e=>e===`true`?r.on:r.off:void 0}}),b=r.energy.map(e=>({c:e,...D(h(e))})),x=b[0]?.bucketMs??36e5,S=[...new Set(b.flatMap(e=>e.buckets.map(e=>e.t)))].sort((e,t)=>e-t).map(e=>({t:e,values:b.map(t=>t.buckets.find(t=>t.t===e)?.values[0]??null)}));return e(`div`,{className:`space-y-5 min-w-0`,children:[_.length>0&&n(M,{title:a(`history.page.someFailed`,`Some series could not be read`),message:_.map(e=>`${l(e.c)}: ${e.e.error}`).join(` · `)}),v.length>0&&n(le,{title:a(`history.page.lines`,`Measurements`),series:v,range:i,height:260,syncKey:J,pending:g}),b.length>0&&n(te,{title:a(`history.page.energy`,`Energy`),layers:b.map((e,t)=>({id:e.c.id,label:G(e.c,s,c),colorIndex:t})),buckets:S,bucketMs:x,range:i,unit:`kWh`,showTotal:!0,height:160,syncKey:J,pending:g}),y.length>0&&n(k,{title:y.length===1?y[0]?.label??``:a(`history.page.states`,`States`),rows:y,range:i,syncKey:J,pending:g})]})}function Pe(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}async function Fe(e,t){let n=[];for(let r of Pe(e,50))try{let{results:e}=await t(r),i=new Map(e.map(e=>[e.seriesId,e]));for(let e of r)n.push(i.get(e)??{seriesId:e,ok:!1,reason:`not-found`})}catch(e){let t=e instanceof Error?e.message:String(e);for(let e of r)n.push({seriesId:e,ok:!1,reason:`request-failed`,message:t})}return n}function Y(e){return e.raw+e[`5m`]+e[`1h`]+e[`1d`]}function Ie(e){return e.reduce((e,t)=>t.ok?{...e,deleted:e.deleted+1,points:e.points+Y(t.deleted)}:{...e,refused:e.refused+1},{deleted:0,refused:0,points:0})}function Le(e,t){let n=new Map(e.map(e=>[e.seriesId,e]));return t.flatMap(e=>{let t=n.get(e.seriesId);return t===void 0?[]:[{series:t,outcome:e}]})}var X=e=>new Date(e).toLocaleDateString(void 0,{dateStyle:`short`});function Z(e,t,n){let r=t.get(e.deviceId);return r===void 0?e.reason===`device-gone`?n(`history.orphans.deviceRemoved`,`#{{id}} (removed)`,{id:e.deviceId}):n(`history.orphans.deviceId`,`#{{id}}`,{id:e.deviceId}):r}function Q(e){let t=e.displayName??e.key;return e.scope===``?t:`${t} · ${e.scope}`}function Re(t,r,i){return{key:`series`,header:i(`history.orphans.colSeries`,`Series`),render:a=>{let o=t(a);return e(`div`,{className:`min-w-0 max-w-[16rem]`,children:[n(`div`,{className:`truncate text-foreground`,title:o.key,children:Q(o)}),n(`div`,{className:`truncate text-[10px] text-foreground-subtle`,children:Z(o,r,i)})]})},sortValue:e=>`${Z(t(e),r,i)} ${Q(t(e))}`}}var ze=[`raw`,`5m`,`1h`,`1d`];function Be(e,t){return e===`raw`?t(`history.orphans.colRaw`,`Raw points`):e===`5m`?t(`history.orphans.col5m`,`5 min`):e===`1h`?t(`history.orphans.col1h`,`1 h`):t(`history.orphans.col1d`,`1 day`)}function Ve(t,r){return[Re(e=>e,t,r),{key:`reason`,header:r(`history.orphans.colReason`,`Reason`),render:t=>e(`div`,{className:`flex flex-col items-start gap-0.5`,children:[n(E,{variant:t.reason===`device-gone`?`warning`:`neutral`,className:`text-[10px]`,children:t.reason===`device-gone`?r(`history.orphans.deviceGone`,`Device removed`):r(`history.orphans.undeclared`,`No longer declared`)}),t.missingSince!==null&&n(`span`,{className:`text-[10px] text-foreground-subtle`,children:r(`history.orphans.since`,`since {{date}}`,{date:X(t.missingSince)})})]}),sortValue:e=>e.reason},{key:`span`,header:r(`history.orphans.colSpan`,`Recorded`),render:t=>e(`span`,{className:`tabular-nums text-foreground-muted`,children:[X(t.firstTs),` → `,X(t.lastTs)]}),sortValue:e=>e.lastTs},...ze.map(e=>({key:`rows-${e}`,header:Be(e,r),align:`right`,render:t=>n(`span`,{className:`tabular-nums text-foreground-muted`,children:t.rows[e].toLocaleString()}),sortValue:t=>t.rows[e]}))]}function He(e,t){if(e.ok)return n(E,{variant:`success`,className:`text-[10px]`,children:t(`history.orphans.deleted`,{count:Y(e.deleted),points:Y(e.deleted).toLocaleString(),defaultValue_one:`Deleted · {{points}} point`,defaultValue_other:`Deleted · {{points}} points`})});let r=e.reason===`request-failed`?t(`history.orphans.requestFailed`,`Not sent: {{message}}`,{message:e.message}):e.reason===`not-orphan`?t(`history.orphans.refusedNotOrphan`,`Kept: no longer orphan`):e.reason===`not-found`?t(`history.orphans.refusedNotFound`,`Already gone`):t(`history.orphans.refusedFailed`,`The hub could not delete it`);return n(E,{variant:e.reason===`not-found`?`neutral`:`warning`,className:`text-[10px]`,children:r})}function Ue(e,t){return[Re(e=>e.series,e,t),{key:`result`,header:t(`history.orphans.colResult`,`Result`),render:e=>He(e.outcome,t),sortValue:e=>+!e.outcome.ok}]}i();function We({open:i,onClose:a,list:o,deviceNames:s,onDelete:u,onRefresh:d,refreshing:f}){let{t:p}=U(),h=m(),[g,v]=r(new Set),[y,b]=r(!1),[x,C]=r([]),w=t(()=>Ve(s,p),[s,p]),T=t(()=>Ue(s,p),[s,p]),E=t(()=>new Set(o.series.map(e=>String(e.seriesId))),[o.series]),D=[...g].filter(e=>E.has(e)).map(Number),k=Ie(x.map(e=>e.outcome)),A=async()=>{if(await h({title:p(`history.orphans.confirmTitle`,{count:D.length,defaultValue_one:`Delete {{count}} series`,defaultValue_other:`Delete {{count}} series`}),message:p(`history.orphans.confirmMessage`,`Every recorded point of these series is removed from the hub. This cannot be undone.`),confirmLabel:p(`history.orphans.confirmLabel`,`Delete`),variant:`danger`})){b(!0);try{let e=await Fe(D,u);C(Le(o.series,e)),v(new Set)}finally{b(!1),d()}}};return n(oe,{open:i,onOpenChange:e=>!e&&a(),children:e(ee,{width:`xl`,placement:`sheet-on-mobile`,scroll:`body`,"data-testid":`orphan-series-dialog`,children:[n(Ce,{children:n(S,{children:p(`history.orphans.title`,`Series no longer linked to a device`)})}),e(O,{className:`space-y-3`,children:[n(`p`,{className:`text-xs text-foreground-muted`,children:p(`history.orphans.intro`,`Nothing records into these series any more: their device was removed, or no capability declares them now. Select the ones to delete.`)}),o.truncated&&e(`div`,{className:`flex flex-wrap items-center gap-2`,"data-testid":`orphan-truncated`,children:[n(`p`,{className:`text-xs text-warning`,children:p(`history.orphans.truncated`,`More series are unlinked than are listed here. Delete these, then load the rest.`)}),e(V,{size:`sm`,variant:`outline`,onClick:d,disabled:f,children:[n(c,{className:`h-3 w-3`,"aria-hidden":!0}),p(`history.orphans.loadAgain`,`Load again`)]})]}),x.length>0&&e(`div`,{className:`space-y-2`,"data-testid":`orphan-outcomes`,children:[n(`p`,{className:`text-xs text-foreground`,"aria-live":`polite`,children:p(`history.orphans.summary`,{count:k.deleted,refused:k.refused,points:k.points.toLocaleString(),defaultValue_one:`{{count}} series deleted ({{points}} points), {{refused}} kept.`,defaultValue_other:`{{count}} series deleted ({{points}} points), {{refused}} kept.`})}),n(P,{columns:T,rows:x,rowKey:e=>String(e.series.seriesId),minWidthPx:420,maxBodyHeight:`max-h-[60vh]`,emptyMessage:``})]}),n(P,{columns:w,rows:o.series,rowKey:e=>String(e.seriesId),minWidthPx:760,maxBodyHeight:H,defaultSort:{columnKey:`series`,dir:`asc`},emptyMessage:p(`history.orphans.empty`,`Every series is linked to a device.`),selection:{selected:g,onChange:v,rowLabel:e=>`${Q(e)} — ${Z(e,s,p)}`,pageLabel:p(`history.orphans.selectAll`,`Select every listed series`)}})]}),e(ce,{children:[n(`span`,{className:`mr-auto text-[11px] tabular-nums text-foreground`,"aria-live":`polite`,children:p(`history.orphans.selected`,{count:D.length,defaultValue_one:`{{count}} selected`,defaultValue_other:`{{count}} selected`})}),n(V,{variant:`ghost`,size:`sm`,onClick:a,children:p(`history.orphans.close`,`Close`)}),e(V,{variant:`danger`,size:`sm`,disabled:D.length===0||y,onClick:()=>void A(),children:[y?n(_,{className:`h-3 w-3 animate-spin`,"aria-hidden":!0}):n(l,{className:`h-3 w-3`,"aria-hidden":!0}),p(`history.orphans.deleteSelected`,`Delete selected`)]})]})]})})}i();var Ge=5*6e4;function Ke({enabled:i}){let{t:a}=U(),[s,c]=r(!1),l=fe({},{enabled:i,staleTime:Ge}),u=N({projection:`slim`},{enabled:i}),d=xe(),f=t(()=>new Map((u.data??[]).map(e=>[e.id,e.name])),[u.data]),p=e=>d.mutateAsync({seriesIds:[...e]});if(!i||l.status===`pending`)return null;if(l.status===`error`)return n(M,{variant:`warning`,title:a(`history.orphans.checkFailedTitle`,`Could not check for unlinked series`),message:l.error.message,onRetry:()=>void l.refetch()});let m=l.data;if(m.series.length===0&&!s)return null;let h=m.series.length;return e(o,{children:[h>0&&n(M,{variant:`warning`,message:m.truncated?a(`history.orphans.noticeMore`,{count:h,defaultValue_one:`More than {{count}} series are no longer linked to a device.`,defaultValue_other:`More than {{count}} series are no longer linked to a device.`}):a(`history.orphans.notice`,{count:h,defaultValue_one:`{{count}} series is no longer linked to a device.`,defaultValue_other:`{{count}} series are no longer linked to a device.`}),action:n(V,{size:`sm`,variant:`outline`,onClick:()=>c(!0),children:a(`history.orphans.review`,`Review`)})}),n(We,{open:s,onClose:()=>c(!1),list:m,deviceNames:f,onDelete:p,onRefresh:()=>void l.refetch(),refreshing:l.isFetching})]})}i();var qe=`device`,Je=`node`;function Ye({catalog:r,selected:i,onChange:a,loading:o}){let{t:s}=U(),c=B(),l=z(),u=e=>G(e,c,l),d=ae(r,{searchText:e=>[De(e)],facetGroups:[{id:`subject`,value:e=>e.ref.subject.kind===`device`?qe:Je},{id:`room`,value:e=>e.location},{id:`unit`,value:e=>e.info.unit??``}]}),f=t(()=>[{key:`metric`,header:s(`history.picker.series`,`Series`),render:t=>e(`div`,{className:`min-w-0`,children:[n(`div`,{className:`truncate text-foreground`,children:t.metric}),n(`div`,{className:`truncate text-[10px] text-foreground-subtle`,children:t.location===``?u(t):`${u(t)} · ${t.location}`})]}),sortValue:e=>`${e.subjectName} ${e.metric}`},{key:`unit`,header:s(`history.picker.unit`,`Unit`),render:e=>n(`span`,{className:`text-foreground-muted`,children:e.info.unit??`—`}),sortValue:e=>e.info.unit??``}],[s,c,l]),p=i.size>=24;return e(`div`,{className:`space-y-2 min-w-0`,children:[n(he,{state:d.state,facets:[],groups:[{...d.groups.find(e=>e.id===`subject`)??{id:`subject`,facets:[],selected:[]},label:s(`history.picker.subject`,`Source`),facetLabel:e=>e===qe?s(`history.picker.devices`,`Devices`):s(`history.picker.nodes`,`Nodes`)},{...d.groups.find(e=>e.id===`room`)??{id:`room`,facets:[],selected:[]},label:s(`history.picker.room`,`Room`),facetLabel:e=>e===``?s(`history.picker.noRoom`,`No room`):e},{...d.groups.find(e=>e.id===`unit`)??{id:`unit`,facets:[],selected:[]},label:s(`history.picker.metricType`,`Unit`),facetLabel:e=>e===``?s(`history.picker.noUnit`,`States & counts`):e}],labels:{searchPlaceholder:s(`history.picker.search`,`Search device, room, metric or node…`),searchLabel:s(`history.picker.searchLabel`,`Search series`),facetsLabel:s(`history.picker.facets`,`Filters`),clearLabel:s(`history.picker.clear`,`Clear`)},onSearch:d.setSearch,onToggleFacet:d.toggleFacet,onToggleGroupFacet:d.toggleGroupFacet,onClear:d.clear}),n(`p`,{className:`text-[10px] text-foreground-subtle`,"aria-live":`polite`,children:s(`history.picker.count`,`{{count}} of {{max}} selected`,{count:i.size,max:24})}),n(P,{columns:f,rows:d.rows,rowKey:e=>e.id,maxBodyHeight:H,pageSize:50,defaultSort:{columnKey:`metric`,dir:`asc`},emptyMessage:o?s(`history.picker.loading`,`Reading the series of every device…`):d.active?s(`history.picker.emptyFiltered`,`No series match these filters.`):s(`history.picker.empty`,`Nothing is recorded yet.`),selection:{selected:i,onChange:e=>{let t=[...e].filter(e=>i.has(e)),n=[...e].filter(e=>!i.has(e));a(new Set([...t,...n].slice(0,24)))},isSelectable:e=>i.has(e.id)||!p,rowLabel:e=>`${u(e)} · ${e.metric}`,pageLabel:s(`history.picker.selectPage`,`Select every series on this page`)}})]})}i();var Xe=new Set([v.Hub,v.Container]),$=5*6e4;function Ze(){let{t:r}=U(),i=ue(`device-history`),[a,o]=we(),c=t(()=>R(a.getAll(`s`).flatMap(e=>{let t=T(e);return t===null?[]:[t]})),[a]),l=a.get(`window`),f=x(l)?l:`7d`,h=se(a.get(`range`)),_=(e,t,n)=>{let r=new URLSearchParams;for(let t of R(e))r.append(`s`,w(t));t!==`7d`&&r.set(`window`,t);let i=n===void 0?a.get(`range`):n;t===`custom`&&i&&r.set(`range`,i),o(r,{replace:!0})},v=Qe(i===`present`),y=F(f,Date.now(),h),S=F(f,de(Date.now(),y.to-y.from),h),C=t(()=>Me(c,v.candidates),[c,v.candidates]),E=t(()=>new Set(c.map(b)),[c]),D=be(),O=g(),k=m(),A=async()=>{let e=await O({title:r(`history.page.saveTitle`,`Save as panel`),label:r(`history.page.saveName`,`Panel name`),confirmLabel:r(`history.page.save`,`Save`)});e===null||e.trim()===``||await D.update(t=>pe(t,{id:`panel-${Date.now().toString(36)}`,name:e.trim().slice(0,80),window:f,selection:[...c]}))},ee=async(e,t)=>{await k({title:r(`history.page.deleteTitle`,`Delete panel`),message:r(`history.page.deleteMessage`,`The panel "{{name}}" is removed from your account.`,{name:t}),confirmLabel:r(`history.page.delete`,`Delete`),variant:`danger`})&&await D.update(t=>re(t,e))},N=e=>e===`energy`?r(`history.panels.energy`,`Total energy`):e===`temperatures`?r(`history.panels.temperatures`,`Temperatures by room`):e===`nodes`?r(`history.panels.nodes`,`Cluster nodes`):r(`history.panels.storage`,`Storage locations`);return n(Te,{icon:d,title:r(`history.page.title`,`History`),subtitle:r(`history.page.subtitle`,`What devices, nodes and storage recorded over time, side by side.`),actions:i===`present`?e(V,{size:`sm`,variant:`outline`,onClick:()=>void A(),disabled:c.length===0||!D.writable,children:[n(s,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),r(`history.page.saveTitle`,`Save as panel`)]}):void 0,children:i===`pending`?n(L,{className:`h-64 w-full`}):i===`unknown`?n(M,{title:r(`history.page.presenceUnknownTitle`,`Could not reach the hub`),message:r(`history.page.presenceUnknown`,`The hub did not say whether device history is installed. Try again in a moment.`)}):i===`absent`?n(I,{icon:u,title:r(`history.page.absentTitle`,`Device history is not running on this hub`),description:r(`history.page.absent`,`Nothing is recorded until the device-history system addon is enabled.`)}):e(`div`,{className:`space-y-3 sm:space-y-4`,children:[n(Ke,{enabled:i===`present`}),e(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":r(`history.page.panels`,`Panels`),children:[Oe.map(e=>n(V,{size:`sm`,variant:`outline`,disabled:v.status!==`ok`,onClick:()=>_(je(e,v.candidates),f),children:N(e)},e)),D.value.panels.map(t=>e(`span`,{className:`inline-flex items-center`,children:[n(V,{size:`sm`,variant:`secondary`,onClick:()=>_(t.selection,t.window,null),children:t.name}),n(V,{size:`sm`,variant:`ghost`,"aria-label":r(`history.page.deleteNamed`,`Delete panel {{name}}`,{name:t.name}),onClick:()=>void ee(t.id,t.name),disabled:!D.writable,children:n(p,{className:`h-3.5 w-3.5`,"aria-hidden":`true`})})]},t.id))]}),e(`div`,{className:`grid grid-cols-1 gap-3 sm:gap-4 xl:grid-cols-5`,children:[n(`div`,{className:`min-w-0 xl:col-span-2`,children:n(j,{headingId:`history-picker`,title:r(`history.picker.title`,`Series`),children:n(`div`,{className:`p-2 sm:p-3`,children:v.status===`error`?n(M,{message:v.error}):n(Ye,{catalog:v.candidates,loading:v.status===`pending`,selected:E,onChange:e=>{let t=c.filter(t=>e.has(b(t))),n=v.candidates.filter(t=>e.has(t.id)&&!E.has(t.id)).map(e=>e.ref);_([...t,...n],f)}})})})}),n(`div`,{className:`min-w-0 xl:col-span-3`,children:n(j,{headingId:`history-overlay`,title:r(`history.page.overlay`,`Overlay`),actions:c.length>0?n(V,{size:`sm`,variant:`ghost`,onClick:()=>_([],f),children:r(`history.page.clear`,`Clear`)}):void 0,children:e(`div`,{className:`p-2 sm:p-3 space-y-3 min-w-0`,children:[n(ve,{value:f,onChange:e=>_(c,e),custom:h,onCustomChange:e=>_(c,`custom`,Se(e))}),v.status===`pending`&&c.length>0?n(L,{className:`h-64 w-full`}):n(Ne,{part:C,window:S}),C.missing.length>0&&v.status===`ok`&&n(`p`,{className:`text-[11px] text-foreground-subtle`,children:r(`history.page.missing`,{count:C.missing.length,defaultValue_one:`{{count}} selected series is no longer recorded.`,defaultValue_other:`{{count}} selected series are no longer recorded.`})})]})})})]})]})})}function Qe(e){let{t:n}=U(),r=n(`history.picker.wholeFrame`,`Whole frame`),i=h().trpcClient,o=N({projection:`slim`},{enabled:e}),{nodes:s}=me(),c=t(()=>(o.data??[]).filter(e=>!Xe.has(String(e.type))),[o.data]),l=a({queries:c.map(t=>({queryKey:[`device-history`,`listSeries`,t.id],queryFn:()=>i.deviceHistory.listSeries.query({deviceId:t.id}),enabled:e,staleTime:$}))}),u=a({queries:s.map(t=>({queryKey:[`device-history`,`listNodeSeries`,t.id],queryFn:()=>i.deviceHistory.listNodeSeries.query({forNodeId:t.id}),enabled:e,staleTime:$}))}),d=_e({},{enabled:e,staleTime:$}),f=t(()=>new Map((d?.data??[]).map(e=>[e.id,e.displayName])),[d?.data]),p=l.map(e=>e.data),m=u.map(e=>e.data),g=t(()=>Ee(c.flatMap((e,t)=>{let n=p[t];return n===void 0?[]:[{device:{id:e.id,name:e.name,location:e.location??null},series:n}]}),s.flatMap((e,t)=>{let n=m[t];return n===void 0?[]:[{node:{id:e.id,name:e.name},series:n}]}),e=>{if(e.key!==`addon:pipeline-analytics/occupancy`)return f.get(e.scope)??e.scope;let{zoneId:t,className:n}=y(e.scope),i=t===``?r:t;return n===void 0?i:`${i} · ${n}`}),[c,s,f,[...l,...u].map(e=>e.dataUpdatedAt).join(`,`),r]);return o.status===`error`?{status:`error`,error:o.error.message,candidates:[]}:{status:o.status===`pending`||l.some(e=>e.isPending)||u.some(e=>e.isPending)?`pending`:`ok`,error:``,candidates:g}}export{Ze as HistoryPage};
|
|
1
|
+
import{C as e,K as t,S as n,Y as r,et as i,i as a,x as o}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CEyXHAdg.js";import{Dn as s,Fn as c,Kt as l,Pr as u,Ri as d,Sa as f,bt as p,ct as m,ht as h,lt as g,xr as _}from"./player-overlays-D5PuUVGx.js";import{Br as v,po as y}from"./client-DDfmis6s.js";import{A as b,B as x,Br as S,C,D as w,E as T,Ei as E,F as D,Fr as O,H as k,I as A,In as j,Ir as ee,Jr as M,Ko as N,Kr as te,L as ne,M as re,N as ie,On as ae,Pr as oe,R as se,Rn as P,Rr as ce,U as le,V as F,Xr as ue,Yr as I,Zr as L,b as de,bo as fe,j as pe,k as R,kf as me,kn as he,oi as z,ri as ge,td as _e,ui as B,vi as V,w as ve,x as ye,y as be,yo as xe,z as Se,zn as H,zr as Ce}from"./src-kgyauwxD.js";import{t as U}from"./useTranslation-BJr-n0es.js";import{Lr as we}from"./index-tVCZ0Ciq.js";import{t as Te}from"./AdminPage-CN1M6UZ4.js";i();function W(e,t){return e.scope===``?e.displayName:`${e.displayName} · ${t?.(e)??e.scope}`}function Ee(e,t,n){let r=[];for(let{device:t,series:i}of e)for(let e of i){let i={subject:{kind:`device`,deviceId:t.id},key:e.key,scope:e.scope};r.push({id:b(i),ref:i,info:e,subjectName:t.name,location:t.location??``,nodeId:``,metric:W(e,n)})}for(let{node:e,series:i}of t)for(let t of i){let i={subject:{kind:`node`,nodeId:e.id},key:t.key,scope:t.scope};r.push({id:b(i),ref:i,info:t,subjectName:e.name,location:``,nodeId:e.id,metric:W(t,n)})}return r}function De(e){return[e.subjectName,e.location,e.metric,e.info.key,e.info.unit??``,e.nodeId].join(` `)}function G(e,t,n){if(e.ref.subject.kind!==`device`||t===null)return e.subjectName;let r=t.byId.get(e.ref.subject.deviceId);return r===void 0?e.subjectName:ge(r,`compact`,t,n)}var Oe=[`energy`,`temperatures`,`nodes`,`storage`],ke=new Set([`cap:temperature-sensor.temperature`,`cap:climate-control.currentTemp`]),K=[`addon:metrics-native/node-cpu-percent`,`addon:metrics-native/node-memory-percent`],Ae=`addon:storage-orchestrator/location-used-percent`;function je(e,t){let n=(e,n)=>{let r=t.filter(e);return R((n?[...r].sort(n):r).map(e=>e.ref))};switch(e){case`energy`:return n(e=>e.ref.subject.kind===`device`&&e.info.key===`derived:energy.kwh`);case`temperatures`:return n(e=>e.ref.subject.kind===`device`&&ke.has(e.info.key)&&e.info.scope===``,(e,t)=>e.location.localeCompare(t.location)||e.subjectName.localeCompare(t.subjectName));case`nodes`:return n(e=>e.ref.subject.kind===`node`&&K.includes(e.info.key)&&e.info.scope===``,(e,t)=>K.indexOf(e.info.key)-K.indexOf(t.info.key)||e.subjectName.localeCompare(t.subjectName));case`storage`:return n(e=>e.ref.subject.kind===`node`&&e.info.key===Ae)}}function Me(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[],i=[],a=[],o=[];for(let t of R(e)){let e=n.get(b(t));if(e===void 0){o.push(t);continue}e.info.key===`derived:energy.kwh`?a.push(e):e.info.kind===`boolean`||e.info.kind===`enum`?i.push(e):r.push(e)}return{lines:r,states:i,energy:a,missing:o}}function q(e){return e.subject.kind===`device`?{deviceId:e.subject.deviceId,key:e.key,scope:e.scope}:{forNodeId:e.subject.nodeId,key:e.key,scope:e.scope}}var J=`history-page`;function Ne({part:r,window:i}){let{t:a}=U(),o=f(),s=B(),c=z(),l=e=>`${G(e,s,c)} · ${e.metric}`,u=t(()=>[...r.lines,...r.states,...r.energy],[r]),p=C(t(()=>u.map(e=>q(e.ref)),[u]),i,!1),m=e=>p.status===`ok`?p.data.current.get(ye(q(e.ref))):void 0,h=e=>{let t=m(e);return t?.ok?t.result:void 0};if(u.length===0)return n(I,{icon:d,title:a(`history.page.emptyTitle`,`Pick series to compare`),description:a(`history.page.emptyHint`,`Choose up to 24 series on the left, or start from a panel above.`)});if(p.status===`error`)return n(M,{title:a(`history.page.readFailed`,`History could not be read`),message:p.error});let g=p.status===`pending`,_=u.map(e=>({c:e,e:m(e)})).filter(e=>e.e?.ok===!1),v=r.lines.map((e,t)=>{let n=h(e),r=A(e.info,n,i.from);return{id:e.id,label:l(e),unit:e.info.unit,colorIndex:t,points:r.points,gapMs:r.gapMs,interpolation:r.held&&n?.resolution===`raw`?`step`:`linear`}}),y=r.states.map((e,t)=>{let n=ne(e.info,h(e),i.from,i.to),r=ie(e.info.key,o);return{id:e.id,label:l(e),kind:e.info.kind===`boolean`?`boolean`:`enum`,colorIndex:e.info.kind===`boolean`?t:0,states:n.states,segments:n.segments,totals:n.totals,stateLabel:e.info.kind===`boolean`?e=>e===`true`?r.on:r.off:void 0}}),b=r.energy.map(e=>({c:e,...D(h(e))})),x=b[0]?.bucketMs??36e5,S=[...new Set(b.flatMap(e=>e.buckets.map(e=>e.t)))].sort((e,t)=>e-t).map(e=>({t:e,values:b.map(t=>t.buckets.find(t=>t.t===e)?.values[0]??null)}));return e(`div`,{className:`space-y-5 min-w-0`,children:[_.length>0&&n(M,{title:a(`history.page.someFailed`,`Some series could not be read`),message:_.map(e=>`${l(e.c)}: ${e.e.error}`).join(` · `)}),v.length>0&&n(le,{title:a(`history.page.lines`,`Measurements`),series:v,range:i,height:260,syncKey:J,pending:g}),b.length>0&&n(te,{title:a(`history.page.energy`,`Energy`),layers:b.map((e,t)=>({id:e.c.id,label:G(e.c,s,c),colorIndex:t})),buckets:S,bucketMs:x,range:i,unit:`kWh`,showTotal:!0,height:160,syncKey:J,pending:g}),y.length>0&&n(k,{title:y.length===1?y[0]?.label??``:a(`history.page.states`,`States`),rows:y,range:i,syncKey:J,pending:g})]})}function Pe(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}async function Fe(e,t){let n=[];for(let r of Pe(e,50))try{let{results:e}=await t(r),i=new Map(e.map(e=>[e.seriesId,e]));for(let e of r)n.push(i.get(e)??{seriesId:e,ok:!1,reason:`not-found`})}catch(e){let t=e instanceof Error?e.message:String(e);for(let e of r)n.push({seriesId:e,ok:!1,reason:`request-failed`,message:t})}return n}function Y(e){return e.raw+e[`5m`]+e[`1h`]+e[`1d`]}function Ie(e){return e.reduce((e,t)=>t.ok?{...e,deleted:e.deleted+1,points:e.points+Y(t.deleted)}:{...e,refused:e.refused+1},{deleted:0,refused:0,points:0})}function Le(e,t){let n=new Map(e.map(e=>[e.seriesId,e]));return t.flatMap(e=>{let t=n.get(e.seriesId);return t===void 0?[]:[{series:t,outcome:e}]})}var X=e=>new Date(e).toLocaleDateString(void 0,{dateStyle:`short`});function Z(e,t,n){let r=t.get(e.deviceId);return r===void 0?e.reason===`device-gone`?n(`history.orphans.deviceRemoved`,`#{{id}} (removed)`,{id:e.deviceId}):n(`history.orphans.deviceId`,`#{{id}}`,{id:e.deviceId}):r}function Q(e){let t=e.displayName??e.key;return e.scope===``?t:`${t} · ${e.scope}`}function Re(t,r,i){return{key:`series`,header:i(`history.orphans.colSeries`,`Series`),render:a=>{let o=t(a);return e(`div`,{className:`min-w-0 max-w-[16rem]`,children:[n(`div`,{className:`truncate text-foreground`,title:o.key,children:Q(o)}),n(`div`,{className:`truncate text-[10px] text-foreground-subtle`,children:Z(o,r,i)})]})},sortValue:e=>`${Z(t(e),r,i)} ${Q(t(e))}`}}var ze=[`raw`,`5m`,`1h`,`1d`];function Be(e,t){return e===`raw`?t(`history.orphans.colRaw`,`Raw points`):e===`5m`?t(`history.orphans.col5m`,`5 min`):e===`1h`?t(`history.orphans.col1h`,`1 h`):t(`history.orphans.col1d`,`1 day`)}function Ve(t,r){return[Re(e=>e,t,r),{key:`reason`,header:r(`history.orphans.colReason`,`Reason`),render:t=>e(`div`,{className:`flex flex-col items-start gap-0.5`,children:[n(E,{variant:t.reason===`device-gone`?`warning`:`neutral`,className:`text-[10px]`,children:t.reason===`device-gone`?r(`history.orphans.deviceGone`,`Device removed`):r(`history.orphans.undeclared`,`No longer declared`)}),t.missingSince!==null&&n(`span`,{className:`text-[10px] text-foreground-subtle`,children:r(`history.orphans.since`,`since {{date}}`,{date:X(t.missingSince)})})]}),sortValue:e=>e.reason},{key:`span`,header:r(`history.orphans.colSpan`,`Recorded`),render:t=>e(`span`,{className:`tabular-nums text-foreground-muted`,children:[X(t.firstTs),` → `,X(t.lastTs)]}),sortValue:e=>e.lastTs},...ze.map(e=>({key:`rows-${e}`,header:Be(e,r),align:`right`,render:t=>n(`span`,{className:`tabular-nums text-foreground-muted`,children:t.rows[e].toLocaleString()}),sortValue:t=>t.rows[e]}))]}function He(e,t){if(e.ok)return n(E,{variant:`success`,className:`text-[10px]`,children:t(`history.orphans.deleted`,{count:Y(e.deleted),points:Y(e.deleted).toLocaleString(),defaultValue_one:`Deleted · {{points}} point`,defaultValue_other:`Deleted · {{points}} points`})});let r=e.reason===`request-failed`?t(`history.orphans.requestFailed`,`Not sent: {{message}}`,{message:e.message}):e.reason===`not-orphan`?t(`history.orphans.refusedNotOrphan`,`Kept: no longer orphan`):e.reason===`not-found`?t(`history.orphans.refusedNotFound`,`Already gone`):t(`history.orphans.refusedFailed`,`The hub could not delete it`);return n(E,{variant:e.reason===`not-found`?`neutral`:`warning`,className:`text-[10px]`,children:r})}function Ue(e,t){return[Re(e=>e.series,e,t),{key:`result`,header:t(`history.orphans.colResult`,`Result`),render:e=>He(e.outcome,t),sortValue:e=>+!e.outcome.ok}]}i();function We({open:i,onClose:a,list:o,deviceNames:s,onDelete:u,onRefresh:d,refreshing:f}){let{t:p}=U(),h=m(),[g,v]=r(new Set),[y,b]=r(!1),[x,C]=r([]),w=t(()=>Ve(s,p),[s,p]),T=t(()=>Ue(s,p),[s,p]),E=t(()=>new Set(o.series.map(e=>String(e.seriesId))),[o.series]),D=[...g].filter(e=>E.has(e)).map(Number),k=Ie(x.map(e=>e.outcome)),A=async()=>{if(await h({title:p(`history.orphans.confirmTitle`,{count:D.length,defaultValue_one:`Delete {{count}} series`,defaultValue_other:`Delete {{count}} series`}),message:p(`history.orphans.confirmMessage`,`Every recorded point of these series is removed from the hub. This cannot be undone.`),confirmLabel:p(`history.orphans.confirmLabel`,`Delete`),variant:`danger`})){b(!0);try{let e=await Fe(D,u);C(Le(o.series,e)),v(new Set)}finally{b(!1),d()}}};return n(oe,{open:i,onOpenChange:e=>!e&&a(),children:e(ee,{width:`xl`,placement:`sheet-on-mobile`,scroll:`body`,"data-testid":`orphan-series-dialog`,children:[n(Ce,{children:n(S,{children:p(`history.orphans.title`,`Series no longer linked to a device`)})}),e(O,{className:`space-y-3`,children:[n(`p`,{className:`text-xs text-foreground-muted`,children:p(`history.orphans.intro`,`Nothing records into these series any more: their device was removed, or no capability declares them now. Select the ones to delete.`)}),o.truncated&&e(`div`,{className:`flex flex-wrap items-center gap-2`,"data-testid":`orphan-truncated`,children:[n(`p`,{className:`text-xs text-warning`,children:p(`history.orphans.truncated`,`More series are unlinked than are listed here. Delete these, then load the rest.`)}),e(V,{size:`sm`,variant:`outline`,onClick:d,disabled:f,children:[n(c,{className:`h-3 w-3`,"aria-hidden":!0}),p(`history.orphans.loadAgain`,`Load again`)]})]}),x.length>0&&e(`div`,{className:`space-y-2`,"data-testid":`orphan-outcomes`,children:[n(`p`,{className:`text-xs text-foreground`,"aria-live":`polite`,children:p(`history.orphans.summary`,{count:k.deleted,refused:k.refused,points:k.points.toLocaleString(),defaultValue_one:`{{count}} series deleted ({{points}} points), {{refused}} kept.`,defaultValue_other:`{{count}} series deleted ({{points}} points), {{refused}} kept.`})}),n(P,{columns:T,rows:x,rowKey:e=>String(e.series.seriesId),minWidthPx:420,maxBodyHeight:`max-h-[60vh]`,emptyMessage:``})]}),n(P,{columns:w,rows:o.series,rowKey:e=>String(e.seriesId),minWidthPx:760,maxBodyHeight:H,defaultSort:{columnKey:`series`,dir:`asc`},emptyMessage:p(`history.orphans.empty`,`Every series is linked to a device.`),selection:{selected:g,onChange:v,rowLabel:e=>`${Q(e)} — ${Z(e,s,p)}`,pageLabel:p(`history.orphans.selectAll`,`Select every listed series`)}})]}),e(ce,{children:[n(`span`,{className:`mr-auto text-[11px] tabular-nums text-foreground`,"aria-live":`polite`,children:p(`history.orphans.selected`,{count:D.length,defaultValue_one:`{{count}} selected`,defaultValue_other:`{{count}} selected`})}),n(V,{variant:`ghost`,size:`sm`,onClick:a,children:p(`history.orphans.close`,`Close`)}),e(V,{variant:`danger`,size:`sm`,disabled:D.length===0||y,onClick:()=>void A(),children:[y?n(_,{className:`h-3 w-3 animate-spin`,"aria-hidden":!0}):n(l,{className:`h-3 w-3`,"aria-hidden":!0}),p(`history.orphans.deleteSelected`,`Delete selected`)]})]})]})})}i();var Ge=5*6e4;function Ke({enabled:i}){let{t:a}=U(),[s,c]=r(!1),l=fe({},{enabled:i,staleTime:Ge}),u=N({projection:`slim`},{enabled:i}),d=xe(),f=t(()=>new Map((u.data??[]).map(e=>[e.id,e.name])),[u.data]),p=e=>d.mutateAsync({seriesIds:[...e]});if(!i||l.status===`pending`)return null;if(l.status===`error`)return n(M,{variant:`warning`,title:a(`history.orphans.checkFailedTitle`,`Could not check for unlinked series`),message:l.error.message,onRetry:()=>void l.refetch()});let m=l.data;if(m.series.length===0&&!s)return null;let h=m.series.length;return e(o,{children:[h>0&&n(M,{variant:`warning`,message:m.truncated?a(`history.orphans.noticeMore`,{count:h,defaultValue_one:`More than {{count}} series are no longer linked to a device.`,defaultValue_other:`More than {{count}} series are no longer linked to a device.`}):a(`history.orphans.notice`,{count:h,defaultValue_one:`{{count}} series is no longer linked to a device.`,defaultValue_other:`{{count}} series are no longer linked to a device.`}),action:n(V,{size:`sm`,variant:`outline`,onClick:()=>c(!0),children:a(`history.orphans.review`,`Review`)})}),n(We,{open:s,onClose:()=>c(!1),list:m,deviceNames:f,onDelete:p,onRefresh:()=>void l.refetch(),refreshing:l.isFetching})]})}i();var qe=`device`,Je=`node`;function Ye({catalog:r,selected:i,onChange:a,loading:o}){let{t:s}=U(),c=B(),l=z(),u=e=>G(e,c,l),d=ae(r,{searchText:e=>[De(e)],facetGroups:[{id:`subject`,value:e=>e.ref.subject.kind===`device`?qe:Je},{id:`room`,value:e=>e.location},{id:`unit`,value:e=>e.info.unit??``}]}),f=t(()=>[{key:`metric`,header:s(`history.picker.series`,`Series`),render:t=>e(`div`,{className:`min-w-0`,children:[n(`div`,{className:`truncate text-foreground`,children:t.metric}),n(`div`,{className:`truncate text-[10px] text-foreground-subtle`,children:t.location===``?u(t):`${u(t)} · ${t.location}`})]}),sortValue:e=>`${e.subjectName} ${e.metric}`},{key:`unit`,header:s(`history.picker.unit`,`Unit`),render:e=>n(`span`,{className:`text-foreground-muted`,children:e.info.unit??`—`}),sortValue:e=>e.info.unit??``}],[s,c,l]),p=i.size>=24;return e(`div`,{className:`space-y-2 min-w-0`,children:[n(he,{state:d.state,facets:[],groups:[{...d.groups.find(e=>e.id===`subject`)??{id:`subject`,facets:[],selected:[]},label:s(`history.picker.subject`,`Source`),facetLabel:e=>e===qe?s(`history.picker.devices`,`Devices`):s(`history.picker.nodes`,`Nodes`)},{...d.groups.find(e=>e.id===`room`)??{id:`room`,facets:[],selected:[]},label:s(`history.picker.room`,`Room`),facetLabel:e=>e===``?s(`history.picker.noRoom`,`No room`):e},{...d.groups.find(e=>e.id===`unit`)??{id:`unit`,facets:[],selected:[]},label:s(`history.picker.metricType`,`Unit`),facetLabel:e=>e===``?s(`history.picker.noUnit`,`States & counts`):e}],labels:{searchPlaceholder:s(`history.picker.search`,`Search device, room, metric or node…`),searchLabel:s(`history.picker.searchLabel`,`Search series`),facetsLabel:s(`history.picker.facets`,`Filters`),clearLabel:s(`history.picker.clear`,`Clear`)},onSearch:d.setSearch,onToggleFacet:d.toggleFacet,onToggleGroupFacet:d.toggleGroupFacet,onClear:d.clear}),n(`p`,{className:`text-[10px] text-foreground-subtle`,"aria-live":`polite`,children:s(`history.picker.count`,`{{count}} of {{max}} selected`,{count:i.size,max:24})}),n(P,{columns:f,rows:d.rows,rowKey:e=>e.id,maxBodyHeight:H,pageSize:50,defaultSort:{columnKey:`metric`,dir:`asc`},emptyMessage:o?s(`history.picker.loading`,`Reading the series of every device…`):d.active?s(`history.picker.emptyFiltered`,`No series match these filters.`):s(`history.picker.empty`,`Nothing is recorded yet.`),selection:{selected:i,onChange:e=>{let t=[...e].filter(e=>i.has(e)),n=[...e].filter(e=>!i.has(e));a(new Set([...t,...n].slice(0,24)))},isSelectable:e=>i.has(e.id)||!p,rowLabel:e=>`${u(e)} · ${e.metric}`,pageLabel:s(`history.picker.selectPage`,`Select every series on this page`)}})]})}i();var Xe=new Set([y.Hub,y.Container]),$=5*6e4;function Ze(){let{t:r}=U(),i=ue(`device-history`),[a,o]=we(),c=t(()=>R(a.getAll(`s`).flatMap(e=>{let t=T(e);return t===null?[]:[t]})),[a]),l=a.get(`window`),f=x(l)?l:`7d`,h=se(a.get(`range`)),_=(e,t,n)=>{let r=new URLSearchParams;for(let t of R(e))r.append(`s`,w(t));t!==`7d`&&r.set(`window`,t);let i=n===void 0?a.get(`range`):n;t===`custom`&&i&&r.set(`range`,i),o(r,{replace:!0})},v=Qe(i===`present`),y=F(f,Date.now(),h),S=F(f,de(Date.now(),y.to-y.from),h),C=t(()=>Me(c,v.candidates),[c,v.candidates]),E=t(()=>new Set(c.map(b)),[c]),D=be(),O=g(),k=m(),A=async()=>{let e=await O({title:r(`history.page.saveTitle`,`Save as panel`),label:r(`history.page.saveName`,`Panel name`),confirmLabel:r(`history.page.save`,`Save`)});e===null||e.trim()===``||await D.update(t=>pe(t,{id:`panel-${Date.now().toString(36)}`,name:e.trim().slice(0,80),window:f,selection:[...c]}))},ee=async(e,t)=>{await k({title:r(`history.page.deleteTitle`,`Delete panel`),message:r(`history.page.deleteMessage`,`The panel "{{name}}" is removed from your account.`,{name:t}),confirmLabel:r(`history.page.delete`,`Delete`),variant:`danger`})&&await D.update(t=>re(t,e))},N=e=>e===`energy`?r(`history.panels.energy`,`Total energy`):e===`temperatures`?r(`history.panels.temperatures`,`Temperatures by room`):e===`nodes`?r(`history.panels.nodes`,`Cluster nodes`):r(`history.panels.storage`,`Storage locations`);return n(Te,{icon:d,title:r(`history.page.title`,`History`),subtitle:r(`history.page.subtitle`,`What devices, nodes and storage recorded over time, side by side.`),actions:i===`present`?e(V,{size:`sm`,variant:`outline`,onClick:()=>void A(),disabled:c.length===0||!D.writable,children:[n(s,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),r(`history.page.saveTitle`,`Save as panel`)]}):void 0,children:i===`pending`?n(L,{className:`h-64 w-full`}):i===`unknown`?n(M,{title:r(`history.page.presenceUnknownTitle`,`Could not reach the hub`),message:r(`history.page.presenceUnknown`,`The hub did not say whether device history is installed. Try again in a moment.`)}):i===`absent`?n(I,{icon:u,title:r(`history.page.absentTitle`,`Device history is not running on this hub`),description:r(`history.page.absent`,`Nothing is recorded until the device-history system addon is enabled.`)}):e(`div`,{className:`space-y-3 sm:space-y-4`,children:[n(Ke,{enabled:i===`present`}),e(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":r(`history.page.panels`,`Panels`),children:[Oe.map(e=>n(V,{size:`sm`,variant:`outline`,disabled:v.status!==`ok`,onClick:()=>_(je(e,v.candidates),f),children:N(e)},e)),D.value.panels.map(t=>e(`span`,{className:`inline-flex items-center`,children:[n(V,{size:`sm`,variant:`secondary`,onClick:()=>_(t.selection,t.window,null),children:t.name}),n(V,{size:`sm`,variant:`ghost`,"aria-label":r(`history.page.deleteNamed`,`Delete panel {{name}}`,{name:t.name}),onClick:()=>void ee(t.id,t.name),disabled:!D.writable,children:n(p,{className:`h-3.5 w-3.5`,"aria-hidden":`true`})})]},t.id))]}),e(`div`,{className:`grid grid-cols-1 gap-3 sm:gap-4 xl:grid-cols-5`,children:[n(`div`,{className:`min-w-0 xl:col-span-2`,children:n(j,{headingId:`history-picker`,title:r(`history.picker.title`,`Series`),children:n(`div`,{className:`p-2 sm:p-3`,children:v.status===`error`?n(M,{message:v.error}):n(Ye,{catalog:v.candidates,loading:v.status===`pending`,selected:E,onChange:e=>{let t=c.filter(t=>e.has(b(t))),n=v.candidates.filter(t=>e.has(t.id)&&!E.has(t.id)).map(e=>e.ref);_([...t,...n],f)}})})})}),n(`div`,{className:`min-w-0 xl:col-span-3`,children:n(j,{headingId:`history-overlay`,title:r(`history.page.overlay`,`Overlay`),actions:c.length>0?n(V,{size:`sm`,variant:`ghost`,onClick:()=>_([],f),children:r(`history.page.clear`,`Clear`)}):void 0,children:e(`div`,{className:`p-2 sm:p-3 space-y-3 min-w-0`,children:[n(ve,{value:f,onChange:e=>_(c,e),custom:h,onCustomChange:e=>_(c,`custom`,Se(e))}),v.status===`pending`&&c.length>0?n(L,{className:`h-64 w-full`}):n(Ne,{part:C,window:S}),C.missing.length>0&&v.status===`ok`&&n(`p`,{className:`text-[11px] text-foreground-subtle`,children:r(`history.page.missing`,{count:C.missing.length,defaultValue_one:`{{count}} selected series is no longer recorded.`,defaultValue_other:`{{count}} selected series are no longer recorded.`})})]})})})]})]})})}function Qe(e){let{t:n}=U(),r=n(`history.picker.wholeFrame`,`Whole frame`),i=h().trpcClient,o=N({projection:`slim`},{enabled:e}),{nodes:s}=me(),c=t(()=>(o.data??[]).filter(e=>!Xe.has(String(e.type))),[o.data]),l=a({queries:c.map(t=>({queryKey:[`device-history`,`listSeries`,t.id],queryFn:()=>i.deviceHistory.listSeries.query({deviceId:t.id}),enabled:e,staleTime:$}))}),u=a({queries:s.map(t=>({queryKey:[`device-history`,`listNodeSeries`,t.id],queryFn:()=>i.deviceHistory.listNodeSeries.query({forNodeId:t.id}),enabled:e,staleTime:$}))}),d=_e({},{enabled:e,staleTime:$}),f=t(()=>new Map((d?.data??[]).map(e=>[e.id,e.displayName])),[d?.data]),p=l.map(e=>e.data),m=u.map(e=>e.data),g=t(()=>Ee(c.flatMap((e,t)=>{let n=p[t];return n===void 0?[]:[{device:{id:e.id,name:e.name,location:e.location??null},series:n}]}),s.flatMap((e,t)=>{let n=m[t];return n===void 0?[]:[{node:{id:e.id,name:e.name},series:n}]}),e=>{if(e.key!==`addon:pipeline-analytics/occupancy`)return f.get(e.scope)??e.scope;let{zoneId:t,className:n}=v(e.scope),i=t===``?r:t;return n===void 0?i:`${i} · ${n}`}),[c,s,f,[...l,...u].map(e=>e.dataUpdatedAt).join(`,`),r]);return o.status===`error`?{status:`error`,error:o.error.message,candidates:[]}:{status:o.status===`pending`||l.some(e=>e.isPending)||u.some(e=>e.isPending)?`pending`:`ok`,error:``,candidates:g}}export{Ze as HistoryPage};
|