vibe64 0.1.47 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/run.js +1734 -1687
- package/bin/server.js +75 -75
- package/bin/upgrade-state.js +4539 -4471
- package/dist/assets/GithubBrowserTabs-BwpiRS2u.js +1 -0
- package/dist/assets/{LocalDatabaseServer-6VzPWZxG.js → LocalDatabaseServer-u_Ky7bNS.js} +1 -1
- package/dist/assets/{Vibe64AuthSettingsButton-TLwqAxDo.js → Vibe64AuthSettingsButton-BCwswT1G.js} +1 -1
- package/dist/assets/{Vibe64DashboardShell-B4dQ-oHD.js → Vibe64DashboardShell-CWlgrR2B.js} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-Bh5WIPOj.js → Vibe64DatabaseWorkspace-Dhs8_H0P.js} +1 -1
- package/dist/assets/Vibe64OutputControls-Dn548CZa.js +8 -0
- package/dist/assets/{Vibe64RepositoryWorkspace-idDg94lc.js → Vibe64RepositoryWorkspace-C-8S4JUF.js} +1 -1
- package/dist/assets/{Vibe64SessionFiles-Z9zxosyl.js → Vibe64SessionFiles-Cx6J7DDN.js} +2 -3
- package/dist/assets/{Vibe64UiStoryboardView-CrCDWMdR.js → Vibe64UiStoryboardView-DHyhJiWS.js} +1 -1
- package/dist/assets/{Vibe64UnavailableSessions-TqsxvGSf.js → Vibe64UnavailableSessions-Da4RxIhA.js} +1 -1
- package/dist/assets/{_sessionId_-7F1VGOou.js → _sessionId_-DCpgDPSI.js} +1 -1
- package/dist/assets/_slug_-BbEWp01a.js +25 -0
- package/dist/assets/{_slug_-B16mTWjj.css → _slug_-DerKOisL.css} +1 -1
- package/dist/assets/{access-Cx9RH95J.js → access-D4di2sCr.js} +1 -1
- package/dist/assets/{app-DPx4KKOa.js → app-Adr9Iz8p.js} +1 -1
- package/dist/assets/asyncModuleRecovery-DJsn5NrL.js +1 -0
- package/dist/assets/{changes-DYsuQLFW.js → changes-3Dd1O8Lu.js} +1 -1
- package/dist/assets/client-BAXHGUOC.js +1 -0
- package/dist/assets/{client-BYsDPxR3.js → client-CCZIu6yc.js} +1 -1
- package/dist/assets/{conversation-3ln-WnbL.css → conversation-CSDHdGDb.css} +1 -1
- package/dist/assets/conversation-DG9lp25w.js +8 -0
- package/dist/assets/conversation-ErAO1CmH.js +13 -0
- package/dist/assets/{dashboard-CWswAbYP.js → dashboard-0tCzDYCX.js} +1 -1
- package/dist/assets/english-definitions-DeiQ-jTT.js +1 -0
- package/dist/assets/env-DsyQ2MFX.js +1 -0
- package/dist/assets/{health-C0f6s-G1.js → health-DyTXU-nb.js} +1 -1
- package/dist/assets/{history-BQjETNB9.js → history-BXGAdPMI.js} +1 -1
- package/dist/assets/{incoming-COpY201m.js → incoming-yajkdGBY.js} +1 -1
- package/dist/assets/{index-MWACm8Pp.css → index-B-dukXUB.css} +1 -1
- package/dist/assets/index-CGz4Yow6.js +136 -0
- package/dist/assets/{integrations-BBkvNRHu.js → integrations-BMrXET36.js} +10 -2
- package/dist/assets/issues-kc1XBZCK.js +1 -0
- package/dist/assets/{learning-B8_wHoe1.js → learning-CIE5ghYv.js} +1 -1
- package/dist/assets/linkPath-Ch9eft18.js +1 -0
- package/dist/assets/{placement-DXvgK433.js → placement-BNmlke_j.js} +1 -1
- package/dist/assets/placement-DYM3JJ-F.js +1 -0
- package/dist/assets/publish-DTh6amqi.js +3 -0
- package/dist/assets/pull-requests-CbfGSSIh.js +1 -0
- package/dist/assets/{repository-BNPt7UWc.js → repository-BstMh-bG.js} +1 -1
- package/dist/assets/settings-Bf8C6dls.js +1 -0
- package/dist/assets/{studioGateApi-BVdclhPL.js → studioGateApi-mkX1eOTX.js} +1 -1
- package/dist/assets/{studioUrls-CGKCbM_d.js → studioUrls-B0-GdWh8.js} +1 -1
- package/dist/assets/useArchivedVibe64Sessions-DIOpfUxD.js +1 -0
- package/dist/assets/useCommand-CVuya6vG.js +1 -0
- package/dist/assets/useEndpointResource-7-YDfAxX.js +1 -0
- package/dist/assets/usePaths-Y6UuQxmI.js +1 -0
- package/dist/assets/{useUiFeedback-B51xtCAK.js → useUiFeedback-Bd3rao6E.js} +1 -1
- package/dist/assets/useVibe64ConversationLog-ChJOU2SD.js +1 -0
- package/dist/assets/{useVibe64DatabaseTools-BE_yXZFn.js → useVibe64DatabaseTools-DKV-TeNJ.js} +1 -1
- package/dist/assets/{useVibe64ProjectScope-D7b8n1gx.js → useVibe64ProjectScope-DXjsKKhl.js} +1 -1
- package/dist/assets/useVibe64SessionData-BkIHUrP5.js +1 -0
- package/dist/assets/useVibe64SessionSelection-N8wX5oqo.js +1 -0
- package/dist/assets/{useVibe64SystemGraph-CDDcsye4.js → useVibe64SystemGraph-Db_eD-X8.js} +1 -1
- package/dist/assets/{useVibe64Terminal-Zr3Mig2L.js → useVibe64Terminal-B9EWJ9Ba.js} +2 -2
- package/dist/assets/vibe64ProjectScope.local-l5_-E6pq.js +1 -0
- package/dist/assets/vibe64RepositoryRealtime-CHT4-6VN.js +1 -0
- package/dist/assets/vibe64SessionFocus-CS6Ex53G.js +1 -0
- package/dist/assets/vibe64SessionFocus-CSm4YJQD.css +1 -0
- package/dist/assets/vibe64SessionRequestConfig-xIx-5jxQ.js +1 -0
- package/dist/index.html +26 -22
- package/docs/colleague-usage/ai-accounts.md +6 -2
- package/docs/colleague-usage/ai-balance-and-allowance.md +15 -2
- package/docs/colleague-usage/coding-agent-failures.md +2 -1
- package/docs/colleague-usage/coding-agent-goals.md +8 -3
- package/docs/colleague-usage/coding-agents.md +16 -0
- package/docs/colleague-usage/github-work.md +14 -0
- package/docs/colleague-usage/preview-browser-checks.md +5 -3
- package/docs/colleague-usage/project-setup.md +6 -3
- package/docs/colleague-usage/running-vibe64-on-your-computer.md +3 -1
- package/docs/colleague-usage/sessions.md +35 -7
- package/docs/colleague-usage/starter-apps.md +3 -0
- package/docs/colleague-usage/temporary-chat-context.md +2 -1
- package/docs/colleague-usage/temporary-chats.md +17 -5
- package/node_modules/@jskit-ai/assistant-core/CHANGELOG.md +539 -0
- package/node_modules/@jskit-ai/assistant-core/locales/en.json +383 -0
- package/node_modules/@jskit-ai/assistant-core/package.json +3 -2
- package/node_modules/@jskit-ai/assistant-runtime/CHANGELOG.md +138 -0
- package/node_modules/@jskit-ai/assistant-runtime/README.md +2 -1
- package/node_modules/@jskit-ai/assistant-runtime/locales/en.json +137 -0
- package/node_modules/@jskit-ai/assistant-runtime/package.json +3 -2
- package/node_modules/@jskit-ai/assistant-runtime/src/server/repositories/assistantConfigRepository.js +223 -203
- package/node_modules/@jskit-ai/assistant-runtime/src/server/repositories/conversationsRepository.js +286 -266
- package/node_modules/@jskit-ai/assistant-runtime/src/server/repositories/messagesRepository.js +270 -250
- package/node_modules/@jskit-ai/assistant-voice/locales/en.json +182 -0
- package/node_modules/@jskit-ai/assistant-voice/package.json +3 -2
- package/node_modules/@jskit-ai/connector-google-calendar/CHANGELOG.md +83 -0
- package/node_modules/@jskit-ai/connector-google-calendar/locales/en.json +91 -0
- package/node_modules/@jskit-ai/connector-google-calendar/package.json +4 -3
- package/node_modules/@jskit-ai/connectors-catalog/CHANGELOG.md +1722 -0
- package/node_modules/@jskit-ai/connectors-catalog/README.md +11 -0
- package/node_modules/@jskit-ai/connectors-catalog/locales/en.json +3139 -0
- package/node_modules/@jskit-ai/connectors-catalog/package.json +5 -4
- package/node_modules/@jskit-ai/connectors-core/CHANGELOG.md +183 -0
- package/node_modules/@jskit-ai/connectors-core/locales/en.json +92 -0
- package/node_modules/@jskit-ai/connectors-core/package.json +3 -2
- package/node_modules/@jskit-ai/http-runtime/CHANGELOG.md +31 -0
- package/node_modules/@jskit-ai/http-runtime/locales/en.json +14 -0
- package/node_modules/@jskit-ai/http-runtime/package.json +3 -2
- package/node_modules/@jskit-ai/kernel/CHANGELOG.md +182 -0
- package/node_modules/@jskit-ai/kernel/locales/en.json +94 -0
- package/node_modules/@jskit-ai/kernel/package.json +6 -2
- package/node_modules/@jskit-ai/payments-core/CHANGELOG.md +128 -0
- package/node_modules/@jskit-ai/payments-core/locales/en.json +77 -0
- package/node_modules/@jskit-ai/payments-core/package.json +3 -2
- package/node_modules/@jskit-ai/realtime/CHANGELOG.md +20 -0
- package/node_modules/@jskit-ai/realtime/locales/en.json +14 -0
- package/node_modules/@jskit-ai/realtime/package.json +3 -2
- package/node_modules/@jskit-ai/resource-core/package.json +1 -1
- package/node_modules/@jskit-ai/resource-crud-core/package.json +1 -1
- package/node_modules/@jskit-ai/uploads-runtime/CHANGELOG.md +35 -0
- package/node_modules/@jskit-ai/uploads-runtime/locales/en.json +15 -0
- package/node_modules/@jskit-ai/uploads-runtime/package.json +3 -2
- package/node_modules/@local/vibe64-execution/src/host/execHelper.js +49 -48
- package/node_modules/@local/vibe64-execution/src/server/gitTurnCheckpointCommand.js +1327 -0
- package/node_modules/@local/vibe64-genesis/bin/vibe64-genesis-host-context +430 -390
- package/node_modules/@local/vibe64-genesis/src/server/index.js +45 -45
- package/node_modules/@local/vibe64-genesis/src/server/promptContext.js +119 -119
- package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProcess.js +57 -57
- package/node_modules/@local/vibe64-sessions/package.json +2 -1
- package/node_modules/@local/vibe64-terminals/src/server/opencodeSessionEnvironmentPlugin.js +195 -175
- package/node_modules/@local/vibe64-terminals/src/server/sessionWorkOperationCommand.js +1385 -1362
- package/package.json +15 -15
- package/server.bundle.mjs +44206 -42825
- package/dist/assets/GithubBrowserTabs-D-Z3TlA8.js +0 -1
- package/dist/assets/Vibe64OutputControls-DtybwgL3.js +0 -8
- package/dist/assets/_slug_-Bq84T_Iv.js +0 -24
- package/dist/assets/conversation-Bn7wpATa.js +0 -2
- package/dist/assets/conversation-CNcCrV-R.js +0 -16
- package/dist/assets/definitions-CEbi4qae.js +0 -1
- package/dist/assets/env-X7EOFLtl.js +0 -1
- package/dist/assets/index-CBo1BEk6.js +0 -138
- package/dist/assets/issues-BiSiUd5o.js +0 -1
- package/dist/assets/placement-B5T1LR7m.js +0 -1
- package/dist/assets/publish-CeLZE2AG.js +0 -3
- package/dist/assets/pull-requests-pTdQOT7i.js +0 -1
- package/dist/assets/settings-lecRzZ-r.js +0 -1
- package/dist/assets/useArchivedVibe64Sessions-DHYRnyJD.js +0 -1
- package/dist/assets/useCommand-Epd2yHhQ.js +0 -1
- package/dist/assets/useEndpointResource-DBRQISI_.js +0 -1
- package/dist/assets/usePaths-DdAnjVDj.js +0 -1
- package/dist/assets/useVibe64ConversationLog-DboM3tYN.js +0 -1
- package/dist/assets/useVibe64SessionData-CreWtQAO.js +0 -1
- package/dist/assets/useVibe64SessionSelection-CDaX4uwY.js +0 -1
- package/dist/assets/vibe64ProjectScope.local-BxTBYuRg.js +0 -1
- package/dist/assets/vibe64RepositoryRealtime-C-J0I5jY.js +0 -1
- package/dist/assets/vibe64SessionFocus-DSW5Irm6.css +0 -1
- package/dist/assets/vibe64SessionFocus-DzqbVq60.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as createVNode,E as createTextVNode,Ht as watch,On as unref,Pt as useId,St as resolveComponent,_ as createBaseVNode,b as createElementBlock,bt as renderList,et as mergeProps,g as computed,gn as reactive,mt as openBlock,o as Fragment,qt as withCtx,tr as toDisplayString,tt as nextTick,un as isRef,v as createBlock,vn as ref,xn as shallowRef,xt as renderSlot,y as createCommentVNode}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{_ as VIcon,cr as withKeys,lr as withModifiers,t as VAvatar}from"./VAvatar-H2hyOWlB.js";import{J as useQueryClient,t as useEndpointResource}from"./useEndpointResource-DBRQISI_.js";import{_ as useRouter,g as useRoute}from"./useApi-BPuI6ZR9-CFWU1m37.js";import{o as projectSlugFromRoute,r as projectAppPath}from"./vibe64ProjectScope.local-BxTBYuRg.js";import{t as VOverlay}from"./VOverlay-Bi97WKy3.js";import{c as VListItemTitle,l as VListItemSubtitle,n as VList,s as VListItem}from"./VMenu-DnhVIMrr.js";import{t as VChip}from"./VChip-Uixfx461.js";import{g as VCheckboxBtn,t as VTextField}from"./VTextField-CnkGeXaT.js";import{r as scopedDevelopmentApiUrl}from"./studioUrls-CGKCbM_d.js";import{C as mdiArrowRight,Jn as mdiPlus,L as mdiCheck,Rn as mdiOpenInNew,Un as mdiPencilOutline,X as mdiClose,Zn as mdiRecordCircleOutline,er as mdiRefresh,kn as mdiMagnify,on as mdiLabelOutline,ot as mdiCommentOutline,rr as mdiRestore}from"./mdi-X9prU-DG.js";import{i as VBtnToggle,t as VBtn}from"./VBtn-Sj5jAuOx.js";import{t as VAlert}from"./VAlert-7_VM9EUm.js";import{t as VAutocomplete}from"./VAutocomplete-Ck14ZtUL.js";import{t as VDivider}from"./VDivider-AUQb_N9d.js";import{t as VSheet}from"./VSheet-CMhyReNa.js";import{t as VDialog}from"./VDialog-Drp3yzSH.js";import{i as VCardTitle,n as VCardText,o as VCardActions,t as VCard}from"./VCard-DExT9Cji.js";import{t as VSpacer}from"./VSpacer-BSTt0_VA.js";import{t as VSkeletonLoader}from"./VSkeletonLoader-pc4bBTxv.js";import{t as VTextarea}from"./VTextarea-wqoRFl1K.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{t as useUiFeedback}from"./useUiFeedback-B51xtCAK.js";import{n as vibe64RealtimeOriginPayload}from"./vibe64BrowserTabOrigin-SF9E31vi.js";import{m as GithubMarkdown_default}from"./index-CBo1BEk6.js";import{t as Vibe64DashboardBackButton_default}from"./Vibe64DashboardBackButton-CE9ig_nO.js";import{a as githubProjectRepositoryName,i as githubProjectAvailable,n as githubIssueLabelsPath,o as invalidateGithubIssueQueries,r as githubIssueMentionsPath,t as GITHUB_BODY_MAX_LENGTH}from"./vibe64GithubProject-Bct-bzKq.js";import{t as _sfc_main$8}from"./GithubBrowserTabs-D-Z3TlA8.js";var drafts=reactive(new Map);var submittedComments=reactive(new Map);function useVibe64Issues(context){const route=useRoute();const router=useRouter();const queryClient=useQueryClient();const feedback=useUiFeedback({source:`vibe64.issues`});const projectSlug=computed(()=>projectSlugFromRoute(route));const repository=computed(()=>githubProjectRepositoryName(context.value.projectContext));const available=computed(()=>githubProjectAvailable(context.value.projectContext));const active=computed(()=>available.value&&context.value.active!==false);const basePath=computed(()=>scopedDevelopmentApiUrl(`/api/vibe64/issues`,projectSlug.value));const state=computed(()=>[`open`,`closed`,`all`].includes(route.query.issueState)?route.query.issueState:`open`);const search=computed(()=>typeof route.query.issueSearch===`string`?route.query.issueSearch:``);const searchDraft=ref(search.value);watch(search,value=>{searchDraft.value=value});const selectedLabels=computed(()=>{const labels=route.query.issueLabel;return(Array.isArray(labels)?labels:[labels]).filter(label=>typeof label===`string`&&label.trim())});const number=computed(()=>/^\d+$/u.test(String(route.query.issue||``))?String(route.query.issue):``);const commentCursor=ref(``);watch([basePath,number],()=>{commentCursor.value=``});const listQuery=computed(()=>({state:state.value,search:search.value,labels:selectedLabels.value,...route.query.issueCursor?{cursor:route.query.issueCursor}:{}}));const listKey=computed(()=>[`vibe64.issues`,basePath.value,listQuery.value]);const list=useEndpointResource({path:basePath,readQuery:listQuery,queryKey:listKey,enabled:computed(()=>active.value&&!number.value),queryOptions:{retry:false},requestRecoveryLabel:`GitHub issues`,fallbackLoadError:`Issues could not load.`});const labelsPath=computed(()=>githubIssueLabelsPath(basePath.value));const labelCatalog=useEndpointResource({path:labelsPath,queryKey:computed(()=>[`vibe64.issueLabels`,labelsPath.value]),enabled:computed(()=>active.value&&!number.value),queryOptions:{retry:false},fallbackLoadError:`Labels could not load.`});const detailPath=computed(()=>`${basePath.value}/${number.value}`);const detail=useEndpointResource({path:detailPath,readQuery:computed(()=>commentCursor.value?{cursor:commentCursor.value}:{}),queryKey:computed(()=>[`vibe64.issue`,detailPath.value,commentCursor.value]),enabled:computed(()=>active.value&&Boolean(number.value)),queryOptions:{retry:false},requestRecoveryLabel:`GitHub issue`,fallbackLoadError:`This issue could not load.`});const issue=computed(()=>detail.data.value?.issue||null);const draft=computed({get:()=>drafts.get(detailPath.value)||``,set:value=>value?drafts.set(detailPath.value,value):drafts.delete(detailPath.value)});const stateRequestPath=ref(``);const localComments=computed(()=>submittedComments.get(detailPath.value)||[]);const savedComments=computed(()=>issue.value?.comments?.nodes||[]);const savedCommentIds=computed(()=>new Set(savedComments.value.map(comment=>comment.id)));const comments=computed(()=>[...savedComments.value,...localComments.value.filter(comment=>!savedCommentIds.value.has(comment.id)&&(comment.delivery!==`sent`||!commentCursor.value))]);const commentCount=computed(()=>(issue.value?.comments?.totalCount||0)+comments.value.length-savedComments.value.length);const pending=computed(()=>{if(stateRequestPath.value===detailPath.value)return`state`;return localComments.value.some(comment=>comment.delivery===`sending`)?`comment`:``});watch([detail.data,detailPath,commentCursor],()=>{if(commentCursor.value||issue.value?.number!==Number(number.value))return;const remaining=localComments.value.filter(comment=>comment.delivery!==`sent`||!savedCommentIds.value.has(comment.id));if(remaining.length)submittedComments.set(detailPath.value,remaining);else submittedComments.delete(detailPath.value)},{immediate:true});function navigate(changes){return router.push({query:{...route.query,...changes}})}function filter(nextState=state.value,nextLabels=selectedLabels.value){return navigate({issueState:nextState,issueSearch:String(searchDraft.value||``).trim()||void 0,issueLabel:nextLabels?.length?nextLabels:void 0,issueCursor:void 0,issue:void 0})}function filterLabel(label){searchDraft.value=`label:${/[\s"\\]/u.test(label)?JSON.stringify(label):label}`;return filter(state.value,[])}function issueUpdated({number:issueNumber,basePath:requestBasePath}){return invalidateGithubIssueQueries(queryClient,requestBasePath,`${requestBasePath}/${issueNumber}`)}async function issueSaved({number:issueNumber,basePath:requestBasePath}){await issueUpdated({number:issueNumber,basePath:requestBasePath});if(basePath.value===requestBasePath)await navigate({issue:String(issueNumber)})}async function mutate(kind){if(pending.value||issue.value?.number!==Number(number.value)||!active.value)return;const requestBasePath=basePath.value;const requestPath=detailPath.value;if(kind===`comment`){const submitted=draft.value;if(!submitted.trim()||submitted.length>65536)return;const comment=reactive({id:crypto.randomUUID(),body:submitted,createdAt:new Date().toISOString(),author:{login:`You`},delivery:`sending`,error:``});submittedComments.set(requestPath,[...localComments.value,comment]);drafts.delete(requestPath);commentCursor.value=``;return sendComment(comment,requestBasePath,requestPath)}stateRequestPath.value=requestPath;try{await detail.save({state:issue.value.state===`OPEN`?`closed`:`open`},{path:requestPath,method:`PATCH`});if(detailPath.value===requestPath)commentCursor.value=``;feedback.success(`Issue updated.`);await invalidateGithubIssueQueries(queryClient,requestBasePath,requestPath)}catch(error){feedback.error(error,`Issue could not be updated.`)}finally{stateRequestPath.value=``}}async function sendComment(comment,requestBasePath,requestPath){comment.delivery=`sending`;comment.error=``;try{const result=await detail.save(vibe64RealtimeOriginPayload({body:comment.body}),{path:`${requestPath}/comments`,method:`POST`});Object.assign(comment,result.comment,{delivery:`sent`})}catch(error){comment.delivery=`failed`;feedback.error(error,`Comment could not be confirmed. Refresh before posting again.`);comment.error=feedback.message.value;return}feedback.success(`Comment added.`);try{await invalidateGithubIssueQueries(queryClient,requestBasePath,requestPath)}catch(error){feedback.error(error,`Comment added, but the conversation could not refresh.`)}}function retryComment(id){const comment=localComments.value.find(entry=>entry.id===id);if(pending.value||!active.value||comment?.delivery!==`failed`)return;commentCursor.value=``;return sendComment(comment,basePath.value,detailPath.value)}return{available,repository,projectSlug,basePath,list,detail,labelCatalog,issue,number,state,searchDraft,selectedLabels,draft,pending,comments,commentCount,commentCursor,navigate,filter,filterLabel,mutate,issueSaved,issueUpdated,retryComment}}var _hoisted_1$6={class:`github-label-name`};var _sfc_main$7={__name:`GithubLabelChip`,props:{label:{type:Object,required:true}},setup(__props){const props=__props;const color=computed(()=>/^[a-f\d]{6}$/iu.test(props.label.color||``)?`#${props.label.color}`:void 0);return(_ctx,_cache)=>{return openBlock(),createBlock(VChip,{color:color.value,title:__props.label.description||__props.label.name,"aria-label":__props.label.name,variant:`flat`,size:`small`},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$6,toDisplayString(__props.label.name),1)]),_:1},8,[`color`,`title`,`aria-label`])}}};var GithubLabelChip_default=_plugin_vue_export_helper_default(_sfc_main$7,[[`__scopeId`,`data-v-9814070c`]]);var _hoisted_1$5={class:`d-flex align-center justify-space-between ga-3 pa-5 pb-2`};var _hoisted_2$4={class:`new-label__colours`};var _hoisted_3$3={class:`new-label__palette`};var _hoisted_4$2={class:`d-flex align-start ga-3`};var _hoisted_5$2=[`value`,`disabled`];var defaultColor=`0075ca`;var _sfc_main$6={__name:`GithubNewLabelButton`,props:{basePath:{type:String,required:true},labels:{type:Array,required:true},disabled:Boolean},emits:[`created`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const palette=[{name:`Red`,color:`d73a4a`},{name:`Orange`,color:`e9963a`},{name:`Yellow`,color:`f9d65c`},{name:`Green`,color:`4c956c`},{name:`Teal`,color:`008672`},{name:`Blue`,color:`0075ca`},{name:`Purple`,color:`8957e5`},{name:`Pink`,color:`db61a2`}];const open=ref(false);const name=ref(``);const color=ref(defaultColor);const pending=ref(false);const trimmedName=computed(()=>name.value.trim());const normalizedColor=computed(()=>color.value.trim().replace(/^#/u,``).toLowerCase());const validColor=computed(()=>/^[a-f\d]{6}$/u.test(normalizedColor.value));const nameError=computed(()=>{if(/\p{Cc}/u.test(name.value)||trimmedName.value.length>50)return`Use up to 50 characters, on one line.`;return props.labels.some(label=>label.name.toLowerCase()===trimmedName.value.toLowerCase())?`A label with this name already exists.`:``});const preview=computed(()=>({name:trimmedName.value||`Your label`,color:validColor.value?normalizedColor.value:defaultColor}));const canSubmit=computed(()=>!props.disabled&&!pending.value&&Boolean(trimmedName.value)&&!nameError.value&&validColor.value);const labelsPath=computed(()=>githubIssueLabelsPath(props.basePath));const resource=useEndpointResource({path:labelsPath,enabled:false,queryKey:computed(()=>[`vibe64.newLabel`,labelsPath.value])});const queryClient=useQueryClient();const feedback=useUiFeedback({source:`vibe64.issues.newLabel`});watch(open,value=>{if(!value)return;name.value=``;color.value=defaultColor});watch(()=>props.basePath,()=>{open.value=false});async function submit(){if(!canSubmit.value)return;const requestPath=labelsPath.value;pending.value=true;let result;try{result=await resource.save({name:trimmedName.value,color:normalizedColor.value},{path:requestPath,method:`POST`})}catch(error){feedback.error(error,`Label could not be created. Your choices have been kept.`);pending.value=false;return}const queryKey=[`vibe64.issueLabels`,requestPath];await queryClient.cancelQueries({queryKey});queryClient.setQueryData(queryKey,catalog=>{if(!catalog)return catalog;const createdName=result.label.name.toLowerCase();const labels=catalog.labels.filter(label=>label.name.toLowerCase()!==createdName);labels.push(result.label);labels.sort((a,b)=>a.name.localeCompare(b.name));return{...catalog,labels}});feedback.success(`Label created.`);if(requestPath===labelsPath.value){open.value=false;emit(`created`,result.label)}pending.value=false}return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[createVNode(VBtn,{"prepend-icon":unref(mdiPlus),color:`primary`,variant:`text`,height:`48`,disabled:__props.disabled||pending.value,onClick:_cache[0]||(_cache[0]=$event=>open.value=true)},{default:withCtx(()=>[..._cache[7]||(_cache[7]=[createTextVNode(`New label`,-1)])]),_:1},8,[`prepend-icon`,`disabled`]),createVNode(VDialog,{modelValue:open.value,"onUpdate:modelValue":_cache[6]||(_cache[6]=$event=>open.value=$event),"max-width":`30rem`,scrollable:``,persistent:pending.value,"aria-label":`New label`},{default:withCtx(()=>[createVNode(VCard,{tag:`form`,rounded:`xl`,onSubmit:withModifiers(submit,[`prevent`,`stop`])},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$5,[_cache[8]||(_cache[8]=createBaseVNode(`h2`,{class:`text-title-large`},`New label`,-1)),createVNode(VBtn,{icon:unref(mdiClose),variant:`text`,size:`48`,"aria-label":`Close new label`,disabled:pending.value,onClick:_cache[1]||(_cache[1]=$event=>open.value=false)},null,8,[`icon`,`disabled`])]),createVNode(VCardText,{class:`d-flex flex-column ga-4`},{default:withCtx(()=>[createVNode(VSheet,{color:`surface-light`,rounded:`lg`,class:`pa-4 d-flex flex-column align-center ga-2`},{default:withCtx(()=>[_cache[9]||(_cache[9]=createBaseVNode(`span`,{class:`text-label-small text-medium-emphasis`},`Preview`,-1)),createVNode(GithubLabelChip_default,{label:preview.value,class:`new-label__preview`},null,8,[`label`])]),_:1}),createVNode(VTextField,{modelValue:name.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>name.value=$event),label:`Label name`,placeholder:`e.g. Ready for review`,variant:`outlined`,maxlength:`50`,autofocus:``,disabled:pending.value,"error-messages":nameError.value,"hide-details":`auto`},null,8,[`modelValue`,`disabled`,`error-messages`]),createBaseVNode(`fieldset`,_hoisted_2$4,[_cache[10]||(_cache[10]=createBaseVNode(`legend`,{class:`text-label-large mb-2`},`Colour`,-1)),createBaseVNode(`div`,_hoisted_3$3,[(openBlock(),createElementBlock(Fragment,null,renderList(palette,swatch=>{return createVNode(VBtn,{key:swatch.color,color:`#${swatch.color}`,variant:`flat`,icon:``,size:`48`,"aria-label":swatch.name,"aria-pressed":normalizedColor.value===swatch.color,disabled:pending.value,onClick:$event=>color.value=swatch.color},{default:withCtx(()=>[normalizedColor.value===swatch.color?(openBlock(),createBlock(VIcon,{key:0,icon:unref(mdiCheck)},null,8,[`icon`])):createCommentVNode(``,true)]),_:2},1032,[`color`,`aria-label`,`aria-pressed`,`disabled`,`onClick`])}),64))])]),createBaseVNode(`div`,_hoisted_4$2,[createBaseVNode(`input`,{type:`color`,value:`#${preview.value.color}`,class:`new-label__custom`,"aria-label":`Custom colour`,title:`Choose a custom colour`,disabled:pending.value,onInput:_cache[3]||(_cache[3]=$event=>color.value=$event.target.value.slice(1))},null,40,_hoisted_5$2),createVNode(VTextField,{modelValue:color.value,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>color.value=$event),label:`Hex colour`,prefix:`#`,variant:`outlined`,density:`compact`,maxlength:`7`,disabled:pending.value,"error-messages":validColor.value?[]:`Use six characters: 0–9 or A–F.`,"hide-details":`auto`,autocomplete:`off`,spellcheck:`false`},null,8,[`modelValue`,`disabled`,`error-messages`])]),_cache[11]||(_cache[11]=createBaseVNode(`p`,{class:`text-body-small text-medium-emphasis ma-0`},`Available to all issues in this repository.`,-1))]),_:1}),createVNode(VCardActions,{class:`pa-5 pt-2`},{default:withCtx(()=>[createVNode(VSpacer),createVNode(VBtn,{variant:`text`,height:`48`,disabled:pending.value,onClick:_cache[5]||(_cache[5]=$event=>open.value=false)},{default:withCtx(()=>[..._cache[12]||(_cache[12]=[createTextVNode(`Cancel`,-1)])]),_:1},8,[`disabled`]),createVNode(VBtn,{type:`submit`,color:`primary`,variant:`flat`,rounded:`pill`,height:`48`,disabled:!canSubmit.value,"aria-busy":pending.value},{default:withCtx(()=>[createTextVNode(toDisplayString(pending.value?`Creating…`:`Create label`),1)]),_:1},8,[`disabled`,`aria-busy`])]),_:1})]),_:1})]),_:1},8,[`modelValue`,`persistent`])],64)}}};var GithubNewLabelButton_default=_plugin_vue_export_helper_default(_sfc_main$6,[[`__scopeId`,`data-v-82e5afdc`]]);var _hoisted_1$4={key:1,class:`text-body-medium pa-3 ma-0`,role:`status`};var _hoisted_2$3={key:2,class:`pa-3 text-body-small`,role:`status`};var _sfc_main$5=Object.assign({inheritAttrs:false},{__name:`GithubMentionTextarea`,props:{modelValue:{type:String,default:``},basePath:{type:String,required:true},issue:{type:Object,default:null},enabled:{type:Boolean,default:true},disabled:Boolean},emits:[`update:modelValue`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const field=ref(null);const mention=ref(null);const selected=ref(0);const listId=`github-mentions-${useId()}`;const path=computed(()=>githubIssueMentionsPath(props.basePath));const number=computed(()=>props.issue?.number||null);const catalog=useEndpointResource({path,readQuery:computed(()=>number.value?{number:number.value}:{}),queryKey:computed(()=>[`vibe64.issueMentions`,path.value,number.value]),enabled:computed(()=>props.enabled),queryOptions:{retry:false,staleTime:6e4},requestRecovery:false,fallbackLoadError:`Mention suggestions could not load. You can still type any @username.`});const people=computed(()=>{const users=new Map;for(const user of[props.issue?.author,...(props.issue?.comments?.nodes||[]).map(comment=>comment.author),...catalog.data.value?.users||[]])if(user?.login)users.set(user.login.toLowerCase(),user);return[...users.values()]});const suggestions=computed(()=>{const query=mention.value?.query.toLowerCase()||``;return people.value.filter(user=>user.login.toLowerCase().includes(query)||user.name?.toLowerCase().includes(query)).sort((a,b)=>{const aStartsWithQuery=a.login.toLowerCase().startsWith(query);const bStartsWithQuery=b.login.toLowerCase().startsWith(query);return Number(bStartsWithQuery)-Number(aStartsWithQuery)||a.login.localeCompare(b.login)}).slice(0,8)});const open=computed(()=>Boolean(mention.value)&&props.enabled&&!props.disabled);const warning=computed(()=>catalog.loadError.value||catalog.data.value?.warning||``);watch([path,number,()=>props.enabled,()=>props.disabled],()=>{mention.value=null});watch(suggestions,()=>{selected.value=0});function updateMention(event){const input=event.target;if(input.tagName!==`TEXTAREA`)return;if(event.isComposing||input.selectionStart!==input.selectionEnd){mention.value=null;return}const end=input.selectionStart;const match=input.value.slice(0,end).match(/(?:^|[\s([{])@([a-z\d-]*)$/iu);mention.value=match?{start:end-match[1].length-1,end,query:match[1]}:null}async function choose(user){if(!mention.value||!user||props.disabled)return;const input=field.value?.$el.querySelector(`textarea`);if(!input)return;const{start,end}=mention.value;const after=input.value.slice(end).replace(/^[a-z\d-]*/iu,``);const insertion=`@${user.login}${/^\s/u.test(after)?``:` `}`;const value=input.value.slice(0,start)+insertion+after;if(input.maxLength>=0&&value.length>input.maxLength)return;const caret=start+insertion.length+(after.startsWith(` `)?1:0);emit(`update:modelValue`,value);mention.value=null;await nextTick();input.focus();input.setSelectionRange(caret,caret)}async function onKeydown(event){if(!open.value||event.isComposing||event.keyCode===229)return;const moveSelection=suggestions.value.length>0&&[`ArrowDown`,`ArrowUp`].includes(event.key);const acceptSelection=suggestions.value.length>0&&(event.key===`Enter`||event.key===`Tab`&&!event.shiftKey);if(event.key!==`Escape`&&!moveSelection&&!acceptSelection)return;event.preventDefault();event.stopPropagation();if(event.key===`Escape`)mention.value=null;else if(moveSelection){selected.value=(selected.value+(event.key===`ArrowDown`?1:-1)+suggestions.value.length)%suggestions.value.length;await nextTick();document.getElementById(`${listId}-${selected.value}`)?.scrollIntoView({block:`nearest`})}else await choose(suggestions.value[selected.value])}return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[createVNode(VTextarea,mergeProps({ref_key:`field`,ref:field},_ctx.$attrs,{"model-value":__props.modelValue,disabled:__props.disabled,hint:`Markdown supported · Type @ to mention someone`,"persistent-hint":``,"aria-autocomplete":`list`,"aria-expanded":open.value,"aria-controls":open.value?listId:void 0,"aria-activedescendant":open.value&&suggestions.value.length?`${listId}-${selected.value}`:void 0,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>emit(`update:modelValue`,$event)),onInput:updateMention,onClick:updateMention,onFocus:updateMention,onSelect:updateMention,onCompositionstart:_cache[1]||(_cache[1]=$event=>mention.value=null),onCompositionend:updateMention,onBlur:_cache[2]||(_cache[2]=$event=>mention.value=null),onKeydown,onKeyup:_cache[3]||(_cache[3]=$event=>[`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes($event.key)&&updateMention($event))}),null,16,[`model-value`,`disabled`,`aria-expanded`,`aria-controls`,`aria-activedescendant`]),createVNode(VOverlay,{"model-value":open.value,target:field.value?.$el,"location-strategy":`connected`,location:`top start`,origin:`bottom start`,"scroll-strategy":`reposition`,scrim:false,"close-on-back":false,"capture-focus":false,"retain-focus":false,width:`360`,"max-width":`calc(100vw - 32px)`,"onUpdate:modelValue":_cache[7]||(_cache[7]=$event=>!$event&&(mention.value=null))},{default:withCtx(()=>[createVNode(VSheet,{rounded:`lg`,border:``,elevation:`3`,class:`overflow-y-auto`,"max-height":`320`},{default:withCtx(()=>[createVNode(VList,{id:listId,role:`listbox`,"aria-label":`Mention suggestions`,density:`compact`,class:`pa-1`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(suggestions.value,(user,index)=>{return openBlock(),createBlock(VListItem,{id:`${listId}-${index}`,key:user.login,tag:`button`,type:`button`,role:`option`,tabindex:`-1`,"aria-selected":index===selected.value,active:index===selected.value,title:`@${user.login}`,subtitle:user.name||void 0,"min-height":`48`,class:`w-100 text-left`,onPointerdown:_cache[4]||(_cache[4]=withModifiers(()=>{},[`prevent`])),onClick:$event=>choose(user)},null,8,[`id`,`aria-selected`,`active`,`title`,`subtitle`,`onClick`])}),128))]),_:1}),unref(catalog).isInitialLoading.value?(openBlock(),createBlock(VSkeletonLoader,{key:0,type:`list-item`,height:`48`,"aria-label":`Loading mention suggestions`,"aria-busy":`true`})):!suggestions.value.length&&!warning.value?(openBlock(),createElementBlock(`p`,_hoisted_1$4,`No matching people`)):createCommentVNode(``,true),warning.value?(openBlock(),createElementBlock(`div`,_hoisted_2$3,[createTextVNode(toDisplayString(warning.value)+` `,1),createVNode(VBtn,{variant:`text`,height:`48`,disabled:unref(catalog).isFetching.value,onPointerdown:_cache[5]||(_cache[5]=withModifiers(()=>{},[`prevent`])),onClick:_cache[6]||(_cache[6]=$event=>unref(catalog).reload())},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(`Retry`,-1)])]),_:1},8,[`disabled`])])):createCommentVNode(``,true)]),_:1})]),_:1},8,[`model-value`,`target`])],64)}}});var _hoisted_1$3={class:`d-flex align-center justify-space-between ga-3 pa-5 pb-2`};var _hoisted_2$2={class:`d-flex align-center ga-3`};var _hoisted_3$2={class:`text-title-large`};var _hoisted_4$1={key:0,class:`text-body-medium ma-0`};var _hoisted_5$1={class:`d-flex flex-wrap justify-space-between ga-2`};var _sfc_main$4={__name:`GithubIssueEditorDialog`,props:{modelValue:Boolean,basePath:{type:String,required:true},issue:{type:Object,default:null},mode:{type:String,default:`create`}},emits:[`update:modelValue`,`saved`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const editing=computed(()=>props.mode!==`create`);const editingLabels=computed(()=>props.mode===`labels`);const heading=computed(()=>editingLabels.value?`Edit labels`:editing.value?`Edit issue`:`New issue`);const title=ref(``);const body=ref(``);const selectedLabels=ref([]);const pending=ref(false);const feedback=useUiFeedback({source:`vibe64.issues.editor`});const labelsPath=computed(()=>githubIssueLabelsPath(props.basePath));const catalog=useEndpointResource({path:labelsPath,queryKey:computed(()=>[`vibe64.issueLabels`,labelsPath.value]),enabled:computed(()=>props.modelValue&&props.mode!==`content`),queryOptions:{retry:false},fallbackLoadError:`Labels could not load.`});const labels=computed(()=>catalog.data.value?.labels||[]);const canSetLabels=computed(()=>{const permission=editing.value?`canEditLabels`:`canCreateWithLabels`;return catalog.data.value?.[permission]===true});const path=computed(()=>editing.value?`${props.basePath}/${props.issue.number}${editingLabels.value?`/labels`:``}`:props.basePath);const resource=useEndpointResource({path,queryKey:computed(()=>[`vibe64.issueEditor`,path.value]),enabled:false});const canSubmit=computed(()=>{if(pending.value||selectedLabels.value.length>100)return false;return editingLabels.value?canSetLabels.value:Boolean(title.value.trim())&&(!editing.value||props.issue.viewerCanUpdate)});const submitLabel=computed(()=>{if(pending.value)return editing.value?`Saving…`:`Creating…`;if(editingLabels.value)return`Save labels`;return editing.value?`Save issue`:`Create issue`});watch(()=>props.modelValue,open=>{if(!open)return;title.value=props.issue?.title||``;body.value=props.issue?.body||``;selectedLabels.value=props.issue?.labels?.nodes?.map(label=>label.name)||[]},{immediate:true});async function submit(){if(!canSubmit.value)return;const wasEditing=editing.value;const requestBasePath=props.basePath;pending.value=true;try{const payload=editingLabels.value?{labels:selectedLabels.value}:{title:title.value.trim(),body:body.value,...!wasEditing?{labels:selectedLabels.value}:{}};const result=await resource.save(payload,{method:wasEditing?`PUT`:`POST`});feedback.success(wasEditing?`Issue updated.`:`Issue created.`);emit(`saved`,{number:result.issue.number,basePath:requestBasePath});emit(`update:modelValue`,false)}catch(error){feedback.error(error,wasEditing?`Issue could not be updated. Your changes have been kept.`:`Issue creation could not be confirmed. Refresh the issue list before trying again.`)}finally{pending.value=false}}return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,"max-width":`42rem`,scrollable:``,persistent:pending.value,"onUpdate:modelValue":_cache[8]||(_cache[8]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{tag:`form`,rounded:`xl`,onSubmit:withModifiers(submit,[`prevent`])},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$3,[createBaseVNode(`div`,_hoisted_2$2,[createVNode(VIcon,{icon:editingLabels.value?unref(mdiLabelOutline):editing.value?unref(mdiPencilOutline):unref(mdiPlus),color:`primary`},null,8,[`icon`]),createBaseVNode(`h2`,_hoisted_3$2,toDisplayString(heading.value),1)]),createVNode(VBtn,{icon:unref(mdiClose),variant:`text`,size:`48`,"aria-label":`Close issue dialog`,disabled:pending.value,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:modelValue`,false))},null,8,[`icon`,`disabled`])]),createVNode(VCardText,{class:`d-flex flex-column ga-4`},{default:withCtx(()=>[editingLabels.value?(openBlock(),createElementBlock(`p`,_hoisted_4$1,`#`+toDisplayString(__props.issue.number)+` · `+toDisplayString(__props.issue.title),1)):(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(VTextField,{modelValue:title.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>title.value=$event),label:`Title`,variant:`outlined`,maxlength:`256`,disabled:pending.value,"hide-details":``,autofocus:``},null,8,[`modelValue`,`disabled`]),createVNode(_sfc_main$5,{modelValue:body.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>body.value=$event),label:`Description`,placeholder:`What needs to happen?`,variant:`outlined`,rows:`5`,"auto-grow":``,maxlength:unref(GITHUB_BODY_MAX_LENGTH),"base-path":__props.basePath,issue:__props.issue,enabled:__props.modelValue,disabled:pending.value},null,8,[`modelValue`,`maxlength`,`base-path`,`issue`,`enabled`,`disabled`])],64)),__props.mode!==`content`?(openBlock(),createElementBlock(Fragment,{key:2},[unref(catalog).isInitialLoading.value?(openBlock(),createBlock(VSkeletonLoader,{key:0,type:`list-item-two-line,button`,"min-height":`152`,"aria-label":`Loading labels`,"aria-busy":`true`})):unref(catalog).loadError.value?(openBlock(),createBlock(VAlert,{key:1,type:`error`,variant:`tonal`,rounded:`lg`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,height:`48`,onClick:_cache[3]||(_cache[3]=$event=>unref(catalog).reload())},{default:withCtx(()=>[..._cache[9]||(_cache[9]=[createTextVNode(`Retry`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(unref(catalog).loadError.value)+` `,1)]),_:1})):(openBlock(),createElementBlock(Fragment,{key:2},[createVNode(VAutocomplete,{modelValue:selectedLabels.value,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>selectedLabels.value=$event),items:labels.value,"item-title":`name`,"item-value":`name`,multiple:``,chips:``,"closable-chips":``,label:`Labels`,variant:`outlined`,disabled:pending.value||!canSetLabels.value,"menu-props":{maxHeight:320},"error-messages":selectedLabels.value.length>100?`Choose up to 100 labels.`:[],hint:canSetLabels.value?`Search and select repository labels.`:editing.value?`Your GitHub account cannot edit labels.`:`GitHub requires write access to set labels on a new issue.`,"persistent-hint":``,"no-data-text":`No matching labels`},{chip:withCtx(({props:chipProps,item})=>[createVNode(GithubLabelChip_default,mergeProps(chipProps,{label:item}),null,16,[`label`])]),item:withCtx(({props:itemProps,item})=>[createVNode(VListItem,mergeProps(itemProps,{"min-height":`48`}),{title:withCtx(()=>[createVNode(GithubLabelChip_default,{label:item},null,8,[`label`])]),subtitle:withCtx(()=>[createTextVNode(toDisplayString(item.description),1)]),_:2},1040)]),_:1},8,[`modelValue`,`items`,`disabled`,`error-messages`,`hint`]),createBaseVNode(`div`,_hoisted_5$1,[unref(catalog).data.value?.canCreateLabels?(openBlock(),createBlock(GithubNewLabelButton_default,{key:0,"base-path":__props.basePath,labels:labels.value,disabled:pending.value,onCreated:_cache[5]||(_cache[5]=$event=>selectedLabels.value=[...selectedLabels.value,$event.name])},null,8,[`base-path`,`labels`,`disabled`])):createCommentVNode(``,true),createVNode(VBtn,{variant:`text`,height:`48`,disabled:pending.value||unref(catalog).isFetching.value,onClick:_cache[6]||(_cache[6]=$event=>unref(catalog).reload())},{default:withCtx(()=>[..._cache[10]||(_cache[10]=[createTextVNode(`Refresh labels`,-1)])]),_:1},8,[`disabled`])])],64))],64)):createCommentVNode(``,true)]),_:1}),createVNode(VCardActions,{class:`pa-5 pt-2`},{default:withCtx(()=>[createVNode(VSpacer),createVNode(VBtn,{variant:`text`,height:`48`,disabled:pending.value,onClick:_cache[7]||(_cache[7]=$event=>emit(`update:modelValue`,false))},{default:withCtx(()=>[..._cache[11]||(_cache[11]=[createTextVNode(`Cancel`,-1)])]),_:1},8,[`disabled`]),createVNode(VBtn,{type:`submit`,color:`primary`,variant:`flat`,rounded:`pill`,height:`48`,disabled:!canSubmit.value,"aria-busy":pending.value},{default:withCtx(()=>[createTextVNode(toDisplayString(submitLabel.value),1)]),_:1},8,[`disabled`,`aria-busy`])]),_:1})]),_:1})]),_:1},8,[`model-value`,`persistent`])}}};var _hoisted_1$2={class:`d-flex flex-wrap justify-end ga-2`};var _sfc_main$3={__name:`GithubCommentEditor`,props:{comment:{type:Object,required:true},issue:{type:Object,required:true},basePath:{type:String,required:true}},emits:[`saved`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const editing=ref(false);const body=ref(``);const pending=ref(false);const feedback=useUiFeedback({source:`vibe64.issues.commentEditor`});const path=computed(()=>`${props.basePath}/${props.issue.number}/comments/${encodeURIComponent(props.comment.id)}`);const resource=useEndpointResource({path,enabled:false});const canSubmit=computed(()=>!pending.value&&Boolean(body.value.trim())&&body.value.length<=65536);function edit(){body.value=props.comment.body;editing.value=true}async function submit(){if(!canSubmit.value)return;const savedIssue={number:props.issue.number,basePath:props.basePath};pending.value=true;try{await resource.save({body:body.value},{method:`PATCH`});editing.value=false;feedback.success(`Comment updated.`);emit(`saved`,savedIssue)}catch(error){feedback.error(error,`Comment could not be updated. Your changes have been kept.`)}finally{pending.value=false}}return(_ctx,_cache)=>{return editing.value?(openBlock(),createElementBlock(`form`,{key:0,class:`d-flex flex-column ga-2`,onSubmit:withModifiers(submit,[`prevent`])},[createVNode(_sfc_main$5,{modelValue:body.value,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>body.value=$event),label:`Edit comment`,"base-path":__props.basePath,issue:__props.issue,disabled:pending.value,enabled:editing.value,variant:`outlined`,rows:`4`,"auto-grow":``,maxlength:unref(GITHUB_BODY_MAX_LENGTH)},null,8,[`modelValue`,`base-path`,`issue`,`disabled`,`enabled`,`maxlength`]),createBaseVNode(`div`,_hoisted_1$2,[createVNode(VBtn,{variant:`text`,height:`48`,disabled:pending.value,onClick:_cache[1]||(_cache[1]=$event=>editing.value=false)},{default:withCtx(()=>[..._cache[2]||(_cache[2]=[createTextVNode(`Cancel`,-1)])]),_:1},8,[`disabled`]),createVNode(VBtn,{type:`submit`,color:`primary`,variant:`flat`,height:`48`,disabled:!canSubmit.value},{default:withCtx(()=>[createTextVNode(toDisplayString(pending.value?`Saving…`:`Save comment`),1)]),_:1},8,[`disabled`])])],32)):(openBlock(),createElementBlock(Fragment,{key:1},[renderSlot(_ctx.$slots,`default`),__props.comment.viewerCanUpdate?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,height:`48`,onClick:edit},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`Edit comment`,-1)])]),_:1})):createCommentVNode(``,true)],64))}}};var _hoisted_1$1={class:`text-body-medium ma-0`};var _hoisted_2$1={key:0,class:`d-flex justify-start`};var _hoisted_3$1={key:1,role:`status`};var _sfc_main$2={__name:`GithubBulkLabelsDialog`,props:{modelValue:Boolean,basePath:{type:String,required:true},numbers:{type:Array,required:true},labels:{type:Array,required:true},canCreateLabels:Boolean},emits:[`update:modelValue`,`applied`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const labelMode=ref(`add`);const selectedLabels=ref([]);const remaining=ref([]);const failures=ref([]);const pending=ref(false);const progress=ref(``);const feedback=useUiFeedback({source:`vibe64.issues.bulkLabels`});const queryClient=useQueryClient();const resource=useEndpointResource({path:computed(()=>props.basePath),enabled:false});const canSubmit=computed(()=>!pending.value&&selectedLabels.value.length>0&&selectedLabels.value.length<=100&&remaining.value.length>0);watch(()=>props.modelValue,open=>{if(!open)return;remaining.value=[...props.numbers];selectedLabels.value=[];labelMode.value=`add`;failures.value=[]},{immediate:true});async function submit(){if(!canSubmit.value)return;const requestBasePath=props.basePath;const numbers=[...remaining.value];const payload={labels:[...selectedLabels.value],labelMode:labelMode.value};failures.value=[];pending.value=true;for(const[index,number]of numbers.entries()){progress.value=`Updating ${index+1} of ${numbers.length}…`;const issuePath=`${requestBasePath}/${number}`;try{await resource.save(payload,{path:`${issuePath}/labels`,method:`PUT`})}catch(error){feedback.error(error,`Labels could not be updated for #${number}.`);failures.value.push({number,message:feedback.message.value});continue}remaining.value=remaining.value.filter(value=>value!==number);emit(`applied`,{number,basePath:requestBasePath});try{await invalidateGithubIssueQueries(queryClient,requestBasePath,issuePath)}catch(error){feedback.error(error,`Labels updated for #${number}, but the issue could not refresh.`)}}pending.value=false;if(!remaining.value.length){feedback.success(`Labels updated for ${numbers.length} ${numbers.length===1?`issue`:`issues`}.`);emit(`update:modelValue`,false)}}return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,"max-width":`36rem`,scrollable:``,persistent:pending.value,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{tag:`form`,rounded:`xl`,onSubmit:withModifiers(submit,[`prevent`])},{default:withCtx(()=>[createVNode(VCardTitle,{class:`pa-5 pb-2`},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createTextVNode(`Bulk edit labels`,-1)])]),_:1}),createVNode(VCardText,{class:`d-flex flex-column ga-4`},{default:withCtx(()=>[createBaseVNode(`p`,_hoisted_1$1,toDisplayString(remaining.value.length)+` selected. Other labels will stay unchanged.`,1),createVNode(VBtnToggle,{modelValue:labelMode.value,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>labelMode.value=$event),mandatory:``,divided:``,rounded:`pill`,disabled:pending.value,"aria-label":`Label action`},{default:withCtx(()=>[createVNode(VBtn,{value:`add`,height:`48`},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(`Add labels`,-1)])]),_:1}),createVNode(VBtn,{value:`remove`,height:`48`},{default:withCtx(()=>[..._cache[7]||(_cache[7]=[createTextVNode(`Remove labels`,-1)])]),_:1})]),_:1},8,[`modelValue`,`disabled`]),createVNode(VAutocomplete,{modelValue:selectedLabels.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>selectedLabels.value=$event),items:__props.labels,"item-title":`name`,"item-value":`name`,multiple:``,chips:``,"closable-chips":``,label:`Labels to change`,variant:`outlined`,disabled:pending.value,"menu-props":{maxHeight:320},"error-messages":selectedLabels.value.length>100?`Choose up to 100 labels.`:[],"no-data-text":`No matching labels`},{chip:withCtx(({props:chipProps,item})=>[createVNode(GithubLabelChip_default,mergeProps(chipProps,{label:item}),null,16,[`label`])]),item:withCtx(({props:itemProps,item})=>[createVNode(VListItem,mergeProps(itemProps,{"min-height":`48`}),{title:withCtx(()=>[createVNode(GithubLabelChip_default,{label:item},null,8,[`label`])]),_:2},1040)]),_:1},8,[`modelValue`,`items`,`disabled`,`error-messages`]),__props.canCreateLabels&&labelMode.value===`add`?(openBlock(),createElementBlock(`div`,_hoisted_2$1,[createVNode(GithubNewLabelButton_default,{"base-path":__props.basePath,labels:__props.labels,disabled:pending.value,onCreated:_cache[2]||(_cache[2]=$event=>selectedLabels.value=[...selectedLabels.value,$event.name])},null,8,[`base-path`,`labels`,`disabled`])])):createCommentVNode(``,true),failures.value.length?(openBlock(),createElementBlock(`div`,_hoisted_3$1,[_cache[8]||(_cache[8]=createBaseVNode(`p`,{class:`text-body-medium`},`Some issues could not be updated. Retry applies only to these issues:`,-1)),(openBlock(true),createElementBlock(Fragment,null,renderList(failures.value,failure=>{return openBlock(),createElementBlock(`p`,{key:failure.number,class:`text-body-small text-error`},`#`+toDisplayString(failure.number)+`: `+toDisplayString(failure.message),1)}),128))])):createCommentVNode(``,true)]),_:1}),createVNode(VCardActions,{class:`pa-5 pt-2 d-flex flex-wrap`},{default:withCtx(()=>[createVNode(VSpacer),createVNode(VBtn,{variant:`text`,height:`48`,disabled:pending.value,onClick:_cache[3]||(_cache[3]=$event=>emit(`update:modelValue`,false))},{default:withCtx(()=>[..._cache[9]||(_cache[9]=[createTextVNode(`Cancel`,-1)])]),_:1},8,[`disabled`]),createVNode(VBtn,{type:`submit`,color:`primary`,variant:`flat`,height:`48`,disabled:!canSubmit.value},{default:withCtx(()=>[createTextVNode(toDisplayString(pending.value?progress.value:failures.value.length?`Retry failed issues`:`Apply labels`),1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`model-value`,`persistent`])}}};var _hoisted_1={class:`issues-panel d-flex flex-column ga-2`};var _hoisted_2={class:`issues-panel__toolbar d-flex flex-wrap align-center ga-2`};var _hoisted_3={class:`issues-panel__labels d-flex flex-wrap align-start ga-2`};var _hoisted_4={key:3,class:`d-flex justify-end`};var _hoisted_5={key:0,class:`text-body-small text-medium-emphasis ma-0`};var _hoisted_6={class:`d-flex align-center justify-space-between px-2 text-label-large text-medium-emphasis`};var _hoisted_7={key:1,class:`d-flex flex-wrap align-center ga-2`};var _hoisted_8={class:`text-label-large`,role:`status`};var _hoisted_9={class:`d-flex align-center`};var _hoisted_10={class:`d-flex flex-wrap align-center ga-1`};var _hoisted_11={key:0,class:`text-label-small`};var _hoisted_12=[`aria-label`];var _hoisted_13={class:`d-flex justify-space-between ga-2`};var _hoisted_14={class:`d-flex align-center flex-wrap ga-2 mb-3`};var _hoisted_15={class:`text-label-large text-medium-emphasis`};var _hoisted_16={class:`text-title-large mb-2 issues-panel__title`};var _hoisted_17={class:`text-body-small text-medium-emphasis mb-0`};var _hoisted_18={class:`d-flex align-center flex-wrap ga-2 mt-3`};var _hoisted_19={key:0,class:`text-body-small text-medium-emphasis`};var _hoisted_20={key:1,class:`text-body-medium text-medium-emphasis ma-0`};var _hoisted_21={class:`d-flex align-center justify-space-between flex-wrap ga-2 px-2`};var _hoisted_22={class:`text-title-medium`};var _hoisted_23={class:`text-medium-emphasis`};var _hoisted_24={class:`d-flex flex-wrap ga-2`};var _hoisted_25={key:1,class:`text-body-medium text-medium-emphasis px-2`};var _hoisted_26={class:`issues-panel__comment-body`};var _hoisted_27={class:`d-flex flex-wrap align-center ga-2 mb-2`};var _hoisted_28={class:`text-label-large`};var _hoisted_29=[`datetime`];var _hoisted_30={key:0,class:`d-flex flex-wrap align-center ga-2 mt-1`,"aria-live":`polite`};var _hoisted_31={key:0,class:`text-body-small text-medium-emphasis`};var _hoisted_32={class:`text-body-small text-error`};var _hoisted_33={key:0,class:`text-body-small text-medium-emphasis ma-0`};var _hoisted_34={class:`d-flex flex-wrap align-center justify-space-between ga-3`};var _sfc_main$1={__name:`GithubIssuesPanel`,props:{dashboardContext:{type:Object,default:()=>({})}},setup(__props){const props=__props;const{available,projectSlug,basePath,list,detail,labelCatalog,issue,number,state,searchDraft,selectedLabels,draft,pending,comments,commentCount,commentCursor,navigate,filter,filterLabel,mutate,issueSaved,issueUpdated,retryComment}=useVibe64Issues(computed(()=>props.dashboardContext));const route=useRoute();const bulkOpen=ref(false);const selectedNumbers=ref([]);const visibleNumbers=computed(()=>(list.data.value?.issues||[]).map(item=>item.number));const allSelected=computed(()=>visibleNumbers.value.length>0&&visibleNumbers.value.every(value=>selectedNumbers.value.includes(value)));watch(()=>[basePath.value,number.value,route.query.issueSearch,route.query.issueState,route.query.issueCursor,route.query.issueLabel],()=>{selectedNumbers.value=[];bulkOpen.value=false},{deep:true});function labelsApplied({number:issueNumber,basePath:requestBasePath}){if(basePath.value===requestBasePath)selectedNumbers.value=selectedNumbers.value.filter(value=>value!==issueNumber)}const editorOpen=ref(false);const editorMode=ref(`create`);const editorIssue=shallowRef(null);watch([basePath,number],()=>{editorOpen.value=false;editorIssue.value=null;editorMode.value=`create`});function openEditor(selectedIssue=null,mode=`create`){editorMode.value=mode;editorIssue.value=selectedIssue;editorOpen.value=true}const resource=computed(()=>number.value?detail:list);const canChangeState=computed(()=>issue.value?.state===`OPEN`?issue.value.viewerCanClose:issue.value?.viewerCanReopen);function date(value){return value?new Date(value).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`}):``}return(_ctx,_cache)=>{const _component_router_link=resolveComponent(`router-link`);return openBlock(),createElementBlock(`section`,_hoisted_1,[createBaseVNode(`div`,_hoisted_2,[createVNode(Vibe64DashboardBackButton_default,{to:unref(available)&&unref(number)?void 0:unref(projectAppPath)(unref(projectSlug),`/dashboard/env`),onClick:_cache[0]||(_cache[0]=$event=>unref(available)&&unref(number)&&unref(navigate)({issue:void 0}))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(available)&&unref(number)?`All issues`:`Back to dashboard`),1)]),_:1},8,[`to`]),createVNode(VSpacer),unref(available)?(openBlock(),createBlock(VBtn,{key:0,"prepend-icon":unref(mdiRefresh),variant:`text`,size:`small`,height:`48`,disabled:resource.value.isFetching.value||Boolean(unref(pending)),onClick:_cache[1]||(_cache[1]=$event=>resource.value.reload())},{default:withCtx(()=>[createTextVNode(toDisplayString(resource.value.isFetching.value?`Refreshing…`:`Refresh`),1)]),_:1},8,[`prepend-icon`,`disabled`])):createCommentVNode(``,true),unref(available)?(openBlock(),createBlock(VBtn,{key:1,"prepend-icon":unref(mdiPlus),color:`primary`,variant:`tonal`,rounded:`pill`,size:`small`,height:`48`,onClick:_cache[2]||(_cache[2]=$event=>openEditor())},{default:withCtx(()=>[..._cache[28]||(_cache[28]=[createTextVNode(`New issue`,-1)])]),_:1},8,[`prepend-icon`])):createCommentVNode(``,true)]),!unref(available)?(openBlock(),createBlock(VAlert,{key:0,variant:`tonal`,type:`info`},{default:withCtx(()=>[..._cache[29]||(_cache[29]=[createTextVNode(`Issues are available only for GitHub projects.`,-1)])]),_:1})):(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(_sfc_main$8),!unref(number)?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode(`form`,{class:`d-flex flex-wrap align-center ga-3`,onSubmit:_cache[8]||(_cache[8]=withModifiers($event=>unref(filter)(),[`prevent`]))},[createVNode(VBtnToggle,{"model-value":unref(state),mandatory:``,divided:``,rounded:`pill`,color:`primary`,variant:`outlined`,"aria-label":`Issue state`,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>unref(filter)($event))},{default:withCtx(()=>[createVNode(VBtn,{value:`open`,height:`48`},{default:withCtx(()=>[..._cache[30]||(_cache[30]=[createTextVNode(`Open`,-1)])]),_:1}),createVNode(VBtn,{value:`closed`,height:`48`},{default:withCtx(()=>[..._cache[31]||(_cache[31]=[createTextVNode(`Closed`,-1)])]),_:1}),createVNode(VBtn,{value:`all`,height:`48`},{default:withCtx(()=>[..._cache[32]||(_cache[32]=[createTextVNode(`All`,-1)])]),_:1})]),_:1},8,[`model-value`]),createVNode(VTextField,{modelValue:unref(searchDraft),"onUpdate:modelValue":_cache[5]||(_cache[5]=$event=>isRef(searchDraft)?searchDraft.value=$event:null),class:`issues-panel__search`,label:`Search issues`,placeholder:`Number, text, label:new or label:"some label"`,"prepend-inner-icon":unref(mdiMagnify),variant:`outlined`,rounded:`pill`,"hide-details":``,maxlength:`200`,clearable:``,onKeydown:_cache[6]||(_cache[6]=withKeys(withModifiers($event=>unref(filter)(),[`prevent`]),[`enter`])),"onClick:clear":_cache[7]||(_cache[7]=$event=>{searchDraft.value=``;unref(filter)()})},{"append-inner":withCtx(()=>[createVNode(VBtn,{icon:unref(mdiArrowRight),variant:`text`,size:`48`,"aria-label":`Search issues`,onClick:_cache[4]||(_cache[4]=$event=>unref(filter)())},null,8,[`icon`])]),_:1},8,[`modelValue`,`prepend-inner-icon`])],32),createBaseVNode(`div`,_hoisted_3,[unref(labelCatalog).isInitialLoading.value?(openBlock(),createBlock(VSkeletonLoader,{key:0,class:`issues-panel__label-filter`,type:`list-item`,height:`80`,"aria-label":`Loading label filters`,"aria-busy":`true`})):unref(labelCatalog).loadError.value?(openBlock(),createBlock(VAlert,{key:1,class:`issues-panel__label-filter`,type:`error`,variant:`tonal`,rounded:`lg`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,height:`48`,onClick:_cache[9]||(_cache[9]=$event=>unref(labelCatalog).reload())},{default:withCtx(()=>[..._cache[33]||(_cache[33]=[createTextVNode(`Retry labels`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(unref(labelCatalog).loadError.value)+` `,1)]),_:1})):(openBlock(),createBlock(VAutocomplete,{key:2,"model-value":unref(selectedLabels),items:unref(labelCatalog).data.value?.labels||[],class:`issues-panel__label-filter`,"item-title":`name`,"item-value":`name`,multiple:``,chips:``,"closable-chips":``,clearable:``,label:`Filter by labels`,"prepend-inner-icon":unref(mdiLabelOutline),variant:`outlined`,rounded:`lg`,"menu-props":{maxHeight:320},hint:`Match all selected labels.`,"persistent-hint":``,"no-data-text":`No matching labels`,"onUpdate:modelValue":_cache[10]||(_cache[10]=$event=>unref(filter)(unref(state),$event))},{chip:withCtx(({props:chipProps,item})=>[createVNode(GithubLabelChip_default,mergeProps(chipProps,{label:item}),null,16,[`label`])]),item:withCtx(({props:itemProps,item})=>[createVNode(VListItem,mergeProps(itemProps,{"min-height":`48`}),{title:withCtx(()=>[createVNode(GithubLabelChip_default,{label:item},null,8,[`label`])]),subtitle:withCtx(()=>[createTextVNode(toDisplayString(item.description),1)]),_:2},1040)]),_:1},8,[`model-value`,`items`,`prepend-inner-icon`])),unref(labelCatalog).data.value?.canCreateLabels?(openBlock(),createElementBlock(`div`,_hoisted_4,[createVNode(GithubNewLabelButton_default,{"base-path":unref(basePath),labels:unref(labelCatalog).data.value.labels},null,8,[`base-path`,`labels`])])):createCommentVNode(``,true)])],64)):createCommentVNode(``,true),resource.value.isInitialLoading.value?(openBlock(),createBlock(VSheet,{key:1,rounded:`xl`,border:``,class:`pa-4`,"aria-label":`Loading issues`,"aria-busy":`true`},{default:withCtx(()=>[(openBlock(),createElementBlock(Fragment,null,renderList(4,index=>{return createVNode(VSkeletonLoader,{key:index,type:unref(number)?`paragraph`:`list-item-two-line`},null,8,[`type`])}),64))]),_:1})):resource.value.loadError.value&&(!unref(number)||!unref(issue))?(openBlock(),createBlock(VAlert,{key:2,type:`error`,variant:`tonal`,rounded:`lg`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,height:`48`,disabled:resource.value.isFetching.value,onClick:_cache[11]||(_cache[11]=$event=>resource.value.reload())},{default:withCtx(()=>[..._cache[34]||(_cache[34]=[createTextVNode(`Retry`,-1)])]),_:1},8,[`disabled`])]),default:withCtx(()=>[createTextVNode(toDisplayString(resource.value.loadError.value)+` `,1)]),_:1})):!unref(number)?(openBlock(),createElementBlock(Fragment,{key:3},[unref(list).data.value?.searchLimit&&unref(list).data.value.total>unref(list).data.value.searchLimit?(openBlock(),createElementBlock(`p`,_hoisted_5,` GitHub returns up to 1,000 matches for text searches or multiple labels. Narrow the filters to see more specific results. `)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_6,[createBaseVNode(`span`,null,toDisplayString(unref(list).data.value?.total||0)+` `+toDisplayString(unref(list).data.value?.total===1?`issue`:`issues`),1),_cache[35]||(_cache[35]=createBaseVNode(`span`,null,`Recently updated`,-1))]),unref(labelCatalog).data.value?.canEditLabels&&visibleNumbers.value.length?(openBlock(),createElementBlock(`div`,_hoisted_7,[createVNode(VCheckboxBtn,{"model-value":allSelected.value,indeterminate:selectedNumbers.value.length>0&&!allSelected.value,label:`Select all on this page`,class:`issues-panel__select-all`,"min-height":`48`,"onUpdate:modelValue":_cache[12]||(_cache[12]=$event=>selectedNumbers.value=$event?[...visibleNumbers.value]:[])},null,8,[`model-value`,`indeterminate`]),createBaseVNode(`span`,_hoisted_8,toDisplayString(selectedNumbers.value.length)+` selected`,1),createVNode(VBtn,{variant:`tonal`,height:`48`,disabled:!selectedNumbers.value.length,onClick:_cache[13]||(_cache[13]=$event=>bulkOpen.value=true)},{default:withCtx(()=>[..._cache[36]||(_cache[36]=[createTextVNode(`Bulk edit labels`,-1)])]),_:1},8,[`disabled`]),selectedNumbers.value.length?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,height:`48`,onClick:_cache[14]||(_cache[14]=$event=>selectedNumbers.value=[])},{default:withCtx(()=>[..._cache[37]||(_cache[37]=[createTextVNode(`Clear selection`,-1)])]),_:1})):createCommentVNode(``,true)])):createCommentVNode(``,true),unref(list).data.value?.issues?.length?(openBlock(),createBlock(VList,{key:2,class:`pa-0`,density:`compact`,lines:`two`,rounded:`xl`,border:``,slim:``,"aria-label":`GitHub issues`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(list).data.value.issues,(item,index)=>{return openBlock(),createElementBlock(Fragment,{key:item.number},[index?(openBlock(),createBlock(VDivider,{key:0})):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_9,[unref(labelCatalog).data.value?.canEditLabels?(openBlock(),createBlock(VCheckboxBtn,{key:0,modelValue:selectedNumbers.value,"onUpdate:modelValue":_cache[15]||(_cache[15]=$event=>selectedNumbers.value=$event),value:item.number,"aria-label":`Select issue #${item.number}`,class:`flex-grow-0 ml-2`,"min-width":`48`,"min-height":`48`},null,8,[`modelValue`,`value`,`aria-label`])):createCommentVNode(``,true),createVNode(VListItem,{class:`py-2 flex-grow-1`,active:false},{prepend:withCtx(()=>[createVNode(VIcon,{icon:item.state===`OPEN`?unref(mdiRecordCircleOutline):unref(mdiCheck),color:item.state===`OPEN`?`success`:`primary`,"aria-label":item.state===`OPEN`?`Open`:`Closed`},null,8,[`icon`,`color`,`aria-label`])]),append:withCtx(()=>[createBaseVNode(`span`,{class:`d-flex align-center ga-1 ml-3 text-label-medium text-medium-emphasis`,"aria-label":`${item.comments.totalCount} comments`},[createVNode(VIcon,{icon:unref(mdiCommentOutline),size:`18`},null,8,[`icon`]),createTextVNode(toDisplayString(item.comments.totalCount),1)],8,_hoisted_12)]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_10,[createVNode(VListItemTitle,{class:`issues-panel__item-title text-title-medium text-wrap`},{default:withCtx(()=>[createVNode(_component_router_link,{class:`issues-panel__issue-link text-decoration-none`,to:{query:{..._ctx.$route.query,issue:String(item.number)}}},{default:withCtx(()=>[createTextVNode(toDisplayString(item.title),1)]),_:2},1032,[`to`])]),_:2},1024),(openBlock(true),createElementBlock(Fragment,null,renderList(item.labels?.nodes||[],label=>{return openBlock(),createBlock(GithubLabelChip_default,{key:label.name,label,tag:`button`,type:`button`,"aria-label":`Filter by label ${label.name}`,onClick:$event=>unref(filterLabel)(label.name)},null,8,[`label`,`aria-label`,`onClick`])}),128)),item.labels?.totalCount>item.labels?.nodes?.length?(openBlock(),createElementBlock(`span`,_hoisted_11,`+`+toDisplayString(item.labels.totalCount-item.labels.nodes.length),1)):createCommentVNode(``,true)]),createVNode(VListItemSubtitle,{class:`text-body-small mt-1`},{default:withCtx(()=>[createTextVNode(` #`+toDisplayString(item.number)+` · `+toDisplayString(item.state===`OPEN`?`Open`:`Closed`)+` · `+toDisplayString(date(item.updatedAt)),1)]),_:2},1024)]),_:2},1024)])],64)}),128))]),_:1})):(openBlock(),createBlock(VSheet,{key:3,rounded:`xl`,color:`surface-light`,class:`pa-8 text-center`},{default:withCtx(()=>[createVNode(VIcon,{icon:unref(mdiRecordCircleOutline),size:`40`,class:`mb-3`},null,8,[`icon`]),_cache[38]||(_cache[38]=createBaseVNode(`p`,{class:`text-title-medium mb-1`},`No issues here`,-1)),_cache[39]||(_cache[39]=createBaseVNode(`p`,{class:`text-body-medium text-medium-emphasis ma-0`},`Try a different filter or search.`,-1))]),_:1})),createBaseVNode(`div`,_hoisted_13,[_ctx.$route.query.issueCursor?(openBlock(),createBlock(VBtn,{key:0,variant:`text`,height:`48`,onClick:_cache[16]||(_cache[16]=$event=>unref(navigate)({issueCursor:void 0}))},{default:withCtx(()=>[..._cache[40]||(_cache[40]=[createTextVNode(`First page`,-1)])]),_:1})):createCommentVNode(``,true),createVNode(VSpacer),unref(list).data.value?.pageInfo?.hasNextPage?(openBlock(),createBlock(VBtn,{key:1,variant:`tonal`,height:`48`,"append-icon":unref(mdiArrowRight),onClick:_cache[17]||(_cache[17]=$event=>unref(navigate)({issueCursor:unref(list).data.value.pageInfo.endCursor}))},{default:withCtx(()=>[..._cache[41]||(_cache[41]=[createTextVNode(` Next page `,-1)])]),_:1},8,[`append-icon`])):createCommentVNode(``,true)])],64)):unref(issue)?(openBlock(),createElementBlock(Fragment,{key:4},[unref(detail).loadError.value?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`,rounded:`lg`},{append:withCtx(()=>[createVNode(VBtn,{variant:`text`,height:`48`,disabled:unref(detail).isFetching.value,onClick:_cache[18]||(_cache[18]=$event=>unref(detail).reload())},{default:withCtx(()=>[..._cache[42]||(_cache[42]=[createTextVNode(`Refresh`,-1)])]),_:1},8,[`disabled`])]),default:withCtx(()=>[createTextVNode(toDisplayString(unref(detail).loadError.value)+` `,1)]),_:1})):createCommentVNode(``,true),createBaseVNode(`div`,null,[createBaseVNode(`div`,_hoisted_14,[createVNode(VChip,{"prepend-icon":unref(issue).state===`OPEN`?unref(mdiRecordCircleOutline):unref(mdiCheck),color:unref(issue).state===`OPEN`?`success`:`primary`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(issue).state===`OPEN`?`Open`:`Closed`),1)]),_:1},8,[`prepend-icon`,`color`]),createBaseVNode(`span`,_hoisted_15,`#`+toDisplayString(unref(issue).number),1),createVNode(VSpacer),unref(issue).viewerCanUpdate?(openBlock(),createBlock(VBtn,{key:0,"prepend-icon":unref(mdiPencilOutline),variant:`text`,height:`48`,onClick:_cache[19]||(_cache[19]=$event=>openEditor(unref(issue),`content`))},{default:withCtx(()=>[..._cache[43]||(_cache[43]=[createTextVNode(`Edit issue`,-1)])]),_:1},8,[`prepend-icon`])):createCommentVNode(``,true),createVNode(VBtn,{href:unref(issue).url,target:`_blank`,rel:`noopener noreferrer`,"append-icon":unref(mdiOpenInNew),variant:`text`,height:`48`},{default:withCtx(()=>[..._cache[44]||(_cache[44]=[createTextVNode(`GitHub`,-1)])]),_:1},8,[`href`,`append-icon`])]),createBaseVNode(`h2`,_hoisted_16,toDisplayString(unref(issue).title),1),createBaseVNode(`p`,_hoisted_17,toDisplayString(unref(issue).author?.login||`Deleted user`)+` opened this on `+toDisplayString(date(unref(issue).createdAt)),1),createBaseVNode(`div`,_hoisted_18,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(issue).labels?.nodes||[],label=>{return openBlock(),createBlock(GithubLabelChip_default,{key:label.name,label,tag:`button`,type:`button`,"aria-label":`Filter by label ${label.name}`,onClick:$event=>unref(filterLabel)(label.name)},null,8,[`label`,`aria-label`,`onClick`])}),128)),!unref(issue).labels?.nodes?.length?(openBlock(),createElementBlock(`span`,_hoisted_19,`No labels`)):createCommentVNode(``,true),unref(issue).canEditLabels?(openBlock(),createBlock(VBtn,{key:1,"prepend-icon":unref(mdiLabelOutline),variant:`text`,height:`48`,onClick:_cache[20]||(_cache[20]=$event=>openEditor(unref(issue),`labels`))},{default:withCtx(()=>[..._cache[45]||(_cache[45]=[createTextVNode(`Edit labels`,-1)])]),_:1},8,[`prepend-icon`])):createCommentVNode(``,true)])]),createVNode(VSheet,{border:``,rounded:`xl`,class:`pa-5 issues-panel__markdown`},{default:withCtx(()=>[unref(issue).body||unref(issue).bodyHTML?(openBlock(),createBlock(GithubMarkdown_default,{key:0,text:unref(issue).body,html:unref(issue).bodyHTML},null,8,[`text`,`html`])):(openBlock(),createElementBlock(`p`,_hoisted_20,`No description provided.`))]),_:1}),createBaseVNode(`div`,_hoisted_21,[createBaseVNode(`h3`,_hoisted_22,[_cache[46]||(_cache[46]=createTextVNode(`Comments `,-1)),createBaseVNode(`span`,_hoisted_23,toDisplayString(unref(commentCount)),1)]),createBaseVNode(`div`,_hoisted_24,[unref(commentCursor)?(openBlock(),createBlock(VBtn,{key:0,height:`48`,variant:`text`,onClick:_cache[21]||(_cache[21]=$event=>commentCursor.value=``)},{default:withCtx(()=>[..._cache[47]||(_cache[47]=[createTextVNode(`Latest comments`,-1)])]),_:1})):createCommentVNode(``,true),unref(issue).comments.pageInfo.hasPreviousPage?(openBlock(),createBlock(VBtn,{key:1,height:`48`,variant:`text`,onClick:_cache[22]||(_cache[22]=$event=>commentCursor.value=unref(issue).comments.pageInfo.startCursor)},{default:withCtx(()=>[..._cache[48]||(_cache[48]=[createTextVNode(` Older comments `,-1)])]),_:1})):createCommentVNode(``,true)])]),!unref(comments).length?(openBlock(),createElementBlock(`p`,_hoisted_25,`No comments yet. Start the conversation.`)):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(unref(comments),comment=>{return openBlock(),createElementBlock(`article`,{key:comment.id,class:`issues-panel__comment d-flex ga-3`},[createVNode(VAvatar,{color:`primary`,variant:`tonal`,size:`36`,class:`mt-1 text-label-large`,"aria-hidden":`true`},{default:withCtx(()=>[createTextVNode(toDisplayString((comment.author?.login||`?`).slice(0,1).toUpperCase()),1)]),_:2},1024),createBaseVNode(`div`,_hoisted_26,[createBaseVNode(`div`,_hoisted_27,[createBaseVNode(`span`,_hoisted_28,toDisplayString(comment.author?.login||`Deleted user`),1),createBaseVNode(`time`,{class:`text-body-small text-medium-emphasis`,datetime:comment.createdAt},toDisplayString(date(comment.createdAt)),9,_hoisted_29)]),(openBlock(),createBlock(_sfc_main$3,{key:`${unref(basePath)}:${unref(issue).number}:${comment.id}`,comment,issue:unref(issue),"base-path":unref(basePath),onSaved:unref(issueUpdated)},{default:withCtx(()=>[createVNode(VSheet,{color:`surface-light`,rounded:`xl`,class:`pa-4 issues-panel__markdown`},{default:withCtx(()=>[createVNode(GithubMarkdown_default,{text:comment.body,html:comment.bodyHTML},null,8,[`text`,`html`])]),_:2},1024)]),_:2},1032,[`comment`,`issue`,`base-path`,`onSaved`])),comment.delivery&&comment.delivery!==`sent`?(openBlock(),createElementBlock(`div`,_hoisted_30,[comment.delivery===`sending`?(openBlock(),createElementBlock(`span`,_hoisted_31,`Posting…`)):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`span`,_hoisted_32,toDisplayString(comment.error),1),createVNode(VBtn,{variant:`text`,height:`48`,disabled:Boolean(unref(pending)),onClick:$event=>unref(retryComment)(comment.id)},{default:withCtx(()=>[..._cache[49]||(_cache[49]=[createTextVNode(`Retry`,-1)])]),_:1},8,[`disabled`,`onClick`])],64))])):createCommentVNode(``,true)])])}),128)),createVNode(VDivider),createBaseVNode(`form`,{class:`d-flex flex-column ga-3`,onSubmit:_cache[25]||(_cache[25]=withModifiers($event=>unref(mutate)(`comment`),[`prevent`]))},[unref(issue).locked?(openBlock(),createElementBlock(`p`,_hoisted_33,`This conversation is locked. GitHub limits comments to permitted collaborators.`)):createCommentVNode(``,true),createVNode(_sfc_main$5,{modelValue:unref(draft),"onUpdate:modelValue":_cache[23]||(_cache[23]=$event=>isRef(draft)?draft.value=$event:null),label:`Add a comment`,placeholder:`Share an update or ask a question…`,variant:`outlined`,rounded:`lg`,rows:`4`,"auto-grow":``,counter:unref(draft).length>65e3?unref(GITHUB_BODY_MAX_LENGTH):void 0,"error-messages":unref(draft).length>unref(65536)?`Keep your comment under 65,536 characters.`:[],"base-path":unref(basePath),issue:unref(issue),enabled:__props.dashboardContext.active!==false},null,8,[`modelValue`,`counter`,`error-messages`,`base-path`,`issue`,`enabled`]),createBaseVNode(`div`,_hoisted_34,[createVNode(VBtn,{variant:`tonal`,height:`48`,"prepend-icon":unref(issue).state===`OPEN`?unref(mdiCheck):unref(mdiRestore),disabled:!canChangeState.value||Boolean(unref(pending)),title:canChangeState.value?``:`Your GitHub account cannot change this issue’s state.`,onClick:_cache[24]||(_cache[24]=$event=>unref(mutate)(`state`))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(pending)===`state`?`Updating…`:unref(issue).state===`OPEN`?`Close issue`:`Reopen issue`),1)]),_:1},8,[`prepend-icon`,`disabled`,`title`]),createVNode(VBtn,{type:`submit`,color:`primary`,variant:`flat`,rounded:`pill`,height:`48`,disabled:!unref(draft).trim()||unref(draft).length>unref(65536)||Boolean(unref(pending))},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(pending)===`comment`?`Posting…`:`Comment`),1)]),_:1},8,[`disabled`])])],32)],64)):createCommentVNode(``,true)],64)),unref(available)?(openBlock(),createBlock(_sfc_main$2,{key:unref(basePath),modelValue:bulkOpen.value,"onUpdate:modelValue":_cache[26]||(_cache[26]=$event=>bulkOpen.value=$event),"base-path":unref(basePath),numbers:selectedNumbers.value,labels:unref(labelCatalog).data.value?.labels||[],"can-create-labels":unref(labelCatalog).data.value?.canCreateLabels===true,onApplied:labelsApplied},null,8,[`modelValue`,`base-path`,`numbers`,`labels`,`can-create-labels`])):createCommentVNode(``,true),unref(available)?(openBlock(),createBlock(_sfc_main$4,{key:3,modelValue:editorOpen.value,"onUpdate:modelValue":_cache[27]||(_cache[27]=$event=>editorOpen.value=$event),"base-path":unref(basePath),issue:editorIssue.value,mode:editorMode.value,onSaved:unref(issueSaved)},null,8,[`modelValue`,`base-path`,`issue`,`mode`,`onSaved`])):createCommentVNode(``,true)])}}};var GithubIssuesPanel_default=_plugin_vue_export_helper_default(_sfc_main$1,[[`__scopeId`,`data-v-b5746745`]]);var _sfc_main={__name:`index`,props:{dashboardContext:{type:Object,default:()=>({})}},setup(__props){return(_ctx,_cache)=>{return openBlock(),createBlock(GithubIssuesPanel_default,{"dashboard-context":__props.dashboardContext},null,8,[`dashboard-context`])}}};export{_sfc_main as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{J as inject,ct as onMounted,it as onBeforeUnmount,xn as shallowRef}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{a as deriveSurfaceRouteBaseFromPagesRoot,n as createSurfacePathHelpers,o as normalizeSurfaceId,r as normalizePathname,s as normalizeSurfacePagesRoot}from"./returnToPath-gKtcu91D.js";import{f as normalizeText,l as normalizeObject,r as isRecord}from"./normalize-BNAdWJYg.js";import"./surface-DzO5xqc8.js";var EXTERNAL_LINK_PATTERN=/^[A-Za-z][A-Za-z0-9+.-]*:/;function isExternalLinkTarget(target=``){const normalizedTarget=String(target||``).trim();if(!normalizedTarget)return false;if(normalizedTarget.startsWith(`//`))return true;return EXTERNAL_LINK_PATTERN.test(normalizedTarget)}function splitPathQueryHash(target=``){const normalizedTarget=String(target||``).trim();if(!normalizedTarget)return Object.freeze({pathname:``,search:``,hash:``});const hashIndex=normalizedTarget.indexOf(`#`);const beforeHash=hashIndex>=0?normalizedTarget.slice(0,hashIndex):normalizedTarget;const hash=hashIndex>=0?normalizedTarget.slice(hashIndex):``;const queryIndex=beforeHash.indexOf(`?`);const pathname=queryIndex>=0?beforeHash.slice(0,queryIndex):beforeHash;const search=queryIndex>=0?beforeHash.slice(queryIndex):``;return Object.freeze({pathname,search,hash})}function resolveLinkPath(basePath=`/`,relativePath=`/`){const normalizedRelativePath=String(relativePath||``).trim();if(isExternalLinkTarget(normalizedRelativePath))return normalizedRelativePath;const normalizedBasePath=normalizePathname(basePath||`/`);if(!normalizedRelativePath)return normalizedBasePath;const{pathname,search,hash}=splitPathQueryHash(normalizedRelativePath);if(!pathname)return`${normalizedBasePath}${search}${hash}`;const normalizedPathname=normalizePathname(pathname.startsWith(`/`)?pathname:`/${pathname}`);return`${normalizedBasePath===`/`?normalizedPathname:normalizedPathname===`/`?normalizedBasePath:`${normalizedBasePath}${normalizedPathname}`}${search}${hash}`}var PLACEMENT_LAYOUT_CLASSES=Object.freeze([`compact`,`medium`,`expanded`]);var WEB_PLACEMENT_SURFACE_ANY=`*`;function normalizeShellOutletTargetId(value=``){const normalizedValue=normalizeText(value);if(!normalizedValue)return``;const separatorIndex=normalizedValue.indexOf(`:`);if(separatorIndex<=0||separatorIndex>=normalizedValue.length-1)return``;const host=normalizeText(normalizedValue.slice(0,separatorIndex));const position=normalizeText(normalizedValue.slice(separatorIndex+1));if(!host||!position)return``;return`${host}:${position}`}function normalizeSemanticPlacementId(value=``){const normalizedValue=normalizeText(value).toLowerCase();if(!normalizedValue||normalizedValue.includes(`:`)||!normalizedValue.includes(`.`))return``;const segments=normalizedValue.split(`.`);if(segments.length<2)return``;const normalizedSegments=[];for(const segment of segments){const normalizedSegment=normalizeText(segment);if(!/^[a-z0-9]+(?:[_-][a-z0-9]+)*$/.test(normalizedSegment))return``;normalizedSegments.push(normalizedSegment)}return normalizedSegments.join(`.`)}function normalizePlacementOwnerId(value=``){const normalizedValue=normalizeText(value).toLowerCase();if(!normalizedValue)return``;if(!/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/.test(normalizedValue))return``;return normalizedValue}function normalizePlacementLayoutClass(value=``){const normalizedValue=normalizeText(value).toLowerCase();if(PLACEMENT_LAYOUT_CLASSES.includes(normalizedValue))return normalizedValue;return``}function normalizePlacementKind(value=``){const normalizedValue=normalizeText(value).toLowerCase();if(normalizedValue===`link`||normalizedValue===`component`)return normalizedValue;return``}function normalizePlacementSurfaceId(value=``){const normalizedValue=normalizeText(value).toLowerCase();if(!normalizedValue)return``;if(normalizedValue===`*`)return`*`;if(/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/.test(normalizedValue))return normalizedValue;return``}function normalizePlacementSurfaces$1(value){const candidates=Array.isArray(value)?value:value===void 0||value===null?[]:[value];if(candidates.length<1)return Object.freeze([`*`]);const normalized=[];const seen=new Set;for(const candidate of candidates){const surface=normalizePlacementSurfaceId(candidate);if(!surface||seen.has(surface))continue;if(surface===`*`)return Object.freeze([`*`]);seen.add(surface);normalized.push(surface)}if(normalized.length<1)return Object.freeze([`*`]);return Object.freeze(normalized)}function resolvePlacementTargetReference(value=``){const semanticId=normalizeSemanticPlacementId(value);if(semanticId)return Object.freeze({id:semanticId,type:`semantic`});const concreteId=normalizeShellOutletTargetId(value);if(concreteId)return Object.freeze({id:concreteId,type:`concrete`});return null}function normalizePlacementRenderers(value={}){const record=normalizeObject(value);const renderers={};for(const[key,rendererToken]of Object.entries(record)){const kind=normalizePlacementKind(key);const token=normalizeText(rendererToken);if(!kind||!token)continue;renderers[kind]=token}return Object.freeze(renderers)}function normalizePlacementTopologyVariant(value={},{context=`placement topology variant`}={}){const record=normalizeObject(value);const outlet=normalizeShellOutletTargetId(record.outlet||record.target);if(!outlet)throw new Error(`${normalizeText(context)||`placement topology variant`} requires outlet in "host:position" format.`);return Object.freeze({outlet,renderers:normalizePlacementRenderers(record.renderers)})}function normalizePlacementTopologyEntry(value={},{context=`placement topology`}={}){const record=normalizeObject(value);const resolvedContext=normalizeText(context)||`placement topology`;const id=normalizeSemanticPlacementId(record.id||record.target);if(!id)throw new Error(`${resolvedContext} requires semantic placement id in "area.slot" format.`);const owner=normalizePlacementOwnerId(record.owner);const surfaces=normalizePlacementSurfaces$1(record.surfaces);const variantsRecord=normalizeObject(record.variants);const variants={};for(const layoutClass of PLACEMENT_LAYOUT_CLASSES){const variant=variantsRecord[layoutClass];if(!variant)throw new Error(`${resolvedContext} "${id}" requires ${layoutClass} topology variant.`);variants[layoutClass]=normalizePlacementTopologyVariant(variant,{context:`${resolvedContext} "${id}" ${layoutClass}`})}return Object.freeze({id,owner,description:normalizeText(record.description),surfaces,default:record.default===true,variants:Object.freeze(variants)})}function normalizePlacementTopologyDefinition(value={},{context=`placement topology`}={}){const record=normalizeObject(value);const entries=Array.isArray(record.placements)?record.placements:Array.isArray(value)?value:[];const normalized=[];const seen=new Set;for(const entry of entries){const placement=normalizePlacementTopologyEntry(entry,{context});const key=`${placement.id}::${placement.owner||``}`;if(seen.has(key))throw new Error(`${normalizeText(context)||`placement topology`} contains duplicate semantic placement "${placement.id}"${placement.owner?` for owner "${placement.owner}"`:``}.`);seen.add(key);normalized.push(placement)}return Object.freeze({placements:Object.freeze(normalized)})}function isRenderableComponent(value){if(typeof value===`function`)return true;return isRecord(value)}function normalizeSurface(value){return normalizeText(value).toLowerCase()||`*`}function normalizePlacementSurface(value,{strict=false,source=`placement`}={}){const surface=normalizePlacementSurfaceId(value);if(!surface&&strict){const normalized=normalizeText(value).toLowerCase();throw new TypeError(normalized?`${source} surface "${normalized}" is invalid.`:`${source} requires surface id or "*".`)}return surface}function toInteger(value,fallback=1e3){const numeric=Number(value);if(!Number.isFinite(numeric))return fallback;return Math.trunc(numeric)}function normalizePlacementTarget(value,{strict=false,source=`placement`}={}){const reference=resolvePlacementTargetReference(String(value||``).toLowerCase());if(reference?.id)return reference.id;if(strict)throw new TypeError(`${source} requires semantic target in "area.slot" format or internal concrete target in "host:position" format.`);return``}function normalizePlacementSurfaces(value,{strict=false,source=`placement`}={}){if(strict){const candidates=Array.isArray(value)?value:value===void 0||value===null?[]:[value];for(const candidate of candidates)if(normalizePlacementSurface(candidate,{strict,source})===`*`)break}return normalizePlacementSurfaces$1(value)}function normalizePlacementDefinition(value,{strict=false,source=`placement`}={}){if(!isRecord(value)){if(strict)throw new TypeError(`${source} must be an object.`);return null}const id=normalizeText(value.id);if(!id){if(strict)throw new TypeError(`${source} requires id.`);return null}const target=normalizePlacementTarget(value.target,{strict,source:`${source} "${id}"`});if(!target)return null;const targetReference=resolvePlacementTargetReference(target);const internal=value.internal===true;if(targetReference?.type===`concrete`&&internal!==true){if(strict)throw new TypeError(`${source} "${id}" targets concrete outlet "${target}" without internal: true.`);return null}const owner=normalizeText(value.owner).toLowerCase();const kind=normalizePlacementKind(value.kind)||(normalizeText(value.componentToken)?`component`:`link`);const componentToken=normalizeText(value.componentToken);if(kind===`component`&&!componentToken){if(strict)throw new TypeError(`${source} "${id}" requires componentToken.`);return null}const props=isRecord(value.props)?{...value.props}:{};const when=typeof value.when===`function`?value.when:null;const surfaces=normalizePlacementSurfaces(value.surfaces,{strict,source:`${source} "${id}"`});return Object.freeze({id,target,targetType:targetReference?.type||``,owner,kind,surfaces,order:toInteger(value.order,1e3),componentToken,props,when,enabled:value.enabled!==false,internal})}function definePlacement(value={}){return normalizePlacementDefinition(value,{strict:true,source:`placement contribution`})}function createPlacementRegistry({entries=[]}={}){const placements=[];const ids=new Set;function addPlacement(value={}){const placement=definePlacement(value);if(ids.has(placement.id))return false;ids.add(placement.id);placements.push(placement);return true}for(const entry of Array.isArray(entries)?entries:[])addPlacement(entry);function hasPlacement(id){return ids.has(String(id||``).trim())}function build(){return Object.freeze([...placements])}return Object.freeze({addPlacement,hasPlacement,build})}var SHELL_WEB_PLACEMENT_RUNTIME_KEY=`jskit.shell-web.runtime.web-placement.client`;var EMPTY_WEB_PLACEMENT_RUNTIME=Object.freeze({getContext(){return Object.freeze({})},getPlacements(){return Object.freeze([])},setContext(){return Object.freeze({})},subscribe(){return()=>{}},getRevision(){return 0}});var EMPTY_WEB_PLACEMENT_CONTEXT_REF=shallowRef(Object.freeze({}));var EMPTY_WEB_PLACEMENT_CONTEXT=Object.freeze({context:EMPTY_WEB_PLACEMENT_CONTEXT_REF,mergeContext(){return EMPTY_WEB_PLACEMENT_CONTEXT_REF.value},replaceContext(){return EMPTY_WEB_PLACEMENT_CONTEXT_REF.value}});function useWebPlacementRuntime({required=false}={}){const runtime=inject(SHELL_WEB_PLACEMENT_RUNTIME_KEY,null);if(runtime&&typeof runtime.getPlacements===`function`)return runtime;if(required)throw new Error(`Web placement runtime is not available in Vue injection context.`);return EMPTY_WEB_PLACEMENT_RUNTIME}function useWebPlacementContext({required=false}={}){const runtime=useWebPlacementRuntime({required});if(runtime===EMPTY_WEB_PLACEMENT_RUNTIME)return EMPTY_WEB_PLACEMENT_CONTEXT;const context=shallowRef(runtime.getContext());let unsubscribe=null;onMounted(()=>{if(typeof runtime.subscribe!==`function`)return;unsubscribe=runtime.subscribe(()=>{context.value=runtime.getContext()})});onBeforeUnmount(()=>{if(typeof unsubscribe===`function`){unsubscribe();unsubscribe=null}});function mergeContext(value={},source=`component`){context.value=runtime.setContext(value,{source});return context.value}function replaceContext(value={},source=`component`){context.value=runtime.setContext(value,{replace:true,source});return context.value}return Object.freeze({context,mergeContext,replaceContext})}var EMPTY_SURFACE_CONFIG=Object.freeze({tenancyMode:``,defaultSurfaceId:``,enabledSurfaceIds:Object.freeze([]),surfacesById:Object.freeze({})});function normalizeSurfaceIdList(value){if(!Array.isArray(value))return[];const seen=new Set;const normalized=[];for(const candidate of value){const surfaceId=normalizeSurfaceId(candidate);if(!surfaceId||seen.has(surfaceId))continue;seen.add(surfaceId);normalized.push(surfaceId)}return normalized}function normalizeSurfaceConfig(surfaceConfig={}){const source=isRecord(surfaceConfig)?surfaceConfig:{};const enabledSurfaceIds=normalizeSurfaceIdList(source.enabledSurfaceIds);const enabledSet=new Set(enabledSurfaceIds);const rawSurfacesById=isRecord(source.surfacesById)?source.surfacesById:{};const normalizedSurfacesById={};for(const[rawSurfaceId,rawDefinition]of Object.entries(rawSurfacesById)){const definition=isRecord(rawDefinition)?rawDefinition:{};const surfaceId=normalizeSurfaceId(definition.id||rawSurfaceId);if(!surfaceId)continue;const pagesRoot=normalizeSurfacePagesRoot(definition.pagesRoot);const routeBase=String(definition.routeBase||deriveSurfaceRouteBaseFromPagesRoot(pagesRoot)).trim()||`/`;const enabled=enabledSet.size>0?enabledSet.has(surfaceId):definition.enabled!==false;normalizedSurfacesById[surfaceId]=Object.freeze({...definition,id:surfaceId,pagesRoot,routeBase,enabled})}const derivedEnabledSurfaceIds=enabledSurfaceIds.length>0?enabledSurfaceIds.filter(surfaceId=>Boolean(normalizedSurfacesById[surfaceId])):Object.values(normalizedSurfacesById).filter(definition=>definition.enabled).map(definition=>definition.id);const defaultSurfaceId=normalizeSurfaceId(source.defaultSurfaceId);const resolvedDefaultSurfaceId=normalizedSurfacesById[defaultSurfaceId]?defaultSurfaceId:derivedEnabledSurfaceIds[0]||Object.keys(normalizedSurfacesById)[0]||``;return Object.freeze({tenancyMode:String(source.tenancyMode||``).trim().toLowerCase(),defaultSurfaceId:resolvedDefaultSurfaceId,enabledSurfaceIds:Object.freeze([...derivedEnabledSurfaceIds]),surfacesById:Object.freeze({...normalizedSurfacesById})})}function buildSurfaceConfigContext(surfaceRuntime=null,{tenancyMode=``}={}){const normalizedTenancyMode=String(tenancyMode||``).trim().toLowerCase();if(!isRecord(surfaceRuntime))return normalizeSurfaceConfig({tenancyMode:normalizedTenancyMode});const surfaceDefinitions=typeof surfaceRuntime.listSurfaceDefinitions===`function`?surfaceRuntime.listSurfaceDefinitions():[];const surfacesById={};for(const definition of Array.isArray(surfaceDefinitions)?surfaceDefinitions:[]){if(!isRecord(definition))continue;const surfaceId=normalizeSurfaceId(definition.id);if(!surfaceId)continue;surfacesById[surfaceId]=definition}return normalizeSurfaceConfig({tenancyMode:normalizedTenancyMode,defaultSurfaceId:surfaceRuntime.DEFAULT_SURFACE_ID,enabledSurfaceIds:typeof surfaceRuntime.listEnabledSurfaceIds===`function`?surfaceRuntime.listEnabledSurfaceIds():[],surfacesById})}function readPlacementSurfaceConfig(contextValue=null){return normalizeSurfaceConfig((isRecord(contextValue)?contextValue:{}).surfaceConfig)}function resolveSurfaceDefinitionFromPlacementContext(contextValue=null,surfaceId=``){const surfaceConfig=readPlacementSurfaceConfig(contextValue);const normalizedSurfaceId=normalizeSurfaceId(surfaceId);if(!normalizedSurfaceId)return null;return surfaceConfig.surfacesById[normalizedSurfaceId]||null}function joinSurfacePath(surfacePrefix=``,pathname=``){const normalizedPrefix=normalizePathname(surfacePrefix||`/`);const rawPathname=String(pathname||``).trim();if(!rawPathname)return normalizedPrefix;const normalizedPathname=(rawPathname.startsWith(`/`)?rawPathname:`/${rawPathname}`).replace(/\/{2,}/g,`/`);const compacted=(normalizedPrefix===`/`?normalizedPathname:`${normalizedPrefix}${normalizedPathname}`).replace(/\/{2,}/g,`/`);if(!compacted)return`/`;return compacted===`/`?compacted:compacted.replace(/\/+$/,``)||`/`}function resolveSurfaceRootPathFromPlacementContext(contextValue=null,surfaceId=``){return joinSurfacePath(resolveSurfaceDefinitionFromPlacementContext(contextValue,surfaceId)?.routeBase,``)}function normalizeSurfaceOrigin(originValue=``){const rawOrigin=String(originValue||``).trim();if(!rawOrigin)return``;try{const parsed=new URL(rawOrigin);if(parsed.protocol!==`http:`&&parsed.protocol!==`https:`)return``;return parsed.origin}catch{return``}}function resolveRuntimeOrigin(currentOrigin=``){const normalizedCurrentOrigin=normalizeSurfaceOrigin(currentOrigin);if(normalizedCurrentOrigin)return normalizedCurrentOrigin;if(typeof window===`object`&&window?.location?.origin)return normalizeSurfaceOrigin(window.location.origin);return``}function resolveSurfaceNavigationTargetFromPlacementContext(contextValue=null,{path=`/`,surfaceId=``,currentOrigin=``}={}){const rawPath=String(path||``).trim()||`/`;if(isExternalLinkTarget(rawPath))return Object.freeze({href:rawPath,sameOrigin:false,surfaceId:normalizeSurfaceId(surfaceId),external:true});const{pathname,search,hash}=splitPathQueryHash(rawPath);const normalizedPathname=normalizePathname(pathname||`/`);const normalizedPath=`${normalizedPathname}${search}${hash}`;const resolvedSurfaceId=normalizeSurfaceId(surfaceId)||resolveSurfaceIdFromPlacementPathname(contextValue,normalizedPathname)||``;const targetOrigin=normalizeSurfaceOrigin((resolvedSurfaceId?resolveSurfaceDefinitionFromPlacementContext(contextValue,resolvedSurfaceId):null)?.origin||``);const runtimeOrigin=resolveRuntimeOrigin(currentOrigin);if(!targetOrigin)return Object.freeze({href:normalizedPath,sameOrigin:true,surfaceId:resolvedSurfaceId,external:false});if(runtimeOrigin&&targetOrigin===runtimeOrigin)return Object.freeze({href:normalizedPath,sameOrigin:true,surfaceId:resolvedSurfaceId,external:false});return Object.freeze({href:`${targetOrigin}${normalizedPath}`,sameOrigin:false,surfaceId:resolvedSurfaceId,external:false})}function createPlacementSurfacePathHelpers(surfaceConfig=EMPTY_SURFACE_CONFIG){const surfacesById=isRecord(surfaceConfig.surfacesById)?surfaceConfig.surfacesById:{};const defaultSurfaceId=normalizeSurfaceId(surfaceConfig.defaultSurfaceId);const fallbackSurfaceId=Object.keys(surfacesById)[0]||``;const resolvedDefaultSurfaceId=defaultSurfaceId&&surfacesById[defaultSurfaceId]?defaultSurfaceId:fallbackSurfaceId;if(!resolvedDefaultSurfaceId)return null;return createSurfacePathHelpers({defaultSurfaceId:resolvedDefaultSurfaceId,surfaceDefinitions:Object.values(surfacesById)})}function resolveSurfaceIdFromPlacementPathname(contextValue=null,pathname=``){const surfaceConfig=readPlacementSurfaceConfig(contextValue);const normalizedPathname=normalizePathname(pathname)||(typeof window===`object`&&window?.location?.pathname?normalizePathname(window.location.pathname):`/`);const pathHelpers=createPlacementSurfacePathHelpers(surfaceConfig);if(!pathHelpers)return``;return pathHelpers.resolveSurfaceFromPathname(normalizedPathname)}export{isExternalLinkTarget as _,resolveSurfaceNavigationTargetFromPlacementContext as a,useWebPlacementContext as c,isRenderableComponent as d,normalizePlacementDefinition as f,normalizePlacementTopologyDefinition as g,normalizePlacementLayoutClass as h,resolveSurfaceIdFromPlacementPathname as i,useWebPlacementRuntime as l,normalizeSurface as m,readPlacementSurfaceConfig as n,resolveSurfaceRootPathFromPlacementContext as o,normalizePlacementTarget as p,resolveSurfaceDefinitionFromPlacementContext as r,SHELL_WEB_PLACEMENT_RUNTIME_KEY as s,buildSurfaceConfigContext as t,createPlacementRegistry as u,resolveLinkPath as v,splitPathQueryHash as y};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{D as createVNode,E as createTextVNode,Ht as watch,On as unref,Zn as normalizeClass,_ as createBaseVNode,b as createElementBlock,bt as renderList,et as mergeProps,g as computed,it as onBeforeUnmount,mt as openBlock,o as Fragment,qt as withCtx,tr as toDisplayString,tt as nextTick,v as createBlock,vn as ref,w as createSlots,wn as toRef,wt as resolveDynamicComponent,xn as shallowRef,xt as renderSlot,y as createCommentVNode}from"./runtime-core.esm-bundler-DGXg_mpN.js";import{An as wrapInArray,Cn as omit,Dt as genericComponent,It as propsFactory,Kn as isObject,Vn as isBoolean,Yt as callEvent,_ as VIcon,bt as useRender,cr as withKeys,dn as getActiveElement,ft as useLocale,jt as injectNestedDefaults,mn as humanReadableFileSize,mt as useProxiedModel,p as VProgressLinear,sn as filterInputAttrs}from"./VAvatar-H2hyOWlB.js";import{d as getHttpWebClient}from"./vibe64ProjectScope.local-BxTBYuRg.js";import{t as VSelect}from"./VSelect-Dqnp_CFi.js";import{l as forwardRefs}from"./VOverlay-Bi97WKy3.js";import{n as VList,s as VListItem,t as VMenu}from"./VMenu-DnhVIMrr.js";import{n as VChipGroup,t as VChip}from"./VChip-Uixfx461.js";import{c as VCounter,l as VInput,m as useFocus,o as VField,s as makeVFieldProps,t as VTextField,u as makeVInputProps}from"./VTextField-CnkGeXaT.js";import{t as resolveStudioRequestUrl}from"./studioUrls-CGKCbM_d.js";import{B as mdiCheckDecagram,C as mdiArrowRight,Ct as mdiDotsVertical,En as mdiLockOutline,Fn as mdiMinusCircleOutline,I as mdiCellphoneArrowDown,Jn as mdiPlus,Jr as mdiWifi,K as mdiCircleOutline,Kn as mdiPlay,Kt as mdiGithub,Ln as mdiNpm,Mr as mdiTestTube,Nr as mdiTrashCanOutline,R as mdiCheckCircle,Rn as mdiOpenInNew,S as mdiArrowLeft,Tn as mdiLockOpenVariantOutline,Un as mdiPencilOutline,V as mdiChevronDown,Xn as mdiQrcode,Y as mdiClockOutline,Yn as mdiProgressClock,Yr as mdiWrenchOutline,Z as mdiCloseCircle,_t as mdiCurrencyUsd,a as mdiAccountKeyOutline,ar as mdiRobotOutline,d as mdiAlertCircle,er as mdiRefresh,f as mdiAlertCircleOutline,ft as mdiContentSaveOutline,gn as mdiLanguagePython,gr as mdiSourceBranch,in as mdiKeyChange,jr as mdiTagOutline,m as mdiAndroid,or as mdiRocketLaunchOutline,p as mdiAlertOutline,pr as mdiShieldKeyOutline,rn as mdiInformationOutline,tr as mdiReplay,wt as mdiDownload,xn as mdiLifebuoy,yr as mdiSourceCommit,zn as mdiPackageVariantClosed,zr as mdiUpload}from"./mdi-X9prU-DG.js";import{i as VBtnToggle,r as VProgressCircular,t as VBtn}from"./VBtn-Sj5jAuOx.js";import{t as VAlert}from"./VAlert-7_VM9EUm.js";import{t as VCheckbox}from"./VCheckbox-CHFec5Bg.js";import{t as VDialog}from"./VDialog-Drp3yzSH.js";import{i as VCardTitle,n as VCardText,o as VCardActions,t as VCard}from"./VCard-DExT9Cji.js";import{t as VSpacer}from"./VSpacer-BSTt0_VA.js";import{n as VRadio,t as VRadioGroup}from"./VRadioGroup-OHg3N6_i.js";import{t as VSkeletonLoader}from"./VSkeletonLoader-pc4bBTxv.js";import{t as VTextarea}from"./VTextarea-wqoRFl1K.js";import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper-DNW4j-dv.js";import{Bt as VTab,Vt as VSnackbar,zt as VTabs}from"./index-CBo1BEk6.js";import{t as Vibe64DashboardPageHeader_default}from"./Vibe64DashboardPageHeader-BhPHQu6p.js";function useFileDrop(){function getTransfer(e){return e.dataTransfer??e.clipboardData??null}function hasFilesOrFolders(e){const transfer=getTransfer(e);return[...transfer?.items??[]].filter(x=>x.kind===`file`).map(x=>x.webkitGetAsEntry()).filter(Boolean).length>0||[...transfer?.files??[]].length>0}function isDraggingFiles(e){return e.dataTransfer?.types.includes(`Files`)??false}async function handleDrop(e){const transfer=getTransfer(e);const result=[];const entries=[...transfer?.items??[]].filter(x=>x.kind===`file`).map(x=>x.webkitGetAsEntry()).filter(Boolean);if(entries.length)for(const entry of entries){const files=await traverseFileTree(entry,appendIfDirectory(`.`,entry));result.push(...files.map(x=>x.file))}else result.push(...[...transfer?.files??[]]);return result}return{handleDrop,hasFilesOrFolders,isDraggingFiles}}function traverseFileTree(item,path=``){return new Promise((resolve,reject)=>{if(item.isFile)item.file(file=>resolve([{file,path}]),reject);else if(item.isDirectory)item.createReader().readEntries(async entries=>{const files=[];for(const entry of entries)files.push(...await traverseFileTree(entry,appendIfDirectory(path,entry)));resolve(files)})})}function appendIfDirectory(path,item){return item.isDirectory?`${path}/${item.name}`:path}var makeFileFilterProps=propsFactory({filterByType:String},`file-accept`);function useFileFilter(props){const fileFilter=computed(()=>props.filterByType?createFilter(props.filterByType):null);function filterAccepted(files){if(fileFilter.value){const accepted=files.filter(fileFilter.value);return{accepted,rejected:files.filter(f=>!accepted.includes(f))}}return{accepted:files,rejected:[]}}return{filterAccepted}}function createFilter(v){const types=v.split(`,`).map(x=>x.trim().toLowerCase());const extensionsToMatch=types.filter(x=>x.startsWith(`.`));const wildcards=types.filter(x=>x.endsWith(`/*`));const typesToMatch=types.filter(x=>!extensionsToMatch.includes(x)&&!wildcards.includes(x));return file=>{const extension=file.name.split(`.`).at(-1)?.toLowerCase()??``;const typeGroup=file.type.split(`/`).at(0)?.toLowerCase()??``;return typesToMatch.includes(file.type)||extensionsToMatch.includes(`.${extension}`)||wildcards.includes(`${typeGroup}/*`)}}var makeVFileInputProps=propsFactory({chips:Boolean,counter:{type:Boolean,default:void 0},counterSizeString:{type:String,default:`$vuetify.fileInput.counterSize`},counterString:{type:String,default:`$vuetify.fileInput.counter`},hideInput:Boolean,multiple:Boolean,placeholder:String,persistentPlaceholder:Boolean,showSize:{type:[Boolean,Number,String],default:false,validator:v=>{return isBoolean(v)||[1e3,1024].includes(Number(v))}},truncateLength:{type:[Number,String],default:22},...omit(makeVInputProps({prependIcon:`$file`}),[`direction`]),modelValue:{type:[Array,Object],default:props=>props.multiple?[]:null,validator:val=>wrapInArray(val).every(isObject)},...makeFileFilterProps(),...makeVFieldProps({clearable:true})},`VFileInput`);var VFileInput=genericComponent()({name:`VFileInput`,inheritAttrs:false,props:makeVFileInputProps(),emits:{"click:control":e=>true,"mousedown:control":e=>true,"update:focused":focused=>true,"update:modelValue":files=>true,rejected:files=>true},setup(props,{attrs,emit,slots}){const{t}=useLocale();const{filterAccepted}=useFileFilter(props);const model=useProxiedModel(props,`modelValue`,props.modelValue,val=>wrapInArray(val),val=>!props.multiple&&Array.isArray(val)?val[0]:val);const{isFocused,focus,blur}=useFocus(props);const chipDefaults=injectNestedDefaults(`VChip`);const base=computed(()=>!isBoolean(props.showSize)?props.showSize:void 0);const totalBytes=computed(()=>(model.value??[]).reduce((bytes,{size=0})=>bytes+size,0));const totalBytesReadable=computed(()=>humanReadableFileSize(totalBytes.value,base.value));const fileNames=computed(()=>(model.value??[]).map(file=>{const{name=``,size=0}=file;const truncatedText=truncateText(name);return!props.showSize?truncatedText:`${truncatedText} (${humanReadableFileSize(size,base.value)})`}));const counterValue=computed(()=>{const fileCount=model.value?.length??0;if(props.showSize)return t(props.counterSizeString,fileCount,totalBytesReadable.value);else return t(props.counterString,fileCount)});const vInputRef=ref();const vFieldRef=ref();const inputRef=ref();const isActive=toRef(()=>props.persistentPlaceholder||isFocused.value||props.active);const isPlainOrUnderlined=computed(()=>[`plain`,`underlined`].includes(props.variant));const isDragging=shallowRef(false);const{handleDrop,hasFilesOrFolders,isDraggingFiles}=useFileDrop();function onFocus(){if(inputRef.value!==getActiveElement())inputRef.value?.focus();if(!isFocused.value)focus()}function onClickPrepend(e){inputRef.value?.click()}function onControlMousedown(e){emit(`mousedown:control`,e)}function onControlClick(e){inputRef.value?.click();emit(`click:control`,e)}function onClear(e){e.stopPropagation();onFocus();nextTick(()=>{model.value=[];callEvent(props[`onClick:clear`],e)})}function truncateText(str){if(str.length<Number(props.truncateLength))return str;const charsKeepOneSide=Math.floor((Number(props.truncateLength)-1)/2);return`${str.slice(0,charsKeepOneSide)}…${str.slice(str.length-charsKeepOneSide)}`}function onDragover(e){if(props.disabled||props.readonly)return;e.preventDefault();e.stopImmediatePropagation();if(isDraggingFiles(e))isDragging.value=true}function onDragleave(e){e.preventDefault();if(!e.currentTarget.contains(e.relatedTarget))isDragging.value=false}async function onDrop(e){e.preventDefault();e.stopImmediatePropagation();isDragging.value=false;if(!inputRef.value||props.disabled||props.readonly||!hasFilesOrFolders(e))return;selectAccepted(await handleDrop(e))}async function onPaste(e){if(!inputRef.value||props.disabled||props.readonly||!hasFilesOrFolders(e))return;e.preventDefault();const files=await handleDrop(e);if(files.length)selectAccepted(files)}function onFileSelection(e){if(!e.target||e.repack)return;if(!props.filterByType){const target=e.target;model.value=[...target.files??[]]}else selectAccepted([...e.target.files])}function selectAccepted(files){const dataTransfer=new DataTransfer;const{accepted,rejected}=filterAccepted(files);if(rejected.length)emit(`rejected`,rejected);for(const file of accepted)dataTransfer.items.add(file);inputRef.value.files=dataTransfer.files;model.value=[...dataTransfer.files];const event=new Event(`change`,{bubbles:true});event.repack=true;inputRef.value.dispatchEvent(event)}watch(model,newValue=>{if((!Array.isArray(newValue)||!newValue.length)&&inputRef.value)inputRef.value.value=``});useRender(()=>{const hasCounter=!!(slots.counter||props.counter!==void 0);const counterActive=props.counter!==false&&props.counter!==null&&!!model.value?.length;const hasDetails=props.hideDetails!==true&&!!(slots.details||hasCounter);const detailsActive=!!(slots.details||hasCounter&&counterActive);const[rootAttrs,inputAttrs]=filterInputAttrs(attrs);const{modelValue:_,...inputProps}=VInput.filterProps(props);const fieldProps={...VField.filterProps(props),"onClick:clear":onClear};const expectsDirectory=attrs.webkitdirectory!==void 0&&attrs.webkitdirectory!==false;const acceptFallback=attrs.accept?String(attrs.accept):void 0;const inputAccept=expectsDirectory?void 0:props.filterByType??acceptFallback;const showPlaceholder=!!props.placeholder&&!model.value?.length&&(isFocused.value||props.persistentPlaceholder||!props.label);return createVNode(VInput,mergeProps({"ref":vInputRef,"modelValue":props.multiple?model.value:model.value[0],"class":[`v-file-input`,{"v-file-input--chips":!!props.chips,"v-file-input--dragging":isDragging.value,"v-file-input--hide":props.hideInput,"v-input--plain-underlined":isPlainOrUnderlined.value},props.class],"style":props.style,"onClick:prepend":onClickPrepend},rootAttrs,inputProps,{"centerAffix":!isPlainOrUnderlined.value,"focused":isFocused.value,"detailsActive":detailsActive,"indentDetails":props.indentDetails??!isPlainOrUnderlined.value}),{...slots,default:({id,isDisabled,isDirty,isReadonly,isValid,hasDetails})=>createVNode(VField,mergeProps({"ref":vFieldRef,"prependIcon":props.prependIcon,"onMousedown":onControlMousedown,"onClick":onControlClick,"onClick:prependInner":props[`onClick:prependInner`],"onClick:appendInner":props[`onClick:appendInner`]},fieldProps,{"id":id.value,"active":isActive.value||isDirty.value,"dirty":isDirty.value||props.dirty,"disabled":isDisabled.value,"focused":isFocused.value,"details":hasDetails.value,"error":isValid.value===false,"onDragleave":onDragleave,"onDragover":onDragover,"onDrop":onDrop}),{...slots,default:({props:{class:fieldClass,...slotProps},controlRef})=>createBaseVNode(Fragment,null,[createBaseVNode(`input`,mergeProps({"ref":val=>inputRef.value=controlRef.value=val,"type":`file`,"accept":inputAccept,"readonly":isReadonly.value,"disabled":isDisabled.value,"multiple":props.multiple,"name":props.name,"onClick":e=>{e.stopPropagation();if(isReadonly.value)e.preventDefault();onFocus()},"onChange":onFileSelection,"onFocus":onFocus,"onBlur":blur,"onPaste":onPaste},slotProps,inputAttrs),null),showPlaceholder?createBaseVNode(`input`,{"class":normalizeClass(fieldClass),"inert":true,"placeholder":props.placeholder,"readonly":true,"form":``,"type":`text`},null):createBaseVNode(`div`,{"class":normalizeClass(fieldClass)},[!!model.value?.length&&!props.hideInput&&(slots.selection?slots.selection({fileNames:fileNames.value,totalBytes:totalBytes.value,totalBytesReadable:totalBytesReadable.value}):props.chips?fileNames.value.map(text=>createVNode(VChip,{"key":text,"size":chipDefaults.value?.size??`small`,"text":text},null)):fileNames.value.join(`, `))])])}),details:hasDetails?slotProps=>createBaseVNode(Fragment,null,[slots.details?.(slotProps),hasCounter&&createBaseVNode(Fragment,null,[createBaseVNode(`span`,null,null),createVNode(VCounter,{"active":counterActive,"value":counterValue.value,"disabled":props.disabled},slots.counter)])]):void 0})});return forwardRefs({},vInputRef,vFieldRef,inputRef)}});var DESTINATION_ICONS=Object.freeze({"android-sideload":mdiCellphoneArrowDown,"github-releases":mdiGithub,npm:mdiNpm,pypi:mdiLanguagePython});var DESTINATION_ACCENTS=Object.freeze({"android-sideload":`success`,"github-releases":`primary`,npm:`error`,pypi:`info`});var STATUS=Object.freeze({succeeded:{label:`Published`,color:`success`,icon:mdiCheckCircle},proven:{label:`Published`,color:`success`,icon:mdiCheckCircle},checked:{label:`Would publish`,color:`success`,icon:mdiCheckCircle},done:{label:`Done`,color:`success`,icon:mdiCheckCircle},passed:{label:`Checks passed`,color:`success`,icon:mdiCheckCircle},partial:{label:`Partly published`,color:`warning`,icon:mdiAlertCircle},interrupted:{label:`Interrupted`,color:`warning`,icon:mdiAlertCircle},unconfigured:{label:`No checks`,color:`warning`,icon:mdiAlertCircle},failed:{label:`Failed`,color:`error`,icon:mdiCloseCircle},running:{label:`Running`,color:`primary`,icon:mdiProgressClock},pending:{label:`Waiting`,color:`default`,icon:mdiCircleOutline},skipped:{label:`Skipped`,color:`default`,icon:mdiMinusCircleOutline}});function statusInfo(status){return STATUS[status]||{label:String(status||`Unknown`),color:`default`,icon:`M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z`}}function destinationIcon(id){return DESTINATION_ICONS[id]||`M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z`}function destinationAccent(id){return DESTINATION_ACCENTS[id]||`primary`}function shortCommit(commit){return String(commit||``).slice(0,7)}function relativeTime(value,now=Date.now()){const at=Date.parse(value||``);if(Number.isNaN(at))return``;const seconds=Math.round((now-at)/1e3);if(seconds<45)return`just now`;const minutes=Math.round(seconds/60);if(minutes<60)return`${minutes} min ago`;const hours=Math.round(minutes/60);if(hours<24)return`${hours} h ago`;const days=Math.round(hours/24);if(days<30)return`${days} d ago`;return new Date(at).toLocaleDateString()}function proofLine(proof={}){if(!proof||typeof proof!==`object`)return``;if(proof.url)return proof.url;if(proof.integrity)return`${String(proof.integrity).slice(0,19)}…`;const hash=proof.sha256||proof.checksum;if(hash)return`${String(hash).replace(/^sha256:/u,`sha256 `).slice(0,19)}…`;return``}function hostOf(address){try{const url=new URL(String(address||``));return`${url.host}${url.pathname.replace(/\/+$/u,``)}`}catch{return String(address||``)}}function publicPageUrl(destination,{package:name,version,settings={}}={}){if(!name)return``;if(destination===`npm`&&/(^|\.)npmjs\.org$/u.test(hostOf(settings.registry||`https://registry.npmjs.org/`).split(`/`)[0]))return`https://www.npmjs.com/package/${name}${version?`/v/${version}`:``}`;if(destination===`pypi`&&[`pypi`,`testpypi`].includes(settings.instance))return`https://${settings.instance===`testpypi`?`test.`:``}pypi.org/project/${name}/${version?`${version}/`:``}`;return``}function destinationGap(entry,{packages=[],baseline={}}={}){if(!packages.some(candidate=>entry.packers.includes(candidate.packer))){if(entry.id===`android-sideload`)return`Needs an app package in Packaging`;if(entry.id===`npm`)return`Needs a JavaScript package in Packaging`;if(entry.id===`pypi`)return`Needs a Python package in Packaging`;return`Needs a package in Packaging`}if(entry.id===`github-releases`&&!baseline.remote?.githubRepository)return`Needs this project's repository on GitHub`;return``}function lastFailure(target,releases=[]){const since=Date.parse(target?.latest?.at||``)||0;for(const release of releases){if(release.kind!==`release`||release.status===`running`)continue;if((Date.parse(release.finishedAt||release.createdAt)||0)<=since)return null;const outcome=release.targets?.[target.id];const step=(release.steps||[]).find(entry=>entry.id===`publish:${target.id}`);if(outcome?.status===`proven`||outcome?.status===`succeeded`)return null;if(!outcome&&!step)continue;if(outcome?.error||[`failed`,`partial`,`interrupted`].includes(release.status))return{release,message:outcome?.error?.message||release.error?.message||statusInfo(release.status).label}}return null}function packageLabeller(packages=[]){const labels=Object.fromEntries(packages.map(entry=>[entry.id,entry.label||entry.id]));return id=>labels[id]||id}function stepLabel(stepId,targetsById={},label=id=>id){const[kind,...rest]=String(stepId||``).split(`:`);const subject=rest.join(`:`);if(kind===`tag`)return`Tag ${subject}`;if(kind===`build`)return`Build ${label(subject)}`;const target=targetsById[subject];const name=target?`${label(target.package)} → ${target.destinationLabel||target.destination}`:subject;return kind===`dry-run`?`Dry run ${name}`:`Publish ${name}`}var _hoisted_1$13={key:0,class:`publish-destinations`,role:`list`};var _hoisted_2$11=[`disabled`,`onClick`];var _hoisted_3$9={class:`publish-destination__icon`};var _hoisted_4$9={class:`publish-destination__copy`};var _hoisted_5$7={class:`publish-destination__meta`};var _hoisted_6$7={key:0,class:`publish-destination__missing`};var _hoisted_7$7={key:1,class:`publish-add-form`};var _hoisted_8$6={class:`publish-add-needs`,"aria-label":`What it needs`};var _sfc_main$14={__name:`AddTargetDialog`,props:{modelValue:{type:Boolean,default:false},state:{type:Object,default:null},preset:{type:String,default:``},call:{type:Function,required:true}},emits:[`update:modelValue`,`add-account`,`added`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const destinationId=ref(``);const packageId=ref(``);const accountId=ref(``);const channel=ref(``);const error=ref(``);const saving=ref(false);const destinations=computed(()=>(props.state?.destinations||[]).map(entry=>({...entry,accountKind:(props.state?.accountKinds||[]).find(kind=>kind.destination===entry.id)||null})));const chosen=computed(()=>destinations.value.find(entry=>entry.id===destinationId.value)||null);const packages=computed(()=>(props.state?.packaging?.packages||[]).filter(entry=>chosen.value?.packers.includes(entry.packer)));const accounts=computed(()=>(props.state?.accounts||[]).filter(entry=>entry.kind===chosen.value?.accountKind?.id));const needsAccount=computed(()=>Boolean(chosen.value?.accountKind));const canAdd=computed(()=>Boolean(chosen.value&&packageId.value&&(!needsAccount.value||accountId.value)));const packageLine=entry=>`${entry.packer}${entry.version?` · ${entry.version}`:``}`;const missing=entry=>destinationGap(entry,{packages:props.state?.packaging?.packages||[],baseline:props.state?.baseline||{}});const ordered=computed(()=>[...destinations.value].sort((left,right)=>Number(Boolean(missing(left)))-Number(Boolean(missing(right)))));const needs=computed(()=>(chosen.value?.needs||[]).map((text,index)=>{let done=false;if(index===0)done=packages.value.length>0;else if(/account|sign-in/iu.test(text))done=!needsAccount.value||accounts.value.length>0;return{text,done}}));watch(()=>props.modelValue,open=>{if(!open)return;error.value=``;pick(props.preset||``)});watch(accounts,list=>{if(!list.some(entry=>entry.id===accountId.value))accountId.value=list[0]?.id||``});function pick(id){destinationId.value=id;packageId.value=packages.value.length===1?packages.value[0].id:``;accountId.value=accounts.value[0]?.id||``;channel.value=``}async function add(){if(!canAdd.value||saving.value)return;saving.value=true;error.value=``;try{const body={destination:destinationId.value,package:packageId.value,...accountId.value?{account:accountId.value}:{},...channel.value.trim()?{channel:channel.value.trim()}:{}};const answer=await props.call(`/targets`,{body});emit(`added`,answer.target);emit(`update:modelValue`,false)}catch(failure){error.value=failure.message}finally{saving.value=false}}return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,"max-width":`760`,scrollable:``,"onUpdate:modelValue":_cache[6]||(_cache[6]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{class:`publish-dialog`,rounded:`xl`},{default:withCtx(()=>[createVNode(VCardTitle,{class:`publish-dialog__title`},{default:withCtx(()=>[chosen.value?(openBlock(),createBlock(VBtn,{key:0,icon:unref(mdiArrowLeft),"aria-label":`Choose another destination`,size:`small`,variant:`text`,onClick:_cache[0]||(_cache[0]=$event=>pick(``))},null,8,[`icon`])):createCommentVNode(``,true),createTextVNode(` `+toDisplayString(chosen.value?`Add ${chosen.value.label}`:`Where should it go?`),1)]),_:1}),createVNode(VCardText,null,{default:withCtx(()=>[!chosen.value?(openBlock(),createElementBlock(`div`,_hoisted_1$13,[(openBlock(true),createElementBlock(Fragment,null,renderList(ordered.value,entry=>{return openBlock(),createElementBlock(`button`,{key:entry.id,class:normalizeClass([`publish-destination--${unref(destinationAccent)(entry.id)}`,`publish-destination`]),disabled:Boolean(missing(entry)),role:`listitem`,type:`button`,onClick:$event=>pick(entry.id)},[createBaseVNode(`span`,_hoisted_3$9,[createVNode(VIcon,{icon:unref(destinationIcon)(entry.id),size:`24`},null,8,[`icon`])]),createBaseVNode(`span`,_hoisted_4$9,[createBaseVNode(`strong`,null,[createTextVNode(toDisplayString(entry.label)+` `,1),entry.zeroAccount&&entry.id!==`github-releases`?(openBlock(),createBlock(VChip,{key:0,class:`ml-1`,color:`success`,size:`x-small`,variant:`tonal`},{default:withCtx(()=>[..._cache[7]||(_cache[7]=[createTextVNode(`No account`,-1)])]),_:1})):createCommentVNode(``,true)]),createBaseVNode(`span`,null,toDisplayString(entry.summary),1),createBaseVNode(`span`,_hoisted_5$7,[createBaseVNode(`span`,null,[createVNode(VIcon,{icon:unref(mdiClockOutline),size:`14`},null,8,[`icon`]),createTextVNode(` `+toDisplayString(entry.repeat)+` after setup`,1)]),createBaseVNode(`span`,null,[createVNode(VIcon,{icon:unref(mdiCurrencyUsd),size:`14`},null,8,[`icon`]),createTextVNode(` `+toDisplayString(entry.cost),1)])]),missing(entry)?(openBlock(),createElementBlock(`span`,_hoisted_6$7,[createVNode(VIcon,{icon:unref(mdiAlertOutline),size:`14`},null,8,[`icon`]),createTextVNode(` `+toDisplayString(missing(entry))+`.`,1)])):createCommentVNode(``,true)])],10,_hoisted_2$11)}),128))])):(openBlock(),createElementBlock(`div`,_hoisted_7$7,[createBaseVNode(`section`,_hoisted_8$6,[_cache[8]||(_cache[8]=createBaseVNode(`h3`,null,`What it needs`,-1)),createBaseVNode(`ul`,null,[(openBlock(true),createElementBlock(Fragment,null,renderList(needs.value,need=>{return openBlock(),createElementBlock(`li`,{key:need.text,class:normalizeClass({"is-done":need.done})},[createVNode(VIcon,{icon:need.done?unref(mdiCheckCircle):unref(mdiCircleOutline),size:`16`},null,8,[`icon`]),createTextVNode(` `+toDisplayString(need.text),1)],2)}),128))]),createBaseVNode(`p`,null,`First time: `+toDisplayString(chosen.value.firstTime)+`. Later: `+toDisplayString(chosen.value.repeat)+`. `+toDisplayString(chosen.value.cost)+`.`,1)]),createVNode(VSelect,{modelValue:packageId.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>packageId.value=$event),items:packages.value,"item-title":`label`,"item-value":`id`,label:`Package`,variant:`outlined`},{item:withCtx(({props:item,item:entry})=>[createVNode(VListItem,mergeProps(item,{subtitle:packageLine(entry.raw||entry)}),null,16,[`subtitle`])]),_:1},8,[`modelValue`,`items`]),needsAccount.value?(openBlock(),createElementBlock(Fragment,{key:0},[accounts.value.length?(openBlock(),createBlock(VSelect,{key:0,modelValue:accountId.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>accountId.value=$event),items:accounts.value,"item-title":`label`,"item-value":`id`,label:`${chosen.value.accountKind.label} account`,variant:`outlined`},null,8,[`modelValue`,`items`,`label`])):(openBlock(),createBlock(VAlert,{key:1,class:`mb-4`,type:`info`,variant:`tonal`},{append:withCtx(()=>[createVNode(VBtn,{"prepend-icon":unref(mdiPlus),rounded:`pill`,size:`small`,variant:`flat`,color:`primary`,onClick:_cache[3]||(_cache[3]=$event=>emit(`add-account`,chosen.value.accountKind.id))},{default:withCtx(()=>[..._cache[9]||(_cache[9]=[createTextVNode(`Add account`,-1)])]),_:1},8,[`prepend-icon`])]),default:withCtx(()=>[createTextVNode(` Add your `+toDisplayString(chosen.value.accountKind.label)+` account to your publishing keys first. `,1)]),_:1}))],64)):createCommentVNode(``,true),chosen.value.id===`npm`?(openBlock(),createBlock(VTextField,{key:1,modelValue:channel.value,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>channel.value=$event),hint:`Leave empty for latest. Use next or beta for previews.`,label:`Tag (optional)`,"persistent-hint":``,placeholder:`latest`,variant:`outlined`},null,8,[`modelValue`])):createCommentVNode(``,true),error.value?(openBlock(),createBlock(VAlert,{key:2,class:`mt-3`,type:`error`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(error.value),1)]),_:1})):createCommentVNode(``,true)]))]),_:1}),createVNode(VCardActions,{class:`publish-dialog__actions`},{default:withCtx(()=>[createVNode(VSpacer),createVNode(VBtn,{rounded:`pill`,variant:`text`,onClick:_cache[5]||(_cache[5]=$event=>emit(`update:modelValue`,false))},{default:withCtx(()=>[..._cache[10]||(_cache[10]=[createTextVNode(`Cancel`,-1)])]),_:1}),chosen.value?(openBlock(),createBlock(VBtn,{key:0,disabled:!canAdd.value,loading:saving.value,color:`primary`,rounded:`pill`,variant:`flat`,onClick:add},{default:withCtx(()=>[..._cache[11]||(_cache[11]=[createTextVNode(`Add target`,-1)])]),_:1},8,[`disabled`,`loading`])):createCommentVNode(``,true)]),_:1})]),_:1})]),_:1},8,[`model-value`])}}};var AddTargetDialog_default=_plugin_vue_export_helper_default(_sfc_main$14,[[`__scopeId`,`data-v-d387eb0c`]]);var _hoisted_1$12={class:`publish-licence__meta`};var _hoisted_2$10=[`href`];var _hoisted_3$8={class:`publish-licence__text`,tabindex:`0`};var _hoisted_4$8={class:`publish-licence__packages`};var _sfc_main$13={__name:`AndroidSdkLicenceDialog`,props:{modelValue:{type:Boolean,default:false},state:{type:Object,default:null},call:{type:Function,required:true}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const licence=ref(null);const agreed=ref(false);const busy=ref(false);const error=ref(``);const accepted=computed(()=>{const record=props.state?.toolchains?.androidLicence;return Boolean(record&&licence.value&&record.hash===licence.value.hash)});watch(()=>props.modelValue,async open=>{if(!open)return;agreed.value=false;error.value=``;if(licence.value)return;busy.value=true;try{licence.value=(await props.call(`/toolchains/android/licence`,{method:`GET`,refreshAfter:false})).licence}catch(failure){error.value=failure.message}finally{busy.value=false}});async function install(){busy.value=true;error.value=``;try{if(!accepted.value)await props.call(`/toolchains/android/licence`,{body:{id:licence.value.id,hash:licence.value.hash},refreshAfter:false});await props.call(`/toolchains/android`);emit(`update:modelValue`,false)}catch(failure){error.value=failure.message}finally{busy.value=false}}return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,"max-width":`680`,scrollable:``,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{rounded:`xl`},{default:withCtx(()=>[createVNode(VCardTitle,{class:`publish-dialog__title`},{default:withCtx(()=>[createVNode(VIcon,{icon:unref(mdiAndroid),class:`mr-2`,color:`success`},null,8,[`icon`]),_cache[3]||(_cache[3]=createTextVNode(`Android build tools`,-1))]),_:1}),createVNode(VCardText,{class:`publish-licence`},{default:withCtx(()=>[_cache[6]||(_cache[6]=createBaseVNode(`p`,{class:`publish-licence__lead`},` Vibe64 downloads Java 21 and Google's Android SDK (about 1.9 GB, once) into your user cache. Google requires you to accept its licence first. `,-1)),busy.value&&!licence.value?(openBlock(),createBlock(VSkeletonLoader,{key:0,type:`paragraph, paragraph`})):licence.value?(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`div`,_hoisted_1$12,[createBaseVNode(`span`,null,toDisplayString(licence.value.id),1),createBaseVNode(`a`,{href:licence.value.termsUrl,rel:`noopener`,target:`_blank`},[_cache[4]||(_cache[4]=createTextVNode(`Google's terms `,-1)),createVNode(VIcon,{icon:unref(mdiOpenInNew),size:`14`},null,8,[`icon`])],8,_hoisted_2$10)]),createBaseVNode(`pre`,_hoisted_3$8,toDisplayString(licence.value.text),1),createBaseVNode(`p`,_hoisted_4$8,`Downloads: `+toDisplayString(licence.value.packages.join(`, `)),1),!accepted.value?(openBlock(),createBlock(VCheckbox,{key:0,modelValue:agreed.value,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>agreed.value=$event),density:`compact`,"hide-details":``,label:`I have read and accept the Android Software Development Kit License Agreement.`},null,8,[`modelValue`])):(openBlock(),createBlock(VAlert,{key:1,color:`success`,density:`compact`,variant:`tonal`},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createTextVNode(`You accepted this licence on this computer.`,-1)])]),_:1}))],64)):createCommentVNode(``,true),error.value?(openBlock(),createBlock(VAlert,{key:2,class:`mt-3`,type:`error`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(error.value),1)]),_:1})):createCommentVNode(``,true)]),_:1}),createVNode(VCardActions,{class:`publish-dialog__actions`},{default:withCtx(()=>[createVNode(VSpacer),createVNode(VBtn,{rounded:`pill`,variant:`text`,onClick:_cache[1]||(_cache[1]=$event=>emit(`update:modelValue`,false))},{default:withCtx(()=>[..._cache[7]||(_cache[7]=[createTextVNode(`Cancel`,-1)])]),_:1}),createVNode(VBtn,{disabled:!licence.value||!(accepted.value||agreed.value),loading:busy.value&&Boolean(licence.value),"prepend-icon":unref(mdiDownload),color:`primary`,rounded:`pill`,variant:`flat`,onClick:install},{default:withCtx(()=>[createTextVNode(toDisplayString(accepted.value?`Download tools`:`Accept and download`),1)]),_:1},8,[`disabled`,`loading`,`prepend-icon`])]),_:1})]),_:1})]),_:1},8,[`model-value`])}}};var AndroidSdkLicenceDialog_default=_plugin_vue_export_helper_default(_sfc_main$13,[[`__scopeId`,`data-v-a2740dee`]]);var _hoisted_1$11={class:`publish-confirm__hero`};var _hoisted_2$9={class:`publish-confirm__badge`};var _hoisted_3$7={key:0};var _hoisted_4$7={key:1};var _hoisted_5$6={class:`publish-confirm__meta`};var _hoisted_6$6={class:`publish-confirm__plan`};var _hoisted_7$6={class:`publish-confirm__targets`};var _hoisted_8$5={class:`publish-confirm__where`};var _hoisted_9$5={class:`publish-confirm__version`};var _sfc_main$12={__name:`ConfirmPublishDialog`,props:{modelValue:{type:Boolean,default:false},plan:{type:Object,default:null},targetIds:{type:Array,default:()=>[]},acknowledged:{type:Array,default:()=>[]},state:{type:Object,default:null},requestedBy:{type:String,default:``},call:{type:Function,required:true}},emits:[`update:modelValue`,`started`,`plan-changed`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const passphrase=ref(``);const working=ref(false);const error=ref(``);const locked=computed(()=>!props.state?.keys?.unlocked);const needsKeys=computed(()=>Boolean(props.state?.keys?.exists));const labels=computed(()=>Object.fromEntries((props.state?.destinations||[]).map(entry=>[entry.id,entry.label])));const packageLabel=computed(()=>packageLabeller(props.state?.packaging?.packages||[]));const versionOf=packageId=>props.plan?.packages?.find(entry=>entry.id===packageId)?.version||shortCommit(props.plan?.savedCommit);const count=computed(()=>props.plan?.targets?.length||0);watch(()=>props.modelValue,open=>{if(open){passphrase.value=``;error.value=``}});async function publish(){if(!props.plan||working.value)return;working.value=true;error.value=``;try{if(needsKeys.value&&locked.value){await props.call(`/keys/unlock`,{body:{passphrase:passphrase.value},refreshAfter:false});passphrase.value=``}const body={planHash:props.plan.planHash,targetIds:props.targetIds,acknowledged:props.acknowledged};const{token}=await props.call(`/confirmation`,{body,refreshAfter:false});const started=await props.call(`/releases`,{body:{...body,token}});emit(`started`,started.releaseId);emit(`update:modelValue`,false)}catch(failure){error.value=failure.message;if(failure.code===`VIBE64_PUBLISH_CONFIRMATION_PLAN_CHANGED`)emit(`plan-changed`)}finally{working.value=false}}return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,"max-width":`560`,persistent:``,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[__props.plan?(openBlock(),createBlock(VCard,{key:0,class:`publish-confirm`,rounded:`xl`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$11,[createBaseVNode(`span`,_hoisted_2$9,[createVNode(VIcon,{icon:unref(mdiRocketLaunchOutline),size:`28`},null,8,[`icon`])]),createBaseVNode(`h2`,null,`Publish to `+toDisplayString(count.value)+` `+toDisplayString(count.value===1?`place`:`places`)+`?`,1),__props.requestedBy===`assistant`?(openBlock(),createElementBlock(`p`,_hoisted_3$7,`Your Colleague asked for this release. Nothing goes out until you press Publish.`)):(openBlock(),createElementBlock(`p`,_hoisted_4$7,`People will be able to install these versions. Published versions cannot be taken back.`))]),createVNode(VCardText,{class:`publish-confirm__body`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_5$6,[createBaseVNode(`span`,null,[createVNode(VIcon,{icon:unref(mdiSourceCommit),size:`16`},null,8,[`icon`]),createTextVNode(` `+toDisplayString(unref(shortCommit)(__props.plan.savedCommit)),1)]),(openBlock(true),createElementBlock(Fragment,null,renderList(__props.plan.tags,tag=>{return openBlock(),createElementBlock(`span`,{key:tag},[createVNode(VIcon,{icon:unref(mdiTagOutline),size:`16`},null,8,[`icon`]),createTextVNode(` `+toDisplayString(tag),1)])}),128)),createBaseVNode(`span`,_hoisted_6$6,`Plan `+toDisplayString(__props.plan.planId),1)]),createBaseVNode(`ul`,_hoisted_7$6,[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.plan.targets,target=>{return openBlock(),createElementBlock(`li`,{key:target.id,class:normalizeClass(`is-${unref(destinationAccent)(target.destination)}`)},[createVNode(VIcon,{icon:unref(destinationIcon)(target.destination),size:`20`},null,8,[`icon`]),createBaseVNode(`span`,_hoisted_8$5,[createBaseVNode(`strong`,null,toDisplayString(labels.value[target.destination]||target.destination),1),createBaseVNode(`span`,null,[createTextVNode(toDisplayString(packageLabel.value(target.package)),1),target.channel?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` · `+toDisplayString(target.channel),1)],64)):createCommentVNode(``,true)])]),createBaseVNode(`span`,_hoisted_9$5,toDisplayString(versionOf(target.package)),1)],2)}),128))]),needsKeys.value&&locked.value?(openBlock(),createBlock(VTextField,{key:0,modelValue:passphrase.value,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>passphrase.value=$event),"prepend-inner-icon":unref(mdiLockOutline),autocomplete:`current-password`,class:`mt-4`,"hide-details":`auto`,hint:`Your keys stay unlocked for 15 minutes.`,label:`Publishing keys passphrase`,"persistent-hint":``,type:`password`,variant:`outlined`,onKeydown:withKeys(publish,[`enter`])},null,8,[`modelValue`,`prepend-inner-icon`])):createCommentVNode(``,true),error.value?(openBlock(),createBlock(VAlert,{key:1,class:`mt-4`,type:`error`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(error.value),1)]),_:1})):createCommentVNode(``,true)]),_:1}),createVNode(VCardActions,{class:`publish-dialog__actions`},{default:withCtx(()=>[createVNode(VSpacer),createVNode(VBtn,{disabled:working.value,rounded:`pill`,variant:`text`,onClick:_cache[1]||(_cache[1]=$event=>emit(`update:modelValue`,false))},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(`Not now`,-1)])]),_:1},8,[`disabled`]),createVNode(VBtn,{disabled:needsKeys.value&&locked.value&&passphrase.value.length<12,loading:working.value,"prepend-icon":unref(mdiRocketLaunchOutline),color:`primary`,"data-test":`confirm-publish`,rounded:`pill`,size:`large`,variant:`flat`,onClick:publish},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(` Publish `,-1)])]),_:1},8,[`disabled`,`loading`,`prepend-icon`])]),_:1})]),_:1})):createCommentVNode(``,true)]),_:1},8,[`model-value`])}}};var ConfirmPublishDialog_default=_plugin_vue_export_helper_default(_sfc_main$12,[[`__scopeId`,`data-v-5c444628`]]);var LEVELS=Object.freeze({L:Object.freeze({ordinal:0,formatBits:1}),M:Object.freeze({ordinal:1,formatBits:0}),Q:Object.freeze({ordinal:2,formatBits:3}),H:Object.freeze({ordinal:3,formatBits:2})});var ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];var NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];var PENALTY_N1=3;var PENALTY_N2=3;var PENALTY_N3=40;var PENALTY_N4=10;function bit(value,index){return(value>>>index&1)!==0}function numRawDataModules(version){let result=(16*version+128)*version+64;if(version>=2){const alignments=Math.floor(version/7)+2;result-=(25*alignments-10)*alignments-55;if(version>=7)result-=36}return result}function numDataCodewords(version,level){return Math.floor(numRawDataModules(version)/8)-ECC_CODEWORDS_PER_BLOCK[level.ordinal][version]*NUM_ERROR_CORRECTION_BLOCKS[level.ordinal][version]}function multiply(x,y){let z=0;for(let index=7;index>=0;index-=1){z=z<<1^(z>>>7)*285;z^=(y>>>index&1)*x}return z}function reedSolomonDivisor(degree){const result=new Array(degree).fill(0);result[degree-1]=1;let root=1;for(let index=0;index<degree;index+=1){for(let position=0;position<result.length;position+=1){result[position]=multiply(result[position],root);if(position+1<result.length)result[position]^=result[position+1]}root=multiply(root,2)}return result}function reedSolomonRemainder(data,divisor){const result=divisor.map(()=>0);for(const byte of data){const factor=byte^result.shift();result.push(0);divisor.forEach((coefficient,index)=>{result[index]^=multiply(coefficient,factor)})}return result}function alignmentPositions(version){if(version===1)return[];const count=Math.floor(version/7)+2;const step=Math.floor((version*8+count*3+5)/(count*4-4))*2;const result=[6];for(let position=version*4+10;result.length<count;position-=step)result.splice(1,0,position);return result}function encodeSegments(bytes,level){for(let version=1;version<=40;version+=1){const capacityBits=numDataCodewords(version,level)*8;const countBits=version<10?8:16;if(4+countBits+bytes.length*8>capacityBits)continue;const bits=[];const append=(value,length)=>{for(let index=length-1;index>=0;index-=1)bits.push(value>>>index&1)};append(4,4);append(bytes.length,countBits);for(const byte of bytes)append(byte,8);append(0,Math.min(4,capacityBits-bits.length));append(0,(8-bits.length%8)%8);for(let pad=236;bits.length<capacityBits;pad^=253)append(pad,8);const codewords=[];for(let index=0;index<bits.length;index+=8)codewords.push(bits.slice(index,index+8).reduce((value,current)=>value<<1|current,0));return{version,codewords}}throw new RangeError(`The text is too long for a QR code.`)}function interleave(data,version,level){const blockCount=NUM_ERROR_CORRECTION_BLOCKS[level.ordinal][version];const eccLength=ECC_CODEWORDS_PER_BLOCK[level.ordinal][version];const rawCodewords=Math.floor(numRawDataModules(version)/8);const shortBlocks=blockCount-rawCodewords%blockCount;const shortLength=Math.floor(rawCodewords/blockCount);const divisor=reedSolomonDivisor(eccLength);const blocks=[];for(let index=0,offset=0;index<blockCount;index+=1){const dataLength=shortLength-eccLength+(index<shortBlocks?0:1);const block=data.slice(offset,offset+dataLength);offset+=dataLength;const ecc=reedSolomonRemainder(block,divisor);if(index<shortBlocks)block.push(0);blocks.push(block.concat(ecc))}const result=[];for(let column=0;column<blocks[0].length;column+=1)blocks.forEach((block,index)=>{if(column!==shortLength-eccLength||index>=shortBlocks)result.push(block[column])});return result}var Matrix=class{constructor(version){this.size=version*4+17;this.modules=Array.from({length:this.size},()=>new Array(this.size).fill(false));this.reserved=Array.from({length:this.size},()=>new Array(this.size).fill(false))}set(x,y,dark){this.modules[y][x]=dark;this.reserved[y][x]=true}};function drawFinder(matrix,x,y){for(let dy=-4;dy<=4;dy+=1)for(let dx=-4;dx<=4;dx+=1){const distance=Math.max(Math.abs(dx),Math.abs(dy));const xx=x+dx;const yy=y+dy;if(xx>=0&&xx<matrix.size&&yy>=0&&yy<matrix.size)matrix.set(xx,yy,distance!==2&&distance!==4)}}function drawFormatBits(matrix,level,mask){const data=level.formatBits<<3|mask;let remainder=data;for(let index=0;index<10;index+=1)remainder=remainder<<1^(remainder>>>9)*1335;const bits=(data<<10|remainder)^21522;for(let index=0;index<=5;index+=1)matrix.set(8,index,bit(bits,index));matrix.set(8,7,bit(bits,6));matrix.set(8,8,bit(bits,7));matrix.set(7,8,bit(bits,8));for(let index=9;index<15;index+=1)matrix.set(14-index,8,bit(bits,index));for(let index=0;index<8;index+=1)matrix.set(matrix.size-1-index,8,bit(bits,index));for(let index=8;index<15;index+=1)matrix.set(8,matrix.size-15+index,bit(bits,index));matrix.set(8,matrix.size-8,true)}function drawVersion(matrix,version){if(version<7)return;let remainder=version;for(let index=0;index<12;index+=1)remainder=remainder<<1^(remainder>>>11)*7973;const bits=version<<12|remainder;for(let index=0;index<18;index+=1){const dark=bit(bits,index);const a=matrix.size-11+index%3;const b=Math.floor(index/3);matrix.set(a,b,dark);matrix.set(b,a,dark)}}function drawFunctionPatterns(matrix,version,level){for(let index=0;index<matrix.size;index+=1){matrix.set(6,index,index%2===0);matrix.set(index,6,index%2===0)}drawFinder(matrix,3,3);drawFinder(matrix,matrix.size-4,3);drawFinder(matrix,3,matrix.size-4);const positions=alignmentPositions(version);const last=positions.length-1;positions.forEach((x,i)=>positions.forEach((y,j)=>{if(i===0&&j===0||i===0&&j===last||i===last&&j===0)return;for(let dy=-2;dy<=2;dy+=1)for(let dx=-2;dx<=2;dx+=1)matrix.set(x+dx,y+dy,Math.max(Math.abs(dx),Math.abs(dy))!==1)}));drawFormatBits(matrix,level,0);drawVersion(matrix,version)}function drawCodewords(matrix,codewords){let index=0;for(let right=matrix.size-1;right>=1;right-=2){if(right===6)right=5;for(let vertical=0;vertical<matrix.size;vertical+=1)for(let column=0;column<2;column+=1){const x=right-column;const y=(right+1&2)===0?matrix.size-1-vertical:vertical;if(!matrix.reserved[y][x]&&index<codewords.length*8){matrix.modules[y][x]=bit(codewords[index>>>3],7-(index&7));index+=1}}}}var MASKS=[(x,y)=>(x+y)%2===0,(x,y)=>y%2===0,x=>x%3===0,(x,y)=>(x+y)%3===0,(x,y)=>(Math.floor(x/3)+Math.floor(y/2))%2===0,(x,y)=>x*y%2+x*y%3===0,(x,y)=>(x*y%2+x*y%3)%2===0,(x,y)=>((x+y)%2+x*y%3)%2===0];function applyMask(matrix,mask){for(let y=0;y<matrix.size;y+=1)for(let x=0;x<matrix.size;x+=1)if(!matrix.reserved[y][x]&&MASKS[mask](x,y))matrix.modules[y][x]=!matrix.modules[y][x]}function finderPenaltyCountPatterns(history){const n=history[1];const core=n>0&&history[2]===n&&history[3]===n*3&&history[4]===n&&history[5]===n;return(core&&history[0]>=n*4&&history[6]>=n?1:0)+(core&&history[6]>=n*4&&history[0]>=n?1:0)}function finderPenaltyAddHistory(length,history,size){history.pop();history.unshift(history[0]===0?length+size:length)}function finderPenaltyTerminate(dark,length,history,size){let run=length;if(dark){finderPenaltyAddHistory(run,history,size);run=0}run+=size;finderPenaltyAddHistory(run,history,size);return finderPenaltyCountPatterns(history)}function penaltyScore(matrix){const{size,modules}=matrix;let result=0;for(const pass of[0,1])for(let a=0;a<size;a+=1){let color=false;let run=0;const history=[0,0,0,0,0,0,0];for(let b=0;b<size;b+=1){const value=pass===0?modules[a][b]:modules[b][a];if(value===color){run+=1;if(run===5)result+=PENALTY_N1;else if(run>5)result+=1}else{finderPenaltyAddHistory(run,history,size);if(!color)result+=finderPenaltyCountPatterns(history)*PENALTY_N3;color=value;run=1}}result+=finderPenaltyTerminate(color,run,history,size)*PENALTY_N3}for(let y=0;y<size-1;y+=1)for(let x=0;x<size-1;x+=1){const color=modules[y][x];if(color===modules[y][x+1]&&color===modules[y+1][x]&&color===modules[y+1][x+1])result+=PENALTY_N2}const dark=modules.reduce((sum,row)=>sum+row.filter(Boolean).length,0);const total=size*size;const k=Math.ceil(Math.abs(dark*20-total*10)/total)-1;return result+k*PENALTY_N4}function qrMatrix(text,{level=`M`}={}){const ecl=LEVELS[level];if(!ecl)throw new RangeError(`QR error correction is L, M, Q or H.`);const{version,codewords}=encodeSegments([...new TextEncoder().encode(String(text))],ecl);const all=interleave(codewords,version,ecl);let best=null;for(let mask=0;mask<8;mask+=1){const matrix=new Matrix(version);drawFunctionPatterns(matrix,version,ecl);drawCodewords(matrix,all);applyMask(matrix,mask);drawFormatBits(matrix,ecl,mask);const score=penaltyScore(matrix);if(!best||score<best.score)best={matrix,score,mask}}return{version,mask:best.mask,size:best.matrix.size,modules:best.matrix.modules}}function escapeAttribute(value){return String(value).replace(/&/gu,`&`).replace(/"/gu,`"`).replace(/</gu,`<`)}function qrSvg(text,{level=`M`,margin=4,dark=`#000000`,light=`#ffffff`,title=``}={}){const{size,modules}=qrMatrix(text,{level});const extent=size+margin*2;const parts=[];modules.forEach((row,y)=>row.forEach((value,x)=>{if(value)parts.push(`M${x+margin},${y+margin}h1v1h-1z`)}));const label=title?`<title>${escapeAttribute(title)}</title>`:``;return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${extent} ${extent}" shape-rendering="crispEdges" role="img"${title?` aria-label="${escapeAttribute(title)}"`:``}>${label}<rect width="100%" height="100%" fill="${escapeAttribute(light)}"/><path d="${parts.join(``)}" fill="${escapeAttribute(dark)}"/></svg>`}var BASE=`/api/vibe64/publishing`;function publishingRequest(suffix=``,{method=`GET`,body}={}){return getHttpWebClient().request(resolveStudioRequestUrl(`${BASE}${suffix}`),{method,...body===void 0?{}:{body}})}function usePublishing({active=()=>true,request=publishingRequest}={}){const state=ref(null);const loading=ref(false);const loadError=ref(``);let timer=null;const busy=computed(()=>Boolean(state.value?.activeRelease||(state.value?.releases||[]).some(release=>release.status===`running`)||state.value?.checks?.status===`running`||state.value?.toolchains?.install?.status===`running`));async function refresh(){if(!active())return state.value;loading.value=true;try{const answer=await request(``);if(answer?.ok===false)throw Object.assign(new Error(answer.error),{code:answer.code});state.value=answer;loadError.value=``}catch(error){loadError.value=error?.message||`Publishing could not load.`}finally{loading.value=false}return state.value}async function call(suffix,{method=`POST`,body,refreshAfter=true}={}){const answer=await request(suffix,{method,body});if(answer?.ok===false)throw Object.assign(new Error(answer.error||`Publishing failed.`),{code:answer.code,details:answer.details});if(refreshAfter)await refresh();return answer}watch(busy,running=>{clearInterval(timer);timer=running?setInterval(refresh,2e3):null},{immediate:true});onBeforeUnmount(()=>clearInterval(timer));return{state,loading,loadError,busy,refresh,call}}function apkDownloadUrl(releaseId,targetId){return resolveStudioRequestUrl(`${BASE}/releases/${encodeURIComponent(releaseId)}/targets/${encodeURIComponent(targetId)}/apk`)}var _hoisted_1$10={class:`publish-install__badge`};var _hoisted_2$8={key:0};var _hoisted_3$6={key:0,class:`publish-install__here`};var _hoisted_4$6={key:1,class:`publish-install__layout`};var _hoisted_5$5=[`innerHTML`];var _hoisted_6$5={class:`publish-install__steps`};var _hoisted_7$5={key:2,class:`publish-install__expiry`};var _sfc_main$11={__name:`InstallOnPhoneDialog`,props:{modelValue:{type:Boolean,default:false},releaseId:{type:String,default:``},targetId:{type:String,default:``},title:{type:String,default:``},version:{type:String,default:``},call:{type:Function,required:true}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const onThisPhone=typeof navigator!==`undefined`&&/Android/iu.test(navigator.userAgent||``);const showQr=ref(!onThisPhone);const share=ref(null);const busy=ref(false);const error=ref(``);const left=ref(0);let timer=null;const qr=computed(()=>share.value?.url?qrSvg(share.value.url,{level:`M`,margin:2,title:`QR code that downloads the app`}):``);const minutes=computed(()=>`${Math.floor(left.value/60)}:${String(left.value%60).padStart(2,`0`)}`);function tick(){left.value=Math.max(0,Math.round((Date.parse(share.value?.expiresAt||``)-Date.now())/1e3));if(!left.value&&share.value)share.value=null}async function start(){busy.value=true;error.value=``;try{share.value=(await props.call(`/share`,{body:{releaseId:props.releaseId,targetId:props.targetId},refreshAfter:false})).share;tick();clearInterval(timer);timer=setInterval(tick,1e3)}catch(failure){error.value=failure.message}finally{busy.value=false}}async function stop(){clearInterval(timer);if(share.value)await props.call(`/share`,{method:`DELETE`,refreshAfter:false}).catch(()=>{});share.value=null}watch(()=>props.modelValue,open=>open?showQr.value?start():null:stop());function revealQr(){showQr.value=true;start()}onBeforeUnmount(stop);return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,"max-width":`520`,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{class:`publish-install`,rounded:`xl`},{default:withCtx(()=>[createVNode(VCardTitle,{class:`publish-dialog__title publish-install__title`},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_1$10,[createVNode(VIcon,{icon:unref(mdiCellphoneArrowDown),size:`22`},null,8,[`icon`])]),createBaseVNode(`span`,null,[createTextVNode(toDisplayString(__props.title?`Install ${__props.title}`:`Install on your phone`)+` `,1),__props.version?(openBlock(),createElementBlock(`small`,_hoisted_2$8,`Version `+toDisplayString(__props.version)+` · signed with your install key`,1)):createCommentVNode(``,true)])]),_:1}),createVNode(VCardText,null,{default:withCtx(()=>[unref(onThisPhone)?(openBlock(),createElementBlock(`div`,_hoisted_3$6,[createVNode(VBtn,{href:unref(apkDownloadUrl)(__props.releaseId,__props.targetId),"prepend-icon":unref(mdiDownload),block:``,color:`success`,rounded:`pill`,size:`large`,variant:`flat`},{default:withCtx(()=>[createTextVNode(` Download `+toDisplayString(__props.title||`the app`),1)]),_:1},8,[`href`,`prepend-icon`]),_cache[3]||(_cache[3]=createBaseVNode(`ol`,{class:`publish-install__steps`},[createBaseVNode(`li`,null,[createBaseVNode(`strong`,null,`Download`),createTextVNode(` it here. Android asks once to allow installs from your browser.`)]),createBaseVNode(`li`,null,[createBaseVNode(`strong`,null,`Install.`),createTextVNode(` Later versions install over it and keep its data.`)])],-1)),!showQr.value?(openBlock(),createBlock(VBtn,{key:0,"prepend-icon":unref(mdiQrcode),rounded:`pill`,variant:`text`,onClick:revealQr},{default:withCtx(()=>[..._cache[2]||(_cache[2]=[createTextVNode(`Show a QR code for another phone`,-1)])]),_:1},8,[`prepend-icon`])):createCommentVNode(``,true)])):createCommentVNode(``,true),showQr.value?(openBlock(),createElementBlock(`div`,_hoisted_4$6,[createBaseVNode(`div`,{class:normalizeClass([`publish-install__qr`,{"is-waiting":!qr.value}])},[qr.value?(openBlock(),createElementBlock(`div`,{key:0,class:`publish-install__code`,innerHTML:qr.value},null,8,_hoisted_5$5)):busy.value?(openBlock(),createBlock(VProgressCircular,{key:1,color:`primary`,indeterminate:``})):(openBlock(),createBlock(VBtn,{key:2,"prepend-icon":unref(mdiWifi),rounded:`pill`,variant:`tonal`,onClick:start},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(`Share again`,-1)])]),_:1},8,[`prepend-icon`]))],2),createBaseVNode(`ol`,_hoisted_6$5,[_cache[6]||(_cache[6]=createBaseVNode(`li`,null,[createBaseVNode(`strong`,null,`Scan`),createTextVNode(` with your Android phone's camera, on the same Wi-Fi as this computer.`)],-1)),createBaseVNode(`li`,null,[_cache[5]||(_cache[5]=createBaseVNode(`strong`,null,`Download`,-1)),createTextVNode(` `+toDisplayString(__props.title||`the app`)+`. Android asks once to allow installs from your browser.`,1)]),_cache[7]||(_cache[7]=createBaseVNode(`li`,null,[createBaseVNode(`strong`,null,`Install.`),createTextVNode(` Later versions install over it and keep its data.`)],-1))])])):createCommentVNode(``,true),share.value&&showQr.value?(openBlock(),createElementBlock(`p`,_hoisted_7$5,[createVNode(VIcon,{icon:unref(mdiWifi),size:`16`},null,8,[`icon`]),createTextVNode(` Shared on your network for `+toDisplayString(minutes.value)+`. Closing this stops it. `,1)])):createCommentVNode(``,true),error.value?(openBlock(),createBlock(VAlert,{key:3,class:`mt-3`,type:`warning`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(error.value),1)]),_:1})):createCommentVNode(``,true)]),_:1}),createVNode(VCardActions,{class:`publish-dialog__actions`},{default:withCtx(()=>[!unref(onThisPhone)?(openBlock(),createBlock(VBtn,{key:0,href:unref(apkDownloadUrl)(__props.releaseId,__props.targetId),"prepend-icon":unref(mdiDownload),rounded:`pill`,variant:`text`},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(`Download APK`,-1)])]),_:1},8,[`href`,`prepend-icon`])):createCommentVNode(``,true),createVNode(VSpacer),createVNode(VBtn,{color:`primary`,rounded:`pill`,variant:`flat`,onClick:_cache[0]||(_cache[0]=$event=>emit(`update:modelValue`,false))},{default:withCtx(()=>[..._cache[9]||(_cache[9]=[createTextVNode(`Done`,-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,[`model-value`])}}};var InstallOnPhoneDialog_default=_plugin_vue_export_helper_default(_sfc_main$11,[[`__scopeId`,`data-v-7a3bfa13`]]);var _hoisted_1$9={class:`publish-keys__vault-icon`};var _hoisted_2$7={class:`publish-keys__vault-copy`};var _hoisted_3$5={key:0};var _hoisted_4$5={key:1};var _hoisted_5$4={key:2};var _hoisted_6$4={key:0,class:`publish-keys__form`};var _hoisted_7$4={key:1,class:`publish-keys__inline`};var _hoisted_8$4={class:`publish-keys__heading`};var _hoisted_9$4={key:0,class:`publish-keys__list`};var _hoisted_10$4={key:1,class:`publish-keys__note`};var _hoisted_11$4={key:2,class:`publish-keys__add`};var _hoisted_12$4={key:0,class:`publish-keys__note mb-3`};var _hoisted_13$4={class:`publish-keys__add-actions`};var _hoisted_14$4={key:0};var _hoisted_15$4={key:1};var _hoisted_16$4={key:2,class:`text-medium-emphasis`};var _hoisted_17$4={key:3};var _sfc_main$10={__name:`PublishingAccountsPanel`,props:{modelValue:{type:Boolean,default:false},state:{type:Object,default:null},addKind:{type:String,default:``},call:{type:Function,required:true}},emits:[`update:modelValue`,`recovery-kit`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const KIND_ICONS={npm:mdiNpm,pypi:mdiLanguagePython,github:mdiGithub};const passphrase=ref(``);const repeat=ref(``);const adding=ref(false);const form=ref({kind:`npm`,label:``,address:``,token:``,source:`token`});const replacing=ref(``);const busy=ref(``);const error=ref(``);const keys=computed(()=>props.state?.keys||{});const accounts=computed(()=>props.state?.accounts||[]);const kinds=computed(()=>props.state?.accountKinds||[]);const kind=computed(()=>kinds.value.find(entry=>entry.id===form.value.kind)||null);const installKeys=computed(()=>(keys.value.entries||[]).filter(entry=>entry.kind===`android-sideload-key`));const kitDate=computed(()=>keys.value.recoveryKit?.createdAt||``);const kitStale=computed(()=>(keys.value.entries||[]).some(entry=>!entry.coveredByRecoveryKit));const until=computed(()=>keys.value.unlockedUntil?new Date(keys.value.unlockedUntil).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):``);watch(()=>props.modelValue,open=>{if(!open)return;error.value=``;passphrase.value=``;repeat.value=``;if(props.addKind)startAdding(props.addKind);else adding.value=false});function startAdding(kindId=`npm`){const chosen=kinds.value.find(entry=>entry.id===kindId)||kinds.value[0];form.value={kind:chosen?.id||`npm`,label:``,address:chosen?.defaultAddress||``,token:``,source:`token`};replacing.value=``;adding.value=true}function startReplacing(account){form.value={kind:account.kind,label:account.label,address:account.address||``,token:``,source:account.source===`github-cli`?`github-cli`:`token`};adding.value=true;replacing.value=account.id}watch(()=>form.value.kind,(value,previous)=>{if(value===previous||replacing.value)return;form.value.address=kinds.value.find(entry=>entry.id===value)?.defaultAddress||``;form.value.source=`token`});async function run(name,work){busy.value=name;error.value=``;try{await work()}catch(failure){error.value=failure.message}finally{busy.value=``}}const create=()=>run(`create`,async()=>{if(passphrase.value!==repeat.value)throw new Error(`The two passphrases differ.`);await props.call(`/keys`,{body:{passphrase:passphrase.value}});passphrase.value=repeat.value=``});const unlock=()=>run(`unlock`,async()=>{await props.call(`/keys/unlock`,{body:{passphrase:passphrase.value}});passphrase.value=``});const lock=()=>run(`lock`,()=>props.call(`/keys/lock`));const addAccount=()=>run(`add`,async()=>{const{kind:kindId,label,address,token,source}=form.value;await props.call(`/accounts`,{body:{kind:kindId,label:label||kind.value?.label,address,source,...source===`token`?{token}:{}}});form.value.token=``;adding.value=false;replacing.value=``});const removeAccount=id=>run(`remove:${id}`,()=>props.call(`/accounts/${encodeURIComponent(id)}`,{method:`DELETE`}));return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,"max-width":`640`,scrollable:``,"onUpdate:modelValue":_cache[12]||(_cache[12]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{rounded:`xl`},{default:withCtx(()=>[createVNode(VCardTitle,{class:`publish-dialog__title`},{default:withCtx(()=>[..._cache[13]||(_cache[13]=[createTextVNode(`Accounts & keys`,-1)])]),_:1}),createVNode(VCardText,{class:`publish-keys`},{default:withCtx(()=>[createBaseVNode(`section`,{class:normalizeClass([`publish-keys__vault`,{"is-open":keys.value.unlocked}])},[createBaseVNode(`span`,_hoisted_1$9,[createVNode(VIcon,{icon:keys.value.unlocked?unref(mdiLockOpenVariantOutline):unref(mdiShieldKeyOutline),size:`26`},null,8,[`icon`])]),createBaseVNode(`div`,_hoisted_2$7,[_cache[14]||(_cache[14]=createBaseVNode(`strong`,null,`Publishing keys`,-1)),!keys.value.exists?(openBlock(),createElementBlock(`span`,_hoisted_3$5,`One passphrase protects every sign-in and install key Vibe64 keeps for publishing. It stays on this computer, encrypted.`)):keys.value.unlocked?(openBlock(),createElementBlock(`span`,_hoisted_4$5,`Unlocked until `+toDisplayString(until.value)+`. Locks by itself.`,1)):(openBlock(),createElementBlock(`span`,_hoisted_5$4,`Locked. Unlock to add accounts or publish.`))]),keys.value.unlocked?(openBlock(),createBlock(VBtn,{key:0,loading:busy.value===`lock`,"prepend-icon":unref(mdiLockOutline),rounded:`pill`,variant:`tonal`,onClick:lock},{default:withCtx(()=>[..._cache[15]||(_cache[15]=[createTextVNode(`Lock`,-1)])]),_:1},8,[`loading`,`prepend-icon`])):createCommentVNode(``,true)],2),!keys.value.exists?(openBlock(),createElementBlock(`div`,_hoisted_6$4,[createVNode(VTextField,{modelValue:passphrase.value,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>passphrase.value=$event),autocomplete:`new-password`,hint:`At least 12 characters. A short sentence works well.`,label:`Passphrase`,"persistent-hint":``,type:`password`,variant:`outlined`},null,8,[`modelValue`]),createVNode(VTextField,{modelValue:repeat.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>repeat.value=$event),autocomplete:`new-password`,label:`Passphrase again`,type:`password`,variant:`outlined`,onKeydown:withKeys(create,[`enter`])},null,8,[`modelValue`]),_cache[17]||(_cache[17]=createBaseVNode(`p`,{class:`publish-keys__note`},`Vibe64 cannot recover a forgotten passphrase. A recovery kit (its own passphrase) restores your keys on any computer.`,-1)),createVNode(VBtn,{disabled:passphrase.value.length<12||!repeat.value,loading:busy.value===`create`,color:`primary`,rounded:`pill`,variant:`flat`,onClick:create},{default:withCtx(()=>[..._cache[16]||(_cache[16]=[createTextVNode(`Create publishing keys`,-1)])]),_:1},8,[`disabled`,`loading`])])):!keys.value.unlocked?(openBlock(),createElementBlock(`div`,_hoisted_7$4,[createVNode(VTextField,{modelValue:passphrase.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>passphrase.value=$event),"prepend-inner-icon":unref(mdiLockOutline),autocomplete:`current-password`,density:`comfortable`,"hide-details":``,label:`Passphrase`,type:`password`,variant:`outlined`,onKeydown:withKeys(unlock,[`enter`])},null,8,[`modelValue`,`prepend-inner-icon`]),createVNode(VBtn,{disabled:passphrase.value.length<12,loading:busy.value===`unlock`,color:`primary`,rounded:`pill`,variant:`flat`,onClick:unlock},{default:withCtx(()=>[..._cache[18]||(_cache[18]=[createTextVNode(`Unlock`,-1)])]),_:1},8,[`disabled`,`loading`])])):createCommentVNode(``,true),keys.value.exists?(openBlock(),createElementBlock(Fragment,{key:2},[createBaseVNode(`h3`,_hoisted_8$4,[_cache[20]||(_cache[20]=createTextVNode(` Accounts `,-1)),!adding.value?(openBlock(),createBlock(VBtn,{key:0,disabled:!keys.value.unlocked,"prepend-icon":unref(mdiPlus),class:`ml-auto`,rounded:`pill`,size:`small`,variant:`tonal`,onClick:_cache[3]||(_cache[3]=$event=>startAdding())},{default:withCtx(()=>[..._cache[19]||(_cache[19]=[createTextVNode(`Add account`,-1)])]),_:1},8,[`disabled`,`prepend-icon`])):createCommentVNode(``,true)]),accounts.value.length?(openBlock(),createElementBlock(`ul`,_hoisted_9$4,[(openBlock(true),createElementBlock(Fragment,null,renderList(accounts.value,account=>{return openBlock(),createElementBlock(`li`,{key:account.id},[createVNode(VIcon,{icon:KIND_ICONS[account.kind]||unref(`M5.8 10C5.4 8.8 4.3 8 3 8C1.3 8 0 9.3 0 11S1.3 14 3 14C4.3 14 5.4 13.2 5.8 12H7V14H9V12H11V10H5.8M3 12C2.4 12 2 11.6 2 11S2.4 10 3 10 4 10.4 4 11 3.6 12 3 12M16 4C13.8 4 12 5.8 12 8S13.8 12 16 12 20 10.2 20 8 18.2 4 16 4M16 10.1C14.8 10.1 13.9 9.2 13.9 8C13.9 6.8 14.8 5.9 16 5.9C17.2 5.9 18.1 6.8 18.1 8S17.2 10.1 16 10.1M16 13C13.3 13 8 14.3 8 17V20H24V17C24 14.3 18.7 13 16 13M22.1 18.1H9.9V17C9.9 16.4 13 14.9 16 14.9C19 14.9 22.1 16.4 22.1 17V18.1Z`),size:`22`},null,8,[`icon`]),createBaseVNode(`div`,null,[createBaseVNode(`strong`,null,toDisplayString(account.label),1),createBaseVNode(`span`,null,toDisplayString(account.source===`github-cli`?`From your GitHub CLI sign-in`:account.address||`Token`)+` · added `+toDisplayString(unref(relativeTime)(account.createdAt)),1)]),createVNode(VBtn,{"aria-label":`Replace the token of ${account.label}`,disabled:!keys.value.unlocked,icon:unref(mdiKeyChange),size:`small`,title:`Replace token`,variant:`text`,onClick:$event=>startReplacing(account)},null,8,[`aria-label`,`disabled`,`icon`,`onClick`]),createVNode(VBtn,{"aria-label":`Remove ${account.label}`,disabled:!keys.value.unlocked,icon:unref(mdiTrashCanOutline),loading:busy.value===`remove:${account.id}`,size:`small`,variant:`text`,onClick:$event=>removeAccount(account.id)},null,8,[`aria-label`,`disabled`,`icon`,`loading`,`onClick`])])}),128))])):!adding.value?(openBlock(),createElementBlock(`p`,_hoisted_10$4,`No accounts yet. Install on my phone needs none; npm, PyPI and GitHub each need one.`)):createCommentVNode(``,true),adding.value?(openBlock(),createElementBlock(`div`,_hoisted_11$4,[replacing.value?(openBlock(),createElementBlock(`p`,_hoisted_12$4,[_cache[21]||(_cache[21]=createTextVNode(`New token for `,-1)),createBaseVNode(`strong`,null,toDisplayString(form.value.label),1),_cache[22]||(_cache[22]=createTextVNode(`. Targets using it keep working with the new token.`,-1))])):createCommentVNode(``,true),!replacing.value?(openBlock(),createBlock(VBtnToggle,{key:1,modelValue:form.value.kind,"onUpdate:modelValue":_cache[4]||(_cache[4]=$event=>form.value.kind=$event),class:`mb-3`,color:`primary`,density:`comfortable`,divided:``,mandatory:``,rounded:`pill`,variant:`outlined`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(kinds.value,entry=>{return openBlock(),createBlock(VBtn,{key:entry.id,"prepend-icon":KIND_ICONS[entry.id],value:entry.id},{default:withCtx(()=>[createTextVNode(toDisplayString(entry.label),1)]),_:2},1032,[`prepend-icon`,`value`])}),128))]),_:1},8,[`modelValue`])):createCommentVNode(``,true),!replacing.value?(openBlock(),createBlock(VTextField,{key:2,modelValue:form.value.label,"onUpdate:modelValue":_cache[5]||(_cache[5]=$event=>form.value.label=$event),placeholder:kind.value?.label,label:`Name`,variant:`outlined`},null,8,[`modelValue`,`placeholder`])):createCommentVNode(``,true),kind.value?.addressLabel&&!replacing.value?(openBlock(),createBlock(VTextField,{key:3,modelValue:form.value.address,"onUpdate:modelValue":_cache[6]||(_cache[6]=$event=>form.value.address=$event),label:kind.value.addressLabel,variant:`outlined`},null,8,[`modelValue`,`label`])):createCommentVNode(``,true),form.value.kind===`github`?(openBlock(),createBlock(VRadioGroup,{key:4,modelValue:form.value.source,"onUpdate:modelValue":_cache[7]||(_cache[7]=$event=>form.value.source=$event),density:`compact`,"hide-details":``,inline:``},{default:withCtx(()=>[createVNode(VRadio,{label:`Use my GitHub CLI sign-in`,value:`github-cli`}),createVNode(VRadio,{label:`Paste a token`,value:`token`})]),_:1},8,[`modelValue`])):createCommentVNode(``,true),form.value.source===`token`?(openBlock(),createBlock(VTextField,{key:5,modelValue:form.value.token,"onUpdate:modelValue":_cache[8]||(_cache[8]=$event=>form.value.token=$event),autocomplete:`off`,label:kind.value?.tokenLabel||`Token`,type:`password`,variant:`outlined`},null,8,[`modelValue`,`label`])):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_13$4,[createVNode(VBtn,{rounded:`pill`,variant:`text`,onClick:_cache[9]||(_cache[9]=$event=>{adding.value=false;replacing.value=``})},{default:withCtx(()=>[..._cache[23]||(_cache[23]=[createTextVNode(`Cancel`,-1)])]),_:1}),createVNode(VBtn,{disabled:form.value.source===`token`&&form.value.token.length<8,loading:busy.value===`add`,color:`primary`,rounded:`pill`,variant:`flat`,onClick:addAccount},{default:withCtx(()=>[createTextVNode(toDisplayString(replacing.value?`Replace token`:`Add`),1)]),_:1},8,[`disabled`,`loading`])])])):createCommentVNode(``,true),_cache[24]||(_cache[24]=createBaseVNode(`h3`,{class:`publish-keys__heading`},`Recovery kit`,-1)),createBaseVNode(`div`,{class:normalizeClass([`publish-keys__kit`,{"is-stale":kitStale.value}])},[createVNode(VIcon,{icon:unref(mdiLifebuoy),size:`22`},null,8,[`icon`]),createBaseVNode(`div`,null,[createBaseVNode(`strong`,null,toDisplayString(!kitDate.value?`No recovery kit yet`:kitStale.value?`Your recovery kit is out of date`:`Saved ${unref(relativeTime)(kitDate.value)}`),1),kitStale.value&&installKeys.value.length?(openBlock(),createElementBlock(`span`,_hoisted_14$4,`Save a new kit: an install key is not in it yet.`)):kitStale.value?(openBlock(),createElementBlock(`span`,_hoisted_15$4,`Save a new kit so it holds every key.`)):createCommentVNode(``,true),kitStale.value&&kitDate.value?(openBlock(),createElementBlock(`span`,_hoisted_16$4,`Last saved `+toDisplayString(unref(relativeTime)(kitDate.value))+`.`,1)):(openBlock(),createElementBlock(`span`,_hoisted_17$4,`Holds every key. Keep it somewhere safe off this computer.`))]),createVNode(VBtn,{color:kitStale.value?`primary`:void 0,variant:kitStale.value?`flat`:`tonal`,rounded:`pill`,size:`small`,onClick:_cache[10]||(_cache[10]=$event=>emit(`recovery-kit`))},{default:withCtx(()=>[createTextVNode(toDisplayString(kitStale.value?`Save kit`:`Manage`),1)]),_:1},8,[`color`,`variant`])],2)],64)):createCommentVNode(``,true),error.value?(openBlock(),createBlock(VAlert,{key:3,class:`mt-3`,type:`error`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(error.value),1)]),_:1})):createCommentVNode(``,true)]),_:1}),createVNode(VCardActions,{class:`publish-dialog__actions`},{default:withCtx(()=>[createVNode(VSpacer),createVNode(VBtn,{rounded:`pill`,variant:`text`,onClick:_cache[11]||(_cache[11]=$event=>emit(`update:modelValue`,false))},{default:withCtx(()=>[..._cache[25]||(_cache[25]=[createTextVNode(`Done`,-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,[`model-value`])}}};var PublishingAccountsPanel_default=_plugin_vue_export_helper_default(_sfc_main$10,[[`__scopeId`,`data-v-8c763fe9`]]);var _hoisted_1$8={key:0,class:`publish-kit__lead`};var _hoisted_2$6={key:1,class:`publish-kit__lead`};var _sfc_main$9={__name:`RecoveryKitDialog`,props:{modelValue:{type:Boolean,default:false},state:{type:Object,default:null},call:{type:Function,required:true}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const tab=ref(`save`);const passphrase=ref(``);const repeat=ref(``);const file=ref(null);const busy=ref(false);const error=ref(``);const done=ref(``);const unlocked=computed(()=>Boolean(props.state?.keys?.unlocked));const count=computed(()=>(props.state?.keys?.entries||[]).length);watch(()=>props.modelValue,open=>{if(!open)return;tab.value=`save`;passphrase.value=repeat.value=``;file.value=null;error.value=done.value=``});function download(base64,fileName){const bytes=Uint8Array.from(atob(base64),character=>character.charCodeAt(0));const url=URL.createObjectURL(new Blob([bytes],{type:`application/octet-stream`}));const link=Object.assign(document.createElement(`a`),{href:url,download:fileName});document.body.append(link);link.click();link.remove();setTimeout(()=>URL.revokeObjectURL(url),1e3)}function asBase64(chosen){return new Promise((resolve,reject)=>{const reader=new FileReader;reader.onload=()=>resolve(String(reader.result).split(`,`)[1]||``);reader.onerror=()=>reject(new Error(`The kit file could not be read.`));reader.readAsDataURL(chosen)})}async function act(work){busy.value=true;error.value=``;try{await work()}catch(failure){error.value=failure.message}finally{busy.value=false}}const save=()=>act(async()=>{if(passphrase.value!==repeat.value)throw new Error(`The two passphrases differ.`);const kit=await props.call(`/recovery-kit`,{body:{passphrase:passphrase.value}});download(kit.data,kit.fileName);passphrase.value=repeat.value=``;done.value=`${kit.fileName} downloaded. Keep it and its passphrase somewhere safe, apart from this computer.`});const restore=()=>act(async()=>{const chosen=Array.isArray(file.value)?file.value[0]:file.value;if(!chosen)throw new Error(`Choose the kit file.`);const answer=await props.call(`/recovery-kit/restore`,{body:{data:await asBase64(chosen),passphrase:passphrase.value}});passphrase.value=``;const restoredCount=answer.restored?.length||0;done.value=`Restored ${restoredCount} ${restoredCount===1?`key`:`keys`}.`});return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,"max-width":`520`,"onUpdate:modelValue":_cache[5]||(_cache[5]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{rounded:`xl`},{default:withCtx(()=>[createVNode(VCardTitle,{class:`publish-dialog__title`},{default:withCtx(()=>[createVNode(VIcon,{icon:unref(mdiLifebuoy),class:`mr-2`,color:`primary`},null,8,[`icon`]),_cache[6]||(_cache[6]=createTextVNode(`Recovery kit`,-1))]),_:1}),createVNode(VTabs,{modelValue:tab.value,"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>tab.value=$event),class:`px-4`,color:`primary`,density:`compact`},{default:withCtx(()=>[createVNode(VTab,{value:`save`},{default:withCtx(()=>[..._cache[7]||(_cache[7]=[createTextVNode(`Save a kit`,-1)])]),_:1}),createVNode(VTab,{value:`restore`},{default:withCtx(()=>[..._cache[8]||(_cache[8]=[createTextVNode(`Restore`,-1)])]),_:1})]),_:1},8,[`modelValue`]),createVNode(VCardText,{class:`publish-kit`},{default:withCtx(()=>[tab.value===`save`?(openBlock(),createElementBlock(`p`,_hoisted_1$8,` The kit holds all `+toDisplayString(count.value)+` of your publishing keys, encrypted under a passphrase of its own. If this computer is lost, the kit restores them, so phones keep accepting your app's updates. `,1)):(openBlock(),createElementBlock(`p`,_hoisted_2$6,`Restore keys from a kit into your publishing keys on this computer.`)),!unlocked.value?(openBlock(),createBlock(VAlert,{key:2,class:`mb-3`,type:`info`,variant:`tonal`},{default:withCtx(()=>[..._cache[9]||(_cache[9]=[createTextVNode(`Unlock your publishing keys first.`,-1)])]),_:1})):createCommentVNode(``,true),tab.value===`restore`?(openBlock(),createBlock(VFileInput,{key:3,modelValue:file.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>file.value=$event),"prepend-icon":null,"prepend-inner-icon":unref(mdiUpload),accept:`.age`,label:`Kit file (.age)`,variant:`outlined`},null,8,[`modelValue`,`prepend-inner-icon`])):createCommentVNode(``,true),createVNode(VTextField,{modelValue:passphrase.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>passphrase.value=$event),hint:tab.value===`save`?`Use a different passphrase from your keys. At least 12 characters.`:``,autocomplete:`new-password`,label:`Kit passphrase`,"persistent-hint":``,type:`password`,variant:`outlined`},null,8,[`modelValue`,`hint`]),tab.value===`save`?(openBlock(),createBlock(VTextField,{key:4,modelValue:repeat.value,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>repeat.value=$event),autocomplete:`new-password`,label:`Kit passphrase again`,type:`password`,variant:`outlined`},null,8,[`modelValue`])):createCommentVNode(``,true),done.value?(openBlock(),createBlock(VAlert,{key:5,color:`success`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(done.value),1)]),_:1})):createCommentVNode(``,true),error.value?(openBlock(),createBlock(VAlert,{key:6,type:`error`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(error.value),1)]),_:1})):createCommentVNode(``,true)]),_:1}),createVNode(VCardActions,{class:`publish-dialog__actions`},{default:withCtx(()=>[createVNode(VSpacer),createVNode(VBtn,{rounded:`pill`,variant:`text`,onClick:_cache[4]||(_cache[4]=$event=>emit(`update:modelValue`,false))},{default:withCtx(()=>[..._cache[10]||(_cache[10]=[createTextVNode(`Close`,-1)])]),_:1}),tab.value===`save`?(openBlock(),createBlock(VBtn,{key:0,disabled:!unlocked.value||passphrase.value.length<12||!repeat.value,loading:busy.value,"prepend-icon":unref(mdiDownload),color:`primary`,rounded:`pill`,variant:`flat`,onClick:save},{default:withCtx(()=>[..._cache[11]||(_cache[11]=[createTextVNode(` Download kit `,-1)])]),_:1},8,[`disabled`,`loading`,`prepend-icon`])):(openBlock(),createBlock(VBtn,{key:1,disabled:!unlocked.value||passphrase.value.length<12||!file.value,loading:busy.value,color:`primary`,rounded:`pill`,variant:`flat`,onClick:restore},{default:withCtx(()=>[..._cache[12]||(_cache[12]=[createTextVNode(`Restore`,-1)])]),_:1},8,[`disabled`,`loading`]))]),_:1})]),_:1})]),_:1},8,[`model-value`])}}};var RecoveryKitDialog_default=_plugin_vue_export_helper_default(_sfc_main$9,[[`__scopeId`,`data-v-14fb34ce`]]);var _hoisted_1$7={class:`publish-release__steps`,"aria-label":`Release steps`};var _hoisted_2$5=[`disabled`];var _hoisted_3$4={class:`publish-release__package-name`};var _hoisted_4$4={key:0,class:`publish-release__muted`};var _hoisted_5$3={key:1,class:`publish-release__bumps`};var _hoisted_6$3={class:`publish-release__kind`};var _hoisted_7$3={key:0,class:`publish-release__muted`};var _hoisted_8$3={key:2,class:`publish-release__note`,role:`note`};var _hoisted_9$3={key:0};var _hoisted_10$3={key:1};var _hoisted_11$3={class:`publish-release__muted`};var _hoisted_12$3={class:`publish-release__baseline`};var _hoisted_13$3={class:`publish-release__targets`};var _hoisted_14$3={key:0,class:`publish-release__unlock`};var _hoisted_15$3={class:`publish-release__heading`};var _hoisted_16$3={key:2,class:`publish-release__checks`};var _hoisted_17$3={key:1,class:`publish-release__output`};var _hoisted_18$3={key:0,class:`publish-release__passed`};var _hoisted_19$1={key:0};var _hoisted_20$1={key:1};var _hoisted_21$1={class:`publish-release__heading`};var _hoisted_22$1={class:`publish-release__plan-id`,title:`Every release follows exactly this reviewed plan`};var _hoisted_23$1={class:`publish-release__plan`};var _hoisted_24={key:0};var _hoisted_25={key:0,class:`publish-release__blocked`};var _sfc_main$8={__name:`ReleaseDialog`,props:{modelValue:{type:Boolean,default:false},state:{type:Object,default:null},dashboardContext:{type:Object,default:()=>({})},call:{type:Function,required:true}},emits:[`update:modelValue`,`confirm`,`dry-run-started`,`accounts`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const step=ref(1);const suggestion=ref(null);const versions=ref({});const notes=ref(``);const prepared=ref(null);const selected=ref([]);const acknowledged=ref([]);const plan=ref(null);const passphrase=ref(``);const busy=ref(``);const error=ref(``);const targets=computed(()=>props.state?.targets||[]);const baseline=computed(()=>props.state?.baseline||{});const keys=computed(()=>props.state?.keys||{});const labels=computed(()=>Object.fromEntries((props.state?.destinations||[]).map(entry=>[entry.id,entry.label])));const packageLabel=computed(()=>packageLabeller(props.state?.packaging?.packages||[]));const sessionId=computed(()=>String(props.dashboardContext?.sessionId||``));const canSave=computed(()=>typeof props.dashboardContext?.requestSaveWork===`function`);const blocked=computed(()=>Boolean(plan.value?.preflight?.blocked));const needsAck=computed(()=>(plan.value?.preflight?.checks||[]).filter(check=>!check.ok&&check.severity===`ack`));const ready=computed(()=>Boolean(plan.value&&!blocked.value&&needsAck.value.every(check=>acknowledged.value.includes(check.id))));const showPassed=ref(false);const passedChecks=computed(()=>(plan.value?.preflight?.checks||[]).filter(check=>check.ok));const shownChecks=computed(()=>[...(plan.value?.preflight?.checks||[]).filter(check=>!check.ok),...showPassed.value?passedChecks.value:[]]);const checksRunning=computed(()=>props.state?.checks?.status===`running`);const checksOutput=computed(()=>props.state?.checks?.status===`failed`?props.state.checks.output||``:``);const showOutput=ref(false);const managed=computed(()=>(suggestion.value?.packages||[]).filter(entry=>!entry.external));function choicesFor(entry){return[...entry.current&&!entry.released?[{kind:`as saved`,version:entry.current}]:[],...entry.suggestions.filter(choice=>choice.version!==entry.current)]}function liveLine(entry){const live=targets.value.filter(target=>target.package===entry.id&&target.latest?.version).map(target=>target.latest.version);const saved=`Saved ${entry.current||`without a version`}`;return live.length?`${saved} · live ${[...new Set(live)].join(`, `)}`:`${saved} · not published yet`}const changes=computed(()=>managed.value.filter(entry=>versions.value[entry.id]&&versions.value[entry.id]!==entry.current));const unreleasedSaved=computed(()=>managed.value.some(entry=>entry.current&&!entry.released));const needsWriting=computed(()=>changes.value.length>0&&!prepared.value);function releaseAsSaved(){versions.value=Object.fromEntries(managed.value.map(entry=>[entry.id,entry.current]));review()}const accountsById=computed(()=>Object.fromEntries((props.state?.accounts||[]).map(entry=>[entry.id,entry])));const planSteps=computed(()=>{if(!plan.value)return[];const versionOf=id=>plan.value.packages?.find(entry=>entry.id===id)?.version||shortCommit(plan.value.savedCommit);return(plan.value.steps||[]).map(entry=>{if(entry.kind===`build`)return{id:`build:${entry.package}`,icon:mdiWrenchOutline,text:`Build ${packageLabel.value(entry.package)} ${versionOf(entry.package)} once`};if(entry.kind===`tag`)return{id:`tag:${entry.tag}`,icon:mdiTagOutline,text:`Tag the saved commit ${entry.tag}`};const target=plan.value.targets.find(candidate=>candidate.id===entry.target);const account=accountsById.value[target.account];const where=hostOf(target.settings?.registry||target.settings?.repository||``);const signed=target.destination===`android-sideload`?`signed with your install key`:``;return{id:`publish:${target.id}`,icon:destinationIcon(target.destination),text:`${labels.value[target.destination]||target.destination}: ${packageLabel.value(target.package)} ${versionOf(target.package)}`,detail:[account?.label,where,signed].filter(Boolean).join(` · `)}})});const blockedHint=computed(()=>{if(!plan.value)return``;if(blocked.value)return`Fix what is marked in red to continue.`;if(!ready.value)return`Confirm what is marked in amber to continue.`;return``});watch(()=>props.modelValue,async open=>{if(!open)return;step.value=1;error.value=``;prepared.value=null;plan.value=null;acknowledged.value=[];selected.value=targets.value.map(target=>target.id);busy.value=`suggest`;try{suggestion.value=await props.call(`/release/suggestion`,{method:`GET`,refreshAfter:false});versions.value=Object.fromEntries(suggestion.value.packages.filter(entry=>!entry.external).map(entry=>[entry.id,choicesFor(entry)[0].version]));notes.value=suggestion.value.notes||``}catch(failure){error.value=failure.message}finally{busy.value=``}});watch(()=>[props.state?.baseline?.commit,props.state?.checks?.status],()=>{if(props.modelValue&&step.value===2&&busy.value!==`plan`)review()});async function run(name,work){busy.value=name;error.value=``;try{return await work()}catch(failure){error.value=failure.message;return null}finally{busy.value=``}}const prepare=()=>run(`prepare`,async()=>{const chosen=Object.fromEntries(changes.value.map(entry=>[entry.id,versions.value[entry.id]]));prepared.value=await props.call(`/release/prepare`,{body:{sessionId:sessionId.value,versions:chosen,notes:notes.value},refreshAfter:false});await props.dashboardContext?.refreshSessionWork?.()});async function save(){await props.dashboardContext.requestSaveWork()}const review=()=>run(`plan`,async()=>{step.value=2;const answer=await props.call(`/plan`,{body:{targetIds:selected.value,acknowledged:acknowledged.value},refreshAfter:false});plan.value=answer.plan});const unlock=()=>run(`unlock`,async()=>{await props.call(`/keys/unlock`,{body:{passphrase:passphrase.value}});passphrase.value=``;busy.value=``;await review()});const runChecks=()=>run(`checks`,()=>props.call(`/checks`));const pushSaved=()=>run(`push`,async()=>{await props.call(`/baseline/push`);busy.value=``;await review()});const dryRun=()=>run(`dry-run`,async()=>{const answer=await props.call(`/dry-run`,{body:{planHash:plan.value.planHash,targetIds:selected.value,acknowledged:acknowledged.value}});emit(`dry-run-started`,answer.releaseId);emit(`update:modelValue`,false)});function publish(){emit(`confirm`,{plan:plan.value,targetIds:[...selected.value],acknowledged:[...acknowledged.value]})}function checkIcon(check){if(check.ok)return{icon:mdiCheckCircle,color:`success`};return check.severity===`block`?{icon:mdiCloseCircle,color:`error`}:{icon:mdiAlertCircle,color:`warning`}}return(_ctx,_cache)=>{return openBlock(),createBlock(VDialog,{"model-value":__props.modelValue,"max-width":`720`,scrollable:``,"onUpdate:modelValue":_cache[10]||(_cache[10]=$event=>emit(`update:modelValue`,$event))},{default:withCtx(()=>[createVNode(VCard,{class:`publish-release`,rounded:`xl`},{default:withCtx(()=>[createVNode(VCardTitle,{class:`publish-dialog__title`},{default:withCtx(()=>[..._cache[11]||(_cache[11]=[createTextVNode(`Release`,-1)])]),_:1}),createBaseVNode(`nav`,_hoisted_1$7,[createBaseVNode(`button`,{class:normalizeClass({"is-current":step.value===1}),type:`button`,onClick:_cache[0]||(_cache[0]=$event=>step.value=1)},[..._cache[12]||(_cache[12]=[createBaseVNode(`span`,null,`1`,-1),createTextVNode(` Version`,-1)])],2),_cache[14]||(_cache[14]=createBaseVNode(`span`,{class:`publish-release__rule`,"aria-hidden":`true`},null,-1)),createBaseVNode(`button`,{class:normalizeClass({"is-current":step.value===2}),disabled:!targets.value.length,type:`button`,onClick:review},[..._cache[13]||(_cache[13]=[createBaseVNode(`span`,null,`2`,-1),createTextVNode(` Review & publish`,-1)])],10,_hoisted_2$5)]),createVNode(VCardText,{class:`publish-release__body`},{default:withCtx(()=>[step.value===1?(openBlock(),createElementBlock(Fragment,{key:0},[busy.value===`suggest`?(openBlock(),createBlock(VSkeletonLoader,{key:0,type:`list-item-two-line, list-item-two-line`})):(openBlock(),createElementBlock(Fragment,{key:1},[_cache[18]||(_cache[18]=createBaseVNode(`p`,{class:`publish-release__lead`},` Choose the version people get. A new version is written with its changelog into your session for you to Save; releases always use the saved commit. `,-1)),(openBlock(true),createElementBlock(Fragment,null,renderList(suggestion.value?.packages||[],entry=>{return openBlock(),createElementBlock(`div`,{key:entry.id,class:`publish-release__package`},[createBaseVNode(`div`,_hoisted_3$4,[createBaseVNode(`strong`,null,toDisplayString(entry.label),1),createBaseVNode(`span`,null,toDisplayString(liveLine(entry)),1)]),entry.external?(openBlock(),createElementBlock(`span`,_hoisted_4$4,`Set by the project's own build.`)):(openBlock(),createElementBlock(`div`,_hoisted_5$3,[createVNode(VChipGroup,{modelValue:versions.value[entry.id],"onUpdate:modelValue":$event=>versions.value[entry.id]=$event,color:`primary`,column:``,mandatory:``},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(choicesFor(entry),choice=>{return openBlock(),createBlock(VChip,{key:choice.kind,value:choice.version,filter:``,rounded:`pill`,variant:`outlined`},{default:withCtx(()=>[createTextVNode(toDisplayString(choice.version),1),createBaseVNode(`span`,_hoisted_6$3,toDisplayString(choice.kind),1)]),_:2},1032,[`value`])}),128))]),_:2},1032,[`modelValue`,`onUpdate:modelValue`])]))])}),128)),suggestion.value&&!suggestion.value.packages.length?(openBlock(),createElementBlock(`p`,_hoisted_7$3,`No package has a version Vibe64 manages. Release the saved commit as it is.`)):createCommentVNode(``,true),needsWriting.value||prepared.value?(openBlock(),createBlock(VTextarea,{key:1,modelValue:notes.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>notes.value=$event),"auto-grow":``,class:`mt-2`,label:`What's new`,"max-rows":`10`,rows:`4`,variant:`outlined`},null,8,[`modelValue`])):createCommentVNode(``,true),needsWriting.value&&!sessionId.value?(openBlock(),createElementBlock(`div`,_hoisted_8$3,[createVNode(VIcon,{icon:unref(mdiInformationOutline),size:`18`},null,8,[`icon`]),unreleasedSaved.value?(openBlock(),createElementBlock(`span`,_hoisted_9$3,[..._cache[15]||(_cache[15]=[createTextVNode(`Writing a new version needs a session. Start one with `,-1),createBaseVNode(`strong`,null,`+`,-1),createTextVNode(` and open Publish from it, or release what is saved as it is.`,-1)])])):(openBlock(),createElementBlock(`span`,_hoisted_10$3,[..._cache[16]||(_cache[16]=[createTextVNode(`The saved version is already published. Writing a new one needs a session: start one with `,-1),createBaseVNode(`strong`,null,`+`,-1),createTextVNode(` and open Publish from it.`,-1)])]))])):createCommentVNode(``,true),prepared.value?(openBlock(),createBlock(VAlert,{key:3,class:`publish-release__prepared`,color:`success`,variant:`tonal`},{default:withCtx(()=>[_cache[17]||(_cache[17]=createBaseVNode(`strong`,null,`Written into this session:`,-1)),createTextVNode(` `+toDisplayString(prepared.value.packages.map(entry=>`${entry.id} ${entry.previousVersion||`–`} → ${entry.version}`).join(`, `))+` `,1),createBaseVNode(`div`,_hoisted_11$3,toDisplayString(prepared.value.packages.flatMap(entry=>entry.files).join(` · `)),1)]),_:1})):createCommentVNode(``,true)],64))],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`div`,_hoisted_12$3,[createVNode(VIcon,{icon:unref(mdiSourceCommit),size:`18`},null,8,[`icon`]),createBaseVNode(`span`,null,[_cache[19]||(_cache[19]=createTextVNode(`Saved commit `,-1)),createBaseVNode(`code`,null,toDisplayString(unref(shortCommit)(baseline.value.commit)),1),createTextVNode(` on `+toDisplayString(baseline.value.branch),1)]),createVNode(VChip,{color:baseline.value.pushed?`success`:`warning`,size:`x-small`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(baseline.value.pushed?`pushed`:`not pushed`),1)]),_:1},8,[`color`])]),_cache[24]||(_cache[24]=createBaseVNode(`h3`,{class:`publish-release__heading`},`Targets`,-1)),createBaseVNode(`div`,_hoisted_13$3,[(openBlock(true),createElementBlock(Fragment,null,renderList(targets.value,target=>{return openBlock(),createBlock(VCheckbox,{key:target.id,modelValue:selected.value,"onUpdate:modelValue":[_cache[2]||(_cache[2]=$event=>selected.value=$event),review],value:target.id,density:`compact`,"hide-details":``},{label:withCtx(()=>[createVNode(VIcon,{icon:unref(destinationIcon)(target.destination),class:`mr-2`,size:`18`},null,8,[`icon`]),createTextVNode(` `+toDisplayString(labels.value[target.destination]||target.destination)+` · `+toDisplayString(packageLabel.value(target.package)),1)]),_:2},1032,[`modelValue`,`value`])}),128))]),keys.value.exists&&!keys.value.unlocked?(openBlock(),createElementBlock(`div`,_hoisted_14$3,[createVNode(VTextField,{modelValue:passphrase.value,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>passphrase.value=$event),"prepend-inner-icon":unref(mdiLockOutline),autocomplete:`current-password`,density:`comfortable`,"hide-details":``,label:`Unlock publishing keys to check sign-ins`,type:`password`,variant:`outlined`,onKeydown:withKeys(unlock,[`enter`])},null,8,[`modelValue`,`prepend-inner-icon`]),createVNode(VBtn,{disabled:passphrase.value.length<12,loading:busy.value===`unlock`,color:`primary`,rounded:`pill`,variant:`flat`,onClick:unlock},{default:withCtx(()=>[..._cache[20]||(_cache[20]=[createTextVNode(`Unlock`,-1)])]),_:1},8,[`disabled`,`loading`])])):createCommentVNode(``,true),createBaseVNode(`h3`,_hoisted_15$3,[_cache[21]||(_cache[21]=createTextVNode(` Before publishing `,-1)),createVNode(VBtn,{icon:unref(mdiRefresh),loading:busy.value===`plan`,"aria-label":`Check again`,class:`ml-auto`,size:`small`,variant:`text`,onClick:review},null,8,[`icon`,`loading`])]),busy.value===`plan`&&!plan.value?(openBlock(),createBlock(VSkeletonLoader,{key:1,type:`list-item, list-item, list-item`})):plan.value?(openBlock(),createElementBlock(`ul`,_hoisted_16$3,[(openBlock(true),createElementBlock(Fragment,null,renderList(shownChecks.value,check=>{return openBlock(),createElementBlock(`li`,{key:check.id,class:normalizeClass({"is-failed":!check.ok&&check.severity===`block`,"is-warning":!check.ok&&check.severity!==`block`})},[createVNode(VIcon,mergeProps({ref_for:true},checkIcon(check),{size:`20`}),null,16),createBaseVNode(`div`,null,[createBaseVNode(`strong`,null,toDisplayString(check.label),1),createBaseVNode(`span`,null,toDisplayString(check.id===`verification-passed`&&!check.ok&&__props.state?.checks?.failedCommand?`${__props.state.checks.failedCommand} failed on the saved commit.`:check.message),1),check.id===`verification-passed`&&checksOutput.value?(openBlock(),createElementBlock(`button`,{key:0,class:`publish-release__output-toggle`,type:`button`,onClick:_cache[4]||(_cache[4]=$event=>showOutput.value=!showOutput.value)},toDisplayString(showOutput.value?`Hide output`:`Show output`),1)):createCommentVNode(``,true),check.id===`verification-passed`&&showOutput.value&&checksOutput.value?(openBlock(),createElementBlock(`pre`,_hoisted_17$3,toDisplayString(checksOutput.value),1)):createCommentVNode(``,true)]),check.id===`verification-passed`&&!check.ok?(openBlock(),createBlock(VBtn,{key:0,loading:checksRunning.value||busy.value===`checks`,rounded:`pill`,size:`small`,variant:`tonal`,onClick:runChecks},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.state?.checks?.status===`failed`?`Run again`:`Run checks`),1)]),_:1},8,[`loading`])):check.id===`baseline-saved-pushed`&&!check.ok&&baseline.value.saved&&!baseline.value.pushed&&baseline.value.remote?(openBlock(),createBlock(VBtn,{key:1,loading:busy.value===`push`,rounded:`pill`,size:`small`,variant:`tonal`,onClick:pushSaved},{default:withCtx(()=>[createTextVNode(` Push to `+toDisplayString(baseline.value.remote.name),1)]),_:1},8,[`loading`])):check.id===`credentials-valid`&&!check.ok?(openBlock(),createBlock(VBtn,{key:2,"prepend-icon":unref(mdiAccountKeyOutline),rounded:`pill`,size:`small`,variant:`tonal`,onClick:_cache[5]||(_cache[5]=$event=>emit(`accounts`))},{default:withCtx(()=>[..._cache[22]||(_cache[22]=[createTextVNode(` Fix sign-in `,-1)])]),_:1},8,[`prepend-icon`])):!check.ok&&check.severity===`ack`?(openBlock(),createBlock(VCheckbox,{key:3,modelValue:acknowledged.value,"onUpdate:modelValue":_cache[6]||(_cache[6]=$event=>acknowledged.value=$event),value:check.id,density:`compact`,"hide-details":``,label:`I understand`},null,8,[`modelValue`,`value`])):createCommentVNode(``,true)],2)}),128)),passedChecks.value.length?(openBlock(),createElementBlock(`li`,_hoisted_18$3,[createBaseVNode(`button`,{type:`button`,onClick:_cache[7]||(_cache[7]=$event=>showPassed.value=!showPassed.value)},[createVNode(VIcon,{icon:unref(mdiCheckCircle),color:`success`,size:`20`},null,8,[`icon`]),passedChecks.value.length===(plan.value.preflight?.checks||[]).length?(openBlock(),createElementBlock(`span`,_hoisted_19$1,[createTextVNode(`All `+toDisplayString(passedChecks.value.length)+` checks passed`,1),createBaseVNode(`em`,null,toDisplayString(showPassed.value?`Hide`:`Show`),1)])):(openBlock(),createElementBlock(`span`,_hoisted_20$1,toDisplayString(showPassed.value?`Hide`:`Show`)+` `+toDisplayString(passedChecks.value.length)+` passed `+toDisplayString(passedChecks.value.length===1?`check`:`checks`),1))])])):createCommentVNode(``,true)])):createCommentVNode(``,true),plan.value&&planSteps.value.length?(openBlock(),createElementBlock(Fragment,{key:3},[createBaseVNode(`h3`,_hoisted_21$1,[_cache[23]||(_cache[23]=createTextVNode(` What happens `,-1)),createBaseVNode(`span`,_hoisted_22$1,`Plan `+toDisplayString(plan.value.planId),1)]),createBaseVNode(`ol`,_hoisted_23$1,[(openBlock(true),createElementBlock(Fragment,null,renderList(planSteps.value,entry=>{return openBlock(),createElementBlock(`li`,{key:entry.id},[createVNode(VIcon,{icon:entry.icon,size:`18`},null,8,[`icon`]),createBaseVNode(`span`,null,[createTextVNode(toDisplayString(entry.text),1),entry.detail?(openBlock(),createElementBlock(`em`,_hoisted_24,toDisplayString(entry.detail),1)):createCommentVNode(``,true)])])}),128))])],64)):createCommentVNode(``,true)],64)),error.value?(openBlock(),createBlock(VAlert,{key:2,class:`mt-4`,type:`error`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(error.value),1)]),_:1})):createCommentVNode(``,true)]),_:1}),createVNode(VCardActions,{class:`publish-dialog__actions`},{default:withCtx(()=>[step.value===1?(openBlock(),createElementBlock(Fragment,{key:0},[createVNode(VBtn,{rounded:`pill`,variant:`text`,onClick:_cache[8]||(_cache[8]=$event=>emit(`update:modelValue`,false))},{default:withCtx(()=>[..._cache[25]||(_cache[25]=[createTextVNode(`Cancel`,-1)])]),_:1}),createVNode(VSpacer),needsWriting.value?(openBlock(),createElementBlock(Fragment,{key:0},[!sessionId.value&&unreleasedSaved.value?(openBlock(),createBlock(VBtn,{key:0,rounded:`pill`,variant:`tonal`,onClick:releaseAsSaved},{default:withCtx(()=>[..._cache[26]||(_cache[26]=[createTextVNode(`Release as saved`,-1)])]),_:1})):createCommentVNode(``,true),createVNode(VBtn,{disabled:!sessionId.value,loading:busy.value===`prepare`,"prepend-icon":unref(mdiPencilOutline),color:`primary`,rounded:`pill`,variant:`flat`,onClick:prepare},{default:withCtx(()=>[createTextVNode(` Write `+toDisplayString(changes.value.length===1?versions.value[changes.value[0].id]:`versions`),1)]),_:1},8,[`disabled`,`loading`,`prepend-icon`])],64)):(openBlock(),createElementBlock(Fragment,{key:1},[prepared.value&&canSave.value?(openBlock(),createBlock(VBtn,{key:0,"prepend-icon":unref(mdiContentSaveOutline),rounded:`pill`,variant:`tonal`,onClick:save},{default:withCtx(()=>[..._cache[27]||(_cache[27]=[createTextVNode(`Save`,-1)])]),_:1},8,[`prepend-icon`])):createCommentVNode(``,true),createVNode(VBtn,{"append-icon":unref(mdiArrowRight),color:`primary`,"data-test":`release-continue`,rounded:`pill`,variant:`flat`,onClick:review},{default:withCtx(()=>[..._cache[28]||(_cache[28]=[createTextVNode(`Continue`,-1)])]),_:1},8,[`append-icon`])],64))],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createVNode(VBtn,{rounded:`pill`,variant:`text`,onClick:_cache[9]||(_cache[9]=$event=>emit(`update:modelValue`,false))},{default:withCtx(()=>[..._cache[29]||(_cache[29]=[createTextVNode(`Close`,-1)])]),_:1}),createVNode(VSpacer),blockedHint.value?(openBlock(),createElementBlock(`span`,_hoisted_25,toDisplayString(blockedHint.value),1)):createCommentVNode(``,true),createVNode(VBtn,{disabled:!ready.value,loading:busy.value===`dry-run`,"prepend-icon":unref(mdiTestTube),rounded:`pill`,variant:`tonal`,onClick:dryRun},{default:withCtx(()=>[..._cache[30]||(_cache[30]=[createTextVNode(`Dry run`,-1)])]),_:1},8,[`disabled`,`loading`,`prepend-icon`]),createVNode(VBtn,{disabled:!ready.value,"prepend-icon":unref(mdiRocketLaunchOutline),color:`primary`,rounded:`pill`,variant:`flat`,onClick:publish},{default:withCtx(()=>[..._cache[31]||(_cache[31]=[createTextVNode(`Publish…`,-1)])]),_:1},8,[`disabled`,`prepend-icon`])],64))]),_:1})]),_:1})]),_:1},8,[`model-value`])}}};var ReleaseDialog_default=_plugin_vue_export_helper_default(_sfc_main$8,[[`__scopeId`,`data-v-f02db937`]]);var _hoisted_1$6={class:`publish-history`,"aria-labelledby":`publish-history-title`};var _hoisted_2$4={key:0,class:`publish-history__empty`};var _hoisted_3$3={key:1,class:`publish-history__list`};var _hoisted_4$3=[`data-release`];var _hoisted_5$2=[`aria-expanded`,`onClick`];var _hoisted_6$2={class:`publish-history__what`};var _hoisted_7$2={key:1,class:`publish-history__detail`};var _hoisted_8$2={class:`publish-history__steps`};var _hoisted_9$2={class:`publish-history__message`};var _hoisted_10$2={key:0,class:`publish-history__outcomes`};var _hoisted_11$2={class:`publish-history__target`};var _hoisted_12$2={key:0,class:`publish-history__error`};var _hoisted_13$2={key:1,class:`publish-history__proof`};var _hoisted_14$2={key:2,class:`publish-history__apk`};var _hoisted_15$2={key:1,class:`publish-history__error`};var _hoisted_16$2={key:2,class:`publish-history__log publish-history__log--failure`};var _hoisted_17$2={class:`publish-history__tools`};var _hoisted_18$2={key:3,class:`publish-history__log`};var _sfc_main$7={__name:`ReleaseHistory`,props:{releases:{type:Array,default:()=>[]},targets:{type:Array,default:()=>[]},destinations:{type:Array,default:()=>[]},activeRelease:{type:String,default:``},savedCommit:{type:String,default:``},packages:{type:Array,default:()=>[]},call:{type:Function,required:true}},emits:[`install`,`resume`,`release`],setup(__props,{expose:__expose,emit:__emit}){const props=__props;const emit=__emit;const open=ref(``);const label=computed(()=>packageLabeller(props.packages));const logs=ref({});const targetsById=computed(()=>{const labels=Object.fromEntries(props.destinations.map(entry=>[entry.id,entry.shortLabel||entry.label]));return Object.fromEntries(props.targets.map(target=>[target.id,{...target,destinationLabel:labels[target.destination]}]))});function outcomeLabel(release){if(release.kind===`dry-run`&&release.status===`succeeded`)return`Would publish — nothing was sent`;return statusInfo(release.status).label}const FAILED=[`failed`,`partial`,`interrupted`];const latestFailedRelease=computed(()=>{const newest=props.releases.find(entry=>entry.kind===`release`);return newest&&FAILED.includes(newest.status)?newest.id:``});const showFull=ref({});function toggle(id){open.value=open.value===id?``:id;const release=props.releases.find(entry=>entry.id===id);if(open.value&&FAILED.includes(release?.status)&&!logs.value[id])showLog(id)}function failureOutput(id){return(logs.value[id]||[]).filter(line=>line.level===`error`).map(line=>line.message).slice(1).join(`
|
|
2
|
-
`).trim()||``}async function reveal(id){open.value=id;await nextTick();showFull.value={...showFull.value,[id]:false};document.querySelector(`[data-release="${CSS.escape(id)}"]`)?.scrollIntoView({behavior:`smooth`,block:`start`});if(!logs.value[id])await showLog(id)}__expose({reveal});function targetName(release,targetId){const target=targetsById.value[targetId];const destination=target?.destination||release.targets?.[targetId]?.destination;const where=target?.destinationLabel||props.destinations.find(entry=>entry.id===destination)?.label||destination||``;return{icon:destinationIcon(destination),text:`${where} · ${label.value(target?.package||release.targets?.[targetId]?.package||targetId)}`}}async function showLog(id){const answer=await props.call(`/releases/${encodeURIComponent(id)}/logs`,{method:`GET`,refreshAfter:false}).catch(error=>({log:[{message:error.message}]}));logs.value={...logs.value,[id]:answer.log||[]}}function versionsLine(release){return Object.entries(release.versions||{}).map(([id,version])=>`${label.value(id)} ${version}`).join(` · `)||shortCommit(release.savedCommit)}function progress(release){const steps=release.steps||[];if(!steps.length)return 0;return Math.round(100*steps.filter(entry=>[`done`,`failed`,`skipped`].includes(entry.status)).length/steps.length)}function isApk(release,targetId){return targetsById.value[targetId]?.destination===`android-sideload`||release.targets?.[targetId]?.destination===`android-sideload`}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1$6,[_cache[5]||(_cache[5]=createBaseVNode(`h2`,{id:`publish-history-title`,class:`publish-section-title`},`History`,-1)),!__props.releases.length?(openBlock(),createElementBlock(`p`,_hoisted_2$4,`Releases and dry runs appear here, with every step and the proof of what was published.`)):(openBlock(),createElementBlock(`ol`,_hoisted_3$3,[(openBlock(true),createElementBlock(Fragment,null,renderList(__props.releases,release=>{return openBlock(),createElementBlock(`li`,{key:release.id,class:normalizeClass({"is-open":open.value===release.id}),"data-release":release.id},[createBaseVNode(`button`,{class:`publish-history__row`,type:`button`,"aria-expanded":open.value===release.id,onClick:$event=>toggle(release.id)},[createVNode(VIcon,{color:unref(statusInfo)(release.status).color,icon:release.status===`running`?release.kind===`dry-run`?unref(mdiTestTube):unref(mdiRocketLaunchOutline):unref(statusInfo)(release.status).icon,size:`22`},null,8,[`color`,`icon`]),createBaseVNode(`span`,_hoisted_6$2,[createBaseVNode(`strong`,null,toDisplayString(release.kind===`dry-run`?`Dry run`:`Release`)+` · `+toDisplayString(versionsLine(release)),1),createBaseVNode(`span`,null,toDisplayString(outcomeLabel(release))+` · `+toDisplayString(unref(relativeTime)(release.finishedAt||release.createdAt))+` · plan `+toDisplayString(release.planId),1)]),createVNode(VIcon,{icon:unref(mdiChevronDown),class:`publish-history__chevron`,size:`20`},null,8,[`icon`])],8,_hoisted_5$2),release.status===`running`?(openBlock(),createBlock(VProgressLinear,{key:0,"model-value":progress(release),color:`primary`,height:`3`},null,8,[`model-value`])):createCommentVNode(``,true),open.value===release.id||release.status===`running`?(openBlock(),createElementBlock(`div`,_hoisted_7$2,[createBaseVNode(`ol`,_hoisted_8$2,[(openBlock(true),createElementBlock(Fragment,null,renderList(release.steps,entry=>{return openBlock(),createElementBlock(`li`,{key:entry.id},[createVNode(VIcon,{color:unref(statusInfo)(entry.status).color,icon:unref(statusInfo)(entry.status).icon,size:`16`},null,8,[`color`,`icon`]),createBaseVNode(`span`,null,toDisplayString(unref(stepLabel)(entry.id,targetsById.value,label.value)),1),createBaseVNode(`span`,_hoisted_9$2,toDisplayString(entry.message),1)])}),128))]),Object.keys(release.targets||{}).length?(openBlock(),createElementBlock(`ul`,_hoisted_10$2,[(openBlock(true),createElementBlock(Fragment,null,renderList(release.targets,(outcome,targetId)=>{return openBlock(),createElementBlock(`li`,{key:targetId},[createBaseVNode(`strong`,_hoisted_11$2,[createVNode(VIcon,{icon:targetName(release,targetId).icon,size:`16`},null,8,[`icon`]),createTextVNode(toDisplayString(targetName(release,targetId).text),1)]),outcome.error?(openBlock(),createElementBlock(`span`,_hoisted_12$2,toDisplayString(outcome.error.message),1)):(openBlock(),createElementBlock(`span`,_hoisted_13$2,toDisplayString(outcome.alreadyPublished?`already published · `:``)+toDisplayString(unref(proofLine)({checksum:outcome.checksum,...outcome.proof})||unref(statusInfo)(outcome.status).label),1)),release.kind===`release`&&outcome.status===`proven`&&isApk(release,targetId)?(openBlock(),createElementBlock(`span`,_hoisted_14$2,[createVNode(VBtn,{href:unref(apkDownloadUrl)(release.id,targetId),"prepend-icon":unref(mdiDownload),rounded:`pill`,size:`small`,variant:`text`},{default:withCtx(()=>[..._cache[1]||(_cache[1]=[createTextVNode(`APK`,-1)])]),_:1},8,[`href`,`prepend-icon`]),createVNode(VBtn,{"prepend-icon":unref(mdiQrcode),rounded:`pill`,size:`small`,variant:`text`,onClick:$event=>emit(`install`,{releaseId:release.id,targetId})},{default:withCtx(()=>[..._cache[2]||(_cache[2]=[createTextVNode(`QR`,-1)])]),_:1},8,[`prepend-icon`,`onClick`])])):createCommentVNode(``,true)])}),128))])):createCommentVNode(``,true),release.error?(openBlock(),createElementBlock(`p`,_hoisted_15$2,toDisplayString(release.error.message),1)):createCommentVNode(``,true),FAILED.includes(release.status)&&failureOutput(release.id)&&!showFull.value[release.id]?(openBlock(),createElementBlock(`pre`,_hoisted_16$2,toDisplayString(failureOutput(release.id)),1)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_17$2,[release.kind===`release`&&FAILED.includes(release.status)&&release.id===latestFailedRelease.value?(openBlock(),createElementBlock(Fragment,{key:0},[!__props.savedCommit||__props.savedCommit===release.savedCommit?(openBlock(),createBlock(VBtn,{key:0,"prepend-icon":unref(mdiReplay),rounded:`pill`,size:`small`,variant:`tonal`,onClick:$event=>emit(`resume`,release)},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(` Finish this release `,-1)])]),_:1},8,[`prepend-icon`,`onClick`])):(openBlock(),createBlock(VBtn,{key:1,"prepend-icon":unref(mdiRocketLaunchOutline),rounded:`pill`,size:`small`,variant:`tonal`,onClick:_cache[0]||(_cache[0]=$event=>emit(`release`))},{default:withCtx(()=>[..._cache[4]||(_cache[4]=[createTextVNode(` Release the new saved work `,-1)])]),_:1},8,[`prepend-icon`]))],64)):createCommentVNode(``,true),createVNode(VBtn,{rounded:`pill`,size:`small`,variant:`text`,onClick:$event=>{showFull.value={...showFull.value,[release.id]:!showFull.value[release.id]};showLog(release.id)}},{default:withCtx(()=>[createTextVNode(toDisplayString(showFull.value[release.id]?`Hide full log`:`Full log`),1)]),_:2},1032,[`onClick`])]),logs.value[release.id]&&showFull.value[release.id]?(openBlock(),createElementBlock(`pre`,_hoisted_18$2,toDisplayString(logs.value[release.id].map(line=>`${line.at?line.at.slice(11,19)+` `:``}${line.message}`).join(`
|
|
3
|
-
`)||`No log lines.`),1)):createCommentVNode(``,true)])):createCommentVNode(``,true)],10,_hoisted_4$3)}),128))]))])}}};var ReleaseHistory_default=_plugin_vue_export_helper_default(_sfc_main$7,[[`__scopeId`,`data-v-d3846248`]]);var _hoisted_1$5=[`data-target`];var _hoisted_2$3={class:`publish-target__head`};var _hoisted_3$2={class:`publish-target__icon`,"aria-hidden":`true`};var _hoisted_4$2={class:`publish-target__title`};var _hoisted_5$1={class:`publish-target__version`,"aria-live":`polite`};var _hoisted_6$1={class:`publish-target__pending`};var _hoisted_7$1={class:`publish-target__live`};var _hoisted_8$1={class:`publish-target__facts`};var _hoisted_9$1={key:0};var _hoisted_10$1={class:`publish-target__verified-files`};var _hoisted_11$1=[`title`];var _hoisted_12$1={class:`publish-target__file-lines`};var _hoisted_13$1={class:`publish-target__file`};var _hoisted_14$1={class:`publish-target__mono`};var _hoisted_15$1={key:1};var _hoisted_16$1=[`title`];var _hoisted_17$1={class:`publish-target__mono`};var _hoisted_18$1={key:1,class:`publish-target__actions`};var _sfc_main$6={__name:`TargetCard`,props:{target:{type:Object,required:true},destination:{type:Object,default:null},packageInfo:{type:Object,default:null},accounts:{type:Array,default:()=>[]},busy:{type:Boolean,default:false},waiting:{type:String,default:``},activity:{type:Object,default:()=>({})}},emits:[`remove`,`change-account`,`show-release`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const accent=computed(()=>destinationAccent(props.target.destination));const latest=computed(()=>props.target.latest||null);const account=computed(()=>props.accounts.find(entry=>entry.id===props.target.account)||null);const proof=computed(()=>latest.value?proofLine({checksum:latest.value.checksum,...latest.value.proof,url:``}):``);const proofFiles=computed(()=>{const facts=latest.value?.proof||{};return(Array.isArray(facts.files)&&facts.files.length?facts.files:Array.isArray(facts.assets)?facts.assets:[]).filter(file=>file?.name&&/^sha256:[0-9a-f]{64}$/u.test(String(file.sha256||``))).map(file=>({name:file.name,sha256:String(file.sha256).slice(7)}))});const accountChoices=computed(()=>props.accounts.filter(entry=>entry.kind===props.destination?.accountKind));const pageUrl=computed(()=>{const proofFacts=latest.value?.proof||{};if(proofFacts.page)return proofFacts.page;return proofFacts.package?publicPageUrl(props.target.destination,{package:proofFacts.package,version:latest.value.version,settings:props.target.settings}):``});const failure=computed(()=>props.activity?.failure||null);return(_ctx,_cache)=>{return openBlock(),createElementBlock(`article`,{class:normalizeClass([`publish-target`,[`publish-target--${accent.value}`,{"is-running":__props.activity.running,"is-live":latest.value&&!__props.activity.running}]]),"data-target":__props.target.id},[createBaseVNode(`header`,_hoisted_2$3,[createBaseVNode(`span`,_hoisted_3$2,[createVNode(VIcon,{icon:unref(destinationIcon)(__props.target.destination),size:`22`},null,8,[`icon`])]),createBaseVNode(`div`,_hoisted_4$2,[createBaseVNode(`h3`,null,toDisplayString(__props.destination?.label||__props.target.destination),1),createBaseVNode(`p`,null,[createTextVNode(toDisplayString(__props.packageInfo?.label||__props.target.package),1),account.value?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` · `+toDisplayString(account.value.label),1)],64)):createCommentVNode(``,true)])]),createVNode(VMenu,{location:`bottom end`},{activator:withCtx(({props:menu})=>[createVNode(VBtn,mergeProps(menu,{"aria-label":`More for ${__props.target.id}`,disabled:__props.busy,icon:unref(mdiDotsVertical),size:`small`,variant:`text`}),null,16,[`aria-label`,`disabled`,`icon`])]),default:withCtx(()=>[createVNode(VList,{density:`compact`,"min-width":`220`},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(accountChoices.value,choice=>{return openBlock(),createBlock(VListItem,{key:choice.id,active:choice.id===__props.target.account,"prepend-icon":unref(mdiAccountKeyOutline),title:`Use ${choice.label}`,onClick:$event=>emit(`change-account`,choice.id)},null,8,[`active`,`prepend-icon`,`title`,`onClick`])}),128)),createVNode(VListItem,{"prepend-icon":unref(mdiTrashCanOutline),"base-color":`error`,title:`Remove target`,onClick:_cache[0]||(_cache[0]=$event=>emit(`remove`))},null,8,[`prepend-icon`])]),_:1})]),_:1})]),createBaseVNode(`div`,_hoisted_5$1,[__props.activity.running?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode(`strong`,_hoisted_6$1,toDisplayString(__props.activity.version?`Publishing ${__props.activity.version}`:`Publishing`)+`…`,1),createVNode(VProgressLinear,{class:`publish-target__progress`,color:`primary`,indeterminate:``,rounded:``})],64)):latest.value?(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode(`strong`,null,toDisplayString(latest.value.version),1),createBaseVNode(`span`,_hoisted_7$1,[_cache[2]||(_cache[2]=createBaseVNode(`i`,{"aria-hidden":`true`},null,-1)),createTextVNode(`Live · published `+toDisplayString(unref(relativeTime)(latest.value.at)),1)])],64)):(openBlock(),createElementBlock(Fragment,{key:2},[_cache[3]||(_cache[3]=createBaseVNode(`strong`,{class:`publish-target__none`},`Not published yet`,-1)),createBaseVNode(`span`,null,toDisplayString(__props.waiting||`Ready for its first release`),1)],64))]),failure.value&&!__props.activity.running?(openBlock(),createElementBlock(`button`,{key:0,class:`publish-target__failure`,type:`button`,onClick:_cache[1]||(_cache[1]=$event=>emit(`show-release`,failure.value.release.id))},[createVNode(VIcon,{icon:unref(mdiAlertCircleOutline),size:`18`},null,8,[`icon`]),createBaseVNode(`span`,null,[_cache[4]||(_cache[4]=createBaseVNode(`strong`,null,`Last release failed.`,-1)),createTextVNode(` `+toDisplayString(failure.value.message),1)])])):createCommentVNode(``,true),createBaseVNode(`dl`,_hoisted_8$1,[renderSlot(_ctx.$slots,`facts`,{},void 0,true),proofFiles.value.length&&!__props.activity.running?(openBlock(),createElementBlock(`div`,_hoisted_9$1,[_cache[5]||(_cache[5]=createBaseVNode(`dt`,null,`Verified`,-1)),createBaseVNode(`dd`,_hoisted_10$1,[(openBlock(true),createElementBlock(Fragment,null,renderList(proofFiles.value,file=>{return openBlock(),createElementBlock(`span`,{key:file.name,class:`publish-target__verified publish-target__verified--file`,title:`Read back from ${__props.destination?.label||`the destination`} after publishing: ${file.name} sha256 ${file.sha256}`},[createVNode(VIcon,{icon:unref(mdiCheckDecagram),color:`success`,size:`16`},null,8,[`icon`]),createBaseVNode(`span`,_hoisted_12$1,[createBaseVNode(`span`,_hoisted_13$1,toDisplayString(file.name),1),createBaseVNode(`span`,_hoisted_14$1,`sha256 `+toDisplayString(file.sha256.slice(0,12))+`…`,1)])],8,_hoisted_11$1)}),128))])])):proof.value&&!__props.activity.running?(openBlock(),createElementBlock(`div`,_hoisted_15$1,[_cache[6]||(_cache[6]=createBaseVNode(`dt`,null,`Verified`,-1)),createBaseVNode(`dd`,{class:`publish-target__verified`,title:`Read back from ${__props.destination?.label||`the destination`} after publishing: ${proof.value}`},[createVNode(VIcon,{icon:unref(mdiCheckDecagram),color:`success`,size:`16`},null,8,[`icon`]),createBaseVNode(`span`,_hoisted_17$1,toDisplayString(proof.value),1)],8,_hoisted_16$1)])):createCommentVNode(``,true)]),renderSlot(_ctx.$slots,`setup`,{},void 0,true),_ctx.$slots.actions||pageUrl.value?(openBlock(),createElementBlock(`footer`,_hoisted_18$1,[renderSlot(_ctx.$slots,`actions`,{},void 0,true),pageUrl.value?(openBlock(),createBlock(VBtn,{key:0,"append-icon":unref(mdiOpenInNew),href:pageUrl.value,rel:`noopener`,rounded:`pill`,size:`small`,target:`_blank`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(` View `+toDisplayString(latest.value.version),1)]),_:1},8,[`append-icon`,`href`])):createCommentVNode(``,true)])):createCommentVNode(``,true)],10,_hoisted_1$5)}}};var TargetCard_default=_plugin_vue_export_helper_default(_sfc_main$6,[[`__scopeId`,`data-v-aa617e31`]]);var _hoisted_1$4={key:0};var _hoisted_2$2=[`title`];var _hoisted_3$1={key:1};var _hoisted_4$1={class:`publish-android-tasks`,"aria-label":`One-time setup`};var _sfc_main$5={__name:`AndroidSideloadCard`,props:{target:{type:Object,required:true},toolchains:{type:Object,default:()=>({})},busy:{type:Boolean,default:false}},emits:[`remove`,`change-account`,`setup-tools`,`create-key`,`recovery-kit`,`install`,`show-release`],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const keyExists=computed(()=>Boolean(props.target.installKey?.exists));const kitCovers=computed(()=>Boolean(props.target.installKey?.coveredByRecoveryKit));const installing=computed(()=>props.toolchains.install?.status===`running`);const toolsReady=computed(()=>Boolean(props.toolchains.java?.ready&&props.toolchains.androidSdk?.ready));const tasks=computed(()=>[{id:`tools`,done:toolsReady.value,running:installing.value,title:`Android build tools`,detail:installing.value?props.toolchains.install?.message||`Downloading Java and the Android SDK…`:toolsReady.value?`Java and the Android SDK are ready.`:`A one-time 1.9 GB download after you accept Google's licence.`,action:`Set up`,event:`setup-tools`},{id:`key`,done:keyExists.value,title:`Install key`,detail:keyExists.value?`Signs every version so your phone accepts updates.`:`Vibe64 makes it and keeps it in your publishing keys.`,action:`Create`,event:`create-key`,needs:toolsReady.value?``:`Set up the tools first`},{id:`kit`,done:kitCovers.value,title:`Recovery kit`,detail:kitCovers.value?`Your kit holds this key.`:`Without it, a lost key means reinstalling the app.`,action:`Save kit`,event:`recovery-kit`,needs:keyExists.value?``:`Create the key first`}]);const ready=computed(()=>tasks.value.every(task=>task.done));return(_ctx,_cache)=>{return openBlock(),createBlock(TargetCard_default,mergeProps(_ctx.$attrs,{busy:__props.busy,target:__props.target,waiting:ready.value?``:`Finish the one-time setup below first`,onChangeAccount:_cache[1]||(_cache[1]=$event=>emit(`change-account`,$event)),onRemove:_cache[2]||(_cache[2]=$event=>emit(`remove`)),onShowRelease:_cache[3]||(_cache[3]=$event=>emit(`show-release`,$event))}),createSlots({facts:withCtx(()=>[__props.target.settings?.certificateSha256?(openBlock(),createElementBlock(`div`,_hoisted_1$4,[_cache[4]||(_cache[4]=createBaseVNode(`dt`,null,`Install key`,-1)),createBaseVNode(`dd`,{class:`publish-target__mono`,title:__props.target.settings.certificateSha256},toDisplayString(__props.target.settings.certificateSha256.slice(0,23))+`…`,9,_hoisted_2$2)])):createCommentVNode(``,true),__props.target.latest?.proof?.size?(openBlock(),createElementBlock(`div`,_hoisted_3$1,[_cache[5]||(_cache[5]=createBaseVNode(`dt`,null,`Size`,-1)),createBaseVNode(`dd`,null,toDisplayString((__props.target.latest.proof.size/1048576).toFixed(1))+` MB`,1)])):createCommentVNode(``,true)]),_:2},[!ready.value?{name:`setup`,fn:withCtx(()=>[createBaseVNode(`ol`,_hoisted_4$1,[(openBlock(true),createElementBlock(Fragment,null,renderList(tasks.value,task=>{return openBlock(),createElementBlock(`li`,{key:task.id,class:normalizeClass({"is-done":task.done})},[createVNode(VIcon,{color:task.done?`success`:task.running?`primary`:void 0,icon:task.done?unref(mdiCheckCircle):task.running?unref(mdiProgressClock):unref(mdiCircleOutline),size:`20`},null,8,[`color`,`icon`]),createBaseVNode(`div`,null,[createBaseVNode(`strong`,null,toDisplayString(task.title),1),createBaseVNode(`span`,null,toDisplayString(task.detail),1),task.running?(openBlock(),createBlock(VProgressLinear,{key:0,class:`mt-1`,color:`primary`,indeterminate:``,rounded:``})):createCommentVNode(``,true)]),!task.done&&!task.running?(openBlock(),createBlock(VBtn,{key:0,disabled:__props.busy||Boolean(task.needs),title:task.needs||void 0,rounded:`pill`,size:`small`,variant:`tonal`,onClick:$event=>emit(task.event)},{default:withCtx(()=>[createTextVNode(toDisplayString(task.action),1)]),_:2},1032,[`disabled`,`title`,`onClick`])):createCommentVNode(``,true)],2)}),128))])]),key:`0`}:void 0,__props.target.latest?.downloadable?{name:`actions`,fn:withCtx(()=>[createVNode(VBtn,{"prepend-icon":unref(mdiQrcode),color:`success`,rounded:`pill`,variant:`flat`,onClick:_cache[0]||(_cache[0]=$event=>emit(`install`))},{default:withCtx(()=>[..._cache[6]||(_cache[6]=[createTextVNode(`Install on phone`,-1)])]),_:1},8,[`prepend-icon`])]),key:`1`}:void 0]),1040,[`busy`,`target`,`waiting`])}}};var AndroidSideloadCard_default=_plugin_vue_export_helper_default(_sfc_main$5,[[`__scopeId`,`data-v-12e9de34`]]);var _hoisted_1$3={key:0};var _sfc_main$4={__name:`GithubReleasesCard`,props:{target:{type:Object,required:true}},emits:[`remove`,`change-account`,`show-release`],setup(__props){return(_ctx,_cache)=>{return openBlock(),createBlock(TargetCard_default,mergeProps(_ctx.$attrs,{target:__props.target,onChangeAccount:_cache[0]||(_cache[0]=$event=>_ctx.$emit(`change-account`,$event)),onRemove:_cache[1]||(_cache[1]=$event=>_ctx.$emit(`remove`)),onShowRelease:_cache[2]||(_cache[2]=$event=>_ctx.$emit(`show-release`,$event))}),createSlots({facts:withCtx(()=>[createBaseVNode(`div`,null,[_cache[3]||(_cache[3]=createBaseVNode(`dt`,null,`Repository`,-1)),createBaseVNode(`dd`,null,toDisplayString(__props.target.settings?.repository),1)]),__props.target.latest?.proof?.tag?(openBlock(),createElementBlock(`div`,_hoisted_1$3,[_cache[4]||(_cache[4]=createBaseVNode(`dt`,null,`Release`,-1)),createBaseVNode(`dd`,null,toDisplayString(__props.target.latest.proof.tag),1)])):createCommentVNode(``,true)]),_:2},[__props.target.latest?.proof?.url?{name:`actions`,fn:withCtx(()=>[createVNode(VBtn,{"append-icon":unref(mdiOpenInNew),href:__props.target.latest.proof.url,rel:`noopener`,rounded:`pill`,size:`small`,target:`_blank`,variant:`tonal`},{default:withCtx(()=>[..._cache[5]||(_cache[5]=[createTextVNode(` Open release `,-1)])]),_:1},8,[`append-icon`,`href`])]),key:`0`}:void 0]),1040,[`target`])}}};var _hoisted_1$2=[`title`];var _hoisted_2$1={key:0};var _sfc_main$3={__name:`NpmCard`,props:{target:{type:Object,required:true}},emits:[`remove`,`change-account`,`show-release`],setup(__props){return(_ctx,_cache)=>{return openBlock(),createBlock(TargetCard_default,mergeProps(_ctx.$attrs,{target:__props.target,onChangeAccount:_cache[0]||(_cache[0]=$event=>_ctx.$emit(`change-account`,$event)),onRemove:_cache[1]||(_cache[1]=$event=>_ctx.$emit(`remove`)),onShowRelease:_cache[2]||(_cache[2]=$event=>_ctx.$emit(`show-release`,$event))}),{facts:withCtx(()=>[createBaseVNode(`div`,null,[_cache[3]||(_cache[3]=createBaseVNode(`dt`,null,`Registry`,-1)),createBaseVNode(`dd`,{title:__props.target.settings?.registry},toDisplayString(unref(hostOf)(__props.target.settings?.registry)),9,_hoisted_1$2)]),createBaseVNode(`div`,null,[_cache[4]||(_cache[4]=createBaseVNode(`dt`,null,`Tag`,-1)),createBaseVNode(`dd`,null,toDisplayString(__props.target.channel||`latest`),1)]),__props.target.settings?.access?(openBlock(),createElementBlock(`div`,_hoisted_2$1,[_cache[5]||(_cache[5]=createBaseVNode(`dt`,null,`Access`,-1)),createBaseVNode(`dd`,null,toDisplayString(__props.target.settings.access),1)])):createCommentVNode(``,true)]),_:1},16,[`target`])}}};var _hoisted_1$1=[`title`];var _sfc_main$2={__name:`PypiCard`,props:{target:{type:Object,required:true}},emits:[`remove`,`change-account`,`show-release`],setup(__props){const props=__props;const where=computed(()=>{const settings=props.target.settings||{};if(settings.instance===`testpypi`)return`TestPyPI`;if(settings.instance===`pypi`)return`pypi.org`;return hostOf(settings.repository||``)});return(_ctx,_cache)=>{return openBlock(),createBlock(TargetCard_default,mergeProps(_ctx.$attrs,{target:__props.target,onChangeAccount:_cache[0]||(_cache[0]=$event=>_ctx.$emit(`change-account`,$event)),onRemove:_cache[1]||(_cache[1]=$event=>_ctx.$emit(`remove`)),onShowRelease:_cache[2]||(_cache[2]=$event=>_ctx.$emit(`show-release`,$event))}),{facts:withCtx(()=>[createBaseVNode(`div`,null,[_cache[3]||(_cache[3]=createBaseVNode(`dt`,null,`Index`,-1)),createBaseVNode(`dd`,{title:__props.target.settings?.repository||where.value},toDisplayString(where.value),9,_hoisted_1$1)])]),_:1},16,[`target`])}}};var _hoisted_1={class:`publish-page`};var _hoisted_2={key:0,class:`publish-banner publish-banner--ask`,role:`status`};var _hoisted_3={key:1,class:`publish-banner publish-banner--running`,role:`status`};var _hoisted_4={class:`publish-saved`,"aria-label":`Saved work`};var _hoisted_5={class:`publish-saved__line`};var _hoisted_6={class:`publish-saved__line`};var _hoisted_7={key:0,class:`publish-saved__output`};var _hoisted_8={class:`publish-saved__packages`};var _hoisted_9={class:`publish-saved__chips`};var _hoisted_10={key:0,class:`publish-saved__muted`};var _hoisted_11={key:3,class:`publish-empty`};var _hoisted_12={key:0,class:`publish-empty__diagnostics`};var _hoisted_13={key:0};var _hoisted_14={key:4,class:`publish-targets`,"aria-labelledby":`publish-targets-title`};var _hoisted_15={key:0,class:`publish-targets__grid`};var _hoisted_16={class:`publish-targets__add-icon`};var _hoisted_17={key:1,class:`publish-start`};var _hoisted_18={class:`publish-start__lead`};var _hoisted_19={class:`publish-start__grid`};var _hoisted_20=[`disabled`,`onClick`];var _hoisted_21={class:`publish-start__icon`};var _hoisted_22={key:0,class:`publish-start__meta publish-start__meta--missing`};var _hoisted_23={key:1,class:`publish-start__meta`};var _sfc_main$1={__name:`PublishPage`,props:{dashboardContext:{type:Object,default:()=>({})},request:{type:Function,default:void 0}},setup(__props){const props=__props;const PACKER_KINDS={"web-bundle":`web files`,capacitor:`app`,npm:`npm package`,"python-dist":`Python package`};const CARDS={npm:_sfc_main$3,pypi:_sfc_main$2,"github-releases":_sfc_main$4,"android-sideload":AndroidSideloadCard_default};const{state,loadError,refresh,call}=usePublishing({active:()=>props.dashboardContext?.active!==false,...props.request?{request:props.request}:{}});refresh();const dialogs=ref({add:false,release:false,confirm:false,keys:false,kit:false,licence:false,install:false});const addPreset=ref(``);const addAccountKind=ref(``);const confirmation=ref({plan:null,targetIds:[],acknowledged:[],requestedBy:``});const install=ref({releaseId:``,targetId:``,title:``,version:``});const pageError=ref(``);const working=ref(``);const destinations=computed(()=>(state.value?.destinations||[]).map(entry=>({...entry,accountKind:(state.value?.accountKinds||[]).find(kind=>kind.destination===entry.id)?.id||``})));const destinationById=computed(()=>Object.fromEntries(destinations.value.map(entry=>[entry.id,entry])));const packages=computed(()=>state.value?.packaging?.packages||[]);const packageById=computed(()=>Object.fromEntries(packages.value.map(entry=>[entry.id,entry])));const targets=computed(()=>state.value?.targets||[]);const baseline=computed(()=>state.value?.baseline||{});const checks=computed(()=>state.value?.checks||null);const packagingReady=computed(()=>state.value?.packaging?.status===`ready`);const running=computed(()=>(state.value?.releases||[]).find(release=>release.id===state.value?.activeRelease)||(state.value?.releases||[]).find(release=>release.status===`running`)||null);const pending=computed(()=>state.value?.pendingConfirmation||null);const keysIcon=computed(()=>state.value?.keys?.unlocked?mdiLockOpenVariantOutline:mdiShieldKeyOutline);const history=ref(null);function availability(entry){const reason=destinationGap(entry,{packages:packages.value,baseline:baseline.value});return{ok:!reason,reason}}const startDestinations=computed(()=>destinations.value.map(entry=>({...entry,availability:availability(entry)})).sort((left,right)=>Number(right.availability.ok)-Number(left.availability.ok)));const startLead=computed(()=>{const open=startDestinations.value.filter(entry=>entry.availability.ok);if(!open.length)return`None of these fits this project's packages yet.`;const free=open.filter(entry=>entry.zeroAccount).length;return free?`Choose where your first release goes. ${free===1?`One needs`:`${free} need`} no new account.`:`Choose where your first release goes.`});const activityByTarget=computed(()=>Object.fromEntries(targets.value.map(target=>{const inFlight=running.value&&(running.value.steps||[]).some(entry=>entry.id===`publish:${target.id}`)&&running.value.kind===`release`;return[target.id,{running:Boolean(inFlight),version:inFlight?running.value.versions?.[target.package]||``:``,failure:lastFailure(target,state.value?.releases||[])}]})));const runChecks=()=>act(`checks`,()=>call(`/checks`));const showOutput=ref(false);function openAdd(preset=``){addPreset.value=preset;dialogs.value.add=true}const returnToAdd=ref(``);function openKeys(kind=``){addAccountKind.value=kind;returnToAdd.value=kind&&dialogs.value.add?addPreset.value||destinations.value.find(entry=>entry.accountKind===kind)?.id||``:``;dialogs.value.add=false;dialogs.value.keys=true}watch(()=>dialogs.value.keys,open=>{if(open||!returnToAdd.value)return;addPreset.value=returnToAdd.value;returnToAdd.value=``;dialogs.value.add=true});async function act(name,work){working.value=name;pageError.value=``;try{await work()}catch(failure){pageError.value=failure.message}finally{working.value=``}}const removeTarget=target=>act(`remove:${target.id}`,()=>call(`/targets/${encodeURIComponent(target.id)}`,{method:`DELETE`}));const changeAccount=(target,account)=>act(`account:${target.id}`,()=>call(`/targets/${encodeURIComponent(target.id)}`,{method:`PATCH`,body:{account}}));const createKey=target=>act(`key:${target.id}`,async()=>{if(!state.value?.keys?.unlocked){openKeys();throw new Error(`Unlock your publishing keys, then create the install key.`)}await call(`/targets/${encodeURIComponent(target.id)}/install-key`)});function openConfirm({plan,targetIds,acknowledged=[],requestedBy=``}){confirmation.value={plan,targetIds,acknowledged,requestedBy};dialogs.value.release=false;dialogs.value.confirm=true}function planAgain(){dialogs.value.confirm=false;dialogs.value.release=true}const reviewRequest=()=>act(`review`,async()=>{const{plan}=await call(`/plan`,{body:{targetIds:pending.value.targetIds},refreshAfter:false});if(plan.planHash!==pending.value.planHash)throw new Error(`The saved work changed since this was asked for. Open Release to review the new plan.`);openConfirm({plan,targetIds:pending.value.targetIds,requestedBy:`assistant`})});const dismissRequest=()=>act(`dismiss`,()=>call(`/confirmation/request`,{method:`DELETE`}));const notice=ref(``);const resume=release=>act(`resume`,async()=>{const targetIds=(release.steps||[]).filter(entry=>entry.id.startsWith(`publish:`)).map(entry=>entry.id.slice(8));const{plan}=await call(`/plan`,{body:{targetIds},refreshAfter:false});if(plan.planHash!==release.planHash){notice.value=`This release's plan changed since you confirmed it, so here is a new release from the saved work.`;dialogs.value.release=true;return}openConfirm({plan,targetIds})});function openInstall({releaseId,targetId}){const target=targets.value.find(entry=>entry.id===targetId);const release=(state.value?.releases||[]).find(entry=>entry.id===releaseId);install.value={releaseId,targetId,title:packageById.value[target?.package]?.applicationName||target?.package||``,version:release?.versions?.[target?.package]||target?.latest?.version||``};dialogs.value.install=true}return(_ctx,_cache)=>{return openBlock(),createElementBlock(`section`,_hoisted_1,[createVNode(Vibe64DashboardPageHeader_default,{icon:unref(mdiPackageVariantClosed),description:`Release your project as an app on your phone or a package people can install.`,title:`Publish`},{actions:withCtx(()=>[createVNode(VBtn,{"prepend-icon":keysIcon.value,"data-test":`open-keys`,rounded:`pill`,variant:`tonal`,onClick:_cache[0]||(_cache[0]=$event=>openKeys())},{default:withCtx(()=>[..._cache[19]||(_cache[19]=[createTextVNode(`Accounts & keys`,-1)])]),_:1},8,[`prepend-icon`]),createVNode(VBtn,{disabled:!targets.value.length||!packagingReady.value||Boolean(running.value),"prepend-icon":unref(mdiRocketLaunchOutline),color:`primary`,"data-test":`open-release`,rounded:`pill`,variant:`flat`,onClick:_cache[1]||(_cache[1]=$event=>dialogs.value.release=true)},{default:withCtx(()=>[..._cache[20]||(_cache[20]=[createTextVNode(` Release `,-1)])]),_:1},8,[`disabled`,`prepend-icon`])]),_:1},8,[`icon`]),unref(loadError)?(openBlock(),createBlock(VAlert,{key:0,type:`error`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(loadError)),1)]),_:1})):createCommentVNode(``,true),!unref(state)&&!unref(loadError)?(openBlock(),createBlock(VSkeletonLoader,{key:1,type:`article, card`})):createCommentVNode(``,true),unref(state)?(openBlock(),createElementBlock(Fragment,{key:2},[pending.value?(openBlock(),createElementBlock(`div`,_hoisted_2,[createVNode(VIcon,{icon:unref(mdiRobotOutline),size:`22`},null,8,[`icon`]),createBaseVNode(`div`,null,[createBaseVNode(`strong`,null,`Your Colleague asked to publish plan `+toDisplayString(pending.value.planId),1),_cache[21]||(_cache[21]=createBaseVNode(`span`,null,`Nothing is published until you review and confirm it here.`,-1))]),createVNode(VBtn,{loading:working.value===`dismiss`,rounded:`pill`,variant:`text`,onClick:dismissRequest},{default:withCtx(()=>[..._cache[22]||(_cache[22]=[createTextVNode(`Dismiss`,-1)])]),_:1},8,[`loading`]),createVNode(VBtn,{loading:working.value===`review`,color:`primary`,rounded:`pill`,variant:`flat`,onClick:reviewRequest},{default:withCtx(()=>[..._cache[23]||(_cache[23]=[createTextVNode(`Review`,-1)])]),_:1},8,[`loading`])])):createCommentVNode(``,true),running.value?(openBlock(),createElementBlock(`div`,_hoisted_3,[createVNode(VIcon,{icon:unref(mdiProgressClock),class:`publish-banner__spin`,size:`22`},null,8,[`icon`]),createBaseVNode(`div`,null,[createBaseVNode(`strong`,null,toDisplayString(running.value.kind===`dry-run`?`Dry run`:`Releasing`)+` `+toDisplayString(Object.entries(running.value.versions||{}).map(([id,version])=>`${packageById.value[id]?.label||id} ${version}`).join(` · `)),1),createBaseVNode(`span`,null,toDisplayString((running.value.steps||[]).filter(entry=>entry.status===`done`).length)+` of `+toDisplayString((running.value.steps||[]).length)+` steps done. You can leave this page; it carries on.`,1)])])):createCommentVNode(``,true),!baseline.value.supported?(openBlock(),createBlock(VAlert,{key:2,type:`warning`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(baseline.value.message||`This project's repository cannot be published from here yet.`),1)]),_:1})):createCommentVNode(``,true),createBaseVNode(`section`,_hoisted_4,[createBaseVNode(`div`,null,[_cache[24]||(_cache[24]=createBaseVNode(`span`,{class:`publish-saved__label`},`Releases use your saved work`,-1)),createBaseVNode(`span`,_hoisted_5,[createVNode(VIcon,{icon:unref(mdiSourceCommit),size:`18`},null,8,[`icon`]),createBaseVNode(`code`,null,toDisplayString(unref(shortCommit)(baseline.value.commit)||`—`),1),createVNode(VIcon,{icon:unref(mdiSourceBranch),class:`ml-2`,size:`18`},null,8,[`icon`]),createTextVNode(` `+toDisplayString(baseline.value.branch||`—`)+` `,1),createVNode(VChip,{color:baseline.value.pushed?`success`:`warning`,class:`ml-1`,size:`x-small`,variant:`tonal`},{default:withCtx(()=>[createTextVNode(toDisplayString(baseline.value.pushed?`pushed`:`not pushed`),1)]),_:1},8,[`color`])])]),createBaseVNode(`div`,null,[_cache[25]||(_cache[25]=createBaseVNode(`span`,{class:`publish-saved__label`},`Checks`,-1)),createBaseVNode(`span`,_hoisted_6,[createVNode(VIcon,{class:normalizeClass({"publish-banner__spin":checks.value?.status===`running`}),color:unref(statusInfo)(checks.value?.status).color,icon:checks.value?unref(statusInfo)(checks.value.status).icon:unref(mdiClockOutline),size:`18`},null,8,[`class`,`color`,`icon`]),createTextVNode(` `+toDisplayString(checks.value?checks.value.status===`failed`?`${checks.value.failedCommand||`Checks`} failed`:unref(statusInfo)(checks.value.status).label:`Not run on this commit`)+` `,1),packagingReady.value&&(!checks.value||checks.value.status===`failed`)?(openBlock(),createBlock(VBtn,{key:0,loading:working.value===`checks`,"prepend-icon":unref(mdiPlay),class:`ml-1`,rounded:`pill`,size:`x-small`,variant:`tonal`,onClick:runChecks},{default:withCtx(()=>[createTextVNode(toDisplayString(checks.value?`Run again`:`Run checks`),1)]),_:1},8,[`loading`,`prepend-icon`])):createCommentVNode(``,true),checks.value?.status===`failed`&&checks.value.output?(openBlock(),createBlock(VBtn,{key:1,class:`publish-saved__output-toggle`,rounded:`pill`,size:`x-small`,variant:`text`,onClick:_cache[2]||(_cache[2]=$event=>showOutput.value=!showOutput.value)},{default:withCtx(()=>[createTextVNode(toDisplayString(showOutput.value?`Hide output`:`Show output`),1)]),_:1})):createCommentVNode(``,true)])]),showOutput.value&&checks.value?.status===`failed`&&checks.value.output?(openBlock(),createElementBlock(`pre`,_hoisted_7,toDisplayString(checks.value.output),1)):createCommentVNode(``,true),createBaseVNode(`div`,_hoisted_8,[_cache[26]||(_cache[26]=createBaseVNode(`span`,{class:`publish-saved__label`},`Packages`,-1)),createBaseVNode(`span`,_hoisted_9,[(openBlock(true),createElementBlock(Fragment,null,renderList(packages.value,entry=>{return openBlock(),createElementBlock(`span`,{key:entry.id,class:`publish-chip`},[createTextVNode(toDisplayString(entry.label)+` `,1),createBaseVNode(`em`,null,toDisplayString(entry.version||PACKER_KINDS[entry.packer]||entry.packer),1)])}),128)),!packages.value.length?(openBlock(),createElementBlock(`span`,_hoisted_10,`None yet`)):createCommentVNode(``,true)])])]),!packagingReady.value?(openBlock(),createElementBlock(`div`,_hoisted_11,[createVNode(VIcon,{icon:unref(mdiAlertOutline),color:`warning`,size:`40`},null,8,[`icon`]),_cache[27]||(_cache[27]=createBaseVNode(`h2`,null,`Tell Vibe64 what to build`,-1)),_cache[28]||(_cache[28]=createBaseVNode(`p`,null,[createTextVNode(` Publishing starts from the project's Packaging section, which says what each package is and how it is built. Ask your Colleague, for example: `),createBaseVNode(`q`,null,`Set up packaging so I can install this app on my phone`),createTextVNode(`, then Save. `)],-1)),unref(state).packaging.problem||unref(state).packaging.diagnostics.length?(openBlock(),createElementBlock(`ul`,_hoisted_12,[unref(state).packaging.problem?(openBlock(),createElementBlock(`li`,_hoisted_13,toDisplayString(unref(state).packaging.problem),1)):createCommentVNode(``,true),(openBlock(true),createElementBlock(Fragment,null,renderList(unref(state).packaging.diagnostics,message=>{return openBlock(),createElementBlock(`li`,{key:message},toDisplayString(message),1)}),128))])):createCommentVNode(``,true)])):(openBlock(),createElementBlock(`section`,_hoisted_14,[_cache[30]||(_cache[30]=createBaseVNode(`h2`,{id:`publish-targets-title`,class:`publish-section-title`},`Targets`,-1)),targets.value.length?(openBlock(),createElementBlock(`div`,_hoisted_15,[(openBlock(true),createElementBlock(Fragment,null,renderList(targets.value,target=>{return openBlock(),createBlock(resolveDynamicComponent(CARDS[target.destination]),{key:target.id,accounts:unref(state).accounts,activity:activityByTarget.value[target.id],busy:working.value.endsWith(`:${target.id}`),destination:destinationById.value[target.destination],"package-info":packageById.value[target.package],target,toolchains:unref(state).toolchains,onChangeAccount:$event=>changeAccount(target,$event),onCreateKey:$event=>createKey(target),onInstall:$event=>openInstall({releaseId:target.latest.releaseId,targetId:target.id}),onRecoveryKit:_cache[3]||(_cache[3]=$event=>dialogs.value.kit=true),onRemove:$event=>removeTarget(target),onSetupTools:_cache[4]||(_cache[4]=$event=>dialogs.value.licence=true),onShowRelease:_cache[5]||(_cache[5]=$event=>history.value?.reveal($event))},null,40,[`accounts`,`activity`,`busy`,`destination`,`package-info`,`target`,`toolchains`,`onChangeAccount`,`onCreateKey`,`onInstall`,`onRemove`])}),128)),createBaseVNode(`button`,{class:`publish-targets__add`,"data-test":`add-target`,type:`button`,onClick:_cache[6]||(_cache[6]=$event=>openAdd())},[createBaseVNode(`span`,_hoisted_16,[createVNode(VIcon,{icon:unref(mdiPlus),size:`22`},null,8,[`icon`])]),_cache[29]||(_cache[29]=createBaseVNode(`strong`,null,`Add target`,-1)),createBaseVNode(`span`,null,`Publish `+toDisplayString(packages.value.length===1?packages.value[0].label:`a package`)+` somewhere else too.`,1)])])):(openBlock(),createElementBlock(`div`,_hoisted_17,[createBaseVNode(`p`,_hoisted_18,toDisplayString(startLead.value),1),createBaseVNode(`div`,_hoisted_19,[(openBlock(true),createElementBlock(Fragment,null,renderList(startDestinations.value,entry=>{return openBlock(),createElementBlock(`button`,{key:entry.id,class:normalizeClass([`publish-start__tile--${unref(destinationAccent)(entry.id)}`,`publish-start__tile`]),disabled:!entry.availability.ok,type:`button`,onClick:$event=>openAdd(entry.id)},[createBaseVNode(`span`,_hoisted_21,[createVNode(VIcon,{icon:unref(destinationIcon)(entry.id),size:`26`},null,8,[`icon`])]),createBaseVNode(`strong`,null,toDisplayString(entry.label),1),createBaseVNode(`span`,null,toDisplayString(entry.summary),1),!entry.availability.ok?(openBlock(),createElementBlock(`span`,_hoisted_22,[createVNode(VIcon,{icon:unref(mdiAlertOutline),size:`14`},null,8,[`icon`]),createTextVNode(` `+toDisplayString(entry.availability.reason),1)])):(openBlock(),createElementBlock(`span`,_hoisted_23,[createVNode(VIcon,{icon:entry.id===`github-releases`?unref(mdiGithub):entry.zeroAccount?unref(mdiCheckCircle):unref(mdiAccountKeyOutline),size:`14`},null,8,[`icon`]),createTextVNode(` `+toDisplayString(entry.id===`github-releases`?`Your GitHub sign-in`:entry.zeroAccount?`No account`:`Needs an account`)+` · `+toDisplayString(entry.cost),1)]))],10,_hoisted_20)}),128))])]))])),createVNode(ReleaseHistory_default,{ref_key:`history`,ref:history,"active-release":unref(state).activeRelease||``,"saved-commit":baseline.value.commit||``,packages:packages.value,call:unref(call),destinations:destinations.value,releases:unref(state).releases,targets:targets.value,onInstall:openInstall,onRelease:_cache[7]||(_cache[7]=$event=>dialogs.value.release=true),onResume:resume},null,8,[`active-release`,`saved-commit`,`packages`,`call`,`destinations`,`releases`,`targets`])],64)):createCommentVNode(``,true),createVNode(VSnackbar,{"model-value":Boolean(pageError.value||notice.value),color:pageError.value?`error`:void 0,location:`bottom`,"max-width":`560`,timeout:`8000`,"onUpdate:modelValue":_cache[9]||(_cache[9]=$event=>{pageError.value=``;notice.value=``})},{actions:withCtx(()=>[createVNode(VBtn,{variant:`text`,onClick:_cache[8]||(_cache[8]=$event=>{pageError.value=``;notice.value=``})},{default:withCtx(()=>[..._cache[31]||(_cache[31]=[createTextVNode(`Close`,-1)])]),_:1})]),default:withCtx(()=>[createTextVNode(toDisplayString(pageError.value||notice.value)+` `,1)]),_:1},8,[`model-value`,`color`]),createVNode(AddTargetDialog_default,{modelValue:dialogs.value.add,"onUpdate:modelValue":_cache[10]||(_cache[10]=$event=>dialogs.value.add=$event),call:unref(call),preset:addPreset.value,state:unref(state),onAddAccount:openKeys},null,8,[`modelValue`,`call`,`preset`,`state`]),createVNode(ReleaseDialog_default,{modelValue:dialogs.value.release,"onUpdate:modelValue":_cache[11]||(_cache[11]=$event=>dialogs.value.release=$event),call:unref(call),"dashboard-context":__props.dashboardContext,state:unref(state),onAccounts:_cache[12]||(_cache[12]=$event=>openKeys()),onConfirm:openConfirm},null,8,[`modelValue`,`call`,`dashboard-context`,`state`]),createVNode(ConfirmPublishDialog_default,{modelValue:dialogs.value.confirm,"onUpdate:modelValue":_cache[13]||(_cache[13]=$event=>dialogs.value.confirm=$event),acknowledged:confirmation.value.acknowledged,call:unref(call),plan:confirmation.value.plan,"requested-by":confirmation.value.requestedBy,state:unref(state),"target-ids":confirmation.value.targetIds,onPlanChanged:planAgain},null,8,[`modelValue`,`acknowledged`,`call`,`plan`,`requested-by`,`state`,`target-ids`]),createVNode(PublishingAccountsPanel_default,{modelValue:dialogs.value.keys,"onUpdate:modelValue":_cache[14]||(_cache[14]=$event=>dialogs.value.keys=$event),"add-kind":addAccountKind.value,call:unref(call),state:unref(state),onRecoveryKit:_cache[15]||(_cache[15]=$event=>dialogs.value.kit=true)},null,8,[`modelValue`,`add-kind`,`call`,`state`]),createVNode(RecoveryKitDialog_default,{modelValue:dialogs.value.kit,"onUpdate:modelValue":_cache[16]||(_cache[16]=$event=>dialogs.value.kit=$event),call:unref(call),state:unref(state)},null,8,[`modelValue`,`call`,`state`]),createVNode(AndroidSdkLicenceDialog_default,{modelValue:dialogs.value.licence,"onUpdate:modelValue":_cache[17]||(_cache[17]=$event=>dialogs.value.licence=$event),call:unref(call),state:unref(state)},null,8,[`modelValue`,`call`,`state`]),createVNode(InstallOnPhoneDialog_default,{modelValue:dialogs.value.install,"onUpdate:modelValue":_cache[18]||(_cache[18]=$event=>dialogs.value.install=$event),call:unref(call),"release-id":install.value.releaseId,"target-id":install.value.targetId,title:install.value.title,version:install.value.version},null,8,[`modelValue`,`call`,`release-id`,`target-id`,`title`,`version`])])}}};var PublishPage_default=_plugin_vue_export_helper_default(_sfc_main$1,[[`__scopeId`,`data-v-27375b96`]]);var _sfc_main={__name:`index`,props:{dashboardContext:{default:()=>({}),type:Object}},setup(__props){return(_ctx,_cache)=>{return openBlock(),createBlock(unref(PublishPage_default),{"dashboard-context":__props.dashboardContext},null,8,[`dashboard-context`])}}};export{_sfc_main as default};
|