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]="735df586-201d-41dd-a449-ad3507e7d84b",e._sentryDebugIdIdentifier="sentry-dbid-735df586-201d-41dd-a449-ad3507e7d84b")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6592],{8075:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[com_id]/admin/playlists/[playlist_id]/manage-episodes",function(){return n(33190)}])},45363:function(e,t,n){"use strict";n.d(t,{x:function(){return a}});var r=n(85893);n(67294);var s=n(11163),i=n(95332);let l=["/login","/sso-callback"],a=e=>{let{fallbackPath:t,skipPaths:n=[],disableDefaultSkipPaths:a=!1,className:o="py-0.5 mb-2 rounded-md text-sm underline font-medium text-gray-500 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-offset-2"}=e,c=(0,s.useRouter)();return(0,r.jsx)("button",{onClick:()=>{let e=window.location.origin,r=document.referrer;i.Z.debug("BackButton - currentOrigin",e),i.Z.debug("BackButton - referrer",r);let s=c.asPath,o=s.split("/").filter(e=>e),d=o.length>0?"/"+o.slice(0,-1).join("/"):"/",u=t||d;i.Z.debug("BackButton - currentPath",s),i.Z.debug("BackButton - parentPath",d),i.Z.debug("BackButton - effectiveFallback",u);let h=window.history.length>1,p=r.startsWith(e),f=h&&p,g="";if(f&&window.history.state){let e=window.history.state;g=(null==e?void 0:e.url)||"",i.Z.debug("BackButton - prevUrl from history",g)}let m=a?n:[...l,...n],x=g&&m.some(e=>g===e||g.startsWith(e+"?")||g.startsWith(e+"/"));i.Z.debug("BackButton - effectiveSkipPaths",m),i.Z.debug("BackButton - isSkipPath",x),f&&!x?(i.Z.debug("BackButton - using browser back"),
1c.back()):(i.Z.debug("BackButton - using fallback path",u),c.push(u))},className:o,children:"ãã©ã"})}},28212:function(e,t,n){"use strict";var r=n(85893);n(67294);var s=n(99603),i=n(59417);t.Z=e=>{let{id:t,isChecked:n,onChange:l,disabled:a}=e;return(0,r.jsxs)("div",{className:"custom-checkbox flex items-center ".concat(a?"opacity-50 cursor-not-allowed":"cursor-pointer"),style:{position:"relative"},children:[(0,r.jsx)("input",{type:"checkbox",id:t,checked:n,onChange:e=>l&&l(e.target.checked),className:"opacity-0 absolute w-full h-full",disabled:a}),(0,r.jsx)("div",{className:"custom-checkbox-bg".concat(a?" opacity-50":""),children:(0,r.jsx)(s.G,{icon:i.LEp,className:"text-white absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2"})})]})}},62785:function(e,t,n){"use strict";n.d(t,{M:function(){return a}});var r=n(85893),s=n(67294),i=n(99603),l=n(59417);let a=e=>{let{id:t,inputRef:n,onChange:a,onKeyUp:o,onFocus:c,onClear:d,placeholder:u="Search...",disableAutocomplete:h=!1}=e,[p,f]=(0,s.useState)(!1),[g,m]=(0,s.useState)("");return(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)("input",{id:t,...n,value:g,className:"w-full border border-gray-300 px-3 py-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 pl-10 z-1",placeholder:u,onChange:e=>{m(e.target.value),null==a||a(e)},onKeyUp:o,onFocus:e=>{f(!0),null==c||c()},onBlur:()=>f(!1),autoComplete:h?"off":void 0}),(0,r.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500 w-4 h-4 flex items-center justify-center",children:(0,r.jsx)(i.G,{icon:l.wn1,className:"w-4 h-4"})}),g&&(0,r.jsx)("span",{className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-500 cursor-pointer z-10",children:(0,r.jsx)("button",{onClick:e=>{e.stopPropagation(),m(""),null==a||a({target:{value:""}}),null==d||d()},className:"p-2 flex items-center justify-center",children:(0,r.jsx)(i.G,{icon:l.NBC,className:"w-4 h-4"})})})]})}},84057:function(e,t,n){"use strict";n.d(t,{o:function(){return x}});var r=n(85893),s=n(67294),i=n(99603),l=n(59417),a=n(80918),o=n(56528),c=n(49294),d=n(99272),u=n(28493),h=n(36963),p=n(9628),f=n(30541),g=n(28212);let m=e=>{let{episode:t,index:n,onRemove:u,onMove:h,isShowDuration:p=!0,highlightId:f,style:m,selectedIds:x,onSelect:y}=e,v=(0,s.useRef)(null),[,b]=(0,c.c)({type:"episode",item:{id:t.id,index:n}}),[,j]=(0,d.L)({accept:"episode",hover(e,t){if(!v.current)return;let r=e.index;if(r===n)return;let{top:s,bottom:i}=v.current.getBoundingClientRect(),l=(i-s)/2,a=t.getClientOffset();if(!a)return;let o=a.y-s;(!(r<n)||!(o<l))&&(r>n&&o>l||(h(r,n),e.index=n))}});b(j(v));let w=x.includes(t.id),N=t.id===f;return(0,r.jsxs)("div",{ref:v,style:{...m,cursor:"move"},className:"flex items-center justify-between border-b border-gray-200 h-[65px] px-2 py-2 text-base ".concat(N?"bg-yellow-200 animate-pulse":"hover:bg-gray-100"),children:[(0,r.jsx)("div",{className:"mr-2 flex-shrink-0",children:(0,r.jsx)(g.Z,{id:"episode-checkbox-".concat(t.id),isChecked:w,onChange:()=>y(t.id)})}),(0,r.jsx)("span",{className:"flex items-center w-[28px] cursor-move",children:(0,r.jsx)(i.G,{icon:l.g$q,className:"mr-2 text-gray-400 w-5 h-5"})}),(0,r.jsx)("span",{className:"flex-grow line-clamp-2 overflow-hidden",children:t.title}),p&&(0,r.jsx)("span",{className:"w-[50px] min-w-[50px] text-center",children:(0,o.L)(t.duration)}),(0,r.jsx)("span",{className:"w-[100px] min-w-[100px] text-center",children:t.publishedAt?(0,a.o)(t.publishedAt,!1):"䏿¸ã"}),(0,r.jsx)("button",{onClick:()=>u(t.id),className:"ml-2 text-gray-400 hover:text-gray-600 w-[20px] cursor-pointer",children:(0,r.jsx)(i.G,{icon:l.NBC})})]})},x=e=>{let{episodes:t,onRemove:n,onMove:i,isShowDuration:l=!0,highlightId:a,containerHeight:o=400,onMoveSelected:c,onRemoveSelected:d,selectedIds:g,onSelect:x}=e,[y,v]=(0,s.useState)([]),b=g||y,j=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!a||!j.current)return;let e=t.findIndex(e=>e.id===a);e>=0&&j.current.scrollToItem(e,"end")},[a,t]);let w=e=>{x?x(e):v(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},N=e=>{c&&0!==b.length&&(c(e),g||v([]))};return(0,r.jsxs)(u.W,{backend:"ontouchstart"in window||navigator.maxTouchPoints>0?p.zr:h.PD,children:[(0,r.jsxs)("div",{className:"flex justify-end mb-2 gap-2",children:[(0,r.jsx)("button",{disabled:0===b.length,className:"px-2 py-1 bg-gray-100 hover:bg-gray-200 rounded text-sm disabled:opacity-50",onClick:()=>N("top"),children:"鏿ãä¸çªä¸ã¸"}),(0,r.jsx)("button",{disabled:0===b.length,className:"px-2 py-1 bg-gray-100 hover:bg-gray-200 rounded text-sm disabled:opacity-50",onClick:()=>
1N("bottom"),children:"鏿ãä¸çªä¸ã¸"}),(0,r.jsx)("button",{disabled:0===b.length,className:"px-2 py-1 bg-gray-100 hover:bg-gray-200 rounded text-sm disabled:opacity-50",onClick:()=>{d&&0!==b.length&&(d(),g||v([]))},children:"鏿ãåé¤"})]}),(0,r.jsx)(f.t7,{ref:j,height:o,itemCount:t.length,itemSize:65,width:"100%",children:e=>{let{index:s,style:o}=e;return(0,r.jsx)(m,{episode:t[s],index:s,onRemove:n,onMove:i,isShowDuration:l,highlightId:a,style:o,selectedIds:b,onSelect:w})}})]})}},49170:function(e,t,n){"use strict";n.d(t,{p:function(){return o}});var r=n(85893);n(67294);var s=n(9008),i=n.n(s),l=n(11163),a=n(76569);let o=e=>{let{pageTitle:t,pageDescription:n,pageImg:s,pageImgWidth:o,pageImgHeight:c}=e,d=(0,l.useRouter)(),{currentPlayingEpisode:u,community:h}=(0,a.s)(),p="éå®å
¬éã®ã©ã¸ãªé
ä¿¡ãªããã³ã¨ããã",f=null==u?void 0:u.title,g=null==h?void 0:h.displayName,m=f?g?"".concat(f," | ").concat(g):f:t?"".concat(t," | ").concat(p):p,x=n||"ã³ã¨ããã¯ããã¼ã ãã³ãã¥ããã£éå®ã«å
±æãã§ããããã¡ã°ãç°¡åãªã©ã¸ãªé
ä¿¡ãã¼ã«ã§ãã",y="".concat("https://coenoma.com").concat(d.asPath.split(/[?#]/)[0]),v=s||"".concat("https://coenoma.com").concat("/images/ogp.png");return(0,r.jsxs)(i(),{children:[(0,r.jsx)("title",{children:m}),(0,r.jsx)("meta",{name:"viewport",content:"width=device-width,initial-scale=1.0"}),(0,r.jsx)("meta",{name:"description",content:x}),(0,r.jsx)("meta",{property:"og:url",content:y}),(0,r.jsx)("meta",{property:"og:title",content:m}),(0,r.jsx)("meta",{property:"og:site_name",content:m}),(0,r.jsx)("meta",{property:"og:description",content:x}),(0,r.jsx)("meta",{property:"og:type",content:"website"}),(0,r.jsx)("meta",{property:"og:image",content:v}),(0,r.jsx)("meta",{property:"og:image:width",content:String(o||1200)}),(0,r.jsx)("meta",{property:"og:image:height",content:String(c||630)}),(0,r.jsx)("link",{rel:"canonical",href:y})]})}},75621:function(e,t,n){"use strict";n.d(t,{G:function(){return p}});var r=n(67294),s=n(11163),i=n(91088);let l=e=>{let{loading:t,isRefreshingToken:n,isUpdatedUserInfo:r,comId:s,hasUserInfo:i,isAuthUserNull:l,isRoleResolved:a,isAdmin:o,hasRoleError:c}=e;return t||n||!r||!s?"wait":i?c?l?"redirect-login":"redirect-community":a?o?"allow":"redirect-community":"wait":l?"redirect-login":"wait"};var a=n(10999),o=n(33221),c=n(76569),d=n(64676),u=n(12011),h=n(84657);let p=()=>{let e=(0,s.useRouter)(),{userInfo:t,isUpdatedUserInfo:n}=(0,o.P)(),{setErrorMessage:p}=(0,c.s)(),{authUser:f,loading:g,isRefreshingToken:m}=(0,d.a)(),{isAdmin:x,isRoleResolved:y,hasRoleError:v}=(0,i.Q)(),b=e.query.com_id,j=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(j.current===b)return;let r=l({loading:g,isRefreshingToken:m,isUpdatedUserInfo:n,comId:b,hasUserInfo:!!(null==t?void 0:t.id),isAuthUserNull:null===f,isRoleResolved:y,isAdmin:x,hasRoleError:v});if("wait"===r||"allow"===r)return;if(j.current=b,"redirect-login"===r){e.replace("/login");return}let s=null==t?void 0:t.id;s&&b&&(0,a.Qg)(s,b),p((0,u.x)(h.V.ADMIN_AUTH)),e.replace("/".concat(b))},[t,b,f,g,m,n,x,y,v,p,e]),{userInfo:t,isUserAdmin:x}}},12915:function(e,t,n){"use strict";n.d(t,{Q:function(){return o}});var r=n(67294),s=n(11163),i=n(64676),l=n(33221),a=n(95332);let o=()=>{let e=(0,s.useRouter)(),{authUser:t,loading:n,isRefreshingToken:o}=(0,i.a)(),{isUpdatedUserInfo:c}=(0,l.P)();return(0,r.useEffect)(()=>{if(c&&!t&&!n&&!o){let r=encodeURIComponent(e.asPath);"/login"!==e.pathname?(a.Z.debug("èªè¨¼ãªãã§ã®ã¢ã¯ã»ã¹ãæ¤åºããã°ã¤ã³ãã¼ã¸ã¸ãªãã¤ã¬ã¯ã",{isUpdatedUserInfo:c,authUser:!!t,loading:n,isRefreshingToken:o,currentPath:e.pathname}),e.push("/login?redirect_to=".concat(r))):a.Z.debug("Already on login page, no redirect needed")}},[t,c,n,o]),{authUser:t,loading:n}}},33190:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return C}});var r=n(85893),s=n(67294),i=n(11163),l=n(33221),a=n(76569),o=n(12915),c=n(75621),d=n(24214),u=n(51161),h=n(4893),p=n(95332);async function f(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];p.Z.debug("calling save_playlist_episodes API",{playlistId:e,episodes:t,removedEpisodeIds:n});let r=await fetch("/api/shared/save_playlist_episodes",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({playlistId:e,episodes:t,removedEpisodeIds:n})});if(!r.ok){let e=await r.json();throw p.Z.error("save_playlist_episodes API error",e),Error(e.error||"Failed to save playlist episodes")}}let g=async function(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=arguments.length>3?arguments[3]:void 0,s=await fetch("/api/shared/get_playlist_episodes_count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,playlistId:t,isPublished:n,guestIdentifier:r}),credentials:"include"});if(!s.ok){let e=await s.json();throw p.Z.error("Failed to fetch playlist episodes count",e),Error(e.error||"Failed to fetch count")}let{count:i}=await s.json();return i};var m=n(2678),x=n(80918),y=n(56528),v=n(49170),b=n(85352),j=n(62785),w=n(84057),N=n(45363),S=n(91108),k=n(89291),_=n(28212),C=()=>{var e;let t=(0,i.useRouter)(),n=t.query.com_id,C=t.query.playlist_id,{loading:B}=(0,o.Q)(),{isUserAdmin:E}=(0,c.G)(),{userInfo:P,isUpdatedUserInfo:Z}=(0,l.P)(),{setSuccessMessage:I,setErrorMessage:D,checkedCommunityAuth:O}
1=(0,a.s)(),[T,A]=(0,s.useState)(null),[R,F]=(0,s.useState)(""),[M,L]=(0,s.useState)([]),[U,q]=(0,s.useState)([]),[G,z]=(0,s.useState)(!0),[H,J]=(0,s.useState)(!1),[Q,W]=(0,s.useState)([]),[$,K]=(0,s.useState)([]),[X,V]=(0,s.useState)([]),[Y,ee]=(0,s.useState)(!1),[et,en]=(0,s.useState)(null),[er,es]=(0,s.useState)(0),[ei,el]=(0,s.useState)(!1),[ea,eo]=(0,s.useState)(!1),[ec,ed]=(0,s.useState)(!1),[eu,eh]=(0,s.useState)(!1),[ep,ef]=(0,s.useState)(!1),[eg,em]=(0,s.useState)(!1),ex=(0,s.useRef)(null),ey=(0,s.useRef)(null),ev="isFullLoadAllPlaylistEpisodes";(0,s.useEffect)(()=>{(async()=>{try{let e=(await (0,u.$)(n,3,0,{column:"created_at",direction:"desc"},null)).data.filter(e=>!Q.some(t=>t.id===e.id));q(e)}catch(e){p.Z.error("Error fetching recent episodes",e)}})()},[n,Q]),(0,s.useEffect)(()=>{C&&(0,d._)(C).then(A)},[C]),(0,s.useEffect)(()=>{if(!ec&&T&&P){var e;let t=Math.max((null!==(e=T.episodeCount)&&void 0!==e?e:0)-100,0);es(t),eb(t,100,!1)}},[T,P,ec]),(0,s.useEffect)(()=>{let e=e=>{ex.current&&!ex.current.contains(e.target)&&(J(!1),L([]))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,s.useEffect)(()=>{if(et&&ey.current){ey.current.scrollTo({top:ey.current.scrollHeight,behavior:"smooth"});let e=setTimeout(()=>en(null),1200);return()=>clearTimeout(e)}},[et]),(0,s.useEffect)(()=>{V([])},[Q.length]);let eb=async(e,t,n)=>{eo(!0);try{let r=await (0,h.o)(null==P?void 0:P.id,C,t,e,{column:"order_by",direction:"asc"},!1,"",[],void 0);W(e=>{let t=n?[...r,...e]:[...r];return t.sort((e,t)=>e.orderBy-t.orderBy),t}),el(e>0)}catch(e){D("ã¨ãã½ã¼ãã®åå¾ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã")}finally{eo(!1)}},ej=async()=>{eh(!1),ed(!0),ef(!0);try{let e=(null==P?void 0:P.id)?void 0:(0,m.j)(),t=await (0,h.o)(null==P?void 0:P.id,C,-1,0,{column:"order_by",direction:"asc"},!1,"",[],e);W(t),el(!1)}catch(e){D("å
¨ä»¶åå¾ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã"),ed(!1)}finally{ef(!1)}};(0,s.useEffect)(()=>{let e=localStorage.getItem(ev);Z&&(em(!0),"true"===e&&ej())},[Z]),(0,s.useEffect)(()=>{Z&&eg&&(p.Z.info("isFullLoad change to",ec),localStorage.setItem(ev,JSON.stringify(ec)))},[ec,Z,eg]);let ew=async e=>{"Enter"===e.key&&(z(!1),R?L((await (0,u.$)(n,-1,0,{column:"created_at",direction:"desc"},R)).data.filter(e=>!Q.some(t=>t.id===e.id))):L([]),J(!0),z(!0))},eN=e=>{Q.find(t=>t.id===e.id)||(W(t=>{let n=t.length>0?Math.max(...t.map(e=>e.orderBy)):0;return p.Z.info("lastOrderBy",n),[...t,{...e,orderBy:n+1}]}),K(t=>t.filter(t=>t!==e.id)),en(e.id),ee(!0),I("ãã¬ã¤ãªã¹ãã«ã¨ãã½ã¼ãã追å ãã¾ããã"))},eS=async()=>{try{let e=await g(null==P?void 0:P.id,C,!1),t=$.length,n=t>0?e-t:e;p.Z.debug("newOrderByMax",n);let r=n-Q.length+2;p.Z.debug("startOrder",r);let s=Q.map((e,t)=>({playlistId:C,episodeId:e.id,orderBy:r+t}));await f(C,s,$),ee(!1),I("ãã¬ã¤ãªã¹ããæ´æ°ããã¾ããã"),K([])}catch(e){D("ãã¬ã¤ãªã¹ãã®æ´æ°ä¸ã«ã¨ã©ã¼ãçºçãã¾ããã")}};return T&&E&&Z?O?(0,r.jsxs)("div",{children:[(0,r.jsx)(v.p,{pageTitle:"ãã¬ã¤ãªã¹ãã".concat(T.displayName,"ãã®ã¨ãã½ã¼ã")}),(0,r.jsxs)("div",{className:"container main-content pb-24",children:[(0,r.jsxs)("div",{className:"flex justify-between items-start",children:[(0,r.jsx)(N.x,{fallbackPath:"/".concat(n,"/admin/playlists"),skipPaths:["/".concat(n,"/admin/playlists/").concat(C)]}),(0,r.jsxs)("div",{className:"flex flex-col items-end",children:[(0,r.jsxs)("label",{htmlFor:"fullLoadToggle",className:"flex items-center cursor-pointer select-none",children:[(0,r.jsx)("span",{className:"".concat(Y?"text-gray-400":"text-gray-800"," mr-2"),children:"ãã¹ã¦ã®ã¨ãã½ã¼ããèªã¿è¾¼ã"}),(0,r.jsx)(_.Z,{id:"fullLoadToggle",isChecked:ec,onChange:e=>{if(Y){D("æªä¿åã®ç·¨éãããã¾ããä¿åå¾ã«å
¨ä»¶ã¢ã¼ããåãæ¿ãã¦ãã ããã");return}if(ec){var t;ed(!1);let e=Math.max((null!==(t=null==T?void 0:T.episodeCount)&&void 0!==t?t:0)-100,0);es(e),eb(e,100,!1)}else eh(!0)},disabled:Y})]}),(0,r.jsx)("div",{className:"h-6 mt-1",children:Y&&(0,r.jsx)("p",{className:"text-gray-500 text-xs",children:"ç·¨éä¸ã¯åãæ¿ãã§ãã¾ãããæ´æ°å¾ã«å度ã試ããã ããã"})})]})]}),(0,r.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,r.jsxs)("div",{className:"md:w-1/2 relative",children:[(0,r.jsx)(j.M,{id:"episodeSearch",placeholder:"ã¨ãã½ã¼ããæ¤ç´¢â¦",disableAutocomplete:!0,onChange:e=>{let t=e.target.value;F(t),t||(L([]),J(!0))},onKeyUp:ew,onFocus:()=>{R||J(!0)}}),H&&(0,r.jsxs)("div",{ref:ex,className:"absolute top-[45px] left-0 py-2 px-4 bg-white overflow-y-auto w-full shadow-lg rounded z-[60] max-h-[calc(100vh-200px)]",children:[G?M.length>0?M.map((e,t)=>(0,r.jsxs)("div",{className:"flex justify-between items-center p-2 cursor-pointer ".concat(t<M.length-1?"border-b border-gray-200":""),onClick:()=>eN(e),children:[(0,r.jsx)("span",{className:"w-4/5 line-clamp-2 overflow-hidden",children:e.title}),(0,r.jsx)("span",{className:"w-1/10 text-center",children:(0,y.L)(e.duration)}),(0,r.jsx)("span",{className:"w-1/10 min-w-[90px] text-center",children:e.publishedAt?(0,x.o)(e.publishedAt,!1):(0,r.jsx)("span",{className:"text-gray-500 text-sm",children:"䏿¸ã"})})]},e.id)):R?(0,r.jsx)("div",{className:"h-[100px] flex justify-center items-center text-gray-600",children:"ä¸è´ããã¨ãã½ã¼ããããã¾ããã"}):null:(0,r.jsx)("div",{className:"h-[100px] flex justify-center items-center",children:(0,r.jsx)(b.a,{type:"small"})}),(0===M.length||!R)&&U.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mt-2 pt-2 border-t border-gray-200 px-2 text-gray-500 text-sm",children:"æè¿ä½æãããã¨ãã½ã¼ã"}),U.map((e,t)=>(0,r.jsxs)("div",{className:"flex justify-between items-center p-2 cursor-pointer ".concat(t<U.length-1?"border-b border-gray-200":""),onClick:()=>eN(e),children:[(0,r.jsx)("span",{className:"w-4/5 line-clamp-2 overflow-hidden",children:e.title}),(0,r.jsx)("span",{className:"w-1/10 text-center",children:(0,y.L)(e.duration)}),(0,r.jsx)("span",{className:"w-1/10 min-w-[90px] text-center",children:e.publishedAt?(0,x.o)(e.publishedAt,!1):(0,r.jsx)("span",{className:"text-gray-500 text-sm",children:"䏿¸ã"})})]},"recent-".concat(e.id)))]})]})]}),(0,r.jsxs)("div",{className:"md:w-1/2 relative",children:[ep&&(0,r.jsx)("div",{className:"absolute inset-0 bg-white bg-opacity-70 z-10 flex items-center justify-center",children:(0,r.jsx)(b.a,{type:"overlay"})}),(0,r.jsxs)("div",{ref:ey,className:"border border-gray-200 rounded-md max-h-[65vh] min-h-[65vh] overflow-y-auto",children:[!ec&&ei&&(0,r.jsx)("div",{className:"p-2 text-center",children:(0,r.jsx)("button",{className:"px-3 py-1 bg-gray-100 rounded hover:bg-gray-200",onClick:()=>{let e=Math.max(er-100,0),t=er-e;es(e),eb(e,t,!0)},children:"ãã£ã¨åã®ã¨ãã½ã¼ããèªã¿è¾¼ã"})}),Q.length>
10?(0,r.jsx)(w.o,{episodes:Q,onRemove:e=>{W(t=>t.filter(t=>t.id!==e)),K(t=>[...t,e]),ee(!0),I("ãã¬ã¤ãªã¹ãããã¨ãã½ã¼ããå¤ãã¾ããã")},onMove:(e,t)=>{W(n=>{let r=[...n],[s]=r.splice(e,1);return r.splice(t,0,s),r}),ee(!0)},highlightId:null!=et?et:void 0,containerHeight:null===(e=ey.current)||void 0===e?void 0:e.clientHeight,selectedIds:X,onSelect:e=>{V(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},onMoveSelected:e=>{0!==X.length&&(W(t=>{let n=new Set(X),r=t.filter(e=>n.has(e.id)),s=t.filter(e=>!n.has(e.id)),i=er+1;return("top"===e?[...r,...s]:[...s,...r]).map((e,t)=>({...e,orderBy:i+t}))}),V([]),ee(!0),I("鏿ããã¨ãã½ã¼ããç§»åãã¾ããã"))},onRemoveSelected:()=>{0!==X.length&&(K(e=>{let t=[...e];return X.forEach(e=>{t.includes(e)||t.push(e)}),t}),W(e=>{let t=new Set(X),n=e.filter(e=>!t.has(e.id)),r=er+1;return n.map((e,t)=>({...e,orderBy:r+t}))}),V([]),ee(!0),I("".concat(X.length,"ä»¶ã®ã¨ãã½ã¼ããåé¤ãã¾ããã")))}}):(0,r.jsx)("div",{className:"h-[100px] flex justify-center items-center text-gray-600",children:ec?"ã¨ãã½ã¼ããå
¨ä»¶èªã¿è¾¼ã¿ä¸â¦":ea?(0,r.jsx)(b.a,{type:"small"}):ei?"ã¨ãã½ã¼ããèªã¿è¾¼ãã§ãã ããã":"ã¾ã ãã®ãã¬ã¤ãªã¹ãã«ã¯ã¨ãã½ã¼ããããã¾ããã"})]})]})]}),(0,r.jsxs)("div",{className:"fixed bottom-0 left-0 w-full bg-white border-t border-gray-200 z-50",children:[Y&&(0,r.jsx)("div",{className:"mb-2 bg-yellow-100 text-yellow-800 text-center py-2 font-medium rounded",children:"â» æªæ´æ°ã®ç·¨éãããã¾ããç»é¢ãé¢ããåã«ãæ´æ°ããããæ¼ãã¦ãã ããã"}),(0,r.jsx)("div",{className:"flex justify-center w-full p-4",children:(0,r.jsx)("button",{className:"button form-button",onClick:eS,children:"æ´æ°ãã"})})]})]}),(0,r.jsxs)(k.P,{isOpen:eu,onRequestClose:()=>eh(!1),title:"ã¨ãã½ã¼ãããã¹ã¦èªã¿è¾¼ã¿ã¾ããï¼",children:[(0,r.jsx)("p",{className:"mb-4",children:"ãã®æä½ã¯ãã¬ã¤ãªã¹ãå
ã®å
¨ã¨ãã½ã¼ããä¸åº¦ã«èªã¿è¾¼ããããã¨ãã½ã¼ãæ°ã«ãã£ã¦ã¯æéããããå ´åãããã¾ãã ç¶è¡ãã¦ãããããã§ããï¼"}),(0,r.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,r.jsx)("button",{onClick:()=>eh(!1),className:"px-4 py-2 bg-gray-200 rounded hover:bg-gray-300",children:"ãã£ã³ã»ã«"}),(0,r.jsx)("button",{onClick:ej,className:"px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark",children:"èªã¿è¾¼ã"})]})]})]}):(0,r.jsx)(S.M,{}):(0,r.jsx)(b.a,{})}},51161:function(e,t,n){"use strict";n.d(t,{$:function(){return i}});var r=n(41865),s=n(63504);let i=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{column:"created_at",direction:"desc"},l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=(arguments.length>5&&arguments[5],arguments.length>6&&arguments[6],arguments.length>7?arguments[7]:void 0),{episodesData:o,usersData:c,groupsData:d,totalCountData:u}=await (0,r.l)(e,t,n,i,!1,void 0,l,void 0,void 0,!0,a);return{data:o.map(e=>{var t,n;let r=(null===(t=e.episodeSpeakers)||void 0===t?void 0:t.map(e=>{let t=c.find(t=>t.id===e.userId);return t?t.displayName:""}).join(", "))||"",i=(null===(n=e.episodeGroups)||void 0===n?void 0:n.map(e=>{var t;return(null===(t=d.find(t=>t.id===e.groupId))||void 0===t?void 0:t.name)||""}).join(", "))||"";return{...(0,s.df)(e),speakerNames:r,groupNames:i}}),totalCount:u}}},41865:function(e,t,n){"use strict";async function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{column:"published_at",direction:"desc"},s=!(arguments.length>4)||void 0===arguments[4]||arguments[4],i=arguments.length>5?arguments[5]:void 0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],o=arguments.length>8?arguments[8]:void 0,c=arguments.length>9&&void 0!==arguments[9]&&arguments[9],d=arguments.length>10?arguments[10]:void 0,u=0;for(;u<3;)try{let u=await fetch("/api/shared/get_episodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({communityIds:e,userId:i,isPublished:s,searchKeyword:l,limit:t,offset:n,orderBy:r,statusFilters:a,guestIdentifier:o,isAdmin:c,groupFilter:d}),credentials:"include"});if(!u.ok){let a=await u.json().catch(()=>({}));console.error("Fetch episodes failed:",{statusCode:u.status,error:a.error||"Failed to fetch episodes",requestDetails:{communityIds:e,userId:i,isPublished:s,searchKeyword:l,limit:t,offset:n,orderBy:r,isAdmin:c}});let o=Error(a.error||"Failed to fetch episodes");throw o.status=u.status,o}let h=await u.json();return(null==h?void 0:h.logDetails)&&console.log("logDetails",null==h?void 0:h.logDetails),{episodesD
1ata:h.episodesData,usersData:h.usersData,groupsData:h.groupsData,totalCountData:h.totalCountData}}catch(t){let e=null==t?void 0:t.status;if("number"==typeof e&&e>=400&&e<500)throw t;if(u>=2)throw console.error("All retries failed:",t),t;u++,console.log("Retrying fetch episodes... Attempt ".concat(u))}throw Error("Failed to fetch episodes after maximum retries")}n.d(t,{l:function(){return r}})},24214:function(e,t,n){"use strict";n.d(t,{_:function(){return i}});var r=n(81657),s=n(63504);let i=async e=>{try{let{data:t,error:n}=await r.O.from("playlists").select("*").eq("id",e).single();if(n)throw n;if(t){let{count:n,error:i}=await r.O.from("playlist_episodes").select("*",{count:"exact"}).eq("playlist_id",e);if(i)throw i;return{...(0,s.df)(t),episodeCount:n}}return null}catch(e){return console.error("Error in fetchPlaylist",e.message),null}}},4893:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});var r=n(95332);let s=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{column:"order_by",direction:"asc"},l=!(arguments.length>5)||void 0===arguments[5]||arguments[5],a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],c=arguments.length>8?arguments[8]:void 0,d=await fetch("/api/shared/get_playlist_episodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,playlistId:t,limit:n,offset:s,orderBy:i,isPublished:l,searchKeyword:a,statusFilters:o,guestIdentifier:c}),credentials:"include"});if(!d.ok)throw Error((await d.json()).error||"Failed to fetch episodes");let{episodes:u}=await d.json();return r.Z.debug("playlist, episodes",u),u}},80918:function(e,t,n){"use strict";function r(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];"string"==typeof e&&(e=new Date(e));let n=e.getFullYear(),r=(e.getMonth()+1).toString().padStart(2,"0"),s=e.getDate().toString().padStart(2,"0"),i=e.getHours().toString().padStart(2,"0"),l=e.getMinutes().toString().padStart(2,"0");return t?"".concat(n,"-").concat(r,"-").concat(s," ").concat(i,":").concat(l):"".concat(n,"-").concat(r,"-").concat(s)}n.d(t,{o:function(){return r}})}},function(e){e.O(0,[197,5650,2888,9774,179],function(){return e(e.s=8075)}),_N_E=e.O()}]);
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.