vibe64 0.1.26 → 0.1.28

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.
Files changed (111) hide show
  1. package/dist/assets/{VRadioGroup-D6WRdUau.js → VRadioGroup-BuRMvs7d.js} +1 -1
  2. package/dist/assets/{VTabs-BGX5dGoS.js → VTabs-CQq9CAuT.js} +1 -1
  3. package/dist/assets/{VTextarea-CD6H_mtJ.js → VTextarea-Duvzvmjq.js} +1 -1
  4. package/dist/assets/{Vibe64AsyncModuleState-Cel3OePx.js → Vibe64AsyncModuleState-DuuzlJDp.js} +1 -1
  5. package/dist/assets/{Vibe64AuthSettingsButton-CMMeacsl.js → Vibe64AuthSettingsButton-CKOCL-kl.js} +1 -1
  6. package/dist/assets/{Vibe64DashboardShell-C2UhX2ke.js → Vibe64DashboardShell-DMT8aOp1.js} +1 -1
  7. package/dist/assets/{Vibe64DatabaseWorkspace-C43TE5-O.js → Vibe64DatabaseWorkspace-CqH0zfFZ.js} +1 -1
  8. package/dist/assets/{Vibe64OutputControls-BmzH2ASf.js → Vibe64OutputControls-DDILWOYb.js} +1 -1
  9. package/dist/assets/{Vibe64RepositoryWorkspace-CT9tkvHh.js → Vibe64RepositoryWorkspace-D11BZHtF.js} +1 -1
  10. package/dist/assets/Vibe64SessionFiles-BSoB7Xrs.js +1 -0
  11. package/dist/assets/{Vibe64SessionFiles-CH5PCxwg.css → Vibe64SessionFiles-DVux69YS.css} +1 -1
  12. package/dist/assets/{Vibe64SubsystemsView-DNx-pZp8.js → Vibe64SubsystemsView-tLlxmK3M.js} +1 -1
  13. package/dist/assets/{Vibe64SystemWorldView-UdNJZbqX.js → Vibe64SystemWorldView-8og8TPyL.js} +1 -1
  14. package/dist/assets/{_sessionId_-DZTmI19N.js → _sessionId_-Dts6gv4W.js} +1 -1
  15. package/dist/assets/{_sessionTool_-CugJWIK4.js → _sessionTool_-bHJUlHCW.js} +1 -1
  16. package/dist/assets/_slug_-B3fqw8Sl.js +12 -0
  17. package/dist/assets/_slug_-DfHqx2_b.css +1 -0
  18. package/dist/assets/{dashboard-D4NXqPY1.js → dashboard-CcD6GIaB.js} +1 -1
  19. package/dist/assets/{definitions-CyUCoqu-.js → definitions-ChGXm26a.js} +1 -1
  20. package/dist/assets/{error-kYKTA8fu.js → error-CStS-Kbt.js} +1 -1
  21. package/dist/assets/{index-hy7AAm-B.js → index-B262pg9q.js} +1 -1
  22. package/dist/assets/{index-DX6Rm6jZ.js → index-B_grpOta.js} +1 -1
  23. package/dist/assets/{index-Cpt19GIW.js → index-BtHA_DX9.js} +1 -1
  24. package/dist/assets/{index-SBc6H2In.js → index-C4KnwA0g.js} +4 -4
  25. package/dist/assets/{index-DeRx59Iq.js → index-CC7BFJAg.js} +1 -1
  26. package/dist/assets/{index-6Kv-7k0S.js → index-CKFrWxnr.js} +1 -1
  27. package/dist/assets/{index-BDe3NnFP.js → index-CPG-_bMW.js} +1 -1
  28. package/dist/assets/{index-CuEZOpKL.js → index-CV9pOpbQ.js} +1 -1
  29. package/dist/assets/{index-D4p1hWbM.js → index-DIQxSy1c.js} +1 -1
  30. package/dist/assets/{index-D5vnCntG.js → index-DVaJ8fEr.js} +1 -1
  31. package/dist/assets/{index-BGu7hfTb.js → index-DtGqjUin.js} +1 -1
  32. package/dist/assets/{index-Cca4WXur.js → index-YQALXwL4.js} +1 -1
  33. package/dist/assets/{placement-Nw6LF6xp.js → placement-Cyt3SnRe.js} +1 -1
  34. package/dist/assets/{studioGateApi-B2eiydiA.js → studioGateApi-BwBnOYBp.js} +1 -1
  35. package/dist/assets/{useArchivedVibe64Sessions-LeGda1Y9.js → useArchivedVibe64Sessions-_FKt1-qN.js} +1 -1
  36. package/dist/assets/{useVibe64ConversationLog-BPyKYbvH.js → useVibe64ConversationLog-BjnpqM9K.js} +1 -1
  37. package/dist/assets/{useVibe64ProjectScope-n5T5l2pY.js → useVibe64ProjectScope-DcDkjbLT.js} +1 -1
  38. package/dist/assets/{useVibe64SessionData-BToODuTg.js → useVibe64SessionData-BHLSmuPm.js} +1 -1
  39. package/dist/assets/{useVibe64SessionSelection-D1wXIWTm.js → useVibe64SessionSelection-G6KQKJxb.js} +1 -1
  40. package/dist/assets/{vibe64RepositoryRealtime-Xo7aIksE.js → vibe64RepositoryRealtime-C2WPn5do.js} +1 -1
  41. package/dist/assets/{vibe64SessionInfo-Dy_4bL3a.js → vibe64SessionInfo-8kuxgD5r.js} +1 -1
  42. package/dist/assets/{vibe64SessionPanelModel-5UED-6V-.js → vibe64SessionPanelModel-DDaXjAJ_.js} +1 -1
  43. package/dist/assets/{vibe64SessionRequestConfig-B7Llggdb.js → vibe64SessionRequestConfig-uGWcyQY6.js} +1 -1
  44. package/dist/assets/{vibe64SessionToolDefinitions-C4maKOfp.js → vibe64SessionToolDefinitions-D5CgOIqa.js} +1 -1
  45. package/dist/assets/{vueRefOrGetterValue-_KqAOFjr.js → vueRefOrGetterValue-CV9c3oBd.js} +1 -1
  46. package/dist/index.html +1 -1
  47. package/node_modules/@jskit-ai/connector-google-calendar/package.json +3 -3
  48. package/node_modules/@jskit-ai/connector-google-calendar/patterns/calendar-cli/example/package.json +4 -4
  49. package/node_modules/@jskit-ai/connectors-catalog/package.json +3 -3
  50. package/node_modules/@jskit-ai/connectors-catalog/test/dbt-semantic-layer.test.js +3 -0
  51. package/node_modules/@jskit-ai/connectors-catalog/test/google-ads.test.js +3 -0
  52. package/node_modules/@jskit-ai/connectors-catalog/test/salesforce.test.js +3 -0
  53. package/node_modules/@jskit-ai/connectors-catalog/test/xero.test.js +3 -0
  54. package/node_modules/@jskit-ai/connectors-core/package.json +4 -4
  55. package/node_modules/@jskit-ai/http-web/package.json +6 -6
  56. package/node_modules/@jskit-ai/kernel/package.json +1 -1
  57. package/node_modules/@jskit-ai/kernel/server/runtime/fastifyBootstrap.js +50 -10
  58. package/node_modules/@jskit-ai/kernel/server/runtime/fastifyBootstrap.test.js +38 -0
  59. package/node_modules/@jskit-ai/kernel/shared/support/normalize.js +8 -0
  60. package/node_modules/@jskit-ai/kernel/shared/support/normalize.test.js +10 -0
  61. package/node_modules/@jskit-ai/payments-core/package.json +1 -1
  62. package/node_modules/@jskit-ai/realtime/package.json +3 -3
  63. package/node_modules/@jskit-ai/realtime/patterns/realtime-application/example/package.json +2 -2
  64. package/node_modules/@jskit-ai/resource-core/package.json +2 -2
  65. package/node_modules/@jskit-ai/resource-crud-core/package.json +3 -3
  66. package/node_modules/@jskit-ai/shell-web/package.json +2 -2
  67. package/node_modules/@jskit-ai/uploads-runtime/package.json +2 -2
  68. package/node_modules/@local/current-app/package.json +1 -1
  69. package/node_modules/@local/main/package.json +2 -2
  70. package/node_modules/@local/studio-health/package.json +1 -1
  71. package/node_modules/@local/vibe64-accounts/package.json +3 -3
  72. package/node_modules/@local/vibe64-core/package.json +1 -1
  73. package/node_modules/@local/vibe64-database-tools/package.json +3 -3
  74. package/node_modules/@local/vibe64-project/package.json +1 -1
  75. package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProvider.js +34 -0
  76. package/node_modules/@local/vibe64-sessions/package.json +1 -1
  77. package/node_modules/@local/vibe64-sessions/src/server/sessionRenewal.js +4 -1
  78. package/node_modules/@local/vibe64-source-editor/package.json +5 -5
  79. package/node_modules/@local/vibe64-system-graph/package.json +3 -3
  80. package/node_modules/@local/vibe64-terminals/package.json +2 -2
  81. package/node_modules/@local/vibe64-terminals/src/server/agent/providers/codexSessionAgentProvider.js +6 -0
  82. package/node_modules/@local/vibe64-terminals/src/server/agent/sessionAgentManager.js +16 -0
  83. package/node_modules/@local/vibe64-terminals/src/server/codexTerminal.js +180 -64
  84. package/node_modules/@local/vibe64-terminals/src/server/registerRoutes.js +12 -0
  85. package/node_modules/@local/vibe64-terminals/src/server/service.js +57 -16
  86. package/node_modules/@local/vibe64-terminals/src/server/sessionPromptHints.js +9 -1
  87. package/node_modules/@local/vibe64-terminals/src/server/sessionSaveCommitMessage.js +1 -1
  88. package/package.json +15 -15
  89. package/packages/current-app/package.json +1 -1
  90. package/packages/main/package.json +2 -2
  91. package/packages/studio-health/package.json +1 -1
  92. package/packages/vibe64-accounts/package.json +3 -3
  93. package/packages/vibe64-core/package.json +1 -1
  94. package/packages/vibe64-database-tools/package.json +3 -3
  95. package/packages/vibe64-project/package.json +1 -1
  96. package/packages/vibe64-runtime/src/server/codexAppServerProvider.js +34 -0
  97. package/packages/vibe64-sessions/package.json +1 -1
  98. package/packages/vibe64-sessions/src/server/sessionRenewal.js +4 -1
  99. package/packages/vibe64-source-editor/package.json +5 -5
  100. package/packages/vibe64-system-graph/package.json +3 -3
  101. package/packages/vibe64-terminals/package.json +2 -2
  102. package/packages/vibe64-terminals/src/server/agent/providers/codexSessionAgentProvider.js +6 -0
  103. package/packages/vibe64-terminals/src/server/agent/sessionAgentManager.js +16 -0
  104. package/packages/vibe64-terminals/src/server/codexTerminal.js +180 -64
  105. package/packages/vibe64-terminals/src/server/registerRoutes.js +12 -0
  106. package/packages/vibe64-terminals/src/server/service.js +57 -16
  107. package/packages/vibe64-terminals/src/server/sessionPromptHints.js +9 -1
  108. package/packages/vibe64-terminals/src/server/sessionSaveCommitMessage.js +1 -1
  109. package/dist/assets/Vibe64SessionFiles-BS5MW7Qz.js +0 -1
  110. package/dist/assets/_slug_-BzRzebKA.js +0 -12
  111. package/dist/assets/_slug_-Q7ibe3SE.css +0 -1
@@ -1 +1 @@
1
- import{c0 as genericComponent,c1 as useRender,e9 as VSelectionControl,e as createVNode,N as mergeProps,c3 as propsFactory,cN as omit,ea as makeVSelectionControlProps,f as useId,c_ as useProxiedModel,eb as filterInputAttrs,ec as VInput,d as createBaseVNode,ed as VLabel,ee as VSelectionControlGroup,F as Fragment,cL as forwardRefs,A as computed,B as ref,ch as IconValue,ef as makeSelectionControlGroupProps,eg as makeVInputProps}from"./index-SBc6H2In.js";const makeVRadioProps=propsFactory({...omit(makeVSelectionControlProps({falseIcon:"$radioOff",trueIcon:"$radioOn"}),["indeterminate","indeterminateIcon"])},"VRadio");const VRadio=genericComponent()({name:"VRadio",props:makeVRadioProps(),setup(props,{slots}){useRender(()=>{const controlProps=VSelectionControl.filterProps(props);return createVNode(VSelectionControl,mergeProps(controlProps,{"class":["v-radio",props.class],"style":props.style,"type":"radio"}),slots)});return{}}});const makeVRadioGroupProps=propsFactory({height:{type:[Number,String],default:"auto"},...omit(makeVInputProps(),["direction","glow"]),...omit(makeSelectionControlGroupProps(),["multiple"]),trueIcon:{type:IconValue,default:"$radioOn"},falseIcon:{type:IconValue,default:"$radioOff"},type:{type:String,default:"radio"}},"VRadioGroup");const VRadioGroup=genericComponent()({name:"VRadioGroup",inheritAttrs:false,props:makeVRadioGroupProps(),emits:{"update:modelValue":value=>true},setup(props,{attrs,slots}){const uid=useId();const id=computed(()=>props.id||`radio-group-${uid}`);const model=useProxiedModel(props,"modelValue");const inputRef=ref();useRender(()=>{const[rootAttrs,controlAttrs]=filterInputAttrs(attrs);const inputProps=VInput.filterProps(props);const controlProps=VSelectionControl.filterProps(props);const label=slots.label?slots.label({label:props.label,props:{for:id.value}}):props.label;return createVNode(VInput,mergeProps({"ref":inputRef,"class":["v-radio-group",props.class],"style":props.style},rootAttrs,inputProps,{"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event,"id":id.value}),{...slots,default:({id:id2,messagesId,isDisabled,isReadonly})=>createBaseVNode(Fragment,null,[label&&createVNode(VLabel,{"id":id2.value},{default:()=>[label]}),createVNode(VSelectionControlGroup,mergeProps(controlProps,{"id":id2.value,"aria-describedby":messagesId.value,"defaultsTarget":"VRadio","trueIcon":props.trueIcon,"falseIcon":props.falseIcon,"type":props.type,"disabled":isDisabled.value,"readonly":isReadonly.value,"aria-labelledby":label?id2.value:void 0,"multiple":false},controlAttrs,{"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event}),slots)])})});return forwardRefs({},inputRef)}});export{VRadioGroup as V,VRadio as a};
1
+ import{c0 as genericComponent,c1 as useRender,e9 as VSelectionControl,e as createVNode,N as mergeProps,c3 as propsFactory,cN as omit,ea as makeVSelectionControlProps,f as useId,c_ as useProxiedModel,eb as filterInputAttrs,ec as VInput,d as createBaseVNode,ed as VLabel,ee as VSelectionControlGroup,F as Fragment,cL as forwardRefs,A as computed,B as ref,ch as IconValue,ef as makeSelectionControlGroupProps,eg as makeVInputProps}from"./index-C4KnwA0g.js";const makeVRadioProps=propsFactory({...omit(makeVSelectionControlProps({falseIcon:"$radioOff",trueIcon:"$radioOn"}),["indeterminate","indeterminateIcon"])},"VRadio");const VRadio=genericComponent()({name:"VRadio",props:makeVRadioProps(),setup(props,{slots}){useRender(()=>{const controlProps=VSelectionControl.filterProps(props);return createVNode(VSelectionControl,mergeProps(controlProps,{"class":["v-radio",props.class],"style":props.style,"type":"radio"}),slots)});return{}}});const makeVRadioGroupProps=propsFactory({height:{type:[Number,String],default:"auto"},...omit(makeVInputProps(),["direction","glow"]),...omit(makeSelectionControlGroupProps(),["multiple"]),trueIcon:{type:IconValue,default:"$radioOn"},falseIcon:{type:IconValue,default:"$radioOff"},type:{type:String,default:"radio"}},"VRadioGroup");const VRadioGroup=genericComponent()({name:"VRadioGroup",inheritAttrs:false,props:makeVRadioGroupProps(),emits:{"update:modelValue":value=>true},setup(props,{attrs,slots}){const uid=useId();const id=computed(()=>props.id||`radio-group-${uid}`);const model=useProxiedModel(props,"modelValue");const inputRef=ref();useRender(()=>{const[rootAttrs,controlAttrs]=filterInputAttrs(attrs);const inputProps=VInput.filterProps(props);const controlProps=VSelectionControl.filterProps(props);const label=slots.label?slots.label({label:props.label,props:{for:id.value}}):props.label;return createVNode(VInput,mergeProps({"ref":inputRef,"class":["v-radio-group",props.class],"style":props.style},rootAttrs,inputProps,{"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event,"id":id.value}),{...slots,default:({id:id2,messagesId,isDisabled,isReadonly})=>createBaseVNode(Fragment,null,[label&&createVNode(VLabel,{"id":id2.value},{default:()=>[label]}),createVNode(VSelectionControlGroup,mergeProps(controlProps,{"id":id2.value,"aria-describedby":messagesId.value,"defaultsTarget":"VRadio","trueIcon":props.trueIcon,"falseIcon":props.falseIcon,"type":props.type,"disabled":isDisabled.value,"readonly":isReadonly.value,"aria-labelledby":label?id2.value:void 0,"multiple":false},controlAttrs,{"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event}),slots)])})});return forwardRefs({},inputRef)}});export{VRadioGroup as V,VRadio as a};
@@ -1 +1 @@
1
- import{c0 as genericComponent,c6 as useTextColor,cc as useBackgroundColor,c1 as useRender,n as VBtn,e as createVNode,d as createBaseVNode,c2 as normalizeStyle,$ as normalizeClass,F as Fragment,N as mergeProps,cL as forwardRefs,B as ref,cM as animate,A as computed,c3 as propsFactory,cN as omit,cO as makeVBtnProps,cP as standardEasing,cQ as keys,cR as provideTheme,cS as useRtl,cT as useLocale,cU as useGroup,H as watch,aC as withDirectives,cV as PREFERS_REDUCED_MOTION,cW as convertToUnit,a6 as nextTick,cX as makeThemeProps,c8 as makeTagProps,c4 as makeComponentProps,ck as toRef,cY as IN_BROWSER,cZ as getScrollParent,aP as shallowRef,bC as provide,au as inject,c_ as useProxiedModel,c$ as useGroupItem,d0 as useSsrBoot,d1 as useLazy,aD as vShow,d2 as MaybeTransition,d3 as makeLazyProps,d4 as makeGroupItemProps,cd as useDensity,d5 as useScopeId,cf as provideDefaults,d6 as VSlideGroup,cj as makeDensityProps,d7 as makeVSlideGroupProps,ca as pick,d8 as isObject}from"./index-SBc6H2In.js";const VTabsSymbol=Symbol.for("vuetify:v-tabs");const makeVTabProps=propsFactory({fixed:Boolean,sliderColor:String,sliderTransition:String,sliderTransitionDuration:[String,Number],hideSlider:Boolean,inset:Boolean,direction:{type:String,default:"horizontal"},...omit(makeVBtnProps({selectedClass:"v-tab--selected",variant:"text"}),["active","block","flat","location","position","symbol"])},"VTab");const VTab=genericComponent()({name:"VTab",props:makeVTabProps(),setup(props,{slots,attrs}){const{textColorClasses:sliderColorClasses,textColorStyles:sliderColorStyles}=useTextColor(()=>props.sliderColor);const{backgroundColorClasses:insetColorClasses,backgroundColorStyles:insetColorStyles}=useBackgroundColor(()=>props.sliderColor);const rootEl=ref();const sliderEl=ref();const isHorizontal=computed(()=>props.direction==="horizontal");const isSelected=computed(()=>{var _a,_b;return((_b=(_a=rootEl.value)==null?void 0:_a.group)==null?void 0:_b.isSelected.value)??false});function fade(nextEl,prevEl){return{opacity:[0,1]}}function grow(nextEl,prevEl){return props.direction==="vertical"?{transform:["scaleY(0)","scaleY(1)"]}:{transform:["scaleX(0)","scaleX(1)"]}}function shift(nextEl,prevEl){const prevBox=prevEl.getBoundingClientRect();const nextBox=nextEl.getBoundingClientRect();const xy=isHorizontal.value?"x":"y";const XY=isHorizontal.value?"X":"Y";const rightBottom=isHorizontal.value?"right":"bottom";const widthHeight=isHorizontal.value?"width":"height";const prevPos=prevBox[xy];const nextPos=nextBox[xy];const delta=prevPos>nextPos?prevBox[rightBottom]-nextBox[rightBottom]:prevBox[xy]-nextBox[xy];const origin=Math.sign(delta)>0?isHorizontal.value?"right":"bottom":Math.sign(delta)<0?isHorizontal.value?"left":"top":"center";const size=Math.abs(delta)+(Math.sign(delta)<0?prevBox[widthHeight]:nextBox[widthHeight]);const scale=size/Math.max(prevBox[widthHeight],nextBox[widthHeight])||0;const initialScale=prevBox[widthHeight]/nextBox[widthHeight]||0;const sigma=1.5;return{transform:[`translate${XY}(${delta}px) scale${XY}(${initialScale})`,`translate${XY}(${delta/sigma}px) scale${XY}(${(scale-1)/sigma+1})`,"none"],transformOrigin:Array(3).fill(origin)}}function updateSlider({value}){var _a,_b;if(value){const prevEl=(_b=(_a=rootEl.value)==null?void 0:_a.$el.parentElement)==null?void 0:_b.querySelector(".v-tab--selected .v-tab__slider");const nextEl=sliderEl.value;if(!prevEl||!nextEl)return;const color=getComputedStyle(prevEl).backgroundColor;const keyframes={fade,grow,shift}[props.sliderTransition??"shift"]??shift;const duration=Number(props.sliderTransitionDuration)||({fade:400,grow:350,shift:225}[props.sliderTransition??"shift"]??225);animate(nextEl,{backgroundColor:[color,color],...keyframes(nextEl,prevEl)},{duration,easing:standardEasing})}}useRender(()=>{const btnProps=VBtn.filterProps(props);return createVNode(VBtn,mergeProps({"symbol":VTabsSymbol,"ref":rootEl,"class":["v-tab",props.class,isSelected.value&&props.inset?insetColorClasses.value:[]],"style":[props.style,isSelected.value&&props.inset?insetColorStyles.value:[],{backgroundColor:isSelected.value&&props.inset?"transparent !important":void 0}],"tabindex":isSelected.value?0:-1,"role":"tab","aria-selected":String(isSelected.value),"active":false},btnProps,attrs,{"block":props.fixed,"maxWidth":props.fixed?300:void 0,"onGroup:selected":updateSlider}),{...slots,default:()=>{var _a;return createBaseVNode(Fragment,null,[((_a=slots.default)==null?void 0:_a.call(slots))??props.text,!props.hideSlider&&createBaseVNode("div",{"ref":sliderEl,"class":normalizeClass(["v-tab__slider",props.inset?insetColorClasses.value:sliderColorClasses.value]),"style":normalizeStyle([sliderColorStyles.value,props.inset?insetColorStyles.value:sliderColorClasses.value])},null)])}})});return forwardRefs({},rootEl)}});const handleGesture=wrapper=>{const{touchstartX,touchendX,touchstartY,touchendY}=wrapper;const dirRatio=.5;const minDistance=16;wrapper.offsetX=touchendX-touchstartX;wrapper.offsetY=touchendY-touchstartY;if(Math.abs(wrapper.offsetY)<dirRatio*Math.abs(wrapper.offsetX)){wrapper.left&&touchendX<touchstartX-minDistance&&wrapper.left(wrapper);wrapper.right&&touchendX>touchstartX+minDistance&&wrapper.right(wrapper)}if(Math.abs(wrapper.offsetX)<dirRatio*Math.abs(wrapper.offsetY)){wrapper.up&&touchendY<touchstartY-minDistance&&wrapper.up(wrapper);wrapper.down&&touchendY>touchstartY+minDistance&&wrapper.down(wrapper)}};function touchstart(event,wrapper){var _a;const touch=event.changedTouches[0];wrapper.touchstartX=touch.clientX;wrapper.touchstartY=touch.clientY;(_a=wrapper.start)==null?void 0:_a.call(wrapper,{originalEvent:event,...wrapper})}function touchend(event,wrapper){var _a;const touch=event.changedTouches[0];wrapper.touchendX=touch.clientX;wrapper.touchendY=touch.clientY;(_a=wrapper.end)==null?void 0:_a.call(wrapper,{originalEvent:event,...wrapper});handleGesture(wrapper)}function touchmove(event,wrapper){var _a;const touch=event.changedTouches[0];wrapper.touchmoveX=touch.clientX;wrapper.touchmoveY=touch.clientY;(_a=wrapper.move)==null?void 0:_a.call(wrapper,{originalEvent:event,...wrapper})}function createHandlers(value={}){const wrapper={touchstartX:0,touchstartY:0,touchendX:0,touchendY:0,touchmoveX:0,touchmoveY:0,offsetX:0,offsetY:0,left:value.left,right:value.right,up:value.up,down:value.down,start:value.start,move:value.move,end:value.end};return{touchstart:e=>touchstart(e,wrapper),touchend:e=>touchend(e,wrapper),touchmove:e=>touchmove(e,wrapper)}}function mounted(el,binding){var _a;const value=binding.value;const target=(value==null?void 0:value.parent)?el.parentElement:el;const options=(value==null?void 0:value.options)??{passive:true};const uid=(_a=binding.instance)==null?void 0:_a.$.uid;if(!target||uid===void 0)return;const handlers=createHandlers(binding.value);target._touchHandlers=target._touchHandlers??Object.create(null);target._touchHandlers[uid]=handlers;keys(handlers).forEach(eventName=>{target.addEventListener(eventName,handlers[eventName],options)})}function unmounted(el,binding){var _a,_b;const target=((_a=binding.value)==null?void 0:_a.parent)?el.parentElement:el;const uid=(_b=binding.instance)==null?void 0:_b.$.uid;if(!(target==null?void 0:target._touchHandlers)||uid===void 0)return;const handlers=target._touchHandlers[uid];if(!handlers)return;keys(handlers).forEach(eventName=>{target.removeEventListener(eventName,handlers[eventName])});delete target._touchHandlers[uid];if(!keys(target._touchHandlers).length){delete target._touchHandlers}}const Touch={mounted,unmounted};const VWindowSymbol=Symbol.for("vuetify:v-window");const VWindowGroupSymbol=Symbol.for("vuetify:v-window-group");const makeVWindowProps=propsFactory({continuous:Boolean,nextIcon:{type:[Boolean,String,Function,Object],default:"$next"},prevIcon:{type:[Boolean,String,Function,Object],default:"$prev"},reverse:Boolean,showArrows:{type:[Boolean,String],validator:v=>typeof v==="boolean"||v==="hover"},verticalArrows:[Boolean,String],touch:{type:[Object,Boolean],default:void 0},direction:{type:String,default:"horizontal"},modelValue:null,disabled:Boolean,selectedClass:{type:String,default:"v-window-item--active"},mandatory:{type:[Boolean,String],default:"force"},crossfade:Boolean,transitionDuration:Number,...makeComponentProps(),...makeTagProps(),...makeThemeProps()},"VWindow");const VWindow=genericComponent()({name:"VWindow",directives:{vTouch:Touch},props:makeVWindowProps(),emits:{"update:modelValue":value=>true},setup(props,{slots}){const{themeClasses}=provideTheme(props);const{isRtl}=useRtl();const{t}=useLocale();const group=useGroup(props,VWindowGroupSymbol);const rootRef=ref();const isRtlReverse=computed(()=>isRtl.value?!props.reverse:props.reverse);const isReversed=shallowRef(false);const transition=computed(()=>{if(props.crossfade){return"v-window-crossfade-transition"}const axis=props.direction==="vertical"?"y":"x";const reverse=isRtlReverse.value?!isReversed.value:isReversed.value;const direction=reverse?"-reverse":"";return`v-window-${axis}${direction}-transition`});const transitionCount=shallowRef(0);const transitionHeight=ref(void 0);const activeIndex=computed(()=>{return group.items.value.findIndex(item=>group.selected.value.includes(item.id))});watch(activeIndex,(newVal,oldVal)=>{let scrollableParent;const savedScrollPosition={left:0,top:0};if(IN_BROWSER&&oldVal>=0){scrollableParent=getScrollParent(rootRef.value);savedScrollPosition.left=scrollableParent==null?void 0:scrollableParent.scrollLeft;savedScrollPosition.top=scrollableParent==null?void 0:scrollableParent.scrollTop}const itemsLength=group.items.value.length;const lastIndex=itemsLength-1;if(itemsLength<=2){isReversed.value=newVal<oldVal}else if(newVal===lastIndex&&oldVal===0){isReversed.value=false}else if(newVal===0&&oldVal===lastIndex){isReversed.value=true}else{isReversed.value=newVal<oldVal}nextTick(()=>{if(!IN_BROWSER||!scrollableParent)return;const currentScrollY=scrollableParent.scrollTop;if(currentScrollY!==savedScrollPosition.top){scrollableParent.scrollTo({...savedScrollPosition,behavior:"instant"})}requestAnimationFrame(()=>{if(!scrollableParent)return;const rafScrollY=scrollableParent.scrollTop;if(rafScrollY!==savedScrollPosition.top){scrollableParent.scrollTo({...savedScrollPosition,behavior:"instant"})}})})},{flush:"sync"});provide(VWindowSymbol,{transition,isReversed,transitionCount,transitionHeight,rootRef});const canMoveBack=toRef(()=>props.continuous||activeIndex.value!==0);const canMoveForward=toRef(()=>props.continuous||activeIndex.value!==group.items.value.length-1);function prev(){canMoveBack.value&&group.prev()}function next(){canMoveForward.value&&group.next()}const arrows=computed(()=>{const arrows2=[];const prevProps={icon:isRtl.value?props.nextIcon:props.prevIcon,class:`v-window__${isRtlReverse.value?"right":"left"}`,onClick:group.prev,"aria-label":t("$vuetify.carousel.prev")};arrows2.push(canMoveBack.value?slots.prev?slots.prev({props:prevProps}):createVNode(VBtn,prevProps,null):createBaseVNode("div",null,null));const nextProps={icon:isRtl.value?props.prevIcon:props.nextIcon,class:`v-window__${isRtlReverse.value?"left":"right"}`,onClick:group.next,"aria-label":t("$vuetify.carousel.next")};arrows2.push(canMoveForward.value?slots.next?slots.next({props:nextProps}):createVNode(VBtn,nextProps,null):createBaseVNode("div",null,null));return arrows2});const touchOptions=computed(()=>{if(props.touch===false)return props.touch;const options={left:()=>{isRtlReverse.value?prev():next()},right:()=>{isRtlReverse.value?next():prev()},start:({originalEvent})=>{originalEvent.stopPropagation()}};return{...options,...props.touch===true?{}:props.touch}});function onKeyDown(e){if(props.direction==="horizontal"&&e.key==="ArrowLeft"||props.direction==="vertical"&&e.key==="ArrowUp"){e.preventDefault();prev();nextTick(()=>{canMoveBack.value?focusArrow(0):focusArrow(1)})}if(props.direction==="horizontal"&&e.key==="ArrowRight"||props.direction==="vertical"&&e.key==="ArrowDown"){e.preventDefault();next();nextTick(()=>{canMoveForward.value?focusArrow(1):focusArrow(0)})}}function focusArrow(index){var _a;const arrow=arrows.value[index];if(!arrow)return;const arrowEl=Array.isArray(arrow)?arrow[0]:arrow;(_a=arrowEl.el)==null?void 0:_a.focus()}useRender(()=>withDirectives(createVNode(props.tag,{"ref":rootRef,"class":normalizeClass(["v-window",{"v-window--show-arrows-on-hover":props.showArrows==="hover","v-window--vertical-arrows":!!props.verticalArrows,"v-window--crossfade":!!props.crossfade},themeClasses.value,props.class]),"style":normalizeStyle([props.style,{"--v-window-transition-duration":!PREFERS_REDUCED_MOTION()?convertToUnit(props.transitionDuration,"ms"):null}])},{default:()=>{var _a,_b;return[createBaseVNode("div",{"class":"v-window__container","style":{height:transitionHeight.value}},[(_a=slots.default)==null?void 0:_a.call(slots,{group}),props.showArrows!==false&&createBaseVNode("div",{"class":normalizeClass(["v-window__controls",{"v-window__controls--left":props.verticalArrows==="left"||props.verticalArrows===true},{"v-window__controls--right":props.verticalArrows==="right"}]),"onKeydown":onKeyDown},[arrows.value])]),(_b=slots.additional)==null?void 0:_b.call(slots,{group})]}}),[[Touch,touchOptions.value]]));return{group}}});const makeVTabsWindowProps=propsFactory({...omit(makeVWindowProps(),["continuous","nextIcon","prevIcon","showArrows","touch","mandatory"])},"VTabsWindow");const VTabsWindow=genericComponent()({name:"VTabsWindow",props:makeVTabsWindowProps(),emits:{"update:modelValue":v=>true},setup(props,{slots}){const group=inject(VTabsSymbol,null);const _model=useProxiedModel(props,"modelValue");const model=computed({get(){var _a;if(_model.value!=null||!group)return _model.value;return(_a=group.items.value.find(item=>group.selected.value.includes(item.id)))==null?void 0:_a.value},set(val){_model.value=val}});useRender(()=>{const windowProps=VWindow.filterProps(props);return createVNode(VWindow,mergeProps({"_as":"VTabsWindow"},windowProps,{"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event,"class":["v-tabs-window",props.class],"style":props.style,"mandatory":false,"touch":false}),slots)});return{}}});const makeVWindowItemProps=propsFactory({reverseTransition:{type:[Boolean,String],default:void 0},transition:{type:[Boolean,String],default:void 0},...makeComponentProps(),...makeGroupItemProps(),...makeLazyProps()},"VWindowItem");const VWindowItem=genericComponent()({name:"VWindowItem",directives:{vTouch:Touch},props:makeVWindowItemProps(),emits:{"group:selected":val=>true},setup(props,{slots}){const window=inject(VWindowSymbol);const groupItem=useGroupItem(props,VWindowGroupSymbol);const{isBooted}=useSsrBoot();if(!window||!groupItem)throw new Error("[Vuetify] VWindowItem must be used inside VWindow");const isTransitioning=shallowRef(false);const hasTransition=computed(()=>isBooted.value&&(window.isReversed.value?props.reverseTransition!==false:props.transition!==false));function onAfterTransition(){if(!isTransitioning.value||!window){return}isTransitioning.value=false;if(window.transitionCount.value>0){window.transitionCount.value-=1;if(window.transitionCount.value===0){window.transitionHeight.value=void 0}}}function onBeforeTransition(){var _a;if(isTransitioning.value||!window){return}isTransitioning.value=true;if(window.transitionCount.value===0){window.transitionHeight.value=convertToUnit((_a=window.rootRef.value)==null?void 0:_a.clientHeight)}window.transitionCount.value+=1}function onTransitionCancelled(){onAfterTransition()}function onEnterTransition(el){if(!isTransitioning.value){return}nextTick(()=>{if(!hasTransition.value||!isTransitioning.value||!window){return}window.transitionHeight.value=convertToUnit(el.clientHeight)})}const transition=computed(()=>{const name=window.isReversed.value?props.reverseTransition:props.transition;return!hasTransition.value?false:{name:typeof name!=="string"?window.transition.value:name,onBeforeEnter:onBeforeTransition,onAfterEnter:onAfterTransition,onEnterCancelled:onTransitionCancelled,onBeforeLeave:onBeforeTransition,onAfterLeave:onAfterTransition,onLeaveCancelled:onTransitionCancelled,onEnter:onEnterTransition}});const{hasContent}=useLazy(props,groupItem.isSelected);useRender(()=>createVNode(MaybeTransition,{"transition":transition.value,"disabled":!isBooted.value},{default:()=>{var _a;return[withDirectives(createBaseVNode("div",{"class":normalizeClass(["v-window-item",groupItem.selectedClass.value,props.class]),"style":normalizeStyle(props.style)},[hasContent.value&&((_a=slots.default)==null?void 0:_a.call(slots))]),[[vShow,groupItem.isSelected.value]])]}}));return{groupItem}}});const makeVTabsWindowItemProps=propsFactory({...makeVWindowItemProps()},"VTabsWindowItem");const VTabsWindowItem=genericComponent()({name:"VTabsWindowItem",props:makeVTabsWindowItemProps(),setup(props,{slots}){useRender(()=>{const windowItemProps=VWindowItem.filterProps(props);return createVNode(VWindowItem,mergeProps({"_as":"VTabsWindowItem"},windowItemProps,{"class":["v-tabs-window-item",props.class],"style":props.style}),slots)});return{}}});function parseItems(items){if(!items)return[];return items.map(item=>{if(!isObject(item))return{text:item,value:item};return item})}const makeVTabsProps=propsFactory({alignTabs:{type:String,default:"start"},color:String,fixedTabs:Boolean,items:{type:Array,default:()=>[]},stacked:Boolean,bgColor:String,grow:Boolean,height:{type:[Number,String],default:void 0},hideSlider:Boolean,inset:Boolean,insetPadding:[String,Number],insetRadius:[String,Number],sliderColor:String,...pick(makeVTabProps(),["spaced","sliderTransition","sliderTransitionDuration"]),...makeVSlideGroupProps({mandatory:"force",selectedClass:"v-tab-item--selected"}),...makeDensityProps(),...makeTagProps()},"VTabs");const VTabs=genericComponent()({name:"VTabs",props:makeVTabsProps(),emits:{"update:modelValue":v=>true},setup(props,{attrs,slots}){const model=useProxiedModel(props,"modelValue");const items=computed(()=>parseItems(props.items));const{densityClasses}=useDensity(props);const{backgroundColorClasses,backgroundColorStyles}=useBackgroundColor(()=>props.bgColor);const{scopeId}=useScopeId();provideDefaults({VTab:{color:toRef(props,"color"),direction:toRef(props,"direction"),stacked:toRef(props,"stacked"),fixed:toRef(props,"fixedTabs"),inset:toRef(props,"inset"),sliderColor:toRef(props,"sliderColor"),sliderTransition:toRef(props,"sliderTransition"),sliderTransitionDuration:toRef(props,"sliderTransitionDuration"),hideSlider:toRef(props,"hideSlider")}});useRender(()=>{const slideGroupProps=VSlideGroup.filterProps(props);const hasWindow=!!(slots.window||props.items.length>0);return createBaseVNode(Fragment,null,[createVNode(VSlideGroup,mergeProps(slideGroupProps,{"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event,"class":["v-tabs",`v-tabs--${props.direction}`,`v-tabs--align-tabs-${props.alignTabs}`,{"v-tabs--fixed-tabs":props.fixedTabs,"v-tabs--grow":props.grow,"v-tabs--inset":props.inset,"v-tabs--stacked":props.stacked},densityClasses.value,backgroundColorClasses.value,props.class],"style":[{"--v-tabs-height":convertToUnit(props.height),"--v-tabs-inset-padding":props.inset?convertToUnit(props.insetPadding):void 0,"--v-tabs-inset-radius":props.inset?convertToUnit(props.insetRadius):void 0},backgroundColorStyles.value,props.style],"role":"tablist","symbol":VTabsSymbol},scopeId,attrs),{default:slots.default??(()=>items.value.map(item=>{var _a;return((_a=slots.tab)==null?void 0:_a.call(slots,{item}))??createVNode(VTab,mergeProps(item,{"key":item.text,"value":item.value,"spaced":props.spaced}),{default:slots[`tab.${item.value}`]?()=>{var _a2;return(_a2=slots[`tab.${item.value}`])==null?void 0:_a2.call(slots,{item})}:void 0})})),prev:slots.prev,next:slots.next}),hasWindow&&createVNode(VTabsWindow,mergeProps({"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event,"key":"tabs-window"},scopeId),{default:()=>{var _a;return[items.value.map(item=>{var _a2;return((_a2=slots.item)==null?void 0:_a2.call(slots,{item}))??createVNode(VTabsWindowItem,{"value":item.value},{default:()=>{var _a3;return(_a3=slots[`item.${item.value}`])==null?void 0:_a3.call(slots,{item})}})}),(_a=slots.window)==null?void 0:_a.call(slots)]}})])});return{}}});export{VTabs as V,VTab as a};
1
+ import{c0 as genericComponent,c6 as useTextColor,cc as useBackgroundColor,c1 as useRender,n as VBtn,e as createVNode,d as createBaseVNode,c2 as normalizeStyle,$ as normalizeClass,F as Fragment,N as mergeProps,cL as forwardRefs,B as ref,cM as animate,A as computed,c3 as propsFactory,cN as omit,cO as makeVBtnProps,cP as standardEasing,cQ as keys,cR as provideTheme,cS as useRtl,cT as useLocale,cU as useGroup,H as watch,aC as withDirectives,cV as PREFERS_REDUCED_MOTION,cW as convertToUnit,a6 as nextTick,cX as makeThemeProps,c8 as makeTagProps,c4 as makeComponentProps,ck as toRef,cY as IN_BROWSER,cZ as getScrollParent,aP as shallowRef,bC as provide,au as inject,c_ as useProxiedModel,c$ as useGroupItem,d0 as useSsrBoot,d1 as useLazy,aD as vShow,d2 as MaybeTransition,d3 as makeLazyProps,d4 as makeGroupItemProps,cd as useDensity,d5 as useScopeId,cf as provideDefaults,d6 as VSlideGroup,cj as makeDensityProps,d7 as makeVSlideGroupProps,ca as pick,d8 as isObject}from"./index-C4KnwA0g.js";const VTabsSymbol=Symbol.for("vuetify:v-tabs");const makeVTabProps=propsFactory({fixed:Boolean,sliderColor:String,sliderTransition:String,sliderTransitionDuration:[String,Number],hideSlider:Boolean,inset:Boolean,direction:{type:String,default:"horizontal"},...omit(makeVBtnProps({selectedClass:"v-tab--selected",variant:"text"}),["active","block","flat","location","position","symbol"])},"VTab");const VTab=genericComponent()({name:"VTab",props:makeVTabProps(),setup(props,{slots,attrs}){const{textColorClasses:sliderColorClasses,textColorStyles:sliderColorStyles}=useTextColor(()=>props.sliderColor);const{backgroundColorClasses:insetColorClasses,backgroundColorStyles:insetColorStyles}=useBackgroundColor(()=>props.sliderColor);const rootEl=ref();const sliderEl=ref();const isHorizontal=computed(()=>props.direction==="horizontal");const isSelected=computed(()=>{var _a,_b;return((_b=(_a=rootEl.value)==null?void 0:_a.group)==null?void 0:_b.isSelected.value)??false});function fade(nextEl,prevEl){return{opacity:[0,1]}}function grow(nextEl,prevEl){return props.direction==="vertical"?{transform:["scaleY(0)","scaleY(1)"]}:{transform:["scaleX(0)","scaleX(1)"]}}function shift(nextEl,prevEl){const prevBox=prevEl.getBoundingClientRect();const nextBox=nextEl.getBoundingClientRect();const xy=isHorizontal.value?"x":"y";const XY=isHorizontal.value?"X":"Y";const rightBottom=isHorizontal.value?"right":"bottom";const widthHeight=isHorizontal.value?"width":"height";const prevPos=prevBox[xy];const nextPos=nextBox[xy];const delta=prevPos>nextPos?prevBox[rightBottom]-nextBox[rightBottom]:prevBox[xy]-nextBox[xy];const origin=Math.sign(delta)>0?isHorizontal.value?"right":"bottom":Math.sign(delta)<0?isHorizontal.value?"left":"top":"center";const size=Math.abs(delta)+(Math.sign(delta)<0?prevBox[widthHeight]:nextBox[widthHeight]);const scale=size/Math.max(prevBox[widthHeight],nextBox[widthHeight])||0;const initialScale=prevBox[widthHeight]/nextBox[widthHeight]||0;const sigma=1.5;return{transform:[`translate${XY}(${delta}px) scale${XY}(${initialScale})`,`translate${XY}(${delta/sigma}px) scale${XY}(${(scale-1)/sigma+1})`,"none"],transformOrigin:Array(3).fill(origin)}}function updateSlider({value}){var _a,_b;if(value){const prevEl=(_b=(_a=rootEl.value)==null?void 0:_a.$el.parentElement)==null?void 0:_b.querySelector(".v-tab--selected .v-tab__slider");const nextEl=sliderEl.value;if(!prevEl||!nextEl)return;const color=getComputedStyle(prevEl).backgroundColor;const keyframes={fade,grow,shift}[props.sliderTransition??"shift"]??shift;const duration=Number(props.sliderTransitionDuration)||({fade:400,grow:350,shift:225}[props.sliderTransition??"shift"]??225);animate(nextEl,{backgroundColor:[color,color],...keyframes(nextEl,prevEl)},{duration,easing:standardEasing})}}useRender(()=>{const btnProps=VBtn.filterProps(props);return createVNode(VBtn,mergeProps({"symbol":VTabsSymbol,"ref":rootEl,"class":["v-tab",props.class,isSelected.value&&props.inset?insetColorClasses.value:[]],"style":[props.style,isSelected.value&&props.inset?insetColorStyles.value:[],{backgroundColor:isSelected.value&&props.inset?"transparent !important":void 0}],"tabindex":isSelected.value?0:-1,"role":"tab","aria-selected":String(isSelected.value),"active":false},btnProps,attrs,{"block":props.fixed,"maxWidth":props.fixed?300:void 0,"onGroup:selected":updateSlider}),{...slots,default:()=>{var _a;return createBaseVNode(Fragment,null,[((_a=slots.default)==null?void 0:_a.call(slots))??props.text,!props.hideSlider&&createBaseVNode("div",{"ref":sliderEl,"class":normalizeClass(["v-tab__slider",props.inset?insetColorClasses.value:sliderColorClasses.value]),"style":normalizeStyle([sliderColorStyles.value,props.inset?insetColorStyles.value:sliderColorClasses.value])},null)])}})});return forwardRefs({},rootEl)}});const handleGesture=wrapper=>{const{touchstartX,touchendX,touchstartY,touchendY}=wrapper;const dirRatio=.5;const minDistance=16;wrapper.offsetX=touchendX-touchstartX;wrapper.offsetY=touchendY-touchstartY;if(Math.abs(wrapper.offsetY)<dirRatio*Math.abs(wrapper.offsetX)){wrapper.left&&touchendX<touchstartX-minDistance&&wrapper.left(wrapper);wrapper.right&&touchendX>touchstartX+minDistance&&wrapper.right(wrapper)}if(Math.abs(wrapper.offsetX)<dirRatio*Math.abs(wrapper.offsetY)){wrapper.up&&touchendY<touchstartY-minDistance&&wrapper.up(wrapper);wrapper.down&&touchendY>touchstartY+minDistance&&wrapper.down(wrapper)}};function touchstart(event,wrapper){var _a;const touch=event.changedTouches[0];wrapper.touchstartX=touch.clientX;wrapper.touchstartY=touch.clientY;(_a=wrapper.start)==null?void 0:_a.call(wrapper,{originalEvent:event,...wrapper})}function touchend(event,wrapper){var _a;const touch=event.changedTouches[0];wrapper.touchendX=touch.clientX;wrapper.touchendY=touch.clientY;(_a=wrapper.end)==null?void 0:_a.call(wrapper,{originalEvent:event,...wrapper});handleGesture(wrapper)}function touchmove(event,wrapper){var _a;const touch=event.changedTouches[0];wrapper.touchmoveX=touch.clientX;wrapper.touchmoveY=touch.clientY;(_a=wrapper.move)==null?void 0:_a.call(wrapper,{originalEvent:event,...wrapper})}function createHandlers(value={}){const wrapper={touchstartX:0,touchstartY:0,touchendX:0,touchendY:0,touchmoveX:0,touchmoveY:0,offsetX:0,offsetY:0,left:value.left,right:value.right,up:value.up,down:value.down,start:value.start,move:value.move,end:value.end};return{touchstart:e=>touchstart(e,wrapper),touchend:e=>touchend(e,wrapper),touchmove:e=>touchmove(e,wrapper)}}function mounted(el,binding){var _a;const value=binding.value;const target=(value==null?void 0:value.parent)?el.parentElement:el;const options=(value==null?void 0:value.options)??{passive:true};const uid=(_a=binding.instance)==null?void 0:_a.$.uid;if(!target||uid===void 0)return;const handlers=createHandlers(binding.value);target._touchHandlers=target._touchHandlers??Object.create(null);target._touchHandlers[uid]=handlers;keys(handlers).forEach(eventName=>{target.addEventListener(eventName,handlers[eventName],options)})}function unmounted(el,binding){var _a,_b;const target=((_a=binding.value)==null?void 0:_a.parent)?el.parentElement:el;const uid=(_b=binding.instance)==null?void 0:_b.$.uid;if(!(target==null?void 0:target._touchHandlers)||uid===void 0)return;const handlers=target._touchHandlers[uid];if(!handlers)return;keys(handlers).forEach(eventName=>{target.removeEventListener(eventName,handlers[eventName])});delete target._touchHandlers[uid];if(!keys(target._touchHandlers).length){delete target._touchHandlers}}const Touch={mounted,unmounted};const VWindowSymbol=Symbol.for("vuetify:v-window");const VWindowGroupSymbol=Symbol.for("vuetify:v-window-group");const makeVWindowProps=propsFactory({continuous:Boolean,nextIcon:{type:[Boolean,String,Function,Object],default:"$next"},prevIcon:{type:[Boolean,String,Function,Object],default:"$prev"},reverse:Boolean,showArrows:{type:[Boolean,String],validator:v=>typeof v==="boolean"||v==="hover"},verticalArrows:[Boolean,String],touch:{type:[Object,Boolean],default:void 0},direction:{type:String,default:"horizontal"},modelValue:null,disabled:Boolean,selectedClass:{type:String,default:"v-window-item--active"},mandatory:{type:[Boolean,String],default:"force"},crossfade:Boolean,transitionDuration:Number,...makeComponentProps(),...makeTagProps(),...makeThemeProps()},"VWindow");const VWindow=genericComponent()({name:"VWindow",directives:{vTouch:Touch},props:makeVWindowProps(),emits:{"update:modelValue":value=>true},setup(props,{slots}){const{themeClasses}=provideTheme(props);const{isRtl}=useRtl();const{t}=useLocale();const group=useGroup(props,VWindowGroupSymbol);const rootRef=ref();const isRtlReverse=computed(()=>isRtl.value?!props.reverse:props.reverse);const isReversed=shallowRef(false);const transition=computed(()=>{if(props.crossfade){return"v-window-crossfade-transition"}const axis=props.direction==="vertical"?"y":"x";const reverse=isRtlReverse.value?!isReversed.value:isReversed.value;const direction=reverse?"-reverse":"";return`v-window-${axis}${direction}-transition`});const transitionCount=shallowRef(0);const transitionHeight=ref(void 0);const activeIndex=computed(()=>{return group.items.value.findIndex(item=>group.selected.value.includes(item.id))});watch(activeIndex,(newVal,oldVal)=>{let scrollableParent;const savedScrollPosition={left:0,top:0};if(IN_BROWSER&&oldVal>=0){scrollableParent=getScrollParent(rootRef.value);savedScrollPosition.left=scrollableParent==null?void 0:scrollableParent.scrollLeft;savedScrollPosition.top=scrollableParent==null?void 0:scrollableParent.scrollTop}const itemsLength=group.items.value.length;const lastIndex=itemsLength-1;if(itemsLength<=2){isReversed.value=newVal<oldVal}else if(newVal===lastIndex&&oldVal===0){isReversed.value=false}else if(newVal===0&&oldVal===lastIndex){isReversed.value=true}else{isReversed.value=newVal<oldVal}nextTick(()=>{if(!IN_BROWSER||!scrollableParent)return;const currentScrollY=scrollableParent.scrollTop;if(currentScrollY!==savedScrollPosition.top){scrollableParent.scrollTo({...savedScrollPosition,behavior:"instant"})}requestAnimationFrame(()=>{if(!scrollableParent)return;const rafScrollY=scrollableParent.scrollTop;if(rafScrollY!==savedScrollPosition.top){scrollableParent.scrollTo({...savedScrollPosition,behavior:"instant"})}})})},{flush:"sync"});provide(VWindowSymbol,{transition,isReversed,transitionCount,transitionHeight,rootRef});const canMoveBack=toRef(()=>props.continuous||activeIndex.value!==0);const canMoveForward=toRef(()=>props.continuous||activeIndex.value!==group.items.value.length-1);function prev(){canMoveBack.value&&group.prev()}function next(){canMoveForward.value&&group.next()}const arrows=computed(()=>{const arrows2=[];const prevProps={icon:isRtl.value?props.nextIcon:props.prevIcon,class:`v-window__${isRtlReverse.value?"right":"left"}`,onClick:group.prev,"aria-label":t("$vuetify.carousel.prev")};arrows2.push(canMoveBack.value?slots.prev?slots.prev({props:prevProps}):createVNode(VBtn,prevProps,null):createBaseVNode("div",null,null));const nextProps={icon:isRtl.value?props.prevIcon:props.nextIcon,class:`v-window__${isRtlReverse.value?"left":"right"}`,onClick:group.next,"aria-label":t("$vuetify.carousel.next")};arrows2.push(canMoveForward.value?slots.next?slots.next({props:nextProps}):createVNode(VBtn,nextProps,null):createBaseVNode("div",null,null));return arrows2});const touchOptions=computed(()=>{if(props.touch===false)return props.touch;const options={left:()=>{isRtlReverse.value?prev():next()},right:()=>{isRtlReverse.value?next():prev()},start:({originalEvent})=>{originalEvent.stopPropagation()}};return{...options,...props.touch===true?{}:props.touch}});function onKeyDown(e){if(props.direction==="horizontal"&&e.key==="ArrowLeft"||props.direction==="vertical"&&e.key==="ArrowUp"){e.preventDefault();prev();nextTick(()=>{canMoveBack.value?focusArrow(0):focusArrow(1)})}if(props.direction==="horizontal"&&e.key==="ArrowRight"||props.direction==="vertical"&&e.key==="ArrowDown"){e.preventDefault();next();nextTick(()=>{canMoveForward.value?focusArrow(1):focusArrow(0)})}}function focusArrow(index){var _a;const arrow=arrows.value[index];if(!arrow)return;const arrowEl=Array.isArray(arrow)?arrow[0]:arrow;(_a=arrowEl.el)==null?void 0:_a.focus()}useRender(()=>withDirectives(createVNode(props.tag,{"ref":rootRef,"class":normalizeClass(["v-window",{"v-window--show-arrows-on-hover":props.showArrows==="hover","v-window--vertical-arrows":!!props.verticalArrows,"v-window--crossfade":!!props.crossfade},themeClasses.value,props.class]),"style":normalizeStyle([props.style,{"--v-window-transition-duration":!PREFERS_REDUCED_MOTION()?convertToUnit(props.transitionDuration,"ms"):null}])},{default:()=>{var _a,_b;return[createBaseVNode("div",{"class":"v-window__container","style":{height:transitionHeight.value}},[(_a=slots.default)==null?void 0:_a.call(slots,{group}),props.showArrows!==false&&createBaseVNode("div",{"class":normalizeClass(["v-window__controls",{"v-window__controls--left":props.verticalArrows==="left"||props.verticalArrows===true},{"v-window__controls--right":props.verticalArrows==="right"}]),"onKeydown":onKeyDown},[arrows.value])]),(_b=slots.additional)==null?void 0:_b.call(slots,{group})]}}),[[Touch,touchOptions.value]]));return{group}}});const makeVTabsWindowProps=propsFactory({...omit(makeVWindowProps(),["continuous","nextIcon","prevIcon","showArrows","touch","mandatory"])},"VTabsWindow");const VTabsWindow=genericComponent()({name:"VTabsWindow",props:makeVTabsWindowProps(),emits:{"update:modelValue":v=>true},setup(props,{slots}){const group=inject(VTabsSymbol,null);const _model=useProxiedModel(props,"modelValue");const model=computed({get(){var _a;if(_model.value!=null||!group)return _model.value;return(_a=group.items.value.find(item=>group.selected.value.includes(item.id)))==null?void 0:_a.value},set(val){_model.value=val}});useRender(()=>{const windowProps=VWindow.filterProps(props);return createVNode(VWindow,mergeProps({"_as":"VTabsWindow"},windowProps,{"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event,"class":["v-tabs-window",props.class],"style":props.style,"mandatory":false,"touch":false}),slots)});return{}}});const makeVWindowItemProps=propsFactory({reverseTransition:{type:[Boolean,String],default:void 0},transition:{type:[Boolean,String],default:void 0},...makeComponentProps(),...makeGroupItemProps(),...makeLazyProps()},"VWindowItem");const VWindowItem=genericComponent()({name:"VWindowItem",directives:{vTouch:Touch},props:makeVWindowItemProps(),emits:{"group:selected":val=>true},setup(props,{slots}){const window=inject(VWindowSymbol);const groupItem=useGroupItem(props,VWindowGroupSymbol);const{isBooted}=useSsrBoot();if(!window||!groupItem)throw new Error("[Vuetify] VWindowItem must be used inside VWindow");const isTransitioning=shallowRef(false);const hasTransition=computed(()=>isBooted.value&&(window.isReversed.value?props.reverseTransition!==false:props.transition!==false));function onAfterTransition(){if(!isTransitioning.value||!window){return}isTransitioning.value=false;if(window.transitionCount.value>0){window.transitionCount.value-=1;if(window.transitionCount.value===0){window.transitionHeight.value=void 0}}}function onBeforeTransition(){var _a;if(isTransitioning.value||!window){return}isTransitioning.value=true;if(window.transitionCount.value===0){window.transitionHeight.value=convertToUnit((_a=window.rootRef.value)==null?void 0:_a.clientHeight)}window.transitionCount.value+=1}function onTransitionCancelled(){onAfterTransition()}function onEnterTransition(el){if(!isTransitioning.value){return}nextTick(()=>{if(!hasTransition.value||!isTransitioning.value||!window){return}window.transitionHeight.value=convertToUnit(el.clientHeight)})}const transition=computed(()=>{const name=window.isReversed.value?props.reverseTransition:props.transition;return!hasTransition.value?false:{name:typeof name!=="string"?window.transition.value:name,onBeforeEnter:onBeforeTransition,onAfterEnter:onAfterTransition,onEnterCancelled:onTransitionCancelled,onBeforeLeave:onBeforeTransition,onAfterLeave:onAfterTransition,onLeaveCancelled:onTransitionCancelled,onEnter:onEnterTransition}});const{hasContent}=useLazy(props,groupItem.isSelected);useRender(()=>createVNode(MaybeTransition,{"transition":transition.value,"disabled":!isBooted.value},{default:()=>{var _a;return[withDirectives(createBaseVNode("div",{"class":normalizeClass(["v-window-item",groupItem.selectedClass.value,props.class]),"style":normalizeStyle(props.style)},[hasContent.value&&((_a=slots.default)==null?void 0:_a.call(slots))]),[[vShow,groupItem.isSelected.value]])]}}));return{groupItem}}});const makeVTabsWindowItemProps=propsFactory({...makeVWindowItemProps()},"VTabsWindowItem");const VTabsWindowItem=genericComponent()({name:"VTabsWindowItem",props:makeVTabsWindowItemProps(),setup(props,{slots}){useRender(()=>{const windowItemProps=VWindowItem.filterProps(props);return createVNode(VWindowItem,mergeProps({"_as":"VTabsWindowItem"},windowItemProps,{"class":["v-tabs-window-item",props.class],"style":props.style}),slots)});return{}}});function parseItems(items){if(!items)return[];return items.map(item=>{if(!isObject(item))return{text:item,value:item};return item})}const makeVTabsProps=propsFactory({alignTabs:{type:String,default:"start"},color:String,fixedTabs:Boolean,items:{type:Array,default:()=>[]},stacked:Boolean,bgColor:String,grow:Boolean,height:{type:[Number,String],default:void 0},hideSlider:Boolean,inset:Boolean,insetPadding:[String,Number],insetRadius:[String,Number],sliderColor:String,...pick(makeVTabProps(),["spaced","sliderTransition","sliderTransitionDuration"]),...makeVSlideGroupProps({mandatory:"force",selectedClass:"v-tab-item--selected"}),...makeDensityProps(),...makeTagProps()},"VTabs");const VTabs=genericComponent()({name:"VTabs",props:makeVTabsProps(),emits:{"update:modelValue":v=>true},setup(props,{attrs,slots}){const model=useProxiedModel(props,"modelValue");const items=computed(()=>parseItems(props.items));const{densityClasses}=useDensity(props);const{backgroundColorClasses,backgroundColorStyles}=useBackgroundColor(()=>props.bgColor);const{scopeId}=useScopeId();provideDefaults({VTab:{color:toRef(props,"color"),direction:toRef(props,"direction"),stacked:toRef(props,"stacked"),fixed:toRef(props,"fixedTabs"),inset:toRef(props,"inset"),sliderColor:toRef(props,"sliderColor"),sliderTransition:toRef(props,"sliderTransition"),sliderTransitionDuration:toRef(props,"sliderTransitionDuration"),hideSlider:toRef(props,"hideSlider")}});useRender(()=>{const slideGroupProps=VSlideGroup.filterProps(props);const hasWindow=!!(slots.window||props.items.length>0);return createBaseVNode(Fragment,null,[createVNode(VSlideGroup,mergeProps(slideGroupProps,{"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event,"class":["v-tabs",`v-tabs--${props.direction}`,`v-tabs--align-tabs-${props.alignTabs}`,{"v-tabs--fixed-tabs":props.fixedTabs,"v-tabs--grow":props.grow,"v-tabs--inset":props.inset,"v-tabs--stacked":props.stacked},densityClasses.value,backgroundColorClasses.value,props.class],"style":[{"--v-tabs-height":convertToUnit(props.height),"--v-tabs-inset-padding":props.inset?convertToUnit(props.insetPadding):void 0,"--v-tabs-inset-radius":props.inset?convertToUnit(props.insetRadius):void 0},backgroundColorStyles.value,props.style],"role":"tablist","symbol":VTabsSymbol},scopeId,attrs),{default:slots.default??(()=>items.value.map(item=>{var _a;return((_a=slots.tab)==null?void 0:_a.call(slots,{item}))??createVNode(VTab,mergeProps(item,{"key":item.text,"value":item.value,"spaced":props.spaced}),{default:slots[`tab.${item.value}`]?()=>{var _a2;return(_a2=slots[`tab.${item.value}`])==null?void 0:_a2.call(slots,{item})}:void 0})})),prev:slots.prev,next:slots.next}),hasWindow&&createVNode(VTabsWindow,mergeProps({"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event,"key":"tabs-window"},scopeId),{default:()=>{var _a;return[items.value.map(item=>{var _a2;return((_a2=slots.item)==null?void 0:_a2.call(slots,{item}))??createVNode(VTabsWindowItem,{"value":item.value},{default:()=>{var _a3;return(_a3=slots[`item.${item.value}`])==null?void 0:_a3.call(slots,{item})}})}),(_a=slots.window)==null?void 0:_a.call(slots)]}})])});return{}}});export{VTabs as V,VTab as a};
@@ -1 +1 @@
1
- import{c0 as genericComponent,eh as Intersect,c_ as useProxiedModel,ei as useFocus,a7 as useDisplay,ej as useAutocomplete,B as ref,bE as watchEffect,o as onMounted,H as watch,C as onBeforeUnmount,c1 as useRender,eb as filterInputAttrs,ec as VInput,ek as VField,e as createVNode,d as createBaseVNode,F as Fragment,el as VCounter,N as mergeProps,aC as withDirectives,em as vModelText,$ as normalizeClass,cW as convertToUnit,cL as forwardRefs,a6 as nextTick,en as clamp,A as computed,eo as callEvent,aP as shallowRef,ep as useAutofocus,eq as getActiveElement,c3 as propsFactory,er as makeVFieldProps,cN as omit,eg as makeVInputProps,es as makeAutocompleteProps}from"./index-SBc6H2In.js";const makeVTextareaProps=propsFactory({autoGrow:Boolean,autofocus:Boolean,counter:[Boolean,Number,String],counterValue:Function,prefix:String,placeholder:String,persistentPlaceholder:Boolean,persistentCounter:Boolean,noResize:Boolean,rows:{type:[Number,String],default:5,validator:v=>!isNaN(parseFloat(v))},maxHeight:{type:[Number,String],validator:v=>!isNaN(parseFloat(v))},maxRows:{type:[Number,String],validator:v=>!isNaN(parseFloat(v))},suffix:String,modelModifiers:Object,...makeAutocompleteProps(),...omit(makeVInputProps(),["direction"]),...makeVFieldProps()},"VTextarea");const VTextarea=genericComponent()({name:"VTextarea",directives:{vIntersect:Intersect},inheritAttrs:false,props:makeVTextareaProps(),emits:{"click:control":e=>true,"mousedown:control":e=>true,"update:focused":focused=>true,"update:modelValue":val=>true,"update:rows":rows=>true},setup(props,{attrs,emit,slots}){const model=useProxiedModel(props,"modelValue");const{isFocused,focus,blur}=useFocus(props);const{onIntersect}=useAutofocus(props);const counterValue=computed(()=>{return typeof props.counterValue==="function"?props.counterValue(model.value):(model.value||"").toString().length});const max=computed(()=>{if(attrs.maxlength)return attrs.maxlength;if(!props.counter||typeof props.counter!=="number"&&typeof props.counter!=="string")return void 0;return props.counter});const vInputRef=ref();const vFieldRef=ref();const controlHeight=shallowRef("");const textareaRef=ref();const scrollbarWidth=ref(0);const{platform}=useDisplay();const autocomplete=useAutocomplete(props);const isActive=computed(()=>props.persistentPlaceholder||isFocused.value||props.active);function onFocus(){var _a;if(autocomplete.isSuppressing.value){autocomplete.update()}if(textareaRef.value!==getActiveElement()){(_a=textareaRef.value)==null?void 0:_a.focus()}if(!isFocused.value)focus()}function onControlClick(e){onFocus();emit("click:control",e)}function onControlMousedown(e){emit("mousedown:control",e)}function onClear(e){e.stopPropagation();onFocus();nextTick(()=>{model.value="";callEvent(props["onClick:clear"],e)})}function onInput(e){var _a;const el=e.target;if(!((_a=props.modelModifiers)==null?void 0:_a.trim)){model.value=el.value;return}const value=el.value;const start=el.selectionStart;const end=el.selectionEnd;model.value=value;nextTick(()=>{let offset=0;if(value.trimStart().length===el.value.length){offset=value.length-el.value.length}if(start!=null)el.selectionStart=start-offset;if(end!=null)el.selectionEnd=end-offset})}const sizerRef=ref();const rows=ref(Number(props.rows));const isPlainOrUnderlined=computed(()=>["plain","underlined"].includes(props.variant));watchEffect(()=>{if(!props.autoGrow)rows.value=Number(props.rows)});function calculateInputHeight(){nextTick(()=>{if(!textareaRef.value)return;if(platform.value.firefox){scrollbarWidth.value=12;return}const{offsetWidth,clientWidth}=textareaRef.value;scrollbarWidth.value=Math.max(0,offsetWidth-clientWidth)});if(!props.autoGrow)return;nextTick(()=>{if(!sizerRef.value||!vFieldRef.value)return;const style=getComputedStyle(sizerRef.value);const fieldStyle=getComputedStyle(vFieldRef.value.$el);const padding=parseFloat(style.getPropertyValue("--v-field-padding-top"))+parseFloat(style.getPropertyValue("--v-input-padding-top"))+parseFloat(style.getPropertyValue("--v-field-padding-bottom"));const height=sizerRef.value.scrollHeight;const lineHeight=parseFloat(style.lineHeight);const minHeight=Math.max(parseFloat(props.rows)*lineHeight+padding,parseFloat(fieldStyle.getPropertyValue("--v-input-control-height")));const maxHeight=props.maxHeight?parseFloat(props.maxHeight):parseFloat(props.maxRows)*lineHeight+padding||Infinity;const newHeight=clamp(height??0,minHeight,maxHeight);rows.value=Math.floor((newHeight-padding)/lineHeight);controlHeight.value=convertToUnit(newHeight)})}onMounted(calculateInputHeight);watch(model,calculateInputHeight);watch(()=>props.rows,calculateInputHeight);watch(()=>props.maxHeight,calculateInputHeight);watch(()=>props.maxRows,calculateInputHeight);watch(()=>props.density,calculateInputHeight);watch(rows,val=>{emit("update:rows",val)});let observer;watch(sizerRef,val=>{if(val){observer=new ResizeObserver(calculateInputHeight);observer.observe(sizerRef.value)}else{observer==null?void 0:observer.disconnect()}});onBeforeUnmount(()=>{observer==null?void 0:observer.disconnect()});useRender(()=>{const hasCounter=!!(slots.counter||props.counter||props.counterValue);const hasDetails=props.hideDetails!==true&&!!(slots.details||hasCounter&&(props.persistentCounter||props.hideDetails===false||isFocused.value));const[rootAttrs,inputAttrs]=filterInputAttrs(attrs);const{modelValue:_,...inputProps}=VInput.filterProps(props);const fieldProps={...VField.filterProps(props),"onClick:clear":onClear};return createVNode(VInput,mergeProps({"ref":vInputRef,"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event,"class":["v-textarea v-text-field",{"v-textarea--prefixed":props.prefix,"v-textarea--suffixed":props.suffix,"v-text-field--prefixed":props.prefix,"v-text-field--suffixed":props.suffix,"v-textarea--auto-grow":props.autoGrow,"v-textarea--no-resize":props.noResize||props.autoGrow,"v-input--plain-underlined":isPlainOrUnderlined.value},props.class],"style":[{"--v-textarea-max-height":props.maxHeight?convertToUnit(props.maxHeight):void 0,"--v-textarea-scroll-bar-width":convertToUnit(scrollbarWidth.value)},props.style]},rootAttrs,inputProps,{"centerAffix":rows.value===1&&!isPlainOrUnderlined.value,"focused":isFocused.value,"indentDetails":props.indentDetails??!isPlainOrUnderlined.value}),{...slots,default:({id,isDisabled,isDirty,isReadonly,isValid,hasDetails:hasDetails2})=>createVNode(VField,mergeProps({"ref":vFieldRef,"style":{"--v-textarea-control-height":controlHeight.value},"onClick":onControlClick,"onMousedown":onControlMousedown,"onClick:prependInner":props["onClick:prependInner"],"onClick:appendInner":props["onClick:appendInner"]},fieldProps,{"id":id.value,"active":isActive.value||isDirty.value,"labelId":`${id.value}-label`,"centerAffix":rows.value===1&&!isPlainOrUnderlined.value,"dirty":isDirty.value||props.dirty,"disabled":isDisabled.value,"focused":isFocused.value,"details":hasDetails2.value,"error":isValid.value===false}),{...slots,default:({props:{class:fieldClass,...slotProps},controlRef})=>createBaseVNode(Fragment,null,[props.prefix&&createBaseVNode("span",{"class":"v-text-field__prefix"},[props.prefix]),withDirectives(createBaseVNode("textarea",mergeProps({"ref":val=>textareaRef.value=controlRef.value=val,"class":fieldClass,"value":model.value,"onInput":onInput,"autofocus":props.autofocus,"readonly":isReadonly.value,"disabled":isDisabled.value,"placeholder":props.placeholder,"rows":props.rows,"name":autocomplete.fieldName.value,"autocomplete":autocomplete.fieldAutocomplete.value,"onFocus":onFocus,"onBlur":blur,"aria-labelledby":`${id.value}-label`},slotProps,inputAttrs),null),[[Intersect,{handler:onIntersect},null,{once:true}]]),props.autoGrow&&withDirectives(createBaseVNode("textarea",{"class":normalizeClass([fieldClass,"v-textarea__sizer"]),"id":`${slotProps.id}-sizer`,"onUpdate:modelValue":$event=>model.value=$event,"ref":sizerRef,"readonly":true,"aria-hidden":"true"},null),[[vModelText,model.value]]),props.suffix&&createBaseVNode("span",{"class":"v-text-field__suffix"},[props.suffix])])}),details:hasDetails?slotProps=>{var _a;return createBaseVNode(Fragment,null,[(_a=slots.details)==null?void 0:_a.call(slots,slotProps),hasCounter&&createBaseVNode(Fragment,null,[createBaseVNode("span",null,null),createVNode(VCounter,{"active":props.persistentCounter||isFocused.value,"value":counterValue.value,"max":max.value,"disabled":props.disabled},slots.counter)])])}:void 0})});return forwardRefs({},vInputRef,vFieldRef,textareaRef)}});export{VTextarea as V};
1
+ import{c0 as genericComponent,eh as Intersect,c_ as useProxiedModel,ei as useFocus,a7 as useDisplay,ej as useAutocomplete,B as ref,bE as watchEffect,o as onMounted,H as watch,C as onBeforeUnmount,c1 as useRender,eb as filterInputAttrs,ec as VInput,ek as VField,e as createVNode,d as createBaseVNode,F as Fragment,el as VCounter,N as mergeProps,aC as withDirectives,em as vModelText,$ as normalizeClass,cW as convertToUnit,cL as forwardRefs,a6 as nextTick,en as clamp,A as computed,eo as callEvent,aP as shallowRef,ep as useAutofocus,eq as getActiveElement,c3 as propsFactory,er as makeVFieldProps,cN as omit,eg as makeVInputProps,es as makeAutocompleteProps}from"./index-C4KnwA0g.js";const makeVTextareaProps=propsFactory({autoGrow:Boolean,autofocus:Boolean,counter:[Boolean,Number,String],counterValue:Function,prefix:String,placeholder:String,persistentPlaceholder:Boolean,persistentCounter:Boolean,noResize:Boolean,rows:{type:[Number,String],default:5,validator:v=>!isNaN(parseFloat(v))},maxHeight:{type:[Number,String],validator:v=>!isNaN(parseFloat(v))},maxRows:{type:[Number,String],validator:v=>!isNaN(parseFloat(v))},suffix:String,modelModifiers:Object,...makeAutocompleteProps(),...omit(makeVInputProps(),["direction"]),...makeVFieldProps()},"VTextarea");const VTextarea=genericComponent()({name:"VTextarea",directives:{vIntersect:Intersect},inheritAttrs:false,props:makeVTextareaProps(),emits:{"click:control":e=>true,"mousedown:control":e=>true,"update:focused":focused=>true,"update:modelValue":val=>true,"update:rows":rows=>true},setup(props,{attrs,emit,slots}){const model=useProxiedModel(props,"modelValue");const{isFocused,focus,blur}=useFocus(props);const{onIntersect}=useAutofocus(props);const counterValue=computed(()=>{return typeof props.counterValue==="function"?props.counterValue(model.value):(model.value||"").toString().length});const max=computed(()=>{if(attrs.maxlength)return attrs.maxlength;if(!props.counter||typeof props.counter!=="number"&&typeof props.counter!=="string")return void 0;return props.counter});const vInputRef=ref();const vFieldRef=ref();const controlHeight=shallowRef("");const textareaRef=ref();const scrollbarWidth=ref(0);const{platform}=useDisplay();const autocomplete=useAutocomplete(props);const isActive=computed(()=>props.persistentPlaceholder||isFocused.value||props.active);function onFocus(){var _a;if(autocomplete.isSuppressing.value){autocomplete.update()}if(textareaRef.value!==getActiveElement()){(_a=textareaRef.value)==null?void 0:_a.focus()}if(!isFocused.value)focus()}function onControlClick(e){onFocus();emit("click:control",e)}function onControlMousedown(e){emit("mousedown:control",e)}function onClear(e){e.stopPropagation();onFocus();nextTick(()=>{model.value="";callEvent(props["onClick:clear"],e)})}function onInput(e){var _a;const el=e.target;if(!((_a=props.modelModifiers)==null?void 0:_a.trim)){model.value=el.value;return}const value=el.value;const start=el.selectionStart;const end=el.selectionEnd;model.value=value;nextTick(()=>{let offset=0;if(value.trimStart().length===el.value.length){offset=value.length-el.value.length}if(start!=null)el.selectionStart=start-offset;if(end!=null)el.selectionEnd=end-offset})}const sizerRef=ref();const rows=ref(Number(props.rows));const isPlainOrUnderlined=computed(()=>["plain","underlined"].includes(props.variant));watchEffect(()=>{if(!props.autoGrow)rows.value=Number(props.rows)});function calculateInputHeight(){nextTick(()=>{if(!textareaRef.value)return;if(platform.value.firefox){scrollbarWidth.value=12;return}const{offsetWidth,clientWidth}=textareaRef.value;scrollbarWidth.value=Math.max(0,offsetWidth-clientWidth)});if(!props.autoGrow)return;nextTick(()=>{if(!sizerRef.value||!vFieldRef.value)return;const style=getComputedStyle(sizerRef.value);const fieldStyle=getComputedStyle(vFieldRef.value.$el);const padding=parseFloat(style.getPropertyValue("--v-field-padding-top"))+parseFloat(style.getPropertyValue("--v-input-padding-top"))+parseFloat(style.getPropertyValue("--v-field-padding-bottom"));const height=sizerRef.value.scrollHeight;const lineHeight=parseFloat(style.lineHeight);const minHeight=Math.max(parseFloat(props.rows)*lineHeight+padding,parseFloat(fieldStyle.getPropertyValue("--v-input-control-height")));const maxHeight=props.maxHeight?parseFloat(props.maxHeight):parseFloat(props.maxRows)*lineHeight+padding||Infinity;const newHeight=clamp(height??0,minHeight,maxHeight);rows.value=Math.floor((newHeight-padding)/lineHeight);controlHeight.value=convertToUnit(newHeight)})}onMounted(calculateInputHeight);watch(model,calculateInputHeight);watch(()=>props.rows,calculateInputHeight);watch(()=>props.maxHeight,calculateInputHeight);watch(()=>props.maxRows,calculateInputHeight);watch(()=>props.density,calculateInputHeight);watch(rows,val=>{emit("update:rows",val)});let observer;watch(sizerRef,val=>{if(val){observer=new ResizeObserver(calculateInputHeight);observer.observe(sizerRef.value)}else{observer==null?void 0:observer.disconnect()}});onBeforeUnmount(()=>{observer==null?void 0:observer.disconnect()});useRender(()=>{const hasCounter=!!(slots.counter||props.counter||props.counterValue);const hasDetails=props.hideDetails!==true&&!!(slots.details||hasCounter&&(props.persistentCounter||props.hideDetails===false||isFocused.value));const[rootAttrs,inputAttrs]=filterInputAttrs(attrs);const{modelValue:_,...inputProps}=VInput.filterProps(props);const fieldProps={...VField.filterProps(props),"onClick:clear":onClear};return createVNode(VInput,mergeProps({"ref":vInputRef,"modelValue":model.value,"onUpdate:modelValue":$event=>model.value=$event,"class":["v-textarea v-text-field",{"v-textarea--prefixed":props.prefix,"v-textarea--suffixed":props.suffix,"v-text-field--prefixed":props.prefix,"v-text-field--suffixed":props.suffix,"v-textarea--auto-grow":props.autoGrow,"v-textarea--no-resize":props.noResize||props.autoGrow,"v-input--plain-underlined":isPlainOrUnderlined.value},props.class],"style":[{"--v-textarea-max-height":props.maxHeight?convertToUnit(props.maxHeight):void 0,"--v-textarea-scroll-bar-width":convertToUnit(scrollbarWidth.value)},props.style]},rootAttrs,inputProps,{"centerAffix":rows.value===1&&!isPlainOrUnderlined.value,"focused":isFocused.value,"indentDetails":props.indentDetails??!isPlainOrUnderlined.value}),{...slots,default:({id,isDisabled,isDirty,isReadonly,isValid,hasDetails:hasDetails2})=>createVNode(VField,mergeProps({"ref":vFieldRef,"style":{"--v-textarea-control-height":controlHeight.value},"onClick":onControlClick,"onMousedown":onControlMousedown,"onClick:prependInner":props["onClick:prependInner"],"onClick:appendInner":props["onClick:appendInner"]},fieldProps,{"id":id.value,"active":isActive.value||isDirty.value,"labelId":`${id.value}-label`,"centerAffix":rows.value===1&&!isPlainOrUnderlined.value,"dirty":isDirty.value||props.dirty,"disabled":isDisabled.value,"focused":isFocused.value,"details":hasDetails2.value,"error":isValid.value===false}),{...slots,default:({props:{class:fieldClass,...slotProps},controlRef})=>createBaseVNode(Fragment,null,[props.prefix&&createBaseVNode("span",{"class":"v-text-field__prefix"},[props.prefix]),withDirectives(createBaseVNode("textarea",mergeProps({"ref":val=>textareaRef.value=controlRef.value=val,"class":fieldClass,"value":model.value,"onInput":onInput,"autofocus":props.autofocus,"readonly":isReadonly.value,"disabled":isDisabled.value,"placeholder":props.placeholder,"rows":props.rows,"name":autocomplete.fieldName.value,"autocomplete":autocomplete.fieldAutocomplete.value,"onFocus":onFocus,"onBlur":blur,"aria-labelledby":`${id.value}-label`},slotProps,inputAttrs),null),[[Intersect,{handler:onIntersect},null,{once:true}]]),props.autoGrow&&withDirectives(createBaseVNode("textarea",{"class":normalizeClass([fieldClass,"v-textarea__sizer"]),"id":`${slotProps.id}-sizer`,"onUpdate:modelValue":$event=>model.value=$event,"ref":sizerRef,"readonly":true,"aria-hidden":"true"},null),[[vModelText,model.value]]),props.suffix&&createBaseVNode("span",{"class":"v-text-field__suffix"},[props.suffix])])}),details:hasDetails?slotProps=>{var _a;return createBaseVNode(Fragment,null,[(_a=slots.details)==null?void 0:_a.call(slots,slotProps),hasCounter&&createBaseVNode(Fragment,null,[createBaseVNode("span",null,null),createVNode(VCounter,{"active":props.persistentCounter||isFocused.value,"value":counterValue.value,"max":max.value,"disabled":props.disabled},slots.counter)])])}:void 0})});return forwardRefs({},vInputRef,vFieldRef,textareaRef)}});export{VTextarea as V};
@@ -1 +1 @@
1
- import{_ as _export_sfc,a as openBlock,c as createElementBlock,b as createBlock,K as VSkeletonLoader,F as Fragment,d as createBaseVNode,e as createVNode,i as unref,q as mdiAlertCircleOutline,h as VIcon,t as toDisplayString,r as createCommentVNode,w as withCtx,j as createTextVNode,n as VBtn,c2 as normalizeStyle,$ as normalizeClass,A as computed}from"./index-SBc6H2In.js";const _hoisted_1=["aria-busy"];const _hoisted_2={class:"vibe64-async-module-state__icon"};const _hoisted_3={class:"vibe64-async-module-state__copy"};const _hoisted_4={key:0,class:"vibe64-async-module-state__hint"};const _hoisted_5={class:"vibe64-async-module-state__actions"};const _sfc_main={__name:"Vibe64AsyncModuleState",props:{label:{default:"Vibe64 module",type:String},loading:{default:false,type:Boolean},message:{default:"",type:String},minHeight:{default:"",type:String},stale:{default:false,type:Boolean}},emits:["reload","retry"],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const title=computed(()=>props.loading?`Loading ${props.label}...`:`${props.label} could not load`);const stateStyle=computed(()=>props.minHeight?{minHeight:props.minHeight}:{});return(_ctx,_cache)=>{return openBlock(),createElementBlock("section",{class:normalizeClass(["vibe64-async-module-state",{"vibe64-async-module-state--loading":__props.loading}]),style:normalizeStyle(stateStyle.value),"aria-busy":__props.loading},[__props.loading?(openBlock(),createBlock(VSkeletonLoader,{key:0,"aria-label":title.value,class:"vibe64-async-module-state__skeleton",type:"article"},null,8,["aria-label"])):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode("div",_hoisted_2,[createVNode(VIcon,{icon:unref(mdiAlertCircleOutline),color:"warning",size:"30"},null,8,["icon"])]),createBaseVNode("div",_hoisted_3,[createBaseVNode("h2",null,toDisplayString(title.value),1),createBaseVNode("p",null,toDisplayString(__props.message),1),__props.stale?(openBlock(),createElementBlock("p",_hoisted_4," If retry keeps failing, reload Vibe64 to pick up the current app files. ")):createCommentVNode("",true),createBaseVNode("div",_hoisted_5,[createVNode(VBtn,{color:"primary",size:"small",type:"button",variant:"flat",onClick:_cache[0]||(_cache[0]=$event=>emit("retry"))},{default:withCtx(()=>[..._cache[2]||(_cache[2]=[createTextVNode(" Retry ",-1)])]),_:1}),createVNode(VBtn,{size:"small",type:"button",variant:"tonal",onClick:_cache[1]||(_cache[1]=$event=>emit("reload"))},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(" Reload Vibe64 ",-1)])]),_:1})])])],64))],14,_hoisted_1)}}};const Vibe64AsyncModuleState=_export_sfc(_sfc_main,[["__scopeId","data-v-c1fdb9ea"]]);export{Vibe64AsyncModuleState as V};
1
+ import{_ as _export_sfc,a as openBlock,c as createElementBlock,b as createBlock,K as VSkeletonLoader,F as Fragment,d as createBaseVNode,e as createVNode,i as unref,q as mdiAlertCircleOutline,h as VIcon,t as toDisplayString,r as createCommentVNode,w as withCtx,j as createTextVNode,n as VBtn,c2 as normalizeStyle,$ as normalizeClass,A as computed}from"./index-C4KnwA0g.js";const _hoisted_1=["aria-busy"];const _hoisted_2={class:"vibe64-async-module-state__icon"};const _hoisted_3={class:"vibe64-async-module-state__copy"};const _hoisted_4={key:0,class:"vibe64-async-module-state__hint"};const _hoisted_5={class:"vibe64-async-module-state__actions"};const _sfc_main={__name:"Vibe64AsyncModuleState",props:{label:{default:"Vibe64 module",type:String},loading:{default:false,type:Boolean},message:{default:"",type:String},minHeight:{default:"",type:String},stale:{default:false,type:Boolean}},emits:["reload","retry"],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const title=computed(()=>props.loading?`Loading ${props.label}...`:`${props.label} could not load`);const stateStyle=computed(()=>props.minHeight?{minHeight:props.minHeight}:{});return(_ctx,_cache)=>{return openBlock(),createElementBlock("section",{class:normalizeClass(["vibe64-async-module-state",{"vibe64-async-module-state--loading":__props.loading}]),style:normalizeStyle(stateStyle.value),"aria-busy":__props.loading},[__props.loading?(openBlock(),createBlock(VSkeletonLoader,{key:0,"aria-label":title.value,class:"vibe64-async-module-state__skeleton",type:"article"},null,8,["aria-label"])):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode("div",_hoisted_2,[createVNode(VIcon,{icon:unref(mdiAlertCircleOutline),color:"warning",size:"30"},null,8,["icon"])]),createBaseVNode("div",_hoisted_3,[createBaseVNode("h2",null,toDisplayString(title.value),1),createBaseVNode("p",null,toDisplayString(__props.message),1),__props.stale?(openBlock(),createElementBlock("p",_hoisted_4," If retry keeps failing, reload Vibe64 to pick up the current app files. ")):createCommentVNode("",true),createBaseVNode("div",_hoisted_5,[createVNode(VBtn,{color:"primary",size:"small",type:"button",variant:"flat",onClick:_cache[0]||(_cache[0]=$event=>emit("retry"))},{default:withCtx(()=>[..._cache[2]||(_cache[2]=[createTextVNode(" Retry ",-1)])]),_:1}),createVNode(VBtn,{size:"small",type:"button",variant:"tonal",onClick:_cache[1]||(_cache[1]=$event=>emit("reload"))},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(" Reload Vibe64 ",-1)])]),_:1})])])],64))],14,_hoisted_1)}}};const Vibe64AsyncModuleState=_export_sfc(_sfc_main,[["__scopeId","data-v-c1fdb9ea"]]);export{Vibe64AsyncModuleState as V};
@@ -1 +1 @@
1
- import{_ as _export_sfc,c as createElementBlock,e as createVNode,w as withCtx,J as renderSlot,z as VSpacer,d as createBaseVNode,i as unref,bK as VAppBar,bL as VContainer,bM as VMain,F as Fragment,a as openBlock,bN as _sfc_main$3,D as useEndpointResource,A as computed,by as proxyRefs,E as useCommand,R as ROUTE_VISIBILITY_PUBLIC,Q as VIBE64_SURFACE_ID,H as watch,B as ref,bA as scopedDevelopmentApiUrl,u as useRouter,b as createBlock,bs as StudioErrorNotice,r as createCommentVNode,t as toDisplayString,y as renderList,n as VBtn,bO as VForm,a3 as withModifiers,a9 as VTextField,bd as isRef,j as createTextVNode,S as VSheet,aU as projectAppPath,K as VSkeletonLoader,aS as useVibe64Accounts,o as onMounted,C as onBeforeUnmount,bP as mdiAccountCogOutline,$ as normalizeClass,V as VCard,g as VCardTitle,ab as mdiClose,br as VDivider,k as VCardText,a8 as withKeys,bQ as ProviderAccountsSetup,p as VDialog,a6 as nextTick,bR as mdiAccountOutline,bS as accountRowsForStatus,aB as mdiRobotOutline,aX as mdiGithub}from"./index-SBc6H2In.js";import{a as VIBE64_PROJECT_CHANGED_EVENT,c as VIBE64_PROJECT_CREATE_API_SUFFIX,b as PROJECT_SELECTION_ENDPOINT,d as VIBE64_PROJECT_SELECT_API_SUFFIX,e as projectSelectionQueryKey}from"./studioGateApi-B2eiydiA.js";import{u as useVibe64ProjectSlug}from"./useVibe64ProjectScope-n5T5l2pY.js";import{o as onVibe64AccountConnectionsDialogRequested}from"./vibe64AccountConnectionsDialog-Cd1-kEer.js";import{V as VTabs,a as VTab}from"./VTabs-BGX5dGoS.js";const _hoisted_1$2={class:"studio-app-shell-layout__top-right"};const _sfc_main$2={__name:"StudioAppShellLayout",setup(__props){return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[createVNode(VAppBar,{border:"",class:"shell-layout__app-bar bg-surface",density:"comfortable",elevation:"0","data-testid":"jskit-shell-app-bar"},{default:withCtx(()=>[renderSlot(_ctx.$slots,"top-left",{},void 0,true),createVNode(VSpacer),createBaseVNode("div",_hoisted_1$2,[createVNode(unref(_sfc_main$3),{target:"shell-layout:top-right"}),renderSlot(_ctx.$slots,"top-right",{},void 0,true)])]),_:3}),createVNode(VMain,{class:"bg-background"},{default:withCtx(()=>[createVNode(VContainer,{fluid:"",class:"shell-layout__content studio-app-shell-layout__content"},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default",{},void 0,true)]),_:3})]),_:3})],64)}}};const StudioAppShellLayout=_export_sfc(_sfc_main$2,[["__scopeId","data-v-f4d65ffa"]]);const cachedProjectSelections=new Map;function useProjectSelectionGate(emit,{scopeSelectionToCurrentProject=false}={}){const creating=ref(false);const selectingSlug=ref("");const newProjectName=ref("");const projectSlug=useVibe64ProjectSlug();const selectionPath=computed(()=>projectSelectionGateEndpoint({projectSlug:projectSlug.value,scopeSelectionToCurrentProject}));const selectionResource=useEndpointResource({fallbackLoadError:"Projects could not load.",path:selectionPath,queryKey:computed(()=>projectSelectionGateQueryKey({ownershipFilter:ROUTE_VISIBILITY_PUBLIC,projectSlug:projectSlug.value,scopeSelectionToCurrentProject,surfaceId:VIBE64_SURFACE_ID})),refreshOnPull:true,requestRecoveryLabel:"Projects",realtime:{event:VIBE64_PROJECT_CHANGED_EVENT}});const projectSelectionView=proxyRefs({isInitialLoading:selectionResource.isInitialLoading,isLoading:selectionResource.isLoading,loadError:selectionResource.loadError,record:selectionResource.data,refresh:selectionResource.reload});const createProjectCommand=useCommand({access:"never",apiSuffix:VIBE64_PROJECT_CREATE_API_SUFFIX,buildCommandOptions:()=>({method:"POST",path:PROJECT_SELECTION_ENDPOINT}),buildRawPayload:(_model,{context})=>({name:context.name||""}),fallbackRunError:"Project could not be created.",messages:{error:"Project could not be created.",success:"Project created."},onRunSuccess:loadProjectSelection,ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:"vibe64.projects.create",surfaceId:VIBE64_SURFACE_ID,writeMethod:"POST"});const selectProjectCommand=useCommand({access:"never",apiSuffix:VIBE64_PROJECT_SELECT_API_SUFFIX,buildCommandOptions:()=>({method:"POST",path:`${PROJECT_SELECTION_ENDPOINT}/select`}),buildRawPayload:(_model,{context})=>({slug:context.slug||""}),fallbackRunError:"Project could not be selected.",messages:{error:"Project could not be selected.",success:"Project selected."},onRunSuccess:loadProjectSelection,ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:"vibe64.projects.select",surfaceId:VIBE64_SURFACE_ID,writeMethod:"POST"});const cachedProjectSelection=computed(()=>cachedProjectSelections.get(projectSlug.value)||null);const projectSelection=computed(()=>projectSelectionView.record||cachedProjectSelection.value||{});const projects=computed(()=>Array.isArray(projectSelection.value.projects)?projectSelection.value.projects:[]);const projectsRoot=computed(()=>String(projectSelection.value.projectsRoot||"~/vibe64"));const hasSelection=computed(()=>projectSelection.value.hasSelection===true);const selectionReady=computed(()=>Boolean(projectSelectionView.record||cachedProjectSelection.value));const selectionInitialLoading=computed(()=>Boolean(projectSelectionView.isInitialLoading&&!selectionReady.value));const busy=computed(()=>creating.value||Boolean(selectingSlug.value));const saveError=computed(()=>{if(createProjectCommand.messageType==="error"){return String(createProjectCommand.message||"")}if(selectProjectCommand.messageType==="error"){return String(selectProjectCommand.message||"")}return""});const errorMessage=computed(()=>String(projectSelectionView.loadError||saveError.value||""));watch(projectSelection,selection=>{if(selection&&Object.keys(selection).length>0){cachedProjectSelections.set(projectSlug.value,selection)}if((selection==null?void 0:selection.hasSelection)===true){emit("ready",selection);return}emit("missing",selection||{})},{immediate:true});watch(errorMessage,message=>{if(message){emit("error",message)}});return{busy,createProject,creating,errorMessage,hasSelection,loadProjectSelection,newProjectName,projectSelection,projects,projectsRoot,selectProject,selectingSlug,selectionInitialLoading,selectionReady};async function loadProjectSelection(){await projectSelectionView.refresh()}async function createProject(){var _a;const name=newProjectName.value.trim();if(!name){return}creating.value=true;try{const response=await createProjectCommand.run({name});newProjectName.value="";return String(((_a=response==null?void 0:response.currentProject)==null?void 0:_a.slug)||"").trim()}finally{creating.value=false}}async function selectProject(slug){selectingSlug.value=String(slug||"");try{const response=await selectProjectCommand.run({slug:selectingSlug.value});return response?selectingSlug.value:""}finally{selectingSlug.value=""}}}function projectSelectionGateEndpoint({projectSlug="",scopeSelectionToCurrentProject=false}={}){return scopeSelectionToCurrentProject?scopedDevelopmentApiUrl(PROJECT_SELECTION_ENDPOINT,projectSlug,{scopeGlobalPaths:true}):PROJECT_SELECTION_ENDPOINT}function projectSelectionGateQueryKey({ownershipFilter,projectSlug="",scopeSelectionToCurrentProject=false,surfaceId}={}){const baseKey=projectSelectionQueryKey(surfaceId,ownershipFilter,projectSlug);return scopeSelectionToCurrentProject?[...baseKey,"route-selection"]:baseKey}const _hoisted_1$1={class:"project-selection-gate"};const _hoisted_2$1={class:"project-selection-gate__header"};const _hoisted_3$1={class:"project-selection-gate__path"};const _hoisted_4$1={key:0,class:"project-selection-gate__list"};const _hoisted_5={class:"project-selection-gate__project-path"};const _sfc_main$1={__name:"ProjectSelectionGate",props:{forcePicker:{type:Boolean,default:false},navigateOnSelect:{type:Boolean,default:false},scopeSelectionToCurrentProject:{type:Boolean,default:false}},emits:["missing","ready","error"],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const router=useRouter();const{busy,createProject,creating,errorMessage,hasSelection,loadProjectSelection,newProjectName,projectSelection,projects,projectsRoot,selectProject,selectingSlug,selectionInitialLoading,selectionReady}=useProjectSelectionGate(emit,{scopeSelectionToCurrentProject:props.scopeSelectionToCurrentProject});const selectedSlotVisible=computed(()=>hasSelection.value&&!props.forcePicker);const pickerVisible=computed(()=>selectionReady.value&&(props.forcePicker||!hasSelection.value));async function handleSelectProject(slug=""){const selected=await selectProject(slug);if(props.navigateOnSelect&&selected){void router.push(projectAppPath(selected))}}async function handleCreateProject(){const selected=await createProject();if(props.navigateOnSelect&&selected){void router.push(projectAppPath(selected))}}return(_ctx,_cache)=>{return openBlock(),createElementBlock("div",_hoisted_1$1,[unref(errorMessage)?(openBlock(),createBlock(StudioErrorNotice,{key:0,title:"Projects could not load",error:unref(errorMessage),compact:""},null,8,["error"])):createCommentVNode("",true),unref(selectionInitialLoading)?(openBlock(),createBlock(VSkeletonLoader,{key:1,"aria-label":"Loading project",class:"project-selection-gate__loading",type:"article"})):selectedSlotVisible.value?renderSlot(_ctx.$slots,"default",{projectSelection:unref(projectSelection),reload:unref(loadProjectSelection)},void 0,true,2):pickerVisible.value?(openBlock(),createBlock(VSheet,{key:3,class:"project-selection-gate__picker",rounded:"lg",border:""},{default:withCtx(()=>[createBaseVNode("div",_hoisted_2$1,[createBaseVNode("div",null,[_cache[1]||(_cache[1]=createBaseVNode("p",{class:"project-selection-gate__eyebrow"},"Project",-1)),_cache[2]||(_cache[2]=createBaseVNode("h2",{class:"project-selection-gate__title"},"Choose a project",-1)),createBaseVNode("p",_hoisted_3$1,toDisplayString(unref(projectsRoot)),1)])]),unref(projects).length?(openBlock(),createElementBlock("div",_hoisted_4$1,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(projects),project=>{return openBlock(),createBlock(VBtn,{key:project.path,class:"project-selection-gate__project",disabled:unref(busy),loading:unref(selectingSlug)===project.slug,variant:"tonal",onClick:$event=>handleSelectProject(project.slug)},{default:withCtx(()=>[createBaseVNode("span",null,toDisplayString(project.slug),1),createBaseVNode("span",_hoisted_5,toDisplayString(project.path),1)]),_:2},1032,["disabled","loading","onClick"])}),128))])):createCommentVNode("",true),createVNode(VForm,{class:"project-selection-gate__create",onSubmit:withModifiers(handleCreateProject,["prevent"])},{default:withCtx(()=>[createVNode(VTextField,{modelValue:unref(newProjectName),"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>isRef(newProjectName)?newProjectName.value=$event:null),autocomplete:"off",density:"comfortable","hide-details":"auto",label:"New project folder",disabled:unref(busy)},null,8,["modelValue","disabled"]),createVNode(VBtn,{color:"primary",disabled:!unref(newProjectName).trim()||unref(busy),loading:unref(creating),type:"submit",variant:"flat"},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(" Create project ",-1)])]),_:1},8,["disabled","loading"])]),_:1})]),_:1})):createCommentVNode("",true)])}}};const ProjectSelectionGate=_export_sfc(_sfc_main$1,[["__scopeId","data-v-5ef80242"]]);const VIBE64_PREFERRED_NAME_MAX_LENGTH=80;function normalizePreferredNameDraft(value=""){return String(value||"").normalize("NFC").replace(/\s+/gu," ").trim()}function preferredNameDraftState(value=""){const preferredName=normalizePreferredNameDraft(value);const length=[...preferredName].length;let error="";if(new RegExp("\\p{Cc}","u").test(preferredName)){error="Name cannot contain control characters."}else if(length>VIBE64_PREFERRED_NAME_MAX_LENGTH){error=`Name cannot exceed ${VIBE64_PREFERRED_NAME_MAX_LENGTH} characters.`}return{error,length,preferredName,valid:!error}}const _hoisted_1={class:"vibe64-auth-settings"};const _hoisted_2={key:0,class:"vibe64-auth-settings__provider-attention","aria-label":"Needs attention"};const _hoisted_3={key:0,class:"vibe64-personal-profile","aria-labelledby":"vibe64-personal-profile-title"};const _hoisted_4={class:"vibe64-personal-profile__actions"};const _sfc_main={__name:"Vibe64AuthSettingsButton",setup(__props){const accountProviderOptions=Object.freeze([{icon:mdiRobotOutline,id:"codex",label:"Codex"},{icon:mdiGithub,id:"github",label:"GitHub"}]);const providerOptions=computed(()=>[...personalProfileAvailable.value?[{icon:mdiAccountOutline,id:"profile",label:"You"}]:[],...accountProviderOptions]);const dialogOpen=ref(false);const selectedProviderId=ref("codex");const accounts=useVibe64Accounts();const preferredNameField=ref(null);const preferredNameDraft=ref("");const preferredNameSaving=computed(()=>accounts.savePersonalAiProfileCommand.isRunning===true);const personalProfile=computed(()=>{var _a;return((_a=accounts.status.value)==null?void 0:_a.personalProfile)||null});const personalProfileAvailable=computed(()=>{var _a;return((_a=personalProfile.value)==null?void 0:_a.available)===true});const preferredNameValidation=computed(()=>preferredNameDraftState(preferredNameDraft.value));const preferredNameChanged=computed(()=>{var _a;return preferredNameValidation.value.preferredName!==String(((_a=personalProfile.value)==null?void 0:_a.preferredName)||"")});const statusLoaded=computed(()=>{return Boolean(accounts.status.value&&Array.isArray(accounts.status.value.accounts))});const allAccountRows=computed(()=>{return accountRowsForStatus(accounts.status.value,["codex","github"],{includeFallbackRows:false})});const selectedAccountRows=computed(()=>{return accountRowsForStatus(accounts.status.value,[selectedProviderId.value],{includeFallbackRows:true})});const selectedProvider=computed(()=>{return providerOptions.value.find(provider=>provider.id===selectedProviderId.value)||providerOptions.value[0]});const selectedProviderTitle=computed(()=>{return`${selectedProvider.value.label} Connection`});const selectedProviderLede=computed(()=>{if(selectedProvider.value.id==="github"){return"Configure the GitHub account and Git identity used by this local Vibe64 editor."}return"Configure the Codex account used by this local Vibe64 editor."});const credentialsNeedAttention=computed(()=>{if(!statusLoaded.value){return false}return allAccountRows.value.some(account=>account.connected!==true)});function normalizeProviderId(providerId=""){const normalized=String(providerId||"").trim();return providerOptions.value.some(provider=>provider.id===normalized)?normalized:""}async function openDialog(options={}){const profileRequested=String(options.section||"").trim()==="profile";const requestedProviderId=normalizeProviderId(options.providerId);if(requestedProviderId){selectedProviderId.value=requestedProviderId}dialogOpen.value=true;if(profileRequested){await accounts.reloadLocalStatus()}else if(options.codexReconnectRequired===true){await accounts.reloadLocalStatus()}else if(options.refresh!==false){await accounts.refresh()}if(profileRequested&&personalProfileAvailable.value){selectedProviderId.value="profile";await focusPreferredName();return}if(requestedProviderId){selectedProviderId.value=requestedProviderId;return}const accountProviderId=firstAccountProviderNeedingAttention();if(accountProviderId){selectedProviderId.value=accountProviderId}}async function focusPreferredName(){var _a,_b;await nextTick();(_b=(_a=preferredNameField.value)==null?void 0:_a.focus)==null?void 0:_b.call(_a)}async function savePreferredName(){if(preferredNameSaving.value||!preferredNameChanged.value||!preferredNameValidation.value.valid){return}await accounts.savePersonalAiProfile({preferredName:preferredNameValidation.value.preferredName})}function firstAccountProviderNeedingAttention(){var _a;return((_a=allAccountRows.value.find(account=>account.connected!==true))==null?void 0:_a.id)||""}function providerNeedsAttention(providerId=""){return allAccountRows.value.some(account=>account.id===providerId&&account.connected!==true)}function handleAccountConnectionsDialogRequest(event){void openDialog((event==null?void 0:event.detail)||{})}let disposeAccountConnectionsDialogRequest=()=>null;onMounted(()=>{disposeAccountConnectionsDialogRequest=onVibe64AccountConnectionsDialogRequested(handleAccountConnectionsDialogRequest)});onBeforeUnmount(()=>{disposeAccountConnectionsDialogRequest()});watch(()=>{var _a;return(_a=personalProfile.value)==null?void 0:_a.preferredName},preferredName=>{preferredNameDraft.value=String(preferredName||"")},{immediate:true});return(_ctx,_cache)=>{return openBlock(),createElementBlock("div",_hoisted_1,[createVNode(VBtn,{class:normalizeClass(["vibe64-auth-settings__button",credentialsNeedAttention.value?"vibe64-auth-settings__button--needs-attention":""]),density:"comfortable",icon:unref(mdiAccountCogOutline),size:"large",title:"Account settings",type:"button",variant:"tonal","aria-label":"Account settings",onClick:openDialog},null,8,["class","icon"]),createVNode(VDialog,{modelValue:dialogOpen.value,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>dialogOpen.value=$event),"max-width":"1120",scrollable:""},{default:withCtx(()=>[createVNode(VCard,{class:"vibe64-auth-settings__dialog",rounded:"lg"},{default:withCtx(()=>[createVNode(VCardTitle,{class:"vibe64-auth-settings__dialog-title"},{default:withCtx(()=>[_cache[4]||(_cache[4]=createBaseVNode("div",null,[createBaseVNode("h2",null,"Account settings"),createBaseVNode("p",null,"Choose how Vibe64 identifies you and connect its coding tools.")],-1)),createVNode(VBtn,{density:"comfortable",icon:unref(mdiClose),title:"Close account settings",type:"button",variant:"text","aria-label":"Close account settings",onClick:_cache[0]||(_cache[0]=$event=>dialogOpen.value=false)},null,8,["icon"])]),_:1}),createVNode(VTabs,{modelValue:selectedProviderId.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>selectedProviderId.value=$event),class:"vibe64-auth-settings__provider-tabs",color:"primary",density:"comfortable","show-arrows":""},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(providerOptions.value,provider=>{return openBlock(),createBlock(VTab,{key:provider.id,class:"vibe64-auth-settings__provider-tab","prepend-icon":provider.icon,value:provider.id},{default:withCtx(()=>[createTextVNode(toDisplayString(provider.label)+" ",1),providerNeedsAttention(provider.id)?(openBlock(),createElementBlock("span",_hoisted_2)):createCommentVNode("",true)]),_:2},1032,["prepend-icon","value"])}),128))]),_:1},8,["modelValue"]),createVNode(VDivider),createVNode(VCardText,{class:"vibe64-auth-settings__dialog-body"},{default:withCtx(()=>[selectedProviderId.value==="profile"?(openBlock(),createElementBlock("section",_hoisted_3,[_cache[5]||(_cache[5]=createBaseVNode("div",{class:"vibe64-personal-profile__heading"},[createBaseVNode("h3",{id:"vibe64-personal-profile-title"},"Your profile"),createBaseVNode("p",null,"You — all projects")],-1)),createVNode(VTextField,{ref_key:"preferredNameField",ref:preferredNameField,modelValue:preferredNameDraft.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>preferredNameDraft.value=$event),"data-vibe64-personal-profile":"",density:"comfortable","error-messages":preferredNameValidation.value.error?[preferredNameValidation.value.error]:[],"hide-details":"auto",label:"What should Vibe64 call you?",variant:"outlined",onKeydown:withKeys(withModifiers(savePreferredName,["prevent"]),["enter"])},null,8,["modelValue","error-messages","onKeydown"]),_cache[6]||(_cache[6]=createBaseVNode("p",{class:"vibe64-personal-profile__supporting-text"}," This name is used in Vibe64 welcomes and collaboration cues across this installation. Leave it blank to use your computer account name. ",-1)),createBaseVNode("div",_hoisted_4,[createVNode(VBtn,{class:"vibe64-personal-profile__save",color:"primary",disabled:preferredNameSaving.value||!preferredNameChanged.value||!preferredNameValidation.value.valid,type:"button",variant:"flat",onClick:savePreferredName},{default:withCtx(()=>[createTextVNode(toDisplayString(preferredNameSaving.value?"Saving…":"Save name"),1)]),_:1},8,["disabled"])])])):(openBlock(),createBlock(unref(ProviderAccountsSetup),{key:1,accounts:unref(accounts),"account-rows":selectedAccountRows.value,"status-loaded":statusLoaded.value,title:selectedProviderTitle.value,lede:selectedProviderLede.value,"needed-label":"Connection needed","ready-label":"Connection ready","show-continue":false},null,8,["accounts","account-rows","status-loaded","title","lede"]))]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}};const Vibe64AuthSettingsButton=_export_sfc(_sfc_main,[["__scopeId","data-v-1b9ee224"]]);export{ProjectSelectionGate as P,StudioAppShellLayout as S,Vibe64AuthSettingsButton as V,projectSelectionGateQueryKey as p};
1
+ import{_ as _export_sfc,c as createElementBlock,e as createVNode,w as withCtx,J as renderSlot,z as VSpacer,d as createBaseVNode,i as unref,bK as VAppBar,bL as VContainer,bM as VMain,F as Fragment,a as openBlock,bN as _sfc_main$3,D as useEndpointResource,A as computed,by as proxyRefs,E as useCommand,R as ROUTE_VISIBILITY_PUBLIC,Q as VIBE64_SURFACE_ID,H as watch,B as ref,bA as scopedDevelopmentApiUrl,u as useRouter,b as createBlock,bs as StudioErrorNotice,r as createCommentVNode,t as toDisplayString,y as renderList,n as VBtn,bO as VForm,a3 as withModifiers,a9 as VTextField,bd as isRef,j as createTextVNode,S as VSheet,aU as projectAppPath,K as VSkeletonLoader,aS as useVibe64Accounts,o as onMounted,C as onBeforeUnmount,bP as mdiAccountCogOutline,$ as normalizeClass,V as VCard,g as VCardTitle,ab as mdiClose,br as VDivider,k as VCardText,a8 as withKeys,bQ as ProviderAccountsSetup,p as VDialog,a6 as nextTick,bR as mdiAccountOutline,bS as accountRowsForStatus,aB as mdiRobotOutline,aX as mdiGithub}from"./index-C4KnwA0g.js";import{a as VIBE64_PROJECT_CHANGED_EVENT,c as VIBE64_PROJECT_CREATE_API_SUFFIX,b as PROJECT_SELECTION_ENDPOINT,d as VIBE64_PROJECT_SELECT_API_SUFFIX,e as projectSelectionQueryKey}from"./studioGateApi-BwBnOYBp.js";import{u as useVibe64ProjectSlug}from"./useVibe64ProjectScope-DcDkjbLT.js";import{o as onVibe64AccountConnectionsDialogRequested}from"./vibe64AccountConnectionsDialog-Cd1-kEer.js";import{V as VTabs,a as VTab}from"./VTabs-CQq9CAuT.js";const _hoisted_1$2={class:"studio-app-shell-layout__top-right"};const _sfc_main$2={__name:"StudioAppShellLayout",setup(__props){return(_ctx,_cache)=>{return openBlock(),createElementBlock(Fragment,null,[createVNode(VAppBar,{border:"",class:"shell-layout__app-bar bg-surface",density:"comfortable",elevation:"0","data-testid":"jskit-shell-app-bar"},{default:withCtx(()=>[renderSlot(_ctx.$slots,"top-left",{},void 0,true),createVNode(VSpacer),createBaseVNode("div",_hoisted_1$2,[createVNode(unref(_sfc_main$3),{target:"shell-layout:top-right"}),renderSlot(_ctx.$slots,"top-right",{},void 0,true)])]),_:3}),createVNode(VMain,{class:"bg-background"},{default:withCtx(()=>[createVNode(VContainer,{fluid:"",class:"shell-layout__content studio-app-shell-layout__content"},{default:withCtx(()=>[renderSlot(_ctx.$slots,"default",{},void 0,true)]),_:3})]),_:3})],64)}}};const StudioAppShellLayout=_export_sfc(_sfc_main$2,[["__scopeId","data-v-f4d65ffa"]]);const cachedProjectSelections=new Map;function useProjectSelectionGate(emit,{scopeSelectionToCurrentProject=false}={}){const creating=ref(false);const selectingSlug=ref("");const newProjectName=ref("");const projectSlug=useVibe64ProjectSlug();const selectionPath=computed(()=>projectSelectionGateEndpoint({projectSlug:projectSlug.value,scopeSelectionToCurrentProject}));const selectionResource=useEndpointResource({fallbackLoadError:"Projects could not load.",path:selectionPath,queryKey:computed(()=>projectSelectionGateQueryKey({ownershipFilter:ROUTE_VISIBILITY_PUBLIC,projectSlug:projectSlug.value,scopeSelectionToCurrentProject,surfaceId:VIBE64_SURFACE_ID})),refreshOnPull:true,requestRecoveryLabel:"Projects",realtime:{event:VIBE64_PROJECT_CHANGED_EVENT}});const projectSelectionView=proxyRefs({isInitialLoading:selectionResource.isInitialLoading,isLoading:selectionResource.isLoading,loadError:selectionResource.loadError,record:selectionResource.data,refresh:selectionResource.reload});const createProjectCommand=useCommand({access:"never",apiSuffix:VIBE64_PROJECT_CREATE_API_SUFFIX,buildCommandOptions:()=>({method:"POST",path:PROJECT_SELECTION_ENDPOINT}),buildRawPayload:(_model,{context})=>({name:context.name||""}),fallbackRunError:"Project could not be created.",messages:{error:"Project could not be created.",success:"Project created."},onRunSuccess:loadProjectSelection,ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:"vibe64.projects.create",surfaceId:VIBE64_SURFACE_ID,writeMethod:"POST"});const selectProjectCommand=useCommand({access:"never",apiSuffix:VIBE64_PROJECT_SELECT_API_SUFFIX,buildCommandOptions:()=>({method:"POST",path:`${PROJECT_SELECTION_ENDPOINT}/select`}),buildRawPayload:(_model,{context})=>({slug:context.slug||""}),fallbackRunError:"Project could not be selected.",messages:{error:"Project could not be selected.",success:"Project selected."},onRunSuccess:loadProjectSelection,ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:"vibe64.projects.select",surfaceId:VIBE64_SURFACE_ID,writeMethod:"POST"});const cachedProjectSelection=computed(()=>cachedProjectSelections.get(projectSlug.value)||null);const projectSelection=computed(()=>projectSelectionView.record||cachedProjectSelection.value||{});const projects=computed(()=>Array.isArray(projectSelection.value.projects)?projectSelection.value.projects:[]);const projectsRoot=computed(()=>String(projectSelection.value.projectsRoot||"~/vibe64"));const hasSelection=computed(()=>projectSelection.value.hasSelection===true);const selectionReady=computed(()=>Boolean(projectSelectionView.record||cachedProjectSelection.value));const selectionInitialLoading=computed(()=>Boolean(projectSelectionView.isInitialLoading&&!selectionReady.value));const busy=computed(()=>creating.value||Boolean(selectingSlug.value));const saveError=computed(()=>{if(createProjectCommand.messageType==="error"){return String(createProjectCommand.message||"")}if(selectProjectCommand.messageType==="error"){return String(selectProjectCommand.message||"")}return""});const errorMessage=computed(()=>String(projectSelectionView.loadError||saveError.value||""));watch(projectSelection,selection=>{if(selection&&Object.keys(selection).length>0){cachedProjectSelections.set(projectSlug.value,selection)}if((selection==null?void 0:selection.hasSelection)===true){emit("ready",selection);return}emit("missing",selection||{})},{immediate:true});watch(errorMessage,message=>{if(message){emit("error",message)}});return{busy,createProject,creating,errorMessage,hasSelection,loadProjectSelection,newProjectName,projectSelection,projects,projectsRoot,selectProject,selectingSlug,selectionInitialLoading,selectionReady};async function loadProjectSelection(){await projectSelectionView.refresh()}async function createProject(){var _a;const name=newProjectName.value.trim();if(!name){return}creating.value=true;try{const response=await createProjectCommand.run({name});newProjectName.value="";return String(((_a=response==null?void 0:response.currentProject)==null?void 0:_a.slug)||"").trim()}finally{creating.value=false}}async function selectProject(slug){selectingSlug.value=String(slug||"");try{const response=await selectProjectCommand.run({slug:selectingSlug.value});return response?selectingSlug.value:""}finally{selectingSlug.value=""}}}function projectSelectionGateEndpoint({projectSlug="",scopeSelectionToCurrentProject=false}={}){return scopeSelectionToCurrentProject?scopedDevelopmentApiUrl(PROJECT_SELECTION_ENDPOINT,projectSlug,{scopeGlobalPaths:true}):PROJECT_SELECTION_ENDPOINT}function projectSelectionGateQueryKey({ownershipFilter,projectSlug="",scopeSelectionToCurrentProject=false,surfaceId}={}){const baseKey=projectSelectionQueryKey(surfaceId,ownershipFilter,projectSlug);return scopeSelectionToCurrentProject?[...baseKey,"route-selection"]:baseKey}const _hoisted_1$1={class:"project-selection-gate"};const _hoisted_2$1={class:"project-selection-gate__header"};const _hoisted_3$1={class:"project-selection-gate__path"};const _hoisted_4$1={key:0,class:"project-selection-gate__list"};const _hoisted_5={class:"project-selection-gate__project-path"};const _sfc_main$1={__name:"ProjectSelectionGate",props:{forcePicker:{type:Boolean,default:false},navigateOnSelect:{type:Boolean,default:false},scopeSelectionToCurrentProject:{type:Boolean,default:false}},emits:["missing","ready","error"],setup(__props,{emit:__emit}){const props=__props;const emit=__emit;const router=useRouter();const{busy,createProject,creating,errorMessage,hasSelection,loadProjectSelection,newProjectName,projectSelection,projects,projectsRoot,selectProject,selectingSlug,selectionInitialLoading,selectionReady}=useProjectSelectionGate(emit,{scopeSelectionToCurrentProject:props.scopeSelectionToCurrentProject});const selectedSlotVisible=computed(()=>hasSelection.value&&!props.forcePicker);const pickerVisible=computed(()=>selectionReady.value&&(props.forcePicker||!hasSelection.value));async function handleSelectProject(slug=""){const selected=await selectProject(slug);if(props.navigateOnSelect&&selected){void router.push(projectAppPath(selected))}}async function handleCreateProject(){const selected=await createProject();if(props.navigateOnSelect&&selected){void router.push(projectAppPath(selected))}}return(_ctx,_cache)=>{return openBlock(),createElementBlock("div",_hoisted_1$1,[unref(errorMessage)?(openBlock(),createBlock(StudioErrorNotice,{key:0,title:"Projects could not load",error:unref(errorMessage),compact:""},null,8,["error"])):createCommentVNode("",true),unref(selectionInitialLoading)?(openBlock(),createBlock(VSkeletonLoader,{key:1,"aria-label":"Loading project",class:"project-selection-gate__loading",type:"article"})):selectedSlotVisible.value?renderSlot(_ctx.$slots,"default",{projectSelection:unref(projectSelection),reload:unref(loadProjectSelection)},void 0,true,2):pickerVisible.value?(openBlock(),createBlock(VSheet,{key:3,class:"project-selection-gate__picker",rounded:"lg",border:""},{default:withCtx(()=>[createBaseVNode("div",_hoisted_2$1,[createBaseVNode("div",null,[_cache[1]||(_cache[1]=createBaseVNode("p",{class:"project-selection-gate__eyebrow"},"Project",-1)),_cache[2]||(_cache[2]=createBaseVNode("h2",{class:"project-selection-gate__title"},"Choose a project",-1)),createBaseVNode("p",_hoisted_3$1,toDisplayString(unref(projectsRoot)),1)])]),unref(projects).length?(openBlock(),createElementBlock("div",_hoisted_4$1,[(openBlock(true),createElementBlock(Fragment,null,renderList(unref(projects),project=>{return openBlock(),createBlock(VBtn,{key:project.path,class:"project-selection-gate__project",disabled:unref(busy),loading:unref(selectingSlug)===project.slug,variant:"tonal",onClick:$event=>handleSelectProject(project.slug)},{default:withCtx(()=>[createBaseVNode("span",null,toDisplayString(project.slug),1),createBaseVNode("span",_hoisted_5,toDisplayString(project.path),1)]),_:2},1032,["disabled","loading","onClick"])}),128))])):createCommentVNode("",true),createVNode(VForm,{class:"project-selection-gate__create",onSubmit:withModifiers(handleCreateProject,["prevent"])},{default:withCtx(()=>[createVNode(VTextField,{modelValue:unref(newProjectName),"onUpdate:modelValue":_cache[0]||(_cache[0]=$event=>isRef(newProjectName)?newProjectName.value=$event:null),autocomplete:"off",density:"comfortable","hide-details":"auto",label:"New project folder",disabled:unref(busy)},null,8,["modelValue","disabled"]),createVNode(VBtn,{color:"primary",disabled:!unref(newProjectName).trim()||unref(busy),loading:unref(creating),type:"submit",variant:"flat"},{default:withCtx(()=>[..._cache[3]||(_cache[3]=[createTextVNode(" Create project ",-1)])]),_:1},8,["disabled","loading"])]),_:1})]),_:1})):createCommentVNode("",true)])}}};const ProjectSelectionGate=_export_sfc(_sfc_main$1,[["__scopeId","data-v-5ef80242"]]);const VIBE64_PREFERRED_NAME_MAX_LENGTH=80;function normalizePreferredNameDraft(value=""){return String(value||"").normalize("NFC").replace(/\s+/gu," ").trim()}function preferredNameDraftState(value=""){const preferredName=normalizePreferredNameDraft(value);const length=[...preferredName].length;let error="";if(new RegExp("\\p{Cc}","u").test(preferredName)){error="Name cannot contain control characters."}else if(length>VIBE64_PREFERRED_NAME_MAX_LENGTH){error=`Name cannot exceed ${VIBE64_PREFERRED_NAME_MAX_LENGTH} characters.`}return{error,length,preferredName,valid:!error}}const _hoisted_1={class:"vibe64-auth-settings"};const _hoisted_2={key:0,class:"vibe64-auth-settings__provider-attention","aria-label":"Needs attention"};const _hoisted_3={key:0,class:"vibe64-personal-profile","aria-labelledby":"vibe64-personal-profile-title"};const _hoisted_4={class:"vibe64-personal-profile__actions"};const _sfc_main={__name:"Vibe64AuthSettingsButton",setup(__props){const accountProviderOptions=Object.freeze([{icon:mdiRobotOutline,id:"codex",label:"Codex"},{icon:mdiGithub,id:"github",label:"GitHub"}]);const providerOptions=computed(()=>[...personalProfileAvailable.value?[{icon:mdiAccountOutline,id:"profile",label:"You"}]:[],...accountProviderOptions]);const dialogOpen=ref(false);const selectedProviderId=ref("codex");const accounts=useVibe64Accounts();const preferredNameField=ref(null);const preferredNameDraft=ref("");const preferredNameSaving=computed(()=>accounts.savePersonalAiProfileCommand.isRunning===true);const personalProfile=computed(()=>{var _a;return((_a=accounts.status.value)==null?void 0:_a.personalProfile)||null});const personalProfileAvailable=computed(()=>{var _a;return((_a=personalProfile.value)==null?void 0:_a.available)===true});const preferredNameValidation=computed(()=>preferredNameDraftState(preferredNameDraft.value));const preferredNameChanged=computed(()=>{var _a;return preferredNameValidation.value.preferredName!==String(((_a=personalProfile.value)==null?void 0:_a.preferredName)||"")});const statusLoaded=computed(()=>{return Boolean(accounts.status.value&&Array.isArray(accounts.status.value.accounts))});const allAccountRows=computed(()=>{return accountRowsForStatus(accounts.status.value,["codex","github"],{includeFallbackRows:false})});const selectedAccountRows=computed(()=>{return accountRowsForStatus(accounts.status.value,[selectedProviderId.value],{includeFallbackRows:true})});const selectedProvider=computed(()=>{return providerOptions.value.find(provider=>provider.id===selectedProviderId.value)||providerOptions.value[0]});const selectedProviderTitle=computed(()=>{return`${selectedProvider.value.label} Connection`});const selectedProviderLede=computed(()=>{if(selectedProvider.value.id==="github"){return"Configure the GitHub account and Git identity used by this local Vibe64 editor."}return"Configure the Codex account used by this local Vibe64 editor."});const credentialsNeedAttention=computed(()=>{if(!statusLoaded.value){return false}return allAccountRows.value.some(account=>account.connected!==true)});function normalizeProviderId(providerId=""){const normalized=String(providerId||"").trim();return providerOptions.value.some(provider=>provider.id===normalized)?normalized:""}async function openDialog(options={}){const profileRequested=String(options.section||"").trim()==="profile";const requestedProviderId=normalizeProviderId(options.providerId);if(requestedProviderId){selectedProviderId.value=requestedProviderId}dialogOpen.value=true;if(profileRequested){await accounts.reloadLocalStatus()}else if(options.codexReconnectRequired===true){await accounts.reloadLocalStatus()}else if(options.refresh!==false){await accounts.refresh()}if(profileRequested&&personalProfileAvailable.value){selectedProviderId.value="profile";await focusPreferredName();return}if(requestedProviderId){selectedProviderId.value=requestedProviderId;return}const accountProviderId=firstAccountProviderNeedingAttention();if(accountProviderId){selectedProviderId.value=accountProviderId}}async function focusPreferredName(){var _a,_b;await nextTick();(_b=(_a=preferredNameField.value)==null?void 0:_a.focus)==null?void 0:_b.call(_a)}async function savePreferredName(){if(preferredNameSaving.value||!preferredNameChanged.value||!preferredNameValidation.value.valid){return}await accounts.savePersonalAiProfile({preferredName:preferredNameValidation.value.preferredName})}function firstAccountProviderNeedingAttention(){var _a;return((_a=allAccountRows.value.find(account=>account.connected!==true))==null?void 0:_a.id)||""}function providerNeedsAttention(providerId=""){return allAccountRows.value.some(account=>account.id===providerId&&account.connected!==true)}function handleAccountConnectionsDialogRequest(event){void openDialog((event==null?void 0:event.detail)||{})}let disposeAccountConnectionsDialogRequest=()=>null;onMounted(()=>{disposeAccountConnectionsDialogRequest=onVibe64AccountConnectionsDialogRequested(handleAccountConnectionsDialogRequest)});onBeforeUnmount(()=>{disposeAccountConnectionsDialogRequest()});watch(()=>{var _a;return(_a=personalProfile.value)==null?void 0:_a.preferredName},preferredName=>{preferredNameDraft.value=String(preferredName||"")},{immediate:true});return(_ctx,_cache)=>{return openBlock(),createElementBlock("div",_hoisted_1,[createVNode(VBtn,{class:normalizeClass(["vibe64-auth-settings__button",credentialsNeedAttention.value?"vibe64-auth-settings__button--needs-attention":""]),density:"comfortable",icon:unref(mdiAccountCogOutline),size:"large",title:"Account settings",type:"button",variant:"tonal","aria-label":"Account settings",onClick:openDialog},null,8,["class","icon"]),createVNode(VDialog,{modelValue:dialogOpen.value,"onUpdate:modelValue":_cache[3]||(_cache[3]=$event=>dialogOpen.value=$event),"max-width":"1120",scrollable:""},{default:withCtx(()=>[createVNode(VCard,{class:"vibe64-auth-settings__dialog",rounded:"lg"},{default:withCtx(()=>[createVNode(VCardTitle,{class:"vibe64-auth-settings__dialog-title"},{default:withCtx(()=>[_cache[4]||(_cache[4]=createBaseVNode("div",null,[createBaseVNode("h2",null,"Account settings"),createBaseVNode("p",null,"Choose how Vibe64 identifies you and connect its coding tools.")],-1)),createVNode(VBtn,{density:"comfortable",icon:unref(mdiClose),title:"Close account settings",type:"button",variant:"text","aria-label":"Close account settings",onClick:_cache[0]||(_cache[0]=$event=>dialogOpen.value=false)},null,8,["icon"])]),_:1}),createVNode(VTabs,{modelValue:selectedProviderId.value,"onUpdate:modelValue":_cache[1]||(_cache[1]=$event=>selectedProviderId.value=$event),class:"vibe64-auth-settings__provider-tabs",color:"primary",density:"comfortable","show-arrows":""},{default:withCtx(()=>[(openBlock(true),createElementBlock(Fragment,null,renderList(providerOptions.value,provider=>{return openBlock(),createBlock(VTab,{key:provider.id,class:"vibe64-auth-settings__provider-tab","prepend-icon":provider.icon,value:provider.id},{default:withCtx(()=>[createTextVNode(toDisplayString(provider.label)+" ",1),providerNeedsAttention(provider.id)?(openBlock(),createElementBlock("span",_hoisted_2)):createCommentVNode("",true)]),_:2},1032,["prepend-icon","value"])}),128))]),_:1},8,["modelValue"]),createVNode(VDivider),createVNode(VCardText,{class:"vibe64-auth-settings__dialog-body"},{default:withCtx(()=>[selectedProviderId.value==="profile"?(openBlock(),createElementBlock("section",_hoisted_3,[_cache[5]||(_cache[5]=createBaseVNode("div",{class:"vibe64-personal-profile__heading"},[createBaseVNode("h3",{id:"vibe64-personal-profile-title"},"Your profile"),createBaseVNode("p",null,"You — all projects")],-1)),createVNode(VTextField,{ref_key:"preferredNameField",ref:preferredNameField,modelValue:preferredNameDraft.value,"onUpdate:modelValue":_cache[2]||(_cache[2]=$event=>preferredNameDraft.value=$event),"data-vibe64-personal-profile":"",density:"comfortable","error-messages":preferredNameValidation.value.error?[preferredNameValidation.value.error]:[],"hide-details":"auto",label:"What should Vibe64 call you?",variant:"outlined",onKeydown:withKeys(withModifiers(savePreferredName,["prevent"]),["enter"])},null,8,["modelValue","error-messages","onKeydown"]),_cache[6]||(_cache[6]=createBaseVNode("p",{class:"vibe64-personal-profile__supporting-text"}," This name is used in Vibe64 welcomes and collaboration cues across this installation. Leave it blank to use your computer account name. ",-1)),createBaseVNode("div",_hoisted_4,[createVNode(VBtn,{class:"vibe64-personal-profile__save",color:"primary",disabled:preferredNameSaving.value||!preferredNameChanged.value||!preferredNameValidation.value.valid,type:"button",variant:"flat",onClick:savePreferredName},{default:withCtx(()=>[createTextVNode(toDisplayString(preferredNameSaving.value?"Saving…":"Save name"),1)]),_:1},8,["disabled"])])])):(openBlock(),createBlock(unref(ProviderAccountsSetup),{key:1,accounts:unref(accounts),"account-rows":selectedAccountRows.value,"status-loaded":statusLoaded.value,title:selectedProviderTitle.value,lede:selectedProviderLede.value,"needed-label":"Connection needed","ready-label":"Connection ready","show-continue":false},null,8,["accounts","account-rows","status-loaded","title","lede"]))]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}};const Vibe64AuthSettingsButton=_export_sfc(_sfc_main,[["__scopeId","data-v-1b9ee224"]]);export{ProjectSelectionGate as P,StudioAppShellLayout as S,Vibe64AuthSettingsButton as V,projectSelectionGateQueryKey as p};
@@ -1 +1 @@
1
- import{_ as _export_sfc,bT as useSlots,aR as useRoute,u as useRouter,B as ref,o as onMounted,C as onBeforeUnmount,a as openBlock,c as createElementBlock,t as toDisplayString,r as createCommentVNode,e as createVNode,w as withCtx,d as createBaseVNode,b as createBlock,bb as VSelect,a$ as VList,J as renderSlot,S as VSheet,$ as normalizeClass,A as computed,aU as projectAppPath,bH as projectSlugFromRoute,bC as provide,i as unref,bN as _sfc_main$2,bU as VIBE64_ACTIVE_SESSION_NAV_KEY}from"./index-SBc6H2In.js";import getPlacements from"./placement-Nw6LF6xp.js";function normalizeRoutePath(pathValue=""){const path=String(pathValue||"").trim();if(!path||path==="/"){return path||"/"}return path.replace(/\/+$/u,"")}function routePathContainsSection(routePathValue="",sectionPathValue=""){const routePath=normalizeRoutePath(routePathValue);const sectionPath=normalizeRoutePath(sectionPathValue);return Boolean(sectionPath&&sectionPath!=="/"&&(routePath===sectionPath||routePath.startsWith(`${sectionPath}/`)))}const _hoisted_1={key:0,class:"section-container-shell__heading"};const _hoisted_2={key:0,class:"section-container-shell__title"};const _hoisted_3={key:1,class:"text-body-2 text-medium-emphasis mb-0"};const _hoisted_4={class:"section-container-shell__body"};const _hoisted_5={key:1,class:"section-container-shell__nav","aria-label":"Dashboard sections"};const _hoisted_6={class:"section-container-shell__content"};const MOBILE_SECTION_MEDIA_QUERY="(max-width: 760px)";const _sfc_main$1={__name:"SectionContainerShell",props:{title:{type:String,default:""},subtitle:{type:String,default:""},mobileSectionLinks:{type:Array,default:()=>[]}},setup(__props){const props=__props;const slots=useSlots();const route=useRoute();const router=useRouter();const mobileSectionLayout=ref(initialMobileSectionLayout());let mobileSectionMediaQuery=null;const resolvedTitle=computed(()=>String(props.title||"").trim());const resolvedSubtitle=computed(()=>String(props.subtitle||"").trim());const hasHeading=computed(()=>Boolean(resolvedTitle.value||resolvedSubtitle.value));const hasTabs=computed(()=>Boolean(slots.tabs));const mobileSectionLinks=computed(()=>{return props.mobileSectionLinks.map(link=>({disabled:(link==null?void 0:link.disabled)===true,icon:String((link==null?void 0:link.icon)||""),id:String((link==null?void 0:link.id)||(link==null?void 0:link.to)||(link==null?void 0:link.label)||""),label:String((link==null?void 0:link.label)||""),to:normalizeRoutePath((link==null?void 0:link.to)||"")})).filter(link=>Boolean(link.id&&link.label&&link.to))});const mobileSectionsActive=computed(()=>Boolean(mobileSectionLayout.value&&mobileSectionLinks.value.length));const activeMobileSection=computed(()=>{return mobileSectionLinks.value.find(link=>routePathContainsSection(route.path||"",link.to))||null});const activeMobileSectionValue=computed(()=>{var _a;return((_a=activeMobileSection.value)==null?void 0:_a.to)||null});function initialMobileSectionLayout(){if(typeof window==="undefined"||typeof window.matchMedia!=="function"){return false}return window.matchMedia(MOBILE_SECTION_MEDIA_QUERY).matches}function syncMobileSectionLayout(){mobileSectionLayout.value=Boolean(mobileSectionMediaQuery==null?void 0:mobileSectionMediaQuery.matches)}function selectMobileSection(value=""){const targetPath=normalizeRoutePath(value||"");if(!targetPath||targetPath===activeMobileSectionValue.value){return}const targetLink=mobileSectionLinks.value.find(link=>link.to===targetPath);if(!targetLink||targetLink.disabled){return}void router.push(targetLink.to)}onMounted(()=>{var _a;if(typeof window==="undefined"||typeof window.matchMedia!=="function"){return}mobileSectionMediaQuery=window.matchMedia(MOBILE_SECTION_MEDIA_QUERY);syncMobileSectionLayout();if(typeof mobileSectionMediaQuery.addEventListener==="function"){mobileSectionMediaQuery.addEventListener("change",syncMobileSectionLayout)}else{(_a=mobileSectionMediaQuery.addListener)==null?void 0:_a.call(mobileSectionMediaQuery,syncMobileSectionLayout)}});onBeforeUnmount(()=>{var _a;if(typeof(mobileSectionMediaQuery==null?void 0:mobileSectionMediaQuery.removeEventListener)==="function"){mobileSectionMediaQuery.removeEventListener("change",syncMobileSectionLayout)}else{(_a=mobileSectionMediaQuery==null?void 0:mobileSectionMediaQuery.removeListener)==null?void 0:_a.call(mobileSectionMediaQuery,syncMobileSectionLayout)}mobileSectionMediaQuery=null});return(_ctx,_cache)=>{return openBlock(),createElementBlock("section",{class:normalizeClass(["section-container-shell",{"section-container-shell--with-heading":hasHeading.value}])},[hasHeading.value?(openBlock(),createElementBlock("header",_hoisted_1,[resolvedTitle.value?(openBlock(),createElementBlock("h1",_hoisted_2,toDisplayString(resolvedTitle.value),1)):createCommentVNode("",true),resolvedSubtitle.value?(openBlock(),createElementBlock("p",_hoisted_3,toDisplayString(resolvedSubtitle.value),1)):createCommentVNode("",true)])):createCommentVNode("",true),createVNode(VSheet,{rounded:"lg",border:"",class:"section-container-shell__panel"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_4,[mobileSectionsActive.value?(openBlock(),createBlock(VSelect,{key:0,"model-value":activeMobileSectionValue.value,items:mobileSectionLinks.value,"item-title":"label","item-value":"to","item-props":item=>({disabled:item.disabled}),label:"Dashboard section",variant:"outlined","hide-details":"","onUpdate:modelValue":selectMobileSection},null,8,["model-value","items","item-props"])):createCommentVNode("",true),hasTabs.value&&!mobileSectionsActive.value?(openBlock(),createElementBlock("nav",_hoisted_5,[createVNode(VList,{nav:"",density:"compact",rounded:"lg"},{default:withCtx(()=>[renderSlot(_ctx.$slots,"tabs",{},void 0,true)]),_:3})])):createCommentVNode("",true),createBaseVNode("main",_hoisted_6,[renderSlot(_ctx.$slots,"default",{},void 0,true)])])]),_:3})],2)}}};const SectionContainerShell=_export_sfc(_sfc_main$1,[["__scopeId","data-v-94847611"]]);function useVibe64DashboardPage({dashboardContext=null}={}){const route=useRoute();const projectSlug=computed(()=>projectSlugFromRoute(route));const projectBasePath=computed(()=>projectAppPath(projectSlug.value));const dashboardSectionLinks=computed(()=>getPlacements().filter(placement=>(placement==null?void 0:placement.kind)==="link"&&(placement==null?void 0:placement.owner)==="app-dashboard"&&(placement==null?void 0:placement.target)==="page.section-nav"&&dashboardPlacementVisible(placement,dashboardContext)).sort((left,right)=>Number((left==null?void 0:left.order)||0)-Number((right==null?void 0:right.order)||0)).map(placement=>{var _a,_b,_c;return{disabled:((_a=placement==null?void 0:placement.props)==null?void 0:_a.disabled)===true,icon:((_b=placement==null?void 0:placement.props)==null?void 0:_b.icon)||"",id:(placement==null?void 0:placement.id)||"",label:((_c=placement==null?void 0:placement.props)==null?void 0:_c.label)||"",to:`${projectBasePath.value}${dashboardSectionSuffix(placement)}`}}));return{dashboardSectionLinks}}function dashboardPlacementVisible(placement={},dashboardContext=null){var _a;const predicate=(_a=placement==null?void 0:placement.props)==null?void 0:_a.visibleWhen;if(typeof predicate!=="function")return true;const context=typeof dashboardContext==="function"?dashboardContext():(dashboardContext==null?void 0:dashboardContext.value)??dashboardContext;return predicate(context&&typeof context==="object"?context:{})===true}function activeSessionMobileSectionLinks(activeSessionNav=null){if(!(activeSessionNav==null?void 0:activeSessionNav.visible)||!Array.isArray(activeSessionNav.tools)){return[]}return activeSessionNav.tools.map(tool=>({disabled:(tool==null?void 0:tool.disabled)===true,icon:String((tool==null?void 0:tool.icon)||""),id:`active-session:${String((tool==null?void 0:tool.id)||(tool==null?void 0:tool.to)||(tool==null?void 0:tool.label)||"")}`,label:String((tool==null?void 0:tool.label)||""),to:String((tool==null?void 0:tool.to)||"")})).filter(tool=>Boolean(tool.id!=="active-session:"&&tool.label&&tool.to))}function dashboardSectionSuffix(placement={}){var _a,_b;const suffix=String(((_a=placement==null?void 0:placement.props)==null?void 0:_a.scopedSuffix)||((_b=placement==null?void 0:placement.props)==null?void 0:_b.unscopedSuffix)||"").trim();if(!suffix){return""}const projectRelativeSuffix=suffix.replace(/^\/+/u,"").replace(/^project\/\[slug\](?=\/|$)/u,"").replace(/^\[slug\](?=\/|$)/u,"").replace(/^\/+/u,"");return projectRelativeSuffix?`/${projectRelativeSuffix}`:""}const _sfc_main={__name:"Vibe64DashboardShell",props:{dashboardContext:{default:()=>({}),type:Object}},setup(__props){const props=__props;const{dashboardSectionLinks}=useVibe64DashboardPage({dashboardContext:()=>props.dashboardContext});const activeSessionNav=computed(()=>{var _a;const nav=((_a=props.dashboardContext)==null?void 0:_a.activeSessionNav)||null;return nav&&typeof nav==="object"?nav:null});const mobileDashboardSectionLinks=computed(()=>[...dashboardSectionLinks.value,...activeSessionMobileSectionLinks(activeSessionNav.value)]);provide(VIBE64_ACTIVE_SESSION_NAV_KEY,activeSessionNav);return(_ctx,_cache)=>{return openBlock(),createBlock(SectionContainerShell,{"mobile-section-links":mobileDashboardSectionLinks.value},{tabs:withCtx(()=>[createVNode(unref(_sfc_main$2),{target:"app-dashboard:primary-menu"}),createVNode(unref(_sfc_main$2),{target:"app-dashboard:active-session-menu",context:{activeSessionNav:activeSessionNav.value||{}}},null,8,["context"])]),default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["mobile-section-links"])}}};export{_sfc_main as _};
1
+ import{_ as _export_sfc,bT as useSlots,aR as useRoute,u as useRouter,B as ref,o as onMounted,C as onBeforeUnmount,a as openBlock,c as createElementBlock,t as toDisplayString,r as createCommentVNode,e as createVNode,w as withCtx,d as createBaseVNode,b as createBlock,bb as VSelect,a$ as VList,J as renderSlot,S as VSheet,$ as normalizeClass,A as computed,aU as projectAppPath,bH as projectSlugFromRoute,bC as provide,i as unref,bN as _sfc_main$2,bU as VIBE64_ACTIVE_SESSION_NAV_KEY}from"./index-C4KnwA0g.js";import getPlacements from"./placement-Cyt3SnRe.js";function normalizeRoutePath(pathValue=""){const path=String(pathValue||"").trim();if(!path||path==="/"){return path||"/"}return path.replace(/\/+$/u,"")}function routePathContainsSection(routePathValue="",sectionPathValue=""){const routePath=normalizeRoutePath(routePathValue);const sectionPath=normalizeRoutePath(sectionPathValue);return Boolean(sectionPath&&sectionPath!=="/"&&(routePath===sectionPath||routePath.startsWith(`${sectionPath}/`)))}const _hoisted_1={key:0,class:"section-container-shell__heading"};const _hoisted_2={key:0,class:"section-container-shell__title"};const _hoisted_3={key:1,class:"text-body-2 text-medium-emphasis mb-0"};const _hoisted_4={class:"section-container-shell__body"};const _hoisted_5={key:1,class:"section-container-shell__nav","aria-label":"Dashboard sections"};const _hoisted_6={class:"section-container-shell__content"};const MOBILE_SECTION_MEDIA_QUERY="(max-width: 760px)";const _sfc_main$1={__name:"SectionContainerShell",props:{title:{type:String,default:""},subtitle:{type:String,default:""},mobileSectionLinks:{type:Array,default:()=>[]}},setup(__props){const props=__props;const slots=useSlots();const route=useRoute();const router=useRouter();const mobileSectionLayout=ref(initialMobileSectionLayout());let mobileSectionMediaQuery=null;const resolvedTitle=computed(()=>String(props.title||"").trim());const resolvedSubtitle=computed(()=>String(props.subtitle||"").trim());const hasHeading=computed(()=>Boolean(resolvedTitle.value||resolvedSubtitle.value));const hasTabs=computed(()=>Boolean(slots.tabs));const mobileSectionLinks=computed(()=>{return props.mobileSectionLinks.map(link=>({disabled:(link==null?void 0:link.disabled)===true,icon:String((link==null?void 0:link.icon)||""),id:String((link==null?void 0:link.id)||(link==null?void 0:link.to)||(link==null?void 0:link.label)||""),label:String((link==null?void 0:link.label)||""),to:normalizeRoutePath((link==null?void 0:link.to)||"")})).filter(link=>Boolean(link.id&&link.label&&link.to))});const mobileSectionsActive=computed(()=>Boolean(mobileSectionLayout.value&&mobileSectionLinks.value.length));const activeMobileSection=computed(()=>{return mobileSectionLinks.value.find(link=>routePathContainsSection(route.path||"",link.to))||null});const activeMobileSectionValue=computed(()=>{var _a;return((_a=activeMobileSection.value)==null?void 0:_a.to)||null});function initialMobileSectionLayout(){if(typeof window==="undefined"||typeof window.matchMedia!=="function"){return false}return window.matchMedia(MOBILE_SECTION_MEDIA_QUERY).matches}function syncMobileSectionLayout(){mobileSectionLayout.value=Boolean(mobileSectionMediaQuery==null?void 0:mobileSectionMediaQuery.matches)}function selectMobileSection(value=""){const targetPath=normalizeRoutePath(value||"");if(!targetPath||targetPath===activeMobileSectionValue.value){return}const targetLink=mobileSectionLinks.value.find(link=>link.to===targetPath);if(!targetLink||targetLink.disabled){return}void router.push(targetLink.to)}onMounted(()=>{var _a;if(typeof window==="undefined"||typeof window.matchMedia!=="function"){return}mobileSectionMediaQuery=window.matchMedia(MOBILE_SECTION_MEDIA_QUERY);syncMobileSectionLayout();if(typeof mobileSectionMediaQuery.addEventListener==="function"){mobileSectionMediaQuery.addEventListener("change",syncMobileSectionLayout)}else{(_a=mobileSectionMediaQuery.addListener)==null?void 0:_a.call(mobileSectionMediaQuery,syncMobileSectionLayout)}});onBeforeUnmount(()=>{var _a;if(typeof(mobileSectionMediaQuery==null?void 0:mobileSectionMediaQuery.removeEventListener)==="function"){mobileSectionMediaQuery.removeEventListener("change",syncMobileSectionLayout)}else{(_a=mobileSectionMediaQuery==null?void 0:mobileSectionMediaQuery.removeListener)==null?void 0:_a.call(mobileSectionMediaQuery,syncMobileSectionLayout)}mobileSectionMediaQuery=null});return(_ctx,_cache)=>{return openBlock(),createElementBlock("section",{class:normalizeClass(["section-container-shell",{"section-container-shell--with-heading":hasHeading.value}])},[hasHeading.value?(openBlock(),createElementBlock("header",_hoisted_1,[resolvedTitle.value?(openBlock(),createElementBlock("h1",_hoisted_2,toDisplayString(resolvedTitle.value),1)):createCommentVNode("",true),resolvedSubtitle.value?(openBlock(),createElementBlock("p",_hoisted_3,toDisplayString(resolvedSubtitle.value),1)):createCommentVNode("",true)])):createCommentVNode("",true),createVNode(VSheet,{rounded:"lg",border:"",class:"section-container-shell__panel"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_4,[mobileSectionsActive.value?(openBlock(),createBlock(VSelect,{key:0,"model-value":activeMobileSectionValue.value,items:mobileSectionLinks.value,"item-title":"label","item-value":"to","item-props":item=>({disabled:item.disabled}),label:"Dashboard section",variant:"outlined","hide-details":"","onUpdate:modelValue":selectMobileSection},null,8,["model-value","items","item-props"])):createCommentVNode("",true),hasTabs.value&&!mobileSectionsActive.value?(openBlock(),createElementBlock("nav",_hoisted_5,[createVNode(VList,{nav:"",density:"compact",rounded:"lg"},{default:withCtx(()=>[renderSlot(_ctx.$slots,"tabs",{},void 0,true)]),_:3})])):createCommentVNode("",true),createBaseVNode("main",_hoisted_6,[renderSlot(_ctx.$slots,"default",{},void 0,true)])])]),_:3})],2)}}};const SectionContainerShell=_export_sfc(_sfc_main$1,[["__scopeId","data-v-94847611"]]);function useVibe64DashboardPage({dashboardContext=null}={}){const route=useRoute();const projectSlug=computed(()=>projectSlugFromRoute(route));const projectBasePath=computed(()=>projectAppPath(projectSlug.value));const dashboardSectionLinks=computed(()=>getPlacements().filter(placement=>(placement==null?void 0:placement.kind)==="link"&&(placement==null?void 0:placement.owner)==="app-dashboard"&&(placement==null?void 0:placement.target)==="page.section-nav"&&dashboardPlacementVisible(placement,dashboardContext)).sort((left,right)=>Number((left==null?void 0:left.order)||0)-Number((right==null?void 0:right.order)||0)).map(placement=>{var _a,_b,_c;return{disabled:((_a=placement==null?void 0:placement.props)==null?void 0:_a.disabled)===true,icon:((_b=placement==null?void 0:placement.props)==null?void 0:_b.icon)||"",id:(placement==null?void 0:placement.id)||"",label:((_c=placement==null?void 0:placement.props)==null?void 0:_c.label)||"",to:`${projectBasePath.value}${dashboardSectionSuffix(placement)}`}}));return{dashboardSectionLinks}}function dashboardPlacementVisible(placement={},dashboardContext=null){var _a;const predicate=(_a=placement==null?void 0:placement.props)==null?void 0:_a.visibleWhen;if(typeof predicate!=="function")return true;const context=typeof dashboardContext==="function"?dashboardContext():(dashboardContext==null?void 0:dashboardContext.value)??dashboardContext;return predicate(context&&typeof context==="object"?context:{})===true}function activeSessionMobileSectionLinks(activeSessionNav=null){if(!(activeSessionNav==null?void 0:activeSessionNav.visible)||!Array.isArray(activeSessionNav.tools)){return[]}return activeSessionNav.tools.map(tool=>({disabled:(tool==null?void 0:tool.disabled)===true,icon:String((tool==null?void 0:tool.icon)||""),id:`active-session:${String((tool==null?void 0:tool.id)||(tool==null?void 0:tool.to)||(tool==null?void 0:tool.label)||"")}`,label:String((tool==null?void 0:tool.label)||""),to:String((tool==null?void 0:tool.to)||"")})).filter(tool=>Boolean(tool.id!=="active-session:"&&tool.label&&tool.to))}function dashboardSectionSuffix(placement={}){var _a,_b;const suffix=String(((_a=placement==null?void 0:placement.props)==null?void 0:_a.scopedSuffix)||((_b=placement==null?void 0:placement.props)==null?void 0:_b.unscopedSuffix)||"").trim();if(!suffix){return""}const projectRelativeSuffix=suffix.replace(/^\/+/u,"").replace(/^project\/\[slug\](?=\/|$)/u,"").replace(/^\[slug\](?=\/|$)/u,"").replace(/^\/+/u,"");return projectRelativeSuffix?`/${projectRelativeSuffix}`:""}const _sfc_main={__name:"Vibe64DashboardShell",props:{dashboardContext:{default:()=>({}),type:Object}},setup(__props){const props=__props;const{dashboardSectionLinks}=useVibe64DashboardPage({dashboardContext:()=>props.dashboardContext});const activeSessionNav=computed(()=>{var _a;const nav=((_a=props.dashboardContext)==null?void 0:_a.activeSessionNav)||null;return nav&&typeof nav==="object"?nav:null});const mobileDashboardSectionLinks=computed(()=>[...dashboardSectionLinks.value,...activeSessionMobileSectionLinks(activeSessionNav.value)]);provide(VIBE64_ACTIVE_SESSION_NAV_KEY,activeSessionNav);return(_ctx,_cache)=>{return openBlock(),createBlock(SectionContainerShell,{"mobile-section-links":mobileDashboardSectionLinks.value},{tabs:withCtx(()=>[createVNode(unref(_sfc_main$2),{target:"app-dashboard:primary-menu"}),createVNode(unref(_sfc_main$2),{target:"app-dashboard:active-session-menu",context:{activeSessionNav:activeSessionNav.value||{}}},null,8,["context"])]),default:withCtx(()=>[renderSlot(_ctx.$slots,"default")]),_:3},8,["mobile-section-links"])}}};export{_sfc_main as _};