transcriptor-web/public/build/assets/AppLayout-ZM0oZ-BJ.js
2025-04-05 15:58:14 +02:00

2 lines
14 KiB
JavaScript

import{j as e,r as f,$ as p,u as z,L as F,W as M}from"./app-43FwoUKv.js";import{c as l}from"./index-C3aXnQRR.js";import{u as _}from"./useTypedPage-_EZ6P4Xz.js";import{z as A}from"./transition-aKza8ZE9.js";function B(n){return e.jsxs("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[e.jsx("path",{d:"M11.395 44.428C4.557 40.198 0 32.632 0 24 0 10.745 10.745 0 24 0a23.891 23.891 0 0113.997 4.502c-.2 17.907-11.097 33.245-26.602 39.926z",fill:"#6875F5"}),e.jsx("path",{d:"M14.134 45.885A23.914 23.914 0 0024 48c13.255 0 24-10.745 24-24 0-3.516-.756-6.856-2.115-9.866-4.659 15.143-16.608 27.092-31.75 31.751z",fill:"#6875F5"})]})}function D(){var o,c;const[n,i]=f.useState(!0),{props:a}=_(),r=((o=a.jetstream.flash)==null?void 0:o.bannerStyle)||"success",s=((c=a.jetstream.flash)==null?void 0:c.banner)||"";return e.jsx("div",{children:n&&s?e.jsx("div",{className:l({"bg-indigo-500":r=="success","bg-red-700":r=="danger"}),children:e.jsx("div",{className:"max-w-(--breakpoint-xl) mx-auto py-2 px-3 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex items-center justify-between flex-wrap",children:[e.jsxs("div",{className:"w-0 flex-1 flex items-center min-w-0",children:[e.jsx("span",{className:l("flex p-2 rounded-lg",{"bg-indigo-600":r=="success","bg-red-600":r=="danger"}),children:(()=>{switch(r){case"success":return e.jsx("svg",{className:"h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})});case"danger":return e.jsx("svg",{className:"h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})});default:return null}})()}),e.jsx("p",{className:"ml-3 font-medium text-sm text-white truncate",children:s})]}),e.jsx("div",{className:"shrink-0 sm:ml-3",children:e.jsx("button",{type:"button",className:l("-mr-1 flex p-2 rounded-md focus:outline-hidden sm:-mr-2 transition",{"hover:bg-indigo-600 focus:bg-indigo-600":r=="success","hover:bg-red-600 focus:bg-red-600":r=="danger"}),"aria-label":"Dismiss",onClick:x=>{x.preventDefault(),i(!1)},children:e.jsx("svg",{className:"h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})})]})})}):null})}function S({align:n="right",width:i="48",contentClasses:a="py-1 bg-white dark:bg-gray-700",renderTrigger:r,children:s}){const[o,c]=f.useState(!1),x={48:"w-48"}[i.toString()],g=n==="left"?"origin-top-left left-0":n==="right"?"origin-top-right right-0":"origin-top";return e.jsxs("div",{className:"relative",children:[e.jsx("div",{onClick:()=>c(!o),children:r()}),e.jsx("div",{className:"fixed inset-0 z-40",style:{display:o?"block":"none"},onClick:()=>c(!1)}),e.jsx(A,{show:o,enter:"transition ease-out duration-200",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:e.jsx("div",{className:"relative z-50",children:e.jsx("div",{className:l("absolute mt-2 rounded-md shadow-lg",x,g),onClick:()=>c(!1),children:e.jsx("div",{className:l("rounded-md ring-1 ring-black ring-opacity-5",a),children:s})})})})]})}function m({as:n,href:i,children:a}){return e.jsx("div",{children:(()=>{switch(n){case"button":return e.jsx("button",{type:"submit",className:"block w-full px-4 py-2 text-left text-sm leading-5 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-hidden focus:bg-gray-100 dark:focus:bg-gray-800 transition duration-150 ease-in-out",children:a});case"a":return e.jsx("a",{href:i,className:"block px-4 py-2 text-sm leading-5 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-hidden focus:bg-gray-100 dark:focus:bg-gray-800 transition duration-150 ease-in-out",children:a});default:return e.jsx(p,{href:i||"",className:"block px-4 py-2 text-sm leading-5 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-hidden focus:bg-gray-100 dark:focus:bg-gray-800 transition duration-150 ease-in-out",children:a})}})()})}function P({active:n,href:i,children:a}){const r=n?"inline-flex items-center px-1 pt-1 border-b-2 border-indigo-400 dark:border-indigo-600 text-sm font-medium leading-5 text-gray-900 dark:text-gray-100 focus:outline-hidden focus:border-indigo-700 transition duration-150 ease-in-out":"inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium leading-5 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:border-gray-300 dark:hover:border-gray-700 focus:outline-hidden focus:text-gray-700 dark:focus:text-gray-300 focus:border-gray-300 dark:focus:border-gray-700 transition duration-150 ease-in-out";return e.jsx(p,{href:i,className:r,children:a})}function u({active:n,href:i,children:a,...r}){const s=n?"block w-full pl-3 pr-4 py-2 border-l-4 border-indigo-400 dark:border-indigo-600 text-left text-base font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-900/50 focus:outline-hidden focus:text-indigo-800 dark:focus:text-indigo-200 focus:bg-indigo-100 dark:focus:bg-indigo-900 focus:border-indigo-700 dark:focus:border-indigo-300 transition duration-150 ease-in-out":"block w-full pl-3 pr-4 py-2 border-l-4 border-transparent text-left text-base font-medium text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-700 hover:border-gray-300 dark:hover:border-gray-600 focus:outline-hidden focus:text-gray-800 dark:focus:text-gray-200 focus:bg-gray-50 dark:focus:bg-gray-700 focus:border-gray-300 dark:focus:border-gray-600 transition duration-150 ease-in-out";return e.jsx("div",{children:"as"in r&&r.as==="button"?e.jsx("button",{className:l("w-full text-left",s),children:a}):e.jsx(p,{href:i||"",className:s,children:a})})}function I({title:n,renderHeader:i,children:a}){var b,j,y,v,k,w,N,L,T,C;const r=_(),s=z(),[o,c]=f.useState(!1);function x(t,d){t.preventDefault(),M.put(s("current-team.update"),{team_id:d.id},{preserveState:!1})}function g(t){t.preventDefault(),M.post(s("logout"))}return e.jsxs("div",{children:[e.jsx(F,{title:n}),e.jsx(D,{}),e.jsxs("div",{className:"min-h-screen bg-gray-100 dark:bg-gray-900",children:[e.jsxs("nav",{className:"bg-white dark:bg-gray-800 border-b border-gray-100 dark:border-gray-700",children:[e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex justify-between h-16",children:[e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:"shrink-0 flex items-center",children:e.jsx(p,{href:s("dashboard"),children:e.jsx(B,{className:"block h-9 w-auto"})})}),e.jsx("div",{className:"hidden space-x-8 sm:-my-px sm:ml-10 sm:flex",children:e.jsx(P,{href:s("dashboard"),active:s().current("dashboard"),children:"Dashboard"})})]}),e.jsxs("div",{className:"hidden sm:flex sm:items-center sm:ml-6",children:[e.jsx("div",{className:"ml-3 relative",children:r.props.jetstream.hasTeamFeatures?e.jsx(S,{align:"right",width:"60",renderTrigger:()=>{var t,d;return e.jsx("span",{className:"inline-flex rounded-md",children:e.jsxs("button",{type:"button",className:"inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 dark:text-gray-400 bg-white dark:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300 focus:outline-hidden focus:bg-gray-50 dark:focus:bg-gray-700 active:bg-gray-50 dark:active:bg-gray-700 transition ease-in-out duration-150",children:[(d=(t=r.props.auth.user)==null?void 0:t.current_team)==null?void 0:d.name,e.jsx("svg",{className:"ml-2 -mr-0.5 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})})]})})},children:e.jsx("div",{className:"w-60",children:r.props.jetstream.hasTeamFeatures?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"block px-4 py-2 text-xs text-gray-400",children:"Manage Team"}),e.jsx(m,{href:s("teams.show",[(b=r.props.auth.user)==null?void 0:b.current_team]),children:"Team Settings"}),r.props.jetstream.canCreateTeams?e.jsx(m,{href:s("teams.create"),children:"Create New Team"}):null,e.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600"}),e.jsx("div",{className:"block px-4 py-2 text-xs text-gray-400",children:"Switch Teams"}),(y=(j=r.props.auth.user)==null?void 0:j.all_teams)==null?void 0:y.map(t=>{var d;return e.jsx("form",{onSubmit:h=>x(h,t),children:e.jsx(m,{as:"button",children:e.jsxs("div",{className:"flex items-center",children:[t.id==((d=r.props.auth.user)==null?void 0:d.current_team_id)&&e.jsx("svg",{className:"mr-2 h-5 w-5 text-green-400",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("div",{children:t.name})]})})},t.id)})]}):null})}):null}),e.jsx("div",{className:"ml-3 relative",children:e.jsxs(S,{align:"right",width:"48",renderTrigger:()=>{var t,d,h;return r.props.jetstream.managesProfilePhotos?e.jsx("button",{className:"flex text-sm border-2 border-transparent rounded-full focus:outline-hidden focus:border-gray-300 transition",children:e.jsx("img",{className:"h-8 w-8 rounded-full object-cover",src:(t=r.props.auth.user)==null?void 0:t.profile_photo_url,alt:(d=r.props.auth.user)==null?void 0:d.name})}):e.jsx("span",{className:"inline-flex rounded-md",children:e.jsxs("button",{type:"button",className:"inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 dark:text-gray-400 bg-white dark:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-300 focus:outline-hidden focus:bg-gray-50 dark:focus:bg-gray-700 active:bg-gray-50 dark:active:bg-gray-700 transition ease-in-out duration-150",children:[(h=r.props.auth.user)==null?void 0:h.name,e.jsx("svg",{className:"ml-2 -mr-0.5 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})]})})},children:[e.jsx("div",{className:"block px-4 py-2 text-xs text-gray-400",children:"Manage Account"}),e.jsx(m,{href:s("profile.show"),children:"Profile"}),r.props.jetstream.hasApiFeatures?e.jsx(m,{href:s("api-tokens.index"),children:"API Tokens"}):null,e.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600"}),e.jsx("form",{onSubmit:g,children:e.jsx(m,{as:"button",children:"Log Out"})})]})})]}),e.jsx("div",{className:"-mr-2 flex items-center sm:hidden",children:e.jsx("button",{onClick:()=>c(!o),className:"inline-flex items-center justify-center p-2 rounded-md text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-900 focus:outline-hidden focus:bg-gray-100 dark:focus:bg-gray-900 focus:text-gray-500 dark:focus:text-gray-400 transition duration-150 ease-in-out",children:e.jsxs("svg",{className:"h-6 w-6",stroke:"currentColor",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("path",{className:l({hidden:o,"inline-flex":!o}),strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M4 12h16M4 18h16"}),e.jsx("path",{className:l({hidden:!o,"inline-flex":o}),strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})]})})})]})}),e.jsxs("div",{className:l("sm:hidden",{block:o,hidden:!o}),children:[e.jsx("div",{className:"pt-2 pb-3 space-y-1",children:e.jsx(u,{href:s("dashboard"),active:s().current("dashboard"),children:"Dashboard"})}),e.jsxs("div",{className:"pt-4 pb-1 border-t border-gray-200 dark:border-gray-600",children:[e.jsxs("div",{className:"flex items-center px-4",children:[r.props.jetstream.managesProfilePhotos?e.jsx("div",{className:"shrink-0 mr-3",children:e.jsx("img",{className:"h-10 w-10 rounded-full object-cover",src:(v=r.props.auth.user)==null?void 0:v.profile_photo_url,alt:(k=r.props.auth.user)==null?void 0:k.name})}):null,e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-base text-gray-800 dark:text-gray-200",children:(w=r.props.auth.user)==null?void 0:w.name}),e.jsx("div",{className:"font-medium text-sm text-gray-500",children:(N=r.props.auth.user)==null?void 0:N.email})]})]}),e.jsxs("div",{className:"mt-3 space-y-1",children:[e.jsx(u,{href:s("profile.show"),active:s().current("profile.show"),children:"Profile"}),r.props.jetstream.hasApiFeatures?e.jsx(u,{href:s("api-tokens.index"),active:s().current("api-tokens.index"),children:"API Tokens"}):null,e.jsx("form",{method:"POST",onSubmit:g,children:e.jsx(u,{as:"button",children:"Log Out"})}),r.props.jetstream.hasTeamFeatures?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600"}),e.jsx("div",{className:"block px-4 py-2 text-xs text-gray-400",children:"Manage Team"}),e.jsx(u,{href:s("teams.show",[(L=r.props.auth.user)==null?void 0:L.current_team]),active:s().current("teams.show"),children:"Team Settings"}),r.props.jetstream.canCreateTeams?e.jsx(u,{href:s("teams.create"),active:s().current("teams.create"),children:"Create New Team"}):null,e.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600"}),e.jsx("div",{className:"block px-4 py-2 text-xs text-gray-400",children:"Switch Teams"}),(C=(T=r.props.auth.user)==null?void 0:T.all_teams)==null?void 0:C.map(t=>{var d;return e.jsx("form",{onSubmit:h=>x(h,t),children:e.jsx(u,{as:"button",children:e.jsxs("div",{className:"flex items-center",children:[t.id==((d=r.props.auth.user)==null?void 0:d.current_team_id)&&e.jsx("svg",{className:"mr-2 h-5 w-5 text-green-400",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("div",{children:t.name})]})})},t.id)})]}):null]})]})]})]}),i?e.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-sm",children:e.jsx("div",{className:"max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8",children:i()})}):null,e.jsx("main",{children:a})]})]})}export{I as A};