@cartanova/qgrid-cli 2.16.0 → 2.17.1

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 (40) hide show
  1. package/bundle/dist/application/qgrid/qgrid.frame.js +76 -26
  2. package/bundle/dist/application/qgrid/qgrid.types.js +11 -3
  3. package/bundle/dist/utils/providers/common/model-cost.js +48 -2
  4. package/bundle/dist/utils/providers/grok/grok-types.js +8 -2
  5. package/bundle/dist/utils/providers/grok/grok-voice-client.js +4 -4
  6. package/bundle/dist/utils/speech-alignment.js +129 -0
  7. package/bundle/src/application/qgrid/qgrid.frame.test.ts +85 -10
  8. package/bundle/src/application/qgrid/qgrid.frame.ts +95 -33
  9. package/bundle/src/application/qgrid/qgrid.types.ts +17 -2
  10. package/bundle/src/utils/providers/common/model-cost.test.ts +14 -0
  11. package/bundle/src/utils/providers/common/model-cost.ts +57 -0
  12. package/bundle/src/utils/providers/grok/grok-types.ts +15 -10
  13. package/bundle/src/utils/providers/grok/grok-voice-client.ts +4 -4
  14. package/bundle/src/utils/speech-alignment.test.ts +72 -0
  15. package/bundle/src/utils/speech-alignment.ts +178 -0
  16. package/bundle/web-dist/client/assets/TimedPlayer-cuEgYA3Q.js +1 -0
  17. package/bundle/web-dist/client/assets/index-Co8uAhSV.css +1 -0
  18. package/bundle/web-dist/client/assets/{index-SGfYBzGT.js → index-D56cIqxW.js} +3 -3
  19. package/bundle/web-dist/client/assets/{logs-DrTz38re.js → logs-pMW62Hvw.js} +1 -1
  20. package/bundle/web-dist/client/assets/{monit-klIY-HEI.js → monit-COC4S7gf.js} +1 -1
  21. package/bundle/web-dist/client/assets/{routes-bGN3y2NW.js → routes-C38qmify.js} +1 -1
  22. package/bundle/web-dist/client/assets/{settings-BHwEvAZL.js → settings-BWGSVpiQ.js} +1 -1
  23. package/bundle/web-dist/client/assets/show-aQTLNz5k.js +2 -0
  24. package/bundle/web-dist/client/assets/{tokens-DMWMG9O5.js → tokens-Ha8SwMPG.js} +1 -1
  25. package/bundle/web-dist/client/assets/{use-oauth-login-flow-D1v4h9zA.js → use-oauth-login-flow-JoEnKQis.js} +1 -1
  26. package/bundle/web-dist/client/assets/{use-update-token-mutation-BVBUlqBN.js → use-update-token-mutation-cdCVcOY5.js} +1 -1
  27. package/bundle/web-dist/client/assets/voice-COmvUTZO.js +1 -0
  28. package/bundle/web-dist/client/index.html +2 -2
  29. package/bundle/web-dist/server/assets/TimedPlayer-DAwjkP4z.js +54 -0
  30. package/bundle/web-dist/server/assets/{show-D8r2sVK0.js → show-B_l5dOcT.js} +43 -8
  31. package/bundle/web-dist/server/assets/{voice-C2HfwkGp.js → voice-CHoPEIfo.js} +76 -68
  32. package/bundle/web-dist/server/entry-server.generated.js +3 -3
  33. package/package.json +1 -1
  34. package/skills/qgrid/references/ai-sdk-provider-contract.md +1 -1
  35. package/skills/qgrid/references/grok-runtime.md +5 -1
  36. package/skills/qgrid/references/request-log-run-lifecycle.md +2 -0
  37. package/skills/qgrid/references/sonamu-api-web-flow.md +2 -2
  38. package/bundle/web-dist/client/assets/index-DyrPRt6O.css +0 -1
  39. package/bundle/web-dist/client/assets/show-BiJkyrfB.js +0 -2
  40. package/bundle/web-dist/client/assets/voice-CwD3asSF.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{N as r}from"./vendor-tanstack-6B86itGS.js";import{t as i}from"./clsx-DB0hHKMi.js";import{o as a,u as o}from"./index-SGfYBzGT.js";var s=e(t(),1),c=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},l=(e,t)=>({classGroupId:e,validator:t}),u=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),d=`-`,f=[],p=`arbitrary..`,m=e=>{let t=_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return g(e);let n=e.split(d);return h(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?c(i,t):t:i||f}return n[e]||f}}},h=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=h(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(d):e.slice(t).join(d),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},g=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?p+r:void 0})(),_=e=>{let{theme:t,classGroups:n}=e;return v(n,t)},v=(e,t)=>{let n=u();for(let r in e){let i=e[r];y(i,n,r,t)}return n},y=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];b(i,t,n,r)}},b=(e,t,n,r)=>{typeof e==`string`?x(e,t,n):typeof e==`function`?S(e,t,n,r):C(e,t,n,r)},x=(e,t,n)=>{let r=e===``?t:w(t,e);r.classGroupId=n},S=(e,t,n,r)=>{T(e)?y(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(l(n,e)))},C=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];y(o,w(t,a),n,r)}},w=(e,t)=>{let n=e,r=t.split(d),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=u(),n.nextPart.set(t,i)),n=i}return n},T=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ee=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},E=`!`,D=`:`,te=[],O=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),k=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===D){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(E)?(c=s.slice(0,-1),l=!0):s.startsWith(E)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return O(t,l,c,u)};if(t){let e=t+D,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):O(te,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},A=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},j=e=>({cache:ee(e.cacheSize),parseClassName:k(e),sortModifiers:A(e),postfixLookupClassGroupIds:ne(e),...m(e)}),ne=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},re=/\s+/,M=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(re),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+E:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},ie=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ae(n))&&(i&&(i+=` `),i+=r);return i},ae=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ae(e[r]))&&(n&&(n+=` `),n+=t);return n},oe=(e,...t)=>{let n,r,i,a,o=o=>(n=j(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=M(e,n);return i(e,a),a};return a=o,(...e)=>a(ie(...e))},N=[],P=e=>{let t=t=>t[e]||N;return t.isThemeGetter=!0,t.themeKey=e,t},F=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,L=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,se=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,R=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ce=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,B=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,V=e=>L.test(e),H=e=>!!e&&!Number.isNaN(Number(e)),U=e=>!!e&&Number.isInteger(Number(e)),le=e=>e.endsWith(`%`)&&H(e.slice(0,-1)),W=e=>se.test(e),ue=()=>!0,G=e=>R.test(e)&&!ce.test(e),K=()=>!1,de=e=>z.test(e),fe=e=>B.test(e),pe=e=>!q(e)&&!Y(e),me=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),he=e=>Z(e,Ae,K),q=e=>F.test(e),J=e=>Z(e,je,G),ge=e=>Z(e,Me,H),_e=e=>Z(e,Pe,ue),ve=e=>Z(e,Ne,K),ye=e=>Z(e,Oe,K),be=e=>Z(e,ke,fe),xe=e=>Z(e,Fe,de),Y=e=>I.test(e),X=e=>Q(e,je),Se=e=>Q(e,Ne),Ce=e=>Q(e,Oe),we=e=>Q(e,Ae),Te=e=>Q(e,ke),Ee=e=>Q(e,Fe,!0),De=e=>Q(e,Pe,!0),Z=(e,t,n)=>{let r=F.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=I.exec(e);return r?r[1]?t(r[1]):n:!1},Oe=e=>e===`position`||e===`percentage`,ke=e=>e===`image`||e===`url`,Ae=e=>e===`length`||e===`size`||e===`bg-size`,je=e=>e===`length`,Me=e=>e===`number`,Ne=e=>e===`family-name`,Pe=e=>e===`number`||e===`weight`,Fe=e=>e===`shadow`,Ie=oe(()=>{let e=P(`color`),t=P(`font`),n=P(`text`),r=P(`font-weight`),i=P(`tracking`),a=P(`leading`),o=P(`breakpoint`),s=P(`container`),c=P(`spacing`),l=P(`radius`),u=P(`shadow`),d=P(`inset-shadow`),f=P(`text-shadow`),p=P(`drop-shadow`),m=P(`blur`),h=P(`perspective`),g=P(`aspect`),_=P(`ease`),v=P(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,q,c],T=()=>[V,`full`,`auto`,...w()],ee=()=>[U,`none`,`subgrid`,Y,q],E=()=>[`auto`,{span:[`full`,U,Y,q]},U,Y,q],D=()=>[U,`auto`,Y,q],te=()=>[`auto`,`min`,`max`,`fr`,Y,q],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[V,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[s,V,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[V,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,Y,q],ie=()=>[...b(),Ce,ye,{position:[Y,q]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,we,he,{size:[Y,q]}],N=()=>[le,X,J],F=()=>[``,`none`,`full`,l,Y,q],I=()=>[``,H,X,J],L=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[H,le,Ce,ye],ce=()=>[``,`none`,m,Y,q],z=()=>[`none`,H,Y,q],B=()=>[`none`,H,Y,q],G=()=>[H,Y,q],K=()=>[V,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[W],breakpoint:[W],color:[ue],container:[W],"drop-shadow":[W],ease:[`in`,`out`,`in-out`],font:[pe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[W],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[W],shadow:[W],spacing:[`px`,H],text:[W],"text-shadow":[W],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,V,q,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,q]}],"container-named":[me],columns:[{columns:[H,`auto`,q,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[U,`auto`,Y,q]}],basis:[{basis:[V,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[H,V,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,H,Y,q]}],shrink:[{shrink:[``,H,Y,q]}],order:[{order:[U,`first`,`last`,`none`,Y,q]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...j()]}],"font-size":[{text:[`base`,n,X,J]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,De,_e]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,le,q]}],"font-family":[{font:[Se,ve,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,q]}],"line-clamp":[{"line-clamp":[H,`none`,Y,ge]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Y,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[H,`from-font`,`auto`,Y,J]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[H,`auto`,Y,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[U,Y,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},U,Y,q],radial:[``,Y,q],conic:[``,U,Y,q]},Te,be]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[H,Y,q]}],"outline-w":[{outline:[``,H,X,J]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`inner`,`none`,u,Ee,xe]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ee,xe]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[H,J]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,Ee,xe]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[H,Y,q]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Y,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,q]}],filter:[{filter:[``,`none`,Y,q]}],blur:[{blur:ce()}],brightness:[{brightness:[H,Y,q]}],contrast:[{contrast:[H,Y,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ee,xe]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,H,Y,q]}],"hue-rotate":[{"hue-rotate":[H,Y,q]}],invert:[{invert:[``,H,Y,q]}],saturate:[{saturate:[H,Y,q]}],sepia:[{sepia:[``,H,Y,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,q]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[H,Y,q]}],"backdrop-contrast":[{"backdrop-contrast":[H,Y,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,H,Y,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,Y,q]}],"backdrop-invert":[{"backdrop-invert":[``,H,Y,q]}],"backdrop-opacity":[{"backdrop-opacity":[H,Y,q]}],"backdrop-saturate":[{"backdrop-saturate":[H,Y,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,H,Y,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[H,`initial`,Y,q]}],ease:[{ease:[`linear`,`initial`,_,Y,q]}],delay:[{delay:[H,Y,q]}],animate:[{animate:[`none`,v,Y,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":[`scale-3d`],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[Y,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":[`translate-none`],zoom:[{zoom:[U,Y,q]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,q]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[H,X,J,ge]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Le(...e){return Ie(i(e))}var $=n(),Re=(0,s.forwardRef)(({title:e,titleId:t,...n},r)=>(0,$.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,$.jsx)(`title`,{id:t,children:e}):null,(0,$.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M18 6L6 18M6 6l12 12`})]}));new Map(Object.entries({Æ:`Ae`,Ð:`D`,Ø:`O`,Þ:`Th`,ß:`ss`,æ:`ae`,ð:`d`,ø:`o`,þ:`th`,Đ:`D`,đ:`d`,Ħ:`H`,ħ:`h`,ı:`i`,IJ:`IJ`,ij:`ij`,ĸ:`k`,Ŀ:`L`,ŀ:`l`,Ł:`L`,ł:`l`,ʼn:`'n`,Ŋ:`N`,ŋ:`n`,Œ:`Oe`,œ:`oe`,Ŧ:`T`,ŧ:`t`,ſ:`s`}));function ze(e){return typeof e==`function`}var Be=s.forwardRef(({className:e,type:t,onValueChange:n,onChange:r,clearable:i=!1,...a},o)=>{let c=s.useRef(null),l=s.useCallback(e=>{c.current=e,ze(o)?o(e):o&&(o.current=e)},[o]),u=a.value!==void 0,[d,f]=s.useState(()=>String(a.defaultValue??``).length>0),p=u?String(a.value??``).length>0:d,m=e=>{u||f(e.target.value.length>0),n?.(e.target.value),r?.(e)},h=()=>{let e=c.current;e&&((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus()),u||f(!1)},g=i&&p&&!a.disabled&&!a.readOnly,_=(0,$.jsx)(`input`,{type:t,"data-slot":`input`,className:Le(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,i&&`pr-8`,e),ref:l,...a,onChange:m});return i?(0,$.jsxs)(`div`,{className:`relative w-full`,children:[_,g&&(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":`Clear`,onMouseDown:e=>e.preventDefault(),onClick:h,className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground opacity-60 hover:opacity-100 transition-opacity cursor-pointer`,children:(0,$.jsx)(Re,{className:`h-4 w-4`})})]}):_});Be.displayName=`Input`;var Ve={openai:`새 탭에서 OpenAI 로그인을 완료한 뒤 연결 실패 화면이 나타나면, 주소창의 전체 URL을 아래에 붙여넣으세요.`,anthropic:`새 탭에서 Claude 로그인을 완료하면 코드가 표시됩니다. 코드 전체를 아래에 붙여넣으세요.`,grok:`새 탭에서 xAI(auth.x.ai) 로그인을 완료하면 127.0.0.1 주소로 이동하며 페이지가 열리지 않습니다. 주소창의 전체 URL(또는 그 안의 code 값)을 아래에 붙여넣으세요.`},He={openai:`http://localhost:1455/auth/callback?code=...&state=...`,anthropic:`code#state`,grok:`http://127.0.0.1:.../callback?code=...&state=...`};function Ue({provider:e,isPending:t,isError:n,onSubmit:r,onRestart:i}){let[a,o]=(0,s.useState)(``);return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`p`,{className:`text-[12px] text-sand-600 leading-relaxed`,children:Ve[e]}),(0,$.jsx)(Be,{value:a,onChange:e=>o(e.target.value),placeholder:He[e],className:`w-full border border-sand-200 rounded-md px-3 py-2 text-sm font-mono text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`}),n&&(0,$.jsx)(`p`,{className:`text-[11px] text-red-500`,children:`인증 결과 확인에 실패했습니다 — 전체 값을 다시 붙여넣거나 로그인을 다시 시작하세요.`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!a.trim()||t,onClick:()=>r(a),children:t?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Verifying...`]}):`Complete login`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150`,onClick:()=>{o(``),i()},children:`처음부터 다시 시작`})]})}var We=[`anthropic`,`openai`,`grok`];function Ge(e){return We.some(t=>t===e)}var Ke=3e3,qe=3e5,Je=5,Ye=3,Xe=`Grok login failed`;function Ze(e){if(e)try{return new URL(e).protocol===`https:`?e:void 0}catch{return}}async function Qe(e,t){let{rows:n}=await o.getTokens(`A`,{num:0,queryMode:`list`});return new Set(n.filter(n=>n.provider===e&&n.name===t).map(e=>e.id))}function $e(){let[e,t]=(0,s.useState)(null),[n,i]=(0,s.useState)(null),[o,c]=(0,s.useState)(null),l=r(),u=a.useOauthStartMutation(),d=a.useOauthStartOpenAIMutation(),f=a.useOauthStartGrokMutation(),p=a.useOauthCompleteMutation(),m=(0,s.useRef)({}),h=(0,s.useRef)(0),g=(0,s.useCallback)(()=>{h.current+=1,m.current.interval!==void 0&&clearInterval(m.current.interval),m.current.timeout!==void 0&&clearTimeout(m.current.timeout),m.current={}},[]);(0,s.useEffect)(()=>g,[g]);let _=()=>Promise.all([l.invalidateQueries({queryKey:[`Token`]}),l.invalidateQueries({queryKey:[`Qgrid`]})]);return{loadingProvider:e,codeEntryProvider:n,deviceFlow:o,start:async(e,n)=>{let r=n.trim();if(!r)return;g();let a=h.current;c(null);let o=window.open(`about:blank`,`_blank`);t(e);try{if(e===`grok`){let{authUrl:n}=await f.mutateAsync({name:r});if(a!==h.current){o?.close();return}let s=Ze(n);if(!s)throw Error(`Grok login URL is not https`);o?o.location.href=s:window.open(s,`_blank`),i(e),t(null);return}if(e===`openai`){let n=await Qe(e,r);if(a!==h.current){o?.close();return}let{authUrl:s,mode:c}=await d.mutateAsync({name:r});if(a!==h.current){o?.close();return}if(o?o.location.href=s:window.open(s,`_blank`),c===`code`){i(e),t(null);return}m.current.interval=window.setInterval(()=>{Qe(e,r).then(e=>{a===h.current&&[...e].some(e=>!n.has(e))&&(g(),t(null),_())}).catch(()=>{})},Ke),m.current.timeout=window.setTimeout(()=>{a===h.current&&(g(),t(null))},qe);return}let{authUrl:n,mode:s}=await u.mutateAsync({name:r});if(a!==h.current){o?.close();return}s===`code`?(o?o.location.href=n:window.open(n,`_blank`),i(e),t(null)):(o?.close(),window.location.href=n)}catch(e){if(o?.close(),a!==h.current)return;console.error(`OAuth start failed:`,e),t(null)}},startDevice:async(e,n)=>{let r=e.trim();if(!r)return;g();let o=h.current;i(null),t(null),c({status:`starting`});let s;try{s=await a.oauthStartGrokDevice(r)}catch(e){if(o!==h.current)return;console.error(`Grok device login start failed:`,e),c({status:`error`,message:e instanceof Error&&e.message?e.message:Xe});return}if(o!==h.current)return;let{deviceCode:l}=s,u=Ze(s.verificationUri);if(!u){c({status:`error`,message:`Grok verification URL is not https`});return}let d=Ze(s.verificationUriComplete),f=Date.now()+s.expiresIn*1e3,p=Math.max(s.interval,1),v=0,y={status:`waiting`,userCode:s.userCode,verificationUri:u,expiresAt:f,slowDown:!1};d&&(y.verificationUriComplete=d),c(y);let b=()=>{let e=Math.min(p*1e3,Math.max(f-Date.now(),0));m.current.timeout=window.setTimeout(()=>void x(),e)},x=async()=>{if(o!==h.current)return;if(Date.now()>=f){c({status:`expired`});return}let e;try{e=await a.oauthPollGrokDevice(l)}catch(e){if(o!==h.current)return;if(v+=1,v>=Ye){console.error(`Grok device login poll failed:`,e),c({status:`error`,message:e instanceof Error&&e.message?e.message:Xe});return}b();return}o===h.current&&(v=0,e.status===`added`?(c({status:`added`,name:e.name??r}),await _(),o===h.current&&n?.()):(e.status===`slow_down`?(p=e.intervalSec??p+Je,c(e=>e?.status===`waiting`?{...e,slowDown:!0}:e)):e.intervalSec!==void 0&&(p=e.intervalSec),p=Math.max(p,1),b()))};b()},submitCode:async e=>{let t=e.trim();if(!t)return!1;try{await p.mutateAsync({pastedCode:t})}catch(e){return console.error(`OAuth complete failed:`,e),!1}return await _(),!0},reset:()=>{g(),t(null),i(null),c(null),p.reset()},completeMutation:p}}export{Be as i,$e as n,Ue as r,Ge as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{N as r}from"./vendor-tanstack-6B86itGS.js";import{t as i}from"./clsx-DB0hHKMi.js";import{o as a,u as o}from"./index-D56cIqxW.js";var s=e(t(),1),c=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},l=(e,t)=>({classGroupId:e,validator:t}),u=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),d=`-`,f=[],p=`arbitrary..`,m=e=>{let t=_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return g(e);let n=e.split(d);return h(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?c(i,t):t:i||f}return n[e]||f}}},h=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=h(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(d):e.slice(t).join(d),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},g=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?p+r:void 0})(),_=e=>{let{theme:t,classGroups:n}=e;return v(n,t)},v=(e,t)=>{let n=u();for(let r in e){let i=e[r];y(i,n,r,t)}return n},y=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];b(i,t,n,r)}},b=(e,t,n,r)=>{typeof e==`string`?x(e,t,n):typeof e==`function`?S(e,t,n,r):C(e,t,n,r)},x=(e,t,n)=>{let r=e===``?t:w(t,e);r.classGroupId=n},S=(e,t,n,r)=>{T(e)?y(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(l(n,e)))},C=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];y(o,w(t,a),n,r)}},w=(e,t)=>{let n=e,r=t.split(d),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=u(),n.nextPart.set(t,i)),n=i}return n},T=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ee=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},E=`!`,D=`:`,te=[],O=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),k=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===D){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(E)?(c=s.slice(0,-1),l=!0):s.startsWith(E)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return O(t,l,c,u)};if(t){let e=t+D,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):O(te,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},A=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},j=e=>({cache:ee(e.cacheSize),parseClassName:k(e),sortModifiers:A(e),postfixLookupClassGroupIds:ne(e),...m(e)}),ne=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},re=/\s+/,M=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(re),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+E:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},ie=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ae(n))&&(i&&(i+=` `),i+=r);return i},ae=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ae(e[r]))&&(n&&(n+=` `),n+=t);return n},oe=(e,...t)=>{let n,r,i,a,o=o=>(n=j(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=M(e,n);return i(e,a),a};return a=o,(...e)=>a(ie(...e))},N=[],P=e=>{let t=t=>t[e]||N;return t.isThemeGetter=!0,t.themeKey=e,t},F=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,L=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,se=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,R=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ce=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,B=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,V=e=>L.test(e),H=e=>!!e&&!Number.isNaN(Number(e)),U=e=>!!e&&Number.isInteger(Number(e)),le=e=>e.endsWith(`%`)&&H(e.slice(0,-1)),W=e=>se.test(e),ue=()=>!0,G=e=>R.test(e)&&!ce.test(e),K=()=>!1,de=e=>z.test(e),fe=e=>B.test(e),pe=e=>!q(e)&&!Y(e),me=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),he=e=>Z(e,Ae,K),q=e=>F.test(e),J=e=>Z(e,je,G),ge=e=>Z(e,Me,H),_e=e=>Z(e,Pe,ue),ve=e=>Z(e,Ne,K),ye=e=>Z(e,Oe,K),be=e=>Z(e,ke,fe),xe=e=>Z(e,Fe,de),Y=e=>I.test(e),X=e=>Q(e,je),Se=e=>Q(e,Ne),Ce=e=>Q(e,Oe),we=e=>Q(e,Ae),Te=e=>Q(e,ke),Ee=e=>Q(e,Fe,!0),De=e=>Q(e,Pe,!0),Z=(e,t,n)=>{let r=F.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=I.exec(e);return r?r[1]?t(r[1]):n:!1},Oe=e=>e===`position`||e===`percentage`,ke=e=>e===`image`||e===`url`,Ae=e=>e===`length`||e===`size`||e===`bg-size`,je=e=>e===`length`,Me=e=>e===`number`,Ne=e=>e===`family-name`,Pe=e=>e===`number`||e===`weight`,Fe=e=>e===`shadow`,Ie=oe(()=>{let e=P(`color`),t=P(`font`),n=P(`text`),r=P(`font-weight`),i=P(`tracking`),a=P(`leading`),o=P(`breakpoint`),s=P(`container`),c=P(`spacing`),l=P(`radius`),u=P(`shadow`),d=P(`inset-shadow`),f=P(`text-shadow`),p=P(`drop-shadow`),m=P(`blur`),h=P(`perspective`),g=P(`aspect`),_=P(`ease`),v=P(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,q,c],T=()=>[V,`full`,`auto`,...w()],ee=()=>[U,`none`,`subgrid`,Y,q],E=()=>[`auto`,{span:[`full`,U,Y,q]},U,Y,q],D=()=>[U,`auto`,Y,q],te=()=>[`auto`,`min`,`max`,`fr`,Y,q],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[V,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ne=()=>[s,V,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],re=()=>[V,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[e,Y,q],ie=()=>[...b(),Ce,ye,{position:[Y,q]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],oe=()=>[`auto`,`cover`,`contain`,we,he,{size:[Y,q]}],N=()=>[le,X,J],F=()=>[``,`none`,`full`,l,Y,q],I=()=>[``,H,X,J],L=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[H,le,Ce,ye],ce=()=>[``,`none`,m,Y,q],z=()=>[`none`,H,Y,q],B=()=>[`none`,H,Y,q],G=()=>[H,Y,q],K=()=>[V,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[W],breakpoint:[W],color:[ue],container:[W],"drop-shadow":[W],ease:[`in`,`out`,`in-out`],font:[pe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[W],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[W],shadow:[W],spacing:[`px`,H],text:[W],"text-shadow":[W],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,V,q,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,q]}],"container-named":[me],columns:[{columns:[H,`auto`,q,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[U,`auto`,Y,q]}],basis:[{basis:[V,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[H,V,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,H,Y,q]}],shrink:[{shrink:[``,H,Y,q]}],order:[{order:[U,`first`,`last`,`none`,Y,q]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...ne()]}],"min-inline-size":[{"min-inline":[`auto`,...ne()]}],"max-inline-size":[{"max-inline":[`none`,...ne()]}],"block-size":[{block:[`auto`,...re()]}],"min-block-size":[{"min-block":[`auto`,...re()]}],"max-block-size":[{"max-block":[`none`,...re()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...j()]}],"font-size":[{text:[`base`,n,X,J]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,De,_e]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,le,q]}],"font-family":[{font:[Se,ve,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,q]}],"line-clamp":[{"line-clamp":[H,`none`,Y,ge]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Y,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[H,`from-font`,`auto`,Y,J]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[H,`auto`,Y,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[U,Y,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},U,Y,q],radial:[``,Y,q],conic:[``,U,Y,q]},Te,be]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[H,Y,q]}],"outline-w":[{outline:[``,H,X,J]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`inner`,`none`,u,Ee,xe]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ee,xe]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[H,J]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,Ee,xe]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[H,Y,q]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Y,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,q]}],filter:[{filter:[``,`none`,Y,q]}],blur:[{blur:ce()}],brightness:[{brightness:[H,Y,q]}],contrast:[{contrast:[H,Y,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ee,xe]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,H,Y,q]}],"hue-rotate":[{"hue-rotate":[H,Y,q]}],invert:[{invert:[``,H,Y,q]}],saturate:[{saturate:[H,Y,q]}],sepia:[{sepia:[``,H,Y,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,q]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[H,Y,q]}],"backdrop-contrast":[{"backdrop-contrast":[H,Y,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,H,Y,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,Y,q]}],"backdrop-invert":[{"backdrop-invert":[``,H,Y,q]}],"backdrop-opacity":[{"backdrop-opacity":[H,Y,q]}],"backdrop-saturate":[{"backdrop-saturate":[H,Y,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,H,Y,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[H,`initial`,Y,q]}],ease:[{ease:[`linear`,`initial`,_,Y,q]}],delay:[{delay:[H,Y,q]}],animate:[{animate:[`none`,v,Y,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:B()}],"scale-x":[{"scale-x":B()}],"scale-y":[{"scale-y":B()}],"scale-z":[{"scale-z":B()}],"scale-3d":[`scale-3d`],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[Y,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":[`translate-none`],zoom:[{zoom:[U,Y,q]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,q]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[H,X,J,ge]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Le(...e){return Ie(i(e))}var $=n(),Re=(0,s.forwardRef)(({title:e,titleId:t,...n},r)=>(0,$.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,$.jsx)(`title`,{id:t,children:e}):null,(0,$.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M18 6L6 18M6 6l12 12`})]}));new Map(Object.entries({Æ:`Ae`,Ð:`D`,Ø:`O`,Þ:`Th`,ß:`ss`,æ:`ae`,ð:`d`,ø:`o`,þ:`th`,Đ:`D`,đ:`d`,Ħ:`H`,ħ:`h`,ı:`i`,IJ:`IJ`,ij:`ij`,ĸ:`k`,Ŀ:`L`,ŀ:`l`,Ł:`L`,ł:`l`,ʼn:`'n`,Ŋ:`N`,ŋ:`n`,Œ:`Oe`,œ:`oe`,Ŧ:`T`,ŧ:`t`,ſ:`s`}));function ze(e){return typeof e==`function`}var Be=s.forwardRef(({className:e,type:t,onValueChange:n,onChange:r,clearable:i=!1,...a},o)=>{let c=s.useRef(null),l=s.useCallback(e=>{c.current=e,ze(o)?o(e):o&&(o.current=e)},[o]),u=a.value!==void 0,[d,f]=s.useState(()=>String(a.defaultValue??``).length>0),p=u?String(a.value??``).length>0:d,m=e=>{u||f(e.target.value.length>0),n?.(e.target.value),r?.(e)},h=()=>{let e=c.current;e&&((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus()),u||f(!1)},g=i&&p&&!a.disabled&&!a.readOnly,_=(0,$.jsx)(`input`,{type:t,"data-slot":`input`,className:Le(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,i&&`pr-8`,e),ref:l,...a,onChange:m});return i?(0,$.jsxs)(`div`,{className:`relative w-full`,children:[_,g&&(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":`Clear`,onMouseDown:e=>e.preventDefault(),onClick:h,className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground opacity-60 hover:opacity-100 transition-opacity cursor-pointer`,children:(0,$.jsx)(Re,{className:`h-4 w-4`})})]}):_});Be.displayName=`Input`;var Ve={openai:`새 탭에서 OpenAI 로그인을 완료한 뒤 연결 실패 화면이 나타나면, 주소창의 전체 URL을 아래에 붙여넣으세요.`,anthropic:`새 탭에서 Claude 로그인을 완료하면 코드가 표시됩니다. 코드 전체를 아래에 붙여넣으세요.`,grok:`새 탭에서 xAI(auth.x.ai) 로그인을 완료하면 127.0.0.1 주소로 이동하며 페이지가 열리지 않습니다. 주소창의 전체 URL(또는 그 안의 code 값)을 아래에 붙여넣으세요.`},He={openai:`http://localhost:1455/auth/callback?code=...&state=...`,anthropic:`code#state`,grok:`http://127.0.0.1:.../callback?code=...&state=...`};function Ue({provider:e,isPending:t,isError:n,onSubmit:r,onRestart:i}){let[a,o]=(0,s.useState)(``);return(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`p`,{className:`text-[12px] text-sand-600 leading-relaxed`,children:Ve[e]}),(0,$.jsx)(Be,{value:a,onChange:e=>o(e.target.value),placeholder:He[e],className:`w-full border border-sand-200 rounded-md px-3 py-2 text-sm font-mono text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`}),n&&(0,$.jsx)(`p`,{className:`text-[11px] text-red-500`,children:`인증 결과 확인에 실패했습니다 — 전체 값을 다시 붙여넣거나 로그인을 다시 시작하세요.`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!a.trim()||t,onClick:()=>r(a),children:t?(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Verifying...`]}):`Complete login`}),(0,$.jsx)(`button`,{type:`button`,className:`w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150`,onClick:()=>{o(``),i()},children:`처음부터 다시 시작`})]})}var We=[`anthropic`,`openai`,`grok`];function Ge(e){return We.some(t=>t===e)}var Ke=3e3,qe=3e5,Je=5,Ye=3,Xe=`Grok login failed`;function Ze(e){if(e)try{return new URL(e).protocol===`https:`?e:void 0}catch{return}}async function Qe(e,t){let{rows:n}=await o.getTokens(`A`,{num:0,queryMode:`list`});return new Set(n.filter(n=>n.provider===e&&n.name===t).map(e=>e.id))}function $e(){let[e,t]=(0,s.useState)(null),[n,i]=(0,s.useState)(null),[o,c]=(0,s.useState)(null),l=r(),u=a.useOauthStartMutation(),d=a.useOauthStartOpenAIMutation(),f=a.useOauthStartGrokMutation(),p=a.useOauthCompleteMutation(),m=(0,s.useRef)({}),h=(0,s.useRef)(0),g=(0,s.useCallback)(()=>{h.current+=1,m.current.interval!==void 0&&clearInterval(m.current.interval),m.current.timeout!==void 0&&clearTimeout(m.current.timeout),m.current={}},[]);(0,s.useEffect)(()=>g,[g]);let _=()=>Promise.all([l.invalidateQueries({queryKey:[`Token`]}),l.invalidateQueries({queryKey:[`Qgrid`]})]);return{loadingProvider:e,codeEntryProvider:n,deviceFlow:o,start:async(e,n)=>{let r=n.trim();if(!r)return;g();let a=h.current;c(null);let o=window.open(`about:blank`,`_blank`);t(e);try{if(e===`grok`){let{authUrl:n}=await f.mutateAsync({name:r});if(a!==h.current){o?.close();return}let s=Ze(n);if(!s)throw Error(`Grok login URL is not https`);o?o.location.href=s:window.open(s,`_blank`),i(e),t(null);return}if(e===`openai`){let n=await Qe(e,r);if(a!==h.current){o?.close();return}let{authUrl:s,mode:c}=await d.mutateAsync({name:r});if(a!==h.current){o?.close();return}if(o?o.location.href=s:window.open(s,`_blank`),c===`code`){i(e),t(null);return}m.current.interval=window.setInterval(()=>{Qe(e,r).then(e=>{a===h.current&&[...e].some(e=>!n.has(e))&&(g(),t(null),_())}).catch(()=>{})},Ke),m.current.timeout=window.setTimeout(()=>{a===h.current&&(g(),t(null))},qe);return}let{authUrl:n,mode:s}=await u.mutateAsync({name:r});if(a!==h.current){o?.close();return}s===`code`?(o?o.location.href=n:window.open(n,`_blank`),i(e),t(null)):(o?.close(),window.location.href=n)}catch(e){if(o?.close(),a!==h.current)return;console.error(`OAuth start failed:`,e),t(null)}},startDevice:async(e,n)=>{let r=e.trim();if(!r)return;g();let o=h.current;i(null),t(null),c({status:`starting`});let s;try{s=await a.oauthStartGrokDevice(r)}catch(e){if(o!==h.current)return;console.error(`Grok device login start failed:`,e),c({status:`error`,message:e instanceof Error&&e.message?e.message:Xe});return}if(o!==h.current)return;let{deviceCode:l}=s,u=Ze(s.verificationUri);if(!u){c({status:`error`,message:`Grok verification URL is not https`});return}let d=Ze(s.verificationUriComplete),f=Date.now()+s.expiresIn*1e3,p=Math.max(s.interval,1),v=0,y={status:`waiting`,userCode:s.userCode,verificationUri:u,expiresAt:f,slowDown:!1};d&&(y.verificationUriComplete=d),c(y);let b=()=>{let e=Math.min(p*1e3,Math.max(f-Date.now(),0));m.current.timeout=window.setTimeout(()=>void x(),e)},x=async()=>{if(o!==h.current)return;if(Date.now()>=f){c({status:`expired`});return}let e;try{e=await a.oauthPollGrokDevice(l)}catch(e){if(o!==h.current)return;if(v+=1,v>=Ye){console.error(`Grok device login poll failed:`,e),c({status:`error`,message:e instanceof Error&&e.message?e.message:Xe});return}b();return}o===h.current&&(v=0,e.status===`added`?(c({status:`added`,name:e.name??r}),await _(),o===h.current&&n?.()):(e.status===`slow_down`?(p=e.intervalSec??p+Je,c(e=>e?.status===`waiting`?{...e,slowDown:!0}:e)):e.intervalSec!==void 0&&(p=e.intervalSec),p=Math.max(p,1),b()))};b()},submitCode:async e=>{let t=e.trim();if(!t)return!1;try{await p.mutateAsync({pastedCode:t})}catch(e){return console.error(`OAuth complete failed:`,e),!1}return await _(),!0},reset:()=>{g(),t(null),i(null),c(null),p.reset()},completeMutation:p}}export{Be as i,$e as n,Ue as r,Ge as t};
@@ -1 +1 @@
1
- import{p as e}from"./vendor-tanstack-6B86itGS.js";import{o as t}from"./index-SGfYBzGT.js";function n(){return e({mutationFn:({id:e,name:n,quotaThreshold:r,weight:i,keepaliveEnabled:a})=>t.updateToken(e,n,r,i,a)})}export{n as t};
1
+ import{p as e}from"./vendor-tanstack-6B86itGS.js";import{o as t}from"./index-D56cIqxW.js";function n(){return e({mutationFn:({id:e,name:n,quotaThreshold:r,weight:i,keepaliveEnabled:a})=>t.updateToken(e,n,r,i,a)})}export{n as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./vendor-react-8xo7RSum.js";import{u as r}from"./vendor-tanstack-6B86itGS.js";import{b as i,o as a,y as o}from"./index-D56cIqxW.js";import{t as s}from"./TimedPlayer-cuEgYA3Q.js";var c=e(t()),l=n(),u=(0,c.forwardRef)(({title:e,titleId:t,...n},r)=>(0,l.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,l.jsx)(`title`,{id:t,children:e}):null,(0,l.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M15 3h6v6m-11 5L21 3m-3 10v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})]})),d=(0,c.forwardRef)(({title:e,titleId:t,...n},r)=>(0,l.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,l.jsx)(`title`,{id:t,children:e}):null,(0,l.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21 12a9 9 0 1 1-6.219-8.56`})]})),f=(0,c.forwardRef)(({title:e,titleId:t,...n},r)=>(0,l.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,l.jsx)(`title`,{id:t,children:e}):null,(0,l.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,l.jsx)(`path`,{d:`M12 19v3m7-12v2a7 7 0 0 1-14 0v-2`}),(0,l.jsx)(`rect`,{width:6,height:13,x:9,y:2,rx:3})]})]})),p=(0,c.forwardRef)(({title:e,titleId:t,...n},r)=>(0,l.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,ref:r,"aria-labelledby":t,...n,children:[e?(0,l.jsx)(`title`,{id:t,children:e}):null,(0,l.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`})]})),m=24e3;function h(e,t=m){let n=new Uint8Array(44+e.length*2),r=new DataView(n.buffer),i=(e,t)=>{for(let n=0;n<t.length;n++)r.setUint8(e+n,t.charCodeAt(n))};return i(0,`RIFF`),r.setUint32(4,36+e.length*2,!0),i(8,`WAVE`),i(12,`fmt `),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,t,!0),r.setUint32(28,t*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),i(36,`data`),r.setUint32(40,e.length*2,!0),e.forEach((e,t)=>{let n=Math.max(-1,Math.min(1,e));r.setInt16(44+t*2,n<0?n*32768:n*32767,!0)}),n}function g(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}async function _(e){let t=new AudioContext({sampleRate:m});try{let n=await t.decodeAudioData(await e.arrayBuffer()),r=new Float32Array(n.length);for(let e=0;e<n.numberOfChannels;e++){let t=n.getChannelData(e);for(let e=0;e<t.length;e++)r[e]+=t[e]/n.numberOfChannels}return g(h(r))}finally{await t.close()}}var v=`qgrid_voice`,y=[`grok/grok-tts`,`openai/gpt-realtime-2.1-mini`,`openai/gpt-realtime-2.1`],b=[`openai/gpt-4o-transcribe`,`openai/gpt-4o-mini-transcribe`,`grok/grok-voice-transcribe-2.0`],x=`marin cedar alloy ash ballad coral echo sage shimmer verse`.split(` `),S=[{label:`Female`,voices:`ara aurora carina celeste eve iris liora luna ursa`.split(` `)},{label:`Male`,voices:`altair atlas castor cosmo helios helix kepler leo lumen lux naksh orion perseus rex rigel sal sirius zagan zenith`.split(` `)}],C=[{label:``,voices:x}],w={provider:`timing from Grok TTS`,aligned:`timing aligned via Grok STT`},T=e=>e.startsWith(`openai/`),E=`w-full rounded-lg border border-sand-200/80 bg-white px-2.5 py-1.5 text-[12px] text-sand-800 placeholder:text-sand-400 focus:outline-none focus:border-sienna-300 disabled:opacity-50`,D=`${E} h-8`,O=`px-3.5 py-1.5 text-[12px] font-medium rounded-lg bg-sienna-500 text-white hover:bg-sienna-600 disabled:opacity-50 transition-all duration-150 active:scale-[0.97] inline-flex items-center gap-1.5 shadow-sm`;function k({label:e,children:t}){return(0,l.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-medium text-sand-500`,children:e}),t]})}var A=e=>e.slice(e.indexOf(`/`)+1);function j({title:e,meta:t,requestLogId:n,onRemove:i,children:a}){return(0,l.jsxs)(`li`,{className:`flex flex-col gap-1.5 px-4 py-3`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px]`,children:[(0,l.jsx)(`span`,{className:`font-medium text-sand-800`,children:e}),(0,l.jsx)(`span`,{className:`tabular-nums text-sand-400`,children:t}),(0,l.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[n!==void 0&&(0,l.jsxs)(r,{to:`/requests/show`,search:{id:n},target:`_blank`,className:`inline-flex items-center gap-1 tabular-nums text-sand-500 hover:text-sienna-500`,children:[`request log #`,n,(0,l.jsx)(u,{className:`size-3`})]}),(0,l.jsx)(`button`,{type:`button`,onClick:i,title:`Remove from history`,className:`text-sand-300 hover:text-sand-600`,children:(0,l.jsx)(o,{className:`size-3.5`})})]})]}),a]})}function M({empty:e,children:t}){return t.length===0?(0,l.jsx)(`p`,{className:`px-4 py-6 text-center text-[12px] text-sand-400`,children:e}):(0,l.jsx)(`ul`,{className:`divide-y divide-sand-100`,children:t})}function N(e){if(!e)return;let t=[],n;return e.graphChars.forEach((r,i)=>{let[a,o]=e.graphTimes[i];/\s/.test(r)?n=void 0:n?(n.text+=r,n.end=o):(n={text:r,start:a,end:o},t.push(n))}),t}function P(){let[e,t]=(0,c.useState)(y[0]),[n,r]=(0,c.useState)(`ara`),[o,u]=(0,c.useState)(``),[f,m]=(0,c.useState)(`Hi! What did you do this weekend?`),[h,g]=(0,c.useState)([]),[_,b]=(0,c.useState)(!0),P=(0,c.useRef)(0),F=a.useSpeakMutation(),I=T(e),L=e=>{T(e)!==I&&r(T(e)?x[0]:`ara`),t(e)},R=I&&o.trim()?o.trim():void 0,z=t=>{let n=performance.now(),r={model:e,text:f,voice:t,projectName:v};R&&(r.instructions=R),_&&(r.withTimestamps=!0),F.mutate({params:r},{onSuccess:i=>{let a={key:P.current++,src:`data:${i.mimeType};base64,${i.audio}`,model:e,voice:t,instructions:r.instructions,text:f,elapsedMs:performance.now()-n,requestLogId:i.requestLogId,words:N(i.audioTimestamps),timing:i.timestampsError?`timing failed: ${i.timestampsError}`:i.timestampsSource&&w[i.timestampsSource]};g(e=>[a,...e])}})},B=(0,c.useRef)(null),[V,H]=(0,c.useState)();(0,c.useEffect)(()=>()=>B.current?.pause(),[]);let U=e=>{if(r(e),B.current?.pause(),V===e){H(void 0);return}let t=new Audio(`/voice-samples/${I?`openai`:`grok`}/${e}.mp3`);t.addEventListener(`ended`,()=>H(t=>t===e?void 0:t),{once:!0}),B.current=t,H(e),t.play()};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,l.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,l.jsx)(k,{label:`Model`,children:(0,l.jsx)(`select`,{value:e,onChange:e=>L(e.target.value),className:D,children:y.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))})}),I&&(0,l.jsx)(k,{label:`Style instructions (OpenAI only)`,children:(0,l.jsx)(`input`,{value:o,onChange:e=>u(e.target.value),placeholder:`e.g. Speak with a gentle Irish accent.`,className:D})})]}),(0,l.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-medium text-sand-500`,children:`Voice — ▶ plays a short self-introduction sample, a name selects it`}),(I?C:S).map(e=>(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[e.label&&(0,l.jsx)(`span`,{className:`w-12 shrink-0 pt-1 text-[11px] text-sand-400`,children:e.label}),(0,l.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.voices.map(e=>(0,l.jsxs)(`span`,{className:`inline-flex items-center overflow-hidden rounded-full border text-[12px] ${n===e?`border-sienna-400 bg-sienna-50 text-sienna-700`:`border-sand-200/80 bg-white text-sand-700`}`,children:[(0,l.jsx)(`button`,{type:`button`,onClick:()=>r(e),"aria-pressed":n===e,className:`py-0.5 pl-2.5 pr-1 hover:text-sienna-600`,children:e}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>U(e),title:V===e?`Stop "${e}"`:`Play a "${e}" sample`,className:`py-1 pl-1 pr-2 hover:text-sienna-500 ${V===e?`text-sienna-500`:`text-sand-400`}`,children:V===e?(0,l.jsx)(i,{className:`size-3`}):(0,l.jsx)(p,{className:`size-3`})})]},e))})]},e.label))]}),(0,l.jsx)(k,{label:`Text`,children:(0,l.jsx)(`textarea`,{value:f,onChange:e=>m(e.target.value),rows:3,className:`${E} resize-y`})}),(0,l.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,l.jsxs)(`button`,{type:`button`,onClick:()=>z(n),disabled:F.isPending||!f.trim(),className:O,children:[F.isPending&&(0,l.jsx)(d,{className:`size-3.5 animate-spin`}),`Generate with `,n]}),(0,l.jsxs)(`label`,{className:`flex items-center gap-1.5 text-[12px] text-sand-600`,children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>b(e.target.checked),className:`accent-sienna-500`}),`Word timing`]}),F.isError&&(0,l.jsx)(`p`,{className:`text-[12px] text-danger-500 break-words`,children:F.error?.message})]})]}),(0,l.jsx)(`div`,{className:`border-t border-sand-100`,children:(0,l.jsx)(M,{empty:`Generated clips stack here, newest first, so voices can be compared side by side.`,children:h.map(e=>(0,l.jsxs)(j,{title:`${e.voice} · ${A(e.model)}`,meta:[`${(e.elapsedMs/1e3).toFixed(1)}s`,e.timing].filter(Boolean).join(` · `),requestLogId:e.requestLogId,onRemove:()=>g(t=>t.filter(t=>t.key!==e.key)),children:[(!e.words||e.instructions)&&(0,l.jsxs)(`p`,{className:`truncate text-[12px] text-sand-600`,title:e.text,children:[!e.words&&e.text,e.instructions&&(0,l.jsxs)(`span`,{className:`text-sand-400`,children:[` — `,e.instructions]})]}),(0,l.jsx)(s,{src:e.src,words:e.words,autoPlay:!0})]},e.key))})})]})}function F(){let[e,t]=(0,c.useState)(b[0]),[n,r]=(0,c.useState)(``),[o,u]=(0,c.useState)(),[p,m]=(0,c.useState)(!1),[h,g]=(0,c.useState)(),[y,x]=(0,c.useState)([]),S=(0,c.useRef)(null),C=(0,c.useRef)([]),w=(0,c.useRef)(0),E=a.useTranscribeMutation(),N=T(e);(0,c.useEffect)(()=>()=>{S.current?.stream.getTracks().forEach(e=>e.stop()),C.current.forEach(e=>URL.revokeObjectURL(e))},[]);let P=e=>{let t=URL.createObjectURL(e);C.current.push(t),u({blob:e,url:t,clip:C.current.length})};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,l.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,l.jsx)(k,{label:`Model`,children:(0,l.jsx)(`select`,{value:e,onChange:e=>t(e.target.value),className:D,children:b.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))})}),N&&(0,l.jsx)(k,{label:`Prompt (OpenAI only)`,children:(0,l.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`domain words, e.g. qgrid, Kuma`,className:D})})]}),(0,l.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,l.jsxs)(`button`,{type:`button`,onClick:async()=>{if(p)S.current?.stop(),m(!1);else{g(void 0);try{let e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e),n=[];t.ondataavailable=e=>n.push(e.data),t.onstop=()=>{e.getTracks().forEach(e=>e.stop()),P(new Blob(n,{type:t.mimeType}))},t.start(),S.current=t,m(!0)}catch(e){g(e instanceof Error?e.message:String(e))}}},className:`${O} ${p?`bg-danger-500 hover:bg-danger-500`:``}`,children:[p?(0,l.jsx)(i,{className:`size-3.5`}):(0,l.jsx)(f,{className:`size-3.5`}),p?`Stop`:`Record`]}),(0,l.jsxs)(`label`,{className:`text-[12px] text-sand-600 cursor-pointer hover:text-sienna-500`,children:[`or upload a file`,(0,l.jsx)(`input`,{type:`file`,accept:`audio/*`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];t&&P(t)}})]}),h&&(0,l.jsx)(`p`,{className:`text-[12px] text-danger-500 break-words`,children:h})]}),o&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsxs)(`span`,{className:`shrink-0 text-[11px] font-medium text-sand-500`,children:[`clip `,o.clip]}),(0,l.jsx)(`audio`,{controls:!0,src:o.url,className:`h-8 w-full`})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,l.jsxs)(`button`,{type:`button`,onClick:async()=>{if(!o)return;g(void 0);let t;try{t=await _(o.blob)}catch(e){g(`could not decode audio: ${e instanceof Error?e.message:String(e)}`);return}let r={model:e,audio:t,mediaType:`audio/wav`,projectName:v};N&&n.trim()&&(r.prompt=n.trim());let i=performance.now();E.mutate({params:r},{onSuccess:t=>{let n={key:w.current++,clip:o.clip,clipUrl:o.url,model:e,prompt:r.prompt,text:t.text,elapsedMs:performance.now()-i,durationSec:t.durationSec,requestLogId:t.requestLogId,words:t.words};x(e=>[n,...e])}})},disabled:!o||p||E.isPending,className:O,children:[E.isPending&&(0,l.jsx)(d,{className:`size-3.5 animate-spin`}),`Transcribe`]}),E.isError&&(0,l.jsx)(`p`,{className:`text-[12px] text-danger-500 break-words`,children:E.error?.message})]})]}),(0,l.jsx)(`div`,{className:`border-t border-sand-100`,children:(0,l.jsx)(M,{empty:`Transcripts stack here, newest first; run one clip through several models to compare.`,children:y.map(e=>(0,l.jsx)(j,{title:`clip ${e.clip} · ${A(e.model)}`,meta:[`${(e.elapsedMs/1e3).toFixed(1)}s`,e.durationSec===void 0?``:`${e.durationSec.toFixed(1)}s audio`,e.prompt?`prompt: ${e.prompt}`:``].filter(Boolean).join(` · `),requestLogId:e.requestLogId,onRemove:()=>x(t=>t.filter(t=>t.key!==e.key)),children:e.words&&e.words.length>0?(0,l.jsx)(s,{src:e.clipUrl,words:e.words}):(0,l.jsx)(`p`,{className:`rounded-lg bg-sand-50 px-3 py-2 text-[13px] text-sand-800 whitespace-pre-wrap`,children:e.text||`(empty transcript)`})},e.key))})})]})}var I=[{id:`tts`,label:`Text to speech`},{id:`stt`,label:`Speech to text`}];function L(){let[e,t]=(0,c.useState)(`tts`);return(0,l.jsxs)(`section`,{className:`rounded-xl border border-sand-200/70 bg-white overflow-hidden`,children:[(0,l.jsx)(`div`,{role:`tablist`,className:`flex gap-1 border-b border-sand-100 px-3 pt-2`,children:I.map(n=>(0,l.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e===n.id,onClick:()=>t(n.id),className:`-mb-px border-b-2 px-3 py-2 text-[13px] transition-colors duration-150 ${e===n.id?`border-sienna-500 font-medium text-sand-800`:`border-transparent text-sand-500 hover:text-sand-700`}`,children:n.label},n.id))}),(0,l.jsx)(`div`,{role:`tabpanel`,hidden:e!==`tts`,children:(0,l.jsx)(P,{})}),(0,l.jsx)(`div`,{role:`tabpanel`,hidden:e!==`stt`,children:(0,l.jsx)(F,{})})]})}function R(){return(0,l.jsx)(`div`,{className:`max-w-3xl mx-auto`,children:(0,l.jsx)(L,{})})}export{R as component};
@@ -5,11 +5,11 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/sonamu.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Qgrid</title>
8
- <script type="module" crossorigin src="/assets/index-SGfYBzGT.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-D56cIqxW.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-8xo7RSum.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-6B86itGS.js">
12
- <link rel="stylesheet" crossorigin href="/assets/index-DyrPRt6O.css">
12
+ <link rel="stylesheet" crossorigin href="/assets/index-Co8uAhSV.css">
13
13
  </head>
14
14
  <body>
15
15
  <div id="root"></div>
@@ -0,0 +1,54 @@
1
+ import { J as require_react, Q as __toESM, q as require_jsx_runtime } from "./services.generated-B6QpnL_N.js";
2
+ //#region src/components/qgrid/TimedPlayer.tsx
3
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
4
+ var import_jsx_runtime = require_jsx_runtime();
5
+ /**
6
+ * Audio player with the timed words under it; the word being spoken is highlighted. The current
7
+ * time is read every animation frame while playing, since timeupdate fires only about 4 times a
8
+ * second and short words would be skipped; timeupdate still feeds it when frames are throttled.
9
+ */
10
+ function TimedPlayer({ src, words, autoPlay, className = "h-8 w-full" }) {
11
+ const audioRef = (0, import_react.useRef)(null);
12
+ const frame = (0, import_react.useRef)(0);
13
+ const [time, setTime] = (0, import_react.useState)(-1);
14
+ const tick = () => {
15
+ setTime(audioRef.current?.currentTime ?? -1);
16
+ frame.current = requestAnimationFrame(tick);
17
+ };
18
+ const stop = () => cancelAnimationFrame(frame.current);
19
+ (0, import_react.useEffect)(() => () => cancelAnimationFrame(frame.current), []);
20
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("audio", {
21
+ ref: audioRef,
22
+ controls: true,
23
+ autoPlay,
24
+ src,
25
+ className,
26
+ onPlay: () => {
27
+ stop();
28
+ tick();
29
+ },
30
+ onPause: stop,
31
+ onTimeUpdate: (e) => setTime(e.currentTarget.currentTime),
32
+ onEnded: () => {
33
+ stop();
34
+ setTime(-1);
35
+ }
36
+ }), words && words.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
37
+ className: "flex flex-wrap gap-x-0.5 gap-y-1 text-[13px] leading-relaxed",
38
+ children: words.map((word, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
39
+ type: "button",
40
+ onClick: () => {
41
+ const audio = audioRef.current;
42
+ if (!audio) return;
43
+ audio.currentTime = word.start;
44
+ setTime(word.start);
45
+ audio.play();
46
+ },
47
+ title: `${word.start.toFixed(2)}–${word.end.toFixed(2)}s · play from here`,
48
+ className: `rounded px-1 transition-colors duration-75 ${time >= word.start && time < word.end ? "bg-sienna-500 text-white" : "text-sand-700 hover:bg-sand-100"}`,
49
+ children: word.text
50
+ }, i))
51
+ })] });
52
+ }
53
+ //#endregion
54
+ export { TimedPlayer as t };
@@ -3,6 +3,7 @@ import { t as Link } from "./link-DrdV092C.js";
3
3
  import { a as ForwardRef$4, c as remarkGfm, l as Markdown, t as Route } from "../entry-server.generated.js";
4
4
  import { n as formatMicroUsd, t as cacheHitRate } from "./cost-oNK0T4Jo.js";
5
5
  import { n as ForwardRef$5, t as requestModelDisplay } from "./request-model-DRF7hmJC.js";
6
+ import { t as TimedPlayer } from "./TimedPlayer-DAwjkP4z.js";
6
7
  //#region ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/extends.js
7
8
  var require_extends = /* @__PURE__ */ __commonJSMin(((exports, module) => {
8
9
  function _extends() {
@@ -2033,7 +2034,7 @@ function parseImageSegments(text) {
2033
2034
  });
2034
2035
  return segments.filter((segment) => segment.type !== "text" || segment.text.trim().length > 0);
2035
2036
  }
2036
- function ImageAwareContent({ text, markdown }) {
2037
+ function ImageAwareContent({ text, markdown, audioWords }) {
2037
2038
  const [viewerSrc, setViewerSrc] = (0, import_react.useState)(null);
2038
2039
  const segments = parseImageSegments(text);
2039
2040
  if (!segments.some((segment) => segment.type !== "text")) return markdown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -2057,7 +2058,14 @@ function ImageAwareContent({ text, markdown }) {
2057
2058
  }, `text-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
2058
2059
  className: "text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed",
2059
2060
  children: segment.text
2060
- }, `text-${index}`) : segment.type === "audio" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("audio", {
2061
+ }, `text-${index}`) : segment.type === "audio" ? audioWords ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2062
+ className: "flex max-w-xl flex-col gap-2",
2063
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TimedPlayer, {
2064
+ src: segment.src,
2065
+ words: audioWords,
2066
+ className: "w-full max-w-md"
2067
+ })
2068
+ }, `audio-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("audio", {
2061
2069
  controls: true,
2062
2070
  src: segment.src,
2063
2071
  className: "w-full max-w-md"
@@ -2091,14 +2099,15 @@ function ImageAwareContent({ text, markdown }) {
2091
2099
  })]
2092
2100
  });
2093
2101
  }
2094
- function FormattedContent({ text, markdown }) {
2102
+ function FormattedContent({ text, markdown, audioWords }) {
2095
2103
  const parsed = tryParseJson(text);
2096
2104
  const [mode, setMode] = (0, import_react.useState)("pretty");
2097
2105
  const jsonContainer = parsed.ok && parsed.value instanceof Object ? parsed.value : null;
2098
2106
  if (!parsed.ok || jsonContainer === null) {
2099
2107
  if (markdown) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageAwareContent, {
2100
2108
  text,
2101
- markdown: true
2109
+ markdown: true,
2110
+ audioWords
2102
2111
  });
2103
2112
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageAwareContent, { text: parsed.ok ? JSON.stringify(parsed.value, null, 2) : text });
2104
2113
  }
@@ -2267,7 +2276,7 @@ function MetricsPanel({ data, toolCallCount }) {
2267
2276
  value: formatTokensPerSec(data.output_tokens, data.duration_ms, data.ttft_ms, tokensPerSecEnabled)
2268
2277
  }),
2269
2278
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2270
- label: "Driver",
2279
+ label: data.media_kind === "stt" || data.media_kind === "tts" ? "Voice" : "Driver",
2271
2280
  value: data.cost_usd !== null ? formatMicroUsd(data.cost_usd) : "—"
2272
2281
  }),
2273
2282
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
@@ -2442,6 +2451,25 @@ function ToolInputImages({ images }) {
2442
2451
  })
2443
2452
  })] });
2444
2453
  }
2454
+ var VoiceStepResult = object({ words: array(object({
2455
+ text: string(),
2456
+ start: number(),
2457
+ end: number()
2458
+ })).optional() });
2459
+ /**
2460
+ * Voice rows keep their word timing in the speech/transcription step result (TTS output words, or
2461
+ * the words heard in the STT input). The step is fetched once so the embedded clip can show its
2462
+ * words; rows without timing render as plain content.
2463
+ */
2464
+ function VoiceAwareContent({ text, stepId }) {
2465
+ const { data: detail } = RequestLogStepService.useRequestLogStep("A", stepId ?? 0, { enabled: stepId !== null });
2466
+ const words = detail ? VoiceStepResult.safeParse(safeParseJson(detail.tool_result)).data?.words : void 0;
2467
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
2468
+ text,
2469
+ markdown: true,
2470
+ audioWords: words
2471
+ });
2472
+ }
2445
2473
  function RequestInputImages({ images, stepId }) {
2446
2474
  const { data: detail } = RequestLogStepService.useRequestLogStep("I", stepId ?? 0, { enabled: images === null && stepId !== null });
2447
2475
  const args = detail ? safeParseJson(detail.tool_args) : null;
@@ -2993,6 +3021,7 @@ function RequestDetail({ id }) {
2993
3021
  });
2994
3022
  const toolCalls = stepTree.flatMap((step) => step.toolCalls);
2995
3023
  const firstImageGenerationStepId = toolCalls.find((toolCall) => toolCall.toolName === "image_generation")?.id ?? null;
3024
+ const voiceStepId = toolCalls.find((toolCall) => toolCall.toolName === "speech" || toolCall.toolName === "transcription")?.id ?? null;
2996
3025
  const hasSteps = stepTree.length > 0;
2997
3026
  const tokensPerSecEnabled = isTokensPerSecEnabled(data);
2998
3027
  const history = data.history ?? null;
@@ -3003,7 +3032,7 @@ function RequestDetail({ id }) {
3003
3032
  const promptSections = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3004
3033
  className: "space-y-4",
3005
3034
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
3006
- title: "System",
3035
+ title: data.media_kind === "tts" ? "Style instructions" : data.media_kind === "stt" ? "Prompt" : "System",
3007
3036
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3008
3037
  className: "relative",
3009
3038
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.system_prompt ?? "null" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
@@ -3017,7 +3046,10 @@ function RequestDetail({ id }) {
3017
3046
  className: "space-y-3",
3018
3047
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3019
3048
  className: "relative",
3020
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.user_prompt ?? "null" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
3049
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.user_prompt ?? "null" }), data.media_kind === "stt" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VoiceAwareContent, {
3050
+ text: data.user_prompt ?? "null",
3051
+ stepId: voiceStepId
3052
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
3021
3053
  text: data.user_prompt ?? "null",
3022
3054
  markdown: true
3023
3055
  })]
@@ -3070,7 +3102,10 @@ function RequestDetail({ id }) {
3070
3102
  title: "Response",
3071
3103
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3072
3104
  className: "relative",
3073
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.response }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
3105
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.response }), data.media_kind === "tts" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VoiceAwareContent, {
3106
+ text: data.response,
3107
+ stepId: voiceStepId
3108
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
3074
3109
  text: data.response,
3075
3110
  markdown: true
3076
3111
  })]