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