wizards 0.5.10 → 0.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/runtime/dist/browser/fast/action-space.js +0 -2
- package/apps/runtime/dist/cli/mcp.js +2 -15
- package/apps/runtime/dist/cli/report.js +2 -15
- package/apps/runtime/dist/cli/start.js +28 -14
- package/apps/runtime/dist/cli/status.js +1 -1
- package/apps/runtime/dist/credits/credits.js +0 -3
- package/apps/runtime/dist/db/client.js +0 -7
- package/apps/runtime/dist/docs/user/build-a-wizard.md +1 -1
- package/apps/runtime/dist/engine/runner.js +12 -7
- package/apps/runtime/dist/harness/index.js +0 -4
- package/apps/runtime/dist/manage.js +7 -7
- package/apps/runtime/dist/plugins/pro.js +0 -6
- package/apps/runtime/dist/render/convert.js +0 -3
- package/apps/runtime/dist/routes/studio.js +42 -6
- package/apps/runtime/dist/services/api.js +8 -6
- package/apps/runtime/dist/store/index.js +0 -11
- package/apps/runtime/dist/texts.js +45 -39
- package/apps/web/dist/assets/{AboutDialog-DsRwnfPV.js → AboutDialog-DvkE9J4h.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-IlNqQnnS.js → ChangelogDialog-BZ8i3wt_.js} +1 -1
- package/apps/web/dist/assets/{ChatView-DtiFinUD.js → ChatView-DIDIR0mb.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-DUNtNSK2.js → EditorPage-BYysznX3.js} +1 -1
- package/apps/web/dist/assets/{FlowPreview-CIzjgZuD.js → FlowPreview-DG23aI89.js} +1 -1
- package/apps/web/dist/assets/{Harness-JP1WcYyl.js → Harness-CFh04TZ3.js} +1 -1
- package/apps/web/dist/assets/{NewWizardChannels-DRenAibu.js → NewWizardChannels-Bmo5yRCv.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-2OPw3sgZ.js → NewWizardPage-4n9-ZmHt.js} +2 -2
- package/apps/web/dist/assets/OnboardingPage-DpZv9qEO.js +1 -0
- package/apps/web/dist/assets/{ProjectPage-Bwvgr0wn.js → ProjectPage-IQb9RFlm.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-C2BBulT4.js → PublicRunner-Da0klKj-.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly--S0kHt6O.js → ReadOnly-C_jD7KjW.js} +1 -1
- package/apps/web/dist/assets/{RunDrawer-DMsGnCo4.js → RunDrawer-FwLK67Yn.js} +1 -1
- package/apps/web/dist/assets/{RunnerView-DKPMblvD.js → RunnerView-BBuphCkK.js} +1 -1
- package/apps/web/dist/assets/{SettingsPage-C_frXK1B.js → SettingsPage-CZx52Ubk.js} +1 -1
- package/apps/web/dist/assets/{SetupPage-BAuR4VsB.js → SetupPage-B-o7VhbI.js} +1 -1
- package/apps/web/dist/assets/{SharePage-t4nlY7Y9.js → SharePage-k2OMGOWU.js} +1 -1
- package/apps/web/dist/assets/changelog-9oSWVuP-.js +1 -0
- package/apps/web/dist/assets/{esm-Bp2lKzWx.js → esm-Dzqe3TT4.js} +1 -1
- package/apps/web/dist/assets/{index-CC09ypna.js → index-93fPRTxr.js} +4 -4
- package/apps/web/dist/assets/index-DaKjB676.css +1 -0
- package/apps/web/dist/assets/{lock-heat0zQ3.js → lock-a8rDnyg5.js} +1 -1
- package/apps/web/dist/assets/{phone-DlicJ0f_.js → phone-CitA6oZn.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-BpPXMKjQ.js → settings-menu-COgM8CgB.js} +1 -1
- package/apps/web/dist/assets/{ui-DWaP9zdL.js → ui-CeZNNuaK.js} +2 -2
- package/apps/web/dist/assets/{upload-BcENTlhM.js → upload-CcKFwoPd.js} +1 -1
- package/apps/web/dist/index.html +3 -3
- package/apps/web/dist/mcp/flow.html +2 -2
- package/node_modules/@engenty-wizards/plugin-sdk/dist/thread.js +34 -34
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +0 -6
- package/node_modules/@engenty-wizards/shared/dist/definition.js +0 -10
- package/node_modules/@engenty-wizards/shared/dist/features.d.ts +0 -1
- package/node_modules/@engenty-wizards/shared/dist/features.js +0 -1
- package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +0 -5
- package/node_modules/@engenty-wizards/shared/dist/marketplace.js +0 -5
- package/node_modules/@engenty-wizards/shared/dist/providers.d.ts +1 -1
- package/node_modules/@engenty-wizards/shared/dist/providers.js +1 -1
- package/node_modules/@engenty-wizards/shared/dist/run.js +1 -1
- package/package.json +1 -1
- package/apps/web/dist/assets/OnboardingPage-3r1Wl95W.js +0 -1
- package/apps/web/dist/assets/changelog-BFj5SeNY.js +0 -1
- package/apps/web/dist/assets/index-5gXip3QC.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Ut as r}from"./ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Ut as r}from"./ui-CeZNNuaK.js";import{a as i,c as a,i as o,n as s,r as c,s as l,t as u}from"./esm-Dzqe3TT4.js";var d=e(t(),1),f=e(n(),1),p=208,m=42,h=26,g=22,_=132;function v({data:e}){let t=e.icon;return(0,f.jsxs)(`div`,{style:{width:p,height:m},className:r(`flex cursor-default items-center gap-2.5 rounded-xl px-2.5`,e.optional?`border border-ink-4 border-dashed`:`bg-paper-2 ring-1 ring-border-soft`),children:[(0,f.jsx)(c,{type:`target`,position:a.Top}),(0,f.jsx)(c,{type:`target`,id:`in`,position:a.Right}),(0,f.jsx)(`span`,{className:r(`inline-flex size-6 shrink-0 items-center justify-center rounded-md`,e.tone),children:(0,f.jsx)(t,{className:`size-3.5`})}),(0,f.jsx)(`span`,{className:`truncate font-medium text-[0.8125rem] text-ink`,children:e.title}),(0,f.jsx)(c,{type:`source`,position:a.Bottom}),(0,f.jsx)(c,{type:`source`,id:`out`,position:a.Right})]})}function y({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,markerEnd:a}){let o=Math.max(e,n)+g,c=[`M ${e} ${t}`,`H ${o-8}`,`Q ${o} ${t} ${o} ${t+8}`,`V ${r-8}`,`Q ${o} ${r} ${o-8} ${r}`,`H ${n}`].join(` `);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(u,{path:c,markerEnd:a,style:{strokeDasharray:`5 4`}}),(0,f.jsx)(s,{children:(0,f.jsx)(`div`,{style:{width:_,transform:`translate(${o+8}px, ${(t+r)/2}px) translateY(-50%)`},className:`absolute text-[0.6875rem] text-ink-2 leading-snug`,children:i})})]})}var b={step:v},x={branch:y};function S(e){let t={markerEnd:{type:l.ArrowClosed,width:14,height:14,color:`var(--ink-4)`}},n=e.map((e,t)=>({id:e.id,type:`step`,position:{x:0,y:t*68},data:{title:e.title,icon:e.icon,tone:e.tone,optional:e.optional},draggable:!1})),r=[],i=!1;return e.forEach((n,a)=>{let o=e[a+1];for(let[a,o]of(n.branches??[]).entries())e.some(e=>e.id===o.to)&&(i=!0,r.push({id:`b-${n.id}-${a}`,type:`branch`,source:n.id,sourceHandle:`out`,target:o.to,targetHandle:`in`,label:o.when,...t}));o&&r.push({id:`n-${n.id}`,type:`straight`,source:n.id,target:o.id,...t})}),{nodes:n,edges:r,width:p+(i?162:0),height:e.length*68-h}}function C({steps:e}){let{nodes:t,edges:n,width:r,height:a}=(0,d.useMemo)(()=>S(e),[e]);return e.length?(0,f.jsx)(`div`,{className:`max-w-full`,style:{width:r,height:a+4},children:(0,f.jsx)(o,{children:(0,f.jsx)(i,{nodes:t,edges:n,nodeTypes:b,edgeTypes:x,defaultViewport:{x:1,y:2,zoom:1},minZoom:1,maxZoom:1,nodesConnectable:!1,nodesDraggable:!1,nodesFocusable:!1,edgesFocusable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,proOptions:{hideAttribution:!0}})})}):null}export{C as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$ as r,Dt as i,Gr as a,Nn as o,Ut as s,W as c,Yt as l,nr as u}from"./ui-DWaP9zdL.js";import{B as d,Zt as f}from"./index-CC09ypna.js";var p=e(t(),1),m=2,h=1,g=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(m,Math.floor(u/e.css.cell.width)),rows:Math.max(h,Math.floor(l/e.css.cell.height))}}},_=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=te.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function ee(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var te=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!ee(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),n.isWrapped&&o.indexOf(` `)===-1););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},ne=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function re(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var ie=class{constructor(e=re,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||ne;this._linkProvider=this._terminal.registerLinkProvider(new _(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},ae=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,se=(e,t)=>{for(var n in t)ae(e,n,{get:t[n],enumerable:!0})},v=(e,t,n,r)=>{for(var i=r>1?void 0:r?oe(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&ae(t,n,i),i},y=(e,t)=>(n,r)=>t(n,r,e),ce=`Terminal input`,b={get:()=>ce,set:e=>ce=e},le=`Too much output to announce, navigate to rows manually to read`,ue={get:()=>le,set:e=>le=e};function de(e){return e.replace(/\r?\n/g,`\r`)}function x(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function fe(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function pe(e,t,n,r){e.stopPropagation(),e.clipboardData&&me(e.clipboardData.getData(`text/plain`),t,n,r)}function me(e,t,n,r){e=de(e),e=x(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function he(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ge(e,t,n,r,i){he(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function S(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function _e(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var ve=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},ye=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},be=``,xe=` `,Se=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Ce}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ce=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},C=class e extends Se{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ce,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?S(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},we=`di$target`,Te=`di$dependencies`,Ee=new Map;function De(e){return e[Te]||[]}function w(e){if(Ee.has(e))return Ee.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);Oe(t,e,r)};return t._id=e,Ee.set(e,t),t}function Oe(e,t,n){t[we]===t?t[Te].push({id:e,index:n}):(t[Te]=[{id:e,index:n}],t[we]=t)}var T=w(`BufferService`),ke=w(`CoreMouseService`),Ae=w(`CoreService`),je=w(`CharsetService`),Me=w(`InstantiationService`),Ne=w(`LogService`),E=w(`OptionsService`),Pe=w(`OscLinkService`),Fe=w(`UnicodeService`),Ie=w(`DecorationService`),Le=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new C,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Re(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Le=v([y(0,T),y(1,E),y(2,Pe)],Le);function Re(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$ as r,Dt as i,Gr as a,Nn as o,Ut as s,W as c,Yt as l,nr as u}from"./ui-CeZNNuaK.js";import{B as d,Zt as f}from"./index-93fPRTxr.js";var p=e(t(),1),m=2,h=1,g=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(m,Math.floor(u/e.css.cell.width)),rows:Math.max(h,Math.floor(l/e.css.cell.height))}}},_=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=te.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function ee(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var te=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!ee(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),n.isWrapped&&o.indexOf(` `)===-1););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},ne=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function re(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var ie=class{constructor(e=re,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||ne;this._linkProvider=this._terminal.registerLinkProvider(new _(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},ae=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,se=(e,t)=>{for(var n in t)ae(e,n,{get:t[n],enumerable:!0})},v=(e,t,n,r)=>{for(var i=r>1?void 0:r?oe(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&ae(t,n,i),i},y=(e,t)=>(n,r)=>t(n,r,e),ce=`Terminal input`,b={get:()=>ce,set:e=>ce=e},le=`Too much output to announce, navigate to rows manually to read`,ue={get:()=>le,set:e=>le=e};function de(e){return e.replace(/\r?\n/g,`\r`)}function x(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function fe(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function pe(e,t,n,r){e.stopPropagation(),e.clipboardData&&me(e.clipboardData.getData(`text/plain`),t,n,r)}function me(e,t,n,r){e=de(e),e=x(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function he(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ge(e,t,n,r,i){he(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function S(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function _e(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var ve=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},ye=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},be=``,xe=` `,Se=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Ce}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ce=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},C=class e extends Se{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ce,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?S(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},we=`di$target`,Te=`di$dependencies`,Ee=new Map;function De(e){return e[Te]||[]}function w(e){if(Ee.has(e))return Ee.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);Oe(t,e,r)};return t._id=e,Ee.set(e,t),t}function Oe(e,t,n){t[we]===t?t[Te].push({id:e,index:n}):(t[Te]=[{id:e,index:n}],t[we]=t)}var T=w(`BufferService`),ke=w(`CoreMouseService`),Ae=w(`CoreService`),je=w(`CharsetService`),Me=w(`InstantiationService`),Ne=w(`LogService`),E=w(`OptionsService`),Pe=w(`OscLinkService`),Fe=w(`UnicodeService`),Ie=w(`DecorationService`),Le=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new C,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Re(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};Le=v([y(0,T),y(1,E),y(2,Pe)],Le);function Re(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
2
2
|
|
|
3
3
|
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var ze=w(`CharSizeService`),Be=w(`CoreBrowserService`),Ve=w(`MouseService`),He=w(`RenderService`),Ue=w(`SelectionService`),We=w(`CharacterJoinerService`),Ge=w(`ThemeService`),Ke=w(`LinkProviderService`),qe=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?$e.isErrorNoTelemetry(e)?new $e(e.message+`
|
|
4
4
|
|
package/apps/web/dist/assets/{NewWizardChannels-DRenAibu.js → NewWizardChannels-Bmo5yRCv.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{En as r,Fn as i,Ut as a,Yt as o,cr as s,nn as c,nr as l,rr as u}from"./ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{En as r,Fn as i,Ut as a,Yt as o,cr as s,nn as c,nr as l,rr as u}from"./ui-CeZNNuaK.js";import{t as d}from"./phone-CitA6oZn.js";import{Ft as f,It as p,Rt as m,Ut as h}from"./index-93fPRTxr.js";var g={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};g.node;var _=s(g),v=[`text`,`data`,`image`,`video`,`voice`,`document`,`dashboard`,`widget`,`film`,`surface`];[...c],[...v];var y={default:`steps`,enabled:[`steps`,`chat`]},b=e(t(),1),x=e(n(),1),S=[{id:`steps`,group:`web`,runner:`steps`,label:`new.ch.steps`,icon:m},{id:`chat`,group:`web`,runner:`chat`,label:`new.ch.chat`,icon:p},{id:`talk`,group:`web`,runner:`talk`,label:`new.ch.talk`,icon:u},{id:`video`,group:`web`,runner:`video`,label:`new.ch.video`,icon:r},{id:`call`,group:`phone`,runner:`call`,label:`new.ch.call`,icon:d},{id:`wacall`,group:`phone`,runner:`call`,label:`new.ch.whatsapp`,icon:null},{id:`sms`,group:`message`,runner:`sms`,label:`new.ch.sms`,icon:_},{id:`whatsapp`,group:`message`,runner:`whatsapp`,label:`new.ch.whatsapp`,icon:null}],C=[{id:`web`,label:`new.web`,icon:h},{id:`phone`,label:`new.phone`,icon:d},{id:`message`,label:`new.messages`,icon:f}],w=S.filter(e=>y.enabled.includes(e.id)).map(e=>e.id),T=e=>S.filter(t=>e.includes(t.id));function E(e){return e.length===w.length&&w.every(t=>e.includes(t))}function D(e){let t=T(e),n=[...new Set(t.map(e=>e.runner))];return{default:t.find(e=>e.group===`web`)?.runner??n[0]??y.default,enabled:n}}var O=e=>e.map(e=>o(e.label));function k(e){return S.find(t=>t.runner===e)}function A(e){return S.filter(t=>t.id!==`wacall`&&e.includes(t.runner)).map(e=>e.id)}function j(e){let t=T(e),n=C.flatMap(e=>{let n=O(t.filter(t=>t.group===e.id));return n.length?[e.id===`web`?n.join(`, `):`${o(e.label)}: ${n.join(`, `)}`]:[]});return`${o(`new.runsAs`)}: ${n.join(` · `)}`}function M(e){return e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}function N({channel:e,className:t}){let n=e.icon;return n?(0,x.jsx)(n,{className:t??`size-4`}):(0,x.jsx)(`span`,{"aria-hidden":`true`,className:`font-semibold text-[0.625rem] tracking-wide`,children:`WA`})}function P(e){let t=new Set(e?.map(e=>e.id)??[`steps`,`chat`,`talk`,`video`]);return S.filter(e=>t.has(e.runner))}function F({value:e,onChange:t,runners:n,without:r,disabled:i}){let s=P(n).filter(e=>!r?.includes(e.id)),c=t=>e.includes(t.id),u=n=>{i||c(n)&&e.length===1||t(c(n)?e.filter(e=>e!==n.id):[...e,n.id])},d=t=>{let n=C.find(e=>e.id===t),r=s.filter(e=>e.group===t);if(!(n&&r.length))return null;let d=n.icon;return(0,x.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-0.5 border-0 p-0`,children:[(0,x.jsxs)(`legend`,{className:`flex items-center gap-1.5 px-2 pt-2 pb-1 text-[0.75rem] text-ink-3`,children:[(0,x.jsx)(d,{className:`size-3.5`}),` `,o(n.label)]}),r.map(t=>(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`label`,{className:a(`flex h-10 w-full cursor-pointer items-center gap-2.5 rounded-lg px-2 text-[0.875rem] transition hover:bg-accent has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-focus coarse:h-11`,c(t)&&`bg-paper-2`),children:[(0,x.jsx)(`span`,{className:`flex w-5 justify-center text-ink-3`,children:(0,x.jsx)(N,{channel:t})}),(0,x.jsx)(`span`,{className:`flex-1`,children:o(t.label)}),(0,x.jsx)(`input`,{type:`checkbox`,className:`sr-only`,"aria-label":o(t.label),checked:c(t),disabled:i,"aria-disabled":c(t)&&e.length===1,onChange:()=>u(t)}),(0,x.jsx)(`span`,{"aria-hidden":`true`,className:a(`flex size-[1.125rem] items-center justify-center rounded-md ring-1`,c(t)?`bg-ink text-paper ring-ink`:`ring-border`),children:c(t)?(0,x.jsx)(l,{className:`size-3`,strokeWidth:3}):null})]}),t.id===`call`&&c(t)?(0,x.jsx)(`p`,{className:`px-2 pb-1.5 pl-9 text-[0.75rem] text-ink-3`,children:o(`new.callHandoff`)}):null]},t.id))]})};return(0,x.jsxs)(`div`,{className:`grid gap-x-4 sm:grid-cols-2`,children:[d(`web`),(0,x.jsxs)(`div`,{className:`flex flex-col`,children:[d(`phone`),d(`message`)]})]})}function I({value:e,onChange:t,runners:n,className:r}){let[s,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)(0),d=(0,b.useRef)(null);(0,b.useEffect)(()=>{if(!s)return;let e=e=>{d.current?.contains(e.target)||c(!1)},t=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[s]);let f=P(n),p=C.filter(e=>f.some(t=>t.group===e.id)),m=t=>e.includes(t.id);return(0,x.jsxs)(`div`,{ref:d,className:a(`relative flex flex-wrap items-center gap-1.5`,r),children:[(0,x.jsx)(`span`,{className:`mr-0.5 px-1 text-[0.8125rem] text-ink-3`,children:o(`new.runsAs`)}),p.map(e=>{let t=O(f.filter(t=>t.group===e.id&&m(t))),n=e.icon;return(0,x.jsxs)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":s,"aria-label":`${o(e.label)}: ${t.length?t.join(`, `):o(`new.off`)}`,onClick:e=>{let t=e.currentTarget;u(t.offsetLeft+t.offsetWidth/2),c(e=>!e)},className:a(`inline-flex h-9 items-center justify-center gap-1.5 rounded-full font-medium text-[0.8125rem] transition coarse:h-11`,t.length?`bg-ink px-3 text-paper`:`w-9 text-ink-3 ring-1 ring-border hover:text-ink coarse:w-11`),children:[(0,x.jsx)(n,{className:`size-4 shrink-0`}),t.length?(0,x.jsx)(`span`,{className:`truncate`,children:M(t)}):null]},e.id)}),(0,x.jsx)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":s,"aria-label":o(`new.where`),onClick:e=>{let t=e.currentTarget;u(t.offsetLeft+t.offsetWidth/2),c(e=>!e)},className:`inline-flex size-9 items-center justify-center rounded-full text-ink-3 ring-1 ring-border transition hover:text-ink coarse:size-11`,children:(0,x.jsx)(i,{className:`size-4`})}),s?(0,x.jsxs)(`div`,{role:`dialog`,"aria-label":o(`new.where`),style:{transformOrigin:`${l}px top`},className:`absolute top-full left-0 z-20 mt-2 w-[min(32rem,calc(100vw-2rem))] animate-unfold rounded-2xl bg-card p-3 text-left shadow-overlay ring-1 ring-border`,children:[(0,x.jsx)(`p`,{className:`px-2 pt-1 font-semibold text-[0.9375rem]`,children:o(`new.where`)}),(0,x.jsx)(F,{value:e,onChange:t,runners:n})]}):null]})}export{j as a,E as c,I as i,D as l,N as n,k as o,F as r,A as s,C as t};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$ as r,At as i,Dt as a,Fn as o,Fr as s,Gr as c,Gt as l,Ht as u,Tn as d,Ut as f,W as p,Yt as m,ar as h,br as g,bt as _,c as v,d as y,f as b,fr as ee,gr as x,kt as S,m as te,p as ne,u as re,vr as ie,zn as ae}from"./ui-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$ as r,At as i,Dt as a,Fn as o,Fr as s,Gr as c,Gt as l,Ht as u,Tn as d,Ut as f,W as p,Yt as m,ar as h,br as g,bt as _,c as v,d as y,f as b,fr as ee,gr as x,kt as S,m as te,p as ne,u as re,vr as ie,zn as ae}from"./ui-CeZNNuaK.js";import{a as oe,c as C,i as w,l as T}from"./NewWizardChannels-Bmo5yRCv.js";import{t as E}from"./upload-CcKFwoPd.js";import{C as se,S as D,T as O,Zt as k,lt as A,mt as ce,ot as j,rt as M,tt as N,w as P}from"./index-93fPRTxr.js";var F=[[`id`,8],[`toolId`,10],[`moduleId`,7],[`pluginId`,6],[`title`,6],[`description`,4],[`tags`,3],[`path`,3],[`inputSchema`,2],[`outputSchema`,2],[`request`,1],[`response`,1]];function I(e){return e.normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase()}function L(e){return I(e).split(/[^a-z0-9]+/).map(e=>e.trim()).filter(e=>e.length>1)}function R(e){return e==null?``:Array.isArray(e)?e.map(R).filter(Boolean).join(` `):typeof e==`object`?Object.values(e).map(R).filter(Boolean).join(` `):String(e)}function z(e,t){let n=t.map(([t,n])=>({text:R(e[t]),weight:n})).filter(e=>e.text.length>0);return{fields:n,tokens:n.flatMap(e=>L(e.text))}}function B(e){let t=[e];if(e.length<5)return t;if(e.endsWith(`ing`)){let n=e.slice(0,-3);n.length>=3&&t.push(n,`${n}e`)}else if(e.endsWith(`ies`)&&e.length>=6)t.push(`${e.slice(0,-3)}y`);else if(e.endsWith(`es`))t.push(e.slice(0,-2),e.slice(0,-1));else if(e.endsWith(`ed`)){let n=e.slice(0,-2);t.push(n,`${n}e`)}else e.endsWith(`s`)&&!e.endsWith(`ss`)&&t.push(e.slice(0,-1));return[...new Set(t)]}function V(e,t){if(e===t)return 1;let n=0;for(let r of B(e))for(let i of B(t)){if(r===i){n=Math.max(n,r===e&&i===t?1:.75);continue}r.length>=2&&i.startsWith(r)&&(n=Math.max(n,.55*(r.length/i.length))),i.length>=4&&r.startsWith(i)&&(n=Math.max(n,.4*(i.length/r.length)))}return n}function H(e,t){return e.reduce((e,n)=>e+V(t,n),0)}function U(e,t,n=F){if(!t?.trim())return 0;let r=L(t);if(r.length===0)return 0;let i=z(e,n);return i.tokens.length===0?0:r.reduce((e,t)=>H(i.tokens,t)===0?e:e+i.fields.reduce((e,n)=>{let r=L(n.text),i=H(r,t);if(i===0)return e;let a=i*2.2/(i+1.2+r.length/16);return e+n.weight*a},0),0)}var W=new Set(L(`aber als also am an auch auf aus bei bin bitte brauche brauchen braucht das dass dem den der
|
|
2
2
|
des die dies diese dieser doch du ein eine einem einen einer eines er es etwas fuer für gerne
|
|
3
3
|
habe haben hat ich ihr im in ist kann können koennen mache machen mag mein meine meinem meinen
|
|
4
4
|
meiner mich mir mit möchte moechte nach nicht noch nur oder sich sie sind soll suche suchen
|
|
5
5
|
sucht um und uns unser unsere vom von vor was wie will wir wird wo wollen zu zum zur
|
|
6
6
|
a about an and are as at be can do for from have how i in is it like looking me my need of on
|
|
7
|
-
or our that the this to want we what which who with would you your`)),G=e=>e.replace(/ß/g,`ss`);function K(e){let t=L(G(e)),n=t.filter(e=>!W.has(e));return n.length?n:t}var q=e=>e.trim().split(/\s+/).filter(Boolean).length>=3,J=e(t(),1),Y=e(n(),1);function le({variant:e=`secondary`,label:t=m(`home.import`)}){let n=x(),r=c(),{project:o}=j(),s=A(),l=(0,J.useRef)(null),u=k({mutationFn:e=>p.upload(`/api/studio/projects/${o.id}/wizards/import`,e),onSuccess:async({id:e})=>{await r.invalidateQueries({queryKey:[`projects`]}),await r.invalidateQueries({queryKey:[`wizards`]}),n(`/edit/${e}`)}}),d=u.error instanceof _?u.error.body?.issues??[]:[];return!s||o?.readOnly?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(a,{variant:e,busy:u.isPending,disabled:!o,onClick:()=>l.current?.click(),children:[(0,Y.jsx)(E,{className:`size-4`}),` `,t]}),(0,Y.jsx)(`input`,{ref:l,hidden:!0,type:`file`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&u.mutate(t)}}),(0,Y.jsxs)(i,{open:u.isError,onClose:u.reset,title:m(`import.failed`),children:[(0,Y.jsx)(`p`,{className:`text-[0.875rem] text-ink-2`,children:u.error?.message}),d.length?(0,Y.jsx)(`ul`,{className:`mt-3 flex list-disc flex-col gap-1 pl-5 text-[0.8125rem] text-ink-2`,children:d.slice(0,8).map(e=>(0,Y.jsx)(`li`,{children:e.message},e.message))}):null,(0,Y.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,Y.jsx)(a,{variant:`secondary`,onClick:u.reset,children:m(`common.close`)})})]})]})}var X=10,Z=3;async function ue(e,t){let n=await fetch(r(`/api/studio/wizards/${e}/files/${encodeURIComponent(t.name)}`),{method:`PUT`,credentials:`include`,headers:{"content-type":t.type||`application/octet-stream`,"accept-language":l},body:t});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??n.statusText)}}function Q({over:e,onClick:t}){return(0,Y.jsx)(`button`,{type:`button`,"aria-label":m(`editor.detach`),onClick:t,className:f(`inline-flex shrink-0 items-center justify-center rounded-full`,e?`-top-1.5 -right-1.5 absolute size-5 bg-ink text-paper shadow-soft coarse:size-7`:`size-5 text-ink-3 hover:bg-paper-3 hover:text-ink coarse:size-7`),children:(0,Y.jsx)(d,{className:`size-3`})})}function $(e,t){let n=K(t);if(!n.length)return[];let r=e.map(e=>({w:e,score:U({title:e.title,summary:e.description},n.join(` `),[[`title`,10],[`summary`,6]])})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score),i=q(t)?(r[0]?.score??0)*.4:0;return r.filter(e=>e.score>=i).slice(0,Z).map(e=>e.w)}function de({wish:e,projectId:t,busy:n,onTake:r,onMore:i}){let o=x(),[c,u]=(0,J.useState)(null),d=O(e.trim(),300),f=g({queryKey:[`wizards`,t,`similar`],queryFn:()=>p.get(`/api/studio/projects/${t}/wizards`)}),h=g({queryKey:[`marketplace`,l,d,`similar`],queryFn:()=>p.get(`/api/studio/marketplace?${new URLSearchParams({lang:l,limit:String(X),offset:`0`,q:d})}`),enabled:d.length>=3,placeholderData:s});if(d.length<3)return null;let _=$(f.data??[],d),v=(h.data?.entries??[]).slice(0,X-_.length),y=(h.data?.total??0)-v.length;if(!(_.length||v.length))return null;let b=`flex items-center gap-3 rounded-xl bg-card py-2 pr-2 pl-3.5 ring-1 ring-border-soft`;return(0,Y.jsxs)(`section`,{className:`mt-5`,children:[(0,Y.jsx)(`h2`,{className:`mb-2 px-1 text-[0.8125rem] text-ink-3`,children:m(`new.similar`)}),(0,Y.jsxs)(`ul`,{className:`flex flex-col gap-1.5`,children:[_.map(e=>(0,Y.jsxs)(`li`,{className:b,children:[(0,Y.jsx)(S,{children:m(`new.yours`)}),(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>o(`/edit/${e.id}`),className:`min-w-0 flex-1 text-left`,children:[(0,Y.jsx)(`span`,{className:`block truncate font-medium text-[0.9375rem]`,children:e.title}),(0,Y.jsx)(`span`,{className:`block truncate text-[0.8125rem] text-ink-3`,children:e.description})]}),(0,Y.jsx)(a,{variant:`secondary`,size:`sm`,onClick:()=>o(`/edit/${e.id}`),children:m(`new.open`)})]},e.id)),v.map(e=>(0,Y.jsxs)(`li`,{className:b,children:[(0,Y.jsx)(S,{children:m(`new.template`)}),(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>u(e.id),className:`min-w-0 flex-1 text-left`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`truncate font-medium text-[0.9375rem]`,children:e.title}),e.plan===`pro`?(0,Y.jsx)(P,{}):null]}),(0,Y.jsx)(`span`,{className:`block truncate text-[0.8125rem] text-ink-3`,children:e.pitch})]}),(0,Y.jsx)(a,{variant:`secondary`,size:`sm`,disabled:n,onClick:()=>r(e),children:m(`new.take`)})]},e.id))]}),y>0?(0,Y.jsx)(`button`,{type:`button`,onClick:()=>i(d),className:`mt-2 px-1 text-[0.875rem] text-ink-2 hover:text-ink coarse:min-h-11`,children:m(`new.more`,{n:y})}):null,(0,Y.jsx)(D,{id:c,fallback:v.find(e=>e.id===c)??null,onClose:()=>u(null),onUse:r,busy:n})]})}function fe(){let e=x(),t=c(),{project:n}=j(),r=A(),[i]=ie(),[s,d]=(0,J.useState)(()=>i.get(`wish`)??M()??``),_=(0,J.useRef)(M()!==null),[S,E]=(0,J.useState)([`steps`]),[D,O]=(0,J.useState)([]),[P,F]=(0,J.useState)(!1),[I,L]=(0,J.useState)(null),R=(0,J.useRef)(null),z=(0,J.useRef)(null),B=(0,J.useRef)(null),[V]=te(),H=ne(s,d,{deviceId:V.deviceId}),U=g({queryKey:[`runners`],queryFn:()=>p.get(`/api/studio/runners`)}),W=e=>{let t=e.map(b);O(e=>[...e.filter(e=>!t.some(t=>t.name===e.name)),...t])},[G,K]=(0,J.useState)(new Map);(0,J.useEffect)(()=>{let e=new Map(D.filter(e=>e.type.startsWith(`image/`)).map(e=>[e,URL.createObjectURL(e)]));return K(e),()=>{for(let t of e.values())URL.revokeObjectURL(t)}},[D]);let q=k({mutationFn:e=>p.post(`/api/studio/wizards`,{projectId:n.id,starterId:e,lang:l}),onSuccess:async({id:n})=>{await t.invalidateQueries({queryKey:[`projects`]}),await t.invalidateQueries({queryKey:[`wizards`]}),e(`/edit/${n}`)}}),X=k({mutationFn:async()=>{let e=B.current??(await p.post(`/api/studio/wizards`,{projectId:n.id,lang:l})).id;B.current=e,C(S)||await p.patch(`/api/studio/wizards/${e}`,{runners:T(S)});for(let t of D)await ue(e,t);return e},onSuccess:async n=>{N(),await t.invalidateQueries({queryKey:[`projects`]}),await t.invalidateQueries({queryKey:[`wizards`]});let r=s.trim();C(S)||(r+=`\n\n${oe(S)}`),D.length&&(r+=`\n\n${m(`editor.attached`)}: ${D.map(e=>e.name).join(`, `)}`),e(`/edit/${n}?prompt=${encodeURIComponent(r)}`)}}),Z=()=>{s.trim()&&n&&!X.isPending&&(H.listening&&H.stop(),X.mutate())};if((0,J.useEffect)(()=>{_.current&&n&&r&&!n.readOnly&&s.trim()&&(_.current=!1,X.mutate())},[n,r,s,X]),!r||n?.readOnly)return(0,Y.jsx)(ee,{to:`/`,replace:!0});let $=X.error??q.error;return(0,Y.jsxs)(`div`,{className:`animate-rise md:pt-4`,children:[(0,Y.jsxs)(`div`,{className:`mx-auto max-w-2xl`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,Y.jsx)(`div`,{className:`size-[84px] md:size-auto`,children:(0,Y.jsx)(`div`,{className:`origin-top-left scale-[0.56] md:scale-100`,children:(0,Y.jsx)(ce,{kind:`sprout`,size:150,fluffy:!0})})}),(0,Y.jsx)(`h1`,{className:`mt-1 font-display font-semibold text-[1.5rem] leading-tight tracking-tight md:mt-2 md:text-[2.375rem]`,children:m(`new.title`)})]}),(0,Y.jsx)(w,{value:S,onChange:E,runners:U.data,className:`mt-4 px-1 md:mt-8`}),(0,Y.jsxs)(`div`,{className:f(`relative mt-3 rounded-2xl bg-card p-2 shadow-elevated ring-1 ring-border-soft focus-within:ring-focus`,P&&`ring-2 ring-focus`),onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),F(!0))},onDragLeave:()=>F(!1),onDrop:e=>{e.preventDefault(),F(!1),W(Array.from(e.dataTransfer.files).map(y))},children:[D.length?(0,Y.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 px-2 pt-2 pb-1`,children:D.map((e,t)=>{let n=G.get(e),r=()=>O(e=>e.filter((e,n)=>n!==t));return n?(0,Y.jsx)(re,{url:n,label:e.name,children:(0,Y.jsx)(Q,{over:!!n,onClick:r})},`${e.name}-${t}`):(0,Y.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 rounded-full bg-paper-2 py-1 pr-1 pl-2.5 text-[0.8125rem] text-ink-2`,children:[(0,Y.jsx)(ae,{className:`size-3.5 shrink-0 text-ink-4`}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.name}),(0,Y.jsx)(Q,{over:!!n,onClick:r})]},`${e.name}-${t}`)})}):null,(0,Y.jsx)(u,{autoFocus:!0,minRows:4,value:s,onChange:e=>d(e.target.value),onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length&&(e.preventDefault(),W(t.map(y)))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&Z()},placeholder:H.listening?m(`editor.listening`):m(`new.placeholder`),className:`border-0 bg-transparent text-[1rem] shadow-none focus:ring-0`}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-1 pb-1`,children:[(0,Y.jsx)(`button`,{type:`button`,"aria-label":m(`editor.attach`),title:m(`editor.attach`),onClick:()=>z.current?.click(),className:`inline-flex size-10 shrink-0 items-center justify-center rounded-full border border-border text-ink transition hover:bg-paper-2 coarse:size-11`,children:(0,Y.jsx)(o,{className:`size-4`})}),(0,Y.jsx)(`input`,{ref:z,type:`file`,multiple:!0,hidden:!0,onChange:e=>{let t=Array.from(e.target.files??[]);e.target.value=``,W(t)}}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[0.75rem] text-ink-4`,children:P?m(`new.dropHint`):null}),H.supported?(0,Y.jsx)(v,{speech:H}):null,(0,Y.jsxs)(a,{size:`md`,onClick:Z,busy:X.isPending,disabled:!s.trim()||q.isPending,children:[m(`new.build`),` `,(0,Y.jsx)(h,{className:`size-4`})]})]})]}),(0,Y.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-ink-3`,children:m(`new.hint`)}),H.error?(0,Y.jsx)(`p`,{className:`mt-2 px-3 text-[0.75rem] text-rose`,children:H.error===`denied`?m(`editor.micDenied`):H.error}):null,$?(0,Y.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-rose`,children:$.message}):null,n?(0,Y.jsx)(de,{wish:s,projectId:n.id,busy:q.isPending||X.isPending,onTake:e=>!q.isPending&&q.mutate(e.id),onMore:e=>{L({text:e}),R.current?.scrollIntoView({behavior:`smooth`,block:`start`})}}):null]}),(0,Y.jsxs)(`section`,{ref:R,className:`mx-auto max-w-5xl scroll-mt-6`,children:[(0,Y.jsx)(`h2`,{className:`mt-16 mb-5 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:m(`new.orStarter`)}),(0,Y.jsx)(se,{open:i.get(`starter`),search:I,busy:q.isPending,onUse:e=>n&&!q.isPending&&q.mutate(e.id)})]}),(0,Y.jsx)(`div`,{className:`mt-8 flex justify-center`,children:(0,Y.jsx)(le,{variant:`ghost`,label:m(`new.import`)})})]})}export{fe as NewWizardPage};
|
|
7
|
+
or our that the this to want we what which who with would you your`)),G=e=>e.replace(/ß/g,`ss`);function K(e){let t=L(G(e)),n=t.filter(e=>!W.has(e));return n.length?n:t}var q=e=>e.trim().split(/\s+/).filter(Boolean).length>=3,J=e(t(),1),Y=e(n(),1);function le({variant:e=`secondary`,label:t=m(`home.import`)}){let n=x(),r=c(),{project:o}=j(),s=A(),l=(0,J.useRef)(null),u=k({mutationFn:e=>p.upload(`/api/studio/projects/${o.id}/wizards/import`,e),onSuccess:async({id:e})=>{await r.invalidateQueries({queryKey:[`projects`]}),await r.invalidateQueries({queryKey:[`wizards`]}),n(`/edit/${e}`)}}),d=u.error instanceof _?u.error.body?.issues??[]:[];return!s||o?.readOnly?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(a,{variant:e,busy:u.isPending,disabled:!o,onClick:()=>l.current?.click(),children:[(0,Y.jsx)(E,{className:`size-4`}),` `,t]}),(0,Y.jsx)(`input`,{ref:l,hidden:!0,type:`file`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&u.mutate(t)}}),(0,Y.jsxs)(i,{open:u.isError,onClose:u.reset,title:m(`import.failed`),children:[(0,Y.jsx)(`p`,{className:`text-[0.875rem] text-ink-2`,children:u.error?.message}),d.length?(0,Y.jsx)(`ul`,{className:`mt-3 flex list-disc flex-col gap-1 pl-5 text-[0.8125rem] text-ink-2`,children:d.slice(0,8).map(e=>(0,Y.jsx)(`li`,{children:e.message},e.message))}):null,(0,Y.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,Y.jsx)(a,{variant:`secondary`,onClick:u.reset,children:m(`common.close`)})})]})]})}var X=10,Z=3;async function ue(e,t){let n=await fetch(r(`/api/studio/wizards/${e}/files/${encodeURIComponent(t.name)}`),{method:`PUT`,credentials:`include`,headers:{"content-type":t.type||`application/octet-stream`,"accept-language":l},body:t});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??n.statusText)}}function Q({over:e,onClick:t}){return(0,Y.jsx)(`button`,{type:`button`,"aria-label":m(`editor.detach`),onClick:t,className:f(`inline-flex shrink-0 items-center justify-center rounded-full`,e?`-top-1.5 -right-1.5 absolute size-5 bg-ink text-paper shadow-soft coarse:size-7`:`size-5 text-ink-3 hover:bg-paper-3 hover:text-ink coarse:size-7`),children:(0,Y.jsx)(d,{className:`size-3`})})}function $(e,t){let n=K(t);if(!n.length)return[];let r=e.map(e=>({w:e,score:U({title:e.title,summary:e.description},n.join(` `),[[`title`,10],[`summary`,6]])})).filter(e=>e.score>0).sort((e,t)=>t.score-e.score),i=q(t)?(r[0]?.score??0)*.4:0;return r.filter(e=>e.score>=i).slice(0,Z).map(e=>e.w)}function de({wish:e,projectId:t,busy:n,onTake:r,onMore:i}){let o=x(),[c,u]=(0,J.useState)(null),d=O(e.trim(),300),f=g({queryKey:[`wizards`,t,`similar`],queryFn:()=>p.get(`/api/studio/projects/${t}/wizards`)}),h=g({queryKey:[`marketplace`,l,d,`similar`],queryFn:()=>p.get(`/api/studio/marketplace?${new URLSearchParams({lang:l,limit:String(X),offset:`0`,q:d})}`),enabled:d.length>=3,placeholderData:s});if(d.length<3)return null;let _=$(f.data??[],d),v=(h.data?.entries??[]).slice(0,X-_.length),y=(h.data?.total??0)-v.length;if(!(_.length||v.length))return null;let b=`flex items-center gap-3 rounded-xl bg-card py-2 pr-2 pl-3.5 ring-1 ring-border-soft`;return(0,Y.jsxs)(`section`,{className:`mt-5`,children:[(0,Y.jsx)(`h2`,{className:`mb-2 px-1 text-[0.8125rem] text-ink-3`,children:m(`new.similar`)}),(0,Y.jsxs)(`ul`,{className:`flex flex-col gap-1.5`,children:[_.map(e=>(0,Y.jsxs)(`li`,{className:b,children:[(0,Y.jsx)(S,{children:m(`new.yours`)}),(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>o(`/edit/${e.id}`),className:`min-w-0 flex-1 text-left`,children:[(0,Y.jsx)(`span`,{className:`block truncate font-medium text-[0.9375rem]`,children:e.title}),(0,Y.jsx)(`span`,{className:`block truncate text-[0.8125rem] text-ink-3`,children:e.description})]}),(0,Y.jsx)(a,{variant:`secondary`,size:`sm`,onClick:()=>o(`/edit/${e.id}`),children:m(`new.open`)})]},e.id)),v.map(e=>(0,Y.jsxs)(`li`,{className:b,children:[(0,Y.jsx)(S,{children:m(`new.template`)}),(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>u(e.id),className:`min-w-0 flex-1 text-left`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`truncate font-medium text-[0.9375rem]`,children:e.title}),e.plan===`pro`?(0,Y.jsx)(P,{}):null]}),(0,Y.jsx)(`span`,{className:`block truncate text-[0.8125rem] text-ink-3`,children:e.pitch})]}),(0,Y.jsx)(a,{variant:`secondary`,size:`sm`,disabled:n,onClick:()=>r(e),children:m(`new.take`)})]},e.id))]}),y>0?(0,Y.jsx)(`button`,{type:`button`,onClick:()=>i(d),className:`mt-2 px-1 text-[0.875rem] text-ink-2 hover:text-ink coarse:min-h-11`,children:m(`new.more`,{n:y})}):null,(0,Y.jsx)(D,{id:c,fallback:v.find(e=>e.id===c)??null,onClose:()=>u(null),onUse:r,busy:n})]})}function fe(){let e=x(),t=c(),{project:n}=j(),r=A(),[i]=ie(),[s,d]=(0,J.useState)(()=>i.get(`wish`)??M()??``),_=(0,J.useRef)(M()!==null),[S,E]=(0,J.useState)([`steps`]),[D,O]=(0,J.useState)([]),[P,F]=(0,J.useState)(!1),[I,L]=(0,J.useState)(null),R=(0,J.useRef)(null),z=(0,J.useRef)(null),B=(0,J.useRef)(null),[V]=te(),H=ne(s,d,{deviceId:V.deviceId}),U=g({queryKey:[`runners`],queryFn:()=>p.get(`/api/studio/runners`)}),W=e=>{let t=e.map(b);O(e=>[...e.filter(e=>!t.some(t=>t.name===e.name)),...t])},[G,K]=(0,J.useState)(new Map);(0,J.useEffect)(()=>{let e=new Map(D.filter(e=>e.type.startsWith(`image/`)).map(e=>[e,URL.createObjectURL(e)]));return K(e),()=>{for(let t of e.values())URL.revokeObjectURL(t)}},[D]);let q=k({mutationFn:e=>p.post(`/api/studio/wizards`,{projectId:n.id,starterId:e,lang:l}),onSuccess:async({id:n})=>{await t.invalidateQueries({queryKey:[`projects`]}),await t.invalidateQueries({queryKey:[`wizards`]}),e(`/edit/${n}`)}}),X=k({mutationFn:async()=>{let e=B.current??(await p.post(`/api/studio/wizards`,{projectId:n.id,lang:l})).id;B.current=e,C(S)||await p.patch(`/api/studio/wizards/${e}`,{runners:T(S)});for(let t of D)await ue(e,t);return e},onSuccess:async n=>{N(),await t.invalidateQueries({queryKey:[`projects`]}),await t.invalidateQueries({queryKey:[`wizards`]});let r=s.trim();C(S)||(r+=`\n\n${oe(S)}`),D.length&&(r+=`\n\n${m(`editor.attached`)}: ${D.map(e=>e.name).join(`, `)}`),e(`/edit/${n}?prompt=${encodeURIComponent(r)}`)}}),Z=()=>{s.trim()&&n&&!X.isPending&&(H.listening&&H.stop(),X.mutate())};if((0,J.useEffect)(()=>{_.current&&n&&r&&!n.readOnly&&s.trim()&&(_.current=!1,X.mutate())},[n,r,s,X]),!r||n?.readOnly)return(0,Y.jsx)(ee,{to:`/`,replace:!0});let $=X.error??q.error;return(0,Y.jsxs)(`div`,{className:`animate-rise md:pt-4`,children:[(0,Y.jsxs)(`div`,{className:`mx-auto max-w-2xl`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,Y.jsx)(`div`,{className:`size-[84px] md:size-auto`,children:(0,Y.jsx)(`div`,{className:`origin-top-left scale-[0.56] md:scale-100`,children:(0,Y.jsx)(ce,{kind:`sprout`,size:150,fluffy:!0})})}),(0,Y.jsx)(`h1`,{className:`mt-1 font-display font-semibold text-[1.5rem] leading-tight tracking-tight md:mt-2 md:text-[2.375rem]`,children:m(`new.title`)})]}),(0,Y.jsx)(w,{value:S,onChange:E,runners:U.data,className:`mt-4 px-1 md:mt-8`}),(0,Y.jsxs)(`div`,{className:f(`relative mt-3 rounded-2xl bg-card p-2 shadow-elevated ring-1 ring-border-soft focus-within:ring-focus`,P&&`ring-2 ring-focus`),onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),F(!0))},onDragLeave:()=>F(!1),onDrop:e=>{e.preventDefault(),F(!1),W(Array.from(e.dataTransfer.files).map(y))},children:[D.length?(0,Y.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 px-2 pt-2 pb-1`,children:D.map((e,t)=>{let n=G.get(e),r=()=>O(e=>e.filter((e,n)=>n!==t));return n?(0,Y.jsx)(re,{url:n,label:e.name,children:(0,Y.jsx)(Q,{over:!!n,onClick:r})},`${e.name}-${t}`):(0,Y.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 rounded-full bg-paper-2 py-1 pr-1 pl-2.5 text-[0.8125rem] text-ink-2`,children:[(0,Y.jsx)(ae,{className:`size-3.5 shrink-0 text-ink-4`}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.name}),(0,Y.jsx)(Q,{over:!!n,onClick:r})]},`${e.name}-${t}`)})}):null,(0,Y.jsx)(u,{autoFocus:!0,minRows:4,value:s,onChange:e=>d(e.target.value),onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length&&(e.preventDefault(),W(t.map(y)))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&Z()},placeholder:H.listening?m(`editor.listening`):m(`new.placeholder`),className:`border-0 bg-transparent text-[1rem] shadow-none focus:ring-0`}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-1 pb-1`,children:[(0,Y.jsx)(`button`,{type:`button`,"aria-label":m(`editor.attach`),title:m(`editor.attach`),onClick:()=>z.current?.click(),className:`inline-flex size-10 shrink-0 items-center justify-center rounded-full border border-border text-ink transition hover:bg-paper-2 coarse:size-11`,children:(0,Y.jsx)(o,{className:`size-4`})}),(0,Y.jsx)(`input`,{ref:z,type:`file`,multiple:!0,hidden:!0,onChange:e=>{let t=Array.from(e.target.files??[]);e.target.value=``,W(t)}}),H.supported?(0,Y.jsx)(v,{speech:H,labelled:!0}):null,(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[0.75rem] text-ink-4`,children:P?m(`new.dropHint`):null}),(0,Y.jsxs)(a,{size:`md`,onClick:Z,busy:X.isPending,disabled:!s.trim()||q.isPending,children:[m(`new.build`),` `,(0,Y.jsx)(h,{className:`size-4`})]})]})]}),(0,Y.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-ink-3`,children:m(`new.hint`)}),H.error?(0,Y.jsx)(`p`,{className:`mt-2 px-3 text-[0.75rem] text-rose`,children:H.error===`denied`?m(`editor.micDenied`):H.error}):null,$?(0,Y.jsx)(`p`,{className:`mt-3 text-center text-[0.875rem] text-rose`,children:$.message}):null,n?(0,Y.jsx)(de,{wish:s,projectId:n.id,busy:q.isPending||X.isPending,onTake:e=>!q.isPending&&q.mutate(e.id),onMore:e=>{L({text:e}),R.current?.scrollIntoView({behavior:`smooth`,block:`start`})}}):null]}),(0,Y.jsxs)(`section`,{ref:R,className:`mx-auto max-w-5xl scroll-mt-6`,children:[(0,Y.jsx)(`h2`,{className:`mt-16 mb-5 text-center font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.08em]`,children:m(`new.orStarter`)}),(0,Y.jsx)(se,{open:i.get(`starter`),search:I,busy:q.isPending,onUse:e=>n&&!q.isPending&&q.mutate(e.id)})]}),(0,Y.jsx)(`div`,{className:`mt-8 flex justify-center`,children:(0,Y.jsx)(le,{variant:`ghost`,label:m(`new.import`)})})]})}export{fe as NewWizardPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Gr as r,Gt as i,Ut as a,W as o,Yt as s,ar as c,gr as ee,nr as l,qn as te}from"./ui-CeZNNuaK.js";import{t as u}from"./upload-CcKFwoPd.js";import{V as ne,Zt as d,gt as f,mt as re,ot as ie,rt as ae,ut as oe,yt as p}from"./index-93fPRTxr.js";var m=e(t(),1),h=e(n(),1),g=`oklch(50% 0.2 262)`,_=`oklch(32% 0.15 262)`,se={"--on":`white`,"--dot":`oklch(90% 0.1 80)`,"--ink-2":`oklch(96% 0.02 262)`,"--ink-3":`oklch(90% 0.035 262)`,"--moss":`oklch(90% 0.14 150)`,"--rose":`oklch(89% 0.09 45)`},v=`w-full rounded-[18px] border border-white/30 bg-white/15 px-6 py-5 text-[1.375rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function ce(){return(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-2.5`,children:[(0,h.jsx)(p,{size:28}),(0,h.jsxs)(`span`,{className:`font-display font-semibold text-[1.0625rem] tracking-tight`,children:[`engenty`,(0,h.jsx)(`span`,{className:`mr-[0.09em] ml-[0.06em] text-(color:--dot)`,children:`.`}),(0,h.jsx)(`span`,{className:`font-normal text-white/70`,children:`wizards`})]})]})}function y({children:e,busy:t,onClick:n,type:r=`button`}){return(0,h.jsxs)(`button`,{type:r,disabled:t,onClick:n,className:`inline-flex h-13 cursor-pointer items-center gap-2.5 rounded-full bg-white px-7 font-semibold text-[1rem] transition hover:bg-white/90 disabled:cursor-default disabled:opacity-70`,style:{color:_},children:[e,(0,h.jsx)(c,{className:`size-[18px]`})]})}function b({children:e,onClick:t}){return(0,h.jsx)(`button`,{type:`button`,onClick:t,className:`cursor-pointer font-semibold text-[0.9375rem] text-white/85 transition hover:text-white`,children:e})}function x({step:e}){return(0,h.jsx)(`span`,{className:`ml-auto inline-flex gap-1.5`,role:`img`,"aria-label":s(`onboard.step`,{n:e}),children:[1,2,3,4].map(t=>(0,h.jsx)(`span`,{className:a(`size-2 rounded-full`,t===e?`bg-white`:`bg-white/40`)},t))})}var S=[{kind:`personal`,label:`onboard.kindPersonal`,sub:`onboard.kindPersonalSub`},{kind:`club`,label:`onboard.kindClub`,sub:`onboard.kindClubSub`},{kind:`small`,label:`onboard.kindSmall`,sub:`onboard.kindSmallSub`},{kind:`corp`,label:`onboard.kindCorp`,sub:`onboard.kindCorpSub`}],C=new Set([`gmail.com`,`googlemail.com`,`gmx.at`,`gmx.de`,`gmx.net`,`web.de`,`outlook.com`,`hotmail.com`,`live.com`,`icloud.com`,`me.com`,`yahoo.com`,`yahoo.de`,`aon.at`,`a1.net`,`chello.at`,`t-online.de`,`proton.me`,`protonmail.com`]);function le(e){let t=(e.split(`@`)[1]??``).trim().toLowerCase();return t?C.has(t)?{kind:`personal`,domain:t}:/(verein|club|klub|^sv-|^fc-|^ff-|feuerwehr|musik|chor)/.test(t)?{kind:`club`,domain:t}:{kind:`small`,domain:t}:{kind:null,domain:t}}var w={club:[`0-50`,`50-250`,`250-1000`,`1000+`],small:[`1`,`2-9`,`10-49`],corp:[`50-249`,`250-999`,`1000+`]},T=e=>Number(e).toLocaleString(i),E=e=>{if(e===`1`)return s(`onboard.justMe`);if(e.endsWith(`+`))return`${T(e.slice(0,-1))}+`;let[t,n]=e.split(`-`);return t===`0`?`≤ ${T(n)}`:`${T(t)}–${T(n)}`},ue=[`sport`,`culture`,`social`,`education`,`environment`,`rescue`,`other`],de=[`chair`,`board`,`treasurer`,`secretary`,`member`],fe=[`management`,`it`,`marketing`,`sales`,`operations`,`other`],D=`w-full rounded-[14px] border border-white/30 bg-white/15 px-4 py-3 text-[1.0625rem] text-white outline-none placeholder:text-white/55 focus:border-white/60`;function O({picked:e,label:t,sub:n,onClick:r}){return(0,h.jsxs)(`button`,{type:`button`,"aria-pressed":e,onClick:r,className:a(`flex cursor-pointer flex-col gap-1 rounded-[18px] border px-5 py-4 text-left transition`,e?`border-white bg-white/25`:`border-white/30 bg-white/10 hover:bg-white/15`),children:[(0,h.jsx)(`span`,{className:`font-display font-semibold text-[1.125rem]`,children:t}),(0,h.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:n})]})}function k({label:e,options:t,value:n,text:r,onChange:i}){return(0,h.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,h.jsx)(`legend`,{className:`mb-2 text-[0.9375rem] text-white/85`,children:e}),(0,h.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,h.jsx)(`button`,{type:`button`,"aria-pressed":n===e,onClick:()=>i(e),className:a(`cursor-pointer rounded-full border px-4 py-2 text-[0.9375rem] transition`,n===e?`border-white bg-white`:`border-white/30 hover:bg-white/15`),style:n===e?{color:_}:void 0,children:r(e)},e))})]})}function A(){f(g);let e=oe(),t=r(),n=ee(),{project:i}=ie(),[c,p]=(0,m.useState)(1),[T,A]=(0,m.useState)(``),[j,M]=(0,m.useState)(``),[N,P]=(0,m.useState)(null),[F,pe]=(0,m.useState)(null),[I,L]=(0,m.useState)([]),R=(0,m.useRef)(null),[z]=(0,m.useState)(ae),[B,V]=(0,m.useState)(`kind`),[H]=(0,m.useState)(()=>le(e.data?.user.email??``)),[U,me]=(0,m.useState)({kind:H.kind,size:null,sector:``,role:null,need:``,legalName:``,phone:``}),W=e=>me(t=>({...t,...e})),G=d({mutationFn:e=>o.put(`/api/studio/team/profile`,{kind:U.kind,size:U.size,sector:U.sector.trim()||null,role:U.role,need:U.need.trim()||null,legalName:U.legalName.trim()||null,phone:U.phone.trim()||null,website:e?.trim()||null})}),K=()=>{!j&&H.domain&&U.kind!==`personal`&&!C.has(H.domain)&&M(H.domain),p(2)},q=d({mutationFn:e=>o.put(`/api/studio/team`,{name:e}),onSuccess:()=>t.invalidateQueries({queryKey:[`team`]})}),J=d({mutationFn:e=>o.post(`/api/studio/projects/${i?.id}/website`,{url:e}),onSuccess:async e=>{pe(e),await t.invalidateQueries({queryKey:[`projects`]})}}),Y=d({mutationFn:e=>o.patch(`/api/studio/projects/${i?.id}`,{brand:{about:e}}),onSuccess:()=>t.invalidateQueries({queryKey:[`projects`]})}),X=d({mutationFn:()=>o.post(`/api/studio/onboarding/done`),onSuccess:async()=>{await t.invalidateQueries({queryKey:[`me`]}),n(`/new`,{replace:!0})}}),Z=e.data?.user.name??``,Q=Z.includes(`@`)?``:Z.split(` `)[0],$=async e=>{if(e&&i){for(let t of Array.from(e)){L(e=>[...e,{name:t.name,state:`uploading`}]);try{await o.upload(`/api/studio/projects/${i.id}/files?kind=document`,t),L(e=>e.map(e=>e.name===t.name?{...e,state:`done`}:e))}catch{L(e=>e.map(e=>e.name===t.name?{...e,state:`failed`}:e))}}await t.invalidateQueries({queryKey:[`projects`]})}},he=F?[F.about?s(`onboard.readAbout`):``,F.colors?s(`onboard.readColors`,{n:F.colors}):``,F.logo?s(`onboard.readLogo`):``].join(``):``;return(0,h.jsxs)(`div`,{className:`flex min-h-dvh flex-col px-6 text-white sm:px-10`,style:{...se,background:g},children:[(0,h.jsxs)(`header`,{className:`flex items-center justify-between pt-6 sm:pt-8`,children:[(0,h.jsx)(ce,{}),(0,h.jsx)(ne,{tone:`ground`,ink:_})]}),(0,h.jsxs)(`main`,{className:`mx-auto grid w-full max-w-6xl flex-1 items-center gap-10 py-10 lg:grid-cols-[5fr_7fr] lg:gap-12`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-8 max-lg:order-first`,children:[(0,h.jsx)(re,{kind:`drop`,size:240,fluffy:!0,coat:`fur`}),z?(0,h.jsxs)(`figure`,{className:`w-full max-w-sm rounded-[18px] bg-white/15 px-5 py-4`,children:[(0,h.jsx)(`figcaption`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:s(`onboard.wish`)}),(0,h.jsx)(`blockquote`,{className:`mt-1.5 line-clamp-6 whitespace-pre-line break-words text-[1rem] leading-relaxed`,children:z}),(0,h.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-white/75`,children:s(`onboard.wishNext`)})]}):null]}),(0,h.jsxs)(`div`,{className:`flex min-w-0 max-w-2xl animate-rise flex-col gap-5`,children:[c===1&&B===`kind`?(0,h.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),U.kind&&V(`details`)},children:[(0,h.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:Q?s(`onboard.kicker1`,{name:Q}):s(`onboard.kicker1Anon`)}),(0,h.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.kind`)}),(0,h.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.kindSub`)}),H.kind?(0,h.jsx)(`p`,{className:`text-[0.9375rem] text-white/80`,children:s(`onboard.guess`,{domain:H.domain,kind:s(S.find(e=>e.kind===H.kind)?.label??`onboard.kindSmall`)})}):null,(0,h.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:S.map(e=>(0,h.jsx)(O,{picked:U.kind===e.kind,label:s(e.label),sub:s(e.sub),onClick:()=>W({kind:e.kind,size:e.kind===U.kind?U.size:null})},e.kind))}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,h.jsx)(y,{type:`submit`,children:s(`onboard.continue`)}),(0,h.jsx)(x,{step:1})]})]}):null,c===1&&B===`details`&&U.kind?(0,h.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),G.mutate(void 0),U.kind===`corp`&&U.legalName.trim()&&!T&&A(U.legalName.trim()),V(`team`)},children:[(0,h.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:Q?s(`onboard.kicker1`,{name:Q}):s(`onboard.kicker1Anon`)}),(0,h.jsx)(`h1`,{className:`font-display font-bold text-[2.25rem] leading-[1.05] tracking-[-0.02em] sm:text-[2.75rem]`,children:s(U.kind===`personal`?`onboard.personalTitle`:U.kind===`club`?`onboard.clubTitle`:`onboard.businessTitle`)}),U.kind===`personal`?(0,h.jsx)(`textarea`,{value:U.need,onChange:e=>W({need:e.target.value}),placeholder:s(`onboard.personalPlaceholder`),rows:3,maxLength:2e3,"aria-label":s(`onboard.personalTitle`),className:a(v,`resize-none text-[1.125rem] leading-relaxed`)}):null,U.kind===`club`?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{label:s(`onboard.clubKind`),options:ue,value:U.sector,text:e=>s(`onboard.club.${e}`),onChange:e=>W({sector:e})}),(0,h.jsx)(k,{label:s(`onboard.members`),options:w.club,value:U.size,text:E,onChange:e=>W({size:e})}),(0,h.jsx)(k,{label:s(`onboard.yourRole`),options:de,value:U.role,text:e=>s(`onboard.role.${e}`),onChange:e=>W({role:e})})]}):null,U.kind===`small`?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{label:s(`onboard.people`),options:w.small,value:U.size,text:E,onChange:e=>W({size:e})}),(0,h.jsxs)(`label`,{className:`flex flex-col gap-2 text-[0.9375rem] text-white/85`,children:[s(`onboard.sector`),(0,h.jsx)(`input`,{value:U.sector,onChange:e=>W({sector:e.target.value}),placeholder:s(`onboard.sectorPlaceholder`),maxLength:120,className:D})]}),(0,h.jsxs)(`label`,{className:`flex flex-col gap-2 text-[0.9375rem] text-white/85`,children:[(0,h.jsxs)(`span`,{children:[s(`onboard.need`),` `,(0,h.jsx)(`span`,{className:`text-white/60`,children:s(`onboard.optional`)})]}),(0,h.jsx)(`textarea`,{value:U.need,onChange:e=>W({need:e.target.value}),placeholder:s(`onboard.needPlaceholder`),rows:2,maxLength:2e3,className:a(D,`resize-none`)})]})]}):null,U.kind===`corp`?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{label:s(`onboard.people`),options:w.corp,value:U.size,text:E,onChange:e=>W({size:e})}),(0,h.jsx)(k,{label:s(`onboard.yourRole`),options:fe,value:U.role,text:e=>s(`onboard.role.${e}`),onChange:e=>W({role:e})}),(0,h.jsxs)(`label`,{className:`flex flex-col gap-2 text-[0.9375rem] text-white/85`,children:[s(`onboard.legalName`),(0,h.jsx)(`input`,{value:U.legalName,onChange:e=>W({legalName:e.target.value}),placeholder:s(`onboard.legalNamePlaceholder`),maxLength:200,autoComplete:`organization`,className:D})]}),(0,h.jsxs)(`label`,{className:`flex flex-col gap-2 text-[0.9375rem] text-white/85`,children:[(0,h.jsxs)(`span`,{children:[s(`onboard.phone`),` `,(0,h.jsx)(`span`,{className:`text-white/60`,children:s(`onboard.phoneWhy`)})]}),(0,h.jsx)(`input`,{type:`tel`,value:U.phone,onChange:e=>W({phone:e.target.value.replace(/[^+0-9 ()/.-]/g,``)}),placeholder:`+43 …`,maxLength:40,autoComplete:`tel`,className:D})]})]}):null,(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,h.jsx)(y,{type:`submit`,busy:G.isPending,children:s(`onboard.continue`)}),(0,h.jsx)(b,{onClick:()=>V(`kind`),children:s(`onboard.back`)}),(0,h.jsx)(x,{step:1})]})]}):null,c===1&&B===`team`?(0,h.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=T.trim();t?q.mutate(t,{onSuccess:K}):K()},children:[(0,h.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:Q?s(`onboard.kicker1`,{name:Q}):s(`onboard.kicker1Anon`)}),(0,h.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.team`)}),(0,h.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.teamSub`)}),(0,h.jsx)(`input`,{value:T,onChange:e=>A(e.target.value),placeholder:s(`onboard.teamPlaceholder`),maxLength:80,"aria-label":s(`onboard.team`),className:v}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,h.jsx)(y,{type:`submit`,busy:q.isPending,children:s(`onboard.continue`)}),(0,h.jsx)(x,{step:1})]})]}):null,c===2?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:s(`onboard.kicker2`)}),(0,h.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.site`)}),(0,h.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.siteSub`)}),N===null?(0,h.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=j.trim();if(t&&!J.isPending){if(U.kind&&G.mutate(t),!t.includes(`.`)){p(3);return}J.mutate(t)}},children:[(0,h.jsx)(`input`,{value:j,onChange:e=>M(e.target.value),placeholder:s(`onboard.sitePlaceholder`),autoCapitalize:`none`,"aria-label":s(`onboard.site`),className:v}),(0,h.jsx)(`p`,{className:`-mt-2 text-[0.875rem] text-white/75`,children:s(`onboard.siteNameHint`)}),F?(0,h.jsxs)(`p`,{className:`flex items-center gap-2 text-[0.9375rem] text-(color:--moss)`,children:[(0,h.jsx)(l,{className:`size-4`}),s(`onboard.readDone`,{name:F.name,details:he})]}):J.isError?(0,h.jsx)(`p`,{className:`text-[0.9375rem] text-(color:--rose)`,children:s(`onboard.readFailed`)}):null,(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[F?(0,h.jsx)(y,{onClick:()=>p(3),children:s(`onboard.continue`)}):(0,h.jsx)(y,{type:`submit`,busy:J.isPending,children:J.isPending?s(`onboard.reading`):s(`onboard.read`)}),(0,h.jsx)(b,{onClick:()=>P(``),children:s(`onboard.line`)}),(0,h.jsx)(b,{onClick:()=>p(3),children:s(`onboard.skip`)}),(0,h.jsx)(x,{step:2})]})]}):(0,h.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault();let t=N.trim();t?Y.mutate(t,{onSuccess:()=>p(3)}):p(3)},children:[(0,h.jsx)(`textarea`,{value:N,onChange:e=>P(e.target.value),placeholder:s(`onboard.linePlaceholder`),rows:3,maxLength:8e3,"aria-label":s(`onboard.line`),className:a(v,`resize-none text-[1.125rem] leading-relaxed`)}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,h.jsx)(y,{type:`submit`,busy:Y.isPending,children:s(`onboard.continue`)}),(0,h.jsx)(b,{onClick:()=>P(null),children:s(`onboard.site`)}),(0,h.jsx)(b,{onClick:()=>p(3),children:s(`onboard.skip`)}),(0,h.jsx)(x,{step:2})]})]})]}):null,c===3?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:s(`onboard.kicker3`)}),(0,h.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.know`)}),(0,h.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.knowSub`)}),(0,h.jsxs)(`button`,{type:`button`,onClick:()=>R.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),$(e.dataTransfer.files)},className:`flex cursor-pointer flex-col items-center gap-2 rounded-[18px] border-2 border-white/45 border-dashed bg-white/10 px-6 py-7 text-center transition hover:bg-white/15`,children:[(0,h.jsx)(u,{className:`size-7`}),(0,h.jsx)(`span`,{className:`font-semibold text-[1.0625rem]`,children:s(`onboard.drop`)}),(0,h.jsx)(`span`,{className:`text-[0.875rem] text-white/80`,children:`PDF · Word · Excel · Markdown`}),(0,h.jsx)(`input`,{ref:R,type:`file`,multiple:!0,className:`sr-only`,onChange:e=>{$(e.target.files),e.target.value=``}})]}),I.length?(0,h.jsx)(`ul`,{className:`flex flex-col gap-2`,children:I.map(e=>(0,h.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-xl bg-white/15 px-3.5 py-2.5 text-[0.875rem]`,children:[(0,h.jsx)(te,{className:`size-4 shrink-0`}),(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),(0,h.jsx)(`span`,{className:a(`text-white/80`,e.state===`failed`?`text-(color:--rose)`:``),children:e.state===`uploading`?s(`onboard.uploading`):e.state===`done`?s(`onboard.uploaded`):s(`onboard.uploadFailed`)})]},e.name))}):null,(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,h.jsx)(y,{busy:I.some(e=>e.state===`uploading`),onClick:()=>p(4),children:s(`onboard.continue`)}),I.length?null:(0,h.jsx)(b,{onClick:()=>p(4),children:s(`onboard.skip`)}),(0,h.jsx)(x,{step:3})]})]}):null,c===4?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`p`,{className:`font-medium text-[0.75rem] text-white/85 uppercase tracking-[0.14em]`,children:s(`onboard.kicker4`)}),(0,h.jsx)(`h1`,{className:`font-display font-bold text-[2.5rem] leading-[1.05] tracking-[-0.02em] sm:text-[3.25rem]`,children:s(`onboard.space`)}),(0,h.jsx)(`p`,{className:`text-[1.0625rem] text-white/90 leading-relaxed`,children:s(`onboard.spaceSub`,{space:i?.name??``})}),(0,h.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[[`partInfo`,`partInfoText`,!!(F||N)],[`partKnow`,`partKnowText`,I.some(e=>e.state===`done`)],[`partData`,`partDataText`,!1],[`partResults`,`partResultsText`,!1]].map(([e,t,n])=>(0,h.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-2xl border border-white/20 bg-white/10 px-4.5 py-4`,children:[(0,h.jsxs)(`span`,{className:`flex items-center gap-2 font-semibold text-[1rem]`,children:[n?(0,h.jsx)(l,{className:`size-4 text-(color:--moss)`}):null,s(`onboard.${e}`)]}),(0,h.jsx)(`span`,{className:`text-[0.84375rem] text-white/85 leading-snug`,children:s(`onboard.${t}`)})]},e))}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5`,children:[(0,h.jsx)(y,{busy:X.isPending,onClick:()=>X.mutate(),children:s(`onboard.build`)}),(0,h.jsx)(x,{step:4})]})]}):null]},`${c}-${B}`)]}),(0,h.jsxs)(`footer`,{className:`mx-auto flex w-full max-w-6xl items-center justify-between pb-6 text-[0.75rem] text-white/55 sm:pb-8`,children:[(0,h.jsx)(`span`,{children:`engenty.wizards`}),(0,h.jsx)(`span`,{"aria-hidden":`true`,className:`size-[3px] bg-(color:--dot)`})]})]})}export{A as OnboardingPage};
|