PageSourceSearch

https://exode.me/client/en-US/chunk-KBCIULU2.js

js exode.me collected 2026-10-04 16:17:19 UTC 186,952 bytes, 68 lines download raw bytes

1import{a as Ke}from"./chunk-5V32CCEH.js";import{b as vr,c as Er}from"./chunk-MFOOQQMJ.js";import{a as hr}from"./chunk-YYIVV5FU.js";import{b as gr}from"./chunk-ZEJP5NXX.js";import{a as Nt}from"./chunk-35AIQB7E.js";import{a as Un}from"./chunk-ONJDYF7W.js";import{a as ji,b as Qi,c as Zi,d as qi,e as Ki}from"./chunk-KB2UXAXF.js";import{a as tn,b as rr,c as ar,d as sr,e as _r,g as Wn,h as pr}from"./chunk-BS6YYGJU.js";import{a as Ji}from"./chunk-FGO7IWQW.js";import{g as er,h as tr}from"./chunk-O5IYCHZC.js";import{a as Xn}from"./chunk-KHC4A3RT.js";import{a as Xi}from"./chunk-BH6MQPW4.js";import"./chunk-U7E76NBH.js";import{b as Pe}from"./chunk-LYSJ47UW.js";import"./chunk-ARBLAW36.js";import{a as mr}from"./chunk-7LUEXPK5.js";import{a as ur}from"./chunk-4TL6DOKL.js";import{a as ir,b as nr,c as Te,d as en}from"./chunk-UFPPYVMH.js";import"./chunk-YEN262T4.js";import"./chunk-4GM7L6JB.js";import{c as or}from"./chunk-XG2UEYRK.js";import{a as be}from"./chunk-LCNXNM6E.js";import"./chunk-O4DWGUCX.js";import{a as dr}from"./chunk-AWZKCMCZ.js";import{b as qo,f as Ko,g as Jo}from"./chunk-QMQZZIR5.js";import"./chunk-XGC7JZAU.js";import"./chunk-MBPSVMMT.js";import{a as Cr}from"./chunk-6S7GR7RZ.js";import{e as yr}from"./chunk-IKRNBRJG.js";import{a as Ui}from"./chunk-L435IOLB.js";import"./chunk-AGD5WKED.js";import{a as lr}from"./chunk-XAUPS75L.js";import{a as At}from"./chunk-C4KUKUZD.js";import{a as Wi}from"./chunk-S7TSA3HI.js";import"./chunk-J3EEEQXE.js";import{a as qe}from"./chunk-62ATBB34.js";import{a as Ie}from"./chunk-PVOHGV2Y.js";import{a as Rt}from"./chunk-LQVRZI54.js";import{a as Uo,b as Xo,c as Gn,d as Wo,e as jo,f as fr,g as nn}from"./chunk-7ANKF5UP.js";import{a as Sr}from"./chunk-JRXKYMED.js";import{a as Gi,c as pi,d as Qo}from"./chunk-EFBJB4GU.js";import{a as cr}from"./chunk-U2CJTFGW.js";import"./chunk-WOBKXJK4.js";import"./chunk-BWH75TCH.js";import"./chunk-SSETSBQT.js";import"./chunk-SGZLU3PA.js";import"./chunk-RBCASDJ4.js";import{a as Ot}from"./chunk-C726LWQF.js";import"./chunk-WMEOAIVO.js";import"./chunk-EO7FPGTW.js";import"./chunk-GDFO7X2G.js";import"./chunk-I6M5NA5Y.js";import{c as Zo}from"./chunk-Q6I3NOHV.js";import{a as Tt}from"./chunk-KIVJRE4O.js";import"./chunk-L7C23KC7.js";import{h as Bi}from"./chunk-VDA4PBJF.js";import"./chunk-YLZ34D6D.js";import"./chunk-QXVUYXIG.js";import{b as Ue}from"./chunk-OR7MKCZD.js";import{a as je}from"./chunk-OTKVWBE5.js";import{a as bt}from"./chunk-LLCRV73S.js";import"./chunk-KEEUBRDB.js";import"./chunk-GGNTEXQL.js";import{a as ki}from"./chunk-TALII272.js";import{a as Qe}from"./chunk-KLT2ZASF.js";import{a as di,d as zi}from"./chunk-V3JZPFOE.js";import{a as Fi,b as fe,c as It}from"./chunk-PG4F5PSG.js";import"./chunk-CIVVPYF3.js";import{a as _i,b as Ze}from"./chunk-FZFWY5Y6.js";import{a as Hi}from"./chunk-EGEBNI4V.js";import{E as U,F as Ge,a as Oo,c as Et,g as j,h as ze,o as ve,p as Mt,r as Ro,w as Be,x as He}from"./chunk-EBOVR5NW.js";import{G as Fo,H as ko,a as Vo,s as $o,u as wi}from"./chunk-UME7L37K.js";import{a as Me}from"./chunk-R76LZEZS.js";import{A as Ln,Ab as Ai,Af as wo,B as vi,Bb as Ni,Ca as s,Cb as g,Cc as So,Ce as No,Db as Y,Dc as H,Df as Ee,Ea as Yn,Eb as V,Ec as Z,F as uo,Fb as J,Fd as Fe,Ga as ft,Gb as P,Gd as vt,Gh as Yi,Ha as Vn,Hb as go,Hc as vo,Ib as p,Ic as li,Jd as ke,K as Ei,Kc as St,Kd as ie,La as $n,Lc as Se,Ma as M,Mc as Eo,Mh as Go,Na as Ti,Nf as xo,Oa as Oi,Og as zo,Oh as Vi,P as Mi,Pb as fo,Pd as To,Pg as Hn,Q as we,Qb as ee,Qf as Xe,Qh as $i,R as ht,Rb as W,Rg as A,S as xe,Sa as Re,Sb as re,Se as Lo,Sf as Yo,Ta as Q,Tc as Mo,Ub as Li,Vc as te,Wb as si,X as Dn,Xb as v,Xg as ca,Y as ye,Yb as I,Z as Pi,Zb as L,Zc as Po,_ as rt,aa as _,b as ot,bb as ho,bc as me,c as ni,cc as ue,d as b,dc as he,de as zn,e as _o,ed as se,fa as T,fb as C,g as Nn,ga as O,gb as y,gh as Bo,hc as $e,hh as w,ib as Ae,j as fi,ja as oi,jb as q,jc as yt,je as Pt,jh as xi,ka as gt,kb as K,kc as Co,kh as st,la as wn,lb as m,lc as D,ma as pe,mb as c,n as ut,na as Ye,nb as a,nh as We,oa as Ii,ob as f,p as Ci,pb as Ct,pd as Io,pe as Ne,qa as ri,qb as ai,r as yi,ra as Ve,rb as Ri,re as Ao,sb as $,sc as G,se as Di,ta as bi,tb as F,tc as ae,te as ci,th as le,u as po,ub as Fn,uc as ge,v as Si,wc as N,x as mo,xc as yo,xe as Le,xh as Ho,ya as xn,yb as k,yd as bo,za as at,zb as kn,ze as Bn,zf as Do}from"./chunk-HVCWS4IF.js";import{a as ce,b as de,e as sa,g as la,j as u,k as De}from"./chunk-KJ7W2O2B.js";var Mr=sa((Xc,pa)=>{pa.exports=`<svg width="278" height="202" viewBox="0 0 278 202" fill="none" xmlns="http://www.w3.org/2000/svg">
2  <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" />
3  <rect x="50.5752" y="22.3535" width="167" height="167" rx="24" transform="rotate(-7.69207 50.5752 22.3535)" fill="var(--bg)" />
4  <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" />
5  <path d="M115.966 52.623L137.514 70.5249" stroke="var(--bg-secondary-450)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" />
6  <path d="M161.057 46.5332L145.03 69.5102" stroke="var(--bg-secondary-450)" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" />
7  <g clip-path="url(#clip0_2530_45010)">
8    <rect y="8.43359" width="74" height="74" rx="37" fill="var(--bg-secondary-450)" />
9    <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" />
10    <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" />
11  </g>
12  <g clip-path="url(#clip1_2530_45010)">
13    <rect x="96" y="157.424" width="44" height="44" rx="22" fill="var(--secondary-icon-color)" />
14    <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" />
15    <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" />
16  </g>
17  <g clip-path="url(#clip2_2530_45010)">
18    <rect x="218" y="77.4258" width="60" height="60" rx="30" fill="var(--fg-300)" />
19    <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" />
20    <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" />
21  </g>
22  <circle cx="219" cy="135.43" r="16" fill="var(--bg-secondary-500)" />
23  <g clip-path="url(#clip3_2530_45010)">
24    <path d="M222.334 138.763L219 135.43L215.667 138.763" stroke="var(--fg-200)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
25    <path d="M219 135.43V142.93" stroke="var(--fg-200)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
26    <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" />
27    <path d="M222.334 138.763L219 135.43L215.667 138.763" stroke="var(--fg-200)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
28  </g>
29  <circle cx="61" cy="76.4336" r="16" fill="var(--secondary-icon-color)" />
30  <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)" />
31  <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.4893
31C68.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)" />
32  <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" />
33  <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" />
34  <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" />
35  <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" />
36  <defs>
37    <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)">
38      <stop />
39      <stop offset="1" stop-opacity="0" />
40    </radialGradient>
41    <clipPath id="clip0_2530_45010">
42      <rect y="8.43359" width="74" height="74" rx="37" fill="var(--bg)" />
43    </clipPath>
44    <clipPath id="clip1_2530_45010">
45      <rect x="96" y="157.424" width="44" height="44" rx="22" fill="var(--bg)" />
46    </clipPath>
47    <clipPath id="clip2_2530_45010">
48      <rect x="218" y="77.4258" width="60" height="60" rx="30" fill="var(--bg)" />
49    </clipPath>
50    <clipPath id="clip3_2530_45010">
51      <rect width="20" height="20" fill="var(--bg)" transform="translate(209 125.43)" />
52    </clipPath>
53  </defs>
54</svg>
55`;});var Lt=class Lt{};u(Lt,"\u0275fac",function(t){return new(t||Lt)();}),u(Lt,"\u0275cmp",M({type:Lt,selectors:[["ng-component"]],decls:1,vars:0,consts:[["mode","user","key","UserVideoCommentList"]],template:function(t,i){t&1&&f(0,"my-video-comment-list-admin-owner",0);},dependencies:[_r],encapsulation:2}));var on=Lt;var Ce=class Ce{authHttp=_(Io);restExtractor=_(Bo);listAvailable(e){let t=Ce.BASE_AUTOMATIC_TAGS_URL+"accounts/"+e.accountName+"/available";return this.authHttp.get(t).pipe(vi(i=>this.restExtractor.handleError(i)));}getCommentPolicies(e){let t=Ce.BASE_AUTOMATIC_TAGS_URL+"policies/accounts/"+e.accountName+"/comments";return this.authHttp.get(t).pipe(vi(i=>this.restExtractor.handleError(i)));}updateCommentPolicies(e){let t=Ce.BASE_AUTOMATIC_TAGS_URL+"policies/accounts/"+e.accountName+"/comments";return this.authHttp.put(t,{review:e.review}).pipe(vi(i=>this.restExtractor.handleError(i)));}};u(Ce,"BASE_AUTOMATIC_TAGS_URL",wo.apiUrl+"/api/v1/automatic-tags/"),u(Ce,"\u0275fac",function(t){return new(t||Ce)();}),u(Ce,"\u0275prov",ye({token:Ce,factory:Ce.ɵfac,providedIn:"root"}));var Dt=Ce;function da(n,e){if(n&1){let t=k();c(0,"div",2)(1,"my-peertube-checkbox",3),he("ngModelChange",function(o){let r=T(t).$implicit;return ue(r.review,o)||(r.review=o),O(o);}),P("ngModelChange",function(){T(t);let o=p();return O(o.updatePolicies());}),a()();}if(n&2){let t=e.$implicit,i=e.$index,o=p();s(),m("inputName","tag-"+i),me("ngModel",t.review),m("labelText",o.getLabelText(t));}}var wt=class wt{authService=_(w);autoTagsService=_(Dt);notifier=_(A);tags=[];ngOnInit(){this.loadAvailableTags();}getLabelText(e){return e.name==="external-link"?"That contain an external link":"That contain any word from your \""+e.name+"\" watched word list";}updatePolicies(){let e=this.authService.getUser().account.name;this.autoTagsService.updateCommentPolicies({accountName:e,review:this.tags.filter(t=>t.review).map(t=>t.name)}).subscribe({next:()=>{this.notifier.success("Comment policies updated");},error:t=>this.notifier.handleError(t)});}loadAvailableTags(){let e=this.authService.getUser().account.name;yi([this.autoTagsService.listAvailable({accountName:e}),this.autoTagsService.getCommentPolicies({accountName:e})]).subscribe(([t,i])=>{this.tags=t.available.map(o=>({name:o.name,type:o.type,review:i.review.includes(o.name)}));});}};u(wt,"\u0275fac",function(t){return new(t||wt)();}),u(wt,"\u0275cmp",M({type:wt,selectors:[["ng-component"]],decls:4,vars:0,consts:()=>{let e;return e="Automatically block comments:",[e,[1,"d-block","mb-3"],[1,"form-group","ms-3"],[3,"ngModelChange","inputName","ngModel","labelText"]];},template:function(t,i){t&1&&(c(0,"strong",1),g(1,0),a(),q(2,da,2,3,"div",2,Ae)),t&2&&(s(2),K(i.tags));},dependencies:[U,j,ve,Ze],encapsulation:2}));
55var rn=wt;function _a(n,e){if(n&1&&(Ct(0,"div",1),Ri(1,"div",4),ai()),n&2){let t=p();s(),kn("innerHTML",t.svg,xn);}}var xt=class xt{activeModal=_($o);title;html;svg;};u(xt,"\u0275fac",function(t){return new(t||xt)();}),u(xt,"\u0275cmp",M({type:xt,selectors:[["my-new-feature-info-modal"]],decls:6,vars:3,consts:()=>{let e;return e="Got it",[[1,"modal-body"],[1,"svg-relative-container"],[1,"content",3,"innerHtml"],["type","button","role","button","value",e,1,"peertube-button","primary-button",3,"click","key.enter"],["aria-hidden","true",1,"svg-container",3,"innerHTML"]];},template:function(t,i){t&1&&(Ct(0,"div",0),C(1,_a,2,1,"div",1),Ct(2,"h2"),v(3),ai(),Ri(4,"div",2),Ct(5,"input",3),go("click",function(){return i.activeModal.close();})("key.enter",function(){return i.activeModal.close();}),ai()()),t&2&&(s(),y(i.svg?1:-1),s(2),I(i.title),s(),kn("innerHTML",i.html,xn));},dependencies:[U],styles:["h2[_ngcontent-%COMP%]{color:var(--fg-350);font-weight:700;margin-bottom:calc(1.325rem + .9vw)}@media(min-width:1200px){h2[_ngcontent-%COMP%]{margin-bottom:2rem}}h2[_ngcontent-%COMP%]{font-size:calc(1.3625rem + 1.35vw)}@media(min-width:1200px){h2[_ngcontent-%COMP%]{font-size:2.375rem}}.modal-body[_ngcontent-%COMP%]{text-align:center}.content[_ngcontent-%COMP%]{color:var(--fg-200);margin-bottom:calc(1.375rem + 1.5vw)}@media(min-width:1200px){.content[_ngcontent-%COMP%]{margin-bottom:2.5rem}}.svg-relative-container[_ngcontent-%COMP%]{position:relative}.svg-container[_ngcontent-%COMP%]{margin:0 auto;position:absolute;top:-3.5rem;right:0;left:0}.svg-relative-container[_ngcontent-%COMP%] + h2[_ngcontent-%COMP%]{margin-top:10rem}"]}));var an=xt;var ma=Mr(),lt=class lt{auth=_(w);modalService=_(wi);serverService=_(le);userService=_(Vi);notifier=_(A);domSanitizer=_(bo);showChannelCollaboration(){this.auth.userInformationLoaded.pipe(Ei()).subscribe(()=>{if(this.serverService.getHTMLConfig().client.newFeaturesInfo!==!0||this.auth.getUser().newFeaturesInfoRead&zn.CHANNEL_COLLABORATION||this.modalService.hasOpenModals())return;let i=this.serverService.getHTMLConfig().instance.name,o=this.modalService.open(an,{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(ma),o.result.finally(()=>{this.userService.markNewFeatureInfoAsRead(zn.CHANNEL_COLLABORATION).subscribe({next:()=>this.auth.refreshUserInformation(),error:l=>this.notifier.handleError(l)});});});}};u(lt,"\u0275fac",function(t){return new(t||lt)();}),u(lt,"\u0275prov",ye({token:lt,factory:lt.ɵfac,providedIn:"root"}));var Yt=lt;var Vt=class Vt{serverService=_(le);newFeatureInfoService=_(Yt);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:"Followers",routerLink:"/my-library/followers"},{label:"Synchronizations",routerLink:"/my-library/video-channel-syncs",isDisplayed:()=>this.isChannelSyncEnabled()}];}isChannelSyncEnabled(){let e=this.serverConfig.import;return this.serverConfig.import.videoChannelSynchronization.enabled&&(e.videos.http.enabled||e.videos.torrent.enabled);}};u(Vt,"\u0275fac",function(t){return new(t||Vt)();}),u(Vt,"\u0275cmp",M({type:Vt,selectors:[["ng-component"]],decls:8,vars:1,consts:()=>{let e;e="My channels";let t;return t="Skip the sub menu",[["myChannelSpaceContent",""],t,[1,"root"],[1,"margin-content"],["href","#my-channel-space-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],["h1Icon","channel","h1",e,3,"menuEntries"],["tabindex","-1","id","my-channel-space-content",1,"margin-content","pb-5","outline-0"]];},template:function(t,i){if(t&1){let o=k();c(0,"div",2)(1,"div",3)(2,"a",4),P("click",function(l){T(o);let d=re(6);return l.preventDefault(),O(d.focus());}),g(3,1),a(),f(4,"my-horizontal-menu",5),a(),c(5,"div",6,0),f(7,"router-outlet"),a()();}t&2&&(s(4),m("menuEntries",i.menuEntries));},dependencies:[vt,Ot],encapsulation:2}));var sn=Vt;function ua(n,e){if(n&1&&(c(0,"span",4),v(1),a()),n&2){let t=p();s(),L(" ",t.getTotalTitle());}}function ha(n,e){n&1&&(c(0,"div",8),g(1,0),a());}function ga(n,e){n&1&&($(0),g(1,1),F());}function fa(n,e){if(n&1&&($(0),g(1,2),F()),n&2){let t=p().$implicit;s(),Y(t.following.name),V(1);}}function Ca(n,e){if(n&1&&(c(0,"div",10),f(1,"my-actor-avatar",11),c(2,"div",12)(3,"a",13)(4,"div",14),v(5),a(),f(6,"my-global-icon",15),a(),c(7,"div",16),C(8,ga,2,0,"ng-container")(9,fa,2,1,"ng-container"),a()()()),n&2){let t=e.$implicit,i=p();s(),m("actor",t.follower)("href",t.follower.url),s(2),m("href",t.follower.url,at),s(2),I(t.follower.name+"@"+t.follower.host),s(3),y(i.isFollowingAccount(t)?8:9);}}var $t=class $t{route=_(Fe);auth=_(w);userSubscriptionService=_(Nt);notifier=_(A);follows=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};
55onDataSubject=new b();search;channelFilter;inputFilters;ngOnInit(){this.inputFilters=[{type:"select",key:"channel",title:"Channel",items:this.auth.getUser().videoChannels.map(e=>({id:e.name,label:e.displayName}))}],this.search=this.route.snapshot.queryParamMap.get("search")||"",this.channelFilter=this.route.snapshot.queryParamMap.get("channel")||"",this.loadFollowers();}onNearOfBottom(){this.pagination.totalItems<=this.pagination.currentPage*this.pagination.itemsPerPage||(this.pagination.currentPage+=1,this.loadFollowers());}onSearch(e){this.search=e,st(this.pagination),this.loadFollowers({reset:!0});}onFilter(e){this.channelFilter=e.channel,st(this.pagination),this.loadFollowers({reset:!0});}isFollowingAccount(e){return e.following.name===this.getUsername();}getTotalTitle(){return Ee(""+this.pagination.totalItems+" {total, plural, =1 {follower} other {followers}}",{total:this.pagination.totalItems});}loadFollowers(e={}){let{reset:t=!1}=e;this.userSubscriptionService.listFollowers({pagination:this.pagination,nameWithHost:this.getUsername(),search:this.search,channel:this.channelFilter}).subscribe({next:i=>{this.follows=t?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;}};u($t,"\u0275fac",function(t){return new(t||$t)();}),u($t,"\u0275cmp",M({type:$t,selectors:[["ng-component"]],decls:9,vars:4,consts:()=>{let e;e="No follower found.";let t;t="Follower page";let i;i="Is following all your channels";let o;return o="Is following your channel "+"\uFFFD0\uFFFD"+"",[e,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",t,1,"actor-names",3,"href"],[1,"actor-display-name"],["iconName","external-link"],[1,"small","muted"]];},template:function(t,i){t&1&&(c(0,"div",3),C(1,ua,2,1,"span",4),c(2,"div",5)(3,"my-search-input",6),P("search",function(r){return i.onSearch(r);}),a(),c(4,"my-advanced-input-filter",7),P("filtersChange",function(r){return i.onFilter(r);}),a()()(),C(5,ha,2,0,"div",8),c(6,"div",9),P("nearOfBottom",function(){return i.onNearOfBottom();}),q(7,Ca,10,5,"div",10,Ae),a()),t&2&&(s(),y(i.pagination.totalItems?1:-1),s(3),m("filters",i.inputFilters),s(),y(i.pagination.totalItems===0?5:-1),s(),m("dataObservable",i.onDataSubject.asObservable()),s(),K(i.follows));},dependencies:[Me,nr,je,Qe,At],styles:[".followers-header[_ngcontent-%COMP%]{margin-bottom:30px;display:flex}input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:300px;max-width:300px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:340px){input[type=text][_ngcontent-%COMP%]{width:100%}}.actor[_ngcontent-%COMP%]{display:flex;min-height:auto;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.actor[_ngcontent-%COMP%]{flex-direction:column;height:auto;align-items:center}}.actor[_ngcontent-%COMP%] > my-actor-avatar[_ngcontent-%COMP%]{margin-inline-end:.625rem}.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]{flex-grow:1}
55.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]{width:fit-content;display:flex;align-items:baseline;color:var(--fg)}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%], .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:active{text-decoration:none}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.actor[_ngcontent-%COMP%]   .actor-display-name[_ngcontent-%COMP%]{font-weight:600;font-size:18px}.actor[_ngcontent-%COMP%]   .actor-name[_ngcontent-%COMP%]{font-size:14px;color:var(--fg-300);margin-inline-start:.3125rem}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]{color:var(--fg);display:flex;align-items:center}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%], .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:focus, .actor[_ng
55content-%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}}"]}));var ln=$t;var Pr=n=>["/c",n],ya=n=>["/a",n],Sa=n=>[n];function va(n,e){if(n&1&&(c(0,"span",4),v(1),a()),n&2){let t=p();s(),L(" ",t.getTotalTitle());}}function Ea(n,e){n&1&&(c(0,"div",6),g(1,0),a());}function Ma(n,e){if(n&1&&(c(0,"div",8),f(1,"my-actor-avatar",9),c(2,"div",10)(3,"a",11)(4,"div",12),v(5),a(),c(6,"div",13),v(7),a()(),c(8,"div",14),g(9,1),a(),c(10,"a",15)(11,"span"),g(12,2),a(),f(13,"my-actor-avatar",16),a()(),f(14,"my-subscribe-button",17),a()),n&2){let t=e.$implicit;s(),m("actor",t)("internalHref",D(10,Pr,t.nameWithHost)),s(2),m("routerLink",D(12,Pr,t.nameWithHost)),s(2),I(t.displayName),s(2),I(t.nameWithHost),s(2),Y(t.followersCount),V(9),s(),m("routerLink",D(14,ya,t.ownerBy)),s(2),Y(t.ownerBy),V(12),s(),m("actor",t.ownerAccount),s(),m("videoChannels",D(16,Sa,t));}}var Ft=class Ft{userSubscriptionService=_(Nt);notifier=_(A);videoChannels=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};
55onDataSubject=new b();search;onNearOfBottom(){this.pagination.totalItems<=this.pagination.currentPage*this.pagination.itemsPerPage||(this.pagination.currentPage+=1,this.loadSubscriptions());}onSearch(e){this.search=e,st(this.pagination),this.loadSubscriptions(!1);}getTotalTitle(){return Ee(""+this.pagination.totalItems+" {total, plural, =1 {subscription} other {subscriptions}}",{total:this.pagination.totalItems});}loadSubscriptions(e=!0){this.userSubscriptionService.listSubscriptions({pagination:this.pagination,search:this.search}).subscribe({next:t=>{this.videoChannels=e?this.videoChannels.concat(t.data):t.data,this.pagination.totalItems=t.total,this.onDataSubject.next(t.data);},error:t=>this.notifier.handleError(t)});}};u(Ft,"\u0275fac",function(t){return new(t||Ft)();}),u(Ft,"\u0275cmp",M({type:Ft,selectors:[["ng-component"]],decls:7,vars:3,consts:()=>{let e;e="You don't have any subscription yet.";let t;t="Channel page";let i;i="Owner account page";let o;o=""+"\uFFFD0\uFFFD"+" subscribers";let r;return r="Created by "+"\uFFFD0\uFFFD"+"",[e,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",t,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(t,i){t&1&&(c(0,"div",3),C(1,va,2,1,"span",4),c(2,"my-search-input",5),P("search",function(r){return i.onSearch(r);}),a()(),C(3,Ea,2,0,"div",6),c(4,"div",7),P("nearOfBottom",function(){return i.onNearOfBottom();}),q(5,Ma,15,18,"div",8,Ae),a()),t&2&&(s(),y(i.pagination.totalItems?1:-1),s(2),y(i.pagination.totalItems===0?3:-1),s(),m("dataObservable",i.onDataSubject.asObservable()),s(),K(i.videoChannels));},dependencies:[At,je,Qe,ie,gr],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:300px;max-width:300px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:340px){input[type=text][_ngcontent-%COMP%]{width:100%}}.actor[_ngcontent-%COMP%]{display:flex;min-height:130px;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.actor[_ngcontent-%COMP%]{flex-direction:column;height:auto;align-items:center}}.actor[_ngcontent-%COMP%] > my-actor-avatar[_ngcontent-%COMP%]{margin-inline-end:.625rem}.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]{flex-grow:1}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]{width:fit-content;display:flex;align-items:baseline;color:var(--fg)}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%], .actor[_ng
55content-%COMP%]   .actor-names[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus, .actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:active{text-decoration:none}.actor[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.actor[_ngcontent-%COMP%]   .actor-display-name[_ngcontent-%COMP%]{font-weight:600;font-size:18px}.actor[_ngcontent-%COMP%]   .actor-name[_ngcontent-%COMP%]{font-size:14px;color:var(--fg-300);margin-inline-start:.3125rem}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]{color:var(--fg);display:flex;align-items:center}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%], .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:hover, .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:focus, .actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:active{text-decoration:none}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:hover{opacity:.8}.actor[_ngcontent-%COMP%]   .actor-owner[_ngcontent-%COMP%]   my-actor-avatar[_ngcontent-%COMP%]{margin-inline-start:.3125rem}@media screen and (max-width:800px){.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]{padding-bottom:10px;text-align:center}.actor[_ngcontent-%COMP%]   .actor-info[_ngcontent-%COMP%]   .actor-names[_ngcontent-%COMP%]{flex-direction:column;align-items:center!important;margin:auto}}"]}));var cn=Ft;var Pa=n=>({$implicit:n});function Ia(n,e){if(n&1&&(c(0,"div",2),g(1,0),a()),n&2){let t=p();s(),Y(t.noResultMessage()),V(1);}}function ba(n,e){if(n&1){let t=k();c(0,"div",6)(1,"my-peertube-checkbox",8),he("ngModelChange",function(o){T(t);let r=p().$implicit,l=p();return ue(l.selection()[r.id],o)||(l.selection()[r.id]=o),O(o);}),a()();}if(n&2){let t=p().$implicit,i=p();s(),m("inputName","video-check-"+t.id),me("ngModel",i.selection()[t.id]);}}function Ta(n,e){n&1&&Fn(0);}function Oa(n,e){if(n&1&&Q(0,Ta,1,0,"ng-container",9),n&2){let t=p().$implicit,i=p();m("ngTemplateOutlet",i.rowButtonsTemplate)("ngTemplateOutletContext",D(2,Pa,t));}}function Ra(n,e){if(n&1&&(c(0,"div",4),C(1,ba,2,2,"div",6),f(2,"my-video-miniature",7),C(3,Oa,1,4,"ng-container"),a()),n&2){let t=e.$implicit,i=p();s(),y(i.enableSelection()?1:-1),s(),m("video",t)("displayAsRow",!0)("displayOptions",i.miniatureDisplayOptions())("displayVideoActions",!1)("user",i.user()),s(),y(i.isInSelectionMode()===!1?3:-1);}}function Aa(n,e){n&1&&Fn(0);}function Na(n,e){if(n&1){let t=k();c(0,"div",5)(1,"button",10),P("click",function(){T(t);let o=p();return O(o.abortSelectionMode());}),g(2,1),a(),Q(3,Aa,1,0,"ng-container",11),a();}if(n&2){let t=p();s(3),m("ngTemplateOutlet",t.globalButtonsTemplate);}}var kt=class kt{notifier=_(A);user=H(void 0);pagination=H(void 0);titlePage=H(void 0);miniatureDisplayOptions=H(void 0);noResultMessage=H("No results.");enableSelection=H(!0);disabled=H(!1);getVideosObservableFunction=H(void 0);templates=vo(_i);selection=li({});videos=li([]);rowButtonsTemplate;globalButtonsTemplate;sort="-publishedAt";
55onDataSubject=new b();hasDoneFirstQuery=!1;lastQueryLength;ngAfterContentInit(){{let e=this.templates().find(t=>t.name()==="rowButtons");e&&(this.rowButtonsTemplate=e.template);}{let e=this.templates().find(t=>t.name()==="globalButtons");e&&(this.globalButtonsTemplate=e.template);}}getVideosObservable(e){return this.getVideosObservableFunction()(e,this.sort);}abortSelectionMode(){this.selection.update(()=>({}));}isInSelectionMode(){return Lo(this.selection()).some(e=>this.selection()[e]===!0);}videoById(e,t){return t.id;}onNearOfBottom(){this.disabled()||this.lastQueryLength!==void 0&&this.lastQueryLength<this.pagination().itemsPerPage||(this.pagination().currentPage+=1,this.loadMoreVideos());}loadMoreVideos(e=!1){e&&(this.hasDoneFirstQuery=!1),this.getVideosObservable(this.pagination().currentPage).subscribe({next:({data:t})=>{this.hasDoneFirstQuery=!0,this.lastQueryLength=t.length,e&&this.videos.set([]),this.videos.update(i=>i.concat(t)),this.onDataSubject.next(t);},error:t=>{let i="Cannot load more videos. Please try again later.";Do.error(i,t),this.notifier.error(i);}});}reloadVideos(){st(this.pagination()),this.loadMoreVideos(!0);}};u(kt,"\u0275fac",function(t){return new(t||kt)();}),u(kt,"\u0275cmp",M({type:kt,selectors:[["my-videos-selection"]],contentQueries:function(t,i,o){t&1&&fo(o,i.templates,_i,4),t&2&&W();},inputs:{user:[1,"user"],pagination:[1,"pagination"],titlePage:[1,"titlePage"],miniatureDisplayOptions:[1,"miniatureDisplayOptions"],noResultMessage:[1,"noResultMessage"],enableSelection:[1,"enableSelection"],disabled:[1,"disabled"],getVideosObservableFunction:[1,"getVideosObservableFunction"],selection:[1,"selection"],videos:[1,"videos"]},outputs:{selection:"selectionChange",videos:"videosChange"},decls:5,vars:3,consts:()=>{let e;e=""+"\uFFFD0\uFFFD"+"";let t;return t="Cancel",[e,t,[1,"no-results"],["myInfiniteScroller","",1,"videos",3,"nearOfBottom","dataObservable"],[1,"video"],[1,"action-selection-mode"],[1,"checkbox-container"],[3,"video","displayAsRow","displayOptions","displayVideoActions","user"],[3,"ngModelChange","inputName","ngModel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"cancel-selection","peertube-button","secondary-button","me-2",3,"click"],[4,"ngTemplateOutlet"]];},template:function(t,i){t&1&&(C(0,Ia,2,1,"div",2),c(1,"div",3),P("nearOfBottom",function(){return i.onNearOfBottom();}),q(2,Ra,4,7,"div",4,i.videoById,!0),a(),C(4,Na,4,1,"div",5)),t&2&&(y(i.hasDoneFirstQuery&&i.videos().length===0?0:-1),s(),m("dataObservable",i.onDataSubject.asObservable()),s(),K(i.videos()),s(2),y(i.isInSelectionMode()===!0?4:-1));},dependencies:[je,Ze,U,j,ve,tr,Po],styles:[".action-selection-mode[_ngcontent-%COMP%]{position:fixed;bottom:1rem}@supports (inset-inline-end: var(--x-margin-content)){.action-selection-mode[_ngcontent-%COMP%]{inset-inline-end:var(--x-margin-content)}}@supports not (inset-inline-end: var(--x-margin-content)){.action-selection-mode[_ngcontent-%COMP%]{right:var(--x-margin-content)}}.action-selection-mode[_ngcontent-%COMP%]   .action-button[_ngcontent-%COMP%]{display:block;margin-inline-start:calc(1.46875rem + 2.625vw)}@media(min-width:1200px){.action-selection-mode[_ngcontent-%COMP%]   .action-button[_ngcontent-%COMP%]{margin-inline-start:3.4375rem}}.video[_ngcontent-%COMP%]{display:flex;min-height:130px;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.video[_ngcontent-%COMP%]{min-height:initial;padding-bottom:.5rem;margin-bottom:.5rem}}.video[_ngcontent-%COMP%]:first-child{margin-top:47px}.video[_ngcontent-%COMP%]   .checkbox-container[_ngcontent-%COMP%]{display:flex;align-items:center;margin-inline-end:1.25rem;margin-inline-start:.75rem}.video[_ngcontent-%COMP%]   my-video-miniature[_ngcontent-%COMP%]{flex-grow:1;max-width:100%}@media screen and (max-width:800px){.video[_ngcontent-%COMP%]{flex-wrap:wrap}.checkbox-container[_ngcontent-%COMP%], .action-selection-mode[_ngcontent-%COMP%]{display:none!important}}"]}));var dn=kt;var La=["videosSelection"];function Da(n,e){if(n&1){let t=k();c(0,"div",12)(1,"my-delete-button",13),P("click",function(){let o=T(t).$implicit,r=p();return O(r.deleteHistoryElement(o));}),a()();}}var zt=class zt{authService=_(w);userService=_(Vi);notifier=_(A);confirmService=_(We);userHistoryService=_(fr);destroyRef=_(wn);videosSelection=Z("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="My watch history";}ngOnInit(){this.user=this.authService.getUser(),this.authService.userInformationLoaded.pipe(Vo(this.destroyRef)).subscribe(()=>this.videosHistoryEnabled=this.user.videosHistoryEnabled);}disableForReuse(){this.disabled=!0;}enabledForReuse(){this.disabled=!1;}reloadData(){this.videosSelection().reloadVideos();}onSearch(e){this.search=e,this.reloadData();}getVideosObservable(e){let t=Yo(this.pagination,{currentPage:e});return this.userHistoryService.list(t,this.search).pipe(xe(i=>this.pagination.totalItems=i.total));}generateSyndicationList(){throw new Error("Method not implemented.");}onVideosHistoryChange(){this.userService.updateMyProfile({videosHistoryEnabled:this.videosHistoryEnabled}).subscribe({next:()=>{let e=this.videosHistoryEnabled===!0?"Video history is enabled":"Video history is disabled";this.notifier.success(e),this.authService.refreshUserInformation();},error:e=>this.notifier.handleError(e)});}deleteHistoryElement(e){this.userHistoryService.deleteElement(e).subscribe({next:()=>{this.videos=this.videos.filter(t=>t.id!==e.id),xi(this.pagination);},error:t=>this.notifier.handleError(t)});}clearAllHistory(){return De(this,null,function*(){let e="Delete video history",t="Are you sure you want to delete all your video history?";(yield this.confirmService.confirm(t,e))===!0&&this.userHistoryService.clearAll().subscribe({next:()=>{this.notifier.success("Video history deleted"),this.reloadData();},error:o=>this.notifier.handleError(o)});});}getNoResultMessage(){return this.search?"No videos found for \""+this.search+"\".":"You don't have any video in your watch history yet.";}};u(zt,"\u0275fac",function(t){return new(t||zt)();}),u(zt,"\u0275cmp",M({type:zt,selectors:[["ng-component"]],viewQuery:function(t,i){t&1&&ee(i.videosSelection,La,5),t&2&&W();},decls:12,vars:10,consts:()=>{let e;e="Track watch history";let t;t="Clear all history";let i;return i="Delete from history",[["videosSelection",""],e,t,[1,"top-buttons"],[1,"search-wrapper"],["emitOnInit","true",3,"search"],[1,"history-switch"],["inputName","track-watch-history",3,"ngModelChange","ngModel"],["for","track-watch-history"],["icon","delete",3,"click"],[3,"videosChange","pagination","videos","miniatureDisplayOptions","titlePage","getVideosObservableFunction","user","noResultMessage","enableSelection","disabled"],["ptTemplate","rowButtons"],[1,"action-button"],["label",i,3,"click"]];},template:function(t,i){if(t&1){let o=k();c(0,"div",3)(1,"div",4)(2,"my-search-input",5),P("search",function(l){return i.onSearch(l);}),a()(),c(3,"div",6)(4,"my-input-switch",7),he("ngModelChange",function(l){return T(o),ue(i.videosHistoryEnabled,l)||(i.videosHistoryEnabled=l),O(l);}),P("ngModelChange",function(){return i.onVideosHistoryChange();}
55),a(),c(5,"label",8),g(6,1),a()(),c(7,"my-button",9),P("click",function(){return i.clearAllHistory();}),g(8,2),a()(),c(9,"my-videos-selection",10,0),he("videosChange",function(l){return T(o),ue(i.videos,l)||(i.videos=l),O(l);}),Q(11,Da,2,0,"ng-template",11),a();}t&2&&(s(4),me("ngModel",i.videosHistoryEnabled),s(5),m("pagination",i.pagination),me("videos",i.videos),m("miniatureDisplayOptions",i.miniatureDisplayOptions)("titlePage",i.titlePage)("getVideosObservableFunction",i.getVideosObservableFunction)("user",i.user)("noResultMessage",i.getNoResultMessage())("enableSelection",!1)("disabled",i.disabled));},dependencies:[It,At,ur,U,j,ve,dn,_i,Ui],styles:[".no-history[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-top:50px;font-weight:600}.top-buttons[_ngcontent-%COMP%]{margin-bottom:30px;display:grid;grid-template-columns:250px 1fr auto auto;align-items:center}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]{grid-column:1}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:250px;max-width:250px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[readonly][_ngcontent-%COMP%]{color:var(--fg-300)}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus, .top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:290px){.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%}}.top-buttons[_ngcontent-%COMP%]   .history-switch[_ngcontent-%COMP%]{grid-column:3;display:flex;align-items:center;margin-inline-start:auto;margin-inline-end:.9375rem}.top-buttons[_ngcontent-%COMP%]   .history-switch[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{margin:0 0 0 5px;color:var(--fg-400);font-weight:600}.top-buttons[_ngcontent-%COMP%]   .delete-history[_ngcontent-%COMP%]{grid-column:4}.video[_ngcontent-%COMP%]{display:flex;min-height:130px;padding-bottom:1.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--input-border-color)}@media screen and (max-width:800px){.video[_ngcontent-%COMP%]{min-height:initial;padding-bottom:.5rem;margin-bottom:.5rem}}.action-button[_ngcontent-%COMP%]{display:flex;align-self:flex-end}@media screen and (max-width:800px){.top-buttons[_ngcontent-%COMP%]{grid-template-columns:auto 1fr auto;row-gap:20px}.top-buttons[_ngcontent-%COMP%]   .history-switch[_ngcontent-%COMP%]{grid-row:1;grid-column:1;margin:0}.top-buttons[_ngcontent-%COMP%]   .delete-history[_ngcontent-%COMP%]{grid-row:1;grid-column:3}.top-buttons[_ngcontent-%COMP%]   .search-wrapper[_ngcontent-%COMP%]{grid-column:1/4}}"]}));var _n=zt;var Bt=class Bt{menuEntries=[];ngOnInit(){this.buildMenu();}buildMenu(){this.menuEntries=[{label:"Playlists",routerLink:"/my-library/video-playlists"},{label:"Subscriptions",routerLink:"/my-library/subscriptions"},{label:"History",routerLink:"/my-library/history/videos"}];}};u(Bt,"\u0275fac",function(t){return new(t||Bt)();}),u(Bt,"\u0275cmp",M({type:Bt,selectors:[["ng-component"]],decls:8,vars:1,consts:()=>{let e;e="My library";let t;return t="Skip the sub menu",[["myLibraryContent",""],t,[1,"root"],[1,"margin-content"],["href","#my-library-content-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],["h1",e,3,"menuEntries"],["tabindex","-1","id","my-library-content",1,"margin-content","pb-5","outline-0"]];},template:function(t,i){if(t&1){let o=k();c(0,"div",2)(1,"div",3)(2,"a",4),P("click",function(l){T(o);let d=re(6);return l.preventDefault(),O(d.focus());}),g(3,1),a(),f(4,"my-horizontal-menu",5),a(),c(5,"div",6,0),f(7,"router-outlet"),a()();}t&2&&(s(4),m("menuEntries",i.menuEntries));},dependencies:[vt,Ot],encapsulation:2}));var pn=Bt;function wa(n,e){if(n&1&&f(0,"my-actor-avatar",2),n&2){let t=p();m("actor",t.actor())("actorType",t.actorType());}}function xa(n,e){n&1&&f(0,"my-global-icon",5);}function Ya(n,e){if(n&1&&(c(0,"span",6),v(1),a()),n&2){let t=p();s(),I(t.actor().name);}}function Va(n,e){n&1&&f(0,"my-collaborator-state",7);}function $a(n,e){n&1&&f(0,"my-collaborator-state",8);}var Ht=class Ht{authService=_(w);actor=H.required();actorType=H.required();displayAvatar=H(!0,{transform:Se});
55displayUsername=H(!0,{transform:Se});target=H("");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 e=this.authService.getUser();return e.isCollaboratingToChannels()&&e.isEditorOfChannel(this.actor());}isOwnerOfChannel(){if(this.actorType()!=="channel")return!1;let e=this.authService.getUser();return e.isCollaboratingToChannels()&&e.isOwnerOfChannel(this.actor());}};u(Ht,"\u0275fac",function(t){return new(t||Ht)();}),u(Ht,"\u0275cmp",M({type:Ht,selectors:[["my-actor-cell"]],inputs:{actor:[1,"actor"],actorType:[1,"actorType"],displayAvatar:[1,"displayAvatar"],displayUsername:[1,"displayUsername"],target:[1,"target"]},decls:10,vars:8,consts:[[3,"routerLink","title","target"],[1,"chip","two-lines"],["size","32",3,"actor","actorType"],[1,"information"],[1,"fw-semibold"],["iconName","external-link"],[1,"muted"],["type","accepted","small","true",1,"ms-2"],["type","owner","small","true",1,"ms-2"]],template:function(t,i){t&1&&(c(0,"a",0)(1,"div",1),C(2,wa,1,2,"my-actor-avatar",2),c(3,"div",3)(4,"span",4),v(5),C(6,xa,1,0,"my-global-icon",5),a(),C(7,Ya,2,1,"span",6),a(),C(8,Va,1,0,"my-collaborator-state",7)(9,$a,1,0,"my-collaborator-state",8),a()()),t&2&&(m("routerLink",i.routerLink)("title",i.linkTitle)("target",i.target()),s(2),y(i.displayAvatar()?2:-1),s(3),L(" ",i.actor().displayName," "),s(),y(i.target()==="_blank"?6:-1),s(),y(i.displayUsername()?7:-1),s(),y(i.isEditorOfChannel()?8:i.isOwnerOfChannel()?9:-1));},dependencies:[To,ie,bt,Qe,Me],styles:["a[_ngcontent-%COMP%]:hover{opacity:1}a[_ngcontent-%COMP%]:hover   .information[_ngcontent-%COMP%]{opacity:.8}"]}));var et=Ht;var Fa=["modal"];function ka(n,e){if(n&1&&(c(0,"div",10),v(1),a()),n&2){let t=p(2);s(),I(t.formErrors.channel);}}function za(n,e){if(n&1){let t=k();c(0,"div",2)(1,"h1",3),v(2),a(),c(3,"button",4),P("click",function(){let o=T(t).dismiss;return O(o());}),f(4,"my-global-icon",5),a()(),c(5,"div",6)(6,"div",7)(7,"label",8),g(8,1),a(),f(9,"my-select-channel",9),C(10,ka,2,1,"div",10),a()(),c(11,"div",11)(12,"div",12)(13,"input",13),P("click",function(){let o=T(t).dismiss;return O(o());})("key.enter",function(){let o=T(t).dismiss;return O(o());}),a(),c(14,"input",14),P("click",function(){let o=T(t).close;return O(o());}),a()()();}if(n&2){let t=p();s(2),I(t.getModalTitle()),s(3),m("formGroup",t.form),s(3),Y(t.ownershipChanges.length),V(8),s(),m("items",t.videoChannels),s(),y(t.formErrors.channel?10:-1);}}var ct=class ct extends Rt{formReactiveService=_(Ue);changeOwnershipService=_(ki);notifier=_(A);authService=_(w);modalService=_(wi);accepted=So();modal=Z("modal");ownershipChanges=[];videoChannels;error=null;ngOnInit(){this.videoChannels=[],Xe(this.authService,{includeCollaborations:!1}).subscribe(e=>this.videoChannels=e),this.buildForm({channel:Cr});}show(e){this.form.patchValue({channel:this.videoChannels[0].id}),this.ownershipChanges=e,this.modalService.open(this.modal(),{centered:!0}).result.then(()=>this.acceptOwnership()).catch(()=>{this.ownershipChanges=[];});}acceptOwnership(){let e=this.form.value.channel;this.changeOwnershipService.acceptVideo(this.ownershipChanges.map(t=>t.id),{channelId:e}).subscribe({next:()=>{let t=this.ownershipChanges.length,i=Ee("{count, plural, =1 {Video {videoName} accepted} other {{count} videos accepted}}",{count:t,videoName:this.ownershipChanges[0].video.name});this.notifier.success(i),this.accepted&&this.accepted.emit();},error:t=>this.notifier.handleError(t)});}getModalTitle(){let e=this.ownershipChanges.length;return Ee("{count, plural, =1 {Accept video} other {Accept {count} videos}}",{count:e});}};u(ct,"\u0275fac",(()=>{let e;return function(i){return(e||(e=Ve(ct)))(i||ct);};})()),u(ct,"\u0275cmp",M({type:ct,selectors:[["my-accept-change-video-ownership"]],viewQuery:function(t,i){t&1&&ee(i.modal,Fa,5),t&2&&W();},outputs:{accepted:"accepted"},features:[Re],decls:2,vars:0,consts:()=>{let e;e="Close this modal";let t;t="Cancel";let i;i="Accept";let o;return o="{VAR_PLURAL, plural, =1 {Select a channel to receive the video} other {Select a channel to receive the videos}}",o=J(o,{VAR_PLURAL:"\uFFFD0\uFFFD"}),[["modal",""],o,[1,"modal-header"],[1,"modal-title"],["title",e,1,"border-0","p-0",3,"click"],["iconName","cross"],[1,"modal-body",3,"formGroup"],[1,"form-group"],["for","channel"],["inputId","channel","formControlName","channel",1,"d-block",3,"items"],["role","alert",1,"form-error"],[1,"modal-footer","inputs"],[1,"inputs"],["type","button","role","button","value",t,1,"peertube-button","secondary-button",3,"click","key.enter"],["type","submit","value",i,1,"peertube-button","primary-button",3,"click"]];},template:function(t,i){t&1&&Q(0,za,15,5,"ng-template",null,0,N);},dependencies:[Me,U,j,ze,Ge,He,Be,Ke],styles:[".peertube-select-container[_ngcontent-%COMP%]{width:350px}@media screen and (max-width:380px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}"]}));var mn=ct;var Ba=["acceptChangeVideoOwnershipComponent"],Ha=["table"];function Ga(n,e){if(n&1&&($(0),g(1,6),G(2,"myNumberFormatter"),F()),n&2){let t=e.$implicit;s(2),Y(t)(ae(2,2,t)),V(1);}}function Ua(n,e){n&1&&(c(0,"span",11),v(1,"TO YOU"),a());}function Xa(n,e){if(n&1&&f(0,"my-actor-cell",12),n&2){let t=p().$implicit;
55m("actor",t.nextOwnerAccount)("displayAvatar",!0)("displayUsername",!0);}}function Wa(n,e){if(n&1&&(c(0,"td"),f(1,"my-video-cell",10),a(),c(2,"td"),C(3,Ua,2,0,"span",11)(4,Xa,1,3,"my-actor-cell",12),a(),c(5,"td"),v(6),G(7,"ptDate"),a(),c(8,"td")(9,"span",13),v(10),a()()),n&2){let t=e.$implicit,i=p();s(),m("video",t.video),s(2),y(i.isReceiver(t)?3:4),s(3),I(ge(7,5,t.createdAt,"short")),s(3),m("ngClass",i.getStateClass(t.state.id)),s(),I(t.state.label);}}function ja(n,e){if(n&1&&f(0,"my-action-dropdown",14),n&2){let t=e.$implicit,i=p();m("actions",i.actions)("entry",t);}}function Qa(n,e){n&1&&($(0),g(1,7),F());}var Gt=class Gt{notifier=_(A);changeOwnershipService=_(ki);authService=_(w);acceptChangeVideoOwnershipComponent=Z("acceptChangeVideoOwnershipComponent");table=Z("table");actions=[];bulkActions=[];columns=[{id:"video",label:"Video",sortable:!1},{id:"targetAccount",label:"Target account",sortable:!1},{id:"createdAt",label:"Created",sortable:!0},{id:"status",label:"Status",sortable:!1}];dataLoader;constructor(){this.dataLoader=this._dataLoader.bind(this);let{simpleActions:e,bulkActions:t}=ir([[{label:()=>"Manage video",linkBuilder:i=>[di.buildManageUrl(i.video)],isDisplayed:i=>this.isReceiver(i)&&i.state.id===Pt.ACCEPTED||this.isInitiator(i)&&i.state.id!==Pt.ACCEPTED,enableBulk:!1}],[{label:()=>"Accept",handler:i=>this.openAcceptModal(i),isDisplayed:i=>this.canAcceptOrReject(i),enableBulk:!0},{label:()=>"Reject",handler:i=>this.reject(i),isDisplayed:i=>this.canAcceptOrReject(i),enableBulk:!0}]]);this.actions=e,this.bulkActions=t;}canAcceptOrReject(e){return this.isReceiver(e)&&e.state.id===Pt.PENDING;}isReceiver(e){return e.nextOwnerAccount.id===this.authService.getUser().account.id;}isInitiator(e){return e.initiatorAccount.id===this.authService.getUser().account.id;}getStateClass(e){switch(e){case Pt.ACCEPTED:return"badge-green";case Pt.REJECTED:return"badge-red";default:return"badge-yellow";}}openAcceptModal(e){this.acceptChangeVideoOwnershipComponent().show(e);}accepted(){this.table().loadData();}reject(e){this.changeOwnershipService.rejectVideo(e.map(t=>t.id)).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}_dataLoader(e){return this.changeOwnershipService.listOfVideos(e.pagination,e.sort).pipe(ut(t=>({data:t.data.map(i=>de(ce({},i),{initiatorAccount:new Hn(i.initiatorAccount),nextOwnerAccount:new Hn(i.nextOwnerAccount)})),total:t.total})));}};u(Gt,"\u0275fac",function(t){return new(t||Gt)();}),u(Gt,"\u0275cmp",M({type:Gt,selectors:[["my-video-ownership-changes"]],viewQuery:function(t,i){t&1&&ee(i.acceptChangeVideoOwnershipComponent,Ba,5)(i.table,Ha,5),t&2&&W(2);},decls:12,vars:3,consts:()=>{let e;e="entries per page";let t;t="{VAR_PLURAL, plural, =0 {No video ownership change} =1 {1 video ownership change} other {{INTERPOLATION} video ownership changes}}",t=J(t,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="Actions";let o;return o="No ownership change request found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["noResults",""],["acceptChangeVideoOwnershipComponent",""],t,o,["key","MyOwnershipChangesComponent","paginatorText",e,"columnConfig","false",3,"defaultColumns","dataLoader","bulkActions"],[3,"accepted"],["size","small",3,"video"],[1,"pt-badge","badge-primary"],["actorType","account","target","_blank",3,"actor","displayAvatar","displayUsername"],[1,"pt-badge",3,"ngClass"],["placement","bottom-right top-right left auto","container","body","label",i,3,"actions","entry"]];},template:function(t,i){t&1&&(c(0,"my-table",8,0),Q(2,Ga,3,4,"ng-template",null,1,N)(4,Wa,11,8,"ng-template",null,2,N)(6,ja,1,2,"ng-template",null,3,N)(8,Qa,2,0,"ng-template",null,4,N),a(),c(10,"my-accept-change-video-ownership",9,5),P("accepted",function(){return i.accepted();}),a()),t&2&&m("defaultColumns",i.columns)("dataLoader",i.dataLoader)("bulkActions",i.bulkActions);},dependencies:[se,te,mn,en,Te,qe,et,be,Ie],encapsulation:2}));var un=Gt;var Xt=class Xt{};u(Xt,"\u0275fac",function(t){return new(t||Xt)();}),u(Xt,"\u0275cmp",M({type:Xt,selectors:[["ng-component"]],decls:1,vars:0,template:function(t,i){t&1&&f(0,"my-video-ownership-changes");},dependencies:[un],encapsulation:2}));var hn=Xt;var Za=["table"];function qa(n,e){n&1&&(c(0,"div")(1,"p",11),g(2,6),a()());}function Ka(n,e){if(n&1&&($(0),g(1,7),G(2,"myNumberFormatter"),F()),n&2){let t=e.$implicit;s(2),Y(t)(ae(2,2,t)),V(1);}}function Ja(n,e){if(n&1&&(c(0,"a",12),f(1,"my-global-icon",13),$(2),g(3,8),F(),a()),n&2){let t=p();m("routerLink",$e(t.getSyncCreateLink()));}}function es(n,e){if(n&1&&(c(0,"td")(1,"a",14),v(2),a()(),c(3,"td"),f(4,"my-actor-cell",15),a(),c(5,"td")(6,"span",16),v(7),a()(),c(8,"td"),v(9),G(10,"ptDate"),a(),c(11,"td"),v(12),G(13,"ptDate"),a()),n&2){let t=e.$implicit,i=p();s(),m("href",t.externalChannelUrl,at),s(),I(t.externalChannelUrl),s(2),m("actor",t.channel),s(2),m("ngClass",i.getSyncStateClass(t.state.id)),s(),L(" ",t.state.label," "),s(2),I(ge(10,7,t.createdAt,"short")),s(3),I(ge(13,10,t.lastSyncAt,"short"));}}function ts(n,e){if(n&1&&f(0,"my-action-dropdown",17),n&2){let t=e.$implicit,i=p();m("actions",i.videoChannelSyncActions)("entry",t);}}function is(n,e){n&1&&($(0),g(1,9),F());}var tt=class tt{videoChannelsSyncService=_(nn);serverService=_(le);notifier=_(A);authService=_(w);videoChannelService=_(zi);table=Z("table");videoChannelSyncActions=[];serverConfig;columns=[{id:"externalChannelUrl",label:"External Channel",sortable:!0},{id:"videoChannel",label:"Channel",sortable:!0},{id:"state",label:"State",sortable:!0},{id:"createdAt",label:"Created",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:"List imports",linkBuilder:()=>["/my-library/video-imports"],queryParamsBuilder:e=>({videoChannelSyncId:e.id}
55),iconName:"cloud-download"}],[{label:"Delete",iconName:"delete",handler:e=>this.deleteSync(e)},{label:"Fully synchronize the channel",description:"This fetches any missing videos on the local channel",iconName:"refresh",handler:e=>this.fullySynchronize(e)}]];}_dataLoader(e){return this.authService.userInformationLoaded.pipe(Ei(),Ci(()=>this.videoChannelsSyncService.listByAccount({sort:e.sort,pagination:e.pagination,includeCollaborations:!0,account:this.authService.getUser().account})));}syncEnabled(){return this.serverConfig.import.videoChannelSynchronization.enabled;}deleteSync(e){this.videoChannelsSyncService.delete(e.id).subscribe({next:()=>{this.notifier.success("Synchronization removed successfully for "+e.channel.displayName+"."),this.table().loadData();},error:t=>this.notifier.handleError(t)});}fullySynchronize(e){this.videoChannelService.importVideos(e.channel.name,e.externalChannelUrl,e.id).subscribe({next:()=>{this.notifier.success("Full synchronization requested successfully for "+e.channel.displayName+".");},error:t=>this.notifier.handleError(t)});}getSyncCreateLink(){return"/my-library/video-channel-syncs/create";}getSyncStateClass(e){return["pt-badge",tt.STATE_CLASS_BY_ID[e]];}getChannelUrl(e){return"/c/"+e;}};u(tt,"STATE_CLASS_BY_ID",{[ci.FAILED]:"badge-red",[ci.PROCESSING]:"badge-blue",[ci.SYNCED]:"badge-green",[ci.WAITING_FIRST_RUN]:"badge-yellow"}),u(tt,"\u0275fac",function(t){return new(t||tt)();}),u(tt,"\u0275cmp",M({type:tt,selectors:[["ng-component"]],viewQuery:function(t,i){t&1&&ee(i.table,Za,5),t&2&&W();},decls:13,vars:3,consts:()=>{let e;e="syncs per page";let t;t="\u26A0\uFE0F The instance doesn't allow channel synchronization";let i;i="{VAR_PLURAL, plural, =0 {No sync} =1 {1 sync} other {{INTERPOLATION} syncs}}",i=J(i,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;o="Add synchronization";let r;return r="You don't have channel synchronisation configured.",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["noResults",""],t,i,o,r,["key","MyVideoChannelsSyncComponent","paginatorText",e,"columnConfig","false",3,"defaultColumns","dataLoader"],[1,"muted"],[1,"peertube-create-button",3,"routerLink"],["iconName","add","aria-hidden","true"],["target","_blank","rel","noopener noreferrer",3,"href"],["actorType","channel",3,"actor"],[3,"ngClass"],["container","body",3,"actions","entry"]];},template:function(t,i){t&1&&(C(0,qa,3,0,"div"),c(1,"my-table",10,0),Q(3,Ka,3,4,"ng-template",null,1,N)(5,Ja,4,2,"ng-template",null,2,N)(7,es,14,13,"ng-template",null,3,N)(9,ts,1,2,"ng-template",null,4,N)(11,is,2,0,"ng-template",null,5,N),a()),t&2&&(y(i.syncEnabled()?-1:0),s(),m("defaultColumns",i.columns)("dataLoader",i.dataLoader));},dependencies:[se,te,Me,ie,qe,Te,et,be,Ie],encapsulation:2}));var gn=tt;var ns=n=>({"input-error":n});function os(n,e){if(n&1&&(c(0,"my-alert",6),v(1),a()),n&2){let t=p();s(),I(t.error);}}function rs(n,e){if(n&1&&(c(0,"div",15),v(1),a()),n&2){let t=p();s(),I(t.formErrors.externalChannelUrl);}}function as(n,e){if(n&1&&(c(0,"div",15),v(1),a()),n&2){let t=p();s(),I(t.formErrors.videoChannel);}}var dt=class dt extends Rt{formReactiveService=_(Ue);authService=_(w);router=_(ke);notifier=_(A);videoChannelSyncService=_(nn);videoChannelService=_(zi);error;userVideoChannels=[];existingVideosStrategy;ngOnInit(){this.buildForm({externalChannelUrl:yr,videoChannel:Xn,existingVideoStrategy:Xn}),Xe(this.authService,{includeCollaborations:!0}).subscribe(e=>this.userVideoChannels=e);}getFormButtonTitle(){return"Create";}formValidated(){this.error=void 0;let e=this.form.value,t={externalChannelUrl:e.externalChannelUrl,videoChannelId:e.videoChannel},i=e.existingVideoStrategy==="import";this.videoChannelSyncService.create(t).pipe(Ci(({videoChannelSync:o})=>i?this.videoChannelService.importVideos(o.channel.name,o.externalChannelUrl,o.id):Promise.resolve(null))).subscribe({next:()=>{this.notifier.success("Synchronization created successfully."),this.router.navigate(["/my-library","video-channel-syncs"]);},error:o=>{this.error=o.message;}});}};u(dt,"\u0275fac",(()=>{let e;return function(i){return(e||(e=Ve(dt)))(i||dt);};})()),u(dt,"\u0275cmp",M({type:dt,selectors:[["my-video-channel-sync-edit"]],features:[Re],decls:30,vars:11,consts:()=>{let e;e="Example: https://youtube.com/channel/UC_fancy_channel";let t;t="NEW SYNCHRONIZATION";let i;i="Remote channel URL";let o;o="Video channel";let r;r="Options for existing videos on remote channel:";let l;l="Import all and watch for new publications";let d;return d="Only watch for new publications",[t,i,o,r,l,d,["type","danger"],[1,"pt-two-cols"],[1,"title-col"],[1,"content-col"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","externalChannelUrl"],[1,"input-group"],["type","text","id","externalChannelUrl","placeholder",e,"formControlName","externalChannelUrl",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["for","videoChannel"],["inputId","videoChannel","formControlName","videoChannel",3,"items"],["role","radiogroup",1,"form-group"],["for","existingVideoStrategy"],[1,"peertube-radio-container"],["type","radio","name","existingVideoStrategy","id","import","value","import","formControlName","existingVideoStrategy"],["for","import"],["type","radio","name","existingVideoStrategy","id","doNothing","value","nothing","formControlName","existingVideoStrategy"],["for","doNothing"],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"]];},template:function(t,i){t&1&&(C(0,os,2,1,"my-alert",6),c(1,"div",7)(2,"div",8)(3,"h2"),g(4,0),a()(),c(5,"div",9)(6,"form",10),P("ngSubmit",function(){return i.formValidated();}),c(7,"div",11)(8,"label",12),g(9,1),a(),c(10,"div",13),f(11,"input",14),a(),C(12,rs,2,1,"div",15),a(),c(13,"div",11)(14,"label",16),g(15,2),a(),f(16,"my-select-channel",17),C(17,as,2,1,"div",15),a(),c(18,"div",18)(19,"label",19),g(20,3),a(),c(21,"div",20),f(22,"input",21),c(23,"label",22),g(24,4),a()(),c(25,"div",20),f(26,"input",23),c(27,"label",24),g(28,5),a()()(),f(29,"input",25),a()()()),t&2&&(y(i.error?0:-1),s(6),m("formGroup",i.form),s(5),m("ngClass",D(9,ns,i.formErrors.externalChannelUrl)),s(),y(i.formErrors.externalChannelUrl?12:-1),s(4),m("items",i.userVideoChannels),s(),y(i.formErrors.videoChannel?17:-1),s(12),m("value",$e(i.getFormButtonTitle()))("disabled",!i.form.valid));},dependencies:[U,Mt,Et,Ro,j,ze,Ge,He,Be,te,Ke,Tt],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:480px;max-width:480px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:520px){input[type=text][_ngcontent-%COMP%]{width:100%}}my-select-channel[_ngcontent-%COMP%]{display:block;max-width:480px}"]}));var fn=dt;var ss=["table"];function ls(n,e){if(n&1&&($(0),g(1,6),G(2,"myNumberFormatter"),F()),n&2){let t=e.$implicit;s(2),Y(t)(ae(2,2,t)),V(1);}}function cs(n,e){if(n&1&&(c(0,"a",11),v(1),a()),n&2){let t=p().$implicit;m("href",t.targetUrl,at)("title",t.targetUrl),s(),I(t.targetUrl);}}function ds(n,e){if(n&1&&(c(0,"span",12),v(1),a()),n&2){let t=p().$implicit;m("title",t.torrentName||t.magnetUri),s(),I(t.torrentName||t.magnetUri);}}
55function _s(n,e){if(n&1&&f(0,"my-actor-cell",13),n&2){let t=p().$implicit;m("actor",t.video.channel);}}function ps(n,e){if(n&1&&v(0),n&2){let t=p().$implicit;L(" ",t.video==null?null:t.video.name," ");}}function ms(n,e){if(n&1&&(c(0,"a",15),v(1),a()),n&2){let t=p(2).$implicit,i=p();m("href",i.getVideoUrl(t.video),at),s(),I(t.video==null?null:t.video.name);}}function us(n,e){n&1&&($(0),g(1,7),F());}function hs(n,e){if(n&1&&C(0,ms,2,2,"a",15)(1,us,2,0,"ng-container"),n&2){let t=p().$implicit;y(t.video?0:1);}}function gs(n,e){if(n&1&&(c(0,"td",10),C(1,cs,2,3,"a",11)(2,ds,2,2,"span",12),a(),c(3,"td"),C(4,_s,1,1,"my-actor-cell",13),a(),c(5,"td"),C(6,ps,1,1)(7,hs,2,1),a(),c(8,"td")(9,"span",14),v(10),a()(),c(11,"td"),v(12),G(13,"ptDate"),a()),n&2){let t=e.$implicit,i=p();s(),y(t.targetUrl?1:2),s(3),y(t.video!=null&&t.video.channel?4:-1),s(2),y(i.isVideoImportPending(t)?6:i.isVideoImportSuccess(t)?7:-1),s(3),m("ngClass",i.getVideoImportStateClass(t.state.id)),s(),L(" ",t.state.label," "),s(2),I(ge(13,6,t.createdAt,"short"));}}function fs(n,e){if(n&1&&f(0,"my-action-dropdown",16),n&2){let t=e.$implicit,i=p();m("actions",i.videoImportActions)("entry",t);}}function Cs(n,e){if(n&1&&(c(0,"pre"),v(1),a()),n&2){let t=e.$implicit;s(),I(t.error);}}function ys(n,e){n&1&&($(0),g(1,8),F());}var Wt=class Wt{notifier=_(A);videoImportService=_(Sr);table=Z("table");inputFilters=[{key:"targetUrl",type:"text",title:"Target URL",placeholder:"https://example.com/.../video.mp4"},{key:"id",type:"text",title:"Import ID",constraint:"numeric"},{key:"videoId",type:"text",title:"Video ID",constraint:"numeric"},{key:"videoChannelSyncId",type:"text",title:"Channel sync ID",constraint:"numeric"}];videoImportActions=[];columns=[{id:"target",label:"Target",sortable:!1},{id:"channel",label:"Channel",sortable:!1},{id:"video",label:"Video",sortable:!1},{id:"state",label:"State",sortable:!1},{id:"createdAt",label:"Created",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:e=>this.cancelImport(e),isDisplayed:e=>this.isVideoImportPending(e)},{label:"Retry import",iconName:"refresh",handler:e=>this.retryImport(e),isDisplayed:e=>this.isVideoImportFailed(e)},{label:"Delete import task",description:"The associated video is not deleted",iconName:"delete",handler:e=>this.deleteImport(e),isDisplayed:e=>this.isVideoImportFailed(e)||this.isVideoImportCancelled(e)||!e.video},{label:"Edit video",iconName:"edit",linkBuilder:e=>[this.getEditVideoUrl(e.video)],isDisplayed:e=>this.isVideoImportSuccess(e)&&!!e.video}];}getVideoImportStateClass(e){switch(e){case Ne.FAILED:return"badge-red";case Ne.REJECTED:return"badge-banned";case Ne.PENDING:return"badge-yellow";case Ne.PROCESSING:return"badge-blue";default:return"badge-green";}}isVideoImportSuccess(e){return e.state.id===Ne.SUCCESS;}isVideoImportPending(e){return e.state.id===Ne.PENDING;}isVideoImportFailed(e){return e.state.id===Ne.FAILED;}isVideoImportCancelled(e){return e.state.id===Ne.CANCELLED;}getVideoUrl(e){return di.buildWatchUrl(e);}getEditVideoUrl(e){return di.buildManageUrl(e);}deleteImport(e){this.videoImportService.deleteVideoImport(e).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}cancelImport(e){this.videoImportService.cancelVideoImport(e).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}retryImport(e){this.videoImportService.retryVideoImport(e).subscribe({next:()=>this.table().loadData(),error:t=>this.notifier.handleError(t)});}_dataLoader(e){return this.videoImportService.listMyVideoImports(de(ce({},e),{includeCollaborations:!0}));}_hasExpandedRow(e){return!!e.error;}};u(Wt,"\u0275fac",function(t){return new(t||Wt)();}),u(Wt,"\u0275cmp",M({type:Wt,selectors:[["ng-component"]],viewQuery:function(t,i){t&1&&ee(i.table,ss,5),t&2&&W();},decls:12,vars:4,consts:()=>{let e;e="imports per page";let t;t="{VAR_PLURAL, plural, =0 {No import} =1 {1 import} other {{INTERPOLATION} imports}}",t=J(t,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let i;i="This video has been deleted";let o;o="Actions";let r;return r="No video import found.",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],t,i,r,["key","MyVideoImportsComponent","paginatorText",e,"columnConfig","false","searchInput","true","refreshButton","true",3,"defaultColumns","dataLoader","inputFilters","hasExpandedRow"],[1,"max-width-300px","ellipsis"],["target","_blank","rel","noopener noreferrer",3,"href","title"],[3,"title"],["actorType","channel",3,"actor"],[1,"pt-badge",3,"ngClass"],["target","_blank","rel","noopener noreferrer",3,"href"],["label",o,"container","body",3,"actions","entry"]];},template:function(t,i){t&1&&(c(0,"my-table",9,0),Q(2,ls,3,4,"ng-template",null,1,N)(4,gs,14,9,"ng-template",null,2,N)(6,fs,1,2,"ng-template",null,3,N)(8,Cs,2,1,"ng-template",null,4,N)(10,ys,2,0,"ng-template",null,5,N),a()),t&2&&m("defaultColumns",i.columns)("dataLoader",i.dataLoader)("inputFilters",i.inputFilters)("hasExpandedRow",i.hasExpandedRow);},dependencies:[se,te,Te,et,qe,be,Ie],styles:["pre[_ngcontent-%COMP%]{font-size:11px}.video-import-error[_ngcontent-%COMP%]{color:var(--red)}"]}));var Cn=Wt;var jt=class extends Rt{videoPlaylistToUpdate;userVideoChannels=[];videoPlaylistPrivacies=[];};var Ss=n=>({"input-error":n}),vs=n=>["/my-library/video-playlists/update",n];function Es(n,e){if(n&1&&(c(0,"my-alert",14),v(1),a()),n&2){let t=p();s(),I(t.error);}}function Ms(n,e){n&1&&(c(0,"li",21),g(1,6),a());}function Ps(n,e){if(n&1&&(c(0,"a",41),v(1),a()),n&2){let t=p(2);m("routerLink",D(2,vs,t.videoPlaylistToUpdate==null?null:t.videoPlaylistToUpdate.shortUUID)),s(),L(" ",t.videoPlaylistToUpdate==null?null:t.videoPlaylistToUpdate.displayName," ");}}function Is(n,e){if(n&1&&(c(0,"li",21),g(1,7),a(),c(2,"li",40),C(3,Ps,2,4,"a",41),a()),n&2){let t=p();s(3),y(t.videoPlaylistToUpdate?3:-1);}}function bs(n,e){n&1&&(c(0,"h2",22),g(1,8),a());}function Ts(n,e){n&1&&(c(0,"h2",22),g(1,9),a());}function Os(n,e){if(n&1&&(c(0,"div",30),v(1),a()),n&2){let t=p();s(),L(" ",t.formErrors.displayName," ");}}function Rs(n,e){if(n&1&&(c(0,"div",30),v(1),a()),n&2){let t=p();s(),I(t.formErrors.privacy);}}function As(n,e){if(n&1&&(c(0,"div",37)(1,"div"),g(2,10),a(),c(3,"div"),g(4,11),a()()),n&2){let t=p();s(2),Y(t.getOwnerAccountDisplayName()),V(2);}}function Ns(n,e){if(n&1&&(c(0,"div",30),v(1),a()),n&2){let t=p();s(),I(t.formErrors.videoChannelId);}}function Ls(n,e){n&1&&(c(0,"div",25)(1,"my-peertube-checkbox",42),$(2,43),c(3,"span"),g(4,12),a(),f(5,"br"),c(6,"span"),g(7,13),a(),F(),a()());}var _t=class _t extends jt{formReactiveService=_(Ue);authService=_(w);notifier=_(A);router=_(ke);videoPlaylistService=_(Pe);serverService=_(le);error;ngOnInit(){this.buildForm({displayName:ji,privacy:Qi,description:Zi,videoChannelId:qi,insertAtFirstPosition:null,thumbnailfile:null}),this.form.get("privacy").valueChanges.subscribe(e=>{Ki(this.form.get("videoChannelId"),e);}),Xe(this.authService,{includeCollaborations:!0}).subscribe(e=>this.userVideoChannels=e),this.serverService.getVideoPlaylistPrivacies().subscribe(e=>{this.videoPlaylistPrivacies=e,this.form.patchValue({privacy:Ao.PRIVATE});});}formValidated(){this.error=void 0;let e=this.form.value,t={displayName:e.displayName,privacy:e.privacy,description:e.description||null,videoChannelId:e.videoChannelId||null,thumbnailfile:e.thumbnailfile||null};this.videoPlaylistService.createVideoPlaylist(t).pipe(we(({videoPlaylist:{id:i}})=>{if(e.insertAtFirstPosition!==!0||!e.videoChannelId)return fi(!0);let o=this.userVideoChannels.find(r=>r.id===e.videoChannelId)?.name;return this.videoPlaylistService.getVideoPlaylist(i).pipe(we(r=>this.videoPlaylistService.reorderPlaylistsOfChannel(o,r.videoChannelPosition,0)));})).subscribe({next:()=>{this.notifier.success("Playlist "+t.displayName+" created."),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"Create";}};u(_t,"\u0275fac",(()=>{let e;return function(i){return(e||(e=Ve(_t)))(i||_t);};})()),u(_t,"\u0275cmp",M({type:_t,selectors:[["ng-component"]],features:[Re],decls:41,vars:18,consts:()=>{let e;e="Edit";let t;t="My Playlists";let i;i="Playlist thumbnail";let o;o="Display name";let r;r="Description";let l;l="Privacy";let d;d="Channel";let h;h="Create";let S;S="Edit";let E;E="NEW PLAYLIST";let B;B="UPDATE PLAYLIST";let ne;ne=" Only "+"\uFFFD0\uFFFD"+"'s channels are listed ";let Oe;Oe=" Changing the owner of a playlist is not supported ";let it;it="Insert at the first position in your channel's playlist list";let nt;nt="Playlists can be manually sorted in your channel.";let X;return X="By default, new playlists are added at the end of the list.",[t,i,o,r,l,d,h,S,E,B,ne,Oe,nt,X,["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"],["input
55Label",e,"inputName","thumbnailfile","formControlName","thumbnailfile"],["for","displayName"],["type","text","id","displayName","formControlName","displayName",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["for","description"],["helpType","markdownText"],["inputId","description","formControlName","description",3,"formError"],["for","privacy"],["inputId","privacy","formControlName","privacy",3,"items"],["for","videoChannelId"],[1,"form-group-description"],["inputId","videoChannelId","formControlName","videoChannelId",3,"items"],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],["aria-current","page",1,"breadcrumb-item","active"],[3,"routerLink"],["inputName","insertAtFirstPosition","formControlName","insertAtFirstPosition","labelText",it],["ngProjectAs","description",5,["description"]]];},template:function(t,i){t&1&&(C(0,Es,2,1,"my-alert",14),c(1,"div",15)(2,"div",16)(3,"nav",17)(4,"ol",18)(5,"li",19)(6,"a",20),g(7,0),a()(),C(8,Ms,2,0,"li",21)(9,Is,4,1),a()(),C(10,bs,2,0,"h2",22)(11,Ts,2,0,"h2",22),a(),c(12,"div",23)(13,"form",24),P("ngSubmit",function(){return i.formValidated();}),c(14,"div",25)(15,"label",26),g(16,1),a(),f(17,"my-image-input",27),a(),c(18,"div",25)(19,"label",28),g(20,2),a(),f(21,"input",29),C(22,Os,2,1,"div",30),a(),c(23,"div",25)(24,"label",31),g(25,3),a(),f(26,"my-help",32)(27,"my-markdown-textarea",33),a(),c(28,"div",25)(29,"label",34),g(30,4),a(),f(31,"my-select-options",35),C(32,Rs,2,1,"div",30),a(),c(33,"div",25)(34,"label",36),g(35,5),a(),C(36,As,5,1,"div",37),f(37,"my-select-channel",38),C(38,Ns,2,1,"div",30),a(),C(39,Ls,8,0,"div",25),f(40,"input",39),a()()()),t&2&&(y(i.error?0:-1),s(8),y(i.isCreation()?8:9),s(2),y(i.isCreation()?10:11),s(3),m("formGroup",i.form),s(8),m("ngClass",D(16,Ss,i.formErrors.displayName)),s(),y(i.formErrors.displayName?22:-1),s(5),m("formError",i.formErrors.description),s(4),m("items",i.videoPlaylistPrivacies),s(),y(i.formErrors.privacy?32:-1),s(4),y(i.isEditor()?36:-1),s(),m("items",i.userVideoChannels),s(),y(i.formErrors.videoChannelId?38:-1),s(),y(i.isCreation()&&i.form.value.videoChannelId?39:-1),s(),m("value",$e(i.getFormButtonTitle()))("disabled",!i.form.valid));},dependencies:[se,te,ie,U,Mt,Et,j,ze,Ge,He,Be,Xi,Hi,Wi,Bi,Ke,Tt,Ze],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-channel[_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}"]}));var yn=_t;var ws=20,Ir=(()=>{let e=class e{_ngZone=_(Ye);_platform=_(Gn);_renderer=_(ft).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new b();_scrolledCount=0;scrollContainers=new Map();register(i){this.scrollContainers.has(i)||this.scrollContainers.set(i,i.elementScrolled().subscribe(()=>this._scrolled.next(i)));}deregister(i){let o=this.scrollContainers.get(i);o&&(o.unsubscribe(),this.scrollContainers.delete(i));}scrolled(i=ws){return this._platform.isBrowser?new ni(o=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));let r=i>0?this._scrolled.pipe(Ln(i)).subscribe(o):this._scrolled.subscribe(o);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0);};}):fi();}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEac
55h((i,o)=>this.deregister(o)),this._scrolled.complete();}ancestorScrolled(i,o){let r=this.getAncestorScrollContainers(i);return this.scrolled(o).pipe(mo(l=>!l||r.indexOf(l)>-1));}getAncestorScrollContainers(i){let o=[];return this.scrollContainers.forEach((r,l)=>{this._scrollableContainsElement(l,i)&&o.push(l);}),o;}_scrollableContainsElement(i,o){let r=fe(o),l=i.getElementRef().nativeElement;do if(r==l)return!0;while(r=r.parentElement);return!1;}};u(e,"\u0275fac",function(o){return new(o||e)();}),u(e,"\u0275prov",ye({token:e,factory:e.ɵfac,providedIn:"root"}));let n=e;return n;})();var xs=20,jn=(()=>{let e=class e{_platform=_(Gn);_listeners;_viewportSize=null;_change=new b();_document=_(gt);constructor(){let i=_(Ye),o=_(ft).createRenderer(null,null);i.runOutsideAngular(()=>{if(this._platform.isBrowser){let r=l=>this._change.next(l);this._listeners=[o.listen("window","resize",r),o.listen("window","orientationchange",r)];}this.change().subscribe(()=>this._viewportSize=null);});}ngOnDestroy(){this._listeners?.forEach(i=>i()),this._change.complete();}getViewportSize(){this._viewportSize||this._updateViewportSize();let i={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),i;}getViewportRect(){let i=this.getViewportScrollPosition(),{width:o,height:r}=this.getViewportSize();return{top:i.top,left:i.left,bottom:i.top+r,right:i.left+o,height:r,width:o};}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let i=this._document,o=this._getWindow(),r=i.documentElement,l=r.getBoundingClientRect(),d=-l.top||i.body?.scrollTop||o.scrollY||r.scrollTop||0,h=-l.left||i.body?.scrollLeft||o.scrollX||r.scrollLeft||0;return{top:d,left:h};}change(i=xs){return i>0?this._change.pipe(Ln(i)):this._change;}
55_getWindow(){return this._document.defaultView||window;}_updateViewportSize(){let i=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:i.innerWidth,height:i.innerHeight}:{width:0,height:0};}};u(e,"\u0275fac",function(o){return new(o||e)();}),u(e,"\u0275prov",ye({token:e,factory:e.ɵfac,providedIn:"root"}));let n=e;return n;})();var br=(()=>{let e=class e{};u(e,"\u0275fac",function(o){return new(o||e)();}),u(e,"\u0275mod",Ti({type:e})),u(e,"\u0275inj",Pi({}));let n=e;return n;})();function qn(n){let e=n.cloneNode(!0),t=e.querySelectorAll("[id]"),i=n.nodeName.toLowerCase();e.removeAttribute("id");for(let o=0;o<t.length;o++)t[o].removeAttribute("id");return i==="canvas"?Rr(n,e):(i==="input"||i==="select"||i==="textarea")&&Or(n,e),Tr("canvas",n,e,Rr),Tr("input, textarea, select",n,e,Or),e;}function Tr(n,e,t,i){let o=e.querySelectorAll(n);if(o.length){let r=t.querySelectorAll(n);for(let l=0;l<o.length;l++)i(o[l],r[l]);}}var Ys=0;function Or(n,e){e.type!=="file"&&(e.value=n.value),e.type==="radio"&&e.name&&(e.name=`mat-clone-${e.name}-${Ys++}`);}function Rr(n,e){let t=e.getContext("2d");if(t)try{t.drawImage(n,0,0);}catch(i){}}function no(n){let e=n.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height,x:e.x,y:e.y};}function Kn(n,e,t){let{top:i,bottom:o,left:r,right:l}=n;return t>=i&&t<=o&&e>=r&&e<=l;}function Vs(n,e){let t=e.left<n.left,i=e.left+e.width>n.right,o=e.top<n.top,r=e.top+e.height>n.bottom;return t||i||o||r;}function hi(n,e,t){n.top+=e,n.bottom=n.top+n.height,n.left+=t,n.right=n.left+n.width;}function Ar(n,e,t,i){let{top:o,right:r,bottom:l,left:d,width:h,height:S}=n,E=h*e,B=S*e;return i>o-B&&i<l+B&&t>d-E&&t<r+E;}var Sn=class{_document;positions=new Map();constructor(e){this._document=e;}clear(){this.positions.clear();}cache(e){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),e.forEach(t=>{this.positions.set(t,{scrollPosition:{top:t.scrollTop,left:t.scrollLeft},clientRect:no(t)});});}handleScroll(e){let t=pi(e),i=this.positions.get(t);if(!i)return null;let o=i.scrollPosition,r,l;if(t===this._document){let S=this.getViewportScrollPosition();r=S.top,l=S.left;}else r=t.scrollTop,l=t.scrollLeft;let d=o.top-r,h=o.left-l;return this.positions.forEach((S,E)=>{S.clientRect&&t!==E&&t.contains(E)&&hi(S.clientRect,d,h);}),o.top=r,o.left=l,{top:d,left:h};}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX};}};function Hr(n,e){let t=n.rootNodes;if(t.length===1&&t[0].nodeType===e.ELEMENT_NODE)return t[0];let i=e.createElement("div");return t.forEach(o=>i.appendChild(o)),i;}function oo(n,e,t){for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];o?n.setProperty(i,o,t?.has(i)?"important":""):n.removeProperty(i);}return n;}function Qt(n,e){let t=e?"":"none";oo(n.style,{"touch-action":e?"":"none","-webkit-user-drag":e?"":"none","-webkit-tap-highlight-color":e?"":"transparent","user-select":t,"-ms-user-select":t,"-webkit-user-select":t,"-moz-user-select":t});}function Nr(n,e,t){oo(n.style,{position:e?"":"fixed",top:e?"":"0",opacity:e?"":"0",left:e?"":"-999em"},t);}function vn(n,e){return e&&e!="none"?n+" "+e:n;}function Lr(n,e){n.style.width=`${e.width}px`,n.style.height=`${e.height}px`,n.style.transform=gi(e.left,e.top);}function gi(n,e){return`translate3d(${Math.round(n)}px, ${Math.round(e)}px, 0)`;}var mi={capture:!0},Qn={passive:!1,capture:!0},$s=(()=>{let e=class e{};u(e,"\u0275fac",function(o){return new(o||e)();}),u(e,"\u0275cmp",M({type:e,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(o,r){},styles:[`@layer cdk-resets {
56  .cdk-drag-preview {
57    background: none;
58    border: none;
59    padding: 0;
60    color: inherit;
61    inset: auto;
62  }
63}
64.cdk-drag-placeholder *,
65.cdk-drag-preview * {
66  pointer-events: none !important;
67}
68`],encapsulation:2,changeDetection:0}));let n=e;return n;})(),ro=(()=>{let e=class e{_ngZone=_(Ye);_document=_(gt);_styleLoader=_(Wo);_renderer=_(ft).createRenderer(null,null);_cleanupDocumentTouchmove;
68_scroll=new b();_dropInstances=new Set();_dragInstances=new Set();_activeDragInstances=Ii([]);_globalListeners;_draggingPredicate=i=>i.isDragging();_domNodesToDirectives=null;pointerMove=new b();pointerUp=new b();constructor(){}registerDropContainer(i){this._dropInstances.has(i)||this._dropInstances.add(i);}registerDragItem(i){this._dragInstances.add(i),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,Qn);});}removeDropContainer(i){this._dropInstances.delete(i);}removeDragItem(i){this._dragInstances.delete(i),this.stopDragging(i),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.();}startDragging(i,o){if(!(this._activeDragInstances().indexOf(i)>-1)&&(this._styleLoader.load($s),this._activeDragInstances.update(r=>[...r,i]),this._activeDragInstances().length===1)){let r=o.type.startsWith("touch"),l=h=>this.pointerUp.next(h),d=[["scroll",h=>this._scroll.next(h),mi],["selectstart",this._preventDefaultWhileDragging,Qn]];r?d.push(["touchend",l,mi],["touchcancel",l,mi]):d.push(["mouseup",l,mi]),r||d.push(["mousemove",h=>this.pointerMove.next(h),Qn]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=d.map(([h,S,E])=>this._renderer.listen(this._document,h,S,E));});}}stopDragging(i){this._activeDragInstances.update(o=>{let r=o.indexOf(i);return r>-1?(o.splice(r,1),[...o]):o;}),this._activeDragInstances().length===0&&this._clearGlobalListeners();}isDragging(i){return this._activeDragInstances().indexOf(i)>-1;}scrolled(i){let o=[this._scroll];return i&&i!==this._document&&o.push(new ni(r=>this._ngZone.runOutsideAngular(()=>{let l=this._renderer.listen(i,"scroll",d=>{this._activeDragInstances().length&&r.next(d);},mi);return()=>{l();};}))),Si(...o);}registerDirectiveNode(i,o){this._domNodesToDirectives??=new WeakMap(),this._domNodesToDirectives.set(i,o);}removeDirectiveNode(i){this._domNodesToDirectives?.delete(i);}getDragDirectiveForNode(i){return this._domNodesToDirectives?.get(i)||null;}ngOnDestroy(){this._dragInstances.forEach(i=>this.removeDragItem(i)),this._dropInstances.forEach(i=>this.removeDropContainer(i)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete();}_preventDefaultWhileDragging=i=>{this._activeDragInstances().length>0&&i.preventDefault();};_persistentTouchmoveListener=i=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&i.preventDefault(),this.pointerMove.next(i));};_clearGlobalListeners(){this._globalListeners?.forEach(i=>i()),this._globalListeners=void 0;}};u(e,"\u0275fac",function(o){return new(o||e)();}),u(e,"\u0275prov",ye({token:e,factory:e.ɵfac,providedIn:"root"}));let n=e;return n;})();function Dr(n){let e=n.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(n)*e;}function Fs(n){let e=getComputedStyle(n),t=Zn(e,"transition-property"),i=t.find(d=>d==="transform"||d==="all");if(!i)return 0;let o=t.indexOf(i),r=Zn(e,"transition-duration"),l=Zn(e,"transition-delay");return Dr(r[o])+Dr(l[o]);}function Zn(n,e){return n.getPropertyValue(e).split(",").map(i=>i.trim());}var ks=new Set(["position"]),Jn=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview;}constructor(e,t,i,o,r,l,d,h,S,E){this._document=e,this._rootElement=t,this._direction=i,this._initialDomRect=o,this._previewTemplate=r,this._previewClass=l,this._pickupPositionOnPage=d,this._initialTransform=h,this._zIndex=S,this._renderer=E;}attach(e){this._preview=this._createPreview(),e.appendChild(this._preview),wr(this._preview)&&this._preview.showPopover();}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null;}setTransform(e){this._preview.style.transform=e;}getBoundingClientRect(){return this._preview.getBoundingClientRect();}addClass(e){this._preview.classList.add(e);}getTransitionDuration(){return Fs(this._preview);}addEventListener(e,t){return this._renderer.listen(this._preview,e,t);}_createPreview(){let e=this._previewTemplate,t=this._previewClass,i=e?e.template:null,o;if(i&&e){let r=e.matchSize?this._initialDomRect:null,l=e.viewContainer.createEmbeddedView(i,e.context);l.detectChanges(),o=Hr(l,this._document),this._previewEmbeddedView=l,e.matchSize?Lr(o,r):o.style.transform=gi(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y);}else o=qn(this._rootElement),Lr(o,this._initialDomRect),this._initialTransform&&(o.style.transform=this._initialTransform);return oo(o.style,{"pointer-events":"none",margin:wr(o)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},ks),Qt(o,!1),o.classList.add("cdk-drag-preview"),o.setAttribute("popover","manual"),o.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(r=>o.classList.add(r)):o.classList.add(t)),o;}};function wr(n){return"showPopover"in n;}var zs={passive:!0},xr={passive:!1},Bs={passive:!1,capture:!0},Hs=800,Yr="cdk-drag-placeholder",Vr=new Set(["position"]);function Gr(n,e,t={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=n.get(Vn,null,{optional:!0})||n.get(ft).createRenderer(null,null);return new eo(e,t,n.get(gt),n.get(Ye),n.get(jn),n.get(ro),i);}var eo=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=Ii(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new b();_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=ot.EMPTY;_pointerUpSubscription=ot.EMPTY;_scrollSubscription=ot.EMPTY;_resizeSubscription=ot.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(e){e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEac
68h(t=>Qt(t,e)));}_disabled=!1;beforeStarted=new b();started=new b();released=new b();ended=new b();entered=new b();exited=new b();dropped=new b();moved=this._moveEvents;data;constrainPosition;constructor(e,t,i,o,r,l,d){this._config=t,this._document=i,this._ngZone=o,this._viewportRuler=r,this._dragDropRegistry=l,this._renderer=d,this.withRootElement(e).withParent(t.parentDragRef||null),this._parentPositions=new Sn(i),l.registerDragItem(this);}getPlaceholderElement(){return this._placeholder;}getRootElement(){return this._rootElement;}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement();}withHandles(e){this._handles=e.map(i=>fe(i)),this._handles.forEach(i=>Qt(i,this.disabled)),this._toggleNativeDragInteractions();let t=new Set();return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&t.add(i);}),this._disabledHandles=t,this;}withPreviewTemplate(e){return this._previewTemplate=e,this;}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this;}withRootElement(e){let t=fe(e);if(t!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(t,"mousedown",this._pointerDown,xr),i.listen(t,"touchstart",this._pointerDown,zs),i.listen(t,"dragstart",this._nativeDragStart,xr)]),this._initialTransform=void 0,this._rootElement=t;}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this;}withBoundaryElement(e){return this._boundaryElement=e?fe(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this;}withParent(e){return this._parentDragRef=e,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&&Vs(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let e=this._boundaryElement.getBoundingClientRect(),t=this._rootElement.getBoundingClientRect(),i=0,o=0;t.left<e.left?i=e.left-t.left:t.right>e.right&&(i=e.right-t.right),t.top<e.top?o=e.top-t.top:t.bottom>e.bottom&&(o=e.bottom-t.bottom);let r=this._activeTransform.x,l=this._activeTransform.y,d=r+i,h=l+o;this._rootElement.style.transform=gi(d,h),this._activeTransform={x:d,y:h},this._passiveTransform={x:d,y:h};}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),Qt(e,!0));}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),Qt(e,this.disabled));}withDirection(e){return this._direction=e,this;}_withDropContainer(e){this._dropContainer=e;}getFreeDragPosition(){let e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y};}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this;}withPreviewContainer(e){return this._previewContainer=e,this;}_sortFromLastPointerPosition(){let e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e);}_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=e=>{if(this.beforeStarted.next(),this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&this._initializeDragSequence(t,e);}else this.disabled||this._initializeDragSequence(this._rootElement,e);};_pointerMove=e=>{let t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging()){let o=Math.abs(t.x-this._pickupPositionOnPage.x),r=Math.abs(t.y-this._pickupPositionOnPage.y);if(o+r>=this._config.dragStartThreshold){let d=Date.now()>=this._dragStartTime+this._getDragStartDelay(e),h=this._dropContainer;if(!d){this._endDragSequence(e);return;}
vendor: 8,887 bytes, line 68
68(!h||!h.isDragging()&&!h.isReceiving())&&(e.cancelable&&e.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(e)));}return;}e.cancelable&&e.preventDefault();let i=this._getConstrainedPointerPosition(t);if(this._hasMoved=!0,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,t);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:e,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta});});};_pointerUp=e=>{this._endDragSequence(e);};_endDragSequence(e){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:e}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);});else{this._passiveTransform.x=this._activeTransform.x;let t=this._getPointerPositionOnPage(e);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(t),dropPoint:t,event:e});}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this);}}_startDragSequence(e){ui(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let t=this._getShadowRoot(),i=this._dropContainer;if(t&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(t,"selectstart",Gs,Bs);}),i){let o=this._rootElement,r=o.parentNode,l=this._placeholder=this._createPlaceholderElement(),d=this._marker=this._marker||this._document.createComment("");r.insertBefore(d,o),this._initialTransform=o.style.transform||"",this._preview=new Jn(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,t)),Nr(o,!1,Vr),this._document.body.appendChild(r.replaceChild(l,o)),this.started.next({source:this,event:e}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this);}else this.started.next({source:this,event:e}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[]);}_initializeDragSequence(e,t){this._parentDragRef&&t.stopPropagation();let i=this.isDragging(),o=ui(t),r=!o&&t.button!==0,l=this._rootElement,d=pi(t),h=!o&&this._lastTouchEventTime&&this._lastTouchEventTime+Hs>Date.now(),S=o?Xo(t):Uo(t);if(d&&d.draggable&&t.type==="mousedown"&&t.preventDefault(),i||r||h||S)return;if(this._handles.length){let ne=l.style;this._rootElementTapHighlight=ne.webkitTapHighlightColor||"",ne.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(ne=>this._updateOnScroll(ne)),this._boundaryElement&&(this._boundaryRect=no(this._boundaryElement));let E=this._previewTemplate;this._pickupPositionInElement=E&&E.template&&!E.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,e,t);let B=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:B.x,y:B.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t);}_cleanupDragArtifacts(e){Nr(this._rootElement,!0,Vr),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 t=this._dropContainer,i=t.getItemIndex(this),o=this._getPointerPositionOnPage(e),r=this._getDragDistance(o),l=t._isOverContainer(o.x,o.y);this.ended.next({source:this,distance:r,dropPoint:o,event:e}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:l,distance:r,dropPoint:o,event:e}),t.drop(this,i,this._initialIndex,this._initialContainer,l,r,o,e),this._dropContainer=this._initialContainer;});}_updateActiveDropContainer({x:e,y:t},{x:i,y:o}){let r=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{let l=this._dropContainer.getItemIndex(this),d=this._dropContainer.getItemAtIndex(l+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(r,this._dropContainer,d),this._dropContainer=r,this._dropContainer.enter(this,e,t,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,e,t,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(e,t):this._applyPreviewTransform(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y));}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let e=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(e.left,e.top);let t=this._preview.getTransitionDuration();return t===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let o=d=>{(!d||this._preview&&pi(d)===this._preview.element&&d.propertyName==="transform")&&(l(),i(),clearTimeout(r));},r=setTimeout(o,t*1.5),l=this._preview.addEventListener("transitionend",o);}));}_createPlaceholderElement(){let e=this._placeholderTemplate,t=e?e.template:null,i;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),i=Hr(this._placeholderRef,this._document)):i=qn(this._rootElement),i.style.pointerEvents="none",i.classList.add(Yr),i;}_getPointerPositionInElement(e,t,i){let o=t===this._rootElement?null:t,r=o?o.getBoundingClientRect():e,l=ui(i)?i.targetTouches[0]:i,d=this._getViewportScrollPosition(),h=l.pageX-r.left-d.left,S=l.pageY-r.top-d.top;return{x:r.left-e.left+h,y:r.top-e.top+S};}_getPointerPositionOnPage(e){let t=this._getViewportScrollPosition(),i=ui(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,o=i.pageX-t.left,r=i.pageY-t.top;if(this._ownerSVGElement){let l=this._ownerSVGElement.getScreenCTM();if(l){let d=this._ownerSVGElement.createSVGPoint();return d.x=o,d.y=r,d.matrixTransform(l.inverse());}}return{x:o,y:r};}_getConstrainedPointerPosition(e){let t=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:o}=this.constrainPosition?this.constrainPosition(e,this,this._initialDomRect,this._pickupPositionInElement):e;if(this.lockAxis==="x"||t==="x"?o=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||t==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:r,y:l}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,d=this._boundaryRect,{width:h,height:S}=this._getPreviewRect(),E=d.top+l,B=d.bottom-(S-l),ne=d.left+r,Oe=d.right-(h-r);i=$r(i,ne,Oe),o=$r(o,E,B);}return{x:i,y:o};}_updatePointerDirectionDelta(e){let{x:t,y:i}=e,o=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,l=Math.abs(t-r.x),d=Math.abs(i-r.y);return l>this._config.pointerDirectionChangeThreshold&&(o.x=t>r.x?1:-1,r.x=t),d>this._config.pointerDirectionChangeThreshold&&(o.y=i>r.y?1:-1,r.y=i),o;}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,Qt(this._rootElement,e));}_removeRootElementListeners(){this._rootElementCleanups?.forEach(e
68=>e()),this._rootElementCleanups=void 0;}_applyRootElementTransform(e,t){let i=1/this.scale,o=gi(e*i,t*i),r=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=r.transform&&r.transform!="none"?r.transform:""),r.transform=vn(o,this._initialTransform);}_applyPreviewTransform(e,t){let i=this._previewTemplate?.template?void 0:this._initialTransform,o=gi(e,t);this._preview.setTransform(vn(o,i));}_getDragDistance(e){let t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0};}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear();}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(e===0&&t===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,l=i.right-o.right,d=o.top-i.top,h=i.bottom-o.bottom;o.width>i.width?(r>0&&(e+=r),l>0&&(e-=l)):e=0,o.height>i.height?(d>0&&(t+=d),h>0&&(t-=h)):t=0,(e!==this._passiveTransform.x||t!==this._passiveTransform.y)&&this.setFreeDragPosition({y:t,x:e});}_getDragStartDelay(e){let t=this.dragStartDelay;return typeof t=="number"?t:ui(e)?t.touch:t?t.mouse:0;}_updateOnScroll(e){let t=this._parentPositions.handleScroll(e);if(t){let i=pi(e);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&hi(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.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=Gi(this._rootElement)),this._cachedShadowRoot;}_getPreviewInsertionPoint(e,t){let i=this._previewContainer||"global";if(i==="parent")return e;if(i==="global"){let o=this._document;return t||o.fullscreenElement||o.webkitFullscreenElement||o.mozFullScreenElement||o.msFullscreenElement||o.body;}return fe(i);}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect;}_nativeDragStart=e=>{if(this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&e.preventDefault();}else this.disabled||e.preventDefault();};_getTargetHandle(e){return this._handles.find(t=>e.target&&(e.target===t||t.contains(e.target)));}_conditionallyInsertAnchor(e,t,i){if(e===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(t===this._initialContainer&&t.hasAnchor){let o=this._anchor??=qn(this._placeholder);o.classList.remove(Yr),o.classList.add("cdk-drag-anchor"),o.style.transform="",i?i.before(o):fe(t.element).appendChild(o);}}};function $r(n,e,t){return Math.max(e,Math.min(t,n));}function ui(n){return n.type[0]==="t";}function Gs(n){n.preventDefault();}function Ur(n,e,t){let i=Fr(e,n.length-1),o=Fr(t,n.length-1);if(i===o)return;let r=n[i],l=o<i?-1:1;for(let d=i;d!==o;d+=l)n[d]=n[d+l];n[o]=r;}function Fr(n,e){return Math.max(0,Math.min(e,n));}var En=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(e){this._dragDropRegistry=e;}_previousSwap={drag:null,delta:0,overlaps:!1};start(e){this.withItems(e);}sort(e,t,i,o){let r=this._itemPositions,l=this._getItemIndexFromPointerPosition(e,t,i,o);if(l===-1&&r.length>0)return null;let d=this.orientation==="horizontal",h=r.findIndex(X=>X.drag===e),S=r[l],E=r[h].clientRect,B=S.clientRect,ne=h>l?1:-1,Oe=this._getItemOffsetPx(E,B,ne),it=this._getSiblingOffsetPx(h,r,ne),nt=r.slice();return Ur(r,h,l),r.forEach((X,R)=>{if(nt[R]===X)return;let so=X.drag===e,An=so?Oe:it,lo=so?e.getPlaceholderElement():X.drag.getRootElement();X.offset+=An;let co=Math.round(X.offset*(1/X.drag.scale));d?(lo.style.transform=vn(`translate3d(${co}px, 0, 0)`,X.initialTransform),hi(X.clientRect,0,An)):(lo.style.transform=vn(`translate3d(0, ${co}px, 0)`,X.initialTransform),hi(X.clientRect,An,0));}),this._previousSwap.overlaps=Kn(B,t,i),this._previousSwap.drag=S.drag,this._previousSwap.delta=d?o.x:o.y,{previousIndex:h,currentIndex:l};}enter(e,t,i,o){let r=this._activeDraggables,l=r.indexOf(e),d=e.getPlaceholderElement();l>-1&&r.splice(l,1);let h=o==null||o<0?this._getItemIndexFromPointerPosition(e,t,i):o,S=r[h];if(S===e&&(S=r[h+1]),!S&&(h==null||h===-1||h<r.length-1)&&this._shouldEnterAsFirstChild(t,i)&&(S=r[0]),S&&!this._dragDropRegistry.isDragging(S)){let E=S.getRootElement();E.parentElement.insertBefore(d,E),r.splice(h,0,e);}else this._element.appendChild(d),r.push(e);d.style.transform="",this._cacheItemPositions();}withItems(e){this._activeDraggables=e.slice(),this._cacheItemPositions();}withSortPredicate(e){this._sortPredicate=e;}
68reset(){this._activeDraggables?.forEach(e=>{let t=e.getRootElement();if(t){let i=this._itemPositions.find(o=>o.drag===e)?.initialTransform;t.style.transform=i||"";}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1;}getActiveItemsSnapshot(){return this._activeDraggables;}getItemIndex(e){return this._getVisualItemPositions().findIndex(t=>t.drag===e);}getItemAtIndex(e){return this._getVisualItemPositions()[e]?.drag||null;}updateOnScroll(e,t){this._itemPositions.forEach(({clientRect:i})=>{hi(i,e,t);}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition();});}withElementContainer(e){this._element=e;}_cacheItemPositions(){let e=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(t=>{let i=t.getVisibleElement();return{drag:t,offset:0,initialTransform:i.style.transform||"",clientRect:no(i)};}).sort((t,i)=>e?t.clientRect.left-i.clientRect.left:t.clientRect.top-i.clientRect.top);}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions;}_getItemOffsetPx(e,t,i){let o=this.orientation==="horizontal",r=o?t.left-e.left:t.top-e.top;return i===-1&&(r+=o?t.width-e.width:t.height-e.height),r;}_getSiblingOffsetPx(e,t,i){let o=this.orientation==="horizontal",r=t[e].clientRect,l=t[e+i*-1],d=r[o?"width":"height"]*i;if(l){let h=o?"left":"top",S=o?"right":"bottom";i===-1?d-=l.clientRect[h]-r[S]:d+=r[h]-l.clientRect[S];}return d;}_shouldEnterAsFirstChild(e,t){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,o=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let l=i[i.length-1].clientRect;return o?e>=l.right:t>=l.bottom;}else{let l=i[0].clientRect;return o?e<=l.left:t<=l.top;}}_getItemIndexFromPointerPosition(e,t,i,o){let r=this.orientation==="horizontal",l=this._itemPositions.findIndex(({drag:d,clientRect:h})=>{if(d===e)return!1;if(o){let S=r?o.x:o.y;if(d===this._previousSwap.drag&&this._previousSwap.overlaps&&S===this._previousSwap.delta)return!1;}return r?t>=Math.floor(h.left)&&t<Math.floor(h.right):i>=Math.floor(h.top)&&i<Math.floor(h.bottom);});return l===-1||!this._sortPredicate(l,e)?-1:l;}},to=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(e,t){this._document=e,this._dragDropRegistry=t;}start(e){let t=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<t.length;i++){let o=t[i];this._relatedNodes.push([o,o.nextSibling]);}this.withItems(e);}sort(e,t,i,o){let r=this._getItemIndexFromPointerPosition(e,t,i),l=this._previousSwap;if(r===-1||this._activeItems[r]===e)return null;let d=this._activeItems[r];if(l.drag===d&&l.overlaps&&l.deltaX===o.x&&l.deltaY===o.y)return null;let h=this.getItemIndex(e),S=e.getPlaceholderElement(),E=d.getRootElement();r>h?E.after(S):E.before(S),Ur(this._activeItems,h,r);let B=this._getRootNode().elementFromPoint(t,i);return l.deltaX=o.x,l.deltaY=o.y,l.drag=d,l.overlaps=E===B||E.contains(B),{previousIndex:h,currentIndex:r};}enter(e,t,i,o){let r=this._activeItems.indexOf(e);r>-1&&this._activeItems.splice(r,1);let l=o==null||o<0?this._getItemIndexFromPointerPosition(e,t,i):o;l===-1&&(l=this._getClosestItemIndexToPointer(e,t,i));let d=this._activeItems[l];d&&!this._dragDropRegistry.isDragging(d)?(this._activeItems.splice(l,0,e),d.getRootElement().before(e.getPlaceholderElement())):(this._activeItems.push(e),this._element.appendChild(e.getPlaceholderElement()));}withItems(e){this._activeItems=e.slice();}withSortPredicate(e){this._sortPredicate=e;}reset(){let e=this._element,t=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[o,r]=this._relatedNodes[i];o.parentNode===e&&o.nextSibling!==r&&(r===null?e.appendChild(o):r.parentNode===e&&e.insertBefore(o,r));}this._relatedNodes=[],this._activeItems=[],t.drag=null,t.deltaX=t.deltaY=0,t.overlaps=!1;}getActiveItemsSnapshot(){return this._activeItems;}getItemIndex(e){return this._activeItems.indexOf(e);}getItemAtIndex(e){return this._activeItems[e]||null;}
68updateOnScroll(){this._activeItems.forEach(e=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition();});}withElementContainer(e){e!==this._element&&(this._element=e,this._rootNode=void 0);}_getItemIndexFromPointerPosition(e,t,i){let o=this._getRootNode().elementFromPoint(Math.floor(t),Math.floor(i)),r=o?this._activeItems.findIndex(l=>{let d=l.getRootElement();return o===d||d.contains(o);}):-1;return r===-1||!this._sortPredicate(r,e)?-1:r;}_getRootNode(){return this._rootNode||(this._rootNode=Gi(this._element)||this._document),this._rootNode;}_getClosestItemIndexToPointer(e,t,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let o=1/0,r=-1;for(let l=0;l<this._activeItems.length;l++){let d=this._activeItems[l];if(d!==e){let{x:h,y:S}=d.getRootElement().getBoundingClientRect(),E=Math.hypot(t-h,i-S);E<o&&(o=E,r=l);}}return r;}},kr=.05,Xr=.05,_e=function(n){return n[n.NONE=0]="NONE",n[n.UP=1]="UP",n[n.DOWN=2]="DOWN",n;}(_e||{}),oe=function(n){return n[n.NONE=0]="NONE",n[n.LEFT=1]="LEFT",n[n.RIGHT=2]="RIGHT",n;}(oe||{});function Wr(n,e){return new io(e,n.get(ro),n.get(gt),n.get(Ye),n.get(jn));}var io=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new b();entered=new b();exited=new b();dropped=new b();sorted=new b();receivingStarted=new b();receivingStopped=new b();data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set();_viewportScrollSubscription=ot.EMPTY;_verticalScrollDirection=_e.NONE;_horizontalScrollDirection=oe.NONE;_scrollNode;_stopScrollTimers=new b();_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(e,t,i,o,r){this._dragDropRegistry=t,this._ngZone=o,this._viewportRuler=r;let l=this.element=fe(e);this._document=i,this.withOrientation("vertical").withElementContainer(l),t.registerDropContainer(this),this._parentPositions=new Sn(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(e,t,i,o){this._draggingStarted(),o==null&&this.sortingDisabled&&(o=this._draggables.indexOf(e)),this._sortStrategy.enter(e,t,i,o),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)});}exit(e){this._reset(),this.exited.next({item:e,container:this});}drop(e,t,i,o,r,l,d,h={}){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:i,container:this,previousContainer:o,isPointerOverContainer:r,distance:l,dropPoint:d,event:h});}withItems(e){let t=this._draggables;return this._draggables=e,e.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(t.filter(o=>o.isDragging()).every(o=>e.indexOf(o)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this;}withDirection(e){return this._direction=e,this._sortStrategy instanceof En&&(this._sortStrategy.direction=e),this;}connectedTo(e){return this._siblings=e.slice(),this;}withOrientation(e){if(e==="mixed")this._sortStrategy=new to(this._document,this._dragDropRegistry);else{let t=new En(this._dragDropRegistry);t.direction=this._direction,t.orientation=e,this._sortStrategy=t;}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((t,i)=>this.sortPredicate(t,i,this)),this;}withScrollableParents(e){let t=this._container;return this._scrollableElements=e.indexOf(t)===-1?[t,...e]:e.slice(),this;}withElementContainer(e){if(e===this._container)return this;let t=fe(this.element),i=this._scrollableElements.indexOf(this._container),o=this._scrollableElements.indexOf(e);return i>-1&&this._scrollableElements.splice(i,1),o>-1&&this._scrollableElements.splice(o,1),this._sortStrategy&&this._sortStrategy.withElementContainer(e),this._cachedShadowRoot=null,this._scrollableElements.unshift(e),this._container=e,this;}getScrollableParents(){return this._scrollableElements;}getItemIndex(e){return this._isDragging?this._sortStrategy.getItemIndex(e):this._draggables.indexOf(e);}getItemAtIndex(e){return this._isDragging?this._sortStrategy.getItemAtIndex(e):this._draggables[e]||null;}isReceiving(){return this._activeSiblings.size>0;}_sortItem(e,t,i,o){if(this.sortingDisabled||!this._domRect||!Ar(this._domRect,kr,t,i))return;let r=this._sortStrategy.sort(e,t,i,o);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:e});}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let i,o=_e.NONE,r=oe.NONE;if(this._parentPositions.positions.forEach((l,d)=>{d===this._document||!l.clientRect||i||Ar(l.clientRect,kr,e,t)&&([o,r]=Us(d,l.clientRect,this._direction,e,t),(o||r)&&(i=d));}),!o&&!r){let{width:l,height:d}=this._viewportRuler.getViewportSize(),h={width:l,height:d,top:0,right:l,bottom:d,left
68:0};o=jr(h,t),r=Qr(h,e),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 e=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.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 e=this._container.style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(t=>t._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear();}_startScrollInterval=()=>{this._stopScrolling(),po(0,Nn).pipe(ht(this._stopScrollTimers)).subscribe(()=>{let e=this._scrollNode,t=this.autoScrollStep;this._verticalScrollDirection===_e.UP?e.scrollBy(0,-t):this._verticalScrollDirection===_e.DOWN&&e.scrollBy(0,t),this._horizontalScrollDirection===oe.LEFT?e.scrollBy(-t,0):this._horizontalScrollDirection===oe.RIGHT&&e.scrollBy(t,0);});};_isOverContainer(e,t){return this._domRect!=null&&Kn(this._domRect,e,t);}_getSiblingContainerFromPosition(e,t,i){return this._siblings.find(o=>o._canReceive(e,t,i));}_canReceive(e,t,i){if(!this._domRect||!Kn(this._domRect,t,i)||!this.enterPredicate(e,this))return!1;let o=this._getShadowRoot().elementFromPoint(t,i);return o?o===this._container||this._container.contains(o):!1;}_startReceiving(e,t){let i=this._activeSiblings;!i.has(e)&&t.every(o=>this.enterPredicate(o,this)||this._draggables.indexOf(o)>-1)&&(i.add(e),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:e,receiver:this,items:t}));}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:e,receiver:this});}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(e=>{if(this.isDragging()){let t=this._parentPositions.handleScroll(e);t&&this._sortStrategy.updateOnScroll(t.top,t.left);}else this.isReceiving()&&this._cacheParentPositions();});}_getShadowRoot(){if(!this._cachedShadowRoot){let e=Gi(this._container);this._cachedShadowRoot=e||this._document;}return this._cachedShadowRoot;}_notifyReceivingSiblings(){let e=this._sortStrategy.getActiveItemsSnapshot().filter(t=>t.isDragging());this._siblings.forEach(t=>t._startReceiving(this,e));}};function jr(n,e){let{top:t,bottom:i,height:o}=n,r=o*Xr;return e>=t-r&&e<=t+r?_e.UP:e>=i-r&&e<=i+r?_e.DOWN:_e.NONE;}function Qr(n,e){let{left:t,right:i,width:o}=n,r=o*Xr;return e>=t-r&&e<=t+r?oe.LEFT:e>=i-r&&e<=i+r?oe.RIGHT:oe.NONE;}function Us(n,e,t,i,o){let r=jr(e,o),l=Qr(e,i),d=_e.NONE,h=oe.NONE;if(r){let S=n.scrollTop;r===_e.UP?S>0&&(d=_e.UP):n.scrollHeight-S>n.clientHeight&&(d=_e.DOWN);}if(l){let S=n.scrollLeft;t==="rtl"?l===oe.RIGHT?S<0&&(h=oe.RIGHT):n.scrollWidth+S>n.clientWidth&&(h=oe.LEFT):l===oe.LEFT?S>0&&(h=oe.LEFT):n.scrollWidth-S>n.clientWidth&&(h=oe.RIGHT);}return[d,h];}var Xs=(()=>{let e=class e{_injector=_(oi);constructor(){}createDrag(i,o){return Gr(this._injector,i,o);}createDropList(i){return Wr(this._injector,i);}};u(e,"\u0275fac",function(o){return new(o||e)();}),u(e,"\u0275prov",ye({token:e,factory:e.ɵfac,providedIn:"root"}));let n=e;return n;})(),zr=new rt("CDK_DRAG_PARENT");var Ws=new rt("CdkDragHandle");var Zr=new rt("CDK_DRAG_CONFIG"),qr=new rt("CdkDropList"),Kr=(()=>{let e=class e{element=_(bi);dropContainer=_(qr,{optional:!0,skipSelf:!0});_ngZone=_(Ye);_viewContainerRef=_($n);_dir=_(Un,{optional:!0});_changeDetectorRef=_(St);_selfHandle=_(Ws,{optional:!0,self:!0});_parentDrag=_(zr,{optional:!0,skipSelf:!0});_dragDropRegistry=_(ro);_destroyed=new b();_handles=new _o([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled);}set disabled(i){this._disabled=i,this._dragRef.disabled=this._disabled;}_disabled=!1;constrainPosition;previewClass;previewContainer;scale=1;started=new pe();released=new pe();ended=new pe();entered=new pe();exited=new pe();dropped=new pe();moved=new ni(i=>{let o=this._dragRef.moved.pipe(ut(r=>({source:this,pointerPosition:r.pointerPosition,event:r.event,delta:r.delta,distance:r.distance}))).subscribe(i);return()=>{o.unsubscribe();};});_injector=_(oi);constructor(){let i=this.dropContainer,o=_(Zr,{optional:!0});this._dragRef=Gr(this._injector,this.element,{dragStartThreshold:o&&o.dragStartThreshold!=null?o.dragStartThreshold:5,pointerDirectionChangeThreshold:o&&o.pointerDirectionChangeThreshold!=null?o.pointerDirectionChangeThreshold:5,zIndex:o?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),o&&this._assignDefaults(o),i&&(i.addItem(this),i._dropListRef.beforeStarted.pipe(ht(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(i){this._dragRef.setFreeDragPosition(i);}ngAfterViewInit(){Yn(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);},{injector:this._injector});}ngOnChanges(i){let o=i.rootElementSelector,r=i.freeDragPosition;o&&!o.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,r&&!r.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition);}
68ngOnDestroy(){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(i){let o=this._handles.getValue();o.push(i),this._handles.next(o);}_removeHandle(i){let o=this._handles.getValue(),r=o.indexOf(i);r>-1&&(o.splice(r,1),this._handles.next(o));}_setPreviewTemplate(i){this._previewTemplate=i;}_resetPreviewTemplate(i){i===this._previewTemplate&&(this._previewTemplate=null);}_setPlaceholderTemplate(i){this._placeholderTemplate=i;}_resetPlaceholderTemplate(i){i===this._placeholderTemplate&&(this._placeholderTemplate=null);}_updateRootElement(){let i=this.element.nativeElement,o=i;this.rootElementSelector&&(o=i.closest!==void 0?i.closest(this.rootElementSelector):i.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(o||i);}_getBoundaryElement(){let i=this.boundaryElement;return i?typeof i=="string"?this.element.nativeElement.closest(i):fe(i):null;}_syncInputs(i){i.beforeStarted.subscribe(()=>{if(!i.isDragging()){let o=this._dir,r=this.dragStartDelay,l=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;i.disabled=this.disabled,i.lockAxis=this.lockAxis,i.scale=this.scale,i.dragStartDelay=typeof r=="object"&&r?r:Fi(r),i.constrainPosition=this.constrainPosition,i.previewClass=this.previewClass,i.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(l).withPreviewTemplate(d).withPreviewContainer(this.previewContainer||"global"),o&&i.withDirection(o.value);}}),i.beforeStarted.pipe(uo(1)).subscribe(()=>{if(this._parentDrag){i.withParent(this._parentDrag._dragRef);return;}let o=this.element.nativeElement.parentElement;for(;o;){let r=this._dragDropRegistry.getDragDirectiveForNode(o);if(r){i.withParent(r._dragRef);break;}o=o.parentElement;}});}_handleEvents(i){i.started.subscribe(o=>{this.started.emit({source:this,event:o.event}),this._changeDetectorRef.markForCheck();}),i.released.subscribe(o=>{this.released.emit({source:this,event:o.event});}),i.ended.subscribe(o=>{this.ended.emit({source:this,distance:o.distance,dropPoint:o.dropPoint,event:o.event}),this._changeDetectorRef.markForCheck();}),i.entered.subscribe(o=>{this.entered.emit({container:o.container.data,item:this,currentIndex:o.currentIndex});}),i.exited.subscribe(o=>{this.exited.emit({container:o.container.data,item:this});}),i.dropped.subscribe(o=>{this.dropped.emit({previousIndex:o.previousIndex,currentIndex:o.currentIndex,previousContainer:o.previousContainer.data,container:o.container.data,isPointerOverContainer:o.isPointerOverContainer,item:this,distance:o.distance,dropPoint:o.dropPoint,event:o.event});});}_assignDefaults(i){let{lockAxis:o,dragStartDelay:r,constrainPosition:l,previewClass:d,boundaryElement:h,draggingDisabled:S,rootElementSelector:E,previewContainer:B}=i;this.disabled=S??!1,this.dragStartDelay=r||0,this.lockAxis=o||null,l&&(this.constrainPosition=l),d&&(this.previewClass=d),h&&(this.boundaryElement=h),E&&(this.rootElementSelector=E),B&&(this.previewContainer=B);}_setupHandlesListener(){this._handles.pipe(xe(i=>{let o=i.map(r=>r.element);this._selfHandle&&this.rootElementSelector&&o.push(this.element),this._dragRef.withHandles(o);}),we(i=>Si(...i.map(o=>o._stateChanges.pipe(Mi(o))))),ht(this._destroyed)).subscribe(i=>{let o=this._dragRef,r=i.element.nativeElement;i.disabled?o.disableHandle(r):o.enableHandle(r);});}};u(e,"\u0275fac",function(o){return new(o||e)();}),u(e,"\u0275dir",Oi({type:e,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(o,r){o&2&&Li("cdk-drag-disabled",r.disabled)("cdk-drag-dragging",r._dragRef.isDragging());},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boun
68daryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",Se],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Eo]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[yt([{provide:zr,useExisting:e}]),ri]}));let n=e;return n;})(),Br=new rt("CdkDropListGroup");var Jr=(()=>{let e=class e{element=_(bi);_changeDetectorRef=_(St);_scrollDispatcher=_(Ir);_dir=_(Un,{optional:!0});_group=_(Br,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new b();_scrollableParentsResolved=!1;_dropListRef;connectedTo=[];data;orientation="vertical";id=_(Qo).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled;}set disabled(i){this._dropListRef.disabled=this._disabled=i;}_disabled=!1;sortingDisabled=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled=!1;autoScrollStep;elementContainerSelector=null;hasAnchor=!1;dropped=new pe();entered=new pe();exited=new pe();sorted=new pe();_unsortedItems=new Set();constructor(){let i=_(Zr,{optional:!0}),o=_(oi);this._dropListRef=Wr(o,this.element),this._dropListRef.data=this,i&&this._assignDefaults(i),this._dropListRef.enterPredicate=(r,l)=>this.enterPredicate(r.data,l.data),this._dropListRef.sortPredicate=(r,l,d)=>this.sortPredicate(r,l.data,d.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),e._dropLists.push(this),this._group&&this._group._items.add(this);}addItem(i){this._unsortedItems.add(i),i._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(o=>o._dragRef));}removeItem(i){if(this._unsortedItems.delete(i),this._latestSortedRefs){let o=this._latestSortedRefs.indexOf(i._dragRef);o>-1&&(this._latestSortedRefs.splice(o,1),this._syncItemsWithRef(this._latestSortedRefs));}}getSortedItems(){return Array.from(this._unsortedItems).sort((i,o)=>i._dragRef.getVisibleElement().compareDocumentPosition(o._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);}ngOnDestroy(){let i=e._dropLists.indexOf(this);i>-1&&e._dropLists.splice(i,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(i){this._dir&&this._dir.change.pipe(Mi(this._dir.value),ht(this._destroyed)).subscribe(o=>i.withDirection(o)),i.beforeStarted.subscribe(()=>{let o=jo(this.connectedTo).map(r=>{if(typeof r=="string"){let l=e._dropLists.find(d=>d.id===r);return l;}return r;});if(this._group&&this._group._items.forEach(r=>{o.indexOf(r)===-1&&o.push(r);}),!this._scrollableParentsResolved){let r=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(l=>l.getElementRef().nativeElement);this._dropListRef.withScrollableParents(r),this._scrollableParentsResolved=!0;}if(this.elementContainerSelector){let r=this.element.nativeElement.querySelector(this.elementContainerSelector);i.withElementContainer(r);}i.disabled=this.disabled,i.lockAxis=this.lockAxis,i.sortingDisabled=this.sortingDisabled,i.autoScrollDisabled=this.autoScrollDisabled,i.autoScrollStep=Fi(this.autoScrollStep,2),i.hasAnchor=this.hasAnchor,i.connectedTo(o.filter(r=>r&&r!==this).map(r=>r._dropListRef)).withOrientation(this.orientation);});}_handleEvents(i){i.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(o=>o._dragRef)),this._changeDetectorRef.markForCheck();}),i.entered.subscribe(o=>{this.entered.emit({container:this,item:o.item.data,currentIndex:o.currentIndex});}),i.exited.subscribe(o=>{this.exited.emit({container:this,item:o.item.data}),this._changeDetectorRef.markForCheck();}),i.sorted.subscribe(o=>{this.sorted.emit({previousIndex:o.previousIndex,currentIndex:o.currentIndex,container:this,item:o.item.data});}),i.dropped.subscribe(o=>{this.dropped.emit({previousIndex:o.previousIndex,currentIndex:o.currentIndex,previousContainer:o.previousContainer.data,container:o.container.data,item:o.item.data,isPointerOverContainer:o.isPointerOverContainer,distance:o.distance,dropPoint:o.dropPoint,event:o.event}),this._changeDetectorRef.markForCheck();}),Si(i.receivingStarted,i.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck());}_assignDefaults(i){let{lockAxis:o,draggingDisabled:r,sortingDisabled:l,listAutoScrollDisabled:d,listOrientation:h}=i;this.disabled=r??!1,this.sortingDisabled=l??!1,this.autoScrollDisabled=d??!1,this.orientation=h||"vertical",this.lockAxis=o||null;}_syncItemsWithRef(i){this._latestSortedRefs=i,this._dropListRef.withItems(i);}};u(e,"_dropLists",[]),u(e,"\u0275fac",function(o){return new(o||e)();}),u(e,"\u0275dir",Oi({type:e,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(o,r){o&2&&(ho("id",r.id),Li("cdk-drop-list-disabled",r.disabled)("cdk-drop-list-dragging",r._dropListRef.isDragging())("cdk-drop-list-receiving",r._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",Se],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",Se],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",Se],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",Se]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[yt([{provide:Br,useValue:void 0},{provide:qr,useExisting:e}])]}));let n=e;return n;})();var ea=(()=>{let e=class e{};u(e,"\u0275fac",function(o){return new(o||e)();}),u(e,"\u0275mod",Ti({type:e})),u(e,"\u0275inj",Pi({providers:[Xs],imports:[br]}));let n=e;return n;})();var js=["videoShareModal"];function Qs(n,e){if(n&1&&f(0,"my-video-playlist-miniature",7),n&2){let t=p();m("playlist",t.playlist);}}function Zs(n,e){if(n&1&&f(0,"my-action-dropdown",10),n&2){let t=p();m("entry",t.playlist)("actions",t.playlistActions);}}function qs(n,e){n&1&&(c(0,"div",12)(1,"div"),g(2,2),a(),c(3,"div"),g(4,3),a(),c(5,"div"),Ai(6,4),f(7,"a",16),Ni(),a()());}function Ks(n,e){if(n&1){let t=k();c(0,"div",14)(1,"my-video-playlist-element-miniature",17),P("elementRemoved",function(o){T(t);let r=p();return O(r.onElementRemoved(o));}),a()();}if(n&2){let t=e.$implicit,i=p();m("cdkDragStartDelay",i.getDragStartDelay()),s(),m("playlistElement",t)("playlist",i.playlist)("owned",!0)("position",t.position);}}var Zt=class Zt{hooks=_(Go);notifier=_(A);router=_(ke);confirmService=_(We);route=_(Fe);screenService=_(Yi);videoPlaylistService=_(Pe);videoShareModal=Z("videoShareModal");errored=!1;playlistElements=[];playlist;playlistActions=[];pagination={currentPage:1,itemsPerPage:10,totalItems:null};
68onDataSubject=new b();videoPlaylistId;paramsSub;ngOnInit(){this.playlistActions=[[{label:"Update playlist",iconName:"edit",linkBuilder:e=>["/my-library","video-playlists","update",e.shortUUID]},{label:"Delete playlist",iconName:"delete",handler:e=>this.deleteVideoPlaylist(e)}]],this.paramsSub=this.route.params.subscribe(e=>{this.videoPlaylistId=e.videoPlaylistId,this.loadElements(),this.loadPlaylistInfo();});}ngOnDestroy(){this.paramsSub&&this.paramsSub.unsubscribe();}drop(e){let t=e.previousIndex,i=e.currentIndex;if(t===i)return;let o=this.playlistElements[t].position,r=this.playlistElements[i].position;o>r&&r--;let l=this.playlistElements[t];this.playlistElements.splice(t,1),this.playlistElements.splice(i,0,l),this.videoPlaylistService.reorderVideosOfPlaylist(this.playlist.id,o,r).subscribe({next:()=>{this.reorderClientPositions();},error:d=>this.notifier.handleError(d)});}onElementRemoved(e){let t=this.findFirst();this.playlistElements=this.playlistElements.filter(i=>i.id!==e.id),xi(this.pagination),this.reorderClientPositions(t);}onNearOfBottom(){this.pagination.totalItems<=this.pagination.currentPage*this.pagination.itemsPerPage||(this.pagination.currentPage+=1,this.loadElements());}trackByFn(e,t){return t.id;}isRegularPlaylist(e){return e?.type.id===Di.REGULAR;}showShareModal(){this.videoShareModal().show();}deleteVideoPlaylist(e){return De(this,null,function*(){(yield this.confirmService.confirm("Do you really want to delete "+e.displayName+"?","Delete"))!==!1&&this.videoPlaylistService.removeVideoPlaylist(e).subscribe({next:()=>{this.router.navigate(["/my-library","video-playlists"]),this.notifier.success("Playlist "+e.displayName+" deleted.");},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:e,data:t})=>{this.playlistElements=this.playlistElements.concat(t),this.pagination.totalItems=e,this.onDataSubject.next(t);},error:e=>{this.errored||(this.notifier.handleError(e),this.errored=!0);}});}loadPlaylistInfo(){this.videoPlaylistService.getVideoPlaylist(this.videoPlaylistId).subscribe({next:e=>{this.playlist=e;},error:e=>{this.errored||(this.notifier.handleError(e),this.errored=!0);}});}reorderClientPositions(e){if(this.playlistElements.length===0)return;let t=e||this.findFirst(),i=1;for(let r of this.playlistElements)r.position=i,i++;let o=this.findFirst();t&&o&&t.id!==o.id&&this.loadPlaylistInfo();}findFirst(){return this.playlistElements.find(e=>e.position===1);}};u(Zt,"\u0275fac",function(t){return new(t||Zt)();}),u(Zt,"\u0275cmp",M({type:Zt,selectors:[["ng-component"]],viewQuery:function(t,i){t&1&&ee(i.videoShareModal,js,5),t&2&&W();},decls:14,vars:5,consts:()=>{let e;e="Share";let t;t="No videos in this playlist.";let i;i="Browse videos on PeerTube to add them in your playlist.";let o;return o="See the "+"\uFFFD#7\uFFFD"+"documentation"+"\uFFFD/#7\uFFFD"+" for more information.",[["videoShareModal",""],e,t,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(t,i){t&1&&(c(0,"div",5)(1,"div",6),C(2,Qs,1,1,"my-video-playlist-miniature",7),c(3,"div",8)(4,"my-button",9),P("click",function(){return i.showShareModal();}),g(5,1),a(),C(6,Zs,1,2,"my-action-dropdown",10),a()(),c(7,"div",11),C(8,qs,8,0,"div",12),c(9,"div",13),P("nearOfBottom",function(){return i.onNearOfBottom();})("cdkDropListDropped",function(r){return i.drop(r);}),q(10,Ks,2,5,"div",14,i.trackByFn,!0),a()()(),f(12,"my-video-share",15,0)),t&2&&(s(2),y(i.playlist?2:-1),s(4),y(i.isRegularPlaylist(i.playlist)?6:-1),s(2),y(i.pagination.totalItems===0?8:-1),s(),m("dataObservable",i.onDataSubject.asObservable()),s(),K(i.playlistElements),s(2),m("playlist",i.playlist));},dependencies:[It,Ji,qe,je,Jr,Kr,Er,vr],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}
68.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}.video[_ngcontent-%COMP%]:last-child{border:0}.videos.cdk-drop-list-dragging[_ngcontent-%COMP%]   .video[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.playlist-elements[_ngcontent-%COMP%]{grid-column:2}my-video-playlist-miniature[_ngcontent-%COMP%]{width:280px}@media screen and (max-width:800px){my-video-playlist-miniature[_ngcontent-%COMP%]{width:201px}}@media screen and (max-width:500px){.root[_ngcontent-%COMP%]{display:block}.playlist-info[_ngcontent-%COMP%]{width:calc(100% + 2 * var(--x-margin-content));padding-top:20px;margin-bottom:10px}my-video-playlist-miniature[_ngcontent-%COMP%], .playlist-buttons[_ngcontent-%COMP%]{margin-inline-start:auto;margin-inline-end:auto}  my-video-playlist-element-miniature .video{padding:5px!important}  my-video-playlist-element-miniature .position{margin-inline-end:.3125rem!important}}"]}));var Mn=Zt;var Js=n=>({"input-error":n}),el=n=>["/my-library/video-playlists/update",n];function tl(n,e){if(n&1&&(c(0,"my-alert",14),v(1),a()),n&2){let t=p();s(),I(t.error);}}function il(n,e){n&1&&(c(0,"li",21),g(1,6),a());}function nl(n,e){if(n&1&&(c(0,"a",41),v(1),a()),n&2){let t=p(2);m("routerLink",D(2,el,t.videoPlaylistToUpdate==null?null:t.videoPlaylistToUpdate.shortUUID)),s(),L(" ",t.videoPlaylistToUpdate==null?null:t.videoPlaylistToUpdate.displayName," ");}}function ol(n,e){if(n&1&&(c(0,"li",21),g(1,7),a(),c(2,"li",40),C(3,nl,2,4,"a",41),a()),n&2){let t=p();s(3),y(t.videoPlaylistToUpdate?3:-1);}}function rl(n,e){n&1&&(c(0,"h2",22),g(1,8),a());}function al(n,e){n&1&&(c(0,"h2",22),g(1,9),a());}function sl(n,e){if(n&1&&(c(0,"div",30),v(1),a()),n&2){let t=p();s(),L(" ",t.formErrors.displayName," ");}}function ll(n,e){if(n&1&&(c(0,"div",30),v(1),a()),n&2){let t=p();s(),I(t.formErrors.privacy);}}function cl(n,e){if(n&1&&(c(0,"div",37)(1,"div"),g(2,10),a(),c(3,"div"),g(4,11),a()()),n&2){let t=p();s(2),Y(t.getOwnerAccountDisplayName()),V(2);}}function dl(n,e){if(n&1&&(c(0,"div",30),v(1),a()),n&2){let t=p();s(),I(t.formErrors.videoChannelId);}}function _l(n,e){n&1&&(c(0,"div",25)(1,"my-peertube-checkbox",42),$(2,43),c(3,"span"),g(4,12),a(),f(5,"br"),c(6,"span"),g(7,13),a(),F(),a()());}var pt=class pt extends jt{formReactiveService=_(Ue);authService=_(w);notifier=_(A);router=_(ke);route=_(Fe);videoPlaylistService=_(Pe);serverService=_(le);error;paramsSub;ngOnInit(){this.buildForm({displayName:ji,privacy:Qi,description:Zi,videoChannelId:qi,thumbnailfile:null}),this.form.get("privacy").valueChanges.subscribe(e=>{Ki(this.form.get("videoChannelId"),e);}),this.paramsSub=this.route.params.pipe(ut(e=>e.videoPlaylistId),we(e=>yi([this.videoPlaylistService.getVideoPlaylist(e),this.serverService.getVideoPlaylistPrivacies(),Xe(this.authService,{includeCollaborations:!0})]))).subscribe({next:([e,t,i])=>{this.videoPlaylistToUpdate=e,this.videoPlaylistPrivacies=t,this.userVideoChannels=i.filter(o=>o.ownerAccountId===this.videoPlaylistToUpdate.ownerAccount.id),this.hydrateFormFromPlaylist();},error:e=>{this.error=e.message;}});}ngOnDestroy(){this.paramsSub&&this.paramsSub.unsubscribe();}formValidated(){this.error=void 0;let e=this.form.value,t={displayName:e.displayName,privacy:e.privacy,description:e.description||null,videoChannelId:e.videoChannelId||null,thumbnailfile:e.thumbnailfile||void 0};this.videoPlaylistService.updateVideoPlaylist(this.videoPlaylistToUpdate,t).subscribe({next:()=>{this.notifier.success("Playlist "+t.displayName+" updated."),this.router.navigate(["/my-library","video-playlists"]);},error:i=>{this.error=i.message;}});}isCreation(){return!1;}getFormButtonTitle(){return"Update";}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.i
68d:null}),fetch(this.videoPlaylistToUpdate.getThumbnailUrl(223)).then(e=>e.blob()).then(e=>{this.form.patchValue({thumbnailfile:e});});}};u(pt,"\u0275fac",(()=>{let e;return function(i){return(e||(e=Ve(pt)))(i||pt);};})()),u(pt,"\u0275cmp",M({type:pt,selectors:[["ng-component"]],features:[Re],decls:41,vars:18,consts:()=>{let e;e="Edit";let t;t="My Playlists";let i;i="Playlist thumbnail";let o;o="Display name";let r;r="Description";let l;l="Privacy";let d;d="Channel";let h;h="Create";let S;S="Edit";let E;E="NEW PLAYLIST";let B;B="UPDATE PLAYLIST";let ne;ne=" Only "+"\uFFFD0\uFFFD"+"'s channels are listed ";let Oe;Oe=" Changing the owner of a playlist is not supported ";let it;it="Insert at the first position in your channel's playlist list";let nt;nt="Playlists can be manually sorted in your channel.";let X;return X="By default, new playlists are added at the end of the list.",[t,i,o,r,l,d,h,S,E,B,ne,Oe,nt,X,["type","danger"],[1,"pt-two-cols"],[1,"title-col"],["aria-label","breadcrumb"],[1,"pt-breadcrumb"],[1,"breadcrumb-item"],["routerLink","/my-library/video-playlists"],[1,"breadcrumb-item","active"],[1,"visually-hidden"],[1,"content-col"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","thumbnailfile"],["inputLabel",e,"inputName","thumbnailfile","formControlName","thumbnailfile"],["for","displayName"],["type","text","id","displayName","formControlName","displayName",1,"form-control",3,"ngClass"],["role","alert",1,"form-error"],["for","description"],["helpType","markdownText"],["inputId","description","formControlName","description",3,"formError"],["for","privacy"],["inputId","privacy","formControlName","privacy",3,"items"],["for","videoChannelId"],[1,"form-group-description"],["inputId","videoChannelId","formControlName","videoChannelId",3,"items"],["type","submit",1,"peertube-button","primary-button",3,"value","disabled"],["aria-current","page",1,"breadcrumb-item","active"],[3,"routerLink"],["inputName","insertAtFirstPosition","formControlName","insertAtFirstPosition","labelText",it],["ngProjectAs","description",5,["description"]]];},template:function(t,i){t&1&&(C(0,tl,2,1,"my-alert",14),c(1,"div",15)(2,"div",16)(3,"nav",17)(4,"ol",18)(5,"li",19)(6,"a",20),g(7,0),a()(),C(8,il,2,0,"li",21)(9,ol,4,1),a()(),C(10,rl,2,0,"h2",22)(11,al,2,0,"h2",22),a(),c(12,"div",23)(13,"form",24),P("ngSubmit",function(){return i.formValidated();}),c(14,"div",25)(15,"label",26),g(16,1),a(),f(17,"my-image-input",27),a(),c(18,"div",25)(19,"label",28),g(20,2),a(),f(21,"input",29),C(22,sl,2,1,"div",30),a(),c(23,"div",25)(24,"label",31),g(25,3),a(),f(26,"my-help",32)(27,"my-markdown-textarea",33),a(),c(28,"div",25)(29,"label",34),g(30,4),a(),f(31,"my-select-options",35),C(32,ll,2,1,"div",30),a(),c(33,"div",25)(34,"label",36),g(35,5),a(),C(36,cl,5,1,"div",37),f(37,"my-select-channel",38),C(38,dl,2,1,"div",30),a(),C(39,_l,8,0,"div",25),f(40,"input",39),a()()()),t&2&&(y(i.error?0:-1),s(8),y(i.isCreation()?8:9),s(2),y(i.isCreation()?10:11),s(3),m("formGroup",i.form),s(8),m("ngClass",D(16,Js,i.formErrors.displayName)),s(),y(i.formErrors.displayName?22:-1),s(5),m("formError",i.formErrors.description),s(4),m("items",i.videoPlaylistPrivacies),s(),y(i.formErrors.privacy?32:-1),s(4),y(i.isEditor()?36:-1),s(),m("items",i.userVideoChannels),s(),y(i.formErrors.videoChannelId?38:-1),s(),y(i.isCreation()&&i.form.value.videoChannelId?39:-1),s(),m("value",$e(i.getFormButtonTitle()))("disabled",!i.form.valid));},dependencies:[se,te,ie,U,Mt,Et,j,ze,Ge,He,Be,Xi,Hi,Wi,Bi,Ke,Tt,Ze],styles:["input[type=text][_ngcontent-%COMP%]{font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:340px;max-width:340px;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}input[type=text][_ngcontent-%COMP%]::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}input[type=text][readonly][_ngcontent-%COMP%]{color:var(--fg-300)}input[type=text][_ngcontent-%COMP%]:focus, input[type=text][_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}input[type=text][disabled][_ngcontent-%COMP%]{color:var(--fg-300);opacity:.8}@media screen and (max-width:380px){input[type=text][_ngcontent-%COMP%]{width:100%}}.peertube-select-container[_ngcontent-%COMP%]{width:340px}@media screen and (max-width:370px){.peertube-select-container[_ngcontent-%COMP%]{width:100%}}my-select-channel[_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}"]}));var Pn=pt;var ia=la(ca());var pl=n=>({active:n}),ml=n=>({"is-rtl":n}),ul=n=>({"has-collaborator-state":n});function hl(n,e){n&1&&f(0,"my-collaborator-state",4);}function gl(n,e){n&1&&f(0,"my-collaborator-state",5);}function fl(n,e){if(n&1&&C(0,hl,1,0,"my-collaborator-state",4)(1,gl,1,0,"my-collaborator-state",5),n&2){let t=p();y(t.user.isEditorOfChannel(t.channel())?0:1);}}var mt=class mt{authService=_(w);localeId=_(yo);checked=li(!1);channel=H.required();inputName=H(void 0);label=H("Toggle this channel");get user(){return this.authService.getUser();}isRTL(){return Mo(this.localeId)==="rtl";}propagateChange=e=>{};writeValue(e){this.checked.set(e);}
68registerOnChange(e){this.propagateChange=e;}registerOnTouched(){}toggle(){this.checked.set(!this.checked()),this.propagateChange(this.checked());}};u(mt,"\u0275fac",function(t){return new(t||mt)();}),u(mt,"\u0275cmp",M({type:mt,selectors:[["my-channel-toggle"]],inputs:{checked:[1,"checked"],channel:[1,"channel"],inputName:[1,"inputName"],label:[1,"label"]},outputs:{checked:"checkedChange"},features:[yt([{provide:Oo,useExisting:Dn(()=>mt),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(t,i){t&1&&(c(0,"button",0),P("click",function(){return i.toggle();}),f(1,"my-actor-avatar",1),c(2,"div",2)(3,"div",3),v(4),a(),C(5,fl,2,1),a()()),t&2&&(si(D(9,pl,i.checked())),m("title",i.label()),s(),si(D(11,ml,i.isRTL())),m("actor",i.channel()),s(),m("ngClass",D(13,ul,i.user.isCollaboratingToChannels())),s(2),I(i.channel().displayName),s(),y(i.user.isCollaboratingToChannels()?5:-1));},dependencies:[se,te,Qe,bt],styles:[".root[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;text-align:start;line-height:1.2;padding-inline-start:17px}.root[_ngcontent-%COMP%]:hover{opacity:.9}.info[_ngcontent-%COMP%]{border-radius:4px;background-color:var(--bg-secondary-400);max-width:150px;padding-top:.75rem;padding-bottom:.75rem;padding-inline-start:25px;padding-inline-end:1rem}.info[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{color:var(--fg-400);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.875rem}.info.has-collaborator-state[_ngcontent-%COMP%]{padding-top:.5rem;padding-bottom:.5rem}my-actor-avatar[_ngcontent-%COMP%]{position:absolute;border:2px solid var(--bg-secondary-400);border-radius:5px}my-actor-avatar.is-rtl[_ngcontent-%COMP%]{right:0}my-actor-avatar[_ngcontent-%COMP%]:not(.is-rtl){left:0}.root.active[_ngcontent-%COMP%]   .info[_ngcontent-%COMP%]{background-color:var(--bg-secondary-450)}.root.active[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{font-weight:700}.root.active[_ngcontent-%COMP%]   my-actor-avatar[_ngcontent-%COMP%]{border-color:var(--bg-secondary-450);background-color:var(--bg-secondary-450)}"]}));var qt=mt;var Cl=["table"],yl=n=>["/my-library/video-playlists",n],Sl=n=>["/c",n],vl=n=>["update",n],El=(n,e)=>e.id;function Ml(n,e){if(n&1){let t=k();c(0,"my-channel-toggle",18),he("ngModelChange",function(o){let r=T(t).$implicit;return ue(r.selected,o)||(r.selected=o),O(o);}),P("ngModelChange",function(){let o=T(t).$implicit,r=p();return O(r.onChannelFilter(o));}),a();}if(n&2){let t=e.$implicit;m("channel",t),me("ngModel",t.selected);}}function Pl(n,e){if(n&1&&($(0),g(1,9),G(2,"myNumberFormatter"),F()),n&2){let t=p().$implicit,i=p();s(2),Y(t)(ae(2,3,t))(i.getFilteredChannel().displayName),V(1);}}function Il(n,e){if(n&1&&($(0),g(1,10),G(2,"myNumberFormatter"),F()),n&2){let t=p().$implicit;s(2),Y(t)(ae(2,2,t)),V(1);}}function bl(n,e){if(n&1&&C(0,Pl,3,5,"ng-container")(1,Il,3,4,"ng-container"),n&2){let t=p();y(t.getFilteredChannel()?0:1);}}function Tl(n,e){n&1&&(c(0,"a",19),f(1,"my-global-icon",20),$(2),g(3,11),F(),a());}function Ol(n,e){if(n&1&&(c(0,"td",21),v(1),a()),n&2){let t=p().$implicit;s(),L(" ",t.videoChannelPosition," ");}}function Rl(n,e){if(n&1&&(c(0,"td"),f(1,"my-video-playlist-miniature",22),a()),n&2){let t=p().$implicit;s(),m("playlist",t);}}function Al(n,e){n&1&&f(0,"my-collaborator-state",26);}function Nl(n,e){n&1&&f(0,"my-collaborator-state",27);}function Ll(n,e){if(n&1&&C(0,Al,1,0,"my-collaborator-state",26)(1,Nl,1,0,"my-collaborator-state",27),n&2){let t=p(3).$implicit,i=p();y(i.user.isOwnerOfChannel(t.videoChannel)?0:i.user.isEditorOfChannel(t.videoChannel)?1:-1);}}function Dl(n,e){if(n&1&&(c(0,"a",25)(1,"span"),v(2),a(),C(3,Ll,2,1),a()),n&2){let t=p(2).$implicit,i=p();m("routerLink",D(3,Sl,t.videoChannel.name)),s(2),I(t.videoChannel.displayName),s(),y(i.user.isCollaboratingToChannels()?3:-1);}}function wl(n,e){if(n&1&&(c(0,"td")(1,"div",23)(2,"a",24),v(3),a(),C(4,Dl,4,5,"a",25),a()()),n&2){let t=p().$implicit;s(2),m("routerLink",D(3,yl,t.shortUUID)),s(),L(" ",t.displayName," "),s(),y(t.videoChannel?4:-1);}}function xl(n,e){if(n&1&&(c(0,"td"),f(1,"my-privacy-badge",28),a()),n&2){let t=p().$implicit;s(),m("playlist",t);}}function Yl(n,e){if(n&1&&(c(0,"td"),v(1),G(2,"ptDate"),a()),n&2){let t=p().$implicit;s(),L(" ",ge(2,1,t.updatedAt,"short")," ");}}function Vl(n,e){if(n&1&&(C(0,Ol,2,1,"td",21),C(1,Rl,2,1,"td"),C(2,wl,5,5,"td"),C(3,xl,2,1,"td"),C(4,Yl,3,4,"td")),n&2){p();let t=re(9);y(t.isColumnDisplayed("videoChannelPosition")?0:-1),s(),y(t.isColumnDisplayed("videos")?1:-1),s(),y(t.isColumnDisplayed("name")?2:-1),s(),y(t.isColumnDisplayed("privacy")?3:-1),s(),y(t.isColumnDisplayed("updatedAt")?4:-1);}}function $l(n,e){if(n&1){let t=k();
68f(0,"my-edit-button",29),c(1,"my-delete-button",30),P("click",function(){T(t);let o=p().$implicit,r=p();return O(r.deleteVideoPlaylist(o));}),a();}if(n&2){let t=p().$implicit;m("ptRouterLink",D(1,vl,t.shortUUID));}}function Fl(n,e){if(n&1&&C(0,$l,2,3),n&2){let t=e.$implicit,i=p();y(i.isRegularPlaylist(t)?0:-1);}}function kl(n,e){if(n&1&&v(0),n&2){let t=e.$implicit;L(" ",t.description," ");}}function zl(n,e){if(n&1&&v(0),n&2){let t=e.search,i=e.hasFilters,o=p();L(" ",o.getNoResults(!!t||i)," ");}}var ta=(0,ia.default)("peertube:my-video-playlists"),Kt=class Kt{notifier=_(A);confirmService=_(We);videoPlaylistService=_(Pe);auth=_(w);headerService=_($i);cdr=_(St);screenService=_(Yi);table=Z("table");user;channels=[];onDataSubject=new b();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:"Videos",selected:!0,sortable:!1},{id:"name",label:"Name",selected:!0,sortable:!0},{id:"privacy",label:"Privacy",selected:!0,sortable:!1},{id:"updatedAt",label:"Updated",selected:!0,sortable:!0}];}ngOnDestroy(){this.headerService.setSearchHidden(!1);}_customParseQueryParams(e){this.user=this.auth.getUser(),this.channels=[...this.user.videoChannels,...this.user.videoChannelCollaborations].map(t=>de(ce({},t),{selected:e.channelName===t.name})),this.cdr.detectChanges();}getNoResults(e){return e?"No playlists found matching your filters.":this.getFilteredChannel()?"No playlists found in selected channels.":"You don't have any playlists published yet.";}_customUpdateUrl(){return{channelName:this.getFilteredChannel()?.name};}deleteVideoPlaylist(e){return De(this,null,function*(){(yield this.confirmService.confirm("Do you really want to delete "+e.displayName+"?","Delete"))!==!1&&this.videoPlaylistService.removeVideoPlaylist(e).subscribe({next:()=>{this.table().loadData(),this.notifier.success("Playlist "+e.displayName+" deleted.");},error:i=>this.notifier.handleError(i)});});}isRegularPlaylist(e){return e.type.id===Di.REGULAR;}onRowReorder(e){let{dragIndex:t,dropIndex:i}=e,o=t-this.paginationStart,r=i-this.paginationStart,l=this.playlistsBeforeDrop[o],d=this.playlistsBeforeDrop[r];if(ta("onRowReorder",{previousIndex:o,newIndex:r,dragPlaylist:l,dropAfterPlaylist:d}),o===r)return;let h=l.videoChannelPosition,S=d.videoChannelPosition;h>S&&S--,ta("Will reorder",{oldPosition:h,insertAfter:S});for(let E=1;E<=this.playlistsAfterDrop.length;E++)this.playlistsAfterDrop[E-1].videoChannelPosition=E+this.paginationStart;this.videoPlaylistService.reorderPlaylistsOfChannel(this.getFilteredChannel().name,h,S).subscribe({next:()=>{this.table().loadData({skipLoader:!this.screenService.isInTouchScreen()}),this.notifier.success("Playlists reordered");},error:E=>this.notifier.handleError(E)});}onChannelFilter(e){for(let t of this.channels)t.id!==e.id&&(t.selected=!1);this.table().onFiltersChange();}hasReorderableRows(){return!!this.getFilteredChannel();}_dataLoader(e){let{pagination:t,sort:i,search:o}=e;this.paginationStart=t.start;let r=this.getFilteredChannel();return(r?this.videoPlaylistService.listChannelPlaylists({videoChannel:{nameWithHost:zo.CREATE_BY_STRING(r.name,r.host)},includeCollaborations:!0,restPagination:t,sort:i,search:o}):this.videoPlaylistService.listAccountPlaylists({account:this.user.account,includeCollaborations:!0,restPagination:t,sort:i,search:o})).pipe(xe(({data:d})=>{this.playlistsAfterDrop=d,this.playlistsBeforeDrop=[...d];}));}_hasExpandedRow(e){return!!e.description;}getFilteredChannel(){return this.channels.find(e=>e.selected);}};u(Kt,"\u0275fac",function(t){return new(t||Kt)();}),u(Kt,"\u0275cmp",M({type:Kt,selectors:[["ng-component"]],viewQuery:function(t,i){t&1&&ee(i.table,Cl,5),t&2&&W();},decls:22,vars:6,consts:()=>{let e;e="playlists per page";let t;t="Drag and drop this row to reorder playlists in your channel";let 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}
68 other {{INTERPOLATION} playlists}}",r=J(r,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let l;l=""+r+" in "+"\uFFFD2\uFFFD"+" channel";let d;d="{VAR_PLURAL, plural, =0 {No playlist} =1 {1 playlist} other {{INTERPOLATION} playlists}}",d=J(d,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let h;return h="Create playlist",[["table",""],["totalTitle",""],["captionRight",""],["tableCells",""],["actionCell",""],["expandedRow",""],["noResults",""],i,o,l,d,h,[1,"form-group"],[1,"label"],[1,"form-group-description"],[1,"channel-filters"],[3,"channel","ngModel"],["key","MyVideoPlaylistsComponent","defaultSort","updatedAt","paginatorText",e,"defaultRowsPerPage","10","columnConfig","false","searchInput","true","dragHandleTitle",t,3,"rowReorder","defaultColumns","dataLoader","customParseQueryParams","customUpdateUrl","hasExpandedRow","reorderableRows"],[3,"ngModelChange","channel","ngModel"],["routerLink","create",1,"peertube-create-button"],["iconName","add","aria-hidden","true"],[2,"width","10px"],["thumbnailOnly","true","toManage","true",3,"playlist"],[1,"name-container"],[1,"name",3,"routerLink"],[1,"channel-sub-link-in-cell",3,"routerLink"],["type","owner","small","true",1,"ms-2"],["type","accepted","small","true",1,"ms-2"],[3,"playlist"],["label","",3,"ptRouterLink"],["label","",3,"click"]];},template:function(t,i){t&1&&(c(0,"div",12)(1,"div",13),g(2,7),a(),c(3,"div",14),g(4,8),a(),c(5,"div",15),q(6,Ml,1,2,"my-channel-toggle",16,El),a()(),c(8,"my-table",17,0),P("rowReorder",function(r){return i.onRowReorder(r);}),Q(10,bl,2,1,"ng-template",null,1,N)(12,Tl,4,0,"ng-template",null,2,N)(14,Vl,5,5,"ng-template",null,3,N)(16,Fl,1,1,"ng-template",null,4,N)(18,kl,1,1,"ng-template",null,5,N)(20,zl,1,1,"ng-template",null,6,N),a()),t&2&&(s(6),K(i.channels),s(2),m("defaultColumns",i.columns)("dataLoader",i.dataLoader)("customParseQueryParams",i.customParseQueryParams)("customUpdateUrl",i.customUpdateUrl)("hasExpandedRow",i.hasExpandedRow)("reorderableRows",i.hasReorderableRows()));},dependencies:[U,j,ve,Me,ie,Ji,Ui,lr,qt,Te,tn,ea,bt,Ie,be],styles:[".channel-filters[_ngcontent-%COMP%]{display:flex;align-items:center;padding-bottom:1rem;border-bottom:1px solid var(--bg-secondary-400);margin-bottom:1rem;gap:1rem;overflow:hidden}.channel-filters[_ngcontent-%COMP%]:hover{overflow:auto}.name[_ngcontent-%COMP%]{color:var(--fg);line-height:1rem;font-weight:700;text-decoration:none}.name-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}my-video-playlist-miniature[_ngcontent-%COMP%]{display:block;width:130px}"]}));var In=Kt;var Jt=class Jt{serverService=_(le);newFeatureInfoService=_(Yt);menuEntries=[];serverConfig;ngOnInit(){this.serverConfig=this.serverService.getHTMLConfig(),this.buildMenu(),this.newFeatureInfoService.showChannelCollaboration();}buildMenu(){this.menuEntries=[{label:"Manage my videos",routerLink:"/my-library/videos"},{label:"Comments",routerLink:"/my-library/comments-on-my-videos",children:[{label:"Comments on my videos",routerLink:"/my-library/comments-on-my-videos"},{label:"Watched words",routerLink:"/my-library/watched-words/list"},{label:"Auto tag policies",routerLink:"/my-library/auto-tag-policies"}]},{label:"More",routerLink:this.isVideoImportEnabled()?"/my-library/video-imports":"/my-library/ownership",children:[{label:"Imports",routerLink:"/my-library/video-imports",isDisplayed:()=>this.isVideoImportEnabled()},{label:"Ownership changes",routerLink:"/my-library/ownership"}]}];}isVideoImportEnabled(){let e=this.serverConfig.import.videos;return e.http.enabled||e.torrent.enabled;}};u(Jt,"\u0275fac",function(t){return new(t||Jt)();}),u(Jt,"\u0275cmp",M({type:Jt,selectors:[["ng-component"]],decls:8,vars:1,consts:()=>{let e;e="My videos";let t;return t="Skip the sub menu",[["myVideoSpaceContent",""],t,[1,"root"],[1,"margin-content"],["href","#my-video-space-content",1,"visually-hidden-focusable","skip-to-content-sub-menu",3,"click"],["h1Icon","videos","h1",e,3,"menuEntries"],["tabindex","-1","id","my-video-space-content",1,"margin-content","pb-5","outline-0"]];},template:function(t,i){if(t&1){let o=k();c(0,"div",2)(1,"div",3)(2,"a",4),P("click",function(l){T(o);let d=re(6);return l.preventDefault(),O(d.focus());}),g(3,1),a(),f(4,"my-horizontal-menu",5),a(),c(5,"div",6,0),f(7,"router-outlet"),a()();}t&2&&(s(4),m("menuEntries",i.menuEntries));},dependencies:[vt,Ot],encapsulation:2}));var bn=Jt;function Bl(n,e){if(n&1&&(c(0,"span",0),v(1),a()),n&2){let t=p();m("ngClass",t.badgeClass),s(),I(t.label);}}var ei=class ei{video=H.required();label;badgeClass;ngOnChanges(){this.buildBadgeAndLabel();}buildBadgeAndLabel(){let e=this.video();if(!e.state){this.label="";return;}let t=e.state.id;switch(this.badgeClass=pr(e.state.id),t){case Bn.PUBLISHED:if(e.privacy.id===Le.PRIVATE){this.label="In your library",this.badgeClass="badge-grey";return;}if(e.privacy.id===Le.INTERNAL){this.label="Internal",this.badgeClass="badge-blue";return;}this.label=Wn(e.state.id);return;case Bn.TO_TRANSCODE:this.label=this.video().waitTranscoding===!0?"Waiting transcoding":"To transcode";return;default:this.label=Wn(e.state.id);}}};u(ei,"\u0275fac",function(t){return new(t||ei)();}),u(ei,"\u0275cmp",M({type:ei,selectors:[["my-video-state-badge"]],inputs:{video:[1,"video"]},features:[ri],decls:1,vars:1,consts:[[1,"pt-badge",3,"ngClass"]],template:function(t,i){t&1&&C(0,Bl,2,2,"span",0),t&2&&y(i.label?0:-1);},dependencies:[se,te],encapsulation:2}));
68var Tn=ei;var Hl=["table"],Gl=n=>({tagsOneOf:n}),Ul=n=>({privacyOneOf:n}),Xl=n=>["/videos/manage",n,"stats"],Wl=()=>[],jl=n=>["/w/p/",n],Ql=n=>["/videos","manage",n],Zl=(n,e)=>e.id;function ql(n,e){if(n&1){let t=k();c(0,"my-channel-toggle",15),he("ngModelChange",function(o){let r=T(t).$implicit;return ue(r.selected,o)||(r.selected=o),O(o);}),P("ngModelChange",function(){T(t),p();let o=re(6);return O(o.onFiltersChange());}),a();}if(n&2){let t=e.$implicit;m("channel",t),me("ngModel",t.selected);}}function Kl(n,e){if(n&1&&($(0),g(1,6),G(2,"myNumberFormatter"),F()),n&2){let t=e.$implicit;s(2),Y(t)(ae(2,2,t)),V(1);}}function Jl(n,e){if(n&1&&(c(0,"td"),f(1,"my-video-cell",16),a()),n&2){let t=p().$implicit;s(),m("video",t);}}function ec(n,e){if(n&1&&(c(0,"td"),f(1,"my-video-cell",17),a()),n&2){let t=p().$implicit;s(),m("video",t);}}function tc(n,e){if(n&1&&(c(0,"a",19),v(1),a()),n&2){let t=e.$implicit;m("queryParams",D(2,Gl,t)),s(),L(" ",t," ");}}function ic(n,e){if(n&1&&(c(0,"td")(1,"div",18),q(2,tc,2,4,"a",19,Ae),a()()),n&2){let t=p().$implicit;s(2),K(t.tags);}}function nc(n,e){if(n&1&&(c(0,"span",23),g(1,7),a()),n&2){let t=p(2).$implicit;m("ngbTooltip",t.blacklistedReason);}}function oc(n,e){if(n&1&&(c(0,"td")(1,"div",20)(2,"a",21),f(3,"my-privacy-badge",22),a(),C(4,nc,2,1,"span",23),a()()),n&2){let t=p().$implicit,i=p();s(2),m("queryParams",D(4,Ul,t.privacy.id))("title",i.getPrivacyFilterTitle(t.privacy.label)),s(),m("video",t),s(),y(t.blacklisted?4:-1);}}function rc(n,e){if(n&1&&(c(0,"td"),f(1,"my-video-nsfw-badge",24),a()),n&2){let t=p().$implicit;s(),m("video",t);}}function ac(n,e){if(n&1&&(f(0,"br"),$(1),g(2,9),G(3,"myNumberFormatter"),F()),n&2){let t=p(2).$implicit;s(3),Y(t.viewers)(ae(3,2,t.views)),V(2);}}function sc(n,e){if(n&1&&(c(0,"td")(1,"a",25),$(2),g(3,8),G(4,"myNumberFormatter"),F(),C(5,ac,4,4),a()()),n&2){let t=p().$implicit;s(),m("routerLink",D(6,Xl,t.shortUUID)),s(3),Y(t.views)(ae(4,4,t.views)),V(3),s(),y(t.isLive?5:-1);}}function lc(n,e){if(n&1&&(c(0,"td")(1,"span"),g(2,10),G(3,"myNumberFormatter"),a()()),n&2){let t=p().$implicit;s(3),Y(t.comments)(ae(3,2,t.comments)),V(2);}}function cc(n,e){if(n&1&&(c(0,"td"),v(1),G(2,"ptDate"),a()),n&2){let t=p().$implicit;s(),L(" ",ge(2,1,t.publishedAt,"short")," ");}}function dc(n,e){if(n&1&&(c(0,"td"),f(1,"my-video-state-badge",24),a()),n&2){let t=p().$implicit;s(),m("video",t);}}function _c(n,e){if(n&1&&v(0),n&2){let t=p(2).$implicit;L(" ",t.language.label," ");}}function pc(n,e){if(n&1&&(c(0,"td"),C(1,_c,1,1),a()),n&2){let t=p().$implicit;s(),y(t.language!=null&&t.language.id?1:-1);}}function mc(n,e){if(n&1&&(c(0,"a",28),v(1),a()),n&2){let t=e.$implicit,i=p(3);si(i.getPlaylistBadge(t.playlistDisplayName)),m("routerLink",D(4,jl,t.playlistShortUUID)),s(),L(" ",t.playlistDisplayName," ");}}function uc(n,e){if(n&1&&(c(0,"td")(1,"div",26),q(2,mc,2,6,"a",27,Ae),a()()),n&2){let t=p().$implicit,i=p();s(2),K(i.videosContainedInPlaylists[t.id]||Co(0,Wl));}}function hc(n,e){if(n&1&&(C(0,Jl,2,1,"td"),C(1,ec,2,1,"td"),C(2,ic,4,0,"td"),C(3,oc,5,6,"td"),C(4,rc,2,1,"td"),C(5,sc,6,8,"td"),C(6,lc,4,4,"td"),C(7,cc,3,4,"td"),C(8,dc,2,1,"td"),C(9,pc,2,1,"td"),C(10,uc,4,1,"td")),n&2){p();let t=re(6);y(t.isColumnDisplayed("duration")?0:-1),s(),y(t.isColumnDisplayed("name")?1:-1),s(),y(t.isColumnDisplayed("tags")?2:-1),s(),y(t.isColumnDisplayed("privacy")?3:-1),s(),y(t.isColumnDisplayed("sensitive")?4:-1),s(),y(t.isColumnDisplayed("insights")?5:-1),s(),y(t.isColumnDisplayed("comments")?6:-1),s(),y(t.isColumnDisplayed("published")?7:-1),s(),y(t.isColumnDisplayed("state")?8:-1),s(),y(t.isColumnDisplayed("language")?9:-1),s(),y(t.isColumnDisplayed("playlists")?10:-1);}}function gc(n,e){if(n&1){let t=k();f(0,"my-button",29),c(1,"my-video-actions-dropdown",30),P("videoRemoved",function(){T(t),p();let o=re(6);
68return O(o.loadData());})("videoFilesRemoved",function(){T(t),p();let o=re(6);return O(o.loadData());})("transcodingCreated",function(){T(t),p();let o=re(6);return O(o.loadData());})("videoExistsInPlaylistChange",function(){let o=T(t).$implicit,r=p();return O(r.fetchVideosContainedInPlaylists([o]));}),a();}if(n&2){let t=e.$implicit,i=p();m("ptRouterLink",D(3,Ql,t.shortUUID)),s(),m("video",t)("displayOptions",i.videoActionsOptions);}}function fc(n,e){if(n&1&&v(0),n&2){let t=e.search,i=e.hasFilters,o=p();L(" ",o.getNoResults(!!t||i)," ");}}var ti=class ti{confirmService=_(We);auth=_(w);notifier=_(A);videoService=_(Zo);playlistService=_(Pe);server=_(le);headerService=_($i);badgeService=_(cr);route=_(Fe);table=Z("table");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};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:"Duration",selected:!0,sortable:!0},{id:"name",label:"Name",selected:!0,sortable:!0},{id:"tags",label:"Tags",selected:!0,sortable:!1},{id:"privacy",label:"Privacy",selected:!0,sortable:!1},{id:"sensitive",label:"Sensitive",selected:!0,sortable:!1},{id:"insights",label:"Insights",selected:!0,sortable:!0,sortKey:"views"},{id:"comments",label:"Comments",selected:!0,sortable:!0},{id:"published",label:"Published",selected:!0,sortable:!0,sortKey:"publishedAt"},{id:"state",label:"State",selected:!0,sortable:!1},{id:"language",label:"Language",selected:!1,sortable:!1},{id:"playlists",label:"Playlists",selected:!0,sortable:!1}],this.inputFilters=[{type:"options",key:"isLive",title:"Video type",options:[{value:"all",label:"All"},{value:!0,label:"Lives"},{value:!1,label:"VOD"}]},{type:"options",key:"privacyOneOf",title:"Privacy",options:[{value:"all",label:"All"},{value:Le.PUBLIC,label:"Public videos"},{value:Le.INTERNAL,label:"Internal videos"},{value:Le.UNLISTED,label:"Unlisted videos"},{value:Le.PASSWORD_PROTECTED,label:"Password protected videos"},{value:Le.PRIVATE,label:"Private videos"}]},{type:"tags",key:"tagsOneOf",title:"One of these tags"}],this._customParseQueryParams(this.route.snapshot.queryParams),this.buildActions();}ngOnDestroy(){this.headerService.setSearchHidden(!1);}_customParseQueryParams(e){let t=e.channelNameOneOf?new Set(No(e.channelNameOneOf)):new Set();this.user=this.auth.getUser(),this.channels=[...this.user.videoChannels,...this.user.videoChannelCollaborations].map(i=>de(ce({},i),{selected:t.has(i.name)}));}getNoResults(e){return e?"No videos found matching your filters.":this.channels.some(t=>t.selected)?"No videos found in selected channels.":"You don't have any videos published yet.";}_customUpdateUrl(){return{channelNameOneOf:this.channels.filter(t=>t.selected).map(t=>t.name)};}_dataLoader(e){let{pagination:t,sort:i,search:o,isLive:r,privacyOneOf:l,tagsOneOf:d}=e,h=this.channels.filter(S=>S.selected).map(S=>S.name);return this.videoService.listMyVideos({restPagination:t,sort:i,search:o,includeCollaborations:!0,channelNameOneOf:h.length!==0?h:void 0,isLive:r,privacyOneOf:l!==void 0?[l]:void 0,tagsOneOf:d}).pipe(xe(({data:S})=>this.fetchVideosContainedInPlaylists(S)));}fetchVideosContainedInPlaylists(e){this.playlistService.doVideosExistInPlaylist(e.map(t=>t.id)).subscribe(t=>{this.videosContainedInPlaylists=Object.keys(t).reduce((i,o)=>de(ce({},i),{[o]:xo(t[+o],r=>r.playlistId)}),this.videosContainedInPlaylists);});}getPlaylistBadge(e){return this.badgeService.getRandomBadge("playlist",e);}removeVideos(e){return De(this,null,function*(){let t=Ee("Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?",{count:e.length});(yield this.confirmService.confirm(t,"Delete"))!==!1&&this.videoService.removeVideo(e.map(o=>o.id)).subscribe({next:()=>{this.notifier.success(Ee("Deleted {count, plural, =1 {1 video} other {{count} videos}}.",{count:e.length}
68)),this.table().loadData();},error:o=>this.notifier.handleError(o)});});}buildActions(){this.bulkActions=[[{label:"Delete",handler:e=>this.removeVideos(e),iconName:"delete"}]];}getPrivacyFilterTitle(e){return"Filter by privacy: "+e+"";}};u(ti,"\u0275fac",function(t){return new(t||ti)();}),u(ti,"\u0275cmp",M({type:ti,selectors:[["my-videos"]],viewQuery:function(t,i){t&1&&ee(i.table,Hl,5),t&2&&W();},decls:15,vars:6,consts:()=>{let e;e="videos per page";let t;t="Per channel:";let i;i="{VAR_PLURAL, plural, =0 {No videos} =1 {1 video} other {{INTERPOLATION} videos}}",i=J(i,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let o;o="Blocked";let r;r="Navigate to the video stats page";let l;l="{VAR_PLURAL, plural, =0 {No views} =1 {1 view} other {{INTERPOLATION} views}}",l=J(l,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let d;d="{VAR_PLURAL, plural, =0 {No viewers} =1 {1 viewer} other {{INTERPOLATION} viewers}}",d=J(d,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let h;h="{VAR_PLURAL, plural, =0 {No comments} =1 {1 comment} other {{INTERPOLATION} comments}}",h=J(h,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let S;return S="Manage",[["table",""],["totalTitle",""],["tableCells",""],["actionCell",""],["noResults",""],t,i,o,l,d,h,[1,"channel-filters"],[1,"channel-label"],[3,"channel","ngModel"],["key","MyVideosComponent","defaultSort","publishedAt","paginatorText",e,"defaultRowsPerPage","5","searchInput","true","canUseMatchSort","true",3,"defaultColumns","bulkActions","dataLoader","customParseQueryParams","customUpdateUrl","inputFilters"],[3,"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",S,"theme","secondary","icon","film","responsiveLabel","true",1,"me-3",3,"ptRouterLink"],["placement","bottom auto","buttonIcon","more-horizontal","buttonStyled","true",3,"videoRemoved","videoFilesRemoved","transcodingCreated","videoExistsInPlaylistChange","video","displayOptions"]];},template:function(t,i){t&1&&(c(0,"div",11)(1,"div",12),g(2,5),a(),q(3,ql,1,2,"my-channel-toggle",13,Zl),a(),c(5,"my-table",14,0),Q(7,Kl,3,4,"ng-template",null,1,N)(9,hc,11,11,"ng-template",null,2,N)(11,gc,2,5,"ng-template",null,3,N)(13,fc,1,1,"ng-template",null,4,N),a()),t&2&&(s(3),K(i.channels),s(2),m("defaultColumns",i.columns)("bulkActions",i.bulkActions)("dataLoader",i.dataLoader)("customParseQueryParams",i.customParseQueryParams)("customUpdateUrl",i.customUpdateUrl)("inputFilters",i.inputFilters));},dependencies:[U,j,ve,It,ko,Fo,er,en,ie,Tn,qt,rr,Te,tn,Ie,be],styles:["my-select-checkbox[_ngcontent-%COMP%]{min-width:250px}.pt-badge[_ngcontent-%COMP%]{margin-inline-end:.3125rem}.badges[_ngcontent-%COMP%]   .pt-badge[_ngcontent-%COMP%]{max-width:200px;vertical-align:bottom;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.video-info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:flex}.video-info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{position:relative;top:-2px;display:inline-block;width:16px;height:16px;line-height:16px;margin-inline-start:.1875rem}td[_ngcontent-%COMP%]{padding-top:.75rem;padding-bottom:.75rem}.channel-label[_ngcontent-%COMP%]{color:var(--fg-200);font-weight:700;white-space:nowrap}.channel-filters[_ngcontent-%COMP%]{display:flex;align-items:center;padding-bottom:1rem;border-bottom:1px solid var(--bg-secondary-400);margin-bottom:1rem;gap:1rem;overflow:hidden}.channel-filters[_ngcontent-%COMP%]:hover{overflow:auto}@media screen and (min-width:800px){.video-cell-name[_ngcontent-%COMP%]{width:300px;display:block}}@media screen and (max-width:800px){my-video-cell[_ngcontent-%COMP%]{max-width:120px;
68display:block}}"]}));var On=ti;var ii=class ii{};u(ii,"\u0275fac",function(t){return new(t||ii)();}),u(ii,"\u0275cmp",M({type:ii,selectors:[["ng-component"]],decls:6,vars:0,consts:()=>{let e;e="Comments that contain any of the watched words are automatically tagged with the name of the list.";let t;return t="These automatic tags can be used to filter comments or "+"\uFFFD#4\uFFFD"+"automatically block"+"\uFFFD/#4\uFFFD"+" them.",[e,t,[1,"d-block"],[1,"d-block","mb-3"],["routerLink","/my-account/auto-tag-policies"],["mode","user"]];},template:function(t,i){t&1&&(c(0,"em",2),g(1,0),a(),c(2,"em",3),Ai(3,1),f(4,"a",4),Ni(),a(),f(5,"my-watched-words-list-admin-owner",5));},dependencies:[sr,ie],encapsulation:2}));var Rn=ii;var ao={path:"",providers:[qo,Jo,Ko,hr,Nt,Dt,ar,dr,or],resolve:{user:mr},canActivateChild:[Ho]},ra=[{path:"videos/comments",redirectTo:"comments-on-my-videos",pathMatch:"full"},{path:"comments-on-my-videos",component:on,data:{meta:{title:"Comments on your videos"}}},{path:"watched-words/list",component:Rn,data:{meta:{title:"Your watched words"}}},{path:"auto-tag-policies",component:rn,data:{meta:{title:"Your automatic tag policies"}}},{path:"videos",component:On,data:{meta:{title:"My videos"}}},{path:"video-imports",component:Cn,data:{meta:{title:"My video imports"}}},{path:"ownership",component:hn,data:{meta:{title:"Ownership changes"}}}],aa=[{path:"",redirectTo:"video-channels",pathMatch:"full"},{path:"video-channels",loadChildren:()=>import("./chunk-WSIDJTMX.js")},{path:"followers",component:ln,data:{meta:{title:"My followers"}}},{path:"video-channel-syncs",component:gn,data:{meta:{title:"My synchronizations"}}},{path:"video-channel-syncs/create",component:fn,data:{meta:{title:"Create new synchronization"}}}],Cc=[{path:"video-playlists",component:In,data:{meta:{title:"My playlists"}}},{path:"video-playlists/create",component:yn,data:{meta:{title:"Create a new playlist"}}},{path:"video-playlists/:videoPlaylistId",component:Mn,data:{meta:{title:"Playlist elements"}}},{path:"video-playlists/update/:videoPlaylistId",component:Pn,data:{meta:{title:"Update playlist"}}},{path:"subscriptions",component:cn,data:{meta:{title:"My subscriptions"}}},{path:"history/videos",component:_n,data:{meta:{title:"My video history"},reuse:{enabled:!0,key:"my-videos-history-list"}}}];function na(n){if(n.length===0)return!1;let e=n[0].path;return ra.some(t=>t.path===e||t.path.startsWith(`${e}/`));}function oa(n){if(n.length===0)return!1;let e=n[0].path;return aa.some(t=>t.path===e||t.path.startsWith(`${e}/`));}var Yf=[de(ce({},ao),{component:bn,canMatch:[(n,e)=>na(e)],children:ra}),de(ce({},ao),{component:sn,canMatch:[(n,e)=>oa(e)],children:aa}),de(ce({},ao),{component:pn,canMatch:[(n,e)=>!na(e)&&!oa(e)],children:Cc})];export{Yf as default};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*/

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.