import{F as Fi,T as Ti}from'./chunk-Dje8DzKw.js';import{d}from'./chunk-Dpcaoaz_.js';import{U as Ut$2}from'./chunk-D4UsfQQX.js';import{B}from'./chunk-C8m0Xc8q.js';import{w as w$1,q,H,Y,G,r as re$1}from'./chunk-CB82O7Po.js';import{K as Kt,M as Me,j as jt,r as rl$1,l as ll$1,P as Pa$2,U as Un$1,Q as Qn$1,t as tl$2,W as Wo$1,b as la$1,c as Qe}from'./chunk-WfrOSB5f.js';import{a as ae,A as Ae,c as c$1}from'./chunk-ByCPOpgQ.js';import{Q}from'./chunk-awKCnOdM.js';import{V as Vd,w as wi}from'./chunk-D8k0e5mQ.js';import'./chunk-yl6_b1fW.js';import{m as me}from'./chunk-D6G00JKq.js';import{h}from'./chunk-Bms7X8vH.js';import{z as z$1}from'./chunk-C5Pz-QUv.js';import'./chunk-BeORjHTo.js';import{Z}from'./chunk-DKL7x6EW.js';import{n}from'./chunk-BtXYuiM6.js';import{o as or$1}from'./chunk-DE4nVJpr.js';import{B as Bc,s as si,u as ue,Q as Qh,L as Lh}from'./chunk-mYtNHXnt.js';import{J as Je$1}from'./chunk-CHdr4AjD.js';import'./chunk-DgsNRGqZ.js';import{_}from'./chunk-D6Znh4tr.js';import{p as p$1}from'./chunk-DoK4sbCH.js';import'./chunk-BRBtyPtw.js';import{p}from'./chunk-K432g2d1.js';import{H as Ht$1,D as Dt,N as Nt,U as Un}from'./chunk-D-Jqsism.js';import{d as d$1}from'./chunk-sjVbQlUC.js';import{t}from'./chunk-CSCyLw6V.js';import'./chunk-ChTAcsy3.js';import{c}from'./chunk-UlPSRvqf.js';import{i as i$2}from'./chunk-j2qBDigd.js';import'./chunk-ZCgWdH_J.js';import{r}from'./chunk-F7sai10S.js';import{av as E,ao as D,d7 as ak,b as Pa$1,g,aQ as Xe,aM as R1,aN as $,a as rc$1,a7 as gg,aO as jr$1,aA as ag,aC as x,$ as $t,bN as kk,bv as i$1,w as wpe,am as Zt,bS as em,br as lt,dC as tHe,aE as L,aF as DAe,be as M,dD as XDe,dy as K,by as Z$1,bA as Ije,dE as T,dF as z,dG as ze,dH as De,I as w,b2 as mt,bF as Uu,dI as Cs$1,b1 as pg,dJ as cIe,cw as Rc,dK as sIe,a9 as Oe,a_ as Lk,bD as Dje,P as Pc,dL as H$1,aP as Ut$1,aR as fe,dM as KP,r as rr$1,dN as k5,dO as vTe,aY as S,dP as ri,bL as J,bM as _o,al as H$2,L as qp,dQ as Rpe,ar as _pe,bo as tc$1,j,R as tl$1,dR as A,C as Cpe,dS as nDe,dT as ie,dU as tt,dV as ms$1,dW as W,dX as q1,bs as L$1,dl as Ie,dY as le,dZ as be,d_ as Ce,cT as Ln,cU as mn,d$ as ot,aL as Ye,e0 as j1,e1 as Et,cK as A$1,at as Mn,e2 as Fr$1,e3 as It,cN as kt,e4 as Gc,e5 as Gu,e6 as ae$1,e7 as Dn,bK as sn$1,e8 as N,e9 as Wd,ea as nt,eb as an$1,ec as o3,ah as c$,bP as D$1,bQ as af,bl as ta$1,ed as E_e,ee as _r$1,aX as fe$1,bf as Pl$1,ef as ni,eg as Fe,eh as L$2,ei as q$1,ej as $$1,ek as R,el as H1,e as Pp,J as Jn,q as qn,l as ln$1,M as Me$1,s as sp,y as yV,u as ub,ae as R2,af as A2,z as zB,ag as N2,ci as lb,m as _2,a6 as KV,cj as db,c6 as H0,dt as cx,A as w2,ak as wx,ck as W0,cc as kS,cp as hn,k as k2,F as Fp,a3 as B0,T as Tr$1,cx as fe$2,X as Xh,cd as R3,em as dx,ca as M$1,c as DV,H as it,n as Mx,t as GH,_ as _0,N as Nx,W as WH,f as fx,bV as vz,cy as vb,a0 as $n,Q as Qn,a1 as Vn,a2 as yn,cf as I0,ai as EV,dz as ed,U as cl$1,V as w3,D as D$,Z as Zn,Y as Je,a5 as fn,bW as v,a4 as l$,ct as r$,c4 as U,as as Yl$1,en as N1,ad as ti,O as J$,b_ as vx,cs as Lp,cE as BV,cg as ef,ch as tf,i as ix,h as sx,o as bV,v as ax,x as vV,d as $I,G as GI,bY as fb,cq as v$,bZ as kp,cz as b$,cr as S$,aj as IV,cG as V0,p as e$,au as ow,ce as u$,cF as sw}from'./main-BiUBeaMj.js';import{L as L$3}from'./chunk-CVz8lsM6.js';import{H as H$3}from'./chunk-DWtNtBal.js';var ko=H$2(($c,Qr)=>{Qr.exports=`<svg width="278" height="202" viewBox="0 0 278 202" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path d="M154.004 185.78C207.06 179.326 249.514 169.528 248.829 163.895C248.144 158.262 204.579 158.927 151.523 165.381C98.4671 171.835 56.0125 181.633 56.6977 187.266C57.3829 192.899 100.948 192.233 154.004 185.78Z" fill="url(#paint0_radial_2530_45010)" fill-opacity="0.1" />
  <rect x="50.5752" y="22.3535" width="167" height="167" rx="24" transform="rotate(-7.69207 50.5752 22.3535)" fill="var(--bg)" />
  <path d="M106.941 75.79L175.903 66.4757C179.902 65.9355 184.024 69.0292 184.689 73.9578L190.119 114.161C190.785 119.09 187.632 123.166 183.632 123.706L114.671 133.02C110.671 133.561 106.55 130.467 105.884 125.538L100.454 85.335C99.7885 80.4063 102.941 76.3302 106.941 75.79Z" stroke="var(--bg-secondary-450)" stroke-width="6" />
  <path d="M115.966 52.623L137.514 70.5249" stroke="var(--bg-secondary-450)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" />
  <path d="M161.057 46.5332L145.03 69.5102" stroke="var(--bg-secondary-450)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" />
  <g clip-path="url(#clip0_2530_45010)">
    <rect y="8.43359" width="74" height="74" rx="37" fill="var(--bg-secondary-450)" />
    <path d="M36.9997 51.8372C44.8237 51.8372 51.1663 45.4946 51.1663 37.6706C51.1663 29.8465 44.8237 23.5039 36.9997 23.5039C29.1756 23.5039 22.833 29.8465 22.833 37.6706C22.833 45.4946 29.1756 51.8372 36.9997 51.8372Z" stroke="var(--secondary-icon-color)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M59.6663 74.5046C59.6663 68.493 57.2783 62.7276 53.0274 58.4768C48.7766 54.226 43.0112 51.8379 36.9997 51.8379C30.9881 51.8379 25.2227 54.226 20.9719 58.4768C16.7211 62.7276 14.333 68.493 14.333 74.5046" stroke="var(--secondary-icon-color)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
  </g>
  <g clip-path="url(#clip1_2530_45010)">
    <rect x="96" y="157.424" width="44" height="44" rx="22" fill="var(--secondary-icon-color)" />
    <path d="M118 184.837C123.062 184.837 127.166 180.733 127.166 175.671C127.166 170.608 123.062 166.504 118 166.504C112.937 166.504 108.833 170.608 108.833 175.671C108.833 180.733 112.937 184.837 118 184.837Z" stroke="var(--bg-secondary-350)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M132.666 199.505C132.666 195.615 131.121 191.884 128.371 189.134C125.62 186.383 121.89 184.838 118 184.838C114.11 184.838 110.379 186.383 107.629 189.134C104.878 191.884 103.333 195.615 103.333 199.505" stroke="var(--bg-secondary-350)" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
  </g>
  <g clip-path="url(#clip2_2530_45010)">
    <rect x="218" y="77.4258" width="60" height="60" rx="30" fill="var(--fg-300)" />
    <path d="M248 115.504C254.904 115.504 260.5 109.907 260.5 103.004C260.5 96.1003 254.904 90.5039 248 90.5039C241.096 90.5039 235.5 96.1003 235.5 103.004C235.5 109.907 241.096 115.504 248 115.504Z" stroke="var(--bg-secondary-500)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M268 135.504C268 130.2 265.893 125.112 262.142 121.362C258.391 117.611 253.304 115.504 248 115.504C242.696 115.504 237.609 117.611 233.858 121.362C230.107 125.112 228 130.2 228 135.504" stroke="var(--bg-secondary-500)" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
  </g>
  <circle cx="219" cy="135.43" r="16" fill="var(--bg-secondary-500)" />
  <g clip-path="url(#clip3_2530_45010)">
    <path d="M222.334 138.763L219 135.43L215.667 138.763" stroke="var(--fg-200)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M219 135.43V142.93" stroke="var(--fg-200)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M225.992 140.755C226.805 140.311 227.447 139.61 227.817 138.762C228.187 137.913 228.264 136.966 228.035 136.069C227.807 135.171 227.286 134.376 226.556 133.807C225.825 133.239 224.926 132.93 224 132.93H222.95C222.698 131.954 222.228 131.048 221.575 130.28C220.922 129.513 220.104 128.903 219.182 128.497C218.26 128.091 217.257 127.899 216.25 127.936C215.243 127.973 214.258 128.238 213.368 128.711C212.478 129.184 211.707 129.852 211.112 130.666C210.518 131.48 210.116 132.418 209.936 133.409C209.756 134.401 209.804 135.42 210.075 136.391C210.345 137.361 210.833 138.258 211.5 139.013" stroke="var(--fg-200)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
    <path d="M222.334 138.763L219 135.43L215.667 138.763" stroke="var(--fg-200)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
  </g>
  <circle cx="61" cy="76.4336" r="16" fill="var(--secondary-icon-color)" />
  <path d="M60.8525 73.166C62.5743 73.1661 63.9697 74.5614 63.9697 76.2832C63.9696 78.0049 62.5742 79.4003 60.8525 79.4004C59.1307 79.4004 57.7355 78.005 57.7354 76.2832C57.7354 74.5613 59.1307 73.166 60.8525 73.166ZM60.8525 73.9736C59.5774 73.9736 58.543 75.0081 58.543 76.2832C58.5431 77.5586 59.5778 78.5908 60.8525 78.5908C62.1275 78.5907 63.1601 77.5582 63.1602 76.2832C63.1602 75.0085 62.128 73.9737 60.8525 73.9736Z" fill="black" stroke="var(--bg)" />
  <path d="M60.8516 66.7402C60.076 66.7405 59.4473 67.3692 59.4473 68.1445V68.2988C59.4472 69.0559 58.994 69.7395 58.2969 70.0352L58.2891 70.0391L58.2803 70.043C58.2589 70.0529 58.2373 70.0585 58.2139 70.0605L58.1484 70.0664L58.0869 70.0879C57.4516 70.3169 56.7454 70.1822 56.2402 69.7451L56.1416 69.6543C55.888 69.3698 55.5309 69.2009 55.1514 69.1846L55.1494 69.1836C54.7556 69.1682 54.3723 69.3204 54.0947 69.6016C53.5506 70.1489 53.5508 71.0335 54.0938 71.5811L54.1035 71.5898C54.6841 72.1443 54.8562 73.004 54.5342 73.7412L54.5293 73.751L54.5254 73.7607C54.2489 74.4732 53.5683 74.9483 52.8037 74.9609H52.7129C51.9379 74.961 51.3088 75.5893 51.3086 76.3643C51.3086 77.14 51.9374 77.7695 52.7129 77.7695H52.8633C53.5773 77.7747 54.224 78.1797 54.5449 78.8096L54.6045 78.9385C54.8987 79.6412 54.7469 80.451 54.2188 80.998C53.9309 81.2694 53.7631 81.6432 53.75 82.0361V82.0605C53.7562 82.4282 53.9053 82.7795 54.1689 83.0391V83.04C54.7164 83.5857 55.6017 83.5846 56.1494 83.04L56.1504 83.0391C56.5239 82.6655 57.0279 82.4521 57.5557 82.4443C57.8088 82.443 58.0594 82.4979 58.29 82.6055L58.3057 82.6133L58.3232 82.6201C59.0318 82.8902 59.5054 83.5638 59.5205 84.3223H59.5195V84.4229C59.5196 85.1978 60.1488 85.8261 60.9238 85.8262C61.7003 85.8262 62.328 85.1975 62.3281 84.4229V84.2715C62.3321 83.5135 62.7851 82.8298 63.4814 82.5303L63.4873 82.5273C64.1921 82.2136 65.0171 82.3665 65.5615 82.9121C65.8323 83.201 66.2085 83.3729 66.6064 83.3848H66.6221C67.1904 83.3832 67.7022 83.0388 67.917 82.5137C68.1326 81.9878 68.0099 81.3832 67.6055 80.9834L67.6016 80.9795L67.498 80.8711C67.0047 80.3141 66.8724 79.5161 67.1709 78.8242L67.1699 78.8232C67.4717 78.1329 68.1553 77.6875 68.9092 77.6875V77.6865C69.288 77.7086 69.6591 77.5787 69.9395 77.3223C70.2321 77.0544 70.3961 76.6752 70.3945 76.2812C70.3932 75.5066 69.7658 74.879 68.9912 74.8789H68.8369C68.0825 74.8789 67.401 74.4287 67.1035 73.7363C67.0885 73.6974 67.0766 73.6568 67.0703 73.6143L67.0635 73.5654L67.0459 73.5186L67.0059 73.3906C66.8248 72.7469 67.0034 72.0505 67.4814 71.5732L67.4805 71.5723C67.7617 71.319 67.9302 70.9648 67.9453 70.5869L67.9443 70.5859C67.9607 70.1941 67.8132 69.8157 67.5381 69.5391H67.5391C67.2769 69.2723 66.9179 69.1197 66.542 69.1182L66.5342 69.1191C66.162 69.1238 65.8093 69.2761 65.5508 69.5391H65.5498L65.5459 69.5439C64.9903 70.1249 64.1316 70.2966 63.3945 69.9746C62.7003 69.6714 62.2527 68.985 62.2559 68.2275L62.2549 68.2266C62.2743 67.8976 62.1798 67.5722 61.9844 67.3086L61.8896 67.1953C61.6222 66.9036 61.2446 66.7391 60.8516 66.7402ZM58.7109 84.417C58.7057 83.9671 58.4415 83.5634 58.0352 83.376L58.0342 83.375L57.8779 83.3164C57.5087 83.2082 57.1039 83.2896 56.8037 83.542L56.7832 83.5596L56.7637 83.5801C56.3516 84.0133 55.7828 84.2602 55.1846 84.2676C54.5877 84.2738 54.0124 84.0404 53.5908 83.6172H53.5918C52.7345 82.7542 52.7345 81.3601 53.5918 80.4971L53.5898 80.4951C53.9284 80.182 54.0411 79.6959 53.875 79.2676L53.8711 79.2578L53.8662 79.2471C53.6929 78.8535 53.3081 78.5962 52.8779 78.5869H52.7129C51.4911 78.5869 50.5002 77.5965 50.5 76.374C50.5 75.1522 51.4911 74.1602 52.7129 74.1602V74.1592C53.1638 74.1725 53.5723 73.9103 53.7529 73.5L53.7539 73.501C53.7563 73.4963 53.7574 73.491 53.7598 73.4863C53.765 73.4741 53.7726 73.4627 53.7773 73.4502L53.7754 73.4492C53.9589 73.0462 53.8902 72.5704 53.5889 72.2393L53.5791 72.2275L53.5684 72.2178L53.4141 72.0518C52.6936 71.1913 52.7275 69.9074 53.5283 69.0859C54.3816 68.2099 55.784 68.1919 56.6592 69.0459L56.6602 69.0439C56.97 69.3745 57.4485 69.4896 57.876 69.3271L57.877 69.3281L58.0488 69.2646L58.1025 69.2451L58.1504 69.2139C58.4234 69.0356 58.5983 68.7453 58.6328 68.4268L58.6387 68.2891V68.1445C58.6387 66.9227 59.6291 65.9319 60.8516 65.9316C62.0734 65.9316 63.0654 66.9227 63.0654 68.1445H63.0664C63.045 68.5949 63.2941 69.0146 63.7002 69.21L63.707 69.2139L63.7129 69.2158C64.1165 69.3958 64.5912 69.3205 64.918 69.0176L64.9414 68.9941C65.3569 68.5542 65.9345 68.3038 66.54 68.3008C67.1231 68.3018 67.6825 68.5325 68.0957 68.9424C68.5121 69.3574 68.7461 69.9218 68.7461 70.5098C68.7461 71.0978 68.5115 71.661 68.0947 72.0762L68.0957 72.0771C67.7964 72.3522 67.6737 72.7654 67.7686 73.1533L67.8242 73.3232C67.8341 73.3479 67.8434 73.377 67.8506 73.4111L67.8721 73.5127L67.9316 73.5967C68.1338 73.8834 68.461 74.056 68.8115 74.0615H68.9912C70.213 74.0616 71.204 75.0519 71.2041 76.2744C71.2041 77.4962 70.213 78.4872 68.9912 78.4873V78.4893C68.5448 78.4707 68.1249 78.7142 67.9268 79.1211L67.9209 79.1318C67.7332 79.5426 67.8211 80.0251 68.1396 80.3438L68.1436 80.3486C69.0198 81.2046 69.0366 82.6089 68.1807 83.4854H68.1797C67.3248 84.3612 65.9205 84.3776 65.0439 83.5215H65.043C64.748 83.1971 64.2884 83.0775 63.873 83.2227C63.4366 83.3738 63.1422 83.7836 63.1367 84.2451V84.4229C63.1366 85.6446 62.1456 86.6357 60.9238 86.6357C59.7021 86.6356 58.7111 85.6446 58.7109 84.4229V84.417Z" fill="black" stroke="var(--bg)" />
  <path d="M45 97C55.5 115 81.5 115.5 88 109.5C94.5 103.5 70 92.5 68 119C66.4 140.2 80.6667 156.5 88 162" stroke="var(--bg-secondary-500)" stroke-linecap="round" stroke-dasharray="4 4" />
  <path d="M251 146.5C253.5 162 253 202 209 184.5C165 167 167 162 148 165" stroke="var(--bg-secondary-500)" stroke-linecap="round" stroke-dasharray="4 4" />
  <path d="M239.5 70.5002C223.5 57 193 63.5011 172.5 82.0005" stroke="var(--bg-secondary-500)" stroke-linecap="round" stroke-dasharray="4 4" />
  <path d="M170.286 79C170.286 80.3609 167.185 83.4258 166.259 85.8156C166.03 86.4039 166.577 86.8845 167.196 86.7608L176 85" stroke="var(--bg-secondary-500)" stroke-linecap="round" />
  <defs>
    <radialGradient id="paint0_radial_2530_45010" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(152.764 175.58) rotate(-6.93547) scale(96.7739 10.2746)">
      <stop />
      <stop offset="1" stop-opacity="0" />
    </radialGradient>
    <clipPath id="clip0_2530_45010">
      <rect y="8.43359" width="74" height="74" rx="37" fill="var(--bg)" />
    </clipPath>
    <clipPath id="clip1_2530_45010">
      <rect x="96" y="157.424" width="44" height="44" rx="22" fill="var(--bg)" />
    </clipPath>
    <clipPath id="clip2_2530_45010">
      <rect x="218" y="77.4258" width="60" height="60" rx="30" fill="var(--bg)" />
    </clipPath>
    <clipPath id="clip3_2530_45010">
      <rect width="20" height="20" fill="var(--bg)" transform="translate(209 125.43)" />
    </clipPath>
  </defs>
</svg>
`;});var xo=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:1,vars:0,consts:[["mode","user","key","UserVideoCommentList"]],template:function(t,n){t&1&&Pp(0,"my-video-comment-list-admin-owner",0);},dependencies:[Pa$2],encapsulation:2,changeDetection:1});}return i;})();function Xr(i,o){if(i&1){let e=k2();sp(0,"div",2)(1,"my-peertube-checkbox",3),Mx("ngModelChange",function(n){let r=$I(e).$implicit;return e$(r.review,n)||(r.review=n),GI(n);}),Fp("ngModelChange",function(){$I(e);let n=bV();return GI(n.updatePolicies());}),ub(),GH(),ub();}if(i&2){let e=o.$implicit,t=o.$index,n=bV();zB(),B0("inputName","tag-"+t),Nx("ngModel",e.review),B0("labelInnerHTML",n.getLabelText(e)),WH();}}var Yo=(()=>{class i{authService=g(Xe);autoTagsService=g(Kt);notifier=g(rc$1);html=g(gg);route=g(jr$1);tags=[];ngOnInit(){this.tags=this.route.snapshot.data.tags;}getLabelText(e){let t=e.name==="external-link"?"That contain <strong>an external link</strong>":"That contain any word from your <strong>"+e.name+"</strong> watched word list";return this.html.toSimpleSafeHtml(t);}updatePolicies(){let e=this.authService.getUser().account.name;this.autoTagsService.updateCommentPolicies({accountName:e,review:this.tags.filter(t=>t.review).map(t=>t.name)}).subscribe({next:()=>{this.notifier.success("Comment policies updated");},error:t=>this.notifier.handleError(t)});}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:4,vars:0,consts:()=>{let e;return e="Automatically block comments:",[e,[1,"d-block","mb-3"],[1,"form-group","ms-3"],[3,"ngModelChange","inputName","ngModel","labelInnerHTML"]];},template:function(t,n){t&1&&(sp(0,"strong",1),yV(1,0),ub(),R2(2,Xr,2,3,"div",2,A2)),t&2&&(zB(2),N2(n.tags));},dependencies:[Jn,qn,ln$1,Me$1],encapsulation:2,changeDetection:1});}return i;})();var Vo=()=>{let i=g(Xe),o=g(Kt),e=i.getUser().account.name;return R1([o.listAvailable({accountName:e}),o.getCommentPolicies({accountName:e})]).pipe($(([t,n])=>t.available.map(r=>({name:r.name,type:r.type,review:n.review.includes(r.name)}))));};function jr(i,o){if(i&1&&(lb(0,"div",1),H0(1,"div",4),db()),i&2){let e=bV();zB(),W0("innerHTML",e.svg,ow);}}var $o=(()=>{class i{activeModal=g(ri);title;html;svg;static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-new-feature-info-modal"]],decls:6,vars:3,consts:()=>{let e;return e="Got it",[[1,"modal-body"],[1,"svg-relative-container"],[1,"content",3,"innerHtml"],["type","button","role","button","value",e,1,"peertube-button","primary-button",3,"click","key.enter"],["aria-hidden","true",1,"svg-container",3,"innerHTML"]];},template:function(t,n){t&1&&(lb(0,"div",0),_2(1,jr,2,1,"div",1),lb(2,"h2"),KV(3),db(),H0(4,"div",2),lb(5,"input",3),cx("click",function(){return n.activeModal.close();})("key.enter",function(){return n.activeModal.close();}),db()()),t&2&&(zB(),w2(n.svg?1:-1),zB(2),wx(n.title),zB(),W0("innerHTML",n.html,ow));},dependencies:[Jn],styles:["h2[_ngcontent-%COMP%]{color:var(--fg-350);font-weight:700;margin-bottom:calc(1.325rem + .9vw)}@media(min-width:1200px){h2[_ngcontent-%COMP%]{margin-bottom:2rem}}h2[_ngcontent-%COMP%]{font-size:calc(1.3625rem + 1.35vw)}@media(min-width:1200px){h2[_ngcontent-%COMP%]{font-size:2.375rem}}.modal-body[_ngcontent-%COMP%]{text-align:center}.content[_ngcontent-%COMP%]{color:var(--fg-200);margin-bottom:calc(1.375rem + 1.5vw)}@media(min-width:1200px){.content[_ngcontent-%COMP%]{margin-bottom:2.5rem}}.svg-relative-container[_ngcontent-%COMP%]{position:relative}.svg-container[_ngcontent-%COMP%]{margin:0 auto;position:absolute;top:-3.5rem;right:0;left:0}.svg-relative-container[_ngcontent-%COMP%] + h2[_ngcontent-%COMP%]{margin-top:10rem}"],changeDetection:1});}return i;})();var qr=ko(),Ri=(()=>{class i{auth=g(Xe);modalService=g(rr$1);serverService=g($t);userService=g(Pc);notifier=g(rc$1);domSanitizer=g(k5);showChannelCollaboration(){this.auth.userInformationLoaded.pipe(ze()).subscribe(()=>{if(this.serverService.getHTMLConfig().client.newFeaturesInfo!==true||this.auth.getUser().newFeaturesInfoRead&vTe.CHANNEL_COLLABORATION||this.modalService.hasOpenModals())return;let n=this.serverService.getHTMLConfig().instance.name,r=this.modalService.open($o,{size:"lg",centered:true}),s=r.componentInstance;s.title="Collaboration on channels are coming to "+n+"",s.html="You can now <strong>invite other users</strong> to collaborate on your channel",s.svg=this.domSanitizer.bypassSecurityTrustHtml(qr),r.result.finally(()=>{this.userService.markNewFeatureInfoAsRead(vTe.CHANNEL_COLLABORATION).subscribe({next:()=>this.auth.refreshUserInformation(),error:d=>this.notifier.handleError(d)});});});}static ɵfac=function(t){return new(t||i)();};static ɵprov=S({token:i,factory:i.ɵfac,providedIn:"root"});}return i;})();var Fo=(()=>{class i{serverService=g($t);newFeatureInfoService=g(Ri);menuEntries=[];serverConfig;ngOnInit(){this.serverConfig=this.serverService.getHTMLConfig(),this.buildMenu(),this.newFeatureInfoService.showChannelCollaboration();}buildMenu(){this.menuEntries=[{label:"Manage my channels",routerLink:"/my-library/video-channels"},{label:"Fylgjarar",routerLink:"/my-library/followers"},{label:"Synchronizations",routerLink:"/my-library/video-channel-syncs",isDisplayed:()=>this.isChannelSyncEnabled()}];}isChannelSyncEnabled(){let e=this.serverConfig.import;return this.serverConfig.import.videoChannelSynchronization.enabled&&(e.videos.http.enabled||e.videos.torrent.enabled);}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:8,vars:1,consts:()=>{let e;e="My channels";let t;return t="Skip the sub menu",[["myChannelSpaceContent",""],t,[1,"root"],[1,"margin-content"],["href","#my-channel-space-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],["h1Icon","channel","h1",e,3,"menuEntries"],["tabindex","-1","id","my-channel-space-content",1,"margin-content","pb-5","outline-0"]];},template:function(t,n){if(t&1){let r=k2();sp(0,"div",2)(1,"div",3)(2,"a",4),Fp("click",function(d){$I(r);let u=IV(6);return d.preventDefault(),GI(u.focus());}),yV(3,1),ub(),Pp(4,"my-horizontal-menu",5),ub(),sp(5,"div",6,0),Pp(7,"router-outlet"),ub()();}t&2&&(zB(4),B0("menuEntries",n.menuEntries));},dependencies:[kS,hn],encapsulation:2,changeDetection:1});}return i;})();function Zr(i,o){if(i&1&&(sp(0,"span",4),KV(1),ub()),i&2){let e=bV();zB(),vb(" ",e.getTotalTitle());}}function Kr(i,o){i&1&&(sp(0,"div",8),yV(1,0),ub());}function Jr(i,o){i&1&&(fb(0),yV(1,1),kp());}function ea(i,o){if(i&1&&(fb(0),yV(1,2),kp()),i&2){let e=bV().$implicit;zB(),ax(e.following.name),vV(1);}}function ta(i,o){if(i&1&&(sp(0,"div",10),Pp(1,"my-actor-avatar",11),sp(2,"div",12)(3,"a",13)(4,"div",14),KV(5),ub(),Pp(6,"my-global-icon",15),ub(),sp(7,"div",16),_2(8,Jr,2,0,"ng-container")(9,ea,2,1,"ng-container"),ub()()()),i&2){let e=o.$implicit,t=bV();zB(),B0("actor",e.follower)("href",e.follower.url),zB(2),B0("href",e.follower.url,sw),zB(2),wx(e.follower.name+"@"+e.follower.host),zB(3),w2(t.isFollowingAccount(e)?8:9);}}var Bo=(()=>{class i{route=g(jr$1);auth=g(Xe);userSubscriptionService=g(B);notifier=g(rc$1);follows=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};onDataSubject=new Z$1();search;channelFilter;inputFilters;ngOnInit(){this.inputFilters=[{type:"select",key:"channel",title:"Channel",items:this.auth.getUser().videoChannels.map(e=>({id:e.name,label:e.displayName}))}],this.search=this.route.snapshot.queryParamMap.get("search")||"",this.channelFilter=this.route.snapshot.queryParamMap.get("channel")||"",this.loadFollowers();}onNearOfBottom(){this.pagination.totalItems<=this.pagination.currentPage*this.pagination.itemsPerPage||(this.pagination.currentPage+=1,this.loadFollowers());}onSearch(e){this.search=e,Ije(this.pagination),this.loadFollowers({reset:true});}onFilter(e){this.channelFilter=e.channel,Ije(this.pagination),this.loadFollowers({reset:true});}isFollowingAccount(e){return e.following.name===this.getUsername();}getTotalTitle(){return DAe(""+this.pagination.totalItems+" {total, plural, =1 {follower} other {followers}}",{total:this.pagination.totalItems});}loadFollowers(e={}){let{reset:t=false}=e;this.userSubscriptionService.listFollowers({pagination:this.pagination,nameWithHost:this.getUsername(),search:this.search,channel:this.channelFilter}).subscribe({next:n=>{this.follows=t?n.data:this.follows.concat(n.data),this.pagination.totalItems=n.total,this.onDataSubject.next(n.data);},error:n=>this.notifier.handleError(n)});}getUsername(){return this.auth.getUser().username;}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:9,vars:4,consts:()=>{let e;e="No follower found.";let t;t="Follower page";let n;n="Is following all your channels";let r;return r="Is following your channel "+"\uFFFD0\uFFFD"+"",[e,n,r,[1,"followers-header","d-flex","justify-content-between","align-items-end","gap-2","flex-wrap"],[1,"total-items"],[1,"d-flex","gap-2","flex-wrap","ms-auto"],[3,"search"],[1,"d-block","ms-auto",3,"filtersChange","filters"],[1,"no-results"],["myInfiniteScroller","",1,"actors",3,"nearOfBottom","dataObservable"],[1,"actor"],["actorType","account","size","40",3,"actor","href"],[1,"actor-info"],["rel","noopener noreferrer","target","_blank","title",t,1,"actor-names",3,"href"],[1,"actor-display-name"],["iconName","external-link"],[1,"small","muted"]];},template:function(t,n){t&1&&(sp(0,"div",3),_2(1,Zr,2,1,"span",4),sp(2,"div",5)(3,"my-search-input",6),Fp("search",function(s){return n.onSearch(s);}),ub(),sp(4,"my-advanced-input-filter",7),Fp("filtersChange",function(s){return n.onFilter(s);}),ub()()(),_2(5,Kr,2,0,"div",8),sp(6,"div",9),Fp("nearOfBottom",function(){return n.onNearOfBottom();}),R2(7,ta,10,5,"div",10,A2),ub()),t&2&&(zB(),w2(n.pagination.totalItems?1:-1),zB(3),B0("filters",n.inputFilters),zB(),w2(n.pagination.totalItems===0?5:-1),zB(),B0("dataObservable",n.onDataSubject.asObservable()),zB(),N2(n.follows));},dependencies:[Tr$1,si,L$3,fe$2,ue],styles:[".followers-header[_ngcontent-%COMP%]{margin-bottom:30px;display:flex}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:300px;max-width:300px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:340px){input[type=text][_ngcontent-%COMP%]{width:100%}}.actor[_ngcontent-%COMP%]{display:flex;min-height:auto;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.actor[_ngcontent-%COMP%]{flex-direction:column;height:auto;align-items:center}}.actor[_ngcontent-%COMP%] > my-actor-avatar[_ngcontent-%COMP%]{margin-inline-end:.625rem}.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]{flex-grow:1}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]{width:fit-content;display:flex;align-items:baseline;color:var(--fg)}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%], .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:active{text-decoration:none}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.actor[_ngcontent-%COMP%]   .actor-display-name[_ngcontent-%COMP%]{font-weight:600;font-size:18px}.actor[_ngcontent-%COMP%]   .actor-name[_ngcontent-%COMP%]{font-size:14px;color:var(--fg-300);margin-inline-start:.3125rem}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]{color:var(--fg);display:flex;align-items:center}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%], .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:focus, .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:active{text-decoration:none}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:hover{opacity:.8}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]   my-actor-avatar[_ngcontent-%COMP%]{margin-inline-start:.3125rem}@media screen and (max-width:800px){.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]{padding-bottom:10px;text-align:center}.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]{flex-direction:column;align-items:center!important;margin:auto}}"],changeDetection:1});}return i;})();var zo=i=>["/c",i],ia=i=>["/a",i],na=i=>[i];function oa(i,o){if(i&1&&(sp(0,"span",4),KV(1),ub()),i&2){let e=bV();zB(),vb(" ",e.getTotalTitle());}}function ra(i,o){i&1&&(sp(0,"div",6),yV(1,0),ub());}function aa(i,o){if(i&1&&(sp(0,"div",8),Pp(1,"my-actor-avatar",9),sp(2,"div",10)(3,"a",11)(4,"div",12),KV(5),ub(),sp(6,"div",13),KV(7),ub()(),sp(8,"div",14),yV(9,1),ub(),sp(10,"a",15)(11,"span"),yV(12,2),ub(),Pp(13,"my-actor-avatar",16),ub()(),Pp(14,"my-subscribe-button",17),ub()),i&2){let e=o.$implicit;zB(),B0("actor",e)("internalHref",l$(10,zo,e.nameWithHost)),zB(2),B0("routerLink",l$(12,zo,e.nameWithHost)),zB(2),wx(e.displayName),zB(2),wx(e.nameWithHost),zB(2),ax(e.followersCount),vV(9),zB(),B0("routerLink",l$(14,ia,e.ownerBy)),zB(2),ax(e.ownerBy),vV(12),zB(),B0("actor",e.ownerAccount),zB(),B0("videoChannels",l$(16,na,e));}}var Ho=(()=>{class i{userSubscriptionService=g(B);notifier=g(rc$1);videoChannels=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};onDataSubject=new Z$1();search;onNearOfBottom(){this.pagination.totalItems<=this.pagination.currentPage*this.pagination.itemsPerPage||(this.pagination.currentPage+=1,this.loadSubscriptions());}onSearch(e){this.search=e,Ije(this.pagination),this.loadSubscriptions(false);}getTotalTitle(){return DAe(""+this.pagination.totalItems+" {total, plural, =1 {subscription} other {subscriptions}}",{total:this.pagination.totalItems});}loadSubscriptions(e=true){this.userSubscriptionService.listSubscriptions({pagination:this.pagination,search:this.search}).subscribe({next:t=>{this.videoChannels=e?this.videoChannels.concat(t.data):t.data,this.pagination.totalItems=t.total,this.onDataSubject.next(t.data);},error:t=>this.notifier.handleError(t)});}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:7,vars:3,consts:()=>{let e;e="You don't have any subscription yet.";let t;t="Channel page";let n;n="Sida til kontoeigaren";let r;r=""+"\uFFFD0\uFFFD"+" subscribers";let s;return s="Created by "+"\uFFFD0\uFFFD"+"",[e,r,s,[1,"mb-4","d-flex","justify-content-between","align-items-end","gap-2","flex-wrap"],[1,"total-items"],["emitOnInit","true",1,"d-block","ms-auto",3,"search"],[1,"no-results"],["myInfiniteScroller","",1,"actors",3,"nearOfBottom","dataObservable"],[1,"actor"],["actorType","channel","size","80",3,"actor","internalHref"],[1,"actor-info"],["title",t,1,"actor-names",3,"routerLink"],[1,"actor-display-name"],[1,"actor-name"],[1,"actor-followers"],["title",n,1,"actor-owner",3,"routerLink"],["actorType","account","size","18",3,"actor"],[3,"videoChannels"]];},template:function(t,n){t&1&&(sp(0,"div",3),_2(1,oa,2,1,"span",4),sp(2,"my-search-input",5),Fp("search",function(s){return n.onSearch(s);}),ub()(),_2(3,ra,2,0,"div",6),sp(4,"div",7),Fp("nearOfBottom",function(){return n.onNearOfBottom();}),R2(5,aa,15,18,"div",8,A2),ub()),t&2&&(zB(),w2(n.pagination.totalItems?1:-1),zB(2),w2(n.pagination.totalItems===0?3:-1),zB(),B0("dataObservable",n.onDataSubject.asObservable()),zB(),N2(n.videoChannels));},dependencies:[ue,L$3,fe$2,Xh,Ut$2],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:300px;max-width:300px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:340px){input[type=text][_ngcontent-%COMP%]{width:100%}}.actor[_ngcontent-%COMP%]{display:flex;min-height:130px;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.actor[_ngcontent-%COMP%]{flex-direction:column;height:auto;align-items:center}}.actor[_ngcontent-%COMP%] > my-actor-avatar[_ngcontent-%COMP%]{margin-inline-end:.625rem}.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]{flex-grow:1}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]{width:fit-content;display:flex;align-items:baseline;color:var(--fg)}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%], .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:active{text-decoration:none}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.actor[_ngcontent-%COMP%]   .actor-display-name[_ngcontent-%COMP%]{font-weight:600;font-size:18px}.actor[_ngcontent-%COMP%]   .actor-name[_ngcontent-%COMP%]{font-size:14px;color:var(--fg-300);margin-inline-start:.3125rem}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]{color:var(--fg);display:flex;align-items:center}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%], .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:focus, .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:active{text-decoration:none}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:hover{opacity:.8}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]   my-actor-avatar[_ngcontent-%COMP%]{margin-inline-start:.3125rem}@media screen and (max-width:800px){.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]{padding-bottom:10px;text-align:center}.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]{flex-direction:column;align-items:center!important;margin:auto}}"],changeDetection:1});}return i;})();var sa=i=>({$implicit:i});function la(i,o){if(i&1&&(sp(0,"div",2),yV(1,0),ub()),i&2){let e=bV();zB(),ax(e.noResultMessage()),vV(1);}}function ca(i,o){if(i&1){let e=k2();sp(0,"div",6)(1,"my-peertube-checkbox",8),Mx("ngModelChange",function(n){$I(e);let r=bV().$implicit,s=bV();return e$(s.selection()[r.id],n)||(s.selection()[r.id]=n),GI(n);}),ub(),GH(),ub();}if(i&2){let e=bV().$implicit,t=bV();zB(),B0("inputName","video-check-"+e.id),Nx("ngModel",t.selection()[e.id]),WH();}}function da(i,o){i&1&&V0(0);}function _a(i,o){if(i&1&&_0(0,da,1,0,"ng-container",9),i&2){let e=bV().$implicit,t=bV();B0("ngTemplateOutlet",t.rowButtonsTemplate)("ngTemplateOutletContext",l$(2,sa,e));}}function pa(i,o){if(i&1&&(sp(0,"div",4),_2(1,ca,2,2,"div",6),Pp(2,"my-video-miniature",7),_2(3,_a,1,4,"ng-container"),ub()),i&2){let e=o.$implicit,t=bV();zB(),w2(t.enableSelection()?1:-1),zB(),B0("video",e)("displayAsRow",true)("displayOptions",t.miniatureDisplayOptions())("displayVideoActions",false)("user",t.user()),zB(),w2(t.isInSelectionMode()===false?3:-1);}}function ma(i,o){i&1&&V0(0);}function ua(i,o){if(i&1){let e=k2();sp(0,"div",5)(1,"button",10),Fp("click",function(){$I(e);let n=bV();return GI(n.abortSelectionMode());}),yV(2,1),ub(),_0(3,ma,1,0,"ng-container",11),ub();}if(i&2){let e=bV();zB(3),B0("ngTemplateOutlet",e.globalButtonsTemplate);}}var Uo=(()=>{class i{notifier=g(rc$1);user=qp(void 0);pagination=qp(void 0);titlePage=qp(void 0);miniatureDisplayOptions=qp(void 0);noResultMessage=qp("No results.");enableSelection=qp(true);disabled=qp(false);getVideosObservableFunction=qp(void 0);templates=Rpe();selection=_pe({});videos=_pe([]);rowButtonsTemplate;globalButtonsTemplate;sort="-publishedAt";onDataSubject=new Z$1();hasDoneFirstQuery=false;lastQueryLength;ngAfterContentInit(){{let e=this.templates().find(t=>t.name()==="rowButtons");e&&(this.rowButtonsTemplate=e.template);}{let e=this.templates().find(t=>t.name()==="globalButtons");e&&(this.globalButtonsTemplate=e.template);}}getVideosObservable(e){return this.getVideosObservableFunction()(e,this.sort);}abortSelectionMode(){this.selection.update(()=>({}));}isInSelectionMode(){return tc$1(this.selection()).some(e=>this.selection()[e]===true);}videoById(e,t){return t.id;}onNearOfBottom(){this.disabled()||this.lastQueryLength!==void 0&&this.lastQueryLength<this.pagination().itemsPerPage||(this.pagination().currentPage+=1,this.loadMoreVideos());}loadMoreVideos(e=false){e&&(this.hasDoneFirstQuery=false),this.getVideosObservable(this.pagination().currentPage).subscribe({next:({data:t})=>{this.hasDoneFirstQuery=true,this.lastQueryLength=t.length,e&&this.videos.set([]),this.videos.update(n=>n.concat(t)),this.onDataSubject.next(t);},error:t=>{let n="Cannot load more videos. Please try again later.";j.error(n,t),this.notifier.error(n);}});}reloadVideos(){Ije(this.pagination()),this.loadMoreVideos(true);}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-videos-selection"]],contentQueries:function(t,n,r){t&1&&dx(r,n.templates,M$1,4),t&2&&DV();},inputs:{user:[1,"user"],pagination:[1,"pagination"],titlePage:[1,"titlePage"],miniatureDisplayOptions:[1,"miniatureDisplayOptions"],noResultMessage:[1,"noResultMessage"],enableSelection:[1,"enableSelection"],disabled:[1,"disabled"],getVideosObservableFunction:[1,"getVideosObservableFunction"],selection:[1,"selection"],videos:[1,"videos"]},outputs:{selection:"selectionChange",videos:"videosChange"},decls:5,vars:3,consts:()=>{let e;e="\n          "+"\uFFFD0\uFFFD"+"\n        ";let t;return t="Cancel",[e,t,[1,"no-results"],["myInfiniteScroller","",1,"videos",3,"nearOfBottom","dataObservable"],[1,"video"],[1,"action-selection-mode"],[1,"checkbox-container"],[3,"video","displayAsRow","displayOptions","displayVideoActions","user"],[3,"ngModelChange","inputName","ngModel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"cancel-selection","peertube-button","secondary-button","me-2",3,"click"],[4,"ngTemplateOutlet"]];},template:function(t,n){t&1&&(_2(0,la,2,1,"div",2),sp(1,"div",3),Fp("nearOfBottom",function(){return n.onNearOfBottom();}),R2(2,pa,4,7,"div",4,n.videoById,true),ub(),_2(4,ua,4,1,"div",5)),t&2&&(w2(n.hasDoneFirstQuery&&n.videos().length===0?0:-1),zB(),B0("dataObservable",n.onDataSubject.asObservable()),zB(),N2(n.videos()),zB(2),w2(n.isInSelectionMode()===true?4:-1));},dependencies:[L$3,Me$1,Jn,qn,ln$1,Vd,R3],styles:[".action-selection-mode[_ngcontent-%COMP%]{position:fixed;bottom:1rem}@supports (inset-inline-end: var(--x-margin-content)){.action-selection-mode[_ngcontent-%COMP%]{inset-inline-end:var(--x-margin-content)}}@supports not (inset-inline-end: var(--x-margin-content)){.action-selection-mode[_ngcontent-%COMP%]{right:var(--x-margin-content)}}.action-selection-mode[_ngcontent-%COMP%]   .action-button[_ngcontent-%COMP%]{display:block;margin-inline-start:calc(1.46875rem + 2.625vw)}@media(min-width:1200px){.action-selection-mode[_ngcontent-%COMP%]   .action-button[_ngcontent-%COMP%]{margin-inline-start:3.4375rem}}.video[_ngcontent-%COMP%]{display:flex;min-height:130px;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.video[_ngcontent-%COMP%]{min-height:initial;padding-bottom:.5rem;margin-bottom:.5rem}}.video[_ngcontent-%COMP%]:first-child{margin-top:47px}.video[_ngcontent-%COMP%]   .checkbox-container[_ngcontent-%COMP%]{display:flex;align-items:center;margin-inline-end:1.25rem;margin-inline-start:.75rem}.video[_ngcontent-%COMP%]   my-video-miniature[_ngcontent-%COMP%]{flex-grow:1;max-width:100%}@media screen and (max-width:800px){.video[_ngcontent-%COMP%]{flex-wrap:wrap}.checkbox-container[_ngcontent-%COMP%], .action-selection-mode[_ngcontent-%COMP%]{display:none!important}}"],changeDetection:1});}return i;})();var ha=["videosSelection"];function ga(i,o){if(i&1){let e=k2();sp(0,"div",12)(1,"my-delete-button",13),Fp("click",function(){let n=$I(e).$implicit,r=bV();return GI(r.deleteHistoryElement(n));}),ub()();}}var Go=(()=>{class i{authService=g(Xe);userService=g(Pc);notifier=g(rc$1);confirmService=g(ag);userHistoryService=g(H$1);destroyRef=g(Ut$1);videosSelection=wpe("videosSelection");titlePage;pagination={currentPage:1,itemsPerPage:5,totalItems:null};videosHistoryEnabled;miniatureDisplayOptions={date:true,views:true,by:true,privacyLabel:false};getVideosObservableFunction=this.getVideosObservable.bind(this);user;videos=[];search;disabled=false;constructor(){this.titlePage="Filmar eg har sett p\xE5";}ngOnInit(){this.user=this.authService.getUser(),this.authService.userInformationLoaded.pipe(fe(this.destroyRef)).subscribe(()=>this.videosHistoryEnabled=this.user.videosHistoryEnabled);}disableForReuse(){this.disabled=true;}enabledForReuse(){this.disabled=false;}reloadData(){this.videosSelection().reloadVideos();}onSearch(e){this.search=e,this.reloadData();}getVideosObservable(e){let t=KP(this.pagination,{currentPage:e});return this.userHistoryService.list(t,this.search).pipe(lt(n=>this.pagination.totalItems=n.total));}generateSyndicationList(){throw new Error("Method not implemented.");}onVideosHistoryChange(){this.userService.updateMyProfile({videosHistoryEnabled:this.videosHistoryEnabled}).subscribe({next:()=>{let e=this.videosHistoryEnabled===true?"Video history is enabled":"Video history is disabled";this.notifier.success(e),this.authService.refreshUserInformation();},error:e=>this.notifier.handleError(e)});}deleteHistoryElement(e){this.userHistoryService.deleteElement(e).subscribe({next:()=>{this.videos=this.videos.filter(t=>t.id!==e.id),Dje(this.pagination);},error:t=>this.notifier.handleError(t)});}clearAllHistory(){return L(this,null,function*(){let e="Delete video history",t="Are you sure you want to delete all your video history?";(yield this.confirmService.confirm(t,e))===true&&this.userHistoryService.clearAll().subscribe({next:()=>{this.notifier.success("Video history deleted"),this.reloadData();},error:r=>this.notifier.handleError(r)});});}getNoResultMessage(){return this.search?"No videos found for \""+this.search+"\".":"Du har ingen filmar i visingsloggen din enno.";}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){t&1&&fx(n.videosSelection,ha,5),t&2&&DV();},decls:12,vars:10,consts:()=>{let e;e="Visingslogg";let t;t="Clear all history";let n;return n="Slett fr\xE5 loggen",[["videosSelection",""],e,t,[1,"top-buttons"],[1,"search-wrapper"],["emitOnInit","true",3,"search"],[1,"history-switch"],["inputName","track-watch-history",3,"ngModelChange","ngModel"],["for","track-watch-history"],["icon","delete",3,"click"],[3,"videosChange","pagination","videos","miniatureDisplayOptions","titlePage","getVideosObservableFunction","user","noResultMessage","enableSelection","disabled"],["ptTemplate","rowButtons"],[1,"action-button"],["label",n,3,"click"]];},template:function(t,n){if(t&1){let r=k2();sp(0,"div",3)(1,"div",4)(2,"my-search-input",5),Fp("search",function(d){return n.onSearch(d);}),ub()(),sp(3,"div",6)(4,"my-input-switch",7),Mx("ngModelChange",function(d){return $I(r),e$(n.videosHistoryEnabled,d)||(n.videosHistoryEnabled=d),GI(d);}),Fp("ngModelChange",function(){return n.onVideosHistoryChange();}),ub(),GH(),sp(5,"label",8),yV(6,1),ub()(),sp(7,"my-button",9),Fp("click",function(){return n.clearAllHistory();}),yV(8,2),ub()(),sp(9,"my-videos-selection",10,0),Mx("videosChange",function(d){return $I(r),e$(n.videos,d)||(n.videos=d),GI(d);}),_0(11,ga,2,0,"ng-template",11),ub();}t&2&&(zB(4),Nx("ngModel",n.videosHistoryEnabled),WH(),zB(5),B0("pagination",n.pagination),Nx("videos",n.videos),B0("miniatureDisplayOptions",n.miniatureDisplayOptions)("titlePage",n.titlePage)("getVideosObservableFunction",n.getVideosObservableFunction)("user",n.user)("noResultMessage",n.getNoResultMessage())("enableSelection",false)("disabled",n.disabled));},dependencies:[it,ue,or$1,Jn,qn,ln$1,Uo,M$1,h],styles:[".no-history[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-top:50px;font-weight:600}.top-buttons[_ngcontent-%COMP%]{margin-bottom:30px;display:grid;grid-template-columns:250px 1fr auto auto;align-items:center}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]{grid-column:1}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:250px;max-width:250px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus, .top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:290px){.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%}}.top-buttons[_ngcontent-%COMP%]   .history-switch[_ngcontent-%COMP%]{grid-column:3;display:flex;align-items:center;margin-inline-start:auto;margin-inline-end:.9375rem}.top-buttons[_ngcontent-%COMP%]   .history-switch[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{margin:0 0 0 5px;color:var(--fg-400);font-weight:600}.top-buttons[_ngcontent-%COMP%]   .delete-history[_ngcontent-%COMP%]{grid-column:4}.video[_ngcontent-%COMP%]{display:flex;min-height:130px;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.video[_ngcontent-%COMP%]{min-height:initial;padding-bottom:.5rem;margin-bottom:.5rem}}.action-button[_ngcontent-%COMP%]{display:flex;align-self:flex-end}@media screen and (max-width:800px){.top-buttons[_ngcontent-%COMP%]{grid-template-columns:auto 1fr auto;row-gap:20px}.top-buttons[_ngcontent-%COMP%]   .history-switch[_ngcontent-%COMP%]{grid-row:1;grid-column:1;margin:0}.top-buttons[_ngcontent-%COMP%]   .delete-history[_ngcontent-%COMP%]{grid-row:1;grid-column:3}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]{grid-column:1/4}}"],changeDetection:1});}return i;})();var Wo=(()=>{class i{menuEntries=[];ngOnInit(){this.buildMenu();}buildMenu(){this.menuEntries=[{label:"Spelelister",routerLink:"/my-library/video-playlists"},{label:"Subscriptions",routerLink:"/my-library/subscriptions"},{label:"Logg",routerLink:"/my-library/history/videos"}];}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:8,vars:1,consts:()=>{let e;e="My library";let t;return t="Skip the sub menu",[["myLibraryContent",""],t,[1,"root"],[1,"margin-content"],["href","#my-library-content-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],["h1",e,3,"menuEntries"],["tabindex","-1","id","my-library-content",1,"margin-content","pb-5","outline-0"]];},template:function(t,n){if(t&1){let r=k2();sp(0,"div",2)(1,"div",3)(2,"a",4),Fp("click",function(d){$I(r);let u=IV(6);return d.preventDefault(),GI(u.focus());}),yV(3,1),ub(),Pp(4,"my-horizontal-menu",5),ub(),sp(5,"div",6,0),Pp(7,"router-outlet"),ub()();}t&2&&(zB(4),B0("menuEntries",n.menuEntries));},dependencies:[kS,hn],encapsulation:2,changeDetection:1});}return i;})();function fa(i,o){if(i&1&&Pp(0,"my-actor-avatar",2),i&2){let e=bV();B0("actor",e.actor())("actorType",e.actorType());}}function Ca(i,o){i&1&&Pp(0,"my-global-icon",5);}function Sa(i,o){if(i&1&&(sp(0,"span",6),KV(1),ub()),i&2){let e=bV();zB(),wx(e.actor().name);}}function ya(i,o){i&1&&Pp(0,"my-collaborator-state",7);}function va(i,o){i&1&&Pp(0,"my-collaborator-state",8);}var Rt=(()=>{class i{authService=g(Xe);actor=qp.required();actorType=qp.required();displayAvatar=qp(true,{transform:tl$1});displayUsername=qp(true,{transform:tl$1});target=qp("");routerLink;linkTitle;ngOnInit(){this.actorType()==="channel"?(this.routerLink=["/c",this.actor().name],this.linkTitle="Go to the channel page of "+this.actor().displayName+""):(this.routerLink=["/a",this.actor().name],this.linkTitle="Go to the account page of "+this.actor().displayName+"");}isEditorOfChannel(){if(this.actorType()!=="channel")return false;let e=this.authService.getUser();return e.isCollaboratingToChannels()&&e.isEditorOfChannel(this.actor());}isOwnerOfChannel(){if(this.actorType()!=="channel")return false;let e=this.authService.getUser();return e.isCollaboratingToChannels()&&e.isOwnerOfChannel(this.actor());}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-actor-cell"]],inputs:{actor:[1,"actor"],actorType:[1,"actorType"],displayAvatar:[1,"displayAvatar"],displayUsername:[1,"displayUsername"],target:[1,"target"]},decls:10,vars:8,consts:[[3,"routerLink","title","target"],[1,"chip","two-lines"],["size","32",3,"actor","actorType"],[1,"information"],[1,"fw-semibold"],["iconName","external-link"],[1,"muted"],["type","accepted","small","true",1,"ms-2"],["type","owner","small","true",1,"ms-2"]],template:function(t,n){t&1&&(sp(0,"a",0)(1,"div",1),_2(2,fa,1,2,"my-actor-avatar",2),sp(3,"div",3)(4,"span",4),KV(5),_2(6,Ca,1,0,"my-global-icon",5),ub(),_2(7,Sa,2,1,"span",6),ub(),_2(8,ya,1,0,"my-collaborator-state",7)(9,va,1,0,"my-collaborator-state",8),ub()()),t&2&&(B0("routerLink",n.routerLink)("title",n.linkTitle)("target",n.target()),zB(2),w2(n.displayAvatar()?2:-1),zB(3),vb(" ",n.actor().displayName," "),zB(),w2(n.target()==="_blank"?6:-1),zB(),w2(n.displayUsername()?7:-1),zB(),w2(n.isEditorOfChannel()?8:n.isOwnerOfChannel()?9:-1));},dependencies:[vz,Xh,H$3,fe$2,Tr$1],styles:["a[_ngcontent-%COMP%]:hover{opacity:1}a[_ngcontent-%COMP%]:hover   .information[_ngcontent-%COMP%]{opacity:.8}"],changeDetection:1});}return i;})();var Ea=["modal"];function Ma(i,o){if(i&1&&(sp(0,"div",10),KV(1),ub()),i&2){let e=bV(2);zB(),wx(e.formErrors.channel);}}function Pa(i,o){if(i&1){let e=k2();sp(0,"div",2)(1,"h1",3),KV(2),ub(),sp(3,"button",4),Fp("click",function(){let n=$I(e).dismiss;return GI(n());}),Pp(4,"my-global-icon",5),ub()(),sp(5,"div",6)(6,"div",7)(7,"label",8),yV(8,1),ub(),Pp(9,"my-select-channel-user",9),GH(),_2(10,Ma,2,1,"div",10),ub()(),sp(11,"div",11)(12,"div",12)(13,"input",13),Fp("click",function(){let n=$I(e).dismiss;return GI(n());})("key.enter",function(){let n=$I(e).dismiss;return GI(n());}),ub(),sp(14,"input",14),Fp("click",function(){let n=$I(e).close;return GI(n());}),ub()()();}if(i&2){let e=bV();zB(2),wx(e.getModalTitle()),zB(3),B0("formGroup",e.form),zB(3),ax(e.ownershipChanges.length),vV(8),zB(),B0("items",e.videoChannels),WH(),zB(),w2(e.formErrors.channel?10:-1);}}var Xo=(()=>{class i extends r{formReactiveService=g(w);changeOwnershipService=g(A);notifier=g(rc$1);authService=g(Xe);modalService=g(rr$1);accepted=Cpe();modal=wpe("modal");ownershipChanges=[];videoChannels;error=null;ngOnInit(){this.videoChannels=[],ae({authService:this.authService,includeCollaborations:false}).subscribe(e=>this.videoChannels=e),this.buildForm({channel:c});}show(e){this.form.patchValue({channel:this.videoChannels[0].id}),this.ownershipChanges=e,this.modalService.open(this.modal(),{centered:true}).result.then(()=>this.acceptOwnership()).catch(()=>{this.ownershipChanges=[];});}acceptOwnership(){let e=this.form.value.channel;this.changeOwnershipService.acceptVideo(this.ownershipChanges.map(t=>t.id),{channelId:e}).subscribe({next:()=>{let t=this.ownershipChanges.length,n=DAe("{count, plural, =1 {Video {videoName} accepted} other {{count} videos accepted}}",{count:t,videoName:this.ownershipChanges[0].video.name});this.notifier.success(n),this.accepted&&this.accepted.emit();},error:t=>this.notifier.handleError(t)});}getModalTitle(){let e=this.ownershipChanges.length;return DAe("{count, plural, =1 {Accept video} other {Accept {count} videos}}",{count:e});}static ɵfac=(()=>{let e;return function(n){return(e||(e=Uu(i)))(n||i);};})();static ɵcmp=Pa$1({type:i,selectors:[["my-accept-change-video-ownership"]],viewQuery:function(t,n){t&1&&fx(n.modal,Ea,5),t&2&&DV();},outputs:{accepted:"accepted"},features:[I0],decls:2,vars:0,consts:()=>{let e;e="Close this modal";let t;t="Cancel";let n;n="Accept";let r;return r="{VAR_PLURAL, plural, =1 {Select a channel to receive the video} other {Select a channel to receive the videos}}",r=EV(r,{VAR_PLURAL:"\uFFFD0\uFFFD"}),[["modal",""],r,[1,"modal-header"],[1,"modal-title"],["title",e,1,"border-0","p-0",3,"click"],["iconName","cross"],[1,"modal-body",3,"formGroup"],[1,"form-group"],["for","channel"],["inputId","channel","formControlName","channel",1,"d-block",3,"items"],["role","alert",1,"form-error"],[1,"modal-footer","inputs"],[1,"inputs"],["type","button","role","button","value",t,1,"peertube-button","secondary-button",3,"click","key.enter"],["type","submit","value",n,1,"peertube-button","primary-button",3,"click"]];},template:function(t,n){t&1&&_0(0,Pa,15,5,"ng-template",null,0,D$);},dependencies:[Tr$1,Jn,qn,$n,Qn,Vn,yn,Ae],styles:[".peertube-select-container[_ngcontent-%COMP%]{width:350px}@media screen and (max-width:380px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}"],changeDetection:1});}return i;})();var Ia=["acceptChangeVideoOwnershipComponent"],Ta=["table"];function Oa(i,o){if(i&1&&(fb(0),yV(1,6),v$(2,"myNumberFormatter"),kp()),i&2){let e=o.$implicit;zB(2),ax(e)(b$(2,2,e)),vV(1);}}function Ra(i,o){i&1&&(sp(0,"span",11),KV(1,"TO YOU"),ub());}function ba(i,o){if(i&1&&Pp(0,"my-actor-cell",12),i&2){let e=bV().$implicit;B0("actor",e.nextOwnerAccount)("displayAvatar",true)("displayUsername",true);}}function Aa(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-cell",10),ub(),sp(2,"td"),_2(3,Ra,2,0,"span",11)(4,ba,1,3,"my-actor-cell",12),ub(),sp(5,"td"),KV(6),v$(7,"ptDate"),ub(),sp(8,"td")(9,"span",13),KV(10),ub()()),i&2){let e=o.$implicit,t=bV();zB(),B0("video",e.video),zB(2),w2(t.isReceiver(e)?3:4),zB(3),wx(S$(7,5,e.createdAt,"short")),zB(3),B0("ngClass",t.getStateClass(e.state.id)),zB(),wx(e.state.label);}}function La(i,o){if(i&1&&Pp(0,"my-action-dropdown",14),i&2){let e=o.$implicit,t=bV();B0("actions",t.actions)("entry",e);}}function Na(i,o){i&1&&(fb(0),yV(1,7),kp());}var jo=(()=>{class i{notifier=g(rc$1);changeOwnershipService=g(A);authService=g(Xe);acceptChangeVideoOwnershipComponent=wpe("acceptChangeVideoOwnershipComponent");table=wpe("table");actions=[];bulkActions=[];columns=[{id:"video",label:"Video",sortable:false},{id:"targetAccount",label:"Target account",sortable:false},{id:"createdAt",label:"Created",sortable:true},{id:"status",label:"Status",sortable:false}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);let{simpleActions:e,bulkActions:t}=Bc([[{label:()=>"Manage video",linkBuilder:n=>[K.buildManageUrl(n.video)],isDisplayed:n=>this.isReceiver(n)&&n.state.id===nDe.ACCEPTED||this.isInitiator(n)&&n.state.id!==nDe.ACCEPTED,enableBulk:false}],[{label:()=>"Accept...",handler:n=>this.openAcceptModal(n),isDisplayed:n=>this.canAcceptOrReject(n),enableBulk:true},{label:()=>"Reject",handler:n=>this.reject(n),isDisplayed:n=>this.canAcceptOrReject(n),enableBulk:true}]]);this.actions=e,this.bulkActions=t;}canAcceptOrReject(e){return this.isReceiver(e)&&e.state.id===nDe.PENDING;}isReceiver(e){return e.nextOwnerAccount.id===this.authService.getUser().account.id;}isInitiator(e){return e.initiatorAccount.id===this.authService.getUser().account.id;}getStateClass(e){switch(e){case nDe.ACCEPTED:return"badge-green";case nDe.REJECTED:return"badge-red";default:return"badge-yellow";}}openAcceptModal(e){this.acceptChangeVideoOwnershipComponent().show(e);}accepted(){this.table().loadData();}reject(e){this.changeOwnershipService.rejectVideo(e.map(t=>t.id)).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}_dataLoader(e){return this.changeOwnershipService.listOfVideos(e.pagination,e.sort).pipe($(t=>({data:t.data.map(n=>E(D({},n),{initiatorAccount:new ed(n.initiatorAccount),nextOwnerAccount:new ed(n.nextOwnerAccount)})),total:t.total})));}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-video-ownership-changes"]],viewQuery:function(t,n){t&1&&fx(n.acceptChangeVideoOwnershipComponent,Ia,5)(n.table,Ta,5),t&2&&DV(2);},decls:12,vars:3,consts:()=>{let e;e="entries per page";let t;t="{VAR_PLURAL, plural, =0 {No video ownership change} =1 {1 video ownership change} other {{INTERPOLATION} video ownership changes}}",t=EV(t,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let n;n="Actions";let r;return r="No ownership change request found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["noResults",""],["acceptChangeVideoOwnershipComponent",""],t,r,["key","MyOwnershipChangesComponent","paginatorText",e,"columnConfig","false",3,"defaultColumns","dataLoader","bulkActions"],[3,"accepted"],["size","small",3,"video"],[1,"pt-badge","badge-primary"],["actorType","account","target","_blank",3,"actor","displayAvatar","displayUsername"],[1,"pt-badge",3,"ngClass"],["placement","bottom-right top-right left auto","container","body","label",n,3,"actions","entry"]];},template:function(t,n){t&1&&(sp(0,"my-table",8,0),_0(2,Oa,3,4,"ng-template",null,1,D$)(4,Aa,11,8,"ng-template",null,2,D$)(6,La,1,2,"ng-template",null,3,D$)(8,Na,2,0,"ng-template",null,4,D$),ub(),sp(10,"my-accept-change-video-ownership",9,5),Fp("accepted",function(){return n.accepted();}),ub()),t&2&&B0("defaultColumns",n.columns)("dataLoader",n.dataLoader)("bulkActions",n.bulkActions);},dependencies:[cl$1,w3,Xo,Qh,Lh,Un,Rt,p$1,d$1],encapsulation:2,changeDetection:1});}return i;})();var Qo=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:1,vars:0,template:function(t,n){t&1&&Pp(0,"my-video-ownership-changes");},dependencies:[jo],encapsulation:2,changeDetection:1});}return i;})();var Da=["table"];function wa(i,o){i&1&&(sp(0,"div")(1,"p",11),yV(2,6),ub()());}function xa(i,o){if(i&1&&(fb(0),yV(1,7),v$(2,"myNumberFormatter"),kp()),i&2){let e=o.$implicit;zB(2),ax(e)(b$(2,2,e)),vV(1);}}function Ya(i,o){if(i&1&&(sp(0,"a",12),Pp(1,"my-global-icon",13),fb(2),yV(3,8),kp(),ub()),i&2){let e=bV();B0("routerLink",r$(e.getSyncCreateLink()));}}function Va(i,o){if(i&1&&(sp(0,"td")(1,"a",14),KV(2),ub()(),sp(3,"td"),Pp(4,"my-actor-cell",15),ub(),sp(5,"td")(6,"span",16),KV(7),ub()(),sp(8,"td"),KV(9),v$(10,"ptDate"),ub(),sp(11,"td"),KV(12),v$(13,"ptDate"),ub()),i&2){let e=o.$implicit,t=bV();zB(),B0("href",e.externalChannelUrl,sw),zB(),wx(e.externalChannelUrl),zB(2),B0("actor",e.channel),zB(2),B0("ngClass",t.getSyncStateClass(e.state.id)),zB(),vb(" ",e.state.label," "),zB(2),wx(S$(10,7,e.createdAt,"short")),zB(3),wx(S$(13,10,e.lastSyncAt,"short"));}}function $a(i,o){if(i&1&&Pp(0,"my-action-dropdown",17),i&2){let e=o.$implicit,t=bV();B0("actions",t.videoChannelSyncActions)("entry",e);}}function ka(i,o){i&1&&(fb(0),yV(1,9),kp());}var qo=(()=>{class i{videoChannelsSyncService=g(T);serverService=g($t);notifier=g(rc$1);authService=g(Xe);videoChannelService=g(z);table=wpe("table");videoChannelSyncActions=[];serverConfig;columns=[{id:"externalChannelUrl",label:"External Channel",sortable:true},{id:"videoChannel",label:"Channel",sortable:true},{id:"state",label:"State",sortable:true},{id:"createdAt",label:"Created",sortable:true},{id:"lastSyncAt",label:"Last synchronization at",sortable:true}];dataLoader;get user(){return this.authService.getUser();}constructor(){this.dataLoader=this._dataLoader.bind(this);}ngOnInit(){this.serverConfig=this.serverService.getHTMLConfig(),this.videoChannelSyncActions=[[{label:"List imports",linkBuilder:()=>["/my-library/video-imports"],queryParamsBuilder:e=>({videoChannelSyncId:e.id}),iconName:"cloud-download"}],[{label:"Delete",iconName:"delete",handler:e=>this.deleteSync(e)},{label:"Fully synchronize the channel",description:"This fetches any missing videos on the local channel",iconName:"refresh",handler:e=>this.fullySynchronize(e)}]];}_dataLoader(e){return this.authService.userInformationLoaded.pipe(ze(),De(()=>this.videoChannelsSyncService.listByAccount({sort:e.sort,pagination:e.pagination,includeCollaborations:true,account:this.authService.getUser().account})));}syncEnabled(){return this.serverConfig.import.videoChannelSynchronization.enabled;}deleteSync(e){this.videoChannelsSyncService.delete(e.id).subscribe({next:()=>{this.notifier.success("Synchronization removed successfully for "+e.channel.displayName+"."),this.table().loadData();},error:t=>this.notifier.handleError(t)});}fullySynchronize(e){this.videoChannelService.importVideos(e.channel.name,e.externalChannelUrl,e.id).subscribe({next:()=>{this.notifier.success("Full synchronization requested successfully for "+e.channel.displayName+".");},error:t=>this.notifier.handleError(t)});}getSyncCreateLink(){return"/my-library/video-channel-syncs/create";}getSyncStateClass(e){return jt(e);}getChannelUrl(e){return"/c/"+e;}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){t&1&&fx(n.table,Da,5),t&2&&DV();},decls:13,vars:3,consts:()=>{let e;e="syncs per page";let t;t="\u26A0\uFE0F The instance doesn't allow channel synchronization";let n;n="{VAR_PLURAL, plural, =0 {No sync} =1 {1 sync} other {{INTERPOLATION} syncs}}",n=EV(n,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let r;r="Add synchronization";let s;return s="You don't have channel synchronisation configured.",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["noResults",""],t,n,r,s,["key","MyVideoChannelsSyncComponent","paginatorText",e,"columnConfig","false",3,"defaultColumns","dataLoader"],[1,"muted"],[1,"peertube-create-button",3,"routerLink"],["iconName","add","aria-hidden","true"],["target","_blank","rel","noopener noreferrer",3,"href"],["actorType","channel",3,"actor"],[3,"ngClass"],["container","body",3,"actions","entry"]];},template:function(t,n){t&1&&(_2(0,wa,3,0,"div"),sp(1,"my-table",10,0),_0(3,xa,3,4,"ng-template",null,1,D$)(5,Ya,4,2,"ng-template",null,2,D$)(7,Va,14,13,"ng-template",null,3,D$)(9,$a,1,2,"ng-template",null,4,D$)(11,ka,2,0,"ng-template",null,5,D$),ub()),t&2&&(w2(n.syncEnabled()?-1:0),zB(),B0("defaultColumns",n.columns)("dataLoader",n.dataLoader));},dependencies:[cl$1,w3,Tr$1,Xh,Un,Lh,Rt,p$1,d$1],encapsulation:2,changeDetection:1});}return i;})();var Fa=i=>({"input-error":i});function Ba(i,o){if(i&1&&(sp(0,"my-alert",6),KV(1),ub()),i&2){let e=bV();zB(),wx(e.error);}}function za(i,o){if(i&1&&(sp(0,"div",15),KV(1),ub()),i&2){let e=bV();zB(),wx(e.formErrors.externalChannelUrl);}}function Ha(i,o){if(i&1&&(sp(0,"div",15),KV(1),ub()),i&2){let e=bV();zB(),wx(e.formErrors.videoChannel);}}var Zo=(()=>{class i extends r{formReactiveService=g(w);authService=g(Xe);router=g(mt);notifier=g(rc$1);videoChannelSyncService=g(T);videoChannelService=g(z);error;channels=[];existingVideosStrategy;ngOnInit(){this.buildForm({externalChannelUrl:i$2,videoChannel:t,existingVideoStrategy:t}),ae({authService:this.authService,includeCollaborations:true}).subscribe(e=>this.channels=e);}getFormButtonTitle(){return"Create";}formValidated(){this.error=void 0;let e=this.form.value,t={externalChannelUrl:e.externalChannelUrl,videoChannelId:e.videoChannel},n=e.existingVideoStrategy==="import";this.videoChannelSyncService.create(t).pipe(De(({videoChannelSync:r})=>n?this.videoChannelService.importVideos(r.channel.name,r.externalChannelUrl,r.id):Promise.resolve(null))).subscribe({next:()=>{this.notifier.success("Synchronization created successfully."),this.router.navigate(["/my-library","video-channel-syncs"]);},error:r=>{this.error=r.message;}});}static ɵfac=(()=>{let e;return function(n){return(e||(e=Uu(i)))(n||i);};})();static ɵcmp=Pa$1({type:i,selectors:[["my-video-channel-sync-edit"]],features:[I0],decls:30,vars:11,consts:()=>{let e;e="Example: https://youtube.com/channel/UC_fancy_channel";let t;t="NEW SYNCHRONIZATION";let n;n="Remote channel URL";let r;r="Video channel";let s;s="Options for existing videos on remote channel:";let d;d="Import all and watch for new publications";let u;return u="Only watch for new publications",[t,n,r,s,d,u,["type","danger"],[1,"pt-two-cols"],[1,"title-col"],[1,"content-col"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","externalChannelUrl"],[1,"input-group"],["type","text","id","externalChannelUrl","placeholder",e,"formControlName","externalChannelUrl",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["for","videoChannel"],["inputId","videoChannel","formControlName","videoChannel",3,"items"],["role","radiogroup",1,"form-group"],["for","existingVideoStrategy"],[1,"peertube-radio-container"],["type","radio","name","existingVideoStrategy","id","import","value","import","formControlName","existingVideoStrategy"],["for","import"],["type","radio","name","existingVideoStrategy","id","doNothing","value","nothing","formControlName","existingVideoStrategy"],["for","doNothing"],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"]];},template:function(t,n){t&1&&(_2(0,Ba,2,1,"my-alert",6),sp(1,"div",7)(2,"div",8)(3,"h2"),yV(4,0),ub()(),sp(5,"div",9)(6,"form",10),Fp("ngSubmit",function(){return n.formValidated();}),sp(7,"div",11)(8,"label",12),yV(9,1),ub(),sp(10,"div",13),Pp(11,"input",14),GH(),ub(),_2(12,za,2,1,"div",15),ub(),sp(13,"div",11)(14,"label",16),yV(15,2),ub(),Pp(16,"my-select-channel-user",17),GH(),_2(17,Ha,2,1,"div",15),ub(),sp(18,"div",18)(19,"label",19),yV(20,3),ub(),sp(21,"div",20),Pp(22,"input",21),GH(),sp(23,"label",22),yV(24,4),ub()(),sp(25,"div",20),Pp(26,"input",23),GH(),sp(27,"label",24),yV(28,5),ub()()(),Pp(29,"input",25),ub()()()),t&2&&(w2(n.error?0:-1),zB(6),B0("formGroup",n.form),zB(5),B0("ngClass",l$(9,Fa,n.formErrors.externalChannelUrl)),WH(),zB(),w2(n.formErrors.externalChannelUrl?12:-1),zB(4),B0("items",n.channels),WH(),zB(),w2(n.formErrors.videoChannel?17:-1),zB(5),WH(),zB(4),WH(),zB(3),B0("value",r$(n.getFormButtonTitle()))("disabled",!n.form.valid));},dependencies:[Jn,Zn,Je,fn,qn,$n,Qn,Vn,yn,w3,Ae,v],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:480px;max-width:480px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:520px){input[type=text][_ngcontent-%COMP%]{width:100%}}my-select-channel-user[_ngcontent-%COMP%]{display:block;max-width:480px}"],changeDetection:1});}return i;})();var Ua=["table"];function Ga(i,o){if(i&1&&(fb(0),yV(1,6),v$(2,"myNumberFormatter"),kp()),i&2){let e=o.$implicit;zB(2),ax(e)(b$(2,2,e)),vV(1);}}function Wa(i,o){if(i&1&&(sp(0,"a",11),KV(1),ub()),i&2){let e=bV().$implicit;B0("href",e.targetUrl,sw)("title",e.targetUrl),zB(),wx(e.targetUrl);}}function Xa(i,o){if(i&1&&(sp(0,"span",12),KV(1),ub()),i&2){let e=bV().$implicit;B0("title",e.torrentName||e.magnetUri),zB(),wx(e.torrentName||e.magnetUri);}}function ja(i,o){if(i&1&&Pp(0,"my-actor-cell",13),i&2){let e=bV().$implicit;B0("actor",e.video.channel);}}function Qa(i,o){if(i&1&&KV(0),i&2){let e=bV().$implicit;vb(" ",e.video?.name," ");}}function qa(i,o){if(i&1&&(sp(0,"a",15),KV(1),ub()),i&2){let e=bV(2).$implicit,t=bV();B0("href",t.getVideoUrl(e.video),sw),zB(),wx(e.video?.name);}}function Za(i,o){i&1&&(fb(0),yV(1,7),kp());}function Ka(i,o){if(i&1&&_2(0,qa,2,2,"a",15)(1,Za,2,0,"ng-container"),i&2){let e=bV().$implicit;w2(e.video?0:1);}}function Ja(i,o){if(i&1&&(sp(0,"td",10),_2(1,Wa,2,3,"a",11)(2,Xa,2,2,"span",12),ub(),sp(3,"td"),_2(4,ja,1,1,"my-actor-cell",13),ub(),sp(5,"td"),_2(6,Qa,1,1)(7,Ka,2,1),ub(),sp(8,"td")(9,"span",14),KV(10),ub()(),sp(11,"td"),KV(12),v$(13,"ptDate"),ub()),i&2){let e=o.$implicit,t=bV();zB(),w2(e.targetUrl?1:2),zB(3),w2(e.video?.channel?4:-1),zB(2),w2(t.isVideoImportPending(e)?6:t.isVideoImportSuccess(e)?7:-1),zB(3),B0("ngClass",t.getVideoImportStateClass(e.state.id)),zB(),vb(" ",e.state.label," "),zB(2),wx(S$(13,6,e.createdAt,"short"));}}function es(i,o){if(i&1&&Pp(0,"my-action-dropdown",16),i&2){let e=o.$implicit,t=bV();B0("actions",t.videoImportActions)("entry",e);}}function ts(i,o){if(i&1&&(sp(0,"pre"),KV(1),ub()),i&2){let e=o.$implicit;zB(),wx(e.error);}}function is(i,o){i&1&&(fb(0),yV(1,8),kp());}var Ko=(()=>{class i{notifier=g(rc$1);videoImportService=g(M);table=wpe("table");inputFilters=[{key:"targetUrl",type:"text",title:"Target URL",placeholder:"https://example.com/.../video.mp4"},{key:"id",type:"text",title:"Import ID",constraint:"numeric"},{key:"videoId",type:"text",title:"Video ID",constraint:"numeric"},{key:"videoChannelSyncId",type:"text",title:"Channel sync ID",constraint:"numeric"}];videoImportActions=[];columns=[{id:"target",label:"Target",sortable:false},{id:"channel",label:"Channel",sortable:false},{id:"video",label:"Video",sortable:false},{id:"state",label:"State",sortable:false},{id:"createdAt",label:"Created",sortable:true}];dataLoader;hasExpandedRow;constructor(){this.dataLoader=this._dataLoader.bind(this),this.hasExpandedRow=this._hasExpandedRow.bind(this);}ngOnInit(){this.videoImportActions=[{label:"Cancel import",iconName:"no",handler:e=>this.cancelImport(e),isDisplayed:e=>this.isVideoImportPending(e)},{label:"Retry import",iconName:"refresh",handler:e=>this.retryImport(e),isDisplayed:e=>this.isVideoImportFailed(e)},{label:"Delete import task",description:"The associated video is not deleted",iconName:"delete",handler:e=>this.deleteImport(e),isDisplayed:e=>this.isVideoImportFailed(e)||this.isVideoImportCancelled(e)||!e.video},{label:"Edit video",iconName:"edit",linkBuilder:e=>[this.getEditVideoUrl(e.video)],isDisplayed:e=>this.isVideoImportSuccess(e)&&!!e.video}];}getVideoImportStateClass(e){switch(e){case XDe.FAILED:return"badge-red";case XDe.REJECTED:return"badge-banned";case XDe.PENDING:return"badge-yellow";case XDe.PROCESSING:return"badge-blue";default:return"badge-green";}}isVideoImportSuccess(e){return e.state.id===XDe.SUCCESS;}isVideoImportPending(e){return e.state.id===XDe.PENDING;}isVideoImportFailed(e){return e.state.id===XDe.FAILED;}isVideoImportCancelled(e){return e.state.id===XDe.CANCELLED;}getVideoUrl(e){return K.buildWatchUrl(e);}getEditVideoUrl(e){return K.buildManageUrl(e);}deleteImport(e){this.videoImportService.deleteVideoImport(e).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}cancelImport(e){this.videoImportService.cancelVideoImport(e).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}retryImport(e){this.videoImportService.retryVideoImport(e).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}_dataLoader(e){return this.videoImportService.listMyVideoImports(E(D({},e),{includeCollaborations:true}));}_hasExpandedRow(e){return!!e.error;}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){t&1&&fx(n.table,Ua,5),t&2&&DV();},decls:12,vars:4,consts:()=>{let e;e="imports per page";let t;t="{VAR_PLURAL, plural, =0 {No import} =1 {1 import} other {{INTERPOLATION} imports}}",t=EV(t,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let n;n="This video has been deleted";let r;r="Actions";let s;return s="No video import found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],t,n,s,["key","MyVideoImportsComponent","paginatorText",e,"columnConfig","false","searchInput","true","refreshButton","true",3,"defaultColumns","dataLoader","inputFilters","hasExpandedRow"],[1,"max-width-300px","ellipsis"],["target","_blank","rel","noopener noreferrer",3,"href","title"],[3,"title"],["actorType","channel",3,"actor"],[1,"pt-badge",3,"ngClass"],["target","_blank","rel","noopener noreferrer",3,"href"],["label",r,"container","body",3,"actions","entry"]];},template:function(t,n){t&1&&(sp(0,"my-table",9,0),_0(2,Ga,3,4,"ng-template",null,1,D$)(4,Ja,14,9,"ng-template",null,2,D$)(6,es,1,2,"ng-template",null,3,D$)(8,ts,2,1,"ng-template",null,4,D$)(10,is,2,0,"ng-template",null,5,D$),ub()),t&2&&B0("defaultColumns",n.columns)("dataLoader",n.dataLoader)("inputFilters",n.inputFilters)("hasExpandedRow",n.hasExpandedRow);},dependencies:[cl$1,w3,Lh,Rt,Un,p$1,d$1],styles:["pre[_ngcontent-%COMP%]{font-size:11px}.video-import-error[_ngcontent-%COMP%]{color:var(--red)}"],changeDetection:1});}return i;})();var At=class extends r{videoPlaylistToUpdate;channels=[];videoPlaylistPrivacies=[];};var ns=i=>({"input-error":i}),os=i=>["/my-library/video-playlists/update",i];function rs(i,o){if(i&1&&(sp(0,"my-alert",14),KV(1),ub()),i&2){let e=bV();zB(),wx(e.error);}}function as(i,o){i&1&&(sp(0,"li",21),yV(1,6),ub());}function ss(i,o){if(i&1&&(sp(0,"a",41),KV(1),ub()),i&2){let e=bV(2);B0("routerLink",l$(2,os,e.videoPlaylistToUpdate?.shortUUID)),zB(),vb(" ",e.videoPlaylistToUpdate?.displayName," ");}}function ls(i,o){if(i&1&&(sp(0,"li",21),yV(1,7),ub(),sp(2,"li",40),_2(3,ss,2,4,"a",41),ub()),i&2){let e=bV();zB(3),w2(e.videoPlaylistToUpdate?3:-1);}}function cs(i,o){i&1&&(sp(0,"h2",22),yV(1,8),ub());}function ds(i,o){i&1&&(sp(0,"h2",22),yV(1,9),ub());}function _s(i,o){if(i&1&&(sp(0,"div",30),KV(1),ub()),i&2){let e=bV();zB(),vb(" ",e.formErrors.displayName," ");}}function ps(i,o){if(i&1&&(sp(0,"div",30),KV(1),ub()),i&2){let e=bV();zB(),wx(e.formErrors.privacy);}}function ms(i,o){if(i&1&&(sp(0,"div",37)(1,"div"),yV(2,10),ub(),sp(3,"div"),yV(4,11),ub()()),i&2){let e=bV();zB(2),ax(e.getOwnerAccountDisplayName()),vV(2);}}function us(i,o){if(i&1&&(sp(0,"div",30),KV(1),ub()),i&2){let e=bV();zB(),wx(e.formErrors.videoChannelId);}}function hs(i,o){i&1&&(sp(0,"div",25)(1,"my-peertube-checkbox",42),fb(2,43),sp(3,"span"),yV(4,12),ub(),Pp(5,"br"),sp(6,"span"),yV(7,13),ub(),kp(),ub(),GH(),ub()),i&2&&(zB(),WH());}var Jo=(()=>{class i extends At{formReactiveService=g(w);authService=g(Xe);notifier=g(rc$1);router=g(mt);videoPlaylistService=g(Z);serverService=g($t);error;ngOnInit(){this.buildForm({displayName:Y,privacy:H,description:q,videoChannelId:w$1,insertAtFirstPosition:null,thumbnailfile:null}),this.form.get("privacy").valueChanges.subscribe(e=>{G(this.form.get("videoChannelId"),e);}),ae({authService:this.authService,includeCollaborations:true}).subscribe(e=>this.channels=e),this.serverService.getVideoPlaylistPrivacies().subscribe(e=>{this.videoPlaylistPrivacies=e,this.form.patchValue({privacy:sIe.PRIVATE});});}formValidated(){this.error=void 0;let e=this.form.value,t={displayName:e.displayName,privacy:e.privacy,description:e.description||null,videoChannelId:e.videoChannelId||null,thumbnailfile:e.thumbnailfile||null};this.videoPlaylistService.createVideoPlaylist(t).pipe(Oe(({videoPlaylist:{id:n}})=>{if(e.insertAtFirstPosition!==true||!e.videoChannelId)return L$1(true);let r=this.channels.find(s=>s.id===e.videoChannelId)?.name;return this.videoPlaylistService.getVideoPlaylist(n).pipe(Oe(s=>this.videoPlaylistService.reorderPlaylistsOfChannel(r,s.videoChannelPosition,0)));})).subscribe({next:()=>{this.notifier.success("Playlist "+t.displayName+" created."),this.router.navigate(["/my-library","video-playlists"]);},error:n=>{this.error=n.message;}});}isCreation(){return true;}isEditor(){return false;}getOwnerAccountDisplayName(){return this.authService.getUser().account.displayName;}getFormButtonTitle(){return"Create";}static ɵfac=(()=>{let e;return function(n){return(e||(e=Uu(i)))(n||i);};})();static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],features:[I0],decls:41,vars:18,consts:()=>{let e;e="Edit";let t;t="Spelelistene mine";let n;n="Playlist thumbnail";let r;r="Display name";let s;s="Skildring";let d;d="Privacy";let u;u="Channel";let S;S="Create";let v;v="Edit";let R;R="NEW PLAYLIST";let oe;oe="UPDATE PLAYLIST";let Le;Le=" Only "+"\uFFFD0\uFFFD"+"'s channels are listed ";let nt;nt=" Changing the owner of a playlist is not supported ";let ot;ot="Insert at the first position in your channel's playlist list";let q;q="Playlists can be manually sorted in your channel.";let rt;return rt="By default, new playlists are added at the end of the list.",[t,n,r,s,d,u,S,v,R,oe,Le,nt,q,rt,["type","danger"],[1,"pt-two-cols"],[1,"title-col"],["aria-label","breadcrumb"],[1,"pt-breadcrumb"],[1,"breadcrumb-item"],["routerLink","/my-library/video-playlists"],[1,"breadcrumb-item","active"],[1,"visually-hidden"],[1,"content-col"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","thumbnailfile"],["inputLabel",e,"inputName","thumbnailfile","formControlName","thumbnailfile"],["for","displayName"],["type","text","id","displayName","formControlName","displayName",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["for","description"],["helpType","markdownText"],["inputId","description","formControlName","description",3,"formError"],["for","privacy"],["inputId","privacy","formControlName","privacy",3,"items"],["for","videoChannelId"],[1,"form-group-description"],["inputId","videoChannelId","formControlName","videoChannelId",3,"items"],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],["aria-current","page",1,"breadcrumb-item","active"],[3,"routerLink"],["inputName","insertAtFirstPosition","formControlName","insertAtFirstPosition","labelText",ot],["ngProjectAs","description",5,["description"]]];},template:function(t,n){t&1&&(_2(0,rs,2,1,"my-alert",14),sp(1,"div",15)(2,"div",16)(3,"nav",17)(4,"ol",18)(5,"li",19)(6,"a",20),yV(7,0),ub()(),_2(8,as,2,0,"li",21)(9,ls,4,1),ub()(),_2(10,cs,2,0,"h2",22)(11,ds,2,0,"h2",22),ub(),sp(12,"div",23)(13,"form",24),Fp("ngSubmit",function(){return n.formValidated();}),sp(14,"div",25)(15,"label",26),yV(16,1),ub(),Pp(17,"my-image-input",27),GH(),ub(),sp(18,"div",25)(19,"label",28),yV(20,2),ub(),Pp(21,"input",29),GH(),_2(22,_s,2,1,"div",30),ub(),sp(23,"div",25)(24,"label",31),yV(25,3),ub(),Pp(26,"my-help",32)(27,"my-markdown-textarea",33),GH(),ub(),sp(28,"div",25)(29,"label",34),yV(30,4),ub(),Pp(31,"my-select-options",35),GH(),_2(32,ps,2,1,"div",30),ub(),sp(33,"div",25)(34,"label",36),yV(35,5),ub(),_2(36,ms,5,1,"div",37),Pp(37,"my-select-channel-user",38),GH(),_2(38,us,2,1,"div",30),ub(),_2(39,hs,8,0,"div",25),Pp(40,"input",39),ub()()()),t&2&&(w2(n.error?0:-1),zB(8),w2(n.isCreation()?8:9),zB(2),w2(n.isCreation()?10:11),zB(3),B0("formGroup",n.form),zB(4),WH(),zB(4),B0("ngClass",l$(16,ns,n.formErrors.displayName)),WH(),zB(),w2(n.formErrors.displayName?22:-1),zB(5),B0("formError",n.formErrors.description),WH(),zB(4),B0("items",n.videoPlaylistPrivacies),WH(),zB(),w2(n.formErrors.privacy?32:-1),zB(4),w2(n.isEditor()?36:-1),zB(),B0("items",n.channels),WH(),zB(),w2(n.formErrors.videoChannelId?38:-1),zB(),w2(n.isCreation()&&n.form.value.videoChannelId?39:-1),zB(),B0("value",r$(n.getFormButtonTitle()))("disabled",!n.form.valid));},dependencies:[cl$1,w3,Xh,Jn,Zn,Je,qn,$n,Qn,Vn,yn,me,U,Je$1,Yl$1,Ae,v,Me$1],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-channel-user[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%]{display:block;max-width:340px}.content-col[_ngcontent-%COMP%]{max-width:500px}my-image-input[_ngcontent-%COMP%]{width:223px;height:122px}"],changeDetection:1});}return i;})();var fs=20,er=(()=>{class i{_ngZone=g(ie);_platform=g(tt);_renderer=g(ms$1).createRenderer(null,null);_cleanupGlobalListener;_scrolled=new Z$1();_scrolledCount=0;scrollContainers=new Map();register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)));}deregister(e){let t=this.scrollContainers.get(e);t&&(t.unsubscribe(),this.scrollContainers.delete(e));}scrolled(e=fs){return this._platform.isBrowser?new W(t=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let n=e>0?this._scrolled.pipe(q1(e)).subscribe(t):this._scrolled.subscribe(t);return this._scrolledCount++,()=>{n.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0);};}):L$1();}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,t)=>this.deregister(t)),this._scrolled.complete();}ancestorScrolled(e,t){let n=this.getAncestorScrollContainers(e);return this.scrolled(t).pipe(Ie(r=>!r||n.indexOf(r)>-1));}getAncestorScrollContainers(e){let t=[];return this.scrollContainers.forEach((n,r)=>{this._targetContainsElement(r,e)&&t.push(r);}),t;}_targetContainsElement(e,t){let n=le(t),r=e.getElementRef().nativeElement;do if(n==r)return true;while(n=n.parentElement);return false;}static ɵfac=function(t){return new(t||i)();};static ɵprov=be({token:i,factory:i.ɵfac});}return i;})();var Cs=20,Ki=(()=>{class i{_platform=g(tt);_listeners;_viewportSize=null;_change=new Z$1();_document=g(Ce);constructor(){let e=g(ie),t=g(ms$1).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let n=r=>this._change.next(r);this._listeners=[t.listen("window","resize",n),t.listen("window","orientationchange",n)];}this.change().subscribe(()=>this._viewportSize=null);});}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete();}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e;}getViewportRect(){let e=this.getViewportScrollPosition(),{width:t,height:n}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+n,right:e.left+t,height:n,width:t};}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,t=this._getWindow(),n=e.documentElement,r=n.getBoundingClientRect(),s=-r.top||e.body?.scrollTop||t.scrollY||n.scrollTop||0,d=-r.left||e.body?.scrollLeft||t.scrollX||n.scrollLeft||0;return{top:s,left:d};}change(e=Cs){return e>0?this._change.pipe(q1(e)):this._change;}_getWindow(){return this._document.defaultView||window;}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0};}static ɵfac=function(t){return new(t||i)();};static ɵprov=be({token:i,factory:i.ɵfac});}return i;})();var tr=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵmod=Ln({type:i});static ɵinj=mn({});}return i;})();function tn(i){let o=i.cloneNode(true),e=o.querySelectorAll("[id]"),t=i.nodeName.toLowerCase();o.removeAttribute("id");for(let n=0;n<e.length;n++)e[n].removeAttribute("id");return t==="canvas"?or(i,o):(t==="input"||t==="select"||t==="textarea")&&nr(i,o),ir("canvas",i,o,or),ir("input, textarea, select",i,o,nr),o;}function ir(i,o,e,t){let n=o.querySelectorAll(i);if(n.length){let r=e.querySelectorAll(i);for(let s=0;s<n.length;s++)t(n[s],r[s]);}}var Ss=0;function nr(i,o){o.type!=="file"&&(o.value=i.value),o.type==="radio"&&o.name&&(o.name=`mat-clone-${o.name}-${Ss++}`);}function or(i,o){let e=o.getContext("2d");if(e)try{e.drawImage(i,0,0);}catch(t){}}function ln(i){let o=i.getBoundingClientRect();return{top:o.top,right:o.right,bottom:o.bottom,left:o.left,width:o.width,height:o.height,x:o.x,y:o.y};}function nn(i,o,e){let{top:t,bottom:n,left:r,right:s}=i;return e>=t&&e<=n&&o>=r&&o<=s;}function ys(i,o){let e=o.left<i.left,t=o.left+o.width>i.right,n=o.top<i.top,r=o.top+o.height>i.bottom;return e||t||n||r;}function Ht(i,o,e){i.top+=o,i.bottom=i.top+i.height,i.left+=e,i.right=i.left+i.width;}function rr(i,o,e,t){let{top:n,right:r,bottom:s,left:d,width:u,height:S}=i,v=u*o,R=S*o;return t>n-R&&t<s+R&&e>d-v&&e<r+v;}var bi=class{_document;positions=new Map();constructor(o){this._document=o;}clear(){this.positions.clear();}cache(o){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),o.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:ln(e)});});}handleScroll(o){let e=L$2(o),t=this.positions.get(e);if(!t)return null;let n=t.scrollPosition,r,s;if(e===this._document){let S=this.getViewportScrollPosition();r=S.top,s=S.left;}else r=e.scrollTop,s=e.scrollLeft;let d=n.top-r,u=n.left-s;return this.positions.forEach((S,v)=>{S.clientRect&&e!==v&&e.contains(v)&&Ht(S.clientRect,d,u);}),n.top=r,n.left=s,{top:d,left:u};}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX};}};function Cr(i,o){let e=i.rootNodes;if(e.length===1&&e[0].nodeType===o.ELEMENT_NODE)return e[0];let t=o.createElement("div");return e.forEach(n=>t.appendChild(n)),t;}function cn(i,o,e){for(let t in o)if(o.hasOwnProperty(t)){let n=o[t];n?i.setProperty(t,n,e?.has(t)?"important":""):i.removeProperty(t);}return i;}function Lt(i,o){let e=o?"":"none";cn(i.style,{"touch-action":o?"":"none","-webkit-user-drag":o?"":"none","-webkit-tap-highlight-color":o?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e});}function ar(i,o,e){cn(i.style,{position:o?"":"fixed",top:o?"":"0",opacity:o?"":"0",left:o?"":"-999em"},e);}function Ai(i,o){return o&&o!="none"?i+" "+o:i;}function sr(i,o){i.style.width=`${o.width}px`,i.style.height=`${o.height}px`,i.style.transform=Ut(o.left,o.top);}function Ut(i,o){return`translate3d(${Math.round(i)}px, ${Math.round(o)}px, 0)`;}var Bt={capture:true},Ji={passive:false,capture:true},vs=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(t,n){},styles:[`@layer cdk-resets {
  .cdk-drag-preview {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    inset: auto;
  }
}
.cdk-drag-placeholder *,
.cdk-drag-preview * {
  pointer-events: none !important;
}
`],encapsulation:2});}return i;})(),dn=(()=>{class i{_ngZone=g(ie);_document=g(Ce);_styleLoader=g(ot);_renderer=g(ms$1).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new Z$1();_dropInstances=new Set();_dragInstances=new Set();_activeDragInstances=Ye([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new Z$1();pointerUp=new Z$1();registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e);}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,Ji);});}removeDropContainer(e){this._dropInstances.delete(e);}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.();}startDragging(e,t){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(vs),this._activeDragInstances.update(n=>[...n,e]),this._activeDragInstances().length===1)){let n=t.type.startsWith("touch"),r=d=>this.pointerUp.next(d),s=[["scroll",d=>this._scroll.next(d),Bt],["selectstart",this._preventDefaultWhileDragging,Ji]];n?s.push(["touchend",r,Bt],["touchcancel",r,Bt]):s.push(["mouseup",r,Bt]),n||s.push(["mousemove",d=>this.pointerMove.next(d),Ji]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=s.map(([d,u,S])=>this._renderer.listen(this._document,d,u,S));});}}stopDragging(e){this._activeDragInstances.update(t=>{let n=t.indexOf(e);return n>-1?(t.splice(n,1),[...t]):t;}),this._activeDragInstances().length===0&&this._clearGlobalListeners();}isDragging(e){return this._activeDragInstances().indexOf(e)>-1;}scrolled(e){let t=[this._scroll];return e&&e!==this._document&&t.push(new W(n=>this._ngZone.runOutsideAngular(()=>{let r=this._renderer.listen(e,"scroll",s=>{this._activeDragInstances().length&&n.next(s);},Bt);return()=>{r();};}))),j1(...t);}registerDirectiveNode(e,t){this._domNodesToDirectives??=new WeakMap(),this._domNodesToDirectives.set(e,t);}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e);}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null;}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete();}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault();};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e));};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0;}static ɵfac=function(t){return new(t||i)();};static ɵprov=be({token:i,factory:i.ɵfac});}return i;})();function lr(i){let o=i.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(i)*o;}function Es(i){let o=getComputedStyle(i),e=en(o,"transition-property"),t=e.find(d=>d==="transform"||d==="all");if(!t)return 0;let n=e.indexOf(t),r=en(o,"transition-duration"),s=en(o,"transition-delay");return lr(r[n])+lr(s[n]);}function en(i,o){return i.getPropertyValue(o).split(",").map(t=>t.trim());}var Ms=new Set(["position"]),on=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview;}constructor(o,e,t,n,r,s,d,u,S,v){this._document=o,this._rootElement=e,this._direction=t,this._initialDomRect=n,this._previewTemplate=r,this._previewClass=s,this._pickupPositionOnPage=d,this._initialTransform=u,this._zIndex=S,this._renderer=v;}attach(o){this._preview=this._createPreview(),o.appendChild(this._preview),cr(this._preview)&&this._preview.showPopover();}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null;}setTransform(o){this._preview.style.transform=o;}getBoundingClientRect(){return this._preview.getBoundingClientRect();}addClass(o){this._preview.classList.add(o);}getTransitionDuration(){return Es(this._preview);}addEventListener(o,e){return this._renderer.listen(this._preview,o,e);}_createPreview(){let o=this._previewTemplate,e=this._previewClass,t=o?o.template:null,n;if(t&&o){let r=o.matchSize?this._initialDomRect:null,s=o.viewContainer.createEmbeddedView(t,o.context);s.detectChanges(),n=Cr(s,this._document),this._previewEmbeddedView=s,o.matchSize?sr(n,r):n.style.transform=Ut(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y);}else n=tn(this._rootElement),sr(n,this._initialDomRect),this._initialTransform&&(n.style.transform=this._initialTransform);return cn(n.style,{"pointer-events":"none",margin:cr(n)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},Ms),Lt(n,false),n.classList.add("cdk-drag-preview"),n.setAttribute("popover","manual"),n.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(r=>n.classList.add(r)):n.classList.add(e)),n;}};function cr(i){return"showPopover"in i;}var Ps={passive:true},dr={passive:false},Is={passive:false,capture:true},Ts=800,_r="cdk-drag-placeholder",pr=new Set(["position"]);function Sr(i,o,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let t=i.get(ni,null,{optional:true})||i.get(ms$1).createRenderer(null,null);return new rn(o,e,i.get(Ce),i.get(ie),i.get(Ki),i.get(dn),t);}var rn=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=Ye(false);_hasMoved=false;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new Z$1();_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=Fe.EMPTY;_pointerUpSubscription=Fe.EMPTY;_scrollSubscription=Fe.EMPTY;_resizeSubscription=Fe.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=true;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set();_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled);}set disabled(o){o!==this._disabled&&(this._disabled=o,this._toggleNativeDragInteractions(),this._handles.forEach(e=>Lt(e,o)));}_disabled=false;beforeStarted=new Z$1();started=new Z$1();released=new Z$1();ended=new Z$1();entered=new Z$1();exited=new Z$1();dropped=new Z$1();moved=this._moveEvents;data;constrainPosition;constructor(o,e,t,n,r,s,d){this._config=e,this._document=t,this._ngZone=n,this._viewportRuler=r,this._dragDropRegistry=s,this._renderer=d,this.withRootElement(o).withParent(e.parentDragRef||null),this._parentPositions=new bi(t),s.registerDragItem(this);}getPlaceholderElement(){return this._placeholder;}getRootElement(){return this._rootElement;}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement();}withHandles(o){this._handles=o.map(t=>le(t)),this._handles.forEach(t=>Lt(t,this.disabled)),this._toggleNativeDragInteractions();let e=new Set();return this._disabledHandles.forEach(t=>{this._handles.indexOf(t)>-1&&e.add(t);}),this._disabledHandles=e,this;}withPreviewTemplate(o){return this._previewTemplate=o,this;}withPlaceholderTemplate(o){return this._placeholderTemplate=o,this;}withRootElement(o){let e=le(o);if(e!==this._rootElement){this._removeRootElementListeners();let t=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[t.listen(e,"mousedown",this._pointerDown,dr),t.listen(e,"touchstart",this._pointerDown,Ps),t.listen(e,"dragstart",this._nativeDragStart,dr)]),this._initialTransform=void 0,this._rootElement=e;}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this;}withBoundaryElement(o){return this._boundaryElement=o?le(o):null,this._resizeSubscription.unsubscribe(),o&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this;}withParent(o){return this._parentDragRef=o,this;}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null;}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this);}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0};}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&ys(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let o=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),t=0,n=0;e.left<o.left?t=o.left-e.left:e.right>o.right&&(t=o.right-e.right),e.top<o.top?n=o.top-e.top:e.bottom>o.bottom&&(n=o.bottom-e.bottom);let r=this._activeTransform.x,s=this._activeTransform.y,d=r+t,u=s+n;this._rootElement.style.transform=Ut(d,u),this._activeTransform={x:d,y:u},this._passiveTransform={x:d,y:u};}}disableHandle(o){!this._disabledHandles.has(o)&&this._handles.indexOf(o)>-1&&(this._disabledHandles.add(o),Lt(o,true));}enableHandle(o){this._disabledHandles.has(o)&&(this._disabledHandles.delete(o),Lt(o,this.disabled));}withDirection(o){return this._direction=o,this;}_withDropContainer(o){this._dropContainer=o;}getFreeDragPosition(){let o=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:o.x,y:o.y};}setFreeDragPosition(o){return this._activeTransform={x:0,y:0},this._passiveTransform.x=o.x,this._passiveTransform.y=o.y,this._dropContainer||this._applyRootElementTransform(o.x,o.y),this;}withPreviewContainer(o){return this._previewContainer=o,this;}_sortFromLastPointerPosition(){let o=this._lastKnownPointerPosition;o&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(o),o);}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0;}_destroyPreview(){this._preview?.destroy(),this._preview=null;}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null;}_pointerDown=o=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(o);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,o);}else this.disabled||this._initializeDragSequence(this._rootElement,o);};_pointerMove=o=>{let e=this._getPointerPositionOnPage(o);if(!this._hasStartedDragging()){let n=Math.abs(e.x-this._pickupPositionOnPage.x),r=Math.abs(e.y-this._pickupPositionOnPage.y);if(n+r>=this._config.dragStartThreshold){let d=Date.now()>=this._dragStartTime+this._getDragStartDelay(o),u=this._dropContainer;if(!d){this._endDragSequence(o);return;}(!u||!u.isDragging()&&!u.isReceiving())&&(o.cancelable&&o.preventDefault(),this._hasStartedDragging.set(true),this._ngZone.run(()=>this._startDragSequence(o)));}return;}o.cancelable&&o.preventDefault();let t=this._getConstrainedPointerPosition(e);if(this._hasMoved=true,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(t),this._dropContainer)this._updateActiveDropContainer(t,e);else{let n=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,r=this._activeTransform;r.x=t.x-n.x+this._passiveTransform.x,r.y=t.y-n.y+this._passiveTransform.y,this._applyRootElementTransform(r.x,r.y);}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:t,event:o,distance:this._getDragDistance(t),delta:this._pointerDirectionDelta});});};_pointerUp=o=>{this._endDragSequence(o);};_endDragSequence(o){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:o}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(o),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(o);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:o});}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);}}_startDragSequence(o){zt(o)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),t=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",Os,Is);}),t){let n=this._rootElement,r=n.parentNode,s=this._placeholder=this._createPlaceholderElement(),d=this._marker=this._marker||this._document.createComment("");r.insertBefore(d,n),this._initialTransform=n.style.transform||"",this._preview=new on(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(r,e)),ar(n,false,pr),this._document.body.appendChild(r.replaceChild(s,n)),this.started.next({source:this,event:o}),t.start(),this._initialContainer=t,this._initialIndex=t.getItemIndex(this);}else this.started.next({source:this,event:o}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(t?t.getScrollableParents():[]);}_initializeDragSequence(o,e){this._parentDragRef&&e.stopPropagation();let t=this.isDragging(),n=zt(e),r=!n&&e.button!==0,s=this._rootElement,d=L$2(e),u=!n&&this._lastTouchEventTime&&this._lastTouchEventTime+Ts>Date.now(),S=n?q$1(e):$$1(e);if(d&&d.draggable&&e.type==="mousedown"&&e.preventDefault(),t||r||u||S)return;if(this._handles.length){let oe=s.style;this._rootElementTapHighlight=oe.webkitTapHighlightColor||"",oe.webkitTapHighlightColor="transparent";}this._hasMoved=false,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(oe=>this._updateOnScroll(oe)),this._boundaryElement&&(this._boundaryRect=ln(this._boundaryElement));let v=this._previewTemplate;this._pickupPositionInElement=v&&v.template&&!v.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,o,e);let R=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:R.x,y:R.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e);}_cleanupDragArtifacts(o){ar(this._rootElement,true,pr),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,t=e.getItemIndex(this),n=this._getPointerPositionOnPage(o),r=this._getDragDistance(n),s=e._isOverContainer(n.x,n.y);this.ended.next({source:this,distance:r,dropPoint:n,event:o}),this.dropped.next({item:this,currentIndex:t,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:s,distance:r,dropPoint:n,event:o}),e.drop(this,t,this._initialIndex,this._initialContainer,s,r,n,o),this._dropContainer=this._initialContainer;});}_updateActiveDropContainer({x:o,y:e},{x:t,y:n}){let r=this._initialContainer._getSiblingContainerFromPosition(this,o,e);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(o,e)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{let s=this._dropContainer.getItemIndex(this),d=this._dropContainer.getItemAtIndex(s+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(r,this._dropContainer,d),this._dropContainer=r,this._dropContainer.enter(this,o,e,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)});}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(t,n),this._dropContainer._sortItem(this,o,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(o,e):this._applyPreviewTransform(o-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y));}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let o=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(o.left,o.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(t=>{let n=d=>{(!d||this._preview&&L$2(d)===this._preview.element&&d.propertyName==="transform")&&(s(),t(),clearTimeout(r));},r=setTimeout(n,e*1.5),s=this._preview.addEventListener("transitionend",n);}));}_createPlaceholderElement(){let o=this._placeholderTemplate,e=o?o.template:null,t;return e?(this._placeholderRef=o.viewContainer.createEmbeddedView(e,o.context),this._placeholderRef.detectChanges(),t=Cr(this._placeholderRef,this._document)):t=tn(this._rootElement),t.style.pointerEvents="none",t.classList.add(_r),t;}_getPointerPositionInElement(o,e,t){let n=e===this._rootElement?null:e,r=n?n.getBoundingClientRect():o,s=zt(t)?t.targetTouches[0]:t,d=this._getViewportScrollPosition(),u=s.pageX-r.left-d.left,S=s.pageY-r.top-d.top;return{x:r.left-o.left+u,y:r.top-o.top+S};}_getPointerPositionOnPage(o){let e=this._getViewportScrollPosition(),t=zt(o)?o.touches[0]||o.changedTouches[0]||{pageX:0,pageY:0}:o,n=t.pageX-e.left,r=t.pageY-e.top;if(this._ownerSVGElement){let s=this._ownerSVGElement.getScreenCTM();if(s){let d=this._ownerSVGElement.createSVGPoint();return d.x=n,d.y=r,d.matrixTransform(s.inverse());}}return{x:n,y:r};}_getConstrainedPointerPosition(o){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:t,y:n}=this.constrainPosition?this.constrainPosition(o,this,this._initialDomRect,this._pickupPositionInElement):o;if(this.lockAxis==="x"||e==="x"?n=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(t=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:r,y:s}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,d=this._boundaryRect,{width:u,height:S}=this._getPreviewRect(),v=d.top+s,R=d.bottom-(S-s),oe=d.left+r,Le=d.right-(u-r);t=mr(t,oe,Le),n=mr(n,v,R);}return{x:t,y:n};}_updatePointerDirectionDelta(o){let{x:e,y:t}=o,n=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,s=Math.abs(e-r.x),d=Math.abs(t-r.y);return s>this._config.pointerDirectionChangeThreshold&&(n.x=e>r.x?1:-1,r.x=e),d>this._config.pointerDirectionChangeThreshold&&(n.y=t>r.y?1:-1,r.y=t),n;}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let o=this._handles.length>0||!this.isDragging();o!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=o,Lt(this._rootElement,o));}_removeRootElementListeners(){this._rootElementCleanups?.forEach(o=>o()),this._rootElementCleanups=void 0;}_applyRootElementTransform(o,e){let t=1/this.scale,n=Ut(o*t,e*t),r=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=r.transform&&r.transform!="none"?r.transform:""),r.transform=Ai(n,this._initialTransform);}_applyPreviewTransform(o,e){let t=this._previewTemplate?.template?void 0:this._initialTransform,n=Ut(o,e);this._preview.setTransform(Ai(n,t));}_getDragDistance(o){let e=this._pickupPositionOnPage;return e?{x:o.x-e.x,y:o.y-e.y}:{x:0,y:0};}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear();}_containInsideBoundaryOnResize(){let{x:o,y:e}=this._passiveTransform;if(o===0&&e===0||this.isDragging()||!this._boundaryElement)return;let t=this._rootElement.getBoundingClientRect(),n=this._boundaryElement.getBoundingClientRect();if(n.width===0&&n.height===0||t.width===0&&t.height===0)return;let r=n.left-t.left,s=t.right-n.right,d=n.top-t.top,u=t.bottom-n.bottom;n.width>t.width?(r>0&&(o+=r),s>0&&(o-=s)):o=0,n.height>t.height?(d>0&&(e+=d),u>0&&(e-=u)):e=0,(o!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:o});}_getDragStartDelay(o){let e=this.dragStartDelay;return typeof e=="number"?e:zt(o)?e.touch:e?e.mouse:0;}_updateOnScroll(o){let e=this._parentPositions.handleScroll(o);if(e){let t=L$2(o);this._boundaryRect&&t!==this._boundaryElement&&t.contains(this._boundaryElement)&&Ht(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y));}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition();}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=R(this._rootElement)),this._cachedShadowRoot;}_getPreviewInsertionPoint(o,e){let t=this._previewContainer||"global";if(t==="parent")return o;if(t==="global"){let n=this._document;return e||n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement||n.body;}return le(t);}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect;}_nativeDragStart=o=>{if(this._handles.length){let e=this._getTargetHandle(o);e&&!this._disabledHandles.has(e)&&!this.disabled&&o.preventDefault();}else this.disabled||o.preventDefault();};_getTargetHandle(o){return this._handles.find(e=>o.target&&(o.target===e||e.contains(o.target)));}_conditionallyInsertAnchor(o,e,t){if(o===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let n=this._anchor??=tn(this._placeholder);n.classList.remove(_r),n.classList.add("cdk-drag-anchor"),n.style.transform="",t?t.before(n):le(e.element).appendChild(n);}}};function mr(i,o,e){return Math.max(o,Math.min(e,i));}function zt(i){return i.type[0]==="t";}function Os(i){i.preventDefault();}function yr(i,o,e){let t=ur(o,i.length-1),n=ur(e,i.length-1);if(t===n)return;let r=i[t],s=n<t?-1:1;for(let d=t;d!==n;d+=s)i[d]=i[d+s];i[n]=r;}function ur(i,o){return Math.max(0,Math.min(o,i));}var Li=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(o){this._dragDropRegistry=o;}_previousSwap={drag:null,delta:0,overlaps:false};start(o){this.withItems(o);}sort(o,e,t,n){let r=this._itemPositions,s=this._getItemIndexFromPointerPosition(o,e,t,n);if(s===-1&&r.length>0)return null;let d=this.orientation==="horizontal",u=r.findIndex(q=>q.drag===o),S=r[s],v=r[u].clientRect,R=S.clientRect,oe=u>s?1:-1,Le=this._getItemOffsetPx(v,R,oe),nt=this._getSiblingOffsetPx(u,r,oe),ot=r.slice();return yr(r,u,s),r.forEach((q,rt)=>{if(ot[rt]===q)return;let b=q.drag===o,Di=b?Le:nt,pn=b?o.getPlaceholderElement():q.drag.getRootElement();q.offset+=Di;let mn=Math.round(q.offset*(1/q.drag.scale));d?(pn.style.transform=Ai(`translate3d(${mn}px, 0, 0)`,q.initialTransform),Ht(q.clientRect,0,Di)):(pn.style.transform=Ai(`translate3d(0, ${mn}px, 0)`,q.initialTransform),Ht(q.clientRect,Di,0));}),this._previousSwap.overlaps=nn(R,e,t),this._previousSwap.drag=S.drag,this._previousSwap.delta=d?n.x:n.y,{previousIndex:u,currentIndex:s};}enter(o,e,t,n){let r=this._activeDraggables,s=r.indexOf(o),d=o.getPlaceholderElement();s>-1&&r.splice(s,1);let u=n==null||n<0?this._getItemIndexFromPointerPosition(o,e,t):n,S=r[u];if(S===o&&(S=r[u+1]),!S&&(u==null||u===-1||u<r.length-1)&&this._shouldEnterAsFirstChild(e,t)&&(S=r[0]),S&&!this._dragDropRegistry.isDragging(S)){let v=S.getRootElement();v.parentElement.insertBefore(d,v),r.splice(u,0,o);}else this._element.appendChild(d),r.push(o);d.style.transform="",this._cacheItemPositions();}withItems(o){this._activeDraggables=o.slice(),this._cacheItemPositions();}withSortPredicate(o){this._sortPredicate=o;}reset(){this._activeDraggables?.forEach(o=>{let e=o.getRootElement();if(e){let t=this._itemPositions.find(n=>n.drag===o)?.initialTransform;e.style.transform=t||"";}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=false;}getActiveItemsSnapshot(){return this._activeDraggables;}getItemIndex(o){return this._getVisualItemPositions().findIndex(e=>e.drag===o);}getItemAtIndex(o){return this._getVisualItemPositions()[o]?.drag||null;}updateOnScroll(o,e){this._itemPositions.forEach(({clientRect:t})=>{Ht(t,o,e);}),this._itemPositions.forEach(({drag:t})=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition();});}withElementContainer(o){this._element=o;}_cacheItemPositions(){let o=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let t=e.getVisibleElement();return{drag:e,offset:0,initialTransform:t.style.transform||"",clientRect:ln(t)};}).sort((e,t)=>o?e.clientRect.left-t.clientRect.left:e.clientRect.top-t.clientRect.top);}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions;}_getItemOffsetPx(o,e,t){let n=this.orientation==="horizontal",r=n?e.left-o.left:e.top-o.top;return t===-1&&(r+=n?e.width-o.width:e.height-o.height),r;}_getSiblingOffsetPx(o,e,t){let n=this.orientation==="horizontal",r=e[o].clientRect,s=e[o+t*-1],d=r[n?"width":"height"]*t;if(s){let u=n?"left":"top",S=n?"right":"bottom";t===-1?d-=s.clientRect[u]-r[S]:d+=r[u]-s.clientRect[S];}return d;}_shouldEnterAsFirstChild(o,e){if(!this._activeDraggables.length)return false;let t=this._itemPositions,n=this.orientation==="horizontal";if(t[0].drag!==this._activeDraggables[0]){let s=t[t.length-1].clientRect;return n?o>=s.right:e>=s.bottom;}else{let s=t[0].clientRect;return n?o<=s.left:e<=s.top;}}_getItemIndexFromPointerPosition(o,e,t,n){let r=this.orientation==="horizontal",s=this._itemPositions.findIndex(({drag:d,clientRect:u})=>{if(d===o)return false;if(n){let S=r?n.x:n.y;if(d===this._previousSwap.drag&&this._previousSwap.overlaps&&S===this._previousSwap.delta)return false;}return r?e>=Math.floor(u.left)&&e<Math.floor(u.right):t>=Math.floor(u.top)&&t<Math.floor(u.bottom);});return s===-1||!this._sortPredicate(s,o)?-1:s;}},an=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:false};_relatedNodes=[];constructor(o,e){this._document=o,this._dragDropRegistry=e;}start(o){let e=this._element.childNodes;this._relatedNodes=[];for(let t=0;t<e.length;t++){let n=e[t];this._relatedNodes.push([n,n.nextSibling]);}this.withItems(o);}sort(o,e,t,n){let r=this._getItemIndexFromPointerPosition(o,e,t),s=this._previousSwap;if(r===-1||this._activeItems[r]===o)return null;let d=this._activeItems[r];if(s.drag===d&&s.overlaps&&s.deltaX===n.x&&s.deltaY===n.y)return null;let u=this.getItemIndex(o),S=o.getPlaceholderElement(),v=d.getRootElement();r>u?v.after(S):v.before(S),yr(this._activeItems,u,r);let R=this._getRootNode().elementFromPoint(e,t);return s.deltaX=n.x,s.deltaY=n.y,s.drag=d,s.overlaps=v===R||v.contains(R),{previousIndex:u,currentIndex:r};}enter(o,e,t,n){let r=this._activeItems.indexOf(o);r>-1&&this._activeItems.splice(r,1);let s=n==null||n<0?this._getItemIndexFromPointerPosition(o,e,t):n;s===-1&&(s=this._getClosestItemIndexToPointer(o,e,t));let d=this._activeItems[s];d&&!this._dragDropRegistry.isDragging(d)?(this._activeItems.splice(s,0,o),d.getRootElement().before(o.getPlaceholderElement())):(this._activeItems.push(o),this._element.appendChild(o.getPlaceholderElement()));}withItems(o){this._activeItems=o.slice();}withSortPredicate(o){this._sortPredicate=o;}reset(){let o=this._element,e=this._previousSwap;for(let t=this._relatedNodes.length-1;t>-1;t--){let[n,r]=this._relatedNodes[t];n.parentNode===o&&n.nextSibling!==r&&(r===null?o.appendChild(n):r.parentNode===o&&o.insertBefore(n,r));}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=false;}getActiveItemsSnapshot(){return this._activeItems;}getItemIndex(o){return this._activeItems.indexOf(o);}getItemAtIndex(o){return this._activeItems[o]||null;}updateOnScroll(){this._activeItems.forEach(o=>{this._dragDropRegistry.isDragging(o)&&o._sortFromLastPointerPosition();});}withElementContainer(o){o!==this._element&&(this._element=o,this._rootNode=void 0);}_getItemIndexFromPointerPosition(o,e,t){let n=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(t)),r=n?this._activeItems.findIndex(s=>{let d=s.getRootElement();return n===d||d.contains(n);}):-1;return r===-1||!this._sortPredicate(r,o)?-1:r;}_getRootNode(){return this._rootNode||(this._rootNode=R(this._element)||this._document),this._rootNode;}_getClosestItemIndexToPointer(o,e,t){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let n=1/0,r=-1;for(let s=0;s<this._activeItems.length;s++){let d=this._activeItems[s];if(d!==o){let{x:u,y:S}=d.getRootElement().getBoundingClientRect(),v=Math.hypot(e-u,t-S);v<n&&(n=v,r=s);}}return r;}},hr=.05,vr=.05,ye=function(i){return i[i.NONE=0]="NONE",i[i.UP=1]="UP",i[i.DOWN=2]="DOWN",i;}(ye||{}),re=function(i){return i[i.NONE=0]="NONE",i[i.LEFT=1]="LEFT",i[i.RIGHT=2]="RIGHT",i;}(re||{});function Er(i,o){return new sn(o,i.get(dn),i.get(Ce),i.get(ie),i.get(Ki));}var sn=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=false;sortingDisabled=false;lockAxis=null;autoScrollDisabled=false;autoScrollStep=2;hasAnchor=false;enterPredicate=()=>true;sortPredicate=()=>true;beforeStarted=new Z$1();entered=new Z$1();exited=new Z$1();dropped=new Z$1();sorted=new Z$1();receivingStarted=new Z$1();receivingStopped=new Z$1();data;_container;_isDragging=false;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set();_viewportScrollSubscription=Fe.EMPTY;_verticalScrollDirection=ye.NONE;_horizontalScrollDirection=re.NONE;_scrollNode;_stopScrollTimers=new Z$1();_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(o,e,t,n,r){this._dragDropRegistry=e,this._ngZone=n,this._viewportRuler=r;let s=this.element=le(o);this._document=t,this.withOrientation("vertical").withElementContainer(s),e.registerDropContainer(this),this._parentPositions=new bi(t);}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this);}isDragging(){return this._isDragging;}start(){this._draggingStarted(),this._notifyReceivingSiblings();}enter(o,e,t,n){this._draggingStarted(),n==null&&this.sortingDisabled&&(n=this._draggables.indexOf(o)),this._sortStrategy.enter(o,e,t,n),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:o,container:this,currentIndex:this.getItemIndex(o)});}exit(o){this._reset(),this.exited.next({item:o,container:this});}drop(o,e,t,n,r,s,d,u){this._reset(),this.dropped.next({item:o,currentIndex:e,previousIndex:t,container:this,previousContainer:n,isPointerOverContainer:r,distance:s,dropPoint:d,event:u});}withItems(o){let e=this._draggables;return this._draggables=o,o.forEach(t=>t._withDropContainer(this)),this.isDragging()&&(e.filter(n=>n.isDragging()).every(n=>o.indexOf(n)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this;}withDirection(o){return this._direction=o,this._sortStrategy instanceof Li&&(this._sortStrategy.direction=o),this;}connectedTo(o){return this._siblings=o.slice(),this;}withOrientation(o){if(o==="mixed")this._sortStrategy=new an(this._document,this._dragDropRegistry);else{let e=new Li(this._dragDropRegistry);e.direction=this._direction,e.orientation=o,this._sortStrategy=e;}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,t)=>this.sortPredicate(e,t,this)),this;}withScrollableParents(o){let e=this._container;return this._scrollableElements=o.indexOf(e)===-1?[e,...o]:o.slice(),this;}withElementContainer(o){if(o===this._container)return this;le(this.element);let t=this._scrollableElements.indexOf(this._container),n=this._scrollableElements.indexOf(o);return t>-1&&this._scrollableElements.splice(t,1),n>-1&&this._scrollableElements.splice(n,1),this._sortStrategy&&this._sortStrategy.withElementContainer(o),this._cachedShadowRoot=null,this._scrollableElements.unshift(o),this._container=o,this;}getScrollableParents(){return this._scrollableElements;}getItemIndex(o){return this._isDragging?this._sortStrategy.getItemIndex(o):this._draggables.indexOf(o);}getItemAtIndex(o){return this._isDragging?this._sortStrategy.getItemAtIndex(o):this._draggables[o]||null;}isReceiving(){return this._activeSiblings.size>0;}_sortItem(o,e,t,n){if(this.sortingDisabled||!this._domRect||!rr(this._domRect,hr,e,t))return;let r=this._sortStrategy.sort(o,e,t,n);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:o});}_startScrollingIfNecessary(o,e){if(this.autoScrollDisabled)return;let t,n=ye.NONE,r=re.NONE;if(this._parentPositions.positions.forEach((s,d)=>{d===this._document||!s.clientRect||t||rr(s.clientRect,hr,o,e)&&([n,r]=Rs(d,s.clientRect,this._direction,o,e),(n||r)&&(t=d));}),!n&&!r){let{width:s,height:d}=this._viewportRuler.getViewportSize(),u={width:s,height:d,top:0,right:s,bottom:d,left:0};n=Mr(u,e),r=Pr(u,o),t=window;}t&&(n!==this._verticalScrollDirection||r!==this._horizontalScrollDirection||t!==this._scrollNode)&&(this._verticalScrollDirection=n,this._horizontalScrollDirection=r,this._scrollNode=t,(n||r)&&t?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling());}_stopScrolling(){this._stopScrollTimers.next();}_draggingStarted(){let o=this._container.style;this.beforeStarted.next(),this._isDragging=true,this._initialScrollSnap=o.msScrollSnapType||o.scrollSnapType||"",o.scrollSnapType=o.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents();}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect;}_reset(){this._isDragging=false;let o=this._container.style;o.scrollSnapType=o.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear();}_startScrollInterval=()=>{this._stopScrolling(),H1(0,N1).pipe(Gc(this._stopScrollTimers)).subscribe(()=>{let o=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===ye.UP?o.scrollBy(0,-e):this._verticalScrollDirection===ye.DOWN&&o.scrollBy(0,e),this._horizontalScrollDirection===re.LEFT?o.scrollBy(-e,0):this._horizontalScrollDirection===re.RIGHT&&o.scrollBy(e,0);});};_isOverContainer(o,e){return this._domRect!=null&&nn(this._domRect,o,e);}_getSiblingContainerFromPosition(o,e,t){return this._siblings.find(n=>n._canReceive(o,e,t));}_canReceive(o,e,t){if(!this._domRect||!nn(this._domRect,e,t)||!this.enterPredicate(o,this))return false;let n=this._getShadowRoot().elementFromPoint(e,t);return n?n===this._container||this._container.contains(n):false;}_startReceiving(o,e){let t=this._activeSiblings;!t.has(o)&&e.every(n=>this.enterPredicate(n,this)||this._draggables.indexOf(n)>-1)&&(t.add(o),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:o,receiver:this,items:e}));}_stopReceiving(o){this._activeSiblings.delete(o),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:o,receiver:this});}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(o=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(o);e&&this._sortStrategy.updateOnScroll(e.top,e.left);}else this.isReceiving()&&this._cacheParentPositions();});}_getShadowRoot(){if(!this._cachedShadowRoot){let o=R(this._container);this._cachedShadowRoot=o||this._document;}return this._cachedShadowRoot;}_notifyReceivingSiblings(){let o=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,o));}};function Mr(i,o){let{top:e,bottom:t,height:n}=i,r=n*vr;return o>=e-r&&o<=e+r?ye.UP:o>=t-r&&o<=t+r?ye.DOWN:ye.NONE;}function Pr(i,o){let{left:e,right:t,width:n}=i,r=n*vr;return o>=e-r&&o<=e+r?re.LEFT:o>=t-r&&o<=t+r?re.RIGHT:re.NONE;}function Rs(i,o,e,t,n){let r=Mr(o,n),s=Pr(o,t),d=ye.NONE,u=re.NONE;if(r){let S=i.scrollTop;r===ye.UP?S>0&&(d=ye.UP):i.scrollHeight-S>i.clientHeight&&(d=ye.DOWN);}if(s){let S=i.scrollLeft;e==="rtl"?s===re.RIGHT?S<0&&(u=re.RIGHT):i.scrollWidth+S>i.clientWidth&&(u=re.LEFT):s===re.LEFT?S>0&&(u=re.LEFT):i.scrollWidth-S>i.clientWidth&&(u=re.RIGHT);}return[d,u];}var bs=(()=>{class i{_injector=g(Et);createDrag(e,t){return Sr(this._injector,e,t);}createDropList(e){return Er(this._injector,e);}static ɵfac=function(t){return new(t||i)();};static ɵprov=be({token:i,factory:i.ɵfac});}return i;})(),gr=new A$1("CDK_DRAG_PARENT");var As=new A$1("CdkDragHandle");var Ir=new A$1("CDK_DRAG_CONFIG"),Tr=new A$1("CdkDropList"),Or=(()=>{class i{element=g(Mn);dropContainer=g(Tr,{optional:true,skipSelf:true});_ngZone=g(ie);_viewContainerRef=g(Fr$1);_dir=g(z$1,{optional:true});_changeDetectorRef=g(Cs$1);_selfHandle=g(As,{optional:true,self:true});_parentDrag=g(gr,{optional:true,skipSelf:true});_dragDropRegistry=g(dn);_destroyed=new Z$1();_handles=new It([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled);}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled;}_disabled=false;constrainPosition;previewClass;previewContainer;scale=1;started=new kt();released=new kt();ended=new kt();entered=new kt();exited=new kt();dropped=new kt();moved=new W(e=>{let t=this._dragRef.moved.pipe($(n=>({source:this,pointerPosition:n.pointerPosition,event:n.event,delta:n.delta,distance:n.distance}))).subscribe(e);return()=>{t.unsubscribe();};});_injector=g(Et);constructor(){let e=this.dropContainer,t=g(Ir,{optional:true});this._dragRef=Sr(this._injector,this.element,{dragStartThreshold:t&&t.dragStartThreshold!=null?t.dragStartThreshold:5,pointerDirectionChangeThreshold:t&&t.pointerDirectionChangeThreshold!=null?t.pointerDirectionChangeThreshold:5,zIndex:t?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),t&&this._assignDefaults(t),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(Gc(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale;})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef);}getPlaceholderElement(){return this._dragRef.getPlaceholderElement();}getRootElement(){return this._dragRef.getRootElement();}reset(){this._dragRef.reset();}resetToBoundary(){this._dragRef.resetToBoundary();}getFreeDragPosition(){return this._dragRef.getFreeDragPosition();}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e);}ngAfterViewInit(){Gu(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);},{injector:this._injector});}ngOnChanges(e){let t=e.rootElementSelector,n=e.freeDragPosition;t&&!t.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose();});}_addHandle(e){let t=this._handles.getValue();t.push(e),this._handles.next(t);}_removeHandle(e){let t=this._handles.getValue(),n=t.indexOf(e);n>-1&&(t.splice(n,1),this._handles.next(t));}_setPreviewTemplate(e){this._previewTemplate=e;}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null);}_setPlaceholderTemplate(e){this._placeholderTemplate=e;}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null);}_updateRootElement(){let e=this.element.nativeElement,t=e;this.rootElementSelector&&(t=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(t||e);}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):le(e):null;}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let t=this._dir,n=this.dragStartDelay,r=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,s=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof n=="object"&&n?n:ae$1(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(r).withPreviewTemplate(s).withPreviewContainer(this.previewContainer||"global"),t&&e.withDirection(t.value);}}),e.beforeStarted.pipe(Dn(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return;}let t=this.element.nativeElement.parentElement;for(;t;){let n=this._dragDropRegistry.getDragDirectiveForNode(t);if(n){e.withParent(n._dragRef);break;}t=t.parentElement;}});}_handleEvents(e){e.started.subscribe(t=>{this.started.emit({source:this,event:t.event}),this._changeDetectorRef.markForCheck();}),e.released.subscribe(t=>{this.released.emit({source:this,event:t.event});}),e.ended.subscribe(t=>{this.ended.emit({source:this,distance:t.distance,dropPoint:t.dropPoint,event:t.event}),this._changeDetectorRef.markForCheck();}),e.entered.subscribe(t=>{this.entered.emit({container:t.container.data,item:this,currentIndex:t.currentIndex});}),e.exited.subscribe(t=>{this.exited.emit({container:t.container.data,item:this});}),e.dropped.subscribe(t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,isPointerOverContainer:t.isPointerOverContainer,item:this,distance:t.distance,dropPoint:t.dropPoint,event:t.event});});}_assignDefaults(e){let{lockAxis:t,dragStartDelay:n,constrainPosition:r,previewClass:s,boundaryElement:d,draggingDisabled:u,rootElementSelector:S,previewContainer:v}=e;this.disabled=u??false,this.dragStartDelay=n||0,this.lockAxis=t||null,r&&(this.constrainPosition=r),s&&(this.previewClass=s),d&&(this.boundaryElement=d),S&&(this.rootElementSelector=S),v&&(this.previewContainer=v);}_setupHandlesListener(){this._handles.pipe(lt(e=>{let t=e.map(n=>n.element);this._selfHandle&&this.rootElementSelector&&t.push(this.element),this._dragRef.withHandles(t);}),Oe(e=>j1(...e.map(t=>t._stateChanges.pipe(Wd(t))))),Gc(this._destroyed)).subscribe(e=>{let t=this._dragRef,n=e.element.nativeElement;e.disabled?t.disableHandle(n):t.enableHandle(n);});}static ɵfac=function(t){return new(t||i)();};static ɵdir=sn$1({type:i,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(t,n){t&2&&vx("cdk-drag-disabled",n.disabled)("cdk-drag-dragging",n._dragRef.isDragging());},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",tl$1],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",J$]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[c$([{provide:gr,useExisting:i}]),ti]});}return i;})(),fr=new A$1("CdkDropListGroup");var Rr=(()=>{class i{element=g(Mn);_changeDetectorRef=g(Cs$1);_scrollDispatcher=g(er);_dir=g(z$1,{optional:true});_group=g(fr,{optional:true,skipSelf:true});_latestSortedRefs;_destroyed=new Z$1();_scrollableParentsResolved=false;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=g(N).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled;}set disabled(e){this._dropListRef.disabled=this._disabled=e;}_disabled=false;sortingDisabled=false;enterPredicate=()=>true;sortPredicate=()=>true;autoScrollDisabled=false;autoScrollStep;elementContainerSelector=null;hasAnchor=false;dropped=new kt();entered=new kt();exited=new kt();sorted=new kt();_unsortedItems=new Set();constructor(){let e=g(Ir,{optional:true}),t=g(Et);this._dropListRef=Er(t,this.element),this._dropListRef.data=this,e&&this._assignDefaults(e),this._dropListRef.enterPredicate=(n,r)=>this.enterPredicate(n.data,r.data),this._dropListRef.sortPredicate=(n,r,s)=>this.sortPredicate(n,r.data,s.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),i._dropLists.push(this),this._group&&this._group._items.add(this);}addItem(e){this._unsortedItems.add(e),e._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(t=>t._dragRef));}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let t=this._latestSortedRefs.indexOf(e._dragRef);t>-1&&(this._latestSortedRefs.splice(t,1),this._syncItemsWithRef(this._latestSortedRefs));}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,t)=>e._dragRef.getVisibleElement().compareDocumentPosition(t._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);}ngOnDestroy(){let e=i._dropLists.indexOf(this);e>-1&&i._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete();}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe(Wd(this._dir.value),Gc(this._destroyed)).subscribe(t=>e.withDirection(t)),e.beforeStarted.subscribe(()=>{let t=nt(this.connectedTo).map(n=>{if(typeof n=="string"){let r=i._dropLists.find(s=>s.id===n);return r;}return n;});if(this._group&&this._group._items.forEach(n=>{t.indexOf(n)===-1&&t.push(n);}),!this._scrollableParentsResolved){let n=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(r=>r.getElementRef().nativeElement);this._dropListRef.withScrollableParents(n),this._scrollableParentsResolved=true;}if(this.elementContainerSelector){let n=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(n);}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=ae$1(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(t.filter(n=>n&&n!==this).map(n=>n._dropListRef)).withOrientation(this.orientation);});}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(t=>t._dragRef)),this._changeDetectorRef.markForCheck();}),e.entered.subscribe(t=>{this.entered.emit({container:this,item:t.item.data,currentIndex:t.currentIndex});}),e.exited.subscribe(t=>{this.exited.emit({container:this,item:t.item.data}),this._changeDetectorRef.markForCheck();}),e.sorted.subscribe(t=>{this.sorted.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,container:this,item:t.item.data});}),e.dropped.subscribe(t=>{this.dropped.emit({previousIndex:t.previousIndex,currentIndex:t.currentIndex,previousContainer:t.previousContainer.data,container:t.container.data,item:t.item.data,isPointerOverContainer:t.isPointerOverContainer,distance:t.distance,dropPoint:t.dropPoint,event:t.event}),this._changeDetectorRef.markForCheck();}),j1(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck());}_assignDefaults(e){let{lockAxis:t,draggingDisabled:n,sortingDisabled:r,listAutoScrollDisabled:s,listOrientation:d}=e;this.disabled=n??false,this.sortingDisabled=r??false,this.autoScrollDisabled=s??false,this.orientation=d||"vertical",this.lockAxis=t||null;}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e);}static ɵfac=function(t){return new(t||i)();};static ɵdir=sn$1({type:i,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(t,n){t&2&&(Lp("id",n.id),vx("cdk-drop-list-disabled",n.disabled)("cdk-drop-list-dragging",n._dropListRef.isDragging())("cdk-drop-list-receiving",n._dropListRef.isReceiving()));},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",tl$1],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",tl$1],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",tl$1],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",tl$1]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[c$([{provide:fr,useValue:void 0},{provide:Tr,useExisting:i}])]});}return i;})();var br=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵmod=Ln({type:i});static ɵinj=mn({providers:[bs],imports:[tr]});}return i;})();var Ls=["videoShareModal"];function Ns(i,o){if(i&1&&Pp(0,"my-video-playlist-miniature",7),i&2){let e=bV();B0("playlist",e.playlist);}}function Ds(i,o){if(i&1&&Pp(0,"my-action-dropdown",10),i&2){let e=bV();B0("entry",e.playlist)("actions",e.playlistActions);}}function ws(i,o){i&1&&(sp(0,"div",12)(1,"div"),yV(2,2),ub(),sp(3,"div"),yV(4,3),ub(),sp(5,"div"),ix(6,4),Pp(7,"a",16),sx(),ub()());}function xs(i,o){if(i&1){let e=k2();sp(0,"div",14)(1,"my-video-playlist-element-miniature",17),Fp("elementRemoved",function(n){$I(e);let r=bV();return GI(r.onElementRemoved(n));}),ub()();}if(i&2){let e=o.$implicit,t=bV();B0("cdkDragStartDelay",t.getDragStartDelay()),zB(),B0("playlistElement",e)("playlist",t.playlist)("owned",true)("position",e.position);}}var Ar=(()=>{class i{hooks=g(Lk);notifier=g(rc$1);router=g(mt);confirmService=g(ag);route=g(jr$1);screenService=g(pg);videoPlaylistService=g(Z);videoShareModal=wpe("videoShareModal");errored=false;playlistElements=[];playlist;playlistActions=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};onDataSubject=new Z$1();videoPlaylistId;paramsSub;ngOnInit(){this.playlistActions=[[{label:"Update playlist",iconName:"edit",linkBuilder:e=>["/my-library","video-playlists","update",e.shortUUID]},{label:"Delete playlist",iconName:"delete",handler:e=>this.deleteVideoPlaylist(e)}]],this.paramsSub=this.route.params.subscribe(e=>{this.videoPlaylistId=e.videoPlaylistId,this.loadElements(),this.loadPlaylistInfo();});}ngOnDestroy(){this.paramsSub&&this.paramsSub.unsubscribe();}drop(e){let t=e.previousIndex,n=e.currentIndex;if(t===n)return;let r=this.playlistElements[t].position,s=this.playlistElements[n].position;r>s&&s--;let d=this.playlistElements[t];this.playlistElements.splice(t,1),this.playlistElements.splice(n,0,d),this.videoPlaylistService.reorderVideosOfPlaylist(this.playlist.id,r,s).subscribe({next:()=>{this.reorderClientPositions();},error:u=>this.notifier.handleError(u)});}onElementRemoved(e){let t=this.findFirst();this.playlistElements=this.playlistElements.filter(n=>n.id!==e.id),Dje(this.pagination),this.reorderClientPositions(t);}onNearOfBottom(){this.pagination.totalItems<=this.pagination.currentPage*this.pagination.itemsPerPage||(this.pagination.currentPage+=1,this.loadElements());}trackByFn(e,t){return t.id;}isRegularPlaylist(e){return e?.type.id===cIe.REGULAR;}showShareModal(){this.videoShareModal().show();}deleteVideoPlaylist(e){return L(this,null,function*(){(yield this.confirmService.confirm("Do you really want to delete "+e.displayName+"?","Delete"))!==false&&this.videoPlaylistService.removeVideoPlaylist(e).subscribe({next:()=>{this.router.navigate(["/my-library","video-playlists"]),this.notifier.success("Playlist "+e.displayName+" deleted.");},error:n=>this.notifier.handleError(n)});});}getDragStartDelay(){return this.screenService.isInTouchScreen()?500:null;}loadElements(){this.hooks.wrapObsFun(this.videoPlaylistService.getPlaylistVideos.bind(this.videoPlaylistService),{videoPlaylistId:this.videoPlaylistId,componentPagination:this.pagination},"my-library","filter:api.my-library.video-playlist-elements.list.params","filter:api.my-library.video-playlist-elements.list.result").subscribe({next:({total:e,data:t})=>{this.playlistElements=this.playlistElements.concat(t),this.pagination.totalItems=e,this.onDataSubject.next(t);},error:e=>{this.errored||(this.notifier.handleError(e),this.errored=true);}});}loadPlaylistInfo(){this.videoPlaylistService.getVideoPlaylist(this.videoPlaylistId).subscribe({next:e=>{this.playlist=e;},error:e=>{this.errored||(this.notifier.handleError(e),this.errored=true);}});}reorderClientPositions(e){if(this.playlistElements.length===0)return;let t=e||this.findFirst(),n=1;for(let s of this.playlistElements)s.position=n,n++;let r=this.findFirst();t&&r&&t.id!==r.id&&this.loadPlaylistInfo();}findFirst(){return this.playlistElements.find(e=>e.position===1);}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){t&1&&fx(n.videoShareModal,Ls,5),t&2&&DV();},decls:14,vars:5,consts:()=>{let e;e="Share";let t;t="No videos in this playlist.";let n;n="Browse videos on PeerTube to add them in your playlist.";let r;return r="See the "+"\uFFFD#7\uFFFD"+"documentation"+"\uFFFD/#7\uFFFD"+" for more information.",[["videoShareModal",""],e,t,n,r,[1,"root"],[1,"playlist-info"],["toManage","false","displayChannel","true","displayDescription","true","displayPrivacy","true",3,"playlist"],[1,"playlist-buttons"],["icon","share",1,"me-3",3,"click"],["label","More",3,"entry","actions"],[1,"playlist-elements"],[1,"no-results"],["myInfiniteScroller","","cdkDropList","",1,"videos",3,"nearOfBottom","cdkDropListDropped","dataObservable"],["cdkDrag","",1,"video",3,"cdkDragStartDelay"],[3,"playlist"],["target","_blank","href","https://docs.joinpeertube.org/use/library#playlist"],[3,"elementRemoved","playlistElement","playlist","owned","position"]];},template:function(t,n){t&1&&(sp(0,"div",5)(1,"div",6),_2(2,Ns,1,1,"my-video-playlist-miniature",7),sp(3,"div",8)(4,"my-button",9),Fp("click",function(){return n.showShareModal();}),yV(5,1),ub(),_2(6,Ds,1,2,"my-action-dropdown",10),ub()(),sp(7,"div",11),_2(8,ws,8,0,"div",12),sp(9,"div",13),Fp("nearOfBottom",function(){return n.onNearOfBottom();})("cdkDropListDropped",function(s){return n.drop(s);}),R2(10,xs,2,5,"div",14,n.trackByFn,true),ub()()(),Pp(12,"my-video-share",15,0)),t&2&&(zB(2),w2(n.playlist?2:-1),zB(4),w2(n.isRegularPlaylist(n.playlist)?6:-1),zB(2),w2(n.pagination.totalItems===0?8:-1),zB(),B0("dataObservable",n.onDataSubject.asObservable()),zB(),N2(n.playlistElements),zB(2),B0("playlist",n.playlist));},dependencies:[it,Q,Un,L$3,Rr,Or,Fi,Ti],styles:[".root[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto 1fr}.playlist-info[_ngcontent-%COMP%]{grid-column:1;display:flex;flex-direction:column;margin-inline-end:1rem}.playlist-buttons[_ngcontent-%COMP%]{display:flex;margin:30px 0 10px}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}.video[_ngcontent-%COMP%]:last-child{border:0}.videos.cdk-drop-list-dragging[_ngcontent-%COMP%]   .video[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.playlist-elements[_ngcontent-%COMP%]{grid-column:2}my-video-playlist-miniature[_ngcontent-%COMP%]{width:280px}@media screen and (max-width:800px){my-video-playlist-miniature[_ngcontent-%COMP%]{width:201px}}@media screen and (max-width:500px){.root[_ngcontent-%COMP%]{display:block}.playlist-info[_ngcontent-%COMP%]{width:calc(100% + 2 * var(--x-margin-content));padding-top:20px;margin-bottom:10px}my-video-playlist-miniature[_ngcontent-%COMP%], .playlist-buttons[_ngcontent-%COMP%]{margin-inline-start:auto;margin-inline-end:auto}  my-video-playlist-element-miniature .video{padding:5px!important}  my-video-playlist-element-miniature .position{margin-inline-end:.3125rem!important}}"],changeDetection:1});}return i;})();var Ys=i=>({"input-error":i}),Vs=i=>["/my-library/video-playlists/update",i];function $s(i,o){if(i&1&&(sp(0,"my-alert",14),KV(1),ub()),i&2){let e=bV();zB(),wx(e.error);}}function ks(i,o){i&1&&(sp(0,"li",21),yV(1,6),ub());}function Fs(i,o){if(i&1&&(sp(0,"a",41),KV(1),ub()),i&2){let e=bV(2);B0("routerLink",l$(2,Vs,e.videoPlaylistToUpdate?.shortUUID)),zB(),vb(" ",e.videoPlaylistToUpdate?.displayName," ");}}function Bs(i,o){if(i&1&&(sp(0,"li",21),yV(1,7),ub(),sp(2,"li",40),_2(3,Fs,2,4,"a",41),ub()),i&2){let e=bV();zB(3),w2(e.videoPlaylistToUpdate?3:-1);}}function zs(i,o){i&1&&(sp(0,"h2",22),yV(1,8),ub());}function Hs(i,o){i&1&&(sp(0,"h2",22),yV(1,9),ub());}function Us(i,o){if(i&1&&(sp(0,"div",30),KV(1),ub()),i&2){let e=bV();zB(),vb(" ",e.formErrors.displayName," ");}}function Gs(i,o){if(i&1&&(sp(0,"div",30),KV(1),ub()),i&2){let e=bV();zB(),wx(e.formErrors.privacy);}}function Ws(i,o){if(i&1&&(sp(0,"div",37)(1,"div"),yV(2,10),ub(),sp(3,"div"),yV(4,11),ub()()),i&2){let e=bV();zB(2),ax(e.getOwnerAccountDisplayName()),vV(2);}}function Xs(i,o){if(i&1&&(sp(0,"div",30),KV(1),ub()),i&2){let e=bV();zB(),wx(e.formErrors.videoChannelId);}}function js(i,o){i&1&&(sp(0,"div",25)(1,"my-peertube-checkbox",42),fb(2,43),sp(3,"span"),yV(4,12),ub(),Pp(5,"br"),sp(6,"span"),yV(7,13),ub(),kp(),ub(),GH(),ub()),i&2&&(zB(),WH());}var Lr=(()=>{class i extends At{formReactiveService=g(w);authService=g(Xe);notifier=g(rc$1);router=g(mt);route=g(jr$1);videoPlaylistService=g(Z);serverService=g($t);error;paramsSub;ngOnInit(){this.buildForm({displayName:Y,privacy:H,description:q,videoChannelId:w$1,thumbnailfile:null}),this.form.get("privacy").valueChanges.subscribe(e=>{G(this.form.get("videoChannelId"),e);}),this.paramsSub=this.authService.userInformationLoaded.pipe(ze(),Oe(()=>this.route.params),$(e=>e.videoPlaylistId),Oe(e=>R1([this.videoPlaylistService.getVideoPlaylist(e).pipe(Oe(t=>ae({authService:this.authService,includeCollaborations:true}).pipe($(n=>({videoPlaylist:t,channels:n}))))),this.serverService.getVideoPlaylistPrivacies()]))).subscribe({next:([{videoPlaylist:e,channels:t},n])=>{this.videoPlaylistToUpdate=e,this.videoPlaylistPrivacies=n,this.channels=t.filter(r=>r.ownerAccountId===this.videoPlaylistToUpdate.ownerAccount.id),this.hydrateFormFromPlaylist();},error:e=>{this.error=e.message;}});}ngOnDestroy(){this.paramsSub&&this.paramsSub.unsubscribe();}formValidated(){this.error=void 0;let e=this.form.value,t={displayName:e.displayName,privacy:e.privacy,description:e.description||null,videoChannelId:e.videoChannelId||null,thumbnailfile:e.thumbnailfile||void 0};this.videoPlaylistService.updateVideoPlaylist(this.videoPlaylistToUpdate,t).subscribe({next:()=>{this.notifier.success("Playlist "+t.displayName+" updated."),this.router.navigate(["/my-library","video-playlists"]);},error:n=>{this.error=n.message;}});}isCreation(){return false;}getFormButtonTitle(){return"Update";}isEditor(){return this.videoPlaylistToUpdate?this.videoPlaylistToUpdate?.ownerAccount.id!==this.authService.getUser().account.id:false;}getOwnerAccountDisplayName(){return this.videoPlaylistToUpdate?.ownerAccount.displayName;}hydrateFormFromPlaylist(){this.form.patchValue({displayName:this.videoPlaylistToUpdate.displayName,privacy:this.videoPlaylistToUpdate.privacy.id,description:this.videoPlaylistToUpdate.description,videoChannelId:this.videoPlaylistToUpdate.videoChannel?this.videoPlaylistToUpdate.videoChannel.id:null}),fetch(this.videoPlaylistToUpdate.getThumbnailUrl(223)).then(e=>e.blob()).then(e=>{this.form.patchValue({thumbnailfile:e});});}static ɵfac=(()=>{let e;return function(n){return(e||(e=Uu(i)))(n||i);};})();static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],features:[I0],decls:41,vars:18,consts:()=>{let e;e="Edit";let t;t="Spelelistene mine";let n;n="Playlist thumbnail";let r;r="Display name";let s;s="Skildring";let d;d="Privacy";let u;u="Channel";let S;S="Create";let v;v="Edit";let R;R="NEW PLAYLIST";let oe;oe="UPDATE PLAYLIST";let Le;Le=" Only "+"\uFFFD0\uFFFD"+"'s channels are listed ";let nt;nt=" Changing the owner of a playlist is not supported ";let ot;ot="Insert at the first position in your channel's playlist list";let q;q="Playlists can be manually sorted in your channel.";let rt;return rt="By default, new playlists are added at the end of the list.",[t,n,r,s,d,u,S,v,R,oe,Le,nt,q,rt,["type","danger"],[1,"pt-two-cols"],[1,"title-col"],["aria-label","breadcrumb"],[1,"pt-breadcrumb"],[1,"breadcrumb-item"],["routerLink","/my-library/video-playlists"],[1,"breadcrumb-item","active"],[1,"visually-hidden"],[1,"content-col"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","thumbnailfile"],["inputLabel",e,"inputName","thumbnailfile","formControlName","thumbnailfile"],["for","displayName"],["type","text","id","displayName","formControlName","displayName",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["for","description"],["helpType","markdownText"],["inputId","description","formControlName","description",3,"formError"],["for","privacy"],["inputId","privacy","formControlName","privacy",3,"items"],["for","videoChannelId"],[1,"form-group-description"],["inputId","videoChannelId","formControlName","videoChannelId",3,"items"],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],["aria-current","page",1,"breadcrumb-item","active"],[3,"routerLink"],["inputName","insertAtFirstPosition","formControlName","insertAtFirstPosition","labelText",ot],["ngProjectAs","description",5,["description"]]];},template:function(t,n){t&1&&(_2(0,$s,2,1,"my-alert",14),sp(1,"div",15)(2,"div",16)(3,"nav",17)(4,"ol",18)(5,"li",19)(6,"a",20),yV(7,0),ub()(),_2(8,ks,2,0,"li",21)(9,Bs,4,1),ub()(),_2(10,zs,2,0,"h2",22)(11,Hs,2,0,"h2",22),ub(),sp(12,"div",23)(13,"form",24),Fp("ngSubmit",function(){return n.formValidated();}),sp(14,"div",25)(15,"label",26),yV(16,1),ub(),Pp(17,"my-image-input",27),GH(),ub(),sp(18,"div",25)(19,"label",28),yV(20,2),ub(),Pp(21,"input",29),GH(),_2(22,Us,2,1,"div",30),ub(),sp(23,"div",25)(24,"label",31),yV(25,3),ub(),Pp(26,"my-help",32)(27,"my-markdown-textarea",33),GH(),ub(),sp(28,"div",25)(29,"label",34),yV(30,4),ub(),Pp(31,"my-select-options",35),GH(),_2(32,Gs,2,1,"div",30),ub(),sp(33,"div",25)(34,"label",36),yV(35,5),ub(),_2(36,Ws,5,1,"div",37),Pp(37,"my-select-channel-user",38),GH(),_2(38,Xs,2,1,"div",30),ub(),_2(39,js,8,0,"div",25),Pp(40,"input",39),ub()()()),t&2&&(w2(n.error?0:-1),zB(8),w2(n.isCreation()?8:9),zB(2),w2(n.isCreation()?10:11),zB(3),B0("formGroup",n.form),zB(4),WH(),zB(4),B0("ngClass",l$(16,Ys,n.formErrors.displayName)),WH(),zB(),w2(n.formErrors.displayName?22:-1),zB(5),B0("formError",n.formErrors.description),WH(),zB(4),B0("items",n.videoPlaylistPrivacies),WH(),zB(),w2(n.formErrors.privacy?32:-1),zB(4),w2(n.isEditor()?36:-1),zB(),B0("items",n.channels),WH(),zB(),w2(n.formErrors.videoChannelId?38:-1),zB(),w2(n.isCreation()&&n.form.value.videoChannelId?39:-1),zB(),B0("value",r$(n.getFormButtonTitle()))("disabled",!n.form.valid));},dependencies:[cl$1,w3,Xh,Jn,Zn,Je,qn,$n,Qn,Vn,yn,me,U,Je$1,Yl$1,Ae,v,Me$1],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-channel-user[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%]{display:block;max-width:340px}.content-col[_ngcontent-%COMP%]{max-width:500px}my-image-input[_ngcontent-%COMP%]{width:223px;height:122px}"],changeDetection:1});}return i;})();var Dr=J(_o());var Qs=i=>({active:i}),qs=i=>({"is-rtl":i}),Zs=i=>({"has-collaborator-state":i});function Ks(i,o){i&1&&Pp(0,"my-collaborator-state",4);}function Js(i,o){i&1&&Pp(0,"my-collaborator-state",5);}function el(i,o){if(i&1&&_2(0,Ks,1,0,"my-collaborator-state",4)(1,Js,1,0,"my-collaborator-state",5),i&2){let e=bV();w2(e.user.isEditorOfChannel(e.channel())?0:1);}}var Ni=(()=>{class i{authService=g(Xe);localeId=g(an$1);checked=_pe(false);channel=qp.required();inputName=qp(void 0);label=qp("Toggle this channel");get user(){return this.authService.getUser();}isRTL(){return o3(this.localeId)==="rtl";}propagateChange=e=>{};writeValue(e){this.checked.set(e);}registerOnChange(e){this.propagateChange=e;}registerOnTouched(){}toggle(){this.checked.set(!this.checked()),this.propagateChange(this.checked());}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-channel-toggle"]],inputs:{checked:[1,"checked"],channel:[1,"channel"],inputName:[1,"inputName"],label:[1,"label"]},outputs:{checked:"checkedChange"},features:[c$([{provide:D$1,useExisting:af(()=>i),multi:true}])],decls:6,vars:15,consts:[[1,"root","button-unstyle",3,"click","title"],["actorType","channel","size","34",3,"actor"],[1,"info",3,"ngClass"],[1,"name"],["small","true","type","accepted"],["small","true","type","owner"]],template:function(t,n){t&1&&(sp(0,"button",0),Fp("click",function(){return n.toggle();}),Pp(1,"my-actor-avatar",1),sp(2,"div",2)(3,"div",3),KV(4),ub(),_2(5,el,2,1),ub()()),t&2&&(BV(l$(9,Qs,n.checked())),B0("title",n.label()),zB(),BV(l$(11,qs,n.isRTL())),B0("actor",n.channel()),zB(),B0("ngClass",l$(13,Zs,n.user.isCollaboratingToChannels())),zB(2),wx(n.channel().displayName),zB(),w2(n.user.isCollaboratingToChannels()?5:-1));},dependencies:[cl$1,w3,fe$2,H$3],styles:[".root[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;text-align:start;line-height:1.2;padding-inline-start:17px}.root[_ngcontent-%COMP%]:hover{opacity:.9}.info[_ngcontent-%COMP%]{border-radius:4px;background-color:var(--bg-secondary-400);max-width:150px;padding-top:.75rem;padding-bottom:.75rem;padding-inline-start:25px;padding-inline-end:1rem}.info[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{color:var(--fg-400);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.875rem}.info.has-collaborator-state[_ngcontent-%COMP%]{padding-top:.5rem;padding-bottom:.5rem}my-actor-avatar[_ngcontent-%COMP%]{position:absolute;border:2px solid var(--bg-secondary-400);border-radius:5px}my-actor-avatar.is-rtl[_ngcontent-%COMP%]{right:0}my-actor-avatar[_ngcontent-%COMP%]:not(.is-rtl){left:0}.root.active[_ngcontent-%COMP%]   .info[_ngcontent-%COMP%]{background-color:var(--bg-secondary-450)}.root.active[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{font-weight:700}.root.active[_ngcontent-%COMP%]   my-actor-avatar[_ngcontent-%COMP%]{border-color:var(--bg-secondary-450);background-color:var(--bg-secondary-450)}"],changeDetection:1});}return i;})();var tl=["table"],il=i=>["/my-library/video-playlists",i],nl=i=>["/c",i],ol=i=>["update",i],rl=(i,o)=>o.id;function al(i,o){if(i&1){let e=k2();sp(0,"my-channel-toggle",18),Mx("ngModelChange",function(n){let r=$I(e).$implicit;return e$(r.selected,n)||(r.selected=n),GI(n);}),Fp("ngModelChange",function(){let n=$I(e).$implicit,r=bV();return GI(r.onChannelFilter(n));}),ub(),GH();}if(i&2){let e=o.$implicit;B0("channel",e),Nx("ngModel",e.selected),WH();}}function sl(i,o){if(i&1&&(fb(0),yV(1,9),v$(2,"myNumberFormatter"),kp()),i&2){let e=bV().$implicit,t=bV();zB(2),ax(e)(b$(2,3,e))(t.getFilteredChannel().displayName),vV(1);}}function ll(i,o){if(i&1&&(fb(0),yV(1,10),v$(2,"myNumberFormatter"),kp()),i&2){let e=bV().$implicit;zB(2),ax(e)(b$(2,2,e)),vV(1);}}function cl(i,o){if(i&1&&_2(0,sl,3,5,"ng-container")(1,ll,3,4,"ng-container"),i&2){let e=bV();w2(e.getFilteredChannel()?0:1);}}function dl(i,o){i&1&&(sp(0,"a",19),Pp(1,"my-global-icon",20),fb(2),yV(3,11),kp(),ub());}function _l(i,o){if(i&1&&(sp(0,"td",21),KV(1),ub()),i&2){let e=bV().$implicit;zB(),vb(" ",e.videoChannelPosition," ");}}function pl(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-playlist-miniature",22),ub()),i&2){let e=bV().$implicit;zB(),B0("playlist",e);}}function ml(i,o){i&1&&Pp(0,"my-collaborator-state",26);}function ul(i,o){i&1&&Pp(0,"my-collaborator-state",27);}function hl(i,o){if(i&1&&_2(0,ml,1,0,"my-collaborator-state",26)(1,ul,1,0,"my-collaborator-state",27),i&2){let e=bV(3).$implicit,t=bV();w2(t.user.isOwnerOfChannel(e.videoChannel)?0:t.user.isEditorOfChannel(e.videoChannel)?1:-1);}}function gl(i,o){if(i&1&&(sp(0,"a",25)(1,"span"),KV(2),ub(),_2(3,hl,2,1),ub()),i&2){let e=bV(2).$implicit,t=bV();B0("routerLink",l$(3,nl,e.videoChannel.name)),zB(2),wx(e.videoChannel.displayName),zB(),w2(t.user.isCollaboratingToChannels()?3:-1);}}function fl(i,o){if(i&1&&(sp(0,"td")(1,"div",23)(2,"a",24),KV(3),ub(),_2(4,gl,4,5,"a",25),ub()()),i&2){let e=bV().$implicit;zB(2),B0("routerLink",l$(3,il,e.shortUUID)),zB(),vb(" ",e.displayName," "),zB(),w2(e.videoChannel?4:-1);}}function Cl(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-privacy-badge",28),ub()),i&2){let e=bV().$implicit;zB(),B0("playlist",e);}}function Sl(i,o){if(i&1&&(sp(0,"td"),KV(1),v$(2,"ptDate"),ub()),i&2){let e=bV().$implicit;zB(),vb(" ",S$(2,1,e.updatedAt,"short")," ");}}function yl(i,o){if(i&1&&(_2(0,_l,2,1,"td",21),_2(1,pl,2,1,"td"),_2(2,fl,5,5,"td"),_2(3,Cl,2,1,"td"),_2(4,Sl,3,4,"td")),i&2){bV();let e=IV(9);w2(e.isColumnDisplayed("videoChannelPosition")?0:-1),zB(),w2(e.isColumnDisplayed("videos")?1:-1),zB(),w2(e.isColumnDisplayed("name")?2:-1),zB(),w2(e.isColumnDisplayed("privacy")?3:-1),zB(),w2(e.isColumnDisplayed("updatedAt")?4:-1);}}function vl(i,o){if(i&1){let e=k2();Pp(0,"my-edit-button",29),sp(1,"my-delete-button",30),Fp("click",function(){$I(e);let n=bV().$implicit,r=bV();return GI(r.deleteVideoPlaylist(n));}),ub();}if(i&2){let e=bV().$implicit;B0("ptRouterLink",l$(1,ol,e.shortUUID));}}function El(i,o){if(i&1&&_2(0,vl,2,3),i&2){let e=o.$implicit,t=bV();w2(t.isRegularPlaylist(e)?0:-1);}}function Ml(i,o){if(i&1&&KV(0),i&2){let e=o.$implicit;vb(" ",e.description," ");}}function Pl(i,o){if(i&1&&KV(0),i&2){let e=o.search,t=o.hasFilters,n=bV();vb(" ",n.getNoResults(!!e||t)," ");}}var Nr=(0,Dr.default)("peertube:my-video-playlists"),wr=(()=>{class i{notifier=g(rc$1);confirmService=g(ag);videoPlaylistService=g(Z);auth=g(Xe);headerService=g(kk);cdr=g(Cs$1);screenService=g(pg);table=wpe("table");user;channels=[];onDataSubject=new Z$1();columns=[];customUpdateUrl;customParseQueryParams;dataLoader;hasExpandedRow;playlistsAfterDrop=[];playlistsBeforeDrop=[];paginationStart=0;constructor(){this.customUpdateUrl=this._customUpdateUrl.bind(this),this.customParseQueryParams=this._customParseQueryParams.bind(this),this.dataLoader=this._dataLoader.bind(this),this.hasExpandedRow=this._hasExpandedRow.bind(this);}ngOnInit(){this.headerService.setSearchHidden(true),this.user=this.auth.getUser(),this.columns=[{id:"videoChannelPosition",label:"Position",selected:true,sortable:true,isDisplayed:()=>this.hasReorderableRows()},{id:"videos",label:"Videos",selected:true,sortable:false},{id:"name",label:"Name",selected:true,sortable:true},{id:"privacy",label:"Privacy",selected:true,sortable:false},{id:"updatedAt",label:"Updated",selected:true,sortable:true}];}ngOnDestroy(){this.headerService.setSearchHidden(false);}_customParseQueryParams(e){this.user=this.auth.getUser(),this.channels=[...this.user.videoChannels,...this.user.videoChannelCollaborations].map(t=>E(D({},t),{selected:e.channelName===t.name})),this.cdr.detectChanges();}getNoResults(e){return e?"No playlists found matching your filters.":this.getFilteredChannel()?"No playlists found in selected channels.":"You don't have any playlists published yet.";}_customUpdateUrl(){return{channelName:this.getFilteredChannel()?.name};}deleteVideoPlaylist(e){return L(this,null,function*(){(yield this.confirmService.confirm("Do you really want to delete "+e.displayName+"?","Delete"))!==false&&this.videoPlaylistService.removeVideoPlaylist(e).subscribe({next:()=>{this.table().loadData(),this.notifier.success("Playlist "+e.displayName+" deleted.");},error:n=>this.notifier.handleError(n)});});}isRegularPlaylist(e){return e.type.id===cIe.REGULAR;}onRowReorder(e){let{dragIndex:t,dropIndex:n}=e,r=t-this.paginationStart,s=n-this.paginationStart,d=this.playlistsBeforeDrop[r],u=this.playlistsBeforeDrop[s];if(Nr("onRowReorder",{previousIndex:r,newIndex:s,dragPlaylist:d,dropAfterPlaylist:u}),r===s)return;let S=d.videoChannelPosition,v=u.videoChannelPosition;S>v&&v--,Nr("Will reorder",{oldPosition:S,insertAfter:v});for(let R=1;R<=this.playlistsAfterDrop.length;R++)this.playlistsAfterDrop[R-1].videoChannelPosition=R+this.paginationStart;this.videoPlaylistService.reorderPlaylistsOfChannel(this.getFilteredChannel().name,S,v).subscribe({next:()=>{this.table().loadData({skipLoader:!this.screenService.isInTouchScreen()}),this.notifier.success("Playlists reordered");},error:R=>this.notifier.handleError(R)});}onChannelFilter(e){for(let t of this.channels)t.id!==e.id&&(t.selected=false);this.table().onFiltersChange();}hasReorderableRows(){return!!this.getFilteredChannel();}_dataLoader(e){let{pagination:t,sort:n,search:r}=e;this.paginationStart=t.start;let s=this.getFilteredChannel();return(s?this.videoPlaylistService.listChannelPlaylists({videoChannel:{nameWithHost:Rc.CREATE_BY_STRING(s.name,s.host)},includeCollaborations:true,restPagination:t,sort:n,search:r}):this.videoPlaylistService.listAccountPlaylists({account:this.user.account,includeCollaborations:true,restPagination:t,sort:n,search:r})).pipe(lt(({data:u})=>{this.playlistsAfterDrop=u,this.playlistsBeforeDrop=[...u];}));}_hasExpandedRow(e){return!!e.description;}getFilteredChannel(){return this.channels.find(e=>e.selected);}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],viewQuery:function(t,n){t&1&&fx(n.table,tl,5),t&2&&DV();},decls:22,vars:6,consts:()=>{let e;e="playlists per page";let t;t="Drag and drop this row to reorder playlists in your channel";let n;n="Filter by a channel";let r;r="This allows you to reorder playlists assigned to it";let s;s="{VAR_PLURAL, plural, =0 {No playlist} =1 {1 playlist} other {{INTERPOLATION} playlists}}",s=EV(s,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let d;d=""+s+" in "+"\uFFFD2\uFFFD"+" channel";let u;u="{VAR_PLURAL, plural, =0 {No playlist} =1 {1 playlist} other {{INTERPOLATION} playlists}}",u=EV(u,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let S;return S="Create playlist",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],n,r,d,u,S,[1,"form-group"],[1,"label"],[1,"form-group-description"],[1,"channel-filters"],[3,"channel","ngModel"],["key","MyVideoPlaylistsComponent","defaultSort","updatedAt","paginatorText",e,"defaultRowsPerPage","10","columnConfig","false","searchInput","true","dragHandleTitle",t,3,"rowReorder","defaultColumns","dataLoader","customParseQueryParams","customUpdateUrl","hasExpandedRow","reorderableRows"],[3,"ngModelChange","channel","ngModel"],["routerLink","create",1,"peertube-create-button"],["iconName","add","aria-hidden","true"],[2,"width","10px"],["thumbnailOnly","true","toManage","true",3,"playlist"],[1,"name-container"],[1,"name",3,"routerLink"],[1,"channel-sub-link-in-cell",3,"routerLink"],["type","owner","small","true",1,"ms-2"],["type","accepted","small","true",1,"ms-2"],[3,"playlist"],["label","",3,"ptRouterLink"],["label","",3,"click"]];},template:function(t,n){t&1&&(sp(0,"div",12)(1,"div",13),yV(2,7),ub(),sp(3,"div",14),yV(4,8),ub(),sp(5,"div",15),R2(6,al,1,2,"my-channel-toggle",16,rl),ub()(),sp(8,"my-table",17,0),Fp("rowReorder",function(s){return n.onRowReorder(s);}),_0(10,cl,2,1,"ng-template",null,1,D$)(12,dl,4,0,"ng-template",null,2,D$)(14,yl,5,5,"ng-template",null,3,D$)(16,El,1,1,"ng-template",null,4,D$)(18,Ml,1,1,"ng-template",null,5,D$)(20,Pl,1,1,"ng-template",null,6,D$),ub()),t&2&&(zB(6),N2(n.channels),zB(2),B0("defaultColumns",n.columns)("dataLoader",n.dataLoader)("customParseQueryParams",n.customParseQueryParams)("customUpdateUrl",n.customUpdateUrl)("hasExpandedRow",n.hasExpandedRow)("reorderableRows",n.hasReorderableRows()));},dependencies:[Jn,qn,ln$1,Tr$1,Xh,Q,h,c$1,Ni,Lh,Un$1,br,H$3,d$1,p$1],styles:[".channel-filters[_ngcontent-%COMP%]{display:flex;align-items:center;padding-bottom:1rem;border-bottom:1px solid var(--bg-secondary-400);margin-bottom:1rem;gap:1rem;overflow:hidden}.channel-filters[_ngcontent-%COMP%]:hover{overflow:auto}.name[_ngcontent-%COMP%]{color:var(--fg);line-height:1rem;font-weight:700;text-decoration:none}.name-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}my-video-playlist-miniature[_ngcontent-%COMP%]{display:block;width:130px}"],changeDetection:1});}return i;})();var xr=(()=>{class i{serverService=g($t);newFeatureInfoService=g(Ri);menuEntries=[];serverConfig;ngOnInit(){this.serverConfig=this.serverService.getHTMLConfig(),this.buildMenu(),this.newFeatureInfoService.showChannelCollaboration();}buildMenu(){this.menuEntries=[{label:"Manage my videos",routerLink:"/my-library/videos"},{label:"Comments",routerLink:"/my-library/comments-on-my-videos",children:[{label:"Comments on my videos",routerLink:"/my-library/comments-on-my-videos"},{label:"Watched words",routerLink:"/my-library/watched-words/list"},{label:"Watched words subscriptions",routerLink:"/my-library/watched-words/subscriptions"},{label:"Auto tag policies",routerLink:"/my-library/auto-tag-policies"}]},{label:"More",routerLink:this.isVideoImportEnabled()?"/my-library/video-imports":"/my-library/ownership",children:[{label:"Imports",routerLink:"/my-library/video-imports",isDisplayed:()=>this.isVideoImportEnabled()},{label:"Ownership changes",routerLink:"/my-library/ownership"}]}];}isVideoImportEnabled(){let e=this.serverConfig.import.videos;return e.http.enabled||e.torrent.enabled;}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:8,vars:1,consts:()=>{let e;e="My videos";let t;return t="Skip the sub menu",[["myVideoSpaceContent",""],t,[1,"root"],[1,"margin-content"],["href","#my-video-space-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],["h1Icon","videos","h1",e,3,"menuEntries"],["tabindex","-1","id","my-video-space-content",1,"margin-content","pb-5","outline-0"]];},template:function(t,n){if(t&1){let r=k2();sp(0,"div",2)(1,"div",3)(2,"a",4),Fp("click",function(d){$I(r);let u=IV(6);return d.preventDefault(),GI(u.focus());}),yV(3,1),ub(),Pp(4,"my-horizontal-menu",5),ub(),sp(5,"div",6,0),Pp(7,"router-outlet"),ub()();}t&2&&(zB(4),B0("menuEntries",n.menuEntries));},dependencies:[kS,hn],encapsulation:2,changeDetection:1});}return i;})();var Yr=J(_o());var Il=["modal"];function Tl(i,o){i&1&&Pp(0,"my-collaborator-state",20);}function Ol(i,o){i&1&&Pp(0,"my-collaborator-state",21);}function Rl(i,o){if(i&1&&_2(0,Tl,1,0,"my-collaborator-state",20)(1,Ol,1,0,"my-collaborator-state",21),i&2){let e=bV().$implicit,t=bV(2);w2(t.user.isOwnerOfChannel(e.videoChannel)?0:t.user.isEditorOfChannel(e.videoChannel)?1:-1);}}function bl(i,o){if(i&1){let e=k2();sp(0,"div",12)(1,"my-peertube-checkbox",19),Mx("ngModelChange",function(n){let r=$I(e).$implicit,s=bV(2);return e$(s.playlistsEnabled[r.id],n)||(s.playlistsEnabled[r.id]=n),GI(n);}),ub(),GH(),_2(2,Rl,2,1),ub();}if(i&2){let e=o.$implicit,t=bV(2);zB(),B0("inputName",t.getPrimaryInputName(e)),Nx("ngModel",t.playlistsEnabled[e.id]),B0("labelText",e.displayName),WH(),zB(),w2(t.user.isCollaboratingToChannels()?2:-1);}}function Al(i,o){if(i&1){let e=k2();sp(0,"my-playlist-create-block",22),Fp("playlistCreated",function(){$I(e);let n=bV(2);return GI(n.onPlaylistCreated());}),ub();}}function Ll(i,o){if(i&1){let e=k2();sp(0,"div",4)(1,"h4",5),yV(2,1),ub(),sp(3,"button",6),Fp("click",function(){$I(e);let n=bV();return GI(n.hide());}),Pp(4,"my-global-icon",7),ub()(),sp(5,"div",8)(6,"div",9)(7,"input",10),Mx("ngModelChange",function(n){$I(e);let r=bV();return e$(r.videoPlaylistSearch,n)||(r.videoPlaylistSearch=n),GI(n);}),Fp("ngModelChange",function(){$I(e);let n=bV();return GI(n.onVideoPlaylistSearchChanged());}),ub(),GH(),ub(),sp(8,"div",11),R2(9,bl,3,4,"div",12,A2),ub(),sp(11,"button",13),Fp("click",function(){$I(e);let n=bV();return GI(n.isNewPlaylistBlockOpened=true);}),Pp(12,"my-global-icon",14),sp(13,"span"),yV(14,2),ub()(),_2(15,Al,1,0,"my-playlist-create-block",15),ub(),sp(16,"div",16)(17,"input",17),Fp("click",function(){$I(e);let n=bV();return GI(n.hide());})("key.enter",function(){$I(e);let n=bV();return GI(n.hide());}),ub(),sp(18,"my-button",18),Fp("click",function(){$I(e);let n=bV();return GI(n.save());}),yV(19,3),ub()();}if(i&2){let e=bV();zB(7),Nx("ngModel",e.videoPlaylistSearch),WH(),zB(2),N2(e.currentPlaylists),zB(2),B0("hidden",e.isNewPlaylistBlockOpened),zB(4),w2(e.isNewPlaylistBlockOpened?15:-1),zB(3),B0("loading",e.updatingPlaylists)("disabled",e.updatingPlaylists);}}var Nl=(0,Yr.default)("peertube:playlists:BulkUpdateVideosInPlaylistModalComponent"),Vr=(()=>{class i{authService=g(Xe);notifier=g(rc$1);videoPlaylistService=g(Z);modalService=g(rr$1);saved=Cpe();videos;videoPlaylistSearch;videoPlaylistSearchChanged=new Z$1();seenPlaylists={};currentPlaylists=[];elementsPerPlaylist={};playlistsEnabled={};initialPlaylistsEnabled={};isNewPlaylistBlockOpened=false;updatingPlaylists=false;modal=wpe("modal");openedModal;videosContainedInPlaylists;listenToAccountPlaylistsChangeSub;get user(){return this.authService.getUser();}get videoIds(){return this.videos.map(e=>e.id);}ngOnInit(){this.videoPlaylistService.listMyPlaylistWithCache(this.user,this.videoPlaylistSearch).subscribe(e=>this.currentPlaylists=e.data),this.listenToAccountPlaylistsChangeSub=this.videoPlaylistService.listenToMyAccountPlaylistsChange().subscribe(e=>{this.currentPlaylists=e.data,this.rebuildPlaylists();}),this.videoPlaylistSearchChanged.pipe(ta$1(500),Oe(()=>this.videoPlaylistService.listMyPlaylistWithCache(this.user,this.videoPlaylistSearch))).subscribe(({data:e})=>{this.currentPlaylists=e,this.rebuildPlaylists();});}ngOnDestroy(){this.listenToAccountPlaylistsChangeSub?.unsubscribe();}show(e){this.videos=e.videos,this.videosContainedInPlaylists=e.videosContainedInPlaylists,this.elementsPerPlaylist={},this.playlistsEnabled={},this.initialPlaylistsEnabled={},this.isNewPlaylistBlockOpened=false,this.rebuildPlaylists(),this.openedModal=this.modalService.open(this.modal(),{centered:true,keyboard:false});}hide(){this.openedModal.close();}rebuildPlaylists(){if(this.videosContainedInPlaylists){for(let e of this.currentPlaylists)this.elementsPerPlaylist[e.id]=[],this.seenPlaylists[e.id]=e;for(let[e,t]of Object.entries(this.videosContainedInPlaylists))for(let n of t)this.elementsPerPlaylist[n.playlistId]&&this.elementsPerPlaylist[n.playlistId].push({videoId:+e,playlistElementId:n.playlistElementId});for(let[e,t]of Object.entries(this.elementsPerPlaylist)){let n=+e;this.playlistsEnabled[n]===void 0&&(this.playlistsEnabled[n]=E_e(t.map(r=>r.videoId)).length===this.videoIds.length,this.initialPlaylistsEnabled[n]=this.playlistsEnabled[n]);}Nl("Rebuilt playlists, enabled playlists:",this.playlistsEnabled);}}onVideoPlaylistSearchChanged(){this.videoPlaylistSearchChanged.next();}getPrimaryInputName(e){return"videos-update-playlist-"+e.id;}save(){let e=[];this.updatingPlaylists=true;for(let[t,n]of Object.entries(this.playlistsEnabled)){let r=+t,s=this.seenPlaylists[r],d=this.initialPlaylistsEnabled[r];n&&!d?e.push(this.addVideosInPlaylist(s)):!n&&d&&e.push(this.removeVideosFromPlaylist(s));}if(e.length===0){this.updatingPlaylists=false,this.notifier.info("No change to save"),this.hide();return;}_r$1(...e).subscribe({next:t=>{t.type==="success"?this.notifier.success(t.message):this.notifier.error(t.message);},error:t=>this.notifier.handleError(t),complete:()=>{this.updatingPlaylists=false,this.hide(),this.saved.emit(this.videos);}});}addVideosInPlaylist(e){let t=new Set(this.elementsPerPlaylist[e.id].map(r=>r.videoId)),n=this.videos.filter(r=>!t.has(r.id)).map(r=>({videoId:r.id}));return this.videoPlaylistService.addVideoInPlaylist(e.id,n).pipe($(r=>({type:"success",message:DAe("{count, plural, =1 {Video added} other {{count} videos added}} to ",{count:r.length,playlistName:e.displayName})})),fe$1(r=>L$1({type:"error",message:r.message})));}removeVideosFromPlaylist(e){return this.videoPlaylistService.removeElementsFromPlaylist({playlistId:e.id,elements:this.elementsPerPlaylist[e.id].map(t=>({playlistElementId:t.playlistElementId,videoId:t.videoId}))}).pipe($(t=>({type:"success",message:DAe("{count, plural, =1 {Video removed} other {{count} videos removed}} from ",{count:t.length,playlistName:e.displayName})})),fe$1(t=>L$1({type:"error",message:t.message})));}onPlaylistCreated(){this.isNewPlaylistBlockOpened=false,this.rebuildPlaylists();}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-bulk-update-videos-in-playlist-modal"]],viewQuery:function(t,n){t&1&&fx(n.modal,Il,5),t&2&&DV();},outputs:{saved:"saved"},decls:2,vars:0,consts:()=>{let e;e="Close this modal";let t;t="S\xF8k i spelelister";let n;n="Cancel";let r;r="Update videos in playlists";let s;s="Create a private playlist";let d;return d="Save",[["modal",""],r,s,d,[1,"modal-header"],[1,"modal-title"],["title",e,1,"border-0","p-0",3,"click"],["iconName","cross"],[1,"modal-body"],[1,"mb-4"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"playlists"],[1,"playlist","d-flex","gap-2","mb-2"],[1,"mt-4","peertube-button","secondary-button",3,"click","hidden"],["iconName","add","aria-hidden","true"],[1,"d-block","mt-3","pt-3"],[1,"modal-footer","inputs"],["type","button","role","button","value",n,1,"peertube-button","secondary-button",3,"click","key.enter"],["theme","primary",3,"click","loading","disabled"],[3,"ngModelChange","inputName","ngModel","labelText"],["type","owner","small","true",1,"ms-2"],["type","accepted","small","true",1,"ms-2"],[1,"d-block","mt-3","pt-3",3,"playlistCreated"]];},template:function(t,n){t&1&&_0(0,Ll,20,5,"ng-template",null,0,D$);},dependencies:[Jn,Je,qn,ln$1,Me$1,Tr$1,H$3,it,re$1],styles:["my-peertube-checkbox[_ngcontent-%COMP%]{align-self:center;margin-inline-end:.625rem}.display-name[_ngcontent-%COMP%]{display:flex;align-items:flex-end;flex-grow:1;margin:0;font-weight:400;cursor:pointer;font-size:1rem}my-playlist-create-block[_ngcontent-%COMP%]{border-top:1px solid var(--bg-secondary-400)}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:100%;max-width:100%;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width: calc(100% + 40px)){input[type=text][_ngcontent-%COMP%]{width:100%}}"],changeDetection:1});}return i;})();function Dl(i,o){if(i&1&&(sp(0,"span",0),KV(1),ub()),i&2){let e=bV();B0("ngClass",e.badgeClass),zB(),wx(e.label);}}var $r=(()=>{class i{video=qp.required();label;badgeClass;ngOnChanges(){this.buildBadgeAndLabel();}buildBadgeAndLabel(){let e=this.video();if(!e.state){this.label="";return;}let t=e.state.id;switch(this.badgeClass=rl$1(e.state.id),t){case Pl$1.PUBLISHED:if(e.privacy.id===Zt.PRIVATE){this.label="In your library",this.badgeClass="badge-grey";return;}if(e.privacy.id===Zt.INTERNAL){this.label="Internal",this.badgeClass="badge-blue";return;}this.label=ll$1(e.state.id);return;case Pl$1.TO_TRANSCODE:this.label=this.video().waitTranscoding===true?"Waiting transcoding":"To transcode";return;default:this.label=ll$1(e.state.id);}}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-video-state-badge"]],inputs:{video:[1,"video"]},features:[ti],decls:1,vars:1,consts:[[1,"pt-badge",3,"ngClass"]],template:function(t,n){t&1&&_2(0,Dl,2,2,"span",0),t&2&&w2(n.label?0:-1);},dependencies:[cl$1,w3],encapsulation:2,changeDetection:1});}return i;})();var wl=["table"],xl=["bulkUpdateVideosInPlaylistModal"],Yl=["bulkUpdateVideosModal"],Vl=i=>({tagsOneOf:i}),$l=i=>({privacyOneOf:i}),kl=i=>["/videos/manage",i,"stats"],Fl=()=>[],Bl=i=>["/w/p/",i],zl=i=>["/videos","manage",i],Hl=(i,o)=>o.id;function Ul(i,o){if(i&1){let e=k2();sp(0,"my-channel-toggle",18),Mx("ngModelChange",function(n){let r=$I(e).$implicit;return e$(r.selected,n)||(r.selected=n),GI(n);}),Fp("ngModelChange",function(){$I(e),bV();let n=IV(6);return GI(n.onFiltersChange());}),ub(),GH();}if(i&2){let e=o.$implicit;B0("channel",e),Nx("ngModel",e.selected),WH();}}function Gl(i,o){if(i&1&&(fb(0),yV(1,8),v$(2,"myNumberFormatter"),kp()),i&2){let e=o.$implicit;zB(2),ax(e)(b$(2,2,e)),vV(1);}}function Wl(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-cell",19),ub()),i&2){let e=bV().$implicit;zB(),B0("video",e);}}function Xl(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-cell",20),ub()),i&2){let e=bV().$implicit;zB(),B0("video",e);}}function jl(i,o){if(i&1&&(sp(0,"a",22),KV(1),ub()),i&2){let e=o.$implicit;B0("queryParams",l$(2,Vl,e)),zB(),vb(" ",e," ");}}function Ql(i,o){if(i&1&&(sp(0,"td")(1,"div",21),R2(2,jl,2,4,"a",22,A2),ub()()),i&2){let e=bV().$implicit;zB(2),N2(e.tags);}}function ql(i,o){if(i&1&&(sp(0,"span",26),yV(1,9),ub()),i&2){let e=bV(2).$implicit;B0("ngbTooltip",e.blacklistedReason);}}function Zl(i,o){if(i&1&&(sp(0,"td")(1,"div",23)(2,"a",24),Pp(3,"my-privacy-badge",25),ub(),_2(4,ql,2,1,"span",26),ub()()),i&2){let e=bV().$implicit,t=bV();zB(2),B0("queryParams",l$(4,$l,e.privacy.id))("title",t.getPrivacyFilterTitle(e.privacy.label)),zB(),B0("video",e),zB(),w2(e.blacklisted?4:-1);}}function Kl(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-nsfw-badge",27),ub()),i&2){let e=bV().$implicit;zB(),B0("video",e);}}function Jl(i,o){if(i&1&&(Pp(0,"br"),fb(1),yV(2,11),v$(3,"myNumberFormatter"),kp()),i&2){let e=bV(2).$implicit;zB(3),ax(e.viewers)(b$(3,2,e.views)),vV(2);}}function ec(i,o){if(i&1&&(sp(0,"td")(1,"a",28),fb(2),yV(3,10),v$(4,"myNumberFormatter"),kp(),_2(5,Jl,4,4),ub()()),i&2){let e=bV().$implicit;zB(),B0("routerLink",l$(6,kl,e.shortUUID)),zB(3),ax(e.views)(b$(4,4,e.views)),vV(3),zB(),w2(e.isLive?5:-1);}}function tc(i,o){if(i&1&&(sp(0,"td")(1,"span"),yV(2,12),v$(3,"myNumberFormatter"),ub()()),i&2){let e=bV().$implicit;zB(3),ax(e.comments)(b$(3,2,e.comments)),vV(2);}}function ic(i,o){if(i&1&&(sp(0,"td"),KV(1),v$(2,"ptDate"),ub()),i&2){let e=bV().$implicit;zB(),vb(" ",S$(2,1,e.publishedAt,"short")," ");}}function nc(i,o){if(i&1&&(sp(0,"td"),Pp(1,"my-video-state-badge",27),ub()),i&2){let e=bV().$implicit;zB(),B0("video",e);}}function oc(i,o){if(i&1&&KV(0),i&2){let e=bV(2).$implicit;vb(" ",e.category.label," ");}}function rc(i,o){if(i&1&&(sp(0,"td"),_2(1,oc,1,1),ub()),i&2){let e=bV().$implicit;zB(),w2(e.category?.id?1:-1);}}function ac(i,o){if(i&1&&KV(0),i&2){let e=bV(2).$implicit;vb(" ",e.language.label," ");}}function sc(i,o){if(i&1&&(sp(0,"td"),_2(1,ac,1,1),ub()),i&2){let e=bV().$implicit;zB(),w2(e.language?.id?1:-1);}}function lc(i,o){if(i&1&&KV(0),i&2){let e=bV(2).$implicit;vb(" ",e.licence.label," ");}}function cc(i,o){if(i&1&&(sp(0,"td"),_2(1,lc,1,1),ub()),i&2){let e=bV().$implicit;zB(),w2(e.licence?.id?1:-1);}}function dc(i,o){if(i&1&&(sp(0,"a",31),KV(1),ub()),i&2){let e=o.$implicit,t=bV(3);BV(t.getPlaylistBadge(e.playlistDisplayName)),B0("routerLink",l$(4,Bl,e.playlistShortUUID)),zB(),vb(" ",e.playlistDisplayName," ");}}function _c(i,o){if(i&1&&(sp(0,"td")(1,"div",29),R2(2,dc,2,6,"a",30,A2),ub()()),i&2){let e=bV().$implicit,t=bV();zB(2),N2(t.videosContainedInPlaylists[e.id]||u$(0,Fl));}}function pc(i,o){if(i&1&&(_2(0,Wl,2,1,"td"),_2(1,Xl,2,1,"td"),_2(2,Ql,4,0,"td"),_2(3,Zl,5,6,"td"),_2(4,Kl,2,1,"td"),_2(5,ec,6,8,"td"),_2(6,tc,4,4,"td"),_2(7,ic,3,4,"td"),_2(8,nc,2,1,"td"),_2(9,rc,2,1,"td"),_2(10,sc,2,1,"td"),_2(11,cc,2,1,"td"),_2(12,_c,4,1,"td")),i&2){bV();let e=IV(6);w2(e.isColumnDisplayed("duration")?0:-1),zB(),w2(e.isColumnDisplayed("name")?1:-1),zB(),w2(e.isColumnDisplayed("tags")?2:-1),zB(),w2(e.isColumnDisplayed("privacy")?3:-1),zB(),w2(e.isColumnDisplayed("sensitive")?4:-1),zB(),w2(e.isColumnDisplayed("insights")?5:-1),zB(),w2(e.isColumnDisplayed("comments")?6:-1),zB(),w2(e.isColumnDisplayed("published")?7:-1),zB(),w2(e.isColumnDisplayed("state")?8:-1),zB(),w2(e.isColumnDisplayed("category")?9:-1),zB(),w2(e.isColumnDisplayed("language")?10:-1),zB(),w2(e.isColumnDisplayed("licence")?11:-1),zB(),w2(e.isColumnDisplayed("playlists")?12:-1);}}function mc(i,o){if(i&1){let e=k2();Pp(0,"my-button",32),sp(1,"my-video-actions-dropdown",33),Fp("videoRemoved",function(){$I(e),bV();let n=IV(6);return GI(n.loadData());})("videoFilesRemoved",function(){$I(e),bV();let n=IV(6);return GI(n.loadData());})("transcodingCreated",function(){$I(e),bV();let n=IV(6);return GI(n.loadData());})("videoExistsInPlaylistChange",function(){let n=$I(e).$implicit,r=bV();return GI(r.fetchVideosContainedInPlaylists([n]));})("videoImportRetried",function(){$I(e),bV();let n=IV(6);return GI(n.loadData());}),ub();}if(i&2){let e=o.$implicit,t=bV();B0("ptRouterLink",l$(3,zl,e.shortUUID)),zB(),B0("video",e)("displayOptions",t.videoActionsOptions);}}function uc(i,o){if(i&1&&KV(0),i&2){let e=o.search,t=o.hasFilters,n=bV();vb(" ",n.getNoResults(!!e||t)," ");}}var kr=(()=>{class i{confirmService=g(ag);auth=g(Xe);notifier=g(rc$1);videoService=g(x);playlistService=g(Z);server=g($t);headerService=g(kk);badgeService=g(i$1);route=g(jr$1);table=wpe("table");bulkUpdateVideosInPlaylistModal=wpe("bulkUpdateVideosInPlaylistModal");bulkUpdateVideosModal=wpe("bulkUpdateVideosModal");videosContainedInPlaylists={};bulkActions=[];videoActionsOptions={playlist:true,download:true,update:false,blacklist:false,delete:true,report:false,duplicate:false,muteByUser:false,muteByServer:false,liveInfo:true,removeFiles:false,transcoding:false,retryFailedImport:true};user;channels=[];inputFilters=[];columns=[];customUpdateUrl;customParseQueryParams;dataLoader;constructor(){this.customUpdateUrl=this._customUpdateUrl.bind(this),this.customParseQueryParams=this._customParseQueryParams.bind(this),this.dataLoader=this._dataLoader.bind(this);}get serverConfig(){return this.server.getHTMLConfig();}ngOnInit(){this.headerService.setSearchHidden(true),this.user=this.auth.getUser(),this.columns=[{id:"duration",label:"Duration",selected:true,sortable:true},{id:"name",label:"Name",selected:true,sortable:true},{id:"tags",label:"Tags",selected:true,sortable:false},{id:"privacy",label:"Privacy",selected:true,sortable:false},{id:"sensitive",label:"Sensitive",selected:true,sortable:false},{id:"insights",label:"Insights",selected:true,sortable:true,sortKey:"views"},{id:"comments",label:"Comments",selected:true,sortable:true},{id:"published",label:"Published",selected:true,sortable:true,sortKey:"publishedAt"},{id:"state",label:"State",selected:true,sortable:false},{id:"category",label:"Category",selected:false,sortable:false},{id:"language",label:"Language",selected:false,sortable:false},{id:"licence",label:"Licence",selected:false,sortable:false},{id:"playlists",label:"Spelelister",selected:true,sortable:false}],this.inputFilters=[{type:"options",key:"isLive",title:"Video type",options:[{value:"all",label:"All"},{value:true,label:"Lives"},{value:false,label:"VOD"}]},{type:"options",key:"privacyOneOf",title:"Privacy",options:[{value:"all",label:"All"},{value:Zt.PUBLIC,label:"Public videos"},{value:Zt.INTERNAL,label:"Internal videos"},{value:Zt.UNLISTED,label:"Unlisted videos"},{value:Zt.PASSWORD_PROTECTED,label:"Password protected videos"},{value:Zt.PRIVATE,label:"Private videos"}]},{type:"tags",key:"tagsOneOf",title:"One of these tags"}],this._customParseQueryParams(this.route.snapshot.queryParams),this.buildActions();}ngOnDestroy(){this.headerService.setSearchHidden(false);}_customParseQueryParams(e){let t=e.channelNameOneOf?new Set(em(e.channelNameOneOf)):new Set();this.user=this.auth.getUser(),this.channels=[...this.user.videoChannels,...this.user.videoChannelCollaborations].map(n=>E(D({},n),{selected:t.has(n.name)}));}getNoResults(e){return e?"No videos found matching your filters.":this.channels.some(t=>t.selected)?"No videos found in selected channels.":"You don't have any videos published yet.";}_customUpdateUrl(){return{channelNameOneOf:this.channels.filter(t=>t.selected).map(t=>t.name)};}_dataLoader(e){let{pagination:t,sort:n,search:r,isLive:s,privacyOneOf:d,tagsOneOf:u}=e,S=this.channels.filter(v=>v.selected).map(v=>v.name);return this.videoService.listMyVideos({restPagination:t,sort:n,search:r,includeCollaborations:true,channelNameOneOf:S.length!==0?S:void 0,isLive:s,privacyOneOf:d!==void 0?[d]:void 0,tagsOneOf:u}).pipe(lt(({data:v})=>this.fetchVideosContainedInPlaylists(v)));}fetchVideosContainedInPlaylists(e){this.playlistService.doVideosExistInPlaylist(e.map(t=>t.id)).subscribe(t=>{this.videosContainedInPlaylists=Object.keys(t).reduce((n,r)=>E(D({},n),{[r]:tHe(t[+r],s=>s.playlistId)}),this.videosContainedInPlaylists);});}getPlaylistBadge(e){return this.badgeService.getRandomBadge("playlist",e);}removeVideos(e){return L(this,null,function*(){let t=DAe("Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?",{count:e.length});(yield this.confirmService.confirm(t,"Delete"))!==false&&this.videoService.removeVideo(e.map(r=>r.id)).subscribe({next:()=>{this.notifier.success(DAe("Deleted {count, plural, =1 {1 video} other {{count} videos}}.",{count:e.length})),this.table().loadData();},error:r=>this.notifier.handleError(r)});});}buildActions(){this.bulkActions=[[{label:"Add to playlist...",handler:e=>{this.bulkUpdateVideosInPlaylistModal().show({videos:e,videosContainedInPlaylists:this.videosContainedInPlaylists});},iconName:"playlist-add"},{label:"Update...",handler:e=>this.bulkUpdateVideosModal().show({videos:e}),iconName:"edit"}],[{label:"Delete",handler:e=>this.removeVideos(e),iconName:"delete"}]];}getPrivacyFilterTitle(e){return"Filter by privacy: "+e+"";}static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["my-videos"]],viewQuery:function(t,n){t&1&&fx(n.table,wl,5)(n.bulkUpdateVideosInPlaylistModal,xl,5)(n.bulkUpdateVideosModal,Yl,5),t&2&&DV(3);},decls:19,vars:6,consts:()=>{let e;e="videos per page";let t;t="Per channel:";let n;n="{VAR_PLURAL, plural, =0 {No videos} =1 {1 video} other {{INTERPOLATION} videos}}",n=EV(n,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let r;r="Blocked";let s;s="Navigate to the video stats page";let d;d="{VAR_PLURAL, plural, =0 {No views} =1 {1 view} other {{INTERPOLATION} views}}",d=EV(d,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let u;u="{VAR_PLURAL, plural, =0 {No viewers} =1 {1 viewer} other {{INTERPOLATION} viewers}}",u=EV(u,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let S;S="{VAR_PLURAL, plural, =0 {No comments} =1 {1 comment} other {{INTERPOLATION} comments}}",S=EV(S,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let v;return v="Manage",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["noResults",""],["bulkUpdateVideosInPlaylistModal",""],["bulkUpdateVideosModal",""],t,n,r,d,u,S,[1,"channel-filters"],[1,"channel-label"],[3,"channel","ngModel"],["key","MyVideosComponent","defaultSort","publishedAt","paginatorText",e,"defaultRowsPerPage","5","searchInput","true","canUseMatchSort","true",3,"defaultColumns","bulkActions","dataLoader","customParseQueryParams","customUpdateUrl","inputFilters"],[3,"saved"],[3,"ngModelChange","channel","ngModel"],["thumbnail","true","title","false",3,"video"],["thumbnail","false","title","true","displayEditorInfo","true",1,"video-cell-name",3,"video"],[1,"badges","tags"],["routerLink",".",1,"pt-badge","badge-secondary","pt-badge-keep-case",3,"queryParams"],[1,"pt-badges-container"],["routerLink",".",3,"queryParams","title"],["displayTooltip","false",3,"video"],[1,"pt-badge","badge-red",3,"ngbTooltip"],[3,"video"],["title",s,1,"pt",3,"routerLink"],[1,"badges","playlists"],[1,"pt-badge","pt-badge-keep-case",3,"class","routerLink"],[1,"pt-badge","pt-badge-keep-case",3,"routerLink"],["label",v,"theme","secondary","icon","film","responsiveLabel","true",1,"me-3",3,"ptRouterLink"],["placement","bottom auto","buttonIcon","more-horizontal","buttonStyled","true",3,"videoRemoved","videoFilesRemoved","transcodingCreated","videoExistsInPlaylistChange","videoImportRetried","video","displayOptions"]];},template:function(t,n){if(t&1){let r=k2();sp(0,"div",13)(1,"div",14),yV(2,7),ub(),R2(3,Ul,1,2,"my-channel-toggle",15,Hl),ub(),sp(5,"my-table",16,0),_0(7,Gl,3,4,"ng-template",null,1,D$)(9,pc,13,13,"ng-template",null,2,D$)(11,mc,2,5,"ng-template",null,3,D$)(13,uc,1,1,"ng-template",null,4,D$),ub(),sp(15,"my-bulk-update-videos-in-playlist-modal",17,5),Fp("saved",function(d){return n.fetchVideosContainedInPlaylists(d);}),ub(),sp(17,"my-bulk-update-videos-modal",17,6),Fp("saved",function(){$I(r);let d=IV(6);return GI(d.loadData());}),ub();}t&2&&(zB(3),N2(n.channels),zB(2),B0("defaultColumns",n.columns)("bulkActions",n.bulkActions)("dataLoader",n.dataLoader)("customParseQueryParams",n.customParseQueryParams)("customUpdateUrl",n.customUpdateUrl)("inputFilters",n.inputFilters));},dependencies:[Jn,qn,ln$1,it,ef,tf,wi,Qh,Xh,$r,Ni,Qn$1,Lh,Un$1,Vr,tl$2,d$1,p$1],styles:["my-select-checkbox[_ngcontent-%COMP%]{min-width:250px}.pt-badge[_ngcontent-%COMP%]{margin-inline-end:.3125rem}.badges[_ngcontent-%COMP%]   .pt-badge[_ngcontent-%COMP%]{max-width:200px;vertical-align:bottom;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.video-info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex}.video-info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{position:relative;top:-2px;display:inline-block;width:16px;height:16px;line-height:16px;margin-inline-start:.1875rem}td[_ngcontent-%COMP%]{padding-top:.75rem;padding-bottom:.75rem}.channel-label[_ngcontent-%COMP%]{color:var(--fg-200);font-weight:700;white-space:nowrap}.channel-filters[_ngcontent-%COMP%]{display:flex;align-items:center;padding-bottom:1rem;border-bottom:1px solid var(--bg-secondary-400);margin-bottom:1rem;gap:1rem;overflow:hidden}.channel-filters[_ngcontent-%COMP%]:hover{overflow:auto}@media screen and (min-width:800px){.video-cell-name[_ngcontent-%COMP%]{width:300px;display:block}}@media screen and (max-width:800px){my-video-cell[_ngcontent-%COMP%]{max-width:120px;display:block}}"],changeDetection:1});}return i;})();var Fr=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],decls:7,vars:0,consts:()=>{let e;e="Comments that contain any of the watched words are automatically tagged with the name of the list.";let t;return t="These automatic tags can be used to filter comments or "+"\uFFFD#5\uFFFD"+"automatically block"+"\uFFFD/#5\uFFFD"+" them.",[e,t,[1,"callout","callout-primary","mb-4"],["routerLink","/my-account/auto-tag-policies"],["mode","user"]];},template:function(t,n){t&1&&(sp(0,"div",2)(1,"div"),yV(2,0),ub(),sp(3,"div"),ix(4,1),Pp(5,"a",3),sx(),ub()(),Pp(6,"my-watched-words-list-admin-owner",4));},dependencies:[Wo$1,Xh],encapsulation:2,changeDetection:1});}return i;})();var Br=(()=>{class i{static ɵfac=function(t){return new(t||i)();};static ɵcmp=Pa$1({type:i,selectors:[["ng-component"]],features:[c$([Qe])],decls:3,vars:0,consts:()=>{let e;return e=" Subscribe to remote watched words lists to automatically keep them synchronized.\n",[e,[1,"callout","callout-primary","mb-4"],["mode","user"]];},template:function(t,n){t&1&&(sp(0,"div",1),yV(1,0),ub(),Pp(2,"my-watched-words-subscriptions-admin-owner",2));},dependencies:[la$1],encapsulation:2,changeDetection:1});}return i;})();var _n={path:"",providers:[Ht$1,Dt,Nt,d,B,Kt,Me,p,_],resolve:{user:n},canActivateChild:[ak]},Ur=[{path:"videos/comments",redirectTo:"comments-on-my-videos",pathMatch:"full"},{path:"comments-on-my-videos",component:xo,data:{meta:{title:"Comments on your videos"}}},{path:"watched-words/list",component:Fr,data:{meta:{title:"Your watched words"}}},{path:"watched-words/subscriptions",component:Br,data:{meta:{title:"Your watched words subscriptions"}}},{path:"auto-tag-policies",component:Yo,resolve:{tags:Vo},data:{meta:{title:"Your automatic tag policies"}}},{path:"videos",component:kr,data:{meta:{title:"My videos"}}},{path:"video-imports",component:Ko,data:{meta:{title:"My video imports"}}},{path:"ownership",component:Qo,data:{meta:{title:"Ownership changes"}}}],Gr=[{path:"",redirectTo:"video-channels",pathMatch:"full"},{path:"video-channels",loadChildren:()=>import('./chunk-DjEKddXU.js')},{path:"followers",component:Bo,data:{meta:{title:"My followers"}}},{path:"video-channel-syncs",component:qo,data:{meta:{title:"My synchronizations"}}},{path:"video-channel-syncs/create",component:Zo,data:{meta:{title:"Create new synchronization"}}}],hc=[{path:"video-playlists",component:wr,data:{meta:{title:"Spelelistene mine"}}},{path:"video-playlists/create",component:Jo,data:{meta:{title:"Create a new playlist"}}},{path:"video-playlists/:videoPlaylistId",component:Ar,data:{meta:{title:"Playlist elements"}}},{path:"video-playlists/update/:videoPlaylistId",component:Lr,data:{meta:{title:"Update playlist"}}},{path:"subscriptions",component:Ho,data:{meta:{title:"My subscriptions"}}},{path:"history/videos",component:Go,data:{meta:{title:"Filmane eg har sett"},reuse:{enabled:true,key:"my-videos-history-list"}}}];function zr(i){if(i.length===0)return false;let o=i[0].path;return Ur.some(e=>e.path===o||e.path.startsWith(`${o}/`));}function Hr(i){if(i.length===0)return false;let o=i[0].path;return Gr.some(e=>e.path===o||e.path.startsWith(`${o}/`));}var b0=[E(D({},_n),{component:xr,canMatch:[(i,o)=>zr(o)],children:Ur}),E(D({},_n),{component:Fo,canMatch:[(i,o)=>Hr(o)],children:Gr}),E(D({},_n),{component:Wo,canMatch:[(i,o)=>!zr(o)&&!Hr(o)],children:hc})];/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{b0 as default};//# sourceMappingURL=chunk-GmlCkL5h.js.map