import{c as x,l as y,o as F,r as C,s as w,t as A}from"./chunk-C6uGsfWa.js";import{$o as mn,$s as u3,A as Bc,An as M,Ao as jx,Ar as Rt,Bo as kr$1,Br as T$,C as Au,Ca as dA,Cc as xF,Ci as Xr$1,Co as jb,Cr as Qx,Ec as xe,En as Lhe,Fn as MV,Fo as kV,G as Ce,Gi as _4,Gn as NV,Gr as Tt,Ha as fIe,Hc as zx,Hi as Zt,Hr as TCe,Ic as zG,Io as kg,Ja as g,Jn as Nhe,Jo as lc,Jr as Tx,Jt as Hx,K as Cn,Ka as ff,Ki as _5,Kn as Ne,Ko as lVe,Kr as Tu,Kt as Hw,L as Bx,Lc as zg,Mo as k3,Mr as S,N as Bn,Na as eh,Nc as yd$1,Nr as S$,Ns as rh,Oc as xje,Oi as Yg,On as Ls$1,Oo as jw,Or as Rhe,Pa as eo,R as C$,Ra as f5,Ri as Ze,Rr as Si,Rs as sDe,S as Ahe,Sc as x$,So as jV,St as G,To as je,Tt as GF,V as CI,Vr as T5,Vs as se,Wi as _$,Wr as Tm,Ws as sn,X as D$,Xi as a5,Xo as lx,Xr as Uc,Xs as td$1,Yn as Nn$1,Yr as UF,Ys as tIe,Z as D5,Zi as aA,Zs as th,Zt as I5,_o as iu,_s as ph,_t as FF,ai as Vj,an as Je,as as nt,ba as cl$1,bc as wx,br as Qc,bs as pt,c as $b,ci as Vx,cn as K,dc as vm,di as We,ei as V,eo as h5,et as DI,fa as bx,fn as Kb,fs as p5,gn as Kr$1,gt as Ex,hi as Wx,hs as pT,ht as Et,ia as ax,ic as uVe,io as hn,jc as yM,jt as Gj,k as Bb,ka as du,kt as Gc,lo as i3,mr as Po,n as $B,nc as uIe,nn as J$,nr as O3,ns as n1,oi as Vn$1,ot as Ds$1,pn as Kc,pr as PV,q as Ct,qi as _F,qo as la$1,qr as Twe,ro as he,rs as nh,s as $a$1,ss as o5,t as $$,ti as Vb,vc as wf,wn as LV,x as Ae,xc as x$1,xs as q,ya as ci,yc as wp,yi as XRe,za as fA,zc as zt}from"./chunk-b0nJCs5_.js";import{t as X1}from"./chunk-CDRFWLLW.js";import"./chunk-d9xmxGyl.js";import{i as z,t as K$1}from"./chunk-BXrVgciI.js";import{t as H}from"./chunk-CswnO8Ym.js";import{a as it,i as Q,n as J,o as pt$1,r as L,s as st,t as D}from"./chunk-Dk3UCogg.js";import"./chunk-DUrVXBNc.js";import{t as _}from"./chunk-DnSoF4cB.js";import"./chunk-BdDU3qnh.js";import{i as R,r as N,t as L$1}from"./chunk-Bm4_iVi2.js";import{A as qn,C as fn,I as yn,O as ln,_ as Zn,o as Je$1,p as Vn$2,r as D$1,s as Jn,t as $n,u as Qn}from"./chunk-Cmet2Nw-.js";import"./chunk-CkJf4plT.js";import"./chunk-Dga4Oy_6.js";import{c as oi}from"./chunk-q-6uNE4L.js";import"./chunk-vxivoKli.js";import"./chunk-YjBxjUE4.js";import{t as S$1}from"./chunk-CKCWxqhm.js";import{D as si,O as sr,S as fe,k as tf,u as Jp}from"./chunk-DcB590Yc.js";import{t as S$2}from"./chunk-BvsfL09w.js";import{n as s,t as q$1}from"./chunk-BpR0ReBf.js";import{t as d}from"./chunk-91NjDu2l.js";import"./chunk-D1ftwTOw.js";import"./chunk-CQu0MGFr.js";import{t as fe$1}from"./chunk-njXSwo6y.js";import{t as c}from"./chunk-DNBjyHdz2.js";import"./chunk-BeduZISV2.js";import"./chunk-B4yFU5n32.js";import"./chunk-uNqEPBRE2.js";import{t as O}from"./chunk-CnYI1CZp2.js";import{n as R$1}from"./chunk-DDsZtj252.js";import"./chunk-CnEH9ox82.js";import{n as ce,r as se$1,t as ae}from"./chunk-DwtxXnIx2.js";import{t as Z}from"./chunk-D3sqbh442.js";import{n as t}from"./chunk-B1IbTx1B2.js";import"./chunk-BqndqiNm2.js";import"./chunk-DzDmtByK2.js";import{t as r}from"./chunk-BWkkRYL92.js";import{t as c$1}from"./chunk-CvGQme2z2.js";import{a as q$2,i as k,n as K$2,o as w$1,r as R$2,t as G$1}from"./chunk-LQEJZ9jr2.js";import{n as r$1}from"./chunk-DsKBogZp.js";import"./chunk-B1JWCK7G.js";import{d as ae$1,l as Y,v as ue,y as u}from"./chunk-CBkcKks-.js";import{a as q$3,i as qi$1,n as Xi$1,r as kt,t as Ac}from"./chunk-B-CeVcqI.js";import{o as _e}from"./chunk-DNbwdWcY.js";import{c as X,n as Ne$1,o as ke,r as Ue}from"./chunk-BrKSdfk8.js";import{n as p}from"./chunk-Hufy2o-o.js";import{t as O$1}from"./chunk-xpAb-8o8.js";import{t as E}from"./chunk-CxGsHfUL.js";import"./chunk-DWd4safw.js";import{n as G$2}from"./chunk-BAE6eT2L.js";import{r as l}from"./chunk-BWPHh9Wj.js";import{l as zn,r as Ot}from"./chunk-DfqsVgzP.js";import{t as P}from"./chunk-DIM23SYz.js";import"./chunk-DJBlpGNa.js";import"./chunk-DPoVWrj9.js";import{n as P$1}from"./chunk-DkFr3Cd7.js";import{t as s$1}from"./chunk-hDPFqAgp.js";import{t as p$1}from"./chunk-26MUAXWT.js";import{a as Ye,c as an,d as ln$1,f as on$1,i as Ur$1,l as jt,n as Qt,o as Yt,p as rn$1,r as Re,s as Zt$1,u as kr$2}from"./chunk-CdyPygE2.js";import{t as F$1}from"./chunk-BGfhYF4g.js";import{t as k$1}from"./chunk-DGv871DT2.js";import{t as u$1}from"./chunk-yXA11qmJ2.js";import{n as nt$1}from"./chunk-Bn2Mr5fD2.js";import{n as ht,r as vt}from"./chunk-DT2M9vR42.js";import{t as L$2}from"./chunk-AtGtJ1de2.js";import{t as Ae$1}from"./chunk-DUrZxAvV2.js";var _r=A((Gd,Jr)=>{Jr.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 Ai=class n{static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],decls:1,vars:0,consts:[[`mode`,`user`,`key`,`UserVideoCommentList`]],template:function(e,i){e&1&&th(0,`my-video-comment-list-admin-owner`,0)},dependencies:[rn$1],encapsulation:2,changeDetection:1})};function Zr(n,t){if(n&1){let e=jV();wp(0,`div`,2)(1,`my-peertube-checkbox`,3),fA(`ngModelChange`,function(o){let r=CI(e).$implicit;return o5(r.review,o)||(r.review=o),DI(o)}),rh(`ngModelChange`,function(){CI(e);return DI(D$().updatePolicies())}),Bb(),Vj(),Bb()}if(n&2){let e=t.$implicit,i=t.$index,o=D$();$B(),Ex(`inputName`,`tag-`+i),dA(`ngModel`,e.review),Ex(`labelInnerHTML`,o.getLabelText(e)),Gj()}}var Di=class n{authService=g(nt);autoTagsService=g(jt);notifier=g(Si);html=g(Kc);route=g(eo);tags=[];ngOnInit(){this.tags=this.route.snapshot.data.tags}getLabelText(t){let e=t.name===`external-link`?"That contain <strong>an external link</strong>":`That contain any word from your <strong>${t.name}</strong> watched word list`;return this.html.toSimpleSafeHtml(e)}updatePolicies(){let t=this.authService.getUser().account.name;this.autoTagsService.updateCommentPolicies({accountName:t,review:this.tags.filter(e=>e.review).map(e=>e.name)}).subscribe({next:()=>{this.notifier.success("Comment policies updated")},error:e=>this.notifier.handleError(e)})}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],decls:4,vars:0,consts:()=>{let t;return t="Automatically block comments:",[t,[1,`d-block`,`mb-3`],[1,`form-group`,`ms-3`],[3,`ngModelChange`,`inputName`,`ngModel`,`labelInnerHTML`]]},template:function(e,i){e&1&&(wp(0,`strong`,1),S$(1,0),Bb(),PV(2,Zr,2,3,`div`,2,LV)),e&2&&($B(2),kV(i.tags))},dependencies:[Jn,qn,ln,q$1],encapsulation:2,changeDetection:1})};var cr=()=>{let n=g(nt),t=g(jt),e=n.getUser().account.name;return _F([t.listAvailable({accountName:e}),t.getCommentPolicies({accountName:e})]).pipe(G(([i,o])=>i.available.map(r=>({name:r.name,type:r.type,review:o.review.includes(r.name)}))))};function Kr(n,t){if(n&1&&(jb(0,`div`,1),bx(1,`div`,4),Vb()),n&2){let e=D$();$B(),wx(`innerHTML`,e.svg,Hw)}}var Li=class n{activeModal=g(si);title;html;svg;static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`my-new-feature-info-modal`]],decls:6,vars:3,consts:()=>{let t;return t="Got it",[[1,`modal-body`],[1,`svg-relative-container`],[1,`content`,3,`innerHtml`],[`type`,`button`,`role`,`button`,`value`,t,1,`peertube-button`,`primary-button`,3,`click`,`key.enter`],[`aria-hidden`,`true`,1,`svg-container`,3,`innerHTML`]]},template:function(e,i){e&1&&(jb(0,`div`,0),NV(1,Kr,2,1,`div`,1),jb(2,`h2`),J$(3),Vb(),bx(4,`div`,2),jb(5,`input`,3),Vx(`click`,function(){return i.activeModal.close()})(`key.enter`,function(){return i.activeModal.close()}),Vb()()),e&2&&($B(),MV(i.svg?1:-1),$B(2),aA(i.title),$B(),wx(`innerHTML`,i.html,Hw))},dependencies:[Jn],styles:[`h2[_ngcontent-%COMP%]{color:var(--%NS%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(--%NS%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})};var ea=_r();var Nt=class n{auth=g(nt);modalService=g(sr);serverService=g(Zt);userService=g(Qc);notifier=g(Si);domSanitizer=g(zG);showChannelCollaboration(){this.auth.userInformationLoaded.pipe(Ze()).subscribe(()=>{if(this.serverService.getHTMLConfig().client.newFeaturesInfo!==!0||this.auth.getUser().newFeaturesInfoRead&TCe.CHANNEL_COLLABORATION||this.modalService.hasOpenModals())return;let i=this.serverService.getHTMLConfig().instance.name,o=this.modalService.open(Li,{size:`lg`,centered:!0}),r=o.componentInstance;r.title=`Collaboration on channels are coming to ${i}`,r.html="You can now <strong>invite other users</strong> to collaborate on your channel",r.svg=this.domSanitizer.bypassSecurityTrustHtml(ea),o.result.finally(()=>{this.userService.markNewFeatureInfoAsRead(TCe.CHANNEL_COLLABORATION).subscribe({next:()=>this.auth.refreshUserInformation(),error:d=>this.notifier.handleError(d)})})})}static ɵfac=function(e){return new(e||n)};static ɵprov=S({token:n,factory:n.ɵfac,providedIn:`root`})};var wi=class n{serverService=g(Zt);newFeatureInfoService=g(Nt);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:"Підписники",routerLink:`/my-library/followers`},{label:"Synchronizations",routerLink:`/my-library/video-channel-syncs`,isDisplayed:()=>this.isChannelSyncEnabled()}]}isChannelSyncEnabled(){let t=this.serverConfig.import;return this.serverConfig.import.videoChannelSynchronization.enabled&&(t.videos.http.enabled||t.videos.torrent.enabled)}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],decls:8,vars:1,consts:()=>{let t;t="My channels";let e;return e="Skip the sub menu",[[`myChannelSpaceContent`,``],e,[1,`root`],[1,`margin-content`],[`href`,`#my-channel-space-content`,1,`visually-hidden-focusable`,`skip-to-content-sub-menu`,3,`click`],[`h1Icon`,`channel`,`h1`,t,3,`menuEntries`],[`tabindex`,`-1`,`id`,`my-channel-space-content`,1,`margin-content`,`pb-5`,`outline-0`]]},template:function(e,i){if(e&1){let o=jV();wp(0,`div`,2)(1,`div`,3)(2,`a`,4),rh(`click`,function(d){CI(o);let c=x$(6);return d.preventDefault(),DI(c.focus())}),S$(3,1),Bb(),th(4,`my-horizontal-menu`,5),Bb(),wp(5,`div`,6,0),th(7,`router-outlet`),Bb()()}e&2&&($B(4),Ex(`menuEntries`,i.menuEntries))},dependencies:[pT,fe$1],encapsulation:2,changeDetection:1})};function ta(n,t){if(n&1&&(wp(0,`span`,4),J$(1),Bb()),n&2){let e=D$();$B(),Kb(` `,e.getTotalTitle())}}function ia(n,t){n&1&&(wp(0,`div`,8),S$(1,0),Bb())}function na(n,t){n&1&&($b(0),S$(1,1),nh())}function oa(n,t){if(n&1&&($b(0),S$(1,2),nh()),n&2){let e=D$().$implicit;$B(),jx(e.following.name),T$(1)}}function ra(n,t){if(n&1&&(wp(0,`div`,10),th(1,`my-actor-avatar`,11),wp(2,`div`,12)(3,`a`,13)(4,`div`,14),J$(5),Bb(),th(6,`my-global-icon`,15),Bb(),wp(7,`div`,16),NV(8,na,2,0,`ng-container`)(9,oa,2,1,`ng-container`),Bb()()()),n&2){let e=t.$implicit,i=D$();$B(),Ex(`actor`,e.follower)(`href`,e.follower.url),$B(2),Ex(`href`,e.follower.url,jw),$B(2),aA(e.follower.name+`@`+e.follower.host),$B(3),MV(i.isFollowingAccount(e)?8:9)}}var xi=class n{route=g(eo);auth=g(nt);userSubscriptionService=g(P);notifier=g(Si);follows=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};onDataSubject=new K;search;channelFilter;inputFilters;ngOnInit(){this.inputFilters=[{type:`select`,key:`channel`,title:"Канал",items:this.auth.getUser().videoChannels.map(t=>({id:t.name,label:t.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(t){this.search=t,uVe(this.pagination),this.loadFollowers({reset:!0})}onFilter(t){this.channelFilter=t.channel,uVe(this.pagination),this.loadFollowers({reset:!0})}isFollowingAccount(t){return t.following.name===this.getUsername()}getTotalTitle(){return XRe(`${this.pagination.totalItems} {total, plural, =1 {follower} other {followers}}`,{total:this.pagination.totalItems})}loadFollowers(t={}){let{reset:e=!1}=t;this.userSubscriptionService.listFollowers({pagination:this.pagination,nameWithHost:this.getUsername(),search:this.search,channel:this.channelFilter}).subscribe({next:i=>{this.follows=e?i.data:this.follows.concat(i.data),this.pagination.totalItems=i.total,this.onDataSubject.next(i.data)},error:i=>this.notifier.handleError(i)})}getUsername(){return this.auth.getUser().username}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],decls:9,vars:4,consts:()=>{let t;t="Підписників не знайдено.";let e;e="Сторінка підписника";let i;i="Слідкує за всіма вашими каналами";let o;return o=`Слідкує за вашим каналом ${`�0�`}`,[t,i,o,[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`,e,1,`actor-names`,3,`href`],[1,`actor-display-name`],[`iconName`,`external-link`],[1,`small`,`muted`]]},template:function(e,i){e&1&&(wp(0,`div`,3),NV(1,ta,2,1,`span`,4),wp(2,`div`,5)(3,`my-search-input`,6),rh(`search`,function(r){return i.onSearch(r)}),Bb(),wp(4,`my-advanced-input-filter`,7),rh(`filtersChange`,function(r){return i.onFilter(r)}),Bb()()(),NV(5,ia,2,0,`div`,8),wp(6,`div`,9),rh(`nearOfBottom`,function(){return i.onNearOfBottom()}),PV(7,ra,10,5,`div`,10,LV),Bb()),e&2&&($B(),MV(i.pagination.totalItems?1:-1),$B(3),Ex(`filters`,i.inputFilters),$B(),MV(i.pagination.totalItems===0?5:-1),$B(),Ex(`dataObservable`,i.onDataSubject.asObservable()),$B(),kV(i.follows))},dependencies:[X1,kt,O$1,R$1,q$3],styles:[`.followers-header[_ngcontent-%COMP%]{margin-bottom:30px;display:flex}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--%NS%input-y-padding) var(--%NS%input-x-padding);width:300px;max-width:300px;color:var(--%NS%input-fg);background-color:var(--%NS%input-bg);border:var(--%NS%input-border-width) solid var(--%NS%input-border-color);border-radius:var(--%NS%input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--%NS%input-placeholder-color);font-size:var(--%NS%input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--%NS%fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--%NS%fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--%NS%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(--%NS%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(--%NS%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(--%NS%fg-300);margin-inline-start:.3125rem}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]{color:var(--%NS%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})};var pr=n=>[`/c`,n];var aa=n=>[`/a`,n];var sa=n=>[n];function la(n,t){if(n&1&&(wp(0,`span`,4),J$(1),Bb()),n&2){let e=D$();$B(),Kb(` `,e.getTotalTitle())}}function da(n,t){n&1&&(wp(0,`div`,6),S$(1,0),Bb())}function ca(n,t){if(n&1&&(wp(0,`div`,8),th(1,`my-actor-avatar`,9),wp(2,`div`,10)(3,`a`,11)(4,`div`,12),J$(5),Bb(),wp(6,`div`,13),J$(7),Bb()(),wp(8,`div`,14),S$(9,1),Bb(),wp(10,`a`,15)(11,`span`),S$(12,2),Bb(),th(13,`my-actor-avatar`,16),Bb()(),th(14,`my-subscribe-button`,17),Bb()),n&2){let e=t.$implicit;$B(),Ex(`actor`,e)(`internalHref`,h5(10,pr,e.nameWithHost)),$B(2),Ex(`routerLink`,h5(12,pr,e.nameWithHost)),$B(2),aA(e.displayName),$B(2),aA(e.nameWithHost),$B(2),jx(e.followersCount),T$(9),$B(),Ex(`routerLink`,h5(14,aa,e.ownerBy)),$B(2),jx(e.ownerBy),T$(12),$B(),Ex(`actor`,e.ownerAccount),$B(),Ex(`videoChannels`,h5(16,sa,e))}}var Vi=class n{userSubscriptionService=g(P);notifier=g(Si);videoChannels=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};onDataSubject=new K;search;onNearOfBottom(){this.pagination.totalItems<=this.pagination.currentPage*this.pagination.itemsPerPage||(this.pagination.currentPage+=1,this.loadSubscriptions())}onSearch(t){this.search=t,uVe(this.pagination),this.loadSubscriptions(!1)}getTotalTitle(){return XRe(`${this.pagination.totalItems} {total, plural, =1 {subscription} other {subscriptions}}`,{total:this.pagination.totalItems})}loadSubscriptions(t=!0){this.userSubscriptionService.listSubscriptions({pagination:this.pagination,search:this.search}).subscribe({next:e=>{this.videoChannels=t?this.videoChannels.concat(e.data):e.data,this.pagination.totalItems=e.total,this.onDataSubject.next(e.data)},error:e=>this.notifier.handleError(e)})}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],decls:7,vars:3,consts:()=>{let t;t="Ви ще не маєте підписок.";let e;e="Сторінка каналу";let i;i="Сторінка облікового запису власника";let o;o=`${`�0�`} підписників `;let r;return r=`Створено ${`�0�`}`,[t,o,r,[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`,e,1,`actor-names`,3,`routerLink`],[1,`actor-display-name`],[1,`actor-name`],[1,`actor-followers`],[`title`,i,1,`actor-owner`,3,`routerLink`],[`actorType`,`account`,`size`,`18`,3,`actor`],[3,`videoChannels`]]},template:function(e,i){e&1&&(wp(0,`div`,3),NV(1,la,2,1,`span`,4),wp(2,`my-search-input`,5),rh(`search`,function(r){return i.onSearch(r)}),Bb()(),NV(3,da,2,0,`div`,6),wp(4,`div`,7),rh(`nearOfBottom`,function(){return i.onNearOfBottom()}),PV(5,ca,15,18,`div`,8,LV),Bb()),e&2&&($B(),MV(i.pagination.totalItems?1:-1),$B(2),MV(i.pagination.totalItems===0?3:-1),$B(),Ex(`dataObservable`,i.onDataSubject.asObservable()),$B(),kV(i.videoChannels))},dependencies:[q$3,O$1,R$1,vm,Ae$1],styles:[`input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--%NS%input-y-padding) var(--%NS%input-x-padding);width:300px;max-width:300px;color:var(--%NS%input-fg);background-color:var(--%NS%input-bg);border:var(--%NS%input-border-width) solid var(--%NS%input-border-color);border-radius:var(--%NS%input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--%NS%input-placeholder-color);font-size:var(--%NS%input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--%NS%fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--%NS%fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--%NS%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(--%NS%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(--%NS%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(--%NS%fg-300);margin-inline-start:.3125rem}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]{color:var(--%NS%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})};var _a=n=>({$implicit:n});function pa(n,t){if(n&1&&(wp(0,`div`,2),S$(1,0),Bb()),n&2){let e=D$();$B(),jx(e.noResultMessage()),T$(1)}}function ma(n,t){if(n&1){let e=jV();wp(0,`div`,6)(1,`my-peertube-checkbox`,8),fA(`ngModelChange`,function(o){CI(e);let r=D$().$implicit,d=D$();return o5(d.selection()[r.id],o)||(d.selection()[r.id]=o),DI(o)}),Bb(),Vj(),Bb()}if(n&2){let e=D$().$implicit,i=D$();$B(),Ex(`inputName`,`video-check-`+e.id),dA(`ngModel`,i.selection()[e.id]),Gj()}}function ua(n,t){n&1&&Tx(0)}function ha(n,t){if(n&1&&lx(0,ua,1,0,`ng-container`,9),n&2){let e=D$().$implicit;Ex(`ngTemplateOutlet`,D$().rowButtonsTemplate)(`ngTemplateOutletContext`,h5(2,_a,e))}}function ga(n,t){if(n&1&&(wp(0,`div`,4),NV(1,ma,2,2,`div`,6),th(2,`my-video-miniature`,7),NV(3,ha,1,4,`ng-container`),Bb()),n&2){let e=t.$implicit,i=D$();$B(),MV(i.enableSelection()?1:-1),$B(),Ex(`video`,e)(`displayAsRow`,!0)(`displayOptions`,i.miniatureDisplayOptions())(`displayVideoActions`,!1)(`user`,i.user())(`headingLevel`,i.headingLevel()),$B(),MV(i.isInSelectionMode()===!1?3:-1)}}function fa(n,t){n&1&&Tx(0)}function Ca(n,t){if(n&1){let e=jV();wp(0,`div`,5)(1,`button`,10),rh(`click`,function(){CI(e);return DI(D$().abortSelectionMode())}),S$(2,1),Bb(),lx(3,fa,1,0,`ng-container`,11),Bb()}if(n&2){let e=D$();$B(3),Ex(`ngTemplateOutlet`,e.globalButtonsTemplate)}}var Yi=class n{notifier=g(Si);user=ph(void 0);pagination=ph(void 0);titlePage=ph(void 0);miniatureDisplayOptions=ph(void 0);noResultMessage=ph("Немає результатів.");enableSelection=ph(!0);disabled=ph(!1);getVideosObservableFunction=ph(void 0);headingLevel=ph(2);templates=Lhe(s);selection=Rhe({});videos=Rhe([]);rowButtonsTemplate;globalButtonsTemplate;sort=`-publishedAt`;onDataSubject=new K;hasDoneFirstQuery=!1;lastQueryLength;ngAfterContentInit(){{let t=this.templates().find(e=>e.name()===`rowButtons`);t&&(this.rowButtonsTemplate=t.template)}{let t=this.templates().find(e=>e.name()===`globalButtons`);t&&(this.globalButtonsTemplate=t.template)}}getVideosObservable(t){return this.getVideosObservableFunction()(t,this.sort)}abortSelectionMode(){this.selection.update(()=>({}))}isInSelectionMode(){return lc(this.selection()).some(t=>this.selection()[t]===!0)}videoById(t,e){return e.id}onNearOfBottom(){this.disabled()||this.lastQueryLength!==void 0&&this.lastQueryLength<this.pagination().itemsPerPage||(this.pagination().currentPage+=1,this.loadMoreVideos())}loadMoreVideos(t=!1){t&&(this.hasDoneFirstQuery=!1),this.getVideosObservable(this.pagination().currentPage).subscribe({next:({data:e})=>{this.hasDoneFirstQuery=!0,this.lastQueryLength=e.length,t&&this.videos.set([]),this.videos.update(i=>i.concat(e)),this.onDataSubject.next(e)},error:e=>{let i="Cannot load more videos. Please try again later.";V.error(i,e),this.notifier.error(i)}})}reloadVideos(){uVe(this.pagination()),this.loadMoreVideos(!0)}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`my-videos-selection`]],contentQueries:function(e,i,o){e&1&&zx(o,i.templates,s,4),e&2&&_$()},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`],headingLevel:[1,`headingLevel`],selection:[1,`selection`],videos:[1,`videos`]},outputs:{selection:`selectionChange`,videos:`videosChange`},decls:5,vars:3,consts:()=>{let t;t=`\n          ${`�0�`}\n        `;let e;return e="Скасувати",[t,e,[1,`no-results`],[`myInfiniteScroller`,``,1,`videos`,3,`nearOfBottom`,`dataObservable`],[1,`video`],[1,`action-selection-mode`],[1,`checkbox-container`],[3,`video`,`displayAsRow`,`displayOptions`,`displayVideoActions`,`user`,`headingLevel`],[3,`ngModelChange`,`inputName`,`ngModel`],[4,`ngTemplateOutlet`,`ngTemplateOutletContext`],[1,`cancel-selection`,`peertube-button`,`secondary-button`,`me-2`,3,`click`],[4,`ngTemplateOutlet`]]},template:function(e,i){e&1&&(NV(0,pa,2,1,`div`,2),wp(1,`div`,3),rh(`nearOfBottom`,function(){return i.onNearOfBottom()}),PV(2,ga,4,8,`div`,4,i.videoById,!0),Bb(),NV(4,Ca,4,1,`div`,5)),e&2&&(MV(i.hasDoneFirstQuery&&i.videos().length===0?0:-1),$B(),Ex(`dataObservable`,i.onDataSubject.asObservable()),$B(),kV(i.videos()),$B(2),MV(i.isInSelectionMode()===!0?4:-1))},dependencies:[O$1,q$1,Jn,qn,ln,zn,k3],styles:[`.action-selection-mode[_ngcontent-%COMP%]{position:fixed;bottom:1rem}@supports (inset-inline-end: var(--%NS%x-margin-content)){.action-selection-mode[_ngcontent-%COMP%]{inset-inline-end:var(--%NS%x-margin-content)}}@supports not (inset-inline-end: var(--%NS%x-margin-content)){.action-selection-mode[_ngcontent-%COMP%]{right:var(--%NS%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(--%NS%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})};var ya=[`videosSelection`];function Sa(n,t){if(n&1){let e=jV();wp(0,`div`,13)(1,`my-delete-button`,14),rh(`click`,function(){let o=CI(e).$implicit;return DI(D$().deleteHistoryElement(o))}),Bb()()}}var $i=class n{authService=g(nt);userService=g(Qc);notifier=g(Si);confirmService=g(Bc);userHistoryService=g(D);destroyRef=g(Ct);videosSelection=Nhe(`videosSelection`);titlePage;pagination={currentPage:1,itemsPerPage:5,totalItems:null};videosHistoryEnabled;miniatureDisplayOptions={date:!0,views:!0,by:!0,privacyLabel:!1};getVideosObservableFunction=this.getVideosObservable.bind(this);user;videos=[];search;disabled=!1;constructor(){this.titlePage="Моя історія перегляду"}ngOnInit(){this.user=this.authService.getUser(),this.authService.userInformationLoaded.pipe(fe(this.destroyRef)).subscribe(()=>this.videosHistoryEnabled=this.user.videosHistoryEnabled)}disableForReuse(){this.disabled=!0}enabledForReuse(){this.disabled=!1}reloadData(){this.videosSelection().reloadVideos()}onSearch(t){this.search=t,this.reloadData()}getVideosObservable(t){let e=n1(this.pagination,{currentPage:t});return this.userHistoryService.list(e,this.search).pipe(pt(i=>this.pagination.totalItems=i.total))}generateSyndicationList(){throw new Error(`Method not implemented.`)}onVideosHistoryChange(){this.userService.updateMyProfile({videosHistoryEnabled:this.videosHistoryEnabled}).subscribe({next:()=>{let t=this.videosHistoryEnabled===!0?"Історія відео ввімкнена":"Історія відео вимкнена";this.notifier.success(t),this.authService.refreshUserInformation()},error:t=>this.notifier.handleError(t)})}deleteHistoryElement(t){this.userHistoryService.deleteElement(t).subscribe({next:()=>{this.videos=this.videos.filter(e=>e.id!==t.id),lVe(this.pagination)},error:e=>this.notifier.handleError(e)})}clearAllHistory(){return F(this,null,function*(){let t="Видалити історію відео",e="Ви впевнені, що хочете видалити всю свою історію відео?";(yield this.confirmService.confirm(e,t))===!0&&this.userHistoryService.clearAll().subscribe({next:()=>{this.notifier.success("Історію відео видалено"),this.reloadData()},error:o=>this.notifier.handleError(o)})})}getNoResultMessage(){return this.search?`Не знайдено відео за запитом «${this.search}».`:"У вашій історії переглядів ще немає відео."}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],viewQuery:function(e,i){e&1&&Wx(i.videosSelection,ya,5),e&2&&_$()},decls:14,vars:11,consts:()=>{let t;t="Відстежувати історію переглядів";let e;e="Clear all history";let i;return i="Видалити з історії",[[`videosSelection`,``],t,e,[1,`visually-hidden`],[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`,i,3,`click`]]},template:function(e,i){if(e&1){let o=jV();wp(0,`h1`,3),J$(1),Bb(),wp(2,`div`,4)(3,`div`,5)(4,`my-search-input`,6),rh(`search`,function(d){return i.onSearch(d)}),Bb()(),wp(5,`div`,7)(6,`my-input-switch`,8),fA(`ngModelChange`,function(d){return CI(o),o5(i.videosHistoryEnabled,d)||(i.videosHistoryEnabled=d),DI(d)}),rh(`ngModelChange`,function(){return i.onVideosHistoryChange()}),Bb(),Vj(),wp(7,`label`,9),S$(8,1),Bb()(),wp(9,`my-button`,10),rh(`click`,function(){return i.clearAllHistory()}),S$(10,2),Bb()(),wp(11,`my-videos-selection`,11,0),fA(`videosChange`,function(d){return CI(o),o5(i.videos,d)||(i.videos=d),DI(d)}),lx(13,Sa,2,0,`ng-template`,12),Bb()}e&2&&($B(),aA(i.titlePage),$B(5),dA(`ngModel`,i.videosHistoryEnabled),Gj(),$B(5),Ex(`pagination`,i.pagination),dA(`videos`,i.videos),Ex(`miniatureDisplayOptions`,i.miniatureDisplayOptions)(`titlePage`,i.titlePage)(`getVideosObservableFunction`,i.getVideosObservableFunction)(`user`,i.user)(`noResultMessage`,i.getNoResultMessage())(`enableSelection`,!1)(`disabled`,i.disabled))},dependencies:[ce,q$3,nt$1,Jn,qn,ln,Yi,s,r$1],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(--%NS%input-y-padding) var(--%NS%input-x-padding);width:250px;max-width:250px;color:var(--%NS%input-fg);background-color:var(--%NS%input-bg);border:var(--%NS%input-border-width) solid var(--%NS%input-border-color);border-radius:var(--%NS%input-border-radius);line-height:24px}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder{color:var(--%NS%input-placeholder-color);font-size:var(--%NS%input-placeholder-font-size)}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[readonly][_ngcontent-%COMP%]{color:var(--%NS%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(--%NS%fg-100);outline:0}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[disabled][_ngcontent-%COMP%]{color:var(--%NS%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(--%NS%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(--%NS%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})};var Fi=class n{menuEntries=[];ngOnInit(){this.buildMenu()}buildMenu(){this.menuEntries=[{label:"Добірки",routerLink:`/my-library/video-playlists`},{label:"Підписки",routerLink:`/my-library/subscriptions`},{label:"Історія",routerLink:`/my-library/history/videos`}]}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],decls:8,vars:1,consts:()=>{let t;t="Моя бібліотека";let e;return e="Skip the sub menu",[[`myLibraryContent`,``],e,[1,`root`],[1,`margin-content`],[`href`,`#my-library-content-content`,1,`visually-hidden-focusable`,`skip-to-content-sub-menu`,3,`click`],[`h1`,t,3,`menuEntries`],[`tabindex`,`-1`,`id`,`my-library-content`,1,`margin-content`,`pb-5`,`outline-0`]]},template:function(e,i){if(e&1){let o=jV();wp(0,`div`,2)(1,`div`,3)(2,`a`,4),rh(`click`,function(d){CI(o);let c=x$(6);return d.preventDefault(),DI(c.focus())}),S$(3,1),Bb(),th(4,`my-horizontal-menu`,5),Bb(),wp(5,`div`,6,0),th(7,`router-outlet`),Bb()()}e&2&&($B(4),Ex(`menuEntries`,i.menuEntries))},dependencies:[pT,fe$1],encapsulation:2,changeDetection:1})};function va(n,t){if(n&1&&th(0,`my-actor-avatar`,2),n&2){let e=D$();Ex(`actor`,e.actor())(`actorType`,e.actorType())}}function Ea(n,t){n&1&&th(0,`my-global-icon`,5)}function Pa(n,t){if(n&1&&(wp(0,`span`,6),J$(1),Bb()),n&2){let e=D$();$B(),aA(e.actor().name)}}function Ma(n,t){n&1&&th(0,`my-collaborator-state`,7)}function Ia(n,t){n&1&&th(0,`my-collaborator-state`,8)}var ot=class n{authService=g(nt);actor=ph.required();actorType=ph.required();displayAvatar=ph(!0,{transform:Tu});displayUsername=ph(!0,{transform:Tu});target=ph(``);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!1;let t=this.authService.getUser();return t.isCollaboratingToChannels()&&t.isEditorOfChannel(this.actor())}isOwnerOfChannel(){if(this.actorType()!==`channel`)return!1;let t=this.authService.getUser();return t.isCollaboratingToChannels()&&t.isOwnerOfChannel(this.actor())}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,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(e,i){e&1&&(wp(0,`a`,0)(1,`div`,1),NV(2,va,1,2,`my-actor-avatar`,2),wp(3,`div`,3)(4,`span`,4),J$(5),NV(6,Ea,1,0,`my-global-icon`,5),Bb(),NV(7,Pa,2,1,`span`,6),Bb(),NV(8,Ma,1,0,`my-collaborator-state`,7)(9,Ia,1,0,`my-collaborator-state`,8),Bb()()),e&2&&(Ex(`routerLink`,i.routerLink)(`title`,i.linkTitle)(`target`,i.target()),$B(2),MV(i.displayAvatar()?2:-1),$B(3),Kb(` `,i.actor().displayName,` `),$B(),MV(i.target()===`_blank`?6:-1),$B(),MV(i.displayUsername()?7:-1),$B(),MV(i.isEditorOfChannel()?8:i.isOwnerOfChannel()?9:-1))},dependencies:[_4,vm,E,R$1,X1],styles:[`a[_ngcontent-%COMP%]:hover{opacity:1}a[_ngcontent-%COMP%]:hover   .information[_ngcontent-%COMP%]{opacity:.8}`],changeDetection:1})};var ba=[`modal`];function Ta(n,t){if(n&1&&(wp(0,`div`,10),J$(1),Bb()),n&2){let e=D$(2);$B(),aA(e.formErrors.channel)}}function Oa(n,t){if(n&1){let e=jV();wp(0,`div`,2)(1,`h1`,3),J$(2),Bb(),wp(3,`button`,4),rh(`click`,function(){let o=CI(e).dismiss;return DI(o())}),th(4,`my-global-icon`,5),Bb()(),wp(5,`div`,6)(6,`div`,7)(7,`label`,8),S$(8,1),Bb(),th(9,`my-select-channel-user`,9),Vj(),NV(10,Ta,2,1,`div`,10),Bb()(),wp(11,`div`,11)(12,`div`,12)(13,`input`,13),rh(`click`,function(){let o=CI(e).dismiss;return DI(o())})(`key.enter`,function(){let o=CI(e).dismiss;return DI(o())}),Bb(),wp(14,`input`,14),rh(`click`,function(){let o=CI(e).close;return DI(o())}),Bb()()()}if(n&2){let e=D$();$B(2),aA(e.getModalTitle()),$B(3),Ex(`formGroup`,e.form),$B(3),jx(e.ownershipChanges.length),T$(8),$B(),Ex(`items`,e.videoChannels),Gj(),$B(),MV(e.formErrors.channel?10:-1)}}var ki=class n extends r{formReactiveService=g(S$1);changeOwnershipService=g(O);notifier=g(Si);authService=g(nt);modalService=g(sr);accepted=Ahe();modal=Nhe(`modal`);ownershipChanges=[];videoChannels;error=null;ngOnInit(){this.videoChannels=[],ae$1({authService:this.authService,includeCollaborations:!1}).subscribe(t=>this.videoChannels=t),this.buildForm({channel:t})}show(t){this.form.patchValue({channel:this.videoChannels[0].id}),this.ownershipChanges=t,this.modalService.open(this.modal(),{centered:!0}).result.then(()=>this.acceptOwnership()).catch(()=>{this.ownershipChanges=[]})}acceptOwnership(){let t=this.form.value.channel;this.changeOwnershipService.acceptVideo(this.ownershipChanges.map(e=>e.id),{channelId:t}).subscribe({next:()=>{let e=this.ownershipChanges.length,i=XRe("{count, plural, =1 {Video {videoName} accepted} other {{count} videos accepted}}",{count:e,videoName:this.ownershipChanges[0].video.name});this.notifier.success(i),this.accepted&&this.accepted.emit()},error:e=>this.notifier.handleError(e)})}getModalTitle(){let t=this.ownershipChanges.length;return XRe("{count, plural, =1 {Accept video} other {Accept {count} videos}}",{count:t})}static ɵfac=(()=>{let t;return function(i){return(t||(t=iu(n)))(i||n)}})();static ɵcmp=$a$1({type:n,selectors:[[`my-accept-change-video-ownership`]],viewQuery:function(e,i){e&1&&Wx(i.modal,ba,5),e&2&&_$()},outputs:{accepted:`accepted`},features:[ax],decls:2,vars:0,consts:()=>{let t;t="Закрити це модальне вікно";let e;e="Скасувати";let i;i="Погодитися";let o;return o="{VAR_PLURAL, plural, =1 {Select a channel to receive the video} other {Select a channel to receive the videos}}",o=C$(o,{VAR_PLURAL:`�0�`}),[[`modal`,``],o,[1,`modal-header`],[1,`modal-title`],[`title`,t,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`,e,1,`peertube-button`,`secondary-button`,3,`click`,`key.enter`],[`type`,`submit`,`value`,i,1,`peertube-button`,`primary-button`,3,`click`]]},template:function(e,i){e&1&&lx(0,Oa,15,5,`ng-template`,null,0,_5)},dependencies:[X1,Jn,qn,$n,Qn,Vn$2,yn,Y],styles:[`.peertube-select-container[_ngcontent-%COMP%]{width:350px}@media screen and (max-width:380px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}`],changeDetection:1})};var Ra=[`acceptChangeVideoOwnershipComponent`];var Na=[`table`];function Aa(n,t){if(n&1&&($b(0),S$(1,6),T5(2,`myNumberFormatter`),nh()),n&2){let e=t.$implicit;$B(2),jx(e)(D5(2,2,e)),T$(1)}}function Da(n,t){n&1&&(wp(0,`span`,11),J$(1,`TO YOU`),Bb())}function La(n,t){if(n&1&&th(0,`my-actor-cell`,12),n&2){let e=D$().$implicit;Ex(`actor`,e.nextOwnerAccount)(`displayAvatar`,!0)(`displayUsername`,!0)}}function wa(n,t){if(n&1&&(wp(0,`td`),th(1,`my-video-cell`,10),Bb(),wp(2,`td`),NV(3,Da,2,0,`span`,11)(4,La,1,3,`my-actor-cell`,12),Bb(),wp(5,`td`),J$(6),T5(7,`ptDate`),Bb(),wp(8,`td`)(9,`span`,13),J$(10),Bb()()),n&2){let e=t.$implicit,i=D$();$B(),Ex(`video`,e.video),$B(2),MV(i.isReceiver(e)?3:4),$B(3),aA(I5(7,5,e.createdAt,`short`)),$B(3),Ex(`ngClass`,i.getStateClass(e.state.id)),$B(),aA(e.state.label)}}function xa(n,t){if(n&1&&th(0,`my-action-dropdown`,14),n&2){let e=t.$implicit;Ex(`actions`,D$().actions)(`entry`,e)}}function Va(n,t){n&1&&($b(0),S$(1,7),nh())}var Bi=class n{notifier=g(Si);changeOwnershipService=g(O);authService=g(nt);acceptChangeVideoOwnershipComponent=Nhe(`acceptChangeVideoOwnershipComponent`);table=Nhe(`table`);actions=[];bulkActions=[];columns=[{id:`video`,label:"Відео",sortable:!1},{id:`targetAccount`,label:"Target account",sortable:!1},{id:`createdAt`,label:"Створено",sortable:!0},{id:`status`,label:"Стан",sortable:!1}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);let{simpleActions:t,bulkActions:e}=Ac([[{label:()=>"Manage video",linkBuilder:i=>[K$1.buildManageUrl(i.video)],isDisplayed:i=>this.isReceiver(i)&&i.state.id===sDe.ACCEPTED||this.isInitiator(i)&&i.state.id!==sDe.ACCEPTED,enableBulk:!1}],[{label:()=>"Accept...",handler:i=>this.openAcceptModal(i),isDisplayed:i=>this.canAcceptOrReject(i),enableBulk:!0},{label:()=>"Відхилити",handler:i=>this.reject(i),isDisplayed:i=>this.canAcceptOrReject(i),enableBulk:!0}]]);this.actions=t,this.bulkActions=e}canAcceptOrReject(t){return this.isReceiver(t)&&t.state.id===sDe.PENDING}isReceiver(t){return t.nextOwnerAccount.id===this.authService.getUser().account.id}isInitiator(t){return t.initiatorAccount.id===this.authService.getUser().account.id}getStateClass(t){switch(t){case sDe.ACCEPTED:return`badge-green`;case sDe.REJECTED:return`badge-red`;default:return`badge-yellow`}}openAcceptModal(t){this.acceptChangeVideoOwnershipComponent().show(t)}accepted(){this.table().loadData()}reject(t){this.changeOwnershipService.rejectVideo(t.map(e=>e.id)).subscribe({next:()=>this.table().loadData(),error:e=>this.notifier.handleError(e)})}_dataLoader(t){return this.changeOwnershipService.listOfVideos(t.pagination,t.sort).pipe(G(e=>({data:e.data.map(i=>x(w({},i),{initiatorAccount:new yd$1(i.initiatorAccount),nextOwnerAccount:new yd$1(i.nextOwnerAccount)})),total:e.total})))}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`my-video-ownership-changes`]],viewQuery:function(e,i){e&1&&Wx(i.acceptChangeVideoOwnershipComponent,Ra,5)(i.table,Na,5),e&2&&_$(2)},decls:12,vars:3,consts:()=>{let t;t="entries per page";let e;e="{VAR_PLURAL, plural, =0 {No video ownership change} =1 {1 video ownership change} other {{INTERPOLATION} video ownership changes}}",e=C$(e,{INTERPOLATION:`�1�`,VAR_PLURAL:`�0�`});let i;i="Дії";let o;return o="Запит на зміну власника не знайдено.",[[`table`,``],[`totalTitle`,``],[`tableCells`,``],[`actionCell`,``],[`noResults`,``],[`acceptChangeVideoOwnershipComponent`,``],e,o,[`key`,`MyOwnershipChangesComponent`,`paginatorText`,t,`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`,i,3,`actions`,`entry`]]},template:function(e,i){e&1&&(wp(0,`my-table`,8,0),lx(2,Aa,3,4,`ng-template`,null,1,_5)(4,wa,11,8,`ng-template`,null,2,_5)(6,xa,1,2,`ng-template`,null,3,_5)(8,Va,2,0,`ng-template`,null,4,_5),Bb(),wp(10,`my-accept-change-video-ownership`,9,5),rh(`accepted`,function(){return i.accepted()}),Bb()),e&2&&Ex(`defaultColumns`,i.columns)(`dataLoader`,i.dataLoader)(`bulkActions`,i.bulkActions)},dependencies:[Au,O3,ki,Xi$1,qi$1,X,ot,s$1,p],encapsulation:2,changeDetection:1})};var zi=class n{static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],decls:1,vars:0,template:function(e,i){e&1&&th(0,`my-video-ownership-changes`)},dependencies:[Bi],encapsulation:2,changeDetection:1})};var Ya=[`table`];function $a(n,t){n&1&&(wp(0,`div`)(1,`p`,12),S$(2,6),Bb()())}function Fa(n,t){if(n&1&&($b(0),S$(1,7),T5(2,`myNumberFormatter`),nh()),n&2){let e=t.$implicit;$B(2),jx(e)(D5(2,2,e)),T$(1)}}function ka(n,t){if(n&1&&(wp(0,`a`,13),th(1,`my-global-icon`,14),$b(2),S$(3,8),nh(),Bb()),n&2)Ex(`routerLink`,a5(D$().getSyncCreateLink()))}function Ba(n,t){if(n&1&&(J$(0),T5(1,`ptDate`)),n&2){let e=D$().$implicit;Kb(` `,I5(1,1,e.lastSyncAt,`short`),` `)}}function za(n,t){n&1&&($b(0),S$(1,9),nh())}function Ha(n,t){if(n&1&&(wp(0,`td`)(1,`a`,15),J$(2),Bb()(),wp(3,`td`),th(4,`my-actor-cell`,16),Bb(),wp(5,`td`)(6,`span`,17),J$(7),Bb()(),wp(8,`td`),J$(9),T5(10,`ptDate`),Bb(),wp(11,`td`),NV(12,Ba,2,4)(13,za,2,0,`ng-container`),Bb()),n&2){let e=t.$implicit,i=D$();$B(),Ex(`href`,e.externalChannelUrl,jw),$B(),aA(e.externalChannelUrl),$B(2),Ex(`actor`,e.channel),$B(2),Ex(`ngClass`,i.getSyncStateClass(e.state.id)),$B(),Kb(` `,e.state.label,` `),$B(2),aA(I5(10,7,e.createdAt,`short`)),$B(3),MV(e.lastSyncAt?12:13)}}function Ua(n,t){if(n&1&&th(0,`my-action-dropdown`,18),n&2){let e=t.$implicit;Ex(`actions`,D$().videoChannelSyncActions)(`entry`,e)}}function Ga(n,t){n&1&&($b(0),S$(1,10),nh())}var Hi=class n{videoChannelsSyncService=g(L);serverService=g(Zt);notifier=g(Si);authService=g(nt);videoChannelService=g(z);table=Nhe(`table`);videoChannelSyncActions=[];serverConfig;columns=[{id:`externalChannelUrl`,label:"External Channel",sortable:!0},{id:`videoChannel`,label:"Канал",sortable:!0},{id:`state`,label:"Стан",sortable:!0},{id:`createdAt`,label:"Створено",sortable:!0},{id:`lastSyncAt`,label:"Last synchronization at",sortable:!0}];dataLoader;get user(){return this.authService.getUser()}constructor(){this.dataLoader=this._dataLoader.bind(this)}ngOnInit(){this.serverConfig=this.serverService.getHTMLConfig(),this.videoChannelSyncActions=[[{label:"Список імпортів",linkBuilder:()=>[`/my-library/video-imports`],queryParamsBuilder:t=>({videoChannelSyncId:t.id}),iconName:`cloud-download`}],[{label:"Видалити",iconName:`delete`,handler:t=>this.deleteSync(t)},{label:"Повністю синхронізований канал",description:"Це завантажує всі відсутні відео на локальний канал",iconName:`refresh`,handler:t=>this.fullySynchronize(t)}]]}_dataLoader(t){return this.authService.userInformationLoaded.pipe(Ze(),xe(()=>this.videoChannelsSyncService.listByAccount({sort:t.sort,pagination:t.pagination,includeCollaborations:!0,account:this.authService.getUser().account})))}syncEnabled(){return this.serverConfig.import.videoChannelSynchronization.enabled}deleteSync(t){this.videoChannelsSyncService.delete(t.id).subscribe({next:()=>{this.notifier.success(`Синхронізацію успішно вилучено для ${t.channel.displayName}.`),this.table().loadData()},error:e=>this.notifier.handleError(e)})}fullySynchronize(t){this.videoChannelService.importVideos(t.channel.name,t.externalChannelUrl,t.id).subscribe({next:()=>{this.notifier.success(`Успішно надіслано запит на повну синхронізацію для ${t.channel.displayName}.`)},error:e=>this.notifier.handleError(e)})}getSyncCreateLink(){return`/my-library/video-channel-syncs/create`}getSyncStateClass(t){return Qt(t)}getChannelUrl(t){return`/c/`+t}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],viewQuery:function(e,i){e&1&&Wx(i.table,Ya,5),e&2&&_$()},decls:13,vars:3,consts:()=>{let t;t="syncs per page";let e;e="⚠️ Сервер не дозволяє синхронізацію каналів";let i;i="{VAR_PLURAL, plural, =0 {No sync} =1 {1 sync} other {{INTERPOLATION} syncs}}",i=C$(i,{INTERPOLATION:`�1�`,VAR_PLURAL:`�0�`});let o;o="Додати синхронізацію";let r;r="Never";let d;return d="You don't have channel synchronisation configured.",[[`table`,``],[`totalTitle`,``],[`captionRight`,``],[`tableCells`,``],[`actionCell`,``],[`noResults`,``],e,i,o,r,d,[`key`,`MyVideoChannelsSyncComponent`,`paginatorText`,t,`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(e,i){e&1&&(NV(0,$a,3,0,`div`),wp(1,`my-table`,11,0),lx(3,Fa,3,4,`ng-template`,null,1,_5)(5,ka,4,2,`ng-template`,null,2,_5)(7,Ha,14,10,`ng-template`,null,3,_5)(9,Ua,1,2,`ng-template`,null,4,_5)(11,Ga,2,0,`ng-template`,null,5,_5),Bb()),e&2&&(MV(i.syncEnabled()?-1:0),$B(),Ex(`defaultColumns`,i.columns)(`dataLoader`,i.dataLoader))},dependencies:[Au,O3,X1,vm,X,qi$1,ot,s$1,p],encapsulation:2,changeDetection:1})};var Wa=n=>({"input-error":n});function Xa(n,t){if(n&1&&(wp(0,`my-alert`,7),J$(1),Bb()),n&2){let e=D$();$B(),aA(e.error)}}function ja(n,t){if(n&1&&(wp(0,`div`,16),J$(1),Bb()),n&2){let e=D$();$B(),aA(e.formErrors.externalChannelUrl)}}function Qa(n,t){if(n&1&&(wp(0,`div`,16),J$(1),Bb()),n&2){let e=D$();$B(),aA(e.formErrors.videoChannel)}}var Ui=class n extends r{formReactiveService=g(S$1);authService=g(nt);router=g(Et);notifier=g(Si);videoChannelSyncService=g(L);videoChannelService=g(z);serverService=g(Zt);videoService=g(H);error;channels=[];existingVideosStrategy;videoPrivacies=[];ngOnInit(){this.buildForm({externalChannelUrl:c$1,videoChannel:l,existingVideoStrategy:l,videoPrivacy:ue}),ae$1({authService:this.authService,includeCollaborations:!0}).subscribe(t=>this.channels=t),this.serverService.getVideoPrivacies().subscribe(t=>{let e=t.filter(i=>i.id!==sn.PASSWORD_PROTECTED);this.videoPrivacies=this.videoService.explainedPrivacyLabels(e).videoPrivacies})}getFormButtonTitle(){return "Створити"}formValidated(){this.error=void 0;let t=this.form.value,e={externalChannelUrl:t.externalChannelUrl,videoChannelId:t.videoChannel,videoPrivacy:t.videoPrivacy},i=t.existingVideoStrategy===`import`;this.videoChannelSyncService.create(e).pipe(xe(({videoChannelSync:o})=>i?this.videoChannelService.importVideos(o.channel.name,o.externalChannelUrl,o.id):Promise.resolve(null))).subscribe({next:()=>{this.notifier.success("Синхронізацію створено успішно."),this.router.navigate([`/my-library`,`video-channel-syncs`])},error:o=>{this.error=o.message}})}static ɵfac=(()=>{let t;return function(i){return(t||(t=iu(n)))(i||n)}})();static ɵcmp=$a$1({type:n,selectors:[[`my-video-channel-sync-edit`]],features:[ax],decls:34,vars:12,consts:()=>{let t;t="Приклад: https://youtube.com/channel/UC_fancy_channel";let e;e="НОВА СИНХРОНІЗАЦІЯ";let i;i="URL віддаленого каналу";let o;o="Video channel";let r;r="Опції для наявних відео на віддаленому каналі:";let d;d="Імпортувати все та слідкувати за новими публікаціями";let c;c="Слідкувати лише за новими публікаціями";let C;return C="Privacy of imported videos",[e,i,o,r,d,c,C,[`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`,t,`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`],[`for`,`videoPrivacy`],[`inputId`,`videoPrivacy`,`formControlName`,`videoPrivacy`,3,`items`],[`type`,`submit`,1,`peertube-button`,`primary-button`,3,`value`,`disabled`]]},template:function(e,i){e&1&&(NV(0,Xa,2,1,`my-alert`,7),wp(1,`div`,8)(2,`div`,9)(3,`h2`),S$(4,0),Bb()(),wp(5,`div`,10)(6,`form`,11),rh(`ngSubmit`,function(){return i.formValidated()}),wp(7,`div`,12)(8,`label`,13),S$(9,1),Bb(),wp(10,`div`,14),th(11,`input`,15),Vj(),Bb(),NV(12,ja,2,1,`div`,16),Bb(),wp(13,`div`,12)(14,`label`,17),S$(15,2),Bb(),th(16,`my-select-channel-user`,18),Vj(),NV(17,Qa,2,1,`div`,16),Bb(),wp(18,`div`,19)(19,`label`,20),S$(20,3),Bb(),wp(21,`div`,21),th(22,`input`,22),Vj(),wp(23,`label`,23),S$(24,4),Bb()(),wp(25,`div`,21),th(26,`input`,24),Vj(),wp(27,`label`,25),S$(28,5),Bb()()(),wp(29,`div`,12)(30,`label`,26),S$(31,6),Bb(),th(32,`my-select-options`,27),Vj(),Bb(),th(33,`input`,28),Bb()()()),e&2&&(MV(i.error?0:-1),$B(6),Ex(`formGroup`,i.form),$B(5),Ex(`ngClass`,h5(10,Wa,i.formErrors.externalChannelUrl)),Gj(),$B(),MV(i.formErrors.externalChannelUrl?12:-1),$B(4),Ex(`items`,i.channels),Gj(),$B(),MV(i.formErrors.videoChannel?17:-1),$B(5),Gj(),$B(4),Gj(),$B(6),Ex(`items`,i.videoPrivacies),Gj(),$B(),Ex(`value`,a5(i.getFormButtonTitle()))(`disabled`,!i.form.valid))},dependencies:[Jn,Zn,Je$1,fn,qn,$n,Qn,Vn$2,yn,O3,Y,c,oi],styles:[`input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--%NS%input-y-padding) var(--%NS%input-x-padding);width:480px;max-width:480px;color:var(--%NS%input-fg);background-color:var(--%NS%input-bg);border:var(--%NS%input-border-width) solid var(--%NS%input-border-color);border-radius:var(--%NS%input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--%NS%input-placeholder-color);font-size:var(--%NS%input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--%NS%fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--%NS%fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--%NS%fg-300);opacity:.8}@media screen and (max-width:520px){input[type=text][_ngcontent-%COMP%]{width:100%}}my-select-channel-user[_ngcontent-%COMP%], my-select-options[_ngcontent-%COMP%]{display:block;max-width:480px}`],changeDetection:1})};var qa=[`table`];function Za(n,t){if(n&1&&($b(0),S$(1,6),T5(2,`myNumberFormatter`),nh()),n&2){let e=t.$implicit;$B(2),jx(e)(D5(2,2,e)),T$(1)}}function Ka(n,t){if(n&1&&(wp(0,`a`,11),J$(1),Bb()),n&2){let e=D$().$implicit;Ex(`href`,e.targetUrl,jw)(`title`,e.targetUrl),$B(),aA(e.targetUrl)}}function Ja(n,t){if(n&1&&(wp(0,`span`,12),J$(1),Bb()),n&2){let e=D$().$implicit;Ex(`title`,e.torrentName||e.magnetUri),$B(),aA(e.torrentName||e.magnetUri)}}function es(n,t){if(n&1&&th(0,`my-actor-cell`,13),n&2){let e=D$().$implicit;Ex(`actor`,e.video.channel)}}function ts(n,t){if(n&1&&J$(0),n&2){let e=D$().$implicit;Kb(` `,e.video?.name,` `)}}function is(n,t){if(n&1&&(wp(0,`a`,15),J$(1),Bb()),n&2){let e=D$(2).$implicit;Ex(`href`,D$().getVideoUrl(e.video),jw),$B(),aA(e.video?.name)}}function ns(n,t){n&1&&($b(0),S$(1,7),nh())}function os(n,t){if(n&1&&NV(0,is,2,2,`a`,15)(1,ns,2,0,`ng-container`),n&2){let e=D$().$implicit;MV(e.video?0:1)}}function rs(n,t){if(n&1&&(wp(0,`td`,10),NV(1,Ka,2,3,`a`,11)(2,Ja,2,2,`span`,12),Bb(),wp(3,`td`),NV(4,es,1,1,`my-actor-cell`,13),Bb(),wp(5,`td`),NV(6,ts,1,1)(7,os,2,1),Bb(),wp(8,`td`)(9,`span`,14),J$(10),Bb()(),wp(11,`td`),J$(12),T5(13,`ptDate`),Bb()),n&2){let e=t.$implicit,i=D$();$B(),MV(e.targetUrl?1:2),$B(3),MV(e.video?.channel?4:-1),$B(2),MV(i.isVideoImportPending(e)?6:i.isVideoImportSuccess(e)?7:-1),$B(3),Ex(`ngClass`,i.getVideoImportStateClass(e.state.id)),$B(),Kb(` `,e.state.label,` `),$B(2),aA(I5(13,6,e.createdAt,`short`))}}function as(n,t){if(n&1&&th(0,`my-action-dropdown`,16),n&2){let e=t.$implicit;Ex(`actions`,D$().videoImportActions)(`entry`,e)}}function ss(n,t){if(n&1&&(wp(0,`pre`),J$(1),Bb()),n&2){let e=t.$implicit;$B(),aA(e.error)}}function ls(n,t){n&1&&($b(0),S$(1,8),nh())}var Gi=class n{notifier=g(Si);videoImportService=g(_);table=Nhe(`table`);inputFilters=[{key:`state`,type:`select`,title:"Стан",clearable:!0,items:[{id:``+yM.PENDING,label:"PENDING",classes:[`pt-badge`,this.getVideoImportStateClass(yM.PENDING)]},{id:``+yM.PROCESSING,label:"PROCESSING",classes:[`pt-badge`,this.getVideoImportStateClass(yM.PROCESSING)]},{id:``+yM.SUCCESS,label:"SUCCESS",classes:[`pt-badge`,this.getVideoImportStateClass(yM.SUCCESS)]},{id:``+yM.FAILED,label:"FAILED",classes:[`pt-badge`,this.getVideoImportStateClass(yM.FAILED)]},{id:``+yM.REJECTED,label:"REJECTED",classes:[`pt-badge`,this.getVideoImportStateClass(yM.REJECTED)]},{id:``+yM.CANCELLED,label:"CANCELLED",classes:[`pt-badge`,this.getVideoImportStateClass(yM.CANCELLED)]}]},{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:"Ціль",sortable:!1},{id:`channel`,label:"Канал",sortable:!1},{id:`video`,label:"Відео",sortable:!1},{id:`state`,label:"Стан",sortable:!1},{id:`createdAt`,label:"Створено",sortable:!0}];dataLoader;hasExpandedRow;constructor(){this.dataLoader=this._dataLoader.bind(this),this.hasExpandedRow=this._hasExpandedRow.bind(this)}ngOnInit(){this.videoImportActions=[{label:"Cancel import",iconName:`no`,handler:t=>this.cancelImport(t),isDisplayed:t=>this.isVideoImportPending(t)},{label:"Retry import",iconName:`refresh`,handler:t=>this.retryImport(t),isDisplayed:t=>tIe.includes(t.state.id)},{label:"Delete import task",description:"The associated video is not deleted",iconName:`delete`,handler:t=>this.deleteImport(t),isDisplayed:t=>this.isVideoImportFailed(t)||this.isVideoImportCancelled(t)||!t.video},{label:"Edit video",iconName:`edit`,linkBuilder:t=>[this.getEditVideoUrl(t.video)],isDisplayed:t=>this.isVideoImportSuccess(t)&&!!t.video}]}getVideoImportStateClass(t){switch(t){case yM.FAILED:return`badge-red`;case yM.REJECTED:return`badge-banned`;case yM.PENDING:return`badge-yellow`;case yM.PROCESSING:return`badge-blue`;default:return`badge-green`}}isVideoImportSuccess(t){return t.state.id===yM.SUCCESS}isVideoImportPending(t){return t.state.id===yM.PENDING}isVideoImportFailed(t){return t.state.id===yM.FAILED}isVideoImportCancelled(t){return t.state.id===yM.CANCELLED}getVideoUrl(t){return K$1.buildWatchUrl(t)}getEditVideoUrl(t){return K$1.buildManageUrl(t)}deleteImport(t){this.videoImportService.deleteVideoImport(t).subscribe({next:()=>this.table().loadData(),error:e=>this.notifier.handleError(e)})}cancelImport(t){this.videoImportService.cancelVideoImport(t).subscribe({next:()=>this.table().loadData(),error:e=>this.notifier.handleError(e)})}retryImport(t){this.videoImportService.retryVideoImport(t).subscribe({next:()=>this.table().loadData(),error:e=>this.notifier.handleError(e)})}_dataLoader(t){let o=t,{state:e}=o,i=y(o,[`state`]);return this.videoImportService.listMyVideoImports(x(w({},i),{stateOneOf:e?[+e]:void 0,includeCollaborations:!0}))}_hasExpandedRow(t){return!!t.error}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],viewQuery:function(e,i){e&1&&Wx(i.table,qa,5),e&2&&_$()},decls:12,vars:4,consts:()=>{let t;t="imports per page";let e;e="{VAR_PLURAL, plural, =0 {No import} =1 {1 import} other {{INTERPOLATION} imports}}",e=C$(e,{INTERPOLATION:`�1�`,VAR_PLURAL:`�0�`});let i;i="This video has been deleted";let o;o="Дії";let r;return r="No video import found.",[[`table`,``],[`totalTitle`,``],[`tableCells`,``],[`actionCell`,``],[`expandedRow`,``],[`noResults`,``],e,i,r,[`key`,`MyVideoImportsComponent`,`paginatorText`,t,`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`,o,`container`,`body`,3,`actions`,`entry`]]},template:function(e,i){e&1&&(wp(0,`my-table`,9,0),lx(2,Za,3,4,`ng-template`,null,1,_5)(4,rs,14,9,`ng-template`,null,2,_5)(6,as,1,2,`ng-template`,null,3,_5)(8,ss,2,1,`ng-template`,null,4,_5)(10,ls,2,0,`ng-template`,null,5,_5),Bb()),e&2&&Ex(`defaultColumns`,i.columns)(`dataLoader`,i.dataLoader)(`inputFilters`,i.inputFilters)(`hasExpandedRow`,i.hasExpandedRow)},dependencies:[Au,O3,qi$1,ot,X,s$1,p],styles:[`pre[_ngcontent-%COMP%]{font-size:11px}.video-import-error[_ngcontent-%COMP%]{color:var(--%NS%red)}`],changeDetection:1})};var Dt=class extends r{videoPlaylistToUpdate;channels=[];videoPlaylistPrivacies=[]};var ds=n=>({"input-error":n});var cs=n=>[`/my-library/video-playlists/update`,n];function _s(n,t){if(n&1&&(wp(0,`my-alert`,14),J$(1),Bb()),n&2){let e=D$();$B(),aA(e.error)}}function ps(n,t){n&1&&(wp(0,`li`,21),S$(1,6),Bb())}function ms(n,t){if(n&1&&(wp(0,`a`,41),J$(1),Bb()),n&2){let e=D$(2);Ex(`routerLink`,h5(2,cs,e.videoPlaylistToUpdate?.shortUUID)),$B(),Kb(` `,e.videoPlaylistToUpdate?.displayName,` `)}}function us(n,t){if(n&1&&(wp(0,`li`,21),S$(1,7),Bb(),wp(2,`li`,40),NV(3,ms,2,4,`a`,41),Bb()),n&2){let e=D$();$B(3),MV(e.videoPlaylistToUpdate?3:-1)}}function hs(n,t){n&1&&(wp(0,`h2`,22),S$(1,8),Bb())}function gs(n,t){n&1&&(wp(0,`h2`,22),S$(1,9),Bb())}function fs(n,t){if(n&1&&(wp(0,`div`,30),J$(1),Bb()),n&2){let e=D$();$B(),Kb(` `,e.formErrors.displayName,` `)}}function Cs(n,t){if(n&1&&(wp(0,`div`,30),J$(1),Bb()),n&2){let e=D$();$B(),aA(e.formErrors.privacy)}}function ys(n,t){if(n&1&&(wp(0,`div`,37)(1,`div`),S$(2,10),Bb(),wp(3,`div`),S$(4,11),Bb()()),n&2){let e=D$();$B(2),jx(e.getOwnerAccountDisplayName()),T$(2)}}function Ss(n,t){if(n&1&&(wp(0,`div`,30),J$(1),Bb()),n&2){let e=D$();$B(),aA(e.formErrors.videoChannelId)}}function vs(n,t){n&1&&(wp(0,`div`,25)(1,`my-peertube-checkbox`,42),$b(2,43),wp(3,`span`),S$(4,12),Bb(),th(5,`br`),wp(6,`span`),S$(7,13),Bb(),nh(),Bb(),Vj(),Bb()),n&2&&($B(),Gj())}var Wi=class n extends Dt{formReactiveService=g(S$1);authService=g(nt);notifier=g(Si);router=g(Et);videoPlaylistService=g(Z);serverService=g(Zt);error;ngOnInit(){this.buildForm({displayName:q$2,privacy:k,description:w$1,videoChannelId:G$1,insertAtFirstPosition:null,thumbnailfile:null}),this.form.get(`privacy`).valueChanges.subscribe(t=>{K$2(this.form.get(`videoChannelId`),t)}),ae$1({authService:this.authService,includeCollaborations:!0}).subscribe(t=>this.channels=t),this.serverService.getVideoPlaylistPrivacies().subscribe(t=>{this.videoPlaylistPrivacies=t,this.form.patchValue({privacy:uIe.PRIVATE})})}formValidated(){this.error=void 0;let t=this.form.value,e={displayName:t.displayName,privacy:t.privacy,description:t.description||null,videoChannelId:t.videoChannelId||null,thumbnailfile:t.thumbnailfile||null};this.videoPlaylistService.createVideoPlaylist(e).pipe(je(({videoPlaylist:{id:i}})=>{if(t.insertAtFirstPosition!==!0||!t.videoChannelId)return M(!0);let o=this.channels.find(r=>r.id===t.videoChannelId)?.name;return this.videoPlaylistService.getVideoPlaylist(i).pipe(je(r=>this.videoPlaylistService.reorderPlaylistsOfChannel(o,r.videoChannelPosition,0)))})).subscribe({next:()=>{this.notifier.success(`Добірку ${e.displayName} створено.`),this.router.navigate([`/my-library`,`video-playlists`])},error:i=>{this.error=i.message}})}isCreation(){return!0}isEditor(){return!1}getOwnerAccountDisplayName(){return this.authService.getUser().account.displayName}getFormButtonTitle(){return "Створити"}static ɵfac=(()=>{let t;return function(i){return(t||(t=iu(n)))(i||n)}})();static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],features:[ax],decls:41,vars:18,consts:()=>{let t;t="Редагувати";let e;e="Мої добірки";let i;i="Мініатюра добірки";let o;o="Видиме ім'я";let r;r="Опис";let d;d="Приватність";let c;c="Канал";let C;C="Створити";let y;y="Редагувати";let P;P="НОВА ДОБІРКА";let q;q="UPDATE PLAYLIST";let se;se=` Only ${`�0�`}'s channels are listed `;let we;we=" Changing the owner of a playlist is not supported ";let rt;rt="Insert at the first position in your channel's playlist list";let at;at="Playlists can be manually sorted in your channel.";let K;return K="By default, new playlists are added at the end of the list.",[e,i,o,r,d,c,C,y,P,q,se,we,at,K,[`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`,t,`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`,rt],[`ngProjectAs`,`description`,5,[`description`]]]},template:function(e,i){e&1&&(NV(0,_s,2,1,`my-alert`,14),wp(1,`div`,15)(2,`div`,16)(3,`nav`,17)(4,`ol`,18)(5,`li`,19)(6,`a`,20),S$(7,0),Bb()(),NV(8,ps,2,0,`li`,21)(9,us,4,1),Bb()(),NV(10,hs,2,0,`h2`,22)(11,gs,2,0,`h2`,22),Bb(),wp(12,`div`,23)(13,`form`,24),rh(`ngSubmit`,function(){return i.formValidated()}),wp(14,`div`,25)(15,`label`,26),S$(16,1),Bb(),th(17,`my-image-input`,27),Vj(),Bb(),wp(18,`div`,25)(19,`label`,28),S$(20,2),Bb(),th(21,`input`,29),Vj(),NV(22,fs,2,1,`div`,30),Bb(),wp(23,`div`,25)(24,`label`,31),S$(25,3),Bb(),th(26,`my-help`,32)(27,`my-markdown-textarea`,33),Vj(),Bb(),wp(28,`div`,25)(29,`label`,34),S$(30,4),Bb(),th(31,`my-select-options`,35),Vj(),NV(32,Cs,2,1,`div`,30),Bb(),wp(33,`div`,25)(34,`label`,36),S$(35,5),Bb(),NV(36,ys,5,1,`div`,37),th(37,`my-select-channel-user`,38),Vj(),NV(38,Ss,2,1,`div`,30),Bb(),NV(39,vs,8,0,`div`,25),th(40,`input`,39),Bb()()()),e&2&&(MV(i.error?0:-1),$B(8),MV(i.isCreation()?8:9),$B(2),MV(i.isCreation()?10:11),$B(3),Ex(`formGroup`,i.form),$B(4),Gj(),$B(4),Ex(`ngClass`,h5(16,ds,i.formErrors.displayName)),Gj(),$B(),MV(i.formErrors.displayName?22:-1),$B(5),Ex(`formError`,i.formErrors.description),Gj(),$B(4),Ex(`items`,i.videoPlaylistPrivacies),Gj(),$B(),MV(i.formErrors.privacy?32:-1),$B(4),MV(i.isEditor()?36:-1),$B(),Ex(`items`,i.channels),Gj(),$B(),MV(i.formErrors.videoChannelId?38:-1),$B(),MV(i.isCreation()&&i.form.value.videoChannelId?39:-1),$B(),Ex(`value`,a5(i.getFormButtonTitle()))(`disabled`,!i.form.valid))},dependencies:[Au,O3,vm,Jn,Zn,Je$1,qn,$n,Qn,Vn$2,yn,k$1,S$2,_e,oi,Y,c,q$1],styles:[`input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--%NS%input-y-padding) var(--%NS%input-x-padding);width:340px;max-width:340px;color:var(--%NS%input-fg);background-color:var(--%NS%input-bg);border:var(--%NS%input-border-width) solid var(--%NS%input-border-color);border-radius:var(--%NS%input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--%NS%input-placeholder-color);font-size:var(--%NS%input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--%NS%fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--%NS%fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--%NS%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})};var Ps=20;var mr=(()=>{class n{_ngZone=g(se);_platform=g(it);_renderer=g(Ds$1).createRenderer(null,null);_cleanupGlobalListener;_scrolled=new K;_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 i=this.scrollContainers.get(e);i&&(i.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=Ps){return this._platform.isBrowser?new q(i=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen(`document`,`scroll`,()=>this._scrolled.next())));let o=e>0?this._scrolled.pipe(GF(e)).subscribe(i):this._scrolled.subscribe(i);return this._scrolledCount++,()=>{o.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):M()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,i)=>this.deregister(i)),this._scrolled.complete()}ancestorScrolled(e,i){let o=this.getAncestorScrollContainers(e);return this.scrolled(i).pipe(Ae(r=>!r||o.indexOf(r)>-1))}getAncestorScrollContainers(e){let i=[];return this.scrollContainers.forEach((o,r)=>{this._targetContainsElement(r,e)&&i.push(r)}),i}_targetContainsElement(e,i){let o=se$1(i),r=e.getElementRef().nativeElement;do if(o==r)return!0;while(o=o.parentElement);return!1}static ɵfac=function(i){return new(i||n)};static ɵprov=Ce({token:n,factory:n.ɵfac})}return n})();var Ms=20;var In=(()=>{class n{_platform=g(it);_listeners;_viewportSize=null;_change=new K;_document=g(Ne);constructor(){let e=g(se),i=g(Ds$1).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){let o=r=>this._change.next(r);this._listeners=[i.listen(`window`,`resize`,o),i.listen(`window`,`orientationchange`,o)]}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:i,height:o}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+o,right:e.left+i,height:o,width:i}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,i=this._getWindow(),o=e.documentElement,r=o.getBoundingClientRect();return{top:-r.top||e.body?.scrollTop||i.scrollY||o.scrollTop||0,left:-r.left||e.body?.scrollLeft||i.scrollX||o.scrollLeft||0}}change(e=Ms){return e>0?this._change.pipe(GF(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(i){return new(i||n)};static ɵprov=Ce({token:n,factory:n.ɵfac})}return n})();var ur=(()=>{class n{static ɵfac=function(i){return new(i||n)};static ɵmod=Vn$1({type:n});static ɵinj=Cn({})}return n})();function On(n){let t=n.cloneNode(!0),e=t.querySelectorAll(`[id]`),i=n.nodeName.toLowerCase();t.removeAttribute(`id`);for(let o=0;o<e.length;o++)e[o].removeAttribute(`id`);return i===`canvas`?fr(n,t):(i===`input`||i===`select`||i===`textarea`)&&gr(n,t),hr(`canvas`,n,t,fr),hr(`input, textarea, select`,n,t,gr),t}function hr(n,t,e,i){let o=t.querySelectorAll(n);if(o.length){let r=e.querySelectorAll(n);for(let d=0;d<o.length;d++)i(o[d],r[d])}}var Is=0;function gr(n,t){t.type!==`file`&&(t.value=n.value),t.type===`radio`&&t.name&&(t.name=`mat-clone-${t.name}-${Is++}`)}function fr(n,t){let e=t.getContext(`2d`);if(e)try{e.drawImage(n,0,0)}catch(i){}}function wn(n){let t=n.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function Rn(n,t,e){let{top:i,bottom:o,left:r,right:d}=n;return e>=i&&e<=o&&t>=r&&t<=d}function bs(n,t){let e=t.left<n.left,i=t.left+t.width>n.right,o=t.top<n.top,r=t.top+t.height>n.bottom;return e||i||o||r}function Wt(n,t,e){n.top+=t,n.bottom=n.top+n.height,n.left+=e,n.right=n.left+n.width}function Cr(n,t,e,i){let{top:o,right:r,bottom:d,left:c,width:C,height:y}=n,P=C*t,q=y*t;return i>o-q&&i<d+q&&e>c-P&&e<r+P}var Xi=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:wn(e)})})}handleScroll(t){let e=L$1(t),i=this.positions.get(e);if(!i)return null;let o=i.scrollPosition,r,d;if(e===this._document){let y=this.getViewportScrollPosition();r=y.top,d=y.left}else r=e.scrollTop,d=e.scrollLeft;let c=o.top-r,C=o.left-d;return this.positions.forEach((y,P)=>{y.clientRect&&e!==P&&e.contains(P)&&Wt(y.clientRect,c,C)}),o.top=r,o.left=d,{top:c,left:C}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function Ar(n,t){let e=n.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement(`div`);return e.forEach(o=>i.appendChild(o)),i}function xn(n,t,e){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o?n.setProperty(i,o,e?.has(i)?`important`:``):n.removeProperty(i)}return n}function Lt(n,t){let e=t?``:`none`;xn(n.style,{"touch-action":t?``:`none`,"-webkit-user-drag":t?``:`none`,"-webkit-tap-highlight-color":t?``:`transparent`,"user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function yr(n,t,e){xn(n.style,{position:t?``:`fixed`,top:t?``:`0`,opacity:t?``:`0`,left:t?``:`-999em`},e)}function ji(n,t){return t&&t!=`none`?n+` `+t:n}function Sr(n,t){n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,n.style.transform=Xt(t.left,t.top)}function Xt(n,t){return`translate3d(${Math.round(n)}px, ${Math.round(t)}px, 0)`}var Ut={capture:!0};var bn={passive:!1,capture:!0};var Ts=(()=>{class n{static ɵfac=function(i){return new(i||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],hostAttrs:[`cdk-drag-resets-container`,``],decls:0,vars:0,template:function(i,o){},styles:[`@layer cdk-resets {
  .cdk-drag-preview {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    overflow: visible;
    inset: auto;
  }
}
.cdk-drag-placeholder *,
.cdk-drag-preview * {
  pointer-events: none !important;
}
`],encapsulation:2})}return n})();var Vn=(()=>{class n{_ngZone=g(se);_document=g(Ne);_styleLoader=g(st);_renderer=g(Ds$1).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new K;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=Je([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new K;pointerUp=new K;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,bn)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(Ts),this._activeDragInstances.update(o=>[...o,e]),this._activeDragInstances().length===1)){let o=i.type.startsWith(`touch`),r=c=>this.pointerUp.next(c),d=[[`scroll`,c=>this._scroll.next(c),Ut],[`selectstart`,this._preventDefaultWhileDragging,bn]];o?d.push([`touchend`,r,Ut],[`touchcancel`,r,Ut]):d.push([`mouseup`,r,Ut]),o||d.push([`mousemove`,c=>this.pointerMove.next(c),bn]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=d.map(([c,C,y])=>this._renderer.listen(this._document,c,C,y))})}}stopDragging(e){this._activeDragInstances.update(i=>{let o=i.indexOf(e);return o>-1?(i.splice(o,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this._scroll];return e&&e!==this._document&&i.push(new q(o=>this._ngZone.runOutsideAngular(()=>{let r=this._renderer.listen(e,`scroll`,d=>{this._activeDragInstances().length&&o.next(d)},Ut);return()=>{r()}}))),UF(...i)}registerDirectiveNode(e,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,i)}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(i){return new(i||n)};static ɵprov=Ce({token:n,factory:n.ɵfac})}return n})();function vr(n){let t=n.toLowerCase().indexOf(`ms`)>-1?1:1e3;return parseFloat(n)*t}function Os(n){let t=getComputedStyle(n),e=Tn(t,`transition-property`),i=e.find(c=>c===`transform`||c===`all`);if(!i)return 0;let o=e.indexOf(i),r=Tn(t,`transition-duration`),d=Tn(t,`transition-delay`);return vr(r[o])+vr(d[o])}function Tn(n,t){return n.getPropertyValue(t).split(`,`).map(i=>i.trim())}var Rs=new Set([`position`]);var Nn=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(t,e,i,o,r,d,c,C,y,P){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=o,this._previewTemplate=r,this._previewClass=d,this._pickupPositionOnPage=c,this._initialTransform=C,this._zIndex=y,this._renderer=P}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),Er(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return Os(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,o;if(i&&t){let r=t.matchSize?this._initialDomRect:null,d=t.viewContainer.createEmbeddedView(i,t.context);d.detectChanges(),o=Ar(d,this._document),this._previewEmbeddedView=d,t.matchSize?Sr(o,r):o.style.transform=Xt(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else o=On(this._rootElement),Sr(o,this._initialDomRect),this._initialTransform&&(o.style.transform=this._initialTransform);return xn(o.style,{"pointer-events":`none`,margin:Er(o)?`0 auto 0 0`:`0`,position:`fixed`,top:`0`,left:`0`,"z-index":this._zIndex+``},Rs),Lt(o,!1),o.classList.add(`cdk-drag-preview`),o.setAttribute(`popover`,`manual`),o.setAttribute(`dir`,this._direction),e&&(Array.isArray(e)?e.forEach(r=>o.classList.add(r)):o.classList.add(e)),o}};function Er(n){return`showPopover`in n}var Ns={passive:!0};var Pr={passive:!1};var As={passive:!1,capture:!0};var Ds=800;var Mr=`cdk-drag-placeholder`;var Ir=new Set([`position`]);function Dr(n,t,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=n.get(Kr$1,null,{optional:!0})||n.get(Ds$1).createRenderer(null,null);return new An(t,e,n.get(Ne),n.get(se),n.get(In),n.get(Vn),i)}var An=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=Je(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new K;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=We.EMPTY;_pointerUpSubscription=We.EMPTY;_scrollSubscription=We.EMPTY;_resizeSubscription=We.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_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(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>Lt(e,t)))}_disabled=!1;beforeStarted=new K;started=new K;released=new K;ended=new K;entered=new K;exited=new K;dropped=new K;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,o,r,d,c){this._config=e,this._document=i,this._ngZone=o,this._viewportRuler=r,this._dragDropRegistry=d,this._renderer=c,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new Xi(i),d.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>se$1(i)),this._handles.forEach(i=>Lt(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=se$1(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,`mousedown`,this._pointerDown,Pr),i.listen(e,`touchstart`,this._pointerDown,Ns),i.listen(e,`dragstart`,this._nativeDragStart,Pr)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<`u`&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?se$1(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,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&&bs(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,o=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?o=t.top-e.top:e.bottom>t.bottom&&(o=t.bottom-e.bottom);let r=this._activeTransform.x,d=this._activeTransform.y,c=r+i,C=d+o;this._rootElement.style.transform=Xt(c,C),this._activeTransform={x:c,y:C},this._passiveTransform={x:c,y:C}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),Lt(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),Lt(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_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=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){if(Math.abs(e.x-this._pickupPositionOnPage.x)+Math.abs(e.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){let c=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),C=this._dropContainer;if(!c){this._endDragSequence(t);return}(!C||!C.isDragging()&&!C.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{let o=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,r=this._activeTransform;r.x=i.x-o.x+this._passiveTransform.x,r.y=i.y-o.y+this._passiveTransform.y,this._applyRootElementTransform(r.x,r.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){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:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){Gt(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,`selectstart`,Ls,As)}),i){let o=this._rootElement,r=o.parentNode,d=this._placeholder=this._createPlaceholderElement(),c=this._marker=this._marker||this._document.createComment(``);r.insertBefore(c,o),this._initialTransform=o.style.transform||``,this._preview=new Nn(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)),yr(o,!1,Ir),this._document.body.appendChild(r.replaceChild(d,o)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),o=Gt(e),r=!o&&e.button!==0,d=this._rootElement,c=L$1(e),C=!o&&this._lastTouchEventTime&&this._lastTouchEventTime+Ds>Date.now(),y=o?Q(e):J(e);if(c&&c.draggable&&e.type===`mousedown`&&e.preventDefault(),i||r||C||y)return;if(this._handles.length){let se=d.style;this._rootElementTapHighlight=se.webkitTapHighlightColor||``,se.webkitTapHighlightColor=`transparent`}this._hasMoved=!1,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(se=>this._updateOnScroll(se)),this._boundaryElement&&(this._boundaryRect=wn(this._boundaryElement));let P=this._previewTemplate;this._pickupPositionInElement=P&&P.template&&!P.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let q=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:q.x,y:q.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){yr(this._rootElement,!0,Ir),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,i=e.getItemIndex(this),o=this._getPointerPositionOnPage(t),r=this._getDragDistance(o),d=e._isOverContainer(o.x,o.y);this.ended.next({source:this,distance:r,dropPoint:o,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:d,distance:r,dropPoint:o,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,d,r,o,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:o}){let r=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{let d=this._dropContainer.getItemIndex(this),c=this._dropContainer.getItemAtIndex(d+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(r,this._dropContainer,c),this._dropContainer=r,this._dropContainer.enter(this,t,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(i,o),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass(`cdk-drag-animating`),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let o=c=>{(!c||this._preview&&L$1(c)===this._preview.element&&c.propertyName===`transform`)&&(d(),i(),clearTimeout(r))},r=setTimeout(o,e*1.5),d=this._preview.addEventListener(`transitionend`,o)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=Ar(this._placeholderRef,this._document)):i=On(this._rootElement),i.style.pointerEvents=`none`,i.classList.add(Mr),i}_getPointerPositionInElement(t,e,i){let o=e===this._rootElement?null:e,r=o?o.getBoundingClientRect():t,d=Gt(i)?i.targetTouches[0]:i,c=this._getViewportScrollPosition(),C=d.pageX-r.left-c.left,y=d.pageY-r.top-c.top;return{x:r.left-t.left+C,y:r.top-t.top+y}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=Gt(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,o=i.pageX-e.left,r=i.pageY-e.top;if(this._ownerSVGElement){let d=this._ownerSVGElement.getScreenCTM();if(d){let c=this._ownerSVGElement.createSVGPoint();return c.x=o,c.y=r,c.matrixTransform(d.inverse())}}return{x:o,y:r}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:o}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis===`x`||e===`x`?o=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis===`y`||e===`y`)&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:r,y:d}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,c=this._boundaryRect,{width:C,height:y}=this._getPreviewRect(),P=c.top+d,q=c.bottom-(y-d),se=c.left+r,we=c.right-(C-r);i=br(i,se,we),o=br(o,P,q)}return{x:i,y:o}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,o=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,d=Math.abs(e-r.x),c=Math.abs(i-r.y);return d>this._config.pointerDirectionChangeThreshold&&(o.x=e>r.x?1:-1,r.x=e),c>this._config.pointerDirectionChangeThreshold&&(o.y=i>r.y?1:-1,r.y=i),o}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,Lt(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let i=1/this.scale,o=Xt(t*i,e*i),r=this._rootElement.style;this._initialTransform??=r.transform&&r.transform!=`none`?r.transform:``,r.transform=ji(o,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,o=Xt(t,e);this._preview.setTransform(ji(o,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),o=this._boundaryElement.getBoundingClientRect();if(o.width===0&&o.height===0||i.width===0&&i.height===0)return;let r=o.left-i.left,d=i.right-o.right,c=o.top-i.top,C=i.bottom-o.bottom;o.width>i.width?(r>0&&(t+=r),d>0&&(t-=d)):t=0,o.height>i.height?(c>0&&(e+=c),C>0&&(e-=C)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e==`number`?e:Gt(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=L$1(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&Wt(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(t,e){let i=this._previewContainer||`global`;if(i===`parent`)return t;if(i===`global`){let o=this._document;return e||o.fullscreenElement||o.webkitFullscreenElement||o.mozFullScreenElement||o.msFullscreenElement||o.body}return se$1(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let o=this._anchor??=On(this._placeholder);o.classList.remove(Mr),o.classList.add(`cdk-drag-anchor`),o.style.transform=``,i?i.before(o):se$1(e.element).appendChild(o)}}};function br(n,t,e){return Math.max(t,Math.min(e,n))}function Gt(n){return n.type[0]===`t`}function Ls(n){n.preventDefault()}function Lr(n,t,e){let i=Tr(t,n.length-1),o=Tr(e,n.length-1);if(i===o)return;let r=n[i],d=o<i?-1:1;for(let c=i;c!==o;c+=d)n[c]=n[c+d];n[o]=r}function Tr(n,t){return Math.max(0,Math.min(t,n))}var Qi=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation=`vertical`;direction=`ltr`;constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,i,o){let r=this._itemPositions,d=this._getItemIndexFromPointerPosition(t,e,i,o);if(d===-1&&r.length>0)return null;let c=this.orientation===`horizontal`,C=r.findIndex(K=>K.drag===t),y=r[d],P=r[C].clientRect,q=y.clientRect,se=C>d?1:-1,we=this._getItemOffsetPx(P,q,se),rt=this._getSiblingOffsetPx(C,r,se),at=r.slice();return Lr(r,C,d),r.forEach((K,A)=>{if(at[A]===K)return;let $n=K.drag===t,an=$n?we:rt,Fn=$n?t.getPlaceholderElement():K.drag.getRootElement();K.offset+=an;let kn=Math.round(K.offset*(1/K.drag.scale));c?(Fn.style.transform=ji(`translate3d(${kn}px, 0, 0)`,K.initialTransform),Wt(K.clientRect,0,an)):(Fn.style.transform=ji(`translate3d(0, ${kn}px, 0)`,K.initialTransform),Wt(K.clientRect,an,0))}),this._previousSwap.overlaps=Rn(q,e,i),this._previousSwap.drag=y.drag,this._previousSwap.delta=c?o.x:o.y,{previousIndex:C,currentIndex:d}}enter(t,e,i,o){let r=this._activeDraggables,d=r.indexOf(t),c=t.getPlaceholderElement();d>-1&&r.splice(d,1);let C=o==null||o<0?this._getItemIndexFromPointerPosition(t,e,i):o,y=r[C];if(y===t&&(y=r[C+1]),!y&&(C==null||C===-1||C<r.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(y=r[0]),y&&!this._dragDropRegistry.isDragging(y)){let P=y.getRootElement();P.parentElement.insertBefore(c,P),r.splice(C,0,t)}else this._element.appendChild(c),r.push(t);c.style.transform=``,this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(o=>o.drag===t)?.initialTransform;e.style.transform=i||``}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{Wt(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation===`horizontal`;this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||``,clientRect:wn(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation===`horizontal`&&this.direction===`rtl`?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let o=this.orientation===`horizontal`,r=o?e.left-t.left:e.top-t.top;return i===-1&&(r+=o?e.width-t.width:e.height-t.height),r}_getSiblingOffsetPx(t,e,i){let o=this.orientation===`horizontal`,r=e[t].clientRect,d=e[t+i*-1],c=r[o?`width`:`height`]*i;if(d){let C=o?`left`:`top`,y=o?`right`:`bottom`;i===-1?c-=d.clientRect[C]-r[y]:c+=r[C]-d.clientRect[y]}return c}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,o=this.orientation===`horizontal`;if(i[0].drag!==this._activeDraggables[0]){let d=i[i.length-1].clientRect;return o?t>=d.right:e>=d.bottom}else{let d=i[0].clientRect;return o?t<=d.left:e<=d.top}}_getItemIndexFromPointerPosition(t,e,i,o){let r=this.orientation===`horizontal`,d=this._itemPositions.findIndex(({drag:c,clientRect:C})=>{if(c===t)return!1;if(o){let y=r?o.x:o.y;if(c===this._previousSwap.drag&&this._previousSwap.overlaps&&y===this._previousSwap.delta)return!1}return r?e>=Math.floor(C.left)&&e<Math.floor(C.right):i>=Math.floor(C.top)&&i<Math.floor(C.bottom)});return d===-1||!this._sortPredicate(d,t)?-1:d}};var Dn=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let o=e[i];this._relatedNodes.push([o,o.nextSibling])}this.withItems(t)}sort(t,e,i,o){let r=this._getItemIndexFromPointerPosition(t,e,i),d=this._previousSwap;if(r===-1||this._activeItems[r]===t)return null;let c=this._activeItems[r];if(d.drag===c&&d.overlaps&&d.deltaX===o.x&&d.deltaY===o.y)return null;let C=this.getItemIndex(t),y=t.getPlaceholderElement(),P=c.getRootElement();r>C?P.after(y):P.before(y),Lr(this._activeItems,C,r);let q=this._getRootNode().elementFromPoint(e,i);return d.deltaX=o.x,d.deltaY=o.y,d.drag=c,d.overlaps=P===q||P.contains(q),{previousIndex:C,currentIndex:r}}enter(t,e,i,o){let r=this._activeItems.indexOf(t);r>-1&&this._activeItems.splice(r,1);let d=o==null||o<0?this._getItemIndexFromPointerPosition(t,e,i):o;d===-1&&(d=this._getClosestItemIndexToPointer(t,e,i));let c=this._activeItems[d];c&&!this._dragDropRegistry.isDragging(c)?(this._activeItems.splice(d,0,t),c.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[o,r]=this._relatedNodes[i];o.parentNode===t&&o.nextSibling!==r&&(r===null?t.appendChild(o):r.parentNode===t&&t.insertBefore(o,r))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let o=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),r=o?this._activeItems.findIndex(d=>{let c=d.getRootElement();return o===c||c.contains(o)}):-1;return r===-1||!this._sortPredicate(r,t)?-1:r}_getRootNode(){return this._rootNode||(this._rootNode=R(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let o=Infinity,r=-1;for(let d=0;d<this._activeItems.length;d++){let c=this._activeItems[d];if(c!==t){let{x:C,y}=c.getRootElement().getBoundingClientRect(),P=Math.hypot(e-C,i-y);P<o&&(o=P,r=d)}}return r}};var Or=.05;var wr=.05;var Ee=(function(n){return n[n.NONE=0]=`NONE`,n[n.UP=1]=`UP`,n[n.DOWN=2]=`DOWN`,n})(Ee||{});var le=(function(n){return n[n.NONE=0]=`NONE`,n[n.LEFT=1]=`LEFT`,n[n.RIGHT=2]=`RIGHT`,n})(le||{});function xr(n,t){return new Ln(t,n.get(Vn),n.get(Ne),n.get(se),n.get(In))}var Ln=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new K;entered=new K;exited=new K;dropped=new K;sorted=new K;receivingStarted=new K;receivingStopped=new K;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=We.EMPTY;_verticalScrollDirection=Ee.NONE;_horizontalScrollDirection=le.NONE;_scrollNode;_stopScrollTimers=new K;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction=`ltr`;constructor(t,e,i,o,r){this._dragDropRegistry=e,this._ngZone=o,this._viewportRuler=r;let d=this.element=se$1(t);this._document=i,this.withOrientation(`vertical`).withElementContainer(d),e.registerDropContainer(this),this._parentPositions=new Xi(i)}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(t,e,i,o){this._draggingStarted(),o==null&&this.sortingDisabled&&(o=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,o),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,o,r,d,c,C){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:o,isPointerOverContainer:r,distance:d,dropPoint:c,event:C})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(o=>o.isDragging()).every(o=>t.indexOf(o)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof Qi&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t===`mixed`)this._sortStrategy=new Dn(this._document,this._dragDropRegistry);else{let e=new Qi(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;se$1(this.element);let i=this._scrollableElements.indexOf(this._container),o=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),o>-1&&this._scrollableElements.splice(o,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,o){if(this.sortingDisabled||!this._domRect||!Cr(this._domRect,Or,e,i))return;let r=this._sortStrategy.sort(t,e,i,o);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,o=Ee.NONE,r=le.NONE;if(this._parentPositions.positions.forEach((d,c)=>{c===this._document||!d.clientRect||i||Cr(d.clientRect,Or,t,e)&&([o,r]=ws(c,d.clientRect,this._direction,t,e),(o||r)&&(i=c))}),!o&&!r){let{width:d,height:c}=this._viewportRuler.getViewportSize(),C={width:d,height:c,top:0,right:d,bottom:c,left:0};o=Vr(C,e),r=Yr(C,t),i=window}i&&(o!==this._verticalScrollDirection||r!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=o,this._horizontalScrollDirection=r,this._scrollNode=i,(o||r)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||``,t.scrollSnapType=t.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=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),FF(0,xF).pipe(cl$1(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===Ee.UP?t.scrollBy(0,-e):this._verticalScrollDirection===Ee.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===le.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===le.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&Rn(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(o=>o._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!Rn(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let o=this._getShadowRoot().elementFromPoint(e,i);return o?o===this._container||this._container.contains(o):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(o=>this.enterPredicate(o,this)||this._draggables.indexOf(o)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=R(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Vr(n,t){let{top:e,bottom:i,height:o}=n,r=o*wr;return t>=e-r&&t<=e+r?Ee.UP:t>=i-r&&t<=i+r?Ee.DOWN:Ee.NONE}function Yr(n,t){let{left:e,right:i,width:o}=n,r=o*wr;return t>=e-r&&t<=e+r?le.LEFT:t>=i-r&&t<=i+r?le.RIGHT:le.NONE}function ws(n,t,e,i,o){let r=Vr(t,o),d=Yr(t,i),c=Ee.NONE,C=le.NONE;if(r){let y=n.scrollTop;r===Ee.UP?y>0&&(c=Ee.UP):n.scrollHeight-y>n.clientHeight&&(c=Ee.DOWN)}if(d){let y=n.scrollLeft;e===`rtl`?d===le.RIGHT?y<0&&(C=le.RIGHT):n.scrollWidth+y>n.clientWidth&&(C=le.LEFT):d===le.LEFT?y>0&&(C=le.LEFT):n.scrollWidth-y>n.clientWidth&&(C=le.RIGHT)}return[c,C]}var xs=(()=>{class n{_injector=g(Tt);createDrag(e,i){return Dr(this._injector,e,i)}createDropList(e){return xr(this._injector,e)}static ɵfac=function(i){return new(i||n)};static ɵprov=Ce({token:n,factory:n.ɵfac})}return n})();var Rr=new x$1(`CDK_DRAG_PARENT`);var Vs=new x$1(`CdkDragHandle`);var $r=new x$1(`CDK_DRAG_CONFIG`);var Fr=new x$1(`CdkDropList`);var kr=(()=>{class n{element=g(Bn);dropContainer=g(Fr,{optional:!0,skipSelf:!0});_ngZone=g(se);_viewContainerRef=g(Xr$1);_dir=g(G$2,{optional:!0});_changeDetectorRef=g(Ls$1);_selfHandle=g(Vs,{optional:!0,self:!0});_parentDrag=g(Rr,{optional:!0,skipSelf:!0});_dragDropRegistry=g(Vn);_destroyed=new K;_handles=new Rt([]);_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=!1;constrainPosition;previewClass;previewContainer;scale=1;started=new zt;released=new zt;ended=new zt;entered=new zt;exited=new zt;dropped=new zt;moved=new q(e=>{let i=this._dragRef.moved.pipe(G(o=>({source:this,pointerPosition:o.pointerPosition,event:o.event,delta:o.delta,distance:o.distance}))).subscribe(e);return()=>{i.unsubscribe()}});_injector=g(Tt);constructor(){let e=this.dropContainer,i=g($r,{optional:!0});this._dragRef=Dr(this._injector,this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(cl$1(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(){du(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let i=e.rootElementSelector,o=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,o&&!o.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 i=this._handles.getValue();i.push(e),this._handles.next(i)}_removeHandle(e){let i=this._handles.getValue(),o=i.indexOf(e);o>-1&&(i.splice(o,1),this._handles.next(i))}_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,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e==`string`?this.element.nativeElement.closest(e):se$1(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,o=this.dragStartDelay,r=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,d=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 o==`object`&&o?o:ae(o),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(r).withPreviewTemplate(d).withPreviewContainer(this.previewContainer||`global`),i&&e.withDirection(i.value)}}),e.beforeStarted.pipe(Nn$1(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let o=this._dragDropRegistry.getDragDirectiveForNode(i);if(o){e.withParent(o._dragRef);break}i=i.parentElement}})}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(e){let{lockAxis:i,dragStartDelay:o,constrainPosition:r,previewClass:d,boundaryElement:c,draggingDisabled:C,rootElementSelector:y,previewContainer:P}=e;this.disabled=C??!1,this.dragStartDelay=o||0,this.lockAxis=i||null,r&&(this.constrainPosition=r),d&&(this.previewClass=d),c&&(this.boundaryElement=c),y&&(this.rootElementSelector=y),P&&(this.previewContainer=P)}_setupHandlesListener(){this._handles.pipe(pt(e=>{let i=e.map(o=>o.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),je(e=>UF(...e.map(i=>i._stateChanges.pipe(ff(i))))),cl$1(this._destroyed)).subscribe(e=>{let i=this._dragRef,o=e.element.nativeElement;e.disabled?i.disableHandle(o):i.enableHandle(o)})}static ɵfac=function(i){return new(i||n)};static ɵdir=hn({type:n,selectors:[[``,`cdkDrag`,``]],hostAttrs:[1,`cdk-drag`],hostVars:4,hostBindings:function(i,o){i&2&&Qx(`cdk-drag-disabled`,o.disabled)(`cdk-drag-dragging`,o._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`,Tu],constrainPosition:[0,`cdkDragConstrainPosition`,`constrainPosition`],previewClass:[0,`cdkDragPreviewClass`,`previewClass`],previewContainer:[0,`cdkDragPreviewContainer`,`previewContainer`],scale:[2,`cdkDragScale`,`scale`,i3]},outputs:{started:`cdkDragStarted`,released:`cdkDragReleased`,ended:`cdkDragEnded`,entered:`cdkDragEntered`,exited:`cdkDragExited`,dropped:`cdkDragDropped`,moved:`cdkDragMoved`},exportAs:[`cdkDrag`],features:[f5([{provide:Rr,useExisting:n}]),ci]})}return n})();var Nr=new x$1(`CdkDropListGroup`);var Br=(()=>{class n{element=g(Bn);_changeDetectorRef=g(Ls$1);_scrollDispatcher=g(mr);_dir=g(G$2,{optional:!0});_group=g(Nr,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new K;_scrollableParentsResolved=!1;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=!1;sortingDisabled=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled=!1;autoScrollStep;elementContainerSelector=null;hasAnchor=!1;dropped=new zt;entered=new zt;exited=new zt;sorted=new zt;_unsortedItems=new Set;constructor(){let e=g($r,{optional:!0}),i=g(Tt);this._dropListRef=xr(i,this.element),this._dropListRef.data=this,e&&this._assignDefaults(e),this._dropListRef.enterPredicate=(o,r)=>this.enterPredicate(o.data,r.data),this._dropListRef.sortPredicate=(o,r,d)=>this.sortPredicate(o,r.data,d.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),n._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(i=>i._dragRef))}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(e._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,i)=>e._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let e=n._dropLists.indexOf(this);e>-1&&n._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(ff(this._dir.value),cl$1(this._destroyed)).subscribe(i=>e.withDirection(i)),e.beforeStarted.subscribe(()=>{let i=pt$1(this.connectedTo).map(o=>{if(typeof o==`string`)return n._dropLists.find(d=>d.id===o);return o});if(this._group&&this._group._items.forEach(o=>{i.indexOf(o)===-1&&i.push(o)}),!this._scrollableParentsResolved){let o=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(r=>r.getElementRef().nativeElement);this._dropListRef.withScrollableParents(o),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let o=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(o)}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=ae(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(i.filter(o=>o&&o!==this).map(o=>o._dropListRef)).withOrientation(this.orientation)})}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck()}),e.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),UF(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(e){let{lockAxis:i,draggingDisabled:o,sortingDisabled:r,listAutoScrollDisabled:d,listOrientation:c}=e;this.disabled=o??!1,this.sortingDisabled=r??!1,this.autoScrollDisabled=d??!1,this.orientation=c||`vertical`,this.lockAxis=i||null}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e)}static ɵfac=function(i){return new(i||n)};static ɵdir=hn({type:n,selectors:[[``,`cdkDropList`,``],[`cdk-drop-list`]],hostAttrs:[1,`cdk-drop-list`],hostVars:7,hostBindings:function(i,o){i&2&&(eh(`id`,o.id),Qx(`cdk-drop-list-disabled`,o.disabled)(`cdk-drop-list-dragging`,o._dropListRef.isDragging())(`cdk-drop-list-receiving`,o._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`,Tu],sortingDisabled:[2,`cdkDropListSortingDisabled`,`sortingDisabled`,Tu],enterPredicate:[0,`cdkDropListEnterPredicate`,`enterPredicate`],sortPredicate:[0,`cdkDropListSortPredicate`,`sortPredicate`],autoScrollDisabled:[2,`cdkDropListAutoScrollDisabled`,`autoScrollDisabled`,Tu],autoScrollStep:[0,`cdkDropListAutoScrollStep`,`autoScrollStep`],elementContainerSelector:[0,`cdkDropListElementContainer`,`elementContainerSelector`],hasAnchor:[2,`cdkDropListHasAnchor`,`hasAnchor`,Tu]},outputs:{dropped:`cdkDropListDropped`,entered:`cdkDropListEntered`,exited:`cdkDropListExited`,sorted:`cdkDropListSorted`},exportAs:[`cdkDropList`],features:[f5([{provide:Nr,useValue:void 0},{provide:Fr,useExisting:n}])]})}return n})();var zr=(()=>{class n{static ɵfac=function(i){return new(i||n)};static ɵmod=Vn$1({type:n});static ɵinj=Cn({providers:[xs],imports:[ur]})}return n})();var Ys=[`videoShareModal`];function $s(n,t){if(n&1&&th(0,`my-video-playlist-miniature`,7),n&2)Ex(`playlist`,D$().playlist)}function Fs(n,t){if(n&1&&th(0,`my-action-dropdown`,10),n&2){let e=D$();Ex(`entry`,e.playlist)(`actions`,e.playlistActions)}}function ks(n,t){n&1&&(wp(0,`div`,12)(1,`div`),S$(2,2),Bb(),wp(3,`div`),S$(4,3),Bb(),wp(5,`div`),Hx(6,4),th(7,`a`,16),Bx(),Bb()())}function Bs(n,t){if(n&1){let e=jV();wp(0,`div`,14)(1,`my-video-playlist-element-miniature`,17),rh(`elementRemoved`,function(o){CI(e);return DI(D$().onElementRemoved(o))}),Bb()()}if(n&2){let e=t.$implicit,i=D$();Ex(`cdkDragStartDelay`,i.getDragStartDelay()),$B(),Ex(`playlistElement`,e)(`playlist`,i.playlist)(`owned`,!0)(`position`,e.position)}}var qi=class n{hooks=g(zg);notifier=g(Si);router=g(Et);confirmService=g(Bc);route=g(eo);screenService=g(Gc);videoPlaylistService=g(Z);videoShareModal=Nhe(`videoShareModal`);errored=!1;playlistElements=[];playlist;playlistActions=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};onDataSubject=new K;videoPlaylistId;paramsSub;ngOnInit(){this.playlistActions=[[{label:"Оновити добірку",iconName:`edit`,linkBuilder:t=>[`/my-library`,`video-playlists`,`update`,t.shortUUID]},{label:"Видалити добірку",iconName:`delete`,handler:t=>this.deleteVideoPlaylist(t)}]],this.paramsSub=this.route.params.subscribe(t=>{this.videoPlaylistId=t.videoPlaylistId,this.loadElements(),this.loadPlaylistInfo()})}ngOnDestroy(){this.paramsSub&&this.paramsSub.unsubscribe()}drop(t){let e=t.previousIndex,i=t.currentIndex;if(e===i)return;let o=this.playlistElements[e].position,r=this.playlistElements[i].position;o>r&&r--;let d=this.playlistElements[e];this.playlistElements.splice(e,1),this.playlistElements.splice(i,0,d),this.videoPlaylistService.reorderVideosOfPlaylist(this.playlist.id,o,r).subscribe({next:()=>{this.reorderClientPositions()},error:c=>this.notifier.handleError(c)})}onElementRemoved(t){let e=this.findFirst();this.playlistElements=this.playlistElements.filter(i=>i.id!==t.id),lVe(this.pagination),this.reorderClientPositions(e)}onNearOfBottom(){this.pagination.totalItems<=this.pagination.currentPage*this.pagination.itemsPerPage||(this.pagination.currentPage+=1,this.loadElements())}trackByFn(t,e){return e.id}isRegularPlaylist(t){return t?.type.id===fIe.REGULAR}showShareModal(){this.videoShareModal().show()}deleteVideoPlaylist(t){return F(this,null,function*(){(yield this.confirmService.confirm(`Справді хочете видалити ${t.displayName}? `,"Видалити"))!==!1&&this.videoPlaylistService.removeVideoPlaylist(t).subscribe({next:()=>{this.router.navigate([`/my-library`,`video-playlists`]),this.notifier.success(`Добірку ${t.displayName} видалено.`)},error:i=>this.notifier.handleError(i)})})}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:t,data:e})=>{this.playlistElements=this.playlistElements.concat(e),this.pagination.totalItems=t,this.onDataSubject.next(e)},error:t=>{this.errored||(this.notifier.handleError(t),this.errored=!0)}})}loadPlaylistInfo(){this.videoPlaylistService.getVideoPlaylist(this.videoPlaylistId).subscribe({next:t=>{this.playlist=t},error:t=>{this.errored||(this.notifier.handleError(t),this.errored=!0)}})}reorderClientPositions(t){if(this.playlistElements.length===0)return;let e=t||this.findFirst(),i=1;for(let r of this.playlistElements)r.position=i,i++;let o=this.findFirst();e&&o&&e.id!==o.id&&this.loadPlaylistInfo()}findFirst(){return this.playlistElements.find(t=>t.position===1)}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],viewQuery:function(e,i){e&1&&Wx(i.videoShareModal,Ys,5),e&2&&_$()},decls:14,vars:5,consts:()=>{let t;t="Поділитись";let e;e="У цій добірці немає відео.";let i;i="Browse videos on PeerTube to add them in your playlist.";let o;return o=`See the ${`�#7�`}documentation${`�/#7�`} for more information.`,[[`videoShareModal`,``],t,e,i,o,[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(e,i){e&1&&(wp(0,`div`,5)(1,`div`,6),NV(2,$s,1,1,`my-video-playlist-miniature`,7),wp(3,`div`,8)(4,`my-button`,9),rh(`click`,function(){return i.showShareModal()}),S$(5,1),Bb(),NV(6,Fs,1,2,`my-action-dropdown`,10),Bb()(),wp(7,`div`,11),NV(8,ks,8,0,`div`,12),wp(9,`div`,13),rh(`nearOfBottom`,function(){return i.onNearOfBottom()})(`cdkDropListDropped`,function(r){return i.drop(r)}),PV(10,Bs,2,5,`div`,14,i.trackByFn,!0),Bb()()(),th(12,`my-video-share`,15,0)),e&2&&($B(2),MV(i.playlist?2:-1),$B(4),MV(i.isRegularPlaylist(i.playlist)?6:-1),$B(2),MV(i.pagination.totalItems===0?8:-1),$B(),Ex(`dataObservable`,i.onDataSubject.asObservable()),$B(),kV(i.playlistElements),$B(2),Ex(`playlist`,i.playlist))},dependencies:[ce,F$1,X,O$1,Br,kr,ht,vt],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(--%NS%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})};var zs=n=>({"input-error":n});var Hs=n=>[`/my-library/video-playlists/update`,n];function Us(n,t){if(n&1&&(wp(0,`my-alert`,14),J$(1),Bb()),n&2){let e=D$();$B(),aA(e.error)}}function Gs(n,t){n&1&&(wp(0,`li`,21),S$(1,6),Bb())}function Ws(n,t){if(n&1&&(wp(0,`a`,41),J$(1),Bb()),n&2){let e=D$(2);Ex(`routerLink`,h5(2,Hs,e.videoPlaylistToUpdate?.shortUUID)),$B(),Kb(` `,e.videoPlaylistToUpdate?.displayName,` `)}}function Xs(n,t){if(n&1&&(wp(0,`li`,21),S$(1,7),Bb(),wp(2,`li`,40),NV(3,Ws,2,4,`a`,41),Bb()),n&2){let e=D$();$B(3),MV(e.videoPlaylistToUpdate?3:-1)}}function js(n,t){n&1&&(wp(0,`h2`,22),S$(1,8),Bb())}function Qs(n,t){n&1&&(wp(0,`h2`,22),S$(1,9),Bb())}function qs(n,t){if(n&1&&(wp(0,`div`,30),J$(1),Bb()),n&2){let e=D$();$B(),Kb(` `,e.formErrors.displayName,` `)}}function Zs(n,t){if(n&1&&(wp(0,`div`,30),J$(1),Bb()),n&2){let e=D$();$B(),aA(e.formErrors.privacy)}}function Ks(n,t){if(n&1&&(wp(0,`div`,37)(1,`div`),S$(2,10),Bb(),wp(3,`div`),S$(4,11),Bb()()),n&2){let e=D$();$B(2),jx(e.getOwnerAccountDisplayName()),T$(2)}}function Js(n,t){if(n&1&&(wp(0,`div`,30),J$(1),Bb()),n&2){let e=D$();$B(),aA(e.formErrors.videoChannelId)}}function el(n,t){n&1&&(wp(0,`div`,25)(1,`my-peertube-checkbox`,42),$b(2,43),wp(3,`span`),S$(4,12),Bb(),th(5,`br`),wp(6,`span`),S$(7,13),Bb(),nh(),Bb(),Vj(),Bb()),n&2&&($B(),Gj())}var Zi=class n extends Dt{formReactiveService=g(S$1);authService=g(nt);notifier=g(Si);router=g(Et);route=g(eo);videoPlaylistService=g(Z);serverService=g(Zt);error;paramsSub;ngOnInit(){this.buildForm({displayName:q$2,privacy:k,description:w$1,videoChannelId:G$1,thumbnailfile:null}),this.form.get(`privacy`).valueChanges.subscribe(t=>{K$2(this.form.get(`videoChannelId`),t)}),this.paramsSub=this.authService.userInformationLoaded.pipe(Ze(),je(()=>this.route.params),G(t=>t.videoPlaylistId),je(t=>_F([this.videoPlaylistService.getVideoPlaylist(t).pipe(je(e=>ae$1({authService:this.authService,includeCollaborations:!0}).pipe(G(i=>({videoPlaylist:e,channels:i}))))),this.serverService.getVideoPlaylistPrivacies()]))).subscribe({next:([{videoPlaylist:t,channels:e},i])=>{this.videoPlaylistToUpdate=t,this.videoPlaylistPrivacies=i,this.channels=e.filter(o=>o.ownerAccountId===this.videoPlaylistToUpdate.ownerAccount.id),this.hydrateFormFromPlaylist()},error:t=>{this.error=t.message}})}ngOnDestroy(){this.paramsSub&&this.paramsSub.unsubscribe()}formValidated(){this.error=void 0;let t=this.form.value,e={displayName:t.displayName,privacy:t.privacy,description:t.description||null,videoChannelId:t.videoChannelId||null,thumbnailfile:t.thumbnailfile||void 0};this.videoPlaylistService.updateVideoPlaylist(this.videoPlaylistToUpdate,e).subscribe({next:()=>{this.notifier.success(`Добірку ${e.displayName} оновлено.`),this.router.navigate([`/my-library`,`video-playlists`])},error:i=>{this.error=i.message}})}isCreation(){return!1}getFormButtonTitle(){return "Оновити"}isEditor(){return this.videoPlaylistToUpdate?this.videoPlaylistToUpdate?.ownerAccount.id!==this.authService.getUser().account.id:!1}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(t=>t.blob()).then(t=>{this.form.patchValue({thumbnailfile:t})})}static ɵfac=(()=>{let t;return function(i){return(t||(t=iu(n)))(i||n)}})();static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],features:[ax],decls:41,vars:18,consts:()=>{let t;t="Редагувати";let e;e="Мої добірки";let i;i="Мініатюра добірки";let o;o="Видиме ім'я";let r;r="Опис";let d;d="Приватність";let c;c="Канал";let C;C="Створити";let y;y="Редагувати";let P;P="НОВА ДОБІРКА";let q;q="UPDATE PLAYLIST";let se;se=` Only ${`�0�`}'s channels are listed `;let we;we=" Changing the owner of a playlist is not supported ";let rt;rt="Insert at the first position in your channel's playlist list";let at;at="Playlists can be manually sorted in your channel.";let K;return K="By default, new playlists are added at the end of the list.",[e,i,o,r,d,c,C,y,P,q,se,we,at,K,[`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`,t,`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`,rt],[`ngProjectAs`,`description`,5,[`description`]]]},template:function(e,i){e&1&&(NV(0,Us,2,1,`my-alert`,14),wp(1,`div`,15)(2,`div`,16)(3,`nav`,17)(4,`ol`,18)(5,`li`,19)(6,`a`,20),S$(7,0),Bb()(),NV(8,Gs,2,0,`li`,21)(9,Xs,4,1),Bb()(),NV(10,js,2,0,`h2`,22)(11,Qs,2,0,`h2`,22),Bb(),wp(12,`div`,23)(13,`form`,24),rh(`ngSubmit`,function(){return i.formValidated()}),wp(14,`div`,25)(15,`label`,26),S$(16,1),Bb(),th(17,`my-image-input`,27),Vj(),Bb(),wp(18,`div`,25)(19,`label`,28),S$(20,2),Bb(),th(21,`input`,29),Vj(),NV(22,qs,2,1,`div`,30),Bb(),wp(23,`div`,25)(24,`label`,31),S$(25,3),Bb(),th(26,`my-help`,32)(27,`my-markdown-textarea`,33),Vj(),Bb(),wp(28,`div`,25)(29,`label`,34),S$(30,4),Bb(),th(31,`my-select-options`,35),Vj(),NV(32,Zs,2,1,`div`,30),Bb(),wp(33,`div`,25)(34,`label`,36),S$(35,5),Bb(),NV(36,Ks,5,1,`div`,37),th(37,`my-select-channel-user`,38),Vj(),NV(38,Js,2,1,`div`,30),Bb(),NV(39,el,8,0,`div`,25),th(40,`input`,39),Bb()()()),e&2&&(MV(i.error?0:-1),$B(8),MV(i.isCreation()?8:9),$B(2),MV(i.isCreation()?10:11),$B(3),Ex(`formGroup`,i.form),$B(4),Gj(),$B(4),Ex(`ngClass`,h5(16,zs,i.formErrors.displayName)),Gj(),$B(),MV(i.formErrors.displayName?22:-1),$B(5),Ex(`formError`,i.formErrors.description),Gj(),$B(4),Ex(`items`,i.videoPlaylistPrivacies),Gj(),$B(),MV(i.formErrors.privacy?32:-1),$B(4),MV(i.isEditor()?36:-1),$B(),Ex(`items`,i.channels),Gj(),$B(),MV(i.formErrors.videoChannelId?38:-1),$B(),MV(i.isCreation()&&i.form.value.videoChannelId?39:-1),$B(),Ex(`value`,a5(i.getFormButtonTitle()))(`disabled`,!i.form.valid))},dependencies:[Au,O3,vm,Jn,Zn,Je$1,qn,$n,Qn,Vn$2,yn,k$1,S$2,_e,oi,Y,c,q$1],styles:[`input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--%NS%input-y-padding) var(--%NS%input-x-padding);width:340px;max-width:340px;color:var(--%NS%input-fg);background-color:var(--%NS%input-bg);border:var(--%NS%input-border-width) solid var(--%NS%input-border-color);border-radius:var(--%NS%input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--%NS%input-placeholder-color);font-size:var(--%NS%input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--%NS%fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--%NS%fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--%NS%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})};var Ur=C(Po());var tl=n=>({active:n});var il=n=>({"is-rtl":n});var nl=n=>({"has-collaborator-state":n});function ol(n,t){n&1&&th(0,`my-collaborator-state`,4)}function rl(n,t){n&1&&th(0,`my-collaborator-state`,5)}function al(n,t){if(n&1&&NV(0,ol,1,0,`my-collaborator-state`,4)(1,rl,1,0,`my-collaborator-state`,5),n&2){let e=D$();MV(e.user.isEditorOfChannel(e.channel())?0:1)}}var wt=class n{authService=g(nt);localeId=g(mn);checked=Rhe(!1);channel=ph.required();inputName=ph(void 0);label=ph("Перемкнути цей канал");get user(){return this.authService.getUser()}isRTL(){return u3(this.localeId)===`rtl`}propagateChange=t=>{};writeValue(t){this.checked.set(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}toggle(){this.checked.set(!this.checked()),this.propagateChange(this.checked())}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`my-channel-toggle`]],inputs:{checked:[1,`checked`],channel:[1,`channel`],inputName:[1,`inputName`],label:[1,`label`]},outputs:{checked:`checkedChange`},features:[f5([{provide:D$1,useExisting:wf(()=>n),multi:!0}])],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(e,i){e&1&&(wp(0,`button`,0),rh(`click`,function(){return i.toggle()}),th(1,`my-actor-avatar`,1),wp(2,`div`,2)(3,`div`,3),J$(4),Bb(),NV(5,al,2,1),Bb()()),e&2&&($$(h5(9,tl,i.checked())),Ex(`title`,i.label()),$B(),$$(h5(11,il,i.isRTL())),Ex(`actor`,i.channel()),$B(),Ex(`ngClass`,h5(13,nl,i.user.isCollaboratingToChannels())),$B(2),aA(i.channel().displayName),$B(),MV(i.user.isCollaboratingToChannels()?5:-1))},dependencies:[Au,O3,R$1,E],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(--%NS%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(--%NS%fg);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(--%NS%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(--%NS%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(--%NS%bg-secondary-450);background-color:var(--%NS%bg-secondary-450)}`],changeDetection:1})};var sl=[`table`];var ll=n=>[`/my-library/video-playlists`,n];var dl=n=>[`/c`,n];var cl=n=>[`update`,n];var _l=(n,t)=>t.id;function pl(n,t){if(n&1){let e=jV();wp(0,`my-channel-toggle`,18),fA(`ngModelChange`,function(o){let r=CI(e).$implicit;return o5(r.selected,o)||(r.selected=o),DI(o)}),rh(`ngModelChange`,function(){let o=CI(e).$implicit;return DI(D$().onChannelFilter(o))}),Bb(),Vj()}if(n&2){let e=t.$implicit;Ex(`channel`,e),dA(`ngModel`,e.selected),Gj()}}function ml(n,t){if(n&1&&($b(0),S$(1,9),T5(2,`myNumberFormatter`),nh()),n&2){let e=D$().$implicit,i=D$();$B(2),jx(e)(D5(2,3,e))(i.getFilteredChannel().displayName),T$(1)}}function ul(n,t){if(n&1&&($b(0),S$(1,10),T5(2,`myNumberFormatter`),nh()),n&2){let e=D$().$implicit;$B(2),jx(e)(D5(2,2,e)),T$(1)}}function hl(n,t){if(n&1&&NV(0,ml,3,5,`ng-container`)(1,ul,3,4,`ng-container`),n&2)MV(D$().getFilteredChannel()?0:1)}function gl(n,t){n&1&&(wp(0,`a`,19),th(1,`my-global-icon`,20),$b(2),S$(3,11),nh(),Bb())}function fl(n,t){if(n&1&&(wp(0,`td`,21),J$(1),Bb()),n&2){let e=D$().$implicit;$B(),Kb(` `,e.videoChannelPosition,` `)}}function Cl(n,t){if(n&1&&(wp(0,`td`),th(1,`my-video-playlist-miniature`,22),Bb()),n&2){let e=D$().$implicit;$B(),Ex(`playlist`,e)}}function yl(n,t){n&1&&th(0,`my-collaborator-state`,26)}function Sl(n,t){n&1&&th(0,`my-collaborator-state`,27)}function vl(n,t){if(n&1&&NV(0,yl,1,0,`my-collaborator-state`,26)(1,Sl,1,0,`my-collaborator-state`,27),n&2){let e=D$(3).$implicit,i=D$();MV(i.user.isOwnerOfChannel(e.videoChannel)?0:i.user.isEditorOfChannel(e.videoChannel)?1:-1)}}function El(n,t){if(n&1&&(wp(0,`a`,25)(1,`span`),J$(2),Bb(),NV(3,vl,2,1),Bb()),n&2){let e=D$(2).$implicit,i=D$();Ex(`routerLink`,h5(3,dl,e.videoChannel.name)),$B(2),aA(e.videoChannel.displayName),$B(),MV(i.user.isCollaboratingToChannels()?3:-1)}}function Pl(n,t){if(n&1&&(wp(0,`td`)(1,`div`,23)(2,`a`,24),J$(3),Bb(),NV(4,El,4,5,`a`,25),Bb()()),n&2){let e=D$().$implicit;$B(2),Ex(`routerLink`,h5(3,ll,e.shortUUID)),$B(),Kb(` `,e.displayName,` `),$B(),MV(e.videoChannel?4:-1)}}function Ml(n,t){if(n&1&&(wp(0,`td`),th(1,`my-privacy-badge`,28),Bb()),n&2){let e=D$().$implicit;$B(),Ex(`playlist`,e)}}function Il(n,t){if(n&1&&(wp(0,`td`),J$(1),T5(2,`ptDate`),Bb()),n&2){let e=D$().$implicit;$B(),Kb(` `,I5(2,1,e.updatedAt,`short`),` `)}}function bl(n,t){if(n&1&&(NV(0,fl,2,1,`td`,21),NV(1,Cl,2,1,`td`),NV(2,Pl,5,5,`td`),NV(3,Ml,2,1,`td`),NV(4,Il,3,4,`td`)),n&2){D$();let e=x$(9);MV(e.isColumnDisplayed(`videoChannelPosition`)?0:-1),$B(),MV(e.isColumnDisplayed(`videos`)?1:-1),$B(),MV(e.isColumnDisplayed(`name`)?2:-1),$B(),MV(e.isColumnDisplayed(`privacy`)?3:-1),$B(),MV(e.isColumnDisplayed(`updatedAt`)?4:-1)}}function Tl(n,t){if(n&1){let e=jV();th(0,`my-edit-button`,29),wp(1,`my-delete-button`,30),rh(`click`,function(){CI(e);let o=D$().$implicit;return DI(D$().deleteVideoPlaylist(o))}),Bb()}if(n&2){let e=D$().$implicit;Ex(`ptRouterLink`,h5(1,cl,e.shortUUID))}}function Ol(n,t){if(n&1&&NV(0,Tl,2,3),n&2){let e=t.$implicit;MV(D$().isRegularPlaylist(e)?0:-1)}}function Rl(n,t){if(n&1&&J$(0),n&2){let e=t.$implicit;Kb(` `,e.description,` `)}}function Nl(n,t){if(n&1&&J$(0),n&2){let e=t.search,i=t.hasFilters;Kb(` `,D$().getNoResults(!!e||i),` `)}}var Hr=(0,Ur.default)(`peertube:my-video-playlists`);var Ki=class n{notifier=g(Si);confirmService=g(Bc);videoPlaylistService=g(Z);auth=g(nt);headerService=g(Yg);cdr=g(Ls$1);screenService=g(Gc);table=Nhe(`table`);user;channels=[];onDataSubject=new K;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(!0),this.user=this.auth.getUser(),this.columns=[{id:`videoChannelPosition`,label:"Position",selected:!0,sortable:!0,isDisplayed:()=>this.hasReorderableRows()},{id:`videos`,label:"Відео",selected:!0,sortable:!1},{id:`name`,label:"Назва",selected:!0,sortable:!0},{id:`privacy`,label:"Приватність",selected:!0,sortable:!1},{id:`updatedAt`,label:"Оновлено",selected:!0,sortable:!0}]}ngOnDestroy(){this.headerService.setSearchHidden(!1)}_customParseQueryParams(t){this.user=this.auth.getUser(),this.channels=[...this.user.videoChannels,...this.user.videoChannelCollaborations].map(e=>x(w({},e),{selected:t.channelName===e.name})),this.cdr.detectChanges()}getNoResults(t){return t?"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(t){return F(this,null,function*(){(yield this.confirmService.confirm(`Справді хочете видалити ${t.displayName}? `,"Видалити"))!==!1&&this.videoPlaylistService.removeVideoPlaylist(t).subscribe({next:()=>{this.table().loadData(),this.notifier.success(`Добірку ${t.displayName} видалено.`)},error:i=>this.notifier.handleError(i)})})}isRegularPlaylist(t){return t.type.id===fIe.REGULAR}onRowReorder(t){let{dragIndex:e,dropIndex:i}=t,o=e-this.paginationStart,r=i-this.paginationStart,d=this.playlistsBeforeDrop[o],c=this.playlistsBeforeDrop[r];if(Hr(`onRowReorder`,{previousIndex:o,newIndex:r,dragPlaylist:d,dropAfterPlaylist:c}),o===r)return;let C=d.videoChannelPosition,y=c.videoChannelPosition;C>y&&y--,Hr(`Will reorder`,{oldPosition:C,insertAfter:y});for(let P=1;P<=this.playlistsAfterDrop.length;P++)this.playlistsAfterDrop[P-1].videoChannelPosition=P+this.paginationStart;this.videoPlaylistService.reorderPlaylistsOfChannel(this.getFilteredChannel().name,C,y).subscribe({next:()=>{this.table().loadData({skipLoader:!this.screenService.isInTouchScreen()}),this.notifier.success("Playlists reordered")},error:P=>this.notifier.handleError(P)})}onChannelFilter(t){for(let e of this.channels)e.id!==t.id&&(e.selected=!1);this.table().onFiltersChange()}hasReorderableRows(){return!!this.getFilteredChannel()}_dataLoader(t){let{pagination:e,sort:i,search:o}=t;this.paginationStart=e.start;let r=this.getFilteredChannel();return(r?this.videoPlaylistService.listChannelPlaylists({videoChannel:{nameWithHost:Uc.CREATE_BY_STRING(r.name,r.host)},includeCollaborations:!0,restPagination:e,sort:i,search:o}):this.videoPlaylistService.listAccountPlaylists({account:this.user.account,includeCollaborations:!0,restPagination:e,sort:i,search:o})).pipe(pt(({data:c})=>{this.playlistsAfterDrop=c,this.playlistsBeforeDrop=[...c]}))}_hasExpandedRow(t){return!!t.description}getFilteredChannel(){return this.channels.find(t=>t.selected)}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],viewQuery:function(e,i){e&1&&Wx(i.table,sl,5),e&2&&_$()},decls:22,vars:6,consts:()=>{let t;t="playlists per page";let e;e="Drag and drop this row to reorder playlists in your channel";let i;i="Filter by a channel";let o;o="This allows you to reorder playlists assigned to it";let r;r="{VAR_PLURAL, plural, =0 {No playlist} =1 {1 playlist} other {{INTERPOLATION} playlists}}",r=C$(r,{INTERPOLATION:`�1�`,VAR_PLURAL:`�0�`});let d;d=`${r} in ${`�2�`} channel`;let c;c="{VAR_PLURAL, plural, =0 {No playlist} =1 {1 playlist} other {{INTERPOLATION} playlists}}",c=C$(c,{INTERPOLATION:`�1�`,VAR_PLURAL:`�0�`});let C;return C="Створити добірку",[[`table`,``],[`totalTitle`,``],[`captionRight`,``],[`tableCells`,``],[`actionCell`,``],[`expandedRow`,``],[`noResults`,``],i,o,d,c,C,[1,`form-group`],[1,`label`],[1,`form-group-description`],[1,`channel-filters`],[3,`channel`,`ngModel`],[`key`,`MyVideoPlaylistsComponent`,`defaultSort`,`updatedAt`,`paginatorText`,t,`defaultRowsPerPage`,`10`,`columnConfig`,`false`,`searchInput`,`true`,`dragHandleTitle`,e,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(e,i){e&1&&(wp(0,`div`,12)(1,`div`,13),S$(2,7),Bb(),wp(3,`div`,14),S$(4,8),Bb(),wp(5,`div`,15),PV(6,pl,1,2,`my-channel-toggle`,16,_l),Bb()(),wp(8,`my-table`,17,0),rh(`rowReorder`,function(r){return i.onRowReorder(r)}),lx(10,hl,2,1,`ng-template`,null,1,_5)(12,gl,4,0,`ng-template`,null,2,_5)(14,bl,5,5,`ng-template`,null,3,_5)(16,Ol,1,1,`ng-template`,null,4,_5)(18,Rl,1,1,`ng-template`,null,5,_5)(20,Nl,1,1,`ng-template`,null,6,_5),Bb()),e&2&&($B(6),kV(i.channels),$B(2),Ex(`defaultColumns`,i.columns)(`dataLoader`,i.dataLoader)(`customParseQueryParams`,i.customParseQueryParams)(`customUpdateUrl`,i.customUpdateUrl)(`hasExpandedRow`,i.hasExpandedRow)(`reorderableRows`,i.hasReorderableRows()))},dependencies:[Jn,qn,ln,X1,vm,F$1,r$1,u,wt,qi$1,Yt,zr,E,p,s$1],styles:[`.channel-filters[_ngcontent-%COMP%]{display:flex;align-items:center;padding-bottom:1rem;border-bottom:1px solid var(--%NS%bg-secondary-400);margin-bottom:1rem;gap:1rem;overflow:hidden}.channel-filters[_ngcontent-%COMP%]:hover{overflow:auto}.name[_ngcontent-%COMP%]{color:var(--%NS%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})};var Ji=class n{serverService=g(Zt);newFeatureInfoService=g(Nt);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:"Коментарі",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:"Більше",routerLink:this.isVideoImportEnabled()?`/my-library/video-imports`:`/my-library/ownership`,children:[{label:"Imports",routerLink:`/my-library/video-imports`,isDisplayed:()=>this.isVideoImportEnabled()},{label:"Зміна власника",routerLink:`/my-library/ownership`}]}]}isVideoImportEnabled(){let t=this.serverConfig.import.videos;return t.http.enabled||t.torrent.enabled}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],decls:8,vars:1,consts:()=>{let t;t="Мої відео";let e;return e="Skip the sub menu",[[`myVideoSpaceContent`,``],e,[1,`root`],[1,`margin-content`],[`href`,`#my-video-space-content`,1,`visually-hidden-focusable`,`skip-to-content-sub-menu`,3,`click`],[`h1Icon`,`videos`,`h1`,t,3,`menuEntries`],[`tabindex`,`-1`,`id`,`my-video-space-content`,1,`margin-content`,`pb-5`,`outline-0`]]},template:function(e,i){if(e&1){let o=jV();wp(0,`div`,2)(1,`div`,3)(2,`a`,4),rh(`click`,function(d){CI(o);let c=x$(6);return d.preventDefault(),DI(c.focus())}),S$(3,1),Bb(),th(4,`my-horizontal-menu`,5),Bb(),wp(5,`div`,6,0),th(7,`router-outlet`),Bb()()}e&2&&($B(4),Ex(`menuEntries`,i.menuEntries))},dependencies:[pT,fe$1],encapsulation:2,changeDetection:1})};var Gr=C(Po());var Al=[`modal`];function Dl(n,t){n&1&&th(0,`my-collaborator-state`,20)}function Ll(n,t){n&1&&th(0,`my-collaborator-state`,21)}function wl(n,t){if(n&1&&NV(0,Dl,1,0,`my-collaborator-state`,20)(1,Ll,1,0,`my-collaborator-state`,21),n&2){let e=D$().$implicit,i=D$(2);MV(i.user.isOwnerOfChannel(e.videoChannel)?0:i.user.isEditorOfChannel(e.videoChannel)?1:-1)}}function xl(n,t){if(n&1){let e=jV();wp(0,`div`,12)(1,`my-peertube-checkbox`,19),fA(`ngModelChange`,function(o){let r=CI(e).$implicit,d=D$(2);return o5(d.playlistsEnabled[r.id],o)||(d.playlistsEnabled[r.id]=o),DI(o)}),Bb(),Vj(),NV(2,wl,2,1),Bb()}if(n&2){let e=t.$implicit,i=D$(2);$B(),Ex(`inputName`,i.getPrimaryInputName(e)),dA(`ngModel`,i.playlistsEnabled[e.id]),Ex(`labelText`,e.displayName),Gj(),$B(),MV(i.user.isCollaboratingToChannels()?2:-1)}}function Vl(n,t){if(n&1){let e=jV();wp(0,`my-playlist-create-block`,22),rh(`playlistCreated`,function(){CI(e);return DI(D$(2).onPlaylistCreated())}),Bb()}}function Yl(n,t){if(n&1){let e=jV();wp(0,`div`,4)(1,`h4`,5),S$(2,1),Bb(),wp(3,`button`,6),rh(`click`,function(){CI(e);return DI(D$().hide())}),th(4,`my-global-icon`,7),Bb()(),wp(5,`div`,8)(6,`div`,9)(7,`input`,10),fA(`ngModelChange`,function(o){CI(e);let r=D$();return o5(r.videoPlaylistSearch,o)||(r.videoPlaylistSearch=o),DI(o)}),rh(`ngModelChange`,function(){CI(e);return DI(D$().onVideoPlaylistSearchChanged())}),Bb(),Vj(),Bb(),wp(8,`div`,11),PV(9,xl,3,4,`div`,12,LV),Bb(),wp(11,`button`,13),rh(`click`,function(){CI(e);let o=D$();return DI(o.isNewPlaylistBlockOpened=!0)}),th(12,`my-global-icon`,14),wp(13,`span`),S$(14,2),Bb()(),NV(15,Vl,1,0,`my-playlist-create-block`,15),Bb(),wp(16,`div`,16)(17,`input`,17),rh(`click`,function(){CI(e);return DI(D$().hide())})(`key.enter`,function(){CI(e);return DI(D$().hide())}),Bb(),wp(18,`my-button`,18),rh(`click`,function(){CI(e);return DI(D$().save())}),S$(19,3),Bb()()}if(n&2){let e=D$();$B(7),dA(`ngModel`,e.videoPlaylistSearch),Gj(),$B(2),kV(e.currentPlaylists),$B(2),Ex(`hidden`,e.isNewPlaylistBlockOpened),$B(4),MV(e.isNewPlaylistBlockOpened?15:-1),$B(3),Ex(`loading`,e.updatingPlaylists)(`disabled`,e.updatingPlaylists)}}var $l=(0,Gr.default)(`peertube:playlists:BulkUpdateVideosInPlaylistModalComponent`);var en=class n{authService=g(nt);notifier=g(Si);videoPlaylistService=g(Z);modalService=g(sr);saved=Ahe();videos;videoPlaylistSearch;videoPlaylistSearchChanged=new K;seenPlaylists={};currentPlaylists=[];elementsPerPlaylist={};playlistsEnabled={};initialPlaylistsEnabled={};isNewPlaylistBlockOpened=!1;updatingPlaylists=!1;modal=Nhe(`modal`);openedModal;videosContainedInPlaylists;listenToAccountPlaylistsChangeSub;get user(){return this.authService.getUser()}get videoIds(){return this.videos.map(t=>t.id)}ngOnInit(){this.videoPlaylistService.listMyPlaylistWithCache(this.user,this.videoPlaylistSearch).subscribe(t=>this.currentPlaylists=t.data),this.listenToAccountPlaylistsChangeSub=this.videoPlaylistService.listenToMyAccountPlaylistsChange().subscribe(t=>{this.currentPlaylists=t.data,this.rebuildPlaylists()}),this.videoPlaylistSearchChanged.pipe(la$1(500),je(()=>this.videoPlaylistService.listMyPlaylistWithCache(this.user,this.videoPlaylistSearch))).subscribe(({data:t})=>{this.currentPlaylists=t,this.rebuildPlaylists()})}ngOnDestroy(){this.listenToAccountPlaylistsChangeSub?.unsubscribe()}show(t){this.videos=t.videos,this.videosContainedInPlaylists=t.videosContainedInPlaylists,this.elementsPerPlaylist={},this.playlistsEnabled={},this.initialPlaylistsEnabled={},this.isNewPlaylistBlockOpened=!1,this.rebuildPlaylists(),this.openedModal=this.modalService.open(this.modal(),{centered:!0,keyboard:!1})}hide(){this.openedModal.close()}rebuildPlaylists(){if(this.videosContainedInPlaylists){for(let t of this.currentPlaylists)this.elementsPerPlaylist[t.id]=[],this.seenPlaylists[t.id]=t;for(let[t,e]of Object.entries(this.videosContainedInPlaylists))for(let i of e)this.elementsPerPlaylist[i.playlistId]&&this.elementsPerPlaylist[i.playlistId].push({videoId:+t,playlistElementId:i.playlistElementId});for(let[t,e]of Object.entries(this.elementsPerPlaylist)){let i=+t;this.playlistsEnabled[i]===void 0&&(this.playlistsEnabled[i]=Twe(e.map(o=>o.videoId)).length===this.videoIds.length,this.initialPlaylistsEnabled[i]=this.playlistsEnabled[i])}$l(`Rebuilt playlists, enabled playlists:`,this.playlistsEnabled)}}onVideoPlaylistSearchChanged(){this.videoPlaylistSearchChanged.next()}getPrimaryInputName(t){return`videos-update-playlist-`+t.id}save(){let t=[];this.updatingPlaylists=!0;for(let[e,i]of Object.entries(this.playlistsEnabled)){let o=+e,r=this.seenPlaylists[o],d=this.initialPlaylistsEnabled[o];i&&!d?t.push(this.addVideosInPlaylist(r)):!i&&d&&t.push(this.removeVideosFromPlaylist(r))}if(t.length===0){this.updatingPlaylists=!1,this.notifier.info("No change to save"),this.hide();return}kr$1(...t).subscribe({next:e=>{e.type===`success`?this.notifier.success(e.message):this.notifier.error(e.message)},error:e=>this.notifier.handleError(e),complete:()=>{this.updatingPlaylists=!1,this.hide(),this.saved.emit(this.videos)}})}addVideosInPlaylist(t){let e=new Set(this.elementsPerPlaylist[t.id].map(o=>o.videoId)),i=this.videos.filter(o=>!e.has(o.id)).map(o=>({videoId:o.id}));return this.videoPlaylistService.addVideoInPlaylist(t.id,i).pipe(G(o=>({type:`success`,message:XRe("{count, plural, =1 {Video added to {playlistName}} other {{count} videos added to {playlistName}}}",{count:o.length,playlistName:t.displayName})})),he(o=>M({type:`error`,message:o.message})))}removeVideosFromPlaylist(t){return this.videoPlaylistService.removeElementsFromPlaylist({playlistId:t.id,elements:this.elementsPerPlaylist[t.id].map(e=>({playlistElementId:e.playlistElementId,videoId:e.videoId}))}).pipe(G(e=>({type:`success`,message:XRe("{count, plural, =1 {Video removed from {playlistName}} other {{count} videos removed from {playlistName}}}",{count:e.length,playlistName:t.displayName})})),he(e=>M({type:`error`,message:e.message})))}onPlaylistCreated(){this.isNewPlaylistBlockOpened=!1,this.rebuildPlaylists()}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`my-bulk-update-videos-in-playlist-modal`]],viewQuery:function(e,i){e&1&&Wx(i.modal,Al,5),e&2&&_$()},outputs:{saved:`saved`},decls:2,vars:0,consts:()=>{let t;t="Закрити це модальне вікно";let e;e="Шукати добірки";let i;i="Скасувати";let o;o="Update videos in playlists";let r;r="Створити приватну добірку";let d;return d="Зберегти",[[`modal`,``],o,r,d,[1,`modal-header`],[1,`modal-title`],[`title`,t,1,`border-0`,`p-0`,3,`click`],[`iconName`,`cross`],[1,`modal-body`],[1,`mb-4`],[`type`,`text`,`placeholder`,e,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`,i,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(e,i){e&1&&lx(0,Yl,20,5,`ng-template`,null,0,_5)},dependencies:[Jn,Je$1,qn,ln,q$1,X1,E,ce,R$2],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(--%NS%bg-secondary-400)}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--%NS%input-y-padding) var(--%NS%input-x-padding);width:100%;max-width:100%;color:var(--%NS%input-fg);background-color:var(--%NS%input-bg);border:var(--%NS%input-border-width) solid var(--%NS%input-border-color);border-radius:var(--%NS%input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--%NS%input-placeholder-color);font-size:var(--%NS%input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--%NS%fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--%NS%fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--%NS%fg-300);opacity:.8}@media screen and (max-width: calc(100% + 40px)){input[type=text][_ngcontent-%COMP%]{width:100%}}`],changeDetection:1})};function Fl(n,t){if(n&1&&(wp(0,`span`,0),J$(1),Bb()),n&2){let e=D$();Ex(`ngClass`,e.badgeClass),$B(),aA(e.label)}}var tn=class n{video=ph.required();label;badgeClass;ngOnChanges(){this.buildBadgeAndLabel()}buildBadgeAndLabel(){let t=this.video();if(!t.state){this.label=``;return}let e=t.state.id;switch(this.badgeClass=kr$2(t.state.id),e){case td$1.PUBLISHED:if(t.privacy.id===sn.PRIVATE){this.label="У вашій бібліотеці",this.badgeClass=`badge-grey`;return}if(t.privacy.id===sn.INTERNAL){this.label="Internal",this.badgeClass=`badge-blue`;return}this.label=Ur$1(t.state.id);return;case td$1.TO_TRANSCODE:this.label=this.video().waitTranscoding===!0?"Очікування перекодування":"Перекодувати";return;default:this.label=Ur$1(t.state.id)}}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`my-video-state-badge`]],inputs:{video:[1,`video`]},features:[ci],decls:1,vars:1,consts:[[1,`pt-badge`,3,`ngClass`]],template:function(e,i){e&1&&NV(0,Fl,2,2,`span`,0),e&2&&MV(i.label?0:-1)},dependencies:[Au,O3],encapsulation:2,changeDetection:1})};var kl=[`table`];var Bl=[`bulkUpdateVideosInPlaylistModal`];var zl=[`bulkUpdateVideosModal`];var Hl=n=>({tagsOneOf:n});var Ul=n=>({privacyOneOf:n});var Gl=n=>[`/videos/manage`,n,`stats`];var Wl=()=>[];var Xl=n=>[`/w/p/`,n];var jl=n=>[`/videos`,`manage`,n];var Ql=(n,t)=>t.id;function ql(n,t){if(n&1){let e=jV();wp(0,`my-channel-toggle`,18),fA(`ngModelChange`,function(o){let r=CI(e).$implicit;return o5(r.selected,o)||(r.selected=o),DI(o)}),rh(`ngModelChange`,function(){CI(e),D$();return DI(x$(6).onFiltersChange())}),Bb(),Vj()}if(n&2){let e=t.$implicit;Ex(`channel`,e),dA(`ngModel`,e.selected),Gj()}}function Zl(n,t){if(n&1&&($b(0),S$(1,8),T5(2,`myNumberFormatter`),nh()),n&2){let e=t.$implicit;$B(2),jx(e)(D5(2,2,e)),T$(1)}}function Kl(n,t){if(n&1&&(wp(0,`td`),th(1,`my-video-cell`,19),Bb()),n&2){let e=D$().$implicit;$B(),Ex(`video`,e)}}function Jl(n,t){if(n&1&&(wp(0,`td`),th(1,`my-video-cell`,20),Bb()),n&2){let e=D$().$implicit;$B(),Ex(`video`,e)}}function ed(n,t){if(n&1&&(wp(0,`a`,22),J$(1),Bb()),n&2){let e=t.$implicit;Ex(`queryParams`,h5(2,Hl,e)),$B(),Kb(` `,e,` `)}}function td(n,t){if(n&1&&(wp(0,`td`)(1,`div`,21),PV(2,ed,2,4,`a`,22,LV),Bb()()),n&2){let e=D$().$implicit;$B(2),kV(e.tags)}}function id(n,t){if(n&1&&(wp(0,`span`,26),S$(1,9),Bb()),n&2){let e=D$(2).$implicit;Ex(`ngbTooltip`,e.blacklistedReason)}}function nd(n,t){if(n&1&&(wp(0,`td`)(1,`div`,23)(2,`a`,24),th(3,`my-privacy-badge`,25),Bb(),NV(4,id,2,1,`span`,26),Bb()()),n&2){let e=D$().$implicit,i=D$();$B(2),Ex(`queryParams`,h5(4,Ul,e.privacy.id))(`title`,i.getPrivacyFilterTitle(e.privacy.label)),$B(),Ex(`video`,e),$B(),MV(e.blacklisted?4:-1)}}function od(n,t){if(n&1&&(wp(0,`td`),th(1,`my-video-nsfw-badge`,27),Bb()),n&2){let e=D$().$implicit;$B(),Ex(`video`,e)}}function rd(n,t){if(n&1&&(th(0,`br`),$b(1),S$(2,11),T5(3,`myNumberFormatter`),nh()),n&2){let e=D$(2).$implicit;$B(3),jx(e.viewers)(D5(3,2,e.views)),T$(2)}}function ad(n,t){if(n&1&&(wp(0,`td`)(1,`a`,28),$b(2),S$(3,10),T5(4,`myNumberFormatter`),nh(),NV(5,rd,4,4),Bb()()),n&2){let e=D$().$implicit;$B(),Ex(`routerLink`,h5(6,Gl,e.shortUUID)),$B(3),jx(e.views)(D5(4,4,e.views)),T$(3),$B(),MV(e.isLive?5:-1)}}function sd(n,t){if(n&1&&(wp(0,`td`)(1,`span`),S$(2,12),T5(3,`myNumberFormatter`),Bb()()),n&2){let e=D$().$implicit;$B(3),jx(e.comments)(D5(3,2,e.comments)),T$(2)}}function ld(n,t){if(n&1&&(wp(0,`td`),J$(1),T5(2,`ptDate`),Bb()),n&2){let e=D$().$implicit;$B(),Kb(` `,I5(2,1,e.publishedAt,`short`),` `)}}function dd(n,t){if(n&1&&(wp(0,`td`),th(1,`my-video-state-badge`,27),Bb()),n&2){let e=D$().$implicit;$B(),Ex(`video`,e)}}function cd(n,t){if(n&1&&J$(0),n&2){let e=D$(2).$implicit;Kb(` `,e.category.label,` `)}}function _d(n,t){if(n&1&&(wp(0,`td`),NV(1,cd,1,1),Bb()),n&2){let e=D$().$implicit;$B(),MV(e.category?.id?1:-1)}}function pd(n,t){if(n&1&&J$(0),n&2){let e=D$(2).$implicit;Kb(` `,e.language.label,` `)}}function md(n,t){if(n&1&&(wp(0,`td`),NV(1,pd,1,1),Bb()),n&2){let e=D$().$implicit;$B(),MV(e.language?.id?1:-1)}}function ud(n,t){if(n&1&&J$(0),n&2){let e=D$(2).$implicit;Kb(` `,e.licence.label,` `)}}function hd(n,t){if(n&1&&(wp(0,`td`),NV(1,ud,1,1),Bb()),n&2){let e=D$().$implicit;$B(),MV(e.licence?.id?1:-1)}}function gd(n,t){if(n&1&&(wp(0,`a`,31),J$(1),Bb()),n&2){let e=t.$implicit;$$(D$(3).getPlaylistBadge(e.playlistDisplayName)),Ex(`routerLink`,h5(4,Xl,e.playlistShortUUID)),$B(),Kb(` `,e.playlistDisplayName,` `)}}function fd(n,t){if(n&1&&(wp(0,`td`)(1,`div`,29),PV(2,gd,2,6,`a`,30,LV),Bb()()),n&2){let e=D$().$implicit,i=D$();$B(2),kV(i.videosContainedInPlaylists[e.id]||p5(0,Wl))}}function Cd(n,t){if(n&1&&(NV(0,Kl,2,1,`td`),NV(1,Jl,2,1,`td`),NV(2,td,4,0,`td`),NV(3,nd,5,6,`td`),NV(4,od,2,1,`td`),NV(5,ad,6,8,`td`),NV(6,sd,4,4,`td`),NV(7,ld,3,4,`td`),NV(8,dd,2,1,`td`),NV(9,_d,2,1,`td`),NV(10,md,2,1,`td`),NV(11,hd,2,1,`td`),NV(12,fd,4,1,`td`)),n&2){D$();let e=x$(6);MV(e.isColumnDisplayed(`duration`)?0:-1),$B(),MV(e.isColumnDisplayed(`name`)?1:-1),$B(),MV(e.isColumnDisplayed(`tags`)?2:-1),$B(),MV(e.isColumnDisplayed(`privacy`)?3:-1),$B(),MV(e.isColumnDisplayed(`sensitive`)?4:-1),$B(),MV(e.isColumnDisplayed(`insights`)?5:-1),$B(),MV(e.isColumnDisplayed(`comments`)?6:-1),$B(),MV(e.isColumnDisplayed(`published`)?7:-1),$B(),MV(e.isColumnDisplayed(`state`)?8:-1),$B(),MV(e.isColumnDisplayed(`category`)?9:-1),$B(),MV(e.isColumnDisplayed(`language`)?10:-1),$B(),MV(e.isColumnDisplayed(`licence`)?11:-1),$B(),MV(e.isColumnDisplayed(`playlists`)?12:-1)}}function yd(n,t){if(n&1){let e=jV();th(0,`my-button`,32),wp(1,`my-video-actions-dropdown`,33),rh(`videoRemoved`,function(){CI(e),D$();return DI(x$(6).loadData())})(`videoFilesRemoved`,function(){CI(e),D$();return DI(x$(6).loadData())})(`transcodingCreated`,function(){CI(e),D$();return DI(x$(6).loadData())})(`videoExistsInPlaylistChange`,function(){let o=CI(e).$implicit;return DI(D$().fetchVideosContainedInPlaylists([o]))})(`videoImportRetried`,function(){CI(e),D$();return DI(x$(6).loadData())}),Bb()}if(n&2){let e=t.$implicit,i=D$();Ex(`ptRouterLink`,h5(3,jl,e.shortUUID)),$B(),Ex(`video`,e)(`displayOptions`,i.videoActionsOptions)}}function Sd(n,t){if(n&1&&J$(0),n&2){let e=t.search,i=t.hasFilters;Kb(` `,D$().getNoResults(!!e||i),` `)}}var nn=class n{confirmService=g(Bc);auth=g(nt);notifier=g(Si);videoService=g(H);playlistService=g(Z);server=g(Zt);headerService=g(Yg);badgeService=g(d);route=g(eo);table=Nhe(`table`);bulkUpdateVideosInPlaylistModal=Nhe(`bulkUpdateVideosInPlaylistModal`);bulkUpdateVideosModal=Nhe(`bulkUpdateVideosModal`);videosContainedInPlaylists={};bulkActions=[];videoActionsOptions={playlist:!0,download:!0,update:!1,blacklist:!1,delete:!0,report:!1,duplicate:!1,muteByUser:!1,muteByServer:!1,liveInfo:!0,removeFiles:!1,transcoding:!1,retryFailedImport:!0};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(!0),this.user=this.auth.getUser(),this.columns=[{id:`duration`,label:"Тривалість",selected:!0,sortable:!0},{id:`name`,label:"Назва",selected:!0,sortable:!0},{id:`tags`,label:"Мітки",selected:!0,sortable:!1},{id:`privacy`,label:"Приватність",selected:!0,sortable:!1},{id:`sensitive`,label:"Делікатне",selected:!0,sortable:!1},{id:`insights`,label:"Insights",selected:!0,sortable:!0,sortKey:`views`},{id:`comments`,label:"Коментарі",selected:!0,sortable:!0},{id:`published`,label:"Опубліковано",selected:!0,sortable:!0,sortKey:`publishedAt`},{id:`state`,label:"Стан",selected:!0,sortable:!1},{id:`category`,label:"Категорія",selected:!1,sortable:!1},{id:`language`,label:"Мова",selected:!1,sortable:!1},{id:`licence`,label:"Ліцензія",selected:!1,sortable:!1},{id:`playlists`,label:"Добірки",selected:!0,sortable:!1}],this.inputFilters=[{type:`options`,key:`isLive`,title:"Тип відео",options:[{value:`all`,label:"All"},{value:!0,label:"Lives"},{value:!1,label:"VOD"}]},{type:`options`,key:`privacyOneOf`,title:"Приватність",options:[{value:`all`,label:"All"},{value:sn.PUBLIC,label:"Public videos"},{value:sn.INTERNAL,label:"Internal videos"},{value:sn.UNLISTED,label:"Unlisted videos"},{value:sn.PASSWORD_PROTECTED,label:"Password protected videos"},{value:sn.PRIVATE,label:"Private videos"}]},{type:`tags`,key:`tagsOneOf`,title:"Одну з цих міток"}],this._customParseQueryParams(this.route.snapshot.queryParams),this.buildActions()}ngOnDestroy(){this.headerService.setSearchHidden(!1)}_customParseQueryParams(t){let e=t.channelNameOneOf?new Set(Tm(t.channelNameOneOf)):new Set;this.user=this.auth.getUser(),this.channels=[...this.user.videoChannels,...this.user.videoChannelCollaborations].map(i=>x(w({},i),{selected:e.has(i.name)}))}getNoResults(t){return t?"No videos found matching your filters.":this.channels.some(e=>e.selected)?"No videos found in selected channels.":"You don't have any videos published yet."}_customUpdateUrl(){return{channelNameOneOf:this.channels.filter(e=>e.selected).map(e=>e.name)}}_dataLoader(t){let{pagination:e,sort:i,search:o,isLive:r,privacyOneOf:d,tagsOneOf:c}=t,C=this.channels.filter(y=>y.selected).map(y=>y.name);return this.videoService.listMyVideos({restPagination:e,sort:i,search:o,includeCollaborations:!0,channelNameOneOf:C.length!==0?C:void 0,isLive:r,privacyOneOf:d!==void 0?[d]:void 0,tagsOneOf:c}).pipe(pt(({data:y})=>this.fetchVideosContainedInPlaylists(y)))}fetchVideosContainedInPlaylists(t){this.playlistService.doVideosExistInPlaylist(t.map(e=>e.id)).subscribe(e=>{this.videosContainedInPlaylists=Object.keys(e).reduce((i,o)=>x(w({},i),{[o]:xje(e[+o],r=>r.playlistId)}),this.videosContainedInPlaylists)})}getPlaylistBadge(t){return this.badgeService.getRandomBadge(`playlist`,t)}removeVideos(t){return F(this,null,function*(){let e=XRe("Ви впевнені, що хочете видалити {count, plural, =1 {це відео} other {ці {count} відео}}?",{count:t.length});(yield this.confirmService.confirm(e,"Видалити"))!==!1&&this.videoService.removeVideo(t.map(o=>o.id)).subscribe({next:()=>{this.notifier.success(XRe("Видалено {count, plural, =1 {1 відео} other {{count} відео}}.",{count:t.length})),this.table().loadData()},error:o=>this.notifier.handleError(o)})})}buildActions(){this.bulkActions=[[{label:"Add to playlist...",handler:t=>{this.bulkUpdateVideosInPlaylistModal().show({videos:t,videosContainedInPlaylists:this.videosContainedInPlaylists})},iconName:`playlist-add`},{label:"Update...",handler:t=>this.bulkUpdateVideosModal().show({videos:t}),iconName:`edit`}],[{label:"Видалити",handler:t=>this.removeVideos(t),iconName:`delete`}]]}getPrivacyFilterTitle(t){return `Filter by privacy: ${t}`}static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`my-videos`]],viewQuery:function(e,i){e&1&&Wx(i.table,kl,5)(i.bulkUpdateVideosInPlaylistModal,Bl,5)(i.bulkUpdateVideosModal,zl,5),e&2&&_$(3)},decls:19,vars:6,consts:()=>{let t;t="videos per page";let e;e="Per channel:";let i;i="{VAR_PLURAL, plural, =0 {Немає відео} =1 {1 відео} other {{INTERPOLATION} відео}}",i=C$(i,{INTERPOLATION:`�1�`,VAR_PLURAL:`�0�`});let o;o="Заблоковано";let r;r="Navigate to the video stats page";let d;d="{VAR_PLURAL, plural, =0 {Немає переглядів} =1 {1 перегляд} other {Переглядів: {INTERPOLATION}}}",d=C$(d,{INTERPOLATION:`�1�`,VAR_PLURAL:`�0�`});let c;c="{VAR_PLURAL, plural, =0 {No viewers} =1 {1 viewer} other {{INTERPOLATION} viewers}}",c=C$(c,{INTERPOLATION:`�1�`,VAR_PLURAL:`�0�`});let C;C="{VAR_PLURAL, plural, =0 {No comments} =1 {1 comment} other {{INTERPOLATION} comments}}",C=C$(C,{INTERPOLATION:`�1�`,VAR_PLURAL:`�0�`});let y;return y="Manage",[[`table`,``],[`totalTitle`,``],[`tableCells`,``],[`actionCell`,``],[`noResults`,``],[`bulkUpdateVideosInPlaylistModal`,``],[`bulkUpdateVideosModal`,``],e,i,o,d,c,C,[1,`channel-filters`],[1,`channel-label`],[3,`channel`,`ngModel`],[`key`,`MyVideosComponent`,`defaultSort`,`publishedAt`,`paginatorText`,t,`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`,r,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`,y,`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(e,i){if(e&1){let o=jV();wp(0,`div`,13)(1,`div`,14),S$(2,7),Bb(),PV(3,ql,1,2,`my-channel-toggle`,15,Ql),Bb(),wp(5,`my-table`,16,0),lx(7,Zl,3,4,`ng-template`,null,1,_5)(9,Cd,13,13,`ng-template`,null,2,_5)(11,yd,2,5,`ng-template`,null,3,_5)(13,Sd,1,1,`ng-template`,null,4,_5),Bb(),wp(15,`my-bulk-update-videos-in-playlist-modal`,17,5),rh(`saved`,function(d){return i.fetchVideosContainedInPlaylists(d)}),Bb(),wp(17,`my-bulk-update-videos-modal`,17,6),rh(`saved`,function(){CI(o);return DI(x$(6).loadData())}),Bb()}e&2&&($B(3),kV(i.channels),$B(2),Ex(`defaultColumns`,i.columns)(`bulkActions`,i.bulkActions)(`dataLoader`,i.dataLoader)(`customParseQueryParams`,i.customParseQueryParams)(`customUpdateUrl`,i.customUpdateUrl)(`inputFilters`,i.inputFilters))},dependencies:[Jn,qn,ln,ce,tf,Jp,Ot,Xi$1,vm,tn,wt,Zt$1,qi$1,Yt,en,ln$1,p,s$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(--%NS%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(--%NS%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})};var on=class n{static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],decls:7,vars:0,consts:()=>{let t;t="Comments that contain any of the watched words are automatically tagged with the name of the list.";let e;return e=`These automatic tags can be used to filter comments or ${`�#5�`}automatically block${`�/#5�`} them.`,[t,e,[1,`callout`,`callout-primary`,`mb-4`],[`routerLink`,`/my-account/auto-tag-policies`],[`mode`,`user`]]},template:function(e,i){e&1&&(wp(0,`div`,2)(1,`div`),S$(2,0),Bb(),wp(3,`div`),Hx(4,1),th(5,`a`,3),Bx(),Bb()(),th(6,`my-watched-words-list-admin-owner`,4))},dependencies:[on$1,vm],encapsulation:2,changeDetection:1})};var rn=class n{static ɵfac=function(e){return new(e||n)};static ɵcmp=$a$1({type:n,selectors:[[`ng-component`]],features:[f5([Ye])],decls:3,vars:0,consts:()=>{let t;return t=" Subscribe to remote watched words lists to automatically keep them synchronized.\n",[t,[1,`callout`,`callout-primary`,`mb-4`],[`mode`,`user`]]},template:function(e,i){e&1&&(wp(0,`div`,1),S$(1,0),Bb(),th(2,`my-watched-words-subscriptions-admin-owner`,2))},dependencies:[an],encapsulation:2,changeDetection:1})};var Yn={path:``,providers:[Ue,Ne$1,ke,L$2,P,jt,Re,p$1,P$1],resolve:{user:u$1},canActivateChild:[kg]};var jr=[{path:`videos/comments`,redirectTo:`comments-on-my-videos`,pathMatch:`full`},{path:`comments-on-my-videos`,component:Ai,data:{meta:{title:"Comments on your videos"}}},{path:`watched-words/list`,component:on,data:{meta:{title:"Your watched words"}}},{path:`watched-words/subscriptions`,component:rn,data:{meta:{title:"Your watched words subscriptions"}}},{path:`auto-tag-policies`,component:Di,resolve:{tags:cr},data:{meta:{title:"Your automatic tag policies"}}},{path:`videos`,component:nn,data:{meta:{title:"Мої відео"}}},{path:`video-imports`,component:Gi,data:{meta:{title:"Мої імпортовані відео"}}},{path:`ownership`,component:zi,data:{meta:{title:"Зміна власника"}}}];var Qr=[{path:``,redirectTo:`video-channels`,pathMatch:`full`},{path:`video-channels`,loadChildren:()=>import(`./chunk-CsVJWVUq.js`)},{path:`followers`,component:xi,data:{meta:{title:"Мої підписники"}}},{path:`video-channel-syncs`,component:Hi,data:{meta:{title:"Мої синхронізації"}}},{path:`video-channel-syncs/create`,component:Ui,data:{meta:{title:"Створити нову синхронізацію"}}}];var vd=[{path:`video-playlists`,component:Ki,data:{meta:{title:"Мої добірки"}}},{path:`video-playlists/create`,component:Wi,data:{meta:{title:"Створити нову добірку"}}},{path:`video-playlists/:videoPlaylistId`,component:qi,data:{meta:{title:"Елементи добірки"}}},{path:`video-playlists/update/:videoPlaylistId`,component:Zi,data:{meta:{title:"Оновити добірку"}}},{path:`subscriptions`,component:Vi,data:{meta:{title:"Мої підписки"}}},{path:`history/videos`,component:$i,data:{meta:{title:"Моя історія відео"},reuse:{enabled:!0,key:`my-videos-history-list`}}}];function Wr(n){if(n.length===0)return!1;let t=n[0].path;return jr.some(e=>e.path===t||e.path.startsWith(`${t}/`))}function Xr(n){if(n.length===0)return!1;let t=n[0].path;return Qr.some(e=>e.path===t||e.path.startsWith(`${t}/`))}var mC=[x(w({},Yn),{component:Ji,canMatch:[(n,t)=>Wr(t)],children:jr}),x(w({},Yn),{component:wi,canMatch:[(n,t)=>Xr(t)],children:Qr}),x(w({},Yn),{component:Fi,canMatch:[(n,t)=>!Wr(t)&&!Xr(t)],children:vd})];export{mC as default};
//# debugId=bdb4e233-0673-5889-a948-9dc827184826
//# sourceMappingURL=chunk-v5PH7J0N.js.map