PageSourceSearch

https://plus.subanana.com/assets/AuthLayout-BY80x_6I.js

js subanana.com collected 2026-09-24 13:24:08 UTC 18,919 bytes, 1 lines download raw bytes

1import{c as te,r as i,w as se,O as ne,h as ae}from"./chunk-UVKPFVEO-42f6VqCb.js";import{j as e}from"./jsx-runtime-u17CrQMm.js";import{u as j}from"./useTranslation-CLgW2CR3.js";import{L as re}from"./LoadingSpinner-Dc1fAL2G.js";import{c as V}from"./env-a1NWev9s.js";import"./brand-config-DsdQC82q.js";import{b as oe,A as ie,R as ce,T as le}from"./useStripHostileInjections-BxcTnmMO.js";import"./purify.es-r8glNMJW.js";import{u as $,t as O,a9 as ue,O as de,C as me,b as fe,X as Q,r as pe,ao as ge}from"./middleware-DrP25n4O.js";import{D as xe,e as he,d as be,f as we}from"./dialog-BSOizRvW.js";import{D as ve,a as ye,c as je,d as Se}from"./drawer-D5bclihG.js";import{B as N}from"./button-9Jm--AQt.js";import{L as Ce}from"./label-CpHGd4oR.js";import{R as ke,a as Ne}from"./radio-group-CbVbNcpb.js";import{u as Re,W,a as Ae,S as Pe}from"./useConnectCalendarFlow-DoVRDdLk.js";import{S as B,a as Y}from"./teams-VA_AAWIy.js";import{a as M}from"./index-C-dmXOB-.js";import{a as y}from"./pendingModeOverlayStore-CWEMB_n3.js";import{R as Ee}from"./recordingModeOptions-FnSzpAiU.js";import{r as ze,d as Ie}from"./oauth-Dl7CjVZ2.js";import{C as _e}from"./check-YWbA5eDc.js";import{L as H}from"./loader-circle-D3SW3IX7.js";import{f as Oe,u as Te}from"./mutations-CBfXK5jQ.js";import{r as Le,s as Me,a as De,c as Ve,b as Ge}from"./guestHandoff-ByTHlYtw.js";import{u as He,W as Ue}from"./WishlistHost-lEL69G2h.js";import{u as L}from"./create-project-sheet-store-IUmLoALJ.js";import{u as X,i as Fe,a as Z,b as We,V as _,U as Be,r as Ye}from"./project_pb-BVLQo6Z_.js";import{g as qe}from"./config-zdKOYgxb.js";import{i as Ke}from"./auto-detect-language-CeeNxh50.js";import{u as $e}from"./guest-handoff-CJ8GJ32g.js";import{P as Qe,S as G,u as q}from"./use-reduced-motion-BC_HrLhQ.js";import{A as Xe,m as Ze}from"./proxy-COuMjwKX.js";import"./spinner-Dq0Kf3lh.js";import"./constants--Skz9yRm.js";import"./schemas-CmJWeYhN.js";import"./content_asset_pb-BjE5rs5O.js";import"./index-Bas3CBRx.js";import"./index-Caik1xua.js";import"./index-DH43njmA.js";import"./index-DQIYFm5A.js";import"./index-B3bileIA.js";import"./index-BxLnb7Mt.js";import"./textarea-CnBkn-G9.js";import"./tabs-x1Rem4hB.js";import"./plus-D-Fubc61.js";const U={eligibility:["public-review-ask","eligibility"]};function Je(s){const t=X();return Fe({queryKey:U.eligibility,queryFn:async()=>await t.getPublicReviewAsk({}),enabled:s.enabled,retry:!1})}function et(){const s=X(),t=Z(),n=()=>{t.setQueryData(U.eligibility,{show:!1})};return We({mutationFn:async()=>{await s.recordPublicReviewAskShown({})},retry:2,onMutate:n,onSuccess:n})}const tt=["connect","recording","ready"];function st(){const{t:s}=j(["client.meetings","common"]),t=$(),r=oe().data?.workspace?.id??"",c=y(o=>o.open),a=y(o=>o.step),x=y(o=>o.pendingProvider),d=y(o=>o.connectedAccountId),p=y(o=>o.setStep),m=y(o=>o.setPendingProvider),l=y(o=>o.setConnectedAccountId),u=y(o=>o.closeWizard),g=Re(),h=Oe(r),[b,S]=te(),k=i.useRef(null);if(i.useEffect(()=>{if(!r)return;const o=b.get("action"),R=b.get("code");if(!R||k.current===R)return;const E=typeof window<"u"?window.sessionStorage.getItem(W):null;if(!E)return;const z=o==="google-calendar-callback"?"google":o==="outlook-calendar-callback"?"outlook":null;if(!z||z!==E)return;const D=b.get("state"),F=ze();if(!D||!F||D!==F)return;k.current=R;const ee=`${window.location.origin}/${z}-calendar-callback`;window.sessionStorage.removeItem(W),Ie(),S(I=>{const A=new URLSearchParams(I);return A.delete("action"),A.delete("code"),A.delete("state"),A},{replace:!0}),y.setState({open:!0,step:"connect",pendingProvider:z,connectedAccountId:null}),h.mutateAsync({provider:z,authCode:R,redirectUri:ee,state:D}).then(I=>{const A=I.account?.accountId??null;l(A),p("recording")}).catch(I=>{O.error(s("client.meetings:wizard.connect.error",{defaultValue:"Failed to connect calendar"})),console.error("ConnectAccount failed (resume)",I),m(null)})},[b,r,h,S,l,m,p,s]),!c)return null;const C=tt.indexOf(a),w=h.isPending,v=s("client.meetings:wizard.title",{defaultValue:"Meeting recorder"}),P=s("client.meetings:wizard.description",{defaultValue:"Connect a calendar, choose which meetings to record, set your defaults, and you're done."}),T=e.jsxs(e.Fragment,{children:[e.jsx(nt,{current:C}),e.jsxs("div",{className:"mt-8",children:[a==="connect"&&e.jsx(at,{isConnecting:w||x!=null,pendingProvider:x,onPick:o=>{g(o)}}),a==="recording"&&d&&e.jsx(rt,{workspaceId:r,accountId:d,onDone:()=>p("ready")}),a==="ready"&&e.jsx(ot,{onClose:()=>u()})]})]}),f=o=>{o||w||u()};return t?e.jsx(ve,{open:c,onOpenChange:f,children:e.jsxs(ye,{className:"max-h-[95vh]",children:[e.jsxs(ue,{children:[e.jsx(je,{children:v}),e.jsx(Se,{children:P})]}),e.jsxs("div",{className:"overflow-y-auto scrollbar-thin px-6 pb-8 pt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"size-6"}),e.jsx(Y,{className:"size-6"})]}),e.jsx("h2",{className:"mt-6 text-[22px] font-semibold leading-tight tracking-tight",children:v}),T]})]})}):e.jsx(xe,{open:c,onOpenChange:f,children:e.jsxs(he,{"data-slot":"dialog-portal",children:[e.jsx(de,{className:"bg-black/40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50"}),e.jsxs(me,{"aria-describedby":void 0,className:M("bg-background fixed top-[50%] left-[50%] z-50 flex flex-col w-full max-w-[calc(100%-2rem)] sm:max-w-[560px] translate-x-[-50%] translate-y-[-50%] rounded-[32px] p-10 shadow-2xl duration-200","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"size-6"}),e.jsx(Y,{className:"size-6"})]}),e.jsx(fe,{className:"inline-flex size-9 items-center justify-center rounded-full bg-muted text-foreground
1/70 hover:bg-muted/80 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed","aria-label":s("common:actions.close",{defaultValue:"Close"}),disabled:w,children:e.jsx(Q,{className:"size-4",strokeWidth:2.25})})]}),e.jsx(be,{className:"mt-6 text-[22px] font-semibold leading-tight tracking-tight",children:v}),e.jsx(we,{className:"sr-only",children:P}),T]})]})})}function nt({current:s}){const{t}=j("client.meetings"),n=[{key:"connect",label:t("wizard.steps.connect",{defaultValue:"Connect"})},{key:"recording",label:t("wizard.steps.recording",{defaultValue:"Recording"})},{key:"ready",label:t("wizard.steps.ready",{defaultValue:"Ready"})}];return e.jsx("ol",{className:"mt-5 flex flex-wrap items-center gap-x-6 gap-y-2",children:n.map((r,c)=>{const a=c===s,x=c<s;return e.jsxs("li",{className:M("flex items-center gap-2 text-sm rounded-full border pl-2 pr-3 py-1",a?"border-border/80":"border-border/40"),children:[e.jsx("span",{className:M("flex size-4 items-center justify-center rounded-full text-[10px] font-semibold",(a||x)&&"bg-foreground text-background",!a&&!x&&"bg-muted text-muted-foreground"),children:x?e.jsx(_e,{className:"size-2.5",strokeWidth:3}):c+1}),e.jsx("span",{className:M("font-medium",a||x?"text-foreground":"text-muted-foreground"),children:r.label})]},r.key)})})}function at({isConnecting:s,pendingProvider:t,onPick:n}){const{t:r}=j("client.meetings");return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("p",{className:"text-[15px] leading-relaxed",children:r("wizard.connect.intro",{defaultValue:"Record, transcribe, and unlock knowledge from your meetings in Microsoft Teams or Google Meet."})}),e.jsxs("div",{className:"mt-5 grid grid-cols-2 gap-3",children:[e.jsxs(N,{className:"h-10 gap-2 rounded-full px-4 has-[>svg]:px-4 min-w-0",onClick:()=>n("google"),disabled:s,children:[s&&t==="google"?e.jsx(H,{className:"size-4 animate-spin"}):e.jsx(Ae,{className:"size-4"}),e.jsx("span",{className:"truncate",children:r("wizard.connect.google",{defaultValue:"Connect Google Calendar"})})]}),e.jsxs(N,{variant:"secondary",className:"h-10 gap-2 rounded-full px-4 has-[>svg]:px-4 min-w-0",onClick:()=>n("outlook"),disabled:s,children:[s&&t==="outlook"?e.jsx(H,{className:"size-4 animate-spin"}):e.jsx(Pe,{className:"size-4"}),e.jsx("span",{className:"truncate",children:r("wizard.connect.outlook",{defaultValue:"Connect Outlook Calendar"})})]})]}),e.jsx("p",{className:"mt-4 text-[13px] text-muted-foreground leading-relaxed",children:r("wizard.connect.helper",{defaultValue:"Subanana needs calendar access to know which meetings to join. You'll choose which meetings to record in the next step."})}),e.jsxs("div",{className:"mt-7 rounded-2xl bg-muted/70 p-6",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:r("wizard.connect.recordingTitle",{defaultValue:"Meeting recordings"})}),e.jsx("p",{className:"mt-2 text-[13px] text-muted-foreground leading-relaxed",children:r("wizard.connect.recordingExplainer",{defaultValue:"Choose the meetings you want to record and receive summaries for in your preferred format. Effortlessly act on sales calls, summarize internal team meetings, document candidate interviews, or distribute notes for all-hands meetings."})})]})]})}function rt({workspaceId:s,accountId:t,onDone:n}){const{t:r}=j("client.meetings"),c=Te(s),[a,x]=i.useState(ie.ALL_MEETINGS);return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("p",{className:"text-[15px] leading-relaxed",children:r("wizard.recording.intro",{defaultValue:"Your meeting bot can now join meetings in your calendar with a video call. Select your preferences on which meetings it joins below."})}),e.jsx(ke,{value:String(a),onValueChange:d=>x(Number(d)),disabled:c.isPending,className:"mt-4 flex flex-col gap-0.5",children:Ee.map(d=>{const p=`wizard:${d.name}`;return e.jsxs(Ce,{htmlFor:p,className:"flex cursor-pointer items-start gap-3 py-2",children:[e.jsx(Ne,{id:p,value:String(d.value),
1className:"mt-0.5"}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-sm font-medium leading-tight",children:r(`accountSettings.modes.${d.name}.label`,{defaultValue:d.defaultLabel})}),e.jsx("span",{className:"text-[13px] text-muted-foreground leading-snug",children:r(`accountSettings.modes.${d.name}.description`,{defaultValue:d.defaultDescription})})]})]},d.name)})}),e.jsx(it,{helper:r("wizard.changeLater",{defaultValue:"You can always change these settings later"}),action:e.jsxs(N,{className:"rounded-full px-6 h-10",onClick:async()=>{try{await c.mutateAsync({accountId:t,recordingMode:a}),n()}catch(d){O.error(r("wizard.recording.error",{defaultValue:"Failed to save recording preferences"})),console.error("UpdateAccountSettings failed",d)}},disabled:c.isPending,children:[c.isPending&&e.jsx(H,{className:"size-4 animate-spin mr-2"}),r("wizard.continue",{defaultValue:"Continue"})]})})]})}function ot({onClose:s}){const{t}=j("client.meetings");return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("p",{className:"text-[15px] leading-relaxed",children:t("wizard.ready.intro",{defaultValue:"You're good to go! You'll find your upcoming and past meetings in the sidebar. To change your meeting bot settings, click the Meeting recorder integration in the connected Integrations list."})}),e.jsx("div",{className:"mt-10 flex items-center justify-end",children:e.jsx(N,{className:"rounded-full px-6 h-10",onClick:s,children:t("wizard.ready.close",{defaultValue:"Close"})})})]})}function it({helper:s,action:t}){return e.jsxs("div",{className:"mt-6 flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-[13px] text-muted-foreground",children:s}),t]})}const ct=new Set([_.ResourceExhausted,_.Unavailable,_.Internal,_.DeadlineExceeded]);function lt(){const{t:s}=j("client.auth"),t=pe(),{mutateAsync:n}=$e(),r=i.useRef(!1),c=i.useRef(null),[a,x]=i.useState(()=>Le()),d=L(m=>m.drawerHostCount),p=i.useCallback(async m=>{try{const l=await n({handoffCode:m}),u={placement:l.placement,source_page:l.sourcePage};if(l.result.case==="project"){t.capturePostHog("guest_handoff_exchanged",{...u,kind:"file",project_id:l.result.value.id}),O.success(s("guestHandoff.projectStarted"));return}if(l.result.case==="youtube"){const g={youtubeId:l.result.value.youtubeId,fromScript:l.result.value.fromScript,toScript:l.result.value.toScript,purpose:l.result.value.purpose};t.capturePostHog("guest_handoff_exchanged",{...u,kind:"youtube"}),Me(g),x(g)}}catch(l){const u=Be.from(l);t.capturePostHog("guest_handoff_failed",{reason:_[u.code]??"Unknown",message:u.rawMessage}),ct.has(u.code)&&De(m),O.error(s("guestHandoff.failed")),L.getState().drawerHostCount>0&&L.getState().setOpen(!0)}},[t,n,s]);return i.useEffect(()=>{if(!c.current){if(r.current)return;const u=Ve();if(!u)return;if(r.current=!0,Ge(u)){p(u);return}c.current=u}const m=c.current,l=window.setTimeout(()=>{c.current=null,O(s("guestHandoff.confirm"),{duration:1/0,closeButton:!0,action:{label:s("guestHandoff.confirmAction"),onClick:()=>{p(m)}}})},0);return()=>window.clearTimeout(l)},[p,s]),i.useEffect(()=>{if(!a||d===0)return;const m=L.getState(),l=a.fromScript,u=a.toScript,g=Qe[a.purpose]??G.SUBTITLE;m.setSelectedScene(g);const h=qe(l);if(h.length>0){const b=h.some(w=>w.id===u),S=g===G.TRANSCRIPT_ONLY||g===G.MEETING,k=b?u:h.length===1?l:h[0]?.id??null,C=b||Ke(u)?null:u;m.setConfig({...m.config,fromScript:l,toScript:k,possibleLanguages:[],translateToScript:S?C:null,additionalTranslationLanguages:!S&&C?[C]:[]})}m.setYoutubeUrl(`https://www.youtube.com/watch?v=${a.youtubeId}`),m.setOpen(!0),He.getState().setPendingYoutubeId(a.youtubeId),x(null)},[a,d]),null}const ut="https://www.trustpilot.com/review/subanana.com";function dt(){const{t:s}=j("client.public-review-ask");return e.jsxs("span",{className:"inline-flex items-center gap-1.5","aria-hidden":!0,children:[e.jsx("svg",{viewBox:"0 0 24 24",className:"size-5 shrink-0",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fill:"#00b67a",d:"M12 1.6 14.74 8.9l7.76.7-5.9 5.05 1.8 7.55L12 18.4l-6.4 3.8 1.8-7.55-5.9-5.05 7.76-.7z"})}),e.jsx("span",{className:"text-sm font-semibold tracking-tight",children:s("PublicReviewAskPanel.brand")})]})}function mt({onWrite:s,onNotNow:t,onClose:n,autoCloseCountdown:r,bottomOffsetPx:c}){const{t:a}=j(["client.public-review-ask","common"]);return e.jsx(Xe,{children:e.jsx(Ze.div,{initial:{opacity:0,y:12,scale:.98}
1,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.98},transition:{duration:.18,ease:"easeOut"},"data-bottom-right-surface":"","data-public-review-ask":"",className:"pointer-events-auto fixed right-[max(1rem,env(safe-area-inset-right))] bottom-[max(1rem,env(safe-area-inset-bottom))] z-[60] w-[calc(100vw-2rem)] max-w-[22rem]",style:c==null?void 0:{bottom:c},children:e.jsx("div",{role:"region","aria-label":a("client.public-review-ask:PublicReviewAskPanel.title"),className:"bg-popover text-popover-foreground relative overflow-hidden rounded-2xl border shadow-lg",children:e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx(dt,{}),e.jsx("h3",{className:"text-base font-semibold text-balance",children:a("client.public-review-ask:PublicReviewAskPanel.title")}),e.jsx("p",{className:"text-muted-foreground text-sm text-pretty",children:a("client.public-review-ask:PublicReviewAskPanel.body")})]}),e.jsx(N,{type:"button",variant:"ghost",size:"icon",className:"size-8 shrink-0 rounded-full","aria-label":a("common:actions.close"),onClick:n,children:e.jsx(Q,{className:"size-4"})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(N,{type:"button",className:"h-11 rounded-xl px-4",onClick:s,children:a("client.public-review-ask:PublicReviewAskPanel.write")}),e.jsx(N,{type:"button",variant:"outline",className:"h-11 rounded-xl px-4",onClick:t,children:a("client.public-review-ask:PublicReviewAskPanel.notNow")})]}),r!=null?e.jsx("p",{className:"text-right text-xs tabular-nums text-muted-foreground",children:a("client.public-review-ask:PublicReviewAskPanel.autoCloseCountdown",{seconds:r})}):null]})})})})}const ft=700,pt=15,gt=400,xt=8e3,ht="[data-bottom-right-surface]",J="[data-bottom-dock]",bt=16;function K(){const s=document.querySelector(J);if(!s)return;const t=s.getBoundingClientRect().height;return t>0?t+bt:void 0}function wt(){return Array.from(document.querySelectorAll(ht)).some(s=>{const t=window.getComputedStyle(s);if(t.display==="none"||t.visibility==="hidden"||Number.parseFloat(t.opacity||"1")===0)return!1;const n=s.getBoundingClientRect();return n.width>0&&n.height>0})}function vt(){const s=$()||ge(),t=q(f=>f.pending),n=q(f=>f.settle),r=Z(),[c,a]=i.useState(!1),[x,d]=i.useState(void 0),[p,m]=i.useState(null),l=i.useRef(t),u=t&&!l.current;l.current=t,u&&c&&a(!1);const g=u?!1:c,h=!s&&g&&t,{data:b,isError:S}=Je({enabled:h}),k=et(),C=i.useRef(k.mutateAsync);C.current=k.mutateAsync;const w=i.useRef(!1);t?h&&b?.show===!0&&(w.current=!0):w.current=!1,i.useEffect(()=>{s&&t&&n()},[s,t,n]),i.useEffect(()=>{t||r.removeQueries({queryKey:U.eligibility})},[t,r]),i.useEffect(()=>{t&&(a(!1),m(null))},[t]),i.useEffect(()=>{if(!t||g||s)return;let f;const o=Date.now(),R=setTimeout(()=>{const E=()=>wt()?Date.now()-o>xt?(n(),!0):!1:(a(!0),!0);E()||(f=setInterval(()=>{E()&&f&&clearInterval(f)},gt))},ft);return()=>{clearTimeout(R),f&&clearInterval(f)}},[g,s,t,n]),i.useEffect(()=>{!t||!g||s||w.current||(S||b?.show===!1)&&n()},[g,b,S,s,t,n]);const v=!s&&t&&g&&w.current;i.useEffect(()=>{if(!v){d(void 0);return}d(K());const f=document.querySelector(J);if(!f||typeof ResizeObserver>"u")return;const o=new ResizeObserver(()=>d(K()));return o.observe(f),()=>o.disconnect()},[v]),i.useEffect(()=>{if(!v){m(null);return}m(pt)},[v]),i.useEffect(()=>{if(p==null)return;if(p<=0){n();return}const f=window.setTimeout(()=>{m(o=>o==null?null:o-1)},1e3);return()=>{window.clearTimeout(f)}},[p,n]);const P=i.useCallback(()=>{n()},[n]),T=i.useCallback(()=>{window.open(ut,"_blank","noopener,noreferrer"),C.current().catch(f=>{console.error("public-review-ask: failed to record the Trustpilot click",f)}),n()},[n]);return v?e.jsx(mt,{onWrite:T,onNotNow:P,onClose:P,autoCloseCountdown:p,bottomOffsetPx:x}):null}const yt=ce({recoverSession:()=>Ye({logtoConfig:V.logto,baseUrl:`/${V.mode}`,app:V.mode})}),fs=async()=>{if(new URLSearchParams(window.location.search).get("redirect_from")==="subper"){const t=parseInt(localStorage.getItem("subanana_subper_visit_count")??"0",10);throw localStorage.setItem("subanana_subper_visit_count",String(t+1)),localStorage.setItem("subanana_redirect_source","subper"),ae("/migration")}return yt()},ps=se(function(){const{t}=j("client.auth"),{shouldBlockRender:n}=le();return n?e.jsx(re,{tips:t("verifying")}):e.jsxs(e.Fragment,{children:[e.jsx(ne,{}),e.jsx(st,{}),e.jsx(lt,{}),e.jsx(Ue,{}),e.jsx(vt,{})]})});export{fs as clientLoader,ps as default};

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.