1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4e327127-e7eb-4ee7-b4b4-981bd74e6ebb",e._sentryDebugIdIdentifier="sentry-dbid-4e327127-e7eb-4ee7-b4b4-981bd74e6ebb")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8894],{88894:function(e,t,i){i.d(t,{Z:function(){return ea}});var o=i(62364),n=i(67294),r=i(84672),d=i(68453),a=i(3785),l=i(9965),c=i(85918),s=i(61312),p=i(97886),m=i(50235),g=i(15437),b=i(46347);let h=g.ZP.div.withConfig({componentId:"sc-b97e50fe-0"})(["width:100%;max-width:52rem;margin:0 auto;padding:"," "," ",";display:flex;flex-direction:column;gap:",";font-family:",";box-sizing:border-box;@media (max-width:640px){padding:"," ",";}"],b.W0.dashboardPageGap,b.W0.cardPadding,b.W0.cardPadding,b.W0.dashboardContentGap,b.cp.fontFamily.primary,b.W0.cardPadding,b.W0.cardPaddingMobile),f=g.ZP.div.withConfig({componentId:"sc-b97e50fe-1"})(["display:flex;flex-direction:column;gap:0.6rem;"]),u=g.ZP.span.withConfig({componentId:"sc-b97e50fe-2"})(["color:",";font-size:",";font-weight:",";letter-spacing:0.16em;text-transform:uppercase;"],b.O9.brand.pink,b.cp.body.xs,b.cp.weight.bold),w=g.ZP.h2.withConfig({componentId:"sc-b97e50fe-3"})(["margin:0;color:",";font-size:clamp(2.6rem,3.4vw,3.2rem);font-weight:",";line-height:",";"],b.O9.text.primary,b.cp.weight.bold,b.cp.lineHeight.heading),y=g.ZP.p.withConfig({componentId:"sc-b97e50fe-4"})(["margin:0;color:",";font-size:",";line-height:",";"],b.O9.text.muted,b.cp.body.md,b.cp.lineHeight.body),x=g.ZP.div.withConfig({componentId:"sc-b97e50fe-5"})(["width:100%;box-sizing:border-box;padding:",";border:1px solid ",";border-radius:12px;background:",";display:flex;flex-direction:column;gap:",";@media (max-width:640px){padding:",";}"],b.W0.cardPadding,b.O9.border.medium,b.O9.background.panel,b.W0.dashboardContentGap,b.W0.cardPaddingMobile),v=g.ZP.div.withConfig({componentId:"sc-b97e50fe-6"})(["display:flex;flex-direction:column;gap:0.6rem;"]),Z=g.ZP.label.withConfig({componentId:"sc-b97e50fe-7"})(["color:",";font-size:",";font-weight:",";letter-spacing:0.06em;text-transform:uppercase;"],b.O9.text.muted,b.cp.body.xs,b.cp.weight.bold),C=g.ZP.input.withConfig({componentId:"sc-b97e50fe-8"})(["width:100%;box-sizing:border-box;padding:1rem ",";border-radius:",";border:1px solid ",";background:",";color:",";font-family:",";font-size:",";outline:none;transition:border-color 0.2s ease,box-shadow 0.2s ease;&::placeholder{color:",";}&:focus{border-color:",";box-shadow:0 0 0 3px ",";}"],b.W0.formGroupGap,b.W0.radiusInput,b.O9.border.medium,b.O9.background.panel,b.O9.text.primary,b.cp.fontFamily.primary,b.cp.body.md,b.O9.text.muted,b.O9.border.pinkSoft,b.O9.shadow.pink),k=g.ZP.textarea.withConfig({componentId:"sc-b97e50fe-9"})(["width:100%;min-height:8rem;box-sizing:border-box;padding:1rem ",";border-radius:",";border:1px solid ",";background:",";color:",";font-family:",";font-size:",";line-height:",";resize:vertical;outline:none;transition:border-color 0.2s ease,box-shadow 0.2s ease;&::placeholder{color:",";}&:focus{border-color:",";box-shadow:0 0 0 3px ",";}"],b.W0.formGroupGap,b.W0.radiusInput,b.O9.border.medium,b.O9.background.panel,b.O9.text.primary,b.cp.fontFamily.primary,b.cp.body.md,b.cp.lineHeight.body,b.O9.text.muted,b.O9.border.pinkSoft,b.O9.shadow.pink),P=g.ZP.button.withConfig({componentId:"sc-b97e50fe-10"})(["width:100%;box-sizing:border-box;padding:"," ",";border:1.5px dashed ",";border-radius:10px;background:",";display:flex;flex-direction:column;align-items:center;gap:0.8rem;cursor:pointer;font-family:",";transition:border-color 0.2s ease,background 0.2s ease;&:hover{border-color:",";background:",";}"],b.W0.dashboardPageGap,b.W0.cardPadding,b.O9.border.medium,b.O9.background.soft,b.cp.fontFamily.primary,b.O9.border.pinkSoft,b.O9.background.panel),O=g.ZP.span.withConfig({componentId:"sc-b97e50fe-11"})(["width:4rem;height:4rem;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:rgba(255,0,128,0.1);color:",";"],b.O9.brand.pink),I=g.ZP.span.withConfig({componentId:"sc-b97e50fe-12"})(["color:",";font-size:",";font-weight:",";"],b.O9.text.primary,b.cp.body.md,b.cp.weight.bold),W=g.ZP.span.withConfig({componentId:"sc-b97e50fe-13"})(["color:",";font-size:",";"],b.O9.text.muted,b.cp.body.sm),z=g.ZP.input.withConfig({componentId:"sc-b97e50fe-14"})(["display:none;"]),G=g.ZP.img.withConfig({componentId:"sc-b97e50fe-15"})(["width:100%;max-height:18rem;object-fit:cover;border-radius:8px;"]),B=g.ZP.div.withConfig({componentId:"sc-b97e50fe-16"})(["width:100%;display:flex;justify-content:center;margin-top:0.8rem;gap:1.2rem;"]),X=g.ZP.button.withConfig({componentId:"sc-b97e50fe-17"})(["border:none;background:none;padding:0;color:",";font-family:",";font-size:",";font-weight:",";cursor:pointer;"],b.O9.brand.pink,b.cp.fontFamily.primary,b.cp.body.sm,b.cp.weight.semibold),S=g.ZP.div.withConfig({componentId:"sc-b97e50fe-18"})(["display:flex;align-items:center;gap:",";"],b.W0.buttonGap),j=g.ZP.button.withConfig({componentId:"sc-b97e50fe-19"})(["padding:1.1rem ",";border:none;border-radius:",";background:",";color:",";display:inline-flex;align-items:center;justify-content:center;gap:0.6rem;font-family:",";font-size:",";font-weight:",";cursor:pointer;transition:transform 0.15s ease,box-shadow 0.2s ease;&:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 0.8rem 2rem ",";}&:disabled{background:#e5e7eb;color:#9ca3af;cursor:not-allowed;box-shadow:none;}"],b.W0.dashboardContentGap,b.W0.radiusButton,b.O9.brand.pink,b.O9.text.inverse,b.cp.fontFamily.primary,b.cp.button.lg,b.cp.weight.semibold,b.O9.shadow.pink),F=g.ZP.button.withConfig({componentId:"sc-b97e50fe-20"})(["padding:1.1rem ",";border:1px solid ",";border-radius:",";background:",";color:",";display:inline-flex;align-items:center;justify-content:center;font-family:",";font-size:",";font-weight:",";cursor:pointer;transition:background 0.2s ease,color 0.2s ease,border-color 0.2s ease;&:hover{background:",";color:",";border-color:",";}"],b.W0.dashboardContentGap,b.O9.border.medium,b.W0.radiusButton,b.O9.background.panel,b.O9.text.secondary,b.cp.fontFamily.primary,b.cp.button.lg,b.cp.weight.semibold,b.O9.background.soft,b.O9.text.primary,b.O9.border.pinkSoft),E=g.ZP.p.withConfig({componentId:"sc-b97e50fe-21"})(["margin:0;color:",";font-size:",";font-weight:",";"],b.O9.brand.pink,b.cp.body.sm,b.cp.weight.medium),N=e=>e.toLocaleLowerCase().trim().replace(/\s+/g," ");var H=e=>{let{onCreate:t,onCancel:i,currentPlaylist:r}
1=e,[d,a]=(0,n.useState)(""),[c,s]=(0,n.useState)(""),[g,b]=(0,n.useState)(""),[H,L]=(0,n.useState)(!1),[_,M]=(0,n.useState)(""),[D,T]=(0,n.useState)(""),[Y,q]=(0,n.useState)(!1),A=(0,n.useRef)(null),R=async e=>{var t;let i=null===(t=e.target.files)||void 0===t?void 0:t[0];if(e.target.value="",i){M(""),L(!0);try{let e=await (0,m.VX)(i);b(e)}catch(e){M(e instanceof Error?e.message:"Could not upload the image.")}finally{L(!1)}}},J=async()=>{let e=d.trim();if(!e){T("Please give your playlist a name.");return}if(null==r?void 0:r.includes(N(e))){T("A playlist with this name already exists.");return}q(!0);let i={...c.trim()?{description:c.trim()}:{},...g?{coverImage:g}:{}};await t(e,i),q(!1)};return(0,o.BX)(h,{children:[(0,o.BX)(f,{children:[(0,o.tZ)(u,{children:"Create playlist"}),(0,o.tZ)(w,{children:"New Playlist"}),(0,o.tZ)(y,{children:"Name it and add a description, then add videos to it."})]}),(0,o.BX)(x,{children:[(0,o.BX)(v,{children:[(0,o.tZ)(Z,{htmlFor:"new-playlist-title",children:"Title"}),(0,o.tZ)(C,{id:"new-playlist-title",value:d,onChange:e=>{a(e.target.value.slice(0,l.TH)),D&&T("")},maxLength:l.TH,placeholder:"Things to do in Stockholm"}),D?(0,o.tZ)(E,{children:D}):null]}),(0,o.BX)(v,{children:[(0,o.tZ)(Z,{htmlFor:"new-playlist-description",children:"Description"}),(0,o.tZ)(k,{id:"new-playlist-description",value:c,onChange:e=>s(e.target.value.slice(0,l.qI)),maxLength:l.qI,placeholder:"What this playlist is for, and who it is aimed at"}),(0,o.BX)(W,{children:[c.length,"/",l.qI]})]}),(0,o.BX)(v,{children:[(0,o.tZ)(Z,{children:"Cover image"}),(0,o.tZ)(z,{ref:A,type:"file",accept:"image/jpeg,image/png,image/webp",onChange:R}),g?(0,o.BX)(o.HY,{children:[(0,o.tZ)(G,{src:g,alt:"Playlist cover"}),(0,o.BX)(B,{children:[(0,o.tZ)(X,{type:"button",onClick:()=>{var e;return null===(e=A.current)||void 0===e?void 0:e.click()},children:"Change"}),(0,o.tZ)(X,{type:"button",onClick:()=>b(""),children:"Remove"})]})]}):(0,o.BX)(P,{type:"button",onClick:()=>{var e;return null===(e=A.current)||void 0===e?void 0:e.click()},disabled:H,children:[(0,o.tZ)(O,{children:(0,o.tZ)(p.Z,{size:20})}),(0,o.tZ)(I,{children:H?"Uploading...":"Choose a cover image"}),(0,o.tZ)(W,{children:"JPG, PNG or WEBP, up to 10MB"})]}),_?(0,o.tZ)(E,{children:_}):null]})]}),(0,o.BX)(S,{children:[(0,o.tZ)(j,{type:"button",onClick:J,disabled:!d.trim()||Y,children:"Create playlist"}),i?(0,o.tZ)(F,{type:"button",onClick:i,children:"Cancel"}):null]})]})};let L=g.ZP.div.withConfig({componentId:"sc-70321252-0"})(["position:relative;width:100%;max-width:52rem;margin:0 auto;padding:"," "," ",";display:flex;flex-direction:column;gap:",";font-family:",";box-sizing:border-box;@media (max-width:640px){padding:"," ",";}"],b.W0.dashboardPageGap,b.W0.cardPadding,b.W0.cardPadding,b.W0.dashboardContentGap,b.cp.fontFamily.primary,b.W0.cardPadding,b.W0.cardPaddingMobile),_=g.ZP.div.withConfig({componentId:"sc-70321252-1"})(["position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,0.72);border-radius:12px;"]),M=g.ZP.div.withConfig({componentId:"sc-70321252-2"})(["display:flex;align-items:center;gap:",";"],b.W0.formGroupGap),D=g.ZP.div.withConfig({componentId:"sc-70321252-3"})(["position:relative;width:5.2rem;height:5.2rem;flex-shrink:0;border-radius:10px;overflow:hidden;background:",";img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;}"],b.O9.background.soft),T=g.ZP.div.withConfig({componentId:"sc-70321252-4"})(["display:flex;flex-direction:column;gap:0.2rem;"]),Y=g.ZP.span.withConfig({componentId:"sc-70321252-5"})(["color:",";font-size:",";font-weight:",";letter-spacing:0.16em;text-transform:uppercase;
1"],b.O9.brand.pink,b.cp.body.xs,b.cp.weight.bold),q=g.ZP.h2.withConfig({componentId:"sc-70321252-6"})(["margin:0;color:",";font-size:",";font-weight:",";line-height:",";"],b.O9.text.primary,b.cp.body.xl,b.cp.weight.bold,b.cp.lineHeight.heading),A=g.ZP.p.withConfig({componentId:"sc-70321252-7"})(["margin:0;color:",";font-size:",";line-height:",";"],b.O9.text.muted,b.cp.body.sm,b.cp.lineHeight.body),R=g.ZP.div.withConfig({componentId:"sc-70321252-8"})(["display:flex;align-items:center;gap:",";@media (max-width:480px){flex-direction:column;align-items:stretch;}"],b.W0.formGroupGap),J=g.ZP.div.withConfig({componentId:"sc-70321252-9"})(["position:relative;flex:1;display:flex;align-items:center;svg{position:absolute;left:",";color:",";pointer-events:none;}"],b.W0.formGroupGap,b.O9.text.muted),U=g.ZP.input.withConfig({componentId:"sc-70321252-10"})(["width:100%;box-sizing:border-box;padding:1rem "," 1rem 3.6rem;border-radius:",";border:1px solid ",";background:",";color:",";font-family:",";font-size:",";outline:none;transition:border-color 0.2s ease;&::placeholder{color:",";}&:focus{border-color:",";}"],b.W0.formGroupGap,b.W0.radiusButton,b.O9.border.medium,b.O9.background.panel,b.O9.text.primary,b.cp.fontFamily.primary,b.cp.body.md,b.O9.text.muted,b.O9.brand.pink),V=g.ZP.button.withConfig({componentId:"sc-70321252-11"})(["flex-shrink:0;padding:1rem ",";border:1px solid ",";border-radius:",";background:",";color:",";display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;font-family:",";font-size:",";font-weight:",";white-space:nowrap;cursor:pointer;transition:background 0.2s ease,transform 0.15s ease;&:hover{background:rgba(255,0,128,0.06);transform:translateY(-1px);}"],b.W0.cardPaddingCompact,b.O9.border.pinkSoft,b.W0.radiusButton,b.O9.background.panel,b.O9.brand.pink,b.cp.fontFamily.primary,b.cp.button.md,b.cp.weight.semibold),$=g.ZP.div.withConfig({componentId:"sc-70321252-12"})(["display:flex;flex-direction:column;gap:0.8rem;max-height:42vh;overflow-y:auto;padding-right:0.2rem;scrollbar-width:thin;&::-webkit-scrollbar{width:6px;}&::-webkit-scrollbar-thumb{background:",";border-radius:999px;}"],b.O9.border.medium),K=g.ZP.button.withConfig({componentId:"sc-70321252-13"})(["width:100%;box-sizing:border-box;padding:0.8rem;border:1px solid ",";border-radius:10px;background:",";display:flex;align-items:center;justify-content:space-between;gap:",";cursor:pointer;text-align:left;transition:border-color 0.2s ease,background 0.2s ease,transform 0.15s ease;&:hover{border-color:",";transform:translateY(-1px);}"],e=>{let{$added:t}=e;return t?b.O9.border.pinkSoft:b.O9.border.medium},e=>{let{$added:t}=e;return t?"rgba(255, 0, 128, 0.04)":b.O9.background.panel},b.W0.formGroupGap,b.O9.border.pinkSoft),Q=g.ZP.div.withConfig({componentId:"sc-70321252-14"})(["min-width:0;display:flex;align-items:center;gap:",";"],b.W0.formGroupGap),ee=g.ZP.div.withConfig({componentId:"sc-70321252-15"})(["position:relative;width:4.4rem;height:4.4rem;flex-shrink:0;border-radius:8px;overflow:hidden;background:",";img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;}"],b.O9.background.soft),et=g.ZP.div.withConfig({componentId:"sc-70321252-16"})(["position:absolute;inset:0;background:linear-gradient( 135deg,",",",","," );"],b.O9.brand.turquoise,b.O9.brand.purple,b.O9.brand.pink),ei=g.ZP.div.withConfig({componentId:"sc-70321252-17"})(["min-width:0;display:flex;flex-direction:column;gap:0.2rem;"]),eo=g.ZP.span.withConfig({componentId:"sc-70321252-18"})(["color:",";font-size:",";font-weight:",";line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"],b.O9.text.primary,b.cp.body.md,b.cp.weight.semibold),en=g.ZP.span.withConfig({componentId:"sc-70321252-19"})(["color:",";font-size:",";"],b.O9.text.muted,b.cp.body.sm),er=g.ZP.span.withConfig({componentId:"sc-70321252-20"})(["flex-shrink:0;width:3rem;height:3rem;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:",";color:",";"],e=>{let{$added:t}=e;return t?b.O9.brand.pink:"rgba(255, 0, 128, 0.1)"},e=>{let{$added:t}=e;return t?b.O9.text.inverse:b.O9.brand.pink}
1),ed=g.ZP.div.withConfig({componentId:"sc-70321252-21"})(["width:100%;padding:"," ",";border:1px dashed ",";border-radius:10px;text-align:center;color:",";font-size:",";font-weight:",";"],b.W0.dashboardContentGap,b.W0.cardPadding,b.O9.border.medium,b.O9.text.muted,b.cp.body.sm,b.cp.weight.medium);var ea=e=>{let{itemId:t,image:i,isNew:p,onCreateCollection:m,onCancel:g,currentPlaylist:b,videoSrc:h}=e,{user:f}=(0,c.a)(),{collections:u,createCollection:w,addItemToCollection:y,loading:x,fetchCollections:v}=(0,l.bX)(),[Z,C]=(0,n.useState)(""),[k,P]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(null==u?void 0:u.length)||v()},[f]);let O=(0,n.useMemo)(()=>{var e;return null!==(e=null==u?void 0:u.filter(e=>"string"==typeof e.title).map(e=>e.title.toLocaleLowerCase()))&&void 0!==e?e:[]},[u]),I=(0,n.useMemo)(()=>{var e;return null!==(e=null==u?void 0:u.filter(e=>{var t;return null===(t=e.title)||void 0===t?void 0:t.toLowerCase().includes(Z.toLowerCase())}))&&void 0!==e?e:[]},[u,Z]);return p?(0,o.tZ)(H,{currentPlaylist:b,onCancel:g,onCreate:(e,t)=>m?m(e,t):w(e,t)}):k?(0,o.tZ)(H,{currentPlaylist:[...null!=b?b:[],...O],onCancel:()=>P(!1),onCreate:async(e,t)=>{await w(e,t),P(!1)}}):(0,o.BX)(L,{children:[x.active&&(0,o.tZ)(_,{children:(0,o.tZ)(s.Z,{message:x.message})}),(0,o.BX)(M,{children:[i?(0,o.tZ)(D,{children:(0,o.tZ)("img",{src:i,alt:"Selected video"})}):null,(0,o.BX)(T,{children:[(0,o.tZ)(Y,{children:"Add to playlist"}),(0,o.tZ)(q,{children:"Add this video"}),(0,o.tZ)(A,{children:"Choose a playlist for this video, or create a new one."})]})]}),(0,o.BX)(R,{children:[(0,o.BX)(J,{children:[(0,o.tZ)(r.Z,{size:16}),(0,o.tZ)(U,{type:"text",value:Z,onChange:e=>C(e.target.value),placeholder:"Search your playlists"})]}),(0,o.BX)(V,{type:"button",onClick:()=>P(!0),children:[(0,o.tZ)(d.Z,{size:16}),"New playlist"]})]}),(0,o.tZ)($,{children:I.length>0?I.map(e=>{let i=Number(t),n=Number.isFinite(i),r=n&&e.items.includes(i);return(0,o.BX)(K,{type:"button",$added:r,onClick:()=>n&&y(e.id,i),children:[(0,o.BX)(Q,{children:[(0,o.tZ)(ee,{children:e.coverImage?(0,o.tZ)("img",{src:e.coverImage,alt:e.title}):(0,o.tZ)(et,{})}),(0,o.BX)(ei,{children:[(0,o.tZ)(eo,{children:e.title}),(0,o.BX)(en,{children:[e.items.length," ",1===e.items.length?"video":"videos",r?" \xb7 added":""]})]})]}),(0,o.tZ)(er,{$added:r,children:r?(0,o.tZ)(a.Z,{size:16}):(0,o.tZ)(d.Z,{size:16})})]},e.id)}):(0,o.tZ)(ed,{children:Z?"No playlists match your search.":"You have no playlists yet. Create one to get started."})})]})}},50235:function(e,t,i){i.d(t,{VX:function(){return r}});var o=i(9835);let n=["image/jpeg","image/png","image/webp"],r=async e=>{if(!n.includes(e.type))throw Error("Please choose a JPG, PNG or WEBP image.");if(e.size>10485760)throw Error("Image must be 10MB or smaller.");let{data:t}=await o.Z.post("/api/playlists/cover",e,{headers:{"Content-Type":e.type,"x-filename":encodeURIComponent(e.name)}}),i=null==t?void 0:t.url;if(!i)throw Error("Image upload failed.");return i}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.