reflex-agent 0.10.0 → 0.10.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 (145) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +114 -113
  3. package/.next/app-path-routes-manifest.json +10 -10
  4. package/.next/build-manifest.json +5 -5
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/react-loadable-manifest.json +1 -1
  7. package/.next/server/app/_not-found/page.js +2 -2
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/agents/[agentId]/page.js +2 -2
  10. package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/agents/[agentId]/respond/route.js +1 -1
  12. package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +1 -1
  18. package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +1 -1
  20. package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +2 -2
  22. package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
  24. package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
  26. package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +1 -1
  29. package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/audit/page.js +2 -2
  35. package/.next/server/app/audit/page.js.nft.json +1 -1
  36. package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  37. package/.next/server/app/onboarding/page.js +3 -3
  38. package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/page.js +2 -2
  40. package/.next/server/app/page.js.nft.json +1 -1
  41. package/.next/server/app/page_client-reference-manifest.js +1 -1
  42. package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -2
  43. package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
  44. package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
  45. package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -2
  46. package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
  47. package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/roots/[id]/page.js +6 -6
  49. package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
  50. package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
  51. package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
  52. package/.next/server/app/roots/[id]/workflows/[wfId]/page.js.nft.json +1 -1
  53. package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
  54. package/.next/server/app/roots/[id]/workflows/page.js +2 -2
  55. package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
  56. package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
  57. package/.next/server/app/roots/new/page.js +3 -3
  58. package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
  59. package/.next/server/app/settings/page.js +6 -6
  60. package/.next/server/app/settings/page.js.nft.json +1 -1
  61. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  62. package/.next/server/app/share/[id]/file/page.js +1 -1
  63. package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
  64. package/.next/server/app/share/[id]/page.js +2 -2
  65. package/.next/server/app/share/[id]/page.js.nft.json +1 -1
  66. package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
  67. package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
  68. package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
  69. package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
  70. package/.next/server/app/utilities/page.js +2 -2
  71. package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
  72. package/.next/server/app-paths-manifest.json +10 -10
  73. package/.next/server/chunks/1358.js +1 -1
  74. package/.next/server/chunks/2108.js +1 -0
  75. package/.next/server/chunks/243.js +1 -0
  76. package/.next/server/chunks/2552.js +1 -1
  77. package/.next/server/chunks/285.js +5 -4
  78. package/.next/server/chunks/3332.js +1 -1
  79. package/.next/server/chunks/{9333.js → 3829.js} +2 -2
  80. package/.next/server/chunks/4812.js +1 -1
  81. package/.next/server/chunks/7800.js +1 -1
  82. package/.next/server/chunks/827.js +1 -0
  83. package/.next/server/chunks/{5090.js → 8501.js} +1 -1
  84. package/.next/server/chunks/9098.js +1 -1
  85. package/.next/server/chunks/9448.js +3 -0
  86. package/.next/server/chunks/9809.js +1 -1
  87. package/.next/server/middleware-build-manifest.js +1 -1
  88. package/.next/server/middleware-manifest.json +5 -5
  89. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  90. package/.next/server/pages/500.html +1 -1
  91. package/.next/server/pages-manifest.json +1 -1
  92. package/.next/server/server-reference-manifest.js +1 -1
  93. package/.next/server/server-reference-manifest.json +1 -1
  94. package/.next/static/chunks/1215-6bf6c0997a3966b5.js +1 -0
  95. package/.next/static/chunks/{3954-fe27ff41d9bf012d.js → 2038-0849f9c03cc8d6ab.js} +1 -1
  96. package/.next/static/chunks/4108.e60f6f2d13c6e341.js +1 -0
  97. package/.next/static/chunks/{6445-99824866a51b582a.js → 5041-50b52df22f60e028.js} +1 -1
  98. package/.next/static/chunks/5475-fd7801895adb058e.js +1 -0
  99. package/.next/static/chunks/{5235-990ba9c4c8446446.js → 6231-d572db56a0a44f92.js} +2 -2
  100. package/.next/static/chunks/7529-5e60df9bb54dac00.js +1 -0
  101. package/.next/static/chunks/7544-361ab91088caf4e2.js +1 -0
  102. package/.next/static/chunks/83-c3e4801d1362769d.js +1 -0
  103. package/.next/static/chunks/{5097-f07f6aeee3f60a33.js → 9776-e3882c1c63293e0a.js} +1 -1
  104. package/.next/static/chunks/app/audit/page-8dcb779a1ca1f1d1.js +1 -0
  105. package/.next/static/chunks/app/layout-d10a100470029f0e.js +1 -0
  106. package/.next/static/chunks/app/onboarding/page-a52d76f48c071f59.js +1 -0
  107. package/.next/static/chunks/app/{page-1ea9bd7d8a2c7e0d.js → page-8551ff0fd6989e65.js} +1 -1
  108. package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-ca235f5f1d523635.js +1 -0
  109. package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-aebc35e79e6e16d6.js +1 -0
  110. package/.next/static/chunks/app/roots/[id]/page-9b4a28b335dd8190.js +1 -0
  111. package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-ab2801337dc9cc52.js +1 -0
  112. package/.next/static/chunks/app/roots/[id]/workflows/page-85f4eb885ecb80a1.js +1 -0
  113. package/.next/static/chunks/app/roots/new/page-4036140c7828948d.js +1 -0
  114. package/.next/static/chunks/app/settings/page-175f2087baeb2328.js +1 -0
  115. package/.next/static/chunks/app/share/[id]/page-5f86538339553350.js +1 -0
  116. package/.next/static/chunks/app/utilities/[scope]/[id]/page-223495e5566167ef.js +1 -0
  117. package/.next/static/chunks/app/utilities/page-cbd341f4f56941a0.js +1 -0
  118. package/.next/static/chunks/{webpack-ab6092bb760ab431.js → webpack-680c8fa1cf6aef64.js} +1 -1
  119. package/.next/trace +89 -89
  120. package/package.json +1 -1
  121. package/.next/server/chunks/1198.js +0 -1
  122. package/.next/server/chunks/2722.js +0 -1
  123. package/.next/server/chunks/5934.js +0 -1
  124. package/.next/server/chunks/6622.js +0 -3
  125. package/.next/static/chunks/1166-5f91e07573aba5c2.js +0 -1
  126. package/.next/static/chunks/1316-fbbc7e5231784e28.js +0 -1
  127. package/.next/static/chunks/1520-eeab8b7f39ffea7b.js +0 -1
  128. package/.next/static/chunks/4108.5478f85adbbd1337.js +0 -1
  129. package/.next/static/chunks/5779-5be906c67d9d3c80.js +0 -1
  130. package/.next/static/chunks/6594-fcdf71ca82322736.js +0 -1
  131. package/.next/static/chunks/app/audit/page-e3445076d462aa80.js +0 -1
  132. package/.next/static/chunks/app/layout-5e299e9b79abfedf.js +0 -1
  133. package/.next/static/chunks/app/onboarding/page-1cde2db95ed14b64.js +0 -1
  134. package/.next/static/chunks/app/roots/[id]/chat/[topicId]/page-5e805f15e4b1cdf6.js +0 -1
  135. package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-9424547b67be2a76.js +0 -1
  136. package/.next/static/chunks/app/roots/[id]/page-c3140c542b7fc06d.js +0 -1
  137. package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-4da7b5a46cbaf70c.js +0 -1
  138. package/.next/static/chunks/app/roots/[id]/workflows/page-e3445076d462aa80.js +0 -1
  139. package/.next/static/chunks/app/roots/new/page-ed360b415bf7fe38.js +0 -1
  140. package/.next/static/chunks/app/settings/page-27ef527431277f6b.js +0 -1
  141. package/.next/static/chunks/app/share/[id]/page-70b32c2d1c5819a4.js +0 -1
  142. package/.next/static/chunks/app/utilities/[scope]/[id]/page-3f219cbd957603ef.js +0 -1
  143. package/.next/static/chunks/app/utilities/page-5f8903782a48ebac.js +0 -1
  144. /package/.next/static/{l_M5u154jKhXKvK6-kjlW → fQIjUyzIepDxqQpzYlf6H}/_buildManifest.js +0 -0
  145. /package/.next/static/{l_M5u154jKhXKvK6-kjlW → fQIjUyzIepDxqQpzYlf6H}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7529],{12734:(e,t,r)=>{r.d(t,{L:()=>$});var a=r(4624),n=r(99356),i=r(49411),l=r(86515),s=r(41234),o=r(71789),c=r(53732),d=r(3606),u=r(31108),m=r(8096),p=r(46972),f=r(16213),g=r(59145),h=r(27474),x=r(39624),v=r(3239),b=r(9721),k=r(84860),w=r(7293),y=r(49623),j=r(64417),N=r(13561),S=r(69285),A=r(56221),C=r(85253),R=r(71651),D=r(13506),F=r(7911);let E=(0,F.createServerReference)("608ee5203aefebf589bd58dfd8c43900d4c01ed245",F.callServer,void 0,F.findSourceMapURL,"searchMentionsAction"),T=[{id:"plan",trigger:"plan",label:"/plan",description:"Show the plan first — Reflex lays out the steps and waits for approval.",kind:"agent-mode",usage:"/plan <task>",icon:"ListChecks"},{id:"goal",trigger:"goal",label:"/goal",description:"Set a goal — Reflex will work toward it on its own, without reminders.",kind:"agent-mode",usage:"/goal <what to achieve>",icon:"Target"},{id:"research",trigger:"research",label:"/research",description:"Deep research on a topic — web search + summary with sources.",kind:"agent-mode",usage:"/research <topic>",icon:"Telescope"},{id:"widget",trigger:"widget",label:"/widget",description:"Create a card on the space dashboard.",kind:"agent-mode",usage:"/widget <what to show>",icon:"LayoutGrid"},{id:"workflow",trigger:"workflow",label:"/workflow",description:"Build a recipe — linear step-based automation for the task.",kind:"agent-mode",usage:"/workflow <what to automate>",icon:"Workflow"},{id:"distill",trigger:"distill",label:"/distill",description:"Pull a URL into the KB — extract key facts, action items, and links to related notes.",kind:"agent-mode",usage:"/distill <url> [focus]",icon:"BookOpenCheck"},{id:"practice",trigger:"practice",label:"/practice",description:"Roleplay a tough conversation — Reflex plays the counterpart and coaches you between turns.",kind:"agent-mode",usage:"/practice <scenario>",icon:"MessagesSquare"},{id:"reflect",trigger:"reflect",label:"/reflect",description:"Daily check-in — three questions adapted to your recent entries, saved as a journal note.",kind:"agent-mode",usage:"/reflect",allowEmpty:!0,icon:"Sunrise"},{id:"remember",trigger:"remember",label:"/remember",description:"Save a note — straight into memory, no AI involved.",kind:"direct",usage:"/remember <what to remember>",icon:"BookmarkPlus"},{id:"mcp",trigger:"mcp",label:"/mcp",description:"Connect an external service (setup wizard opens in chat).",kind:"agent-mode",usage:"/mcp <what you need>",icon:"PackagePlus"},{id:"skill",trigger:"skill",label:"/skill",description:"Attach a role — a ready-made instruction set for this conversation.",kind:"agent-mode",usage:"/skill <role-id> [prompt]",icon:"Sparkles"},{id:"delete-topic",trigger:"delete-topic",label:"/delete-topic",description:"Delete this conversation (with confirmation).",kind:"direct",usage:"/delete-topic",requiresConfirm:!0,allowEmpty:!0,icon:"Trash2"},{id:"clear-project",trigger:"clear-project",label:"/clear-project",description:"DANGER: clear the space — all conversations, cards, memory. Double confirmation.",kind:"direct",usage:"/clear-project",requiresConfirm:!0,allowEmpty:!0,icon:"AlertOctagon"},{id:"util",trigger:"util",label:"/util",description:"Open a mini-app (by partial name or from the list).",kind:"direct",usage:"/util <partial name or id>",allowEmpty:!0,icon:"Boxes"},{id:"help",trigger:"help",label:"/help",description:"List available commands.",kind:"direct",usage:"/help",allowEmpty:!0,icon:"HelpCircle"}],I=(0,F.createServerReference)("4089da0eb10908eaffc0f19af5f23be68cfb1e6168",F.callServer,void 0,F.findSourceMapURL,"listCommandArgsAction"),z=(0,F.createServerReference)("40f41b976c3193a5b210d4c9f576dc49a18ba83def",F.callServer,void 0,F.findSourceMapURL,"listAvailableSlashCommandsAction"),L=(0,F.createServerReference)("60e2998e078a2e9aecd946a7d348dbc509000974fc",F.callServer,void 0,F.findSourceMapURL,"rememberAction"),M=(0,F.createServerReference)("60378711d400f8b208e71c3544e783bf0dd8df6436",F.callServer,void 0,F.findSourceMapURL,"deleteCurrentTopicCommand"),P=(0,F.createServerReference)("60eb7329039f3f7cf212eadac76f0529a5a96488b7",F.callServer,void 0,F.findSourceMapURL,"openUtilityAction"),_=(0,F.createServerReference)("40d7e7a2a225c530451856534a05ad8da3fe90d999",F.callServer,void 0,F.findSourceMapURL,"clearProjectAction");var U=r(63514);let B={ListChecks:l.A,Target:s.A,Telescope:o.A,LayoutGrid:c.A,BookmarkPlus:d.A,PackagePlus:u.A,Sparkles:m.A,Trash2:p.A,AlertOctagon:f.A,HelpCircle:g.A,Workflow:h.A,Boxes:x.A};function $(e){let{rootId:t,topicId:r,placeholder:l,submitLabel:s,pendingLabel:o,SubmitIcon:c,disabled:d,onSubmit:u,active:m,onStop:p,clarifyLabel:f,stopLabel:g}=e,h=(0,i.c)("roots"),x=null!=f?f:h("chatInputForm.clarifyLabel"),w=null!=g?g:h("chatInputForm.stopLabel"),y=(0,S.useRouter)(),[j,N]=(0,n.useState)(""),[F,L]=(0,n.useState)([]),[M,P]=(0,n.useState)(!1),[_,U]=(0,n.useState)(!1),[B,$]=(0,n.useState)(!1),[Z,G]=(0,n.useState)(T);(0,n.useEffect)(()=>{let e=!0;return(async()=>{let r=await z({rootId:t});e&&r.ok&&G(r.commands)})(),()=>{e=!1}},[t]);let Q=(0,n.useRef)(null),V=(0,n.useRef)(null),[J,X]=(0,n.useState)(null),[Y,ee]=(0,n.useState)([]),[et,er]=(0,n.useState)(0),[ea,en]=(0,n.useState)(!1),ei=(0,n.useRef)(0),[el,es]=(0,n.useState)(null),[eo,ec]=(0,n.useState)(null),ed=(0,n.useRef)(0),eu=(0,n.useCallback)(()=>{let e=Q.current;e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,240)+"px")},[]);(0,n.useEffect)(()=>{eu()},[j,eu]);let em=(0,n.useCallback)((e,r)=>{let a=r;for(;a>0;){let t=e[a-1];if("@"===t){a-=1;break}if(/\s/.test(t)){a=-1;break}a-=1}if(a<0||"@"!==e[a]||a>0&&!/\s/.test(e[a-1])){X(null),ee([]);return}let n=e.slice(a+1,r);X({start:a,end:r}),er(0),en(!0);let i=++ei.current;(async()=>{let e=await E(t,n);ei.current===i&&(en(!1),ee(e.ok?e.items:[]))})()},[t]),ep=(0,n.useCallback)(()=>{X(null),ee([]),ei.current++},[]),ef=(0,n.useCallback)((e,r)=>{if(!e.startsWith("/")){es(null),ec(null);return}let a=e.indexOf(" ");if(a<0){ec(null);let t=e.slice(1).toLowerCase(),r=Z.filter(e=>e.trigger.startsWith(t)||e.label.toLowerCase().includes(t)||e.description.toLowerCase().includes(t));es(r.length?{items:r,index:0}:null);return}es(null);let n=e.slice(1,a),i=Z.find(e=>e.trigger===n);if(!i)return void ec(null);let l=a+1,s=r>=l?r:e.length;if(e.slice(s).indexOf(" ")>=0)return void ec(null);let o=e.slice(l,s),c=++ed.current;ec(e=>({cmd:i,items:(null==e?void 0:e.cmd.id)===i.id?e.items:[],index:0,start:l,end:s,loading:!0})),(async()=>{let e=await I({commandId:i.id,query:o,rootId:t});if(ed.current===c){if(!e.ok||!e.supported||0===e.items.length)return ec(null);ec({cmd:i,items:e.items,index:0,start:l,end:s,loading:!1})}})()},[t,Z]),eg=(0,n.useCallback)(()=>{es(null),ec(null)},[]),eh=(0,n.useCallback)(e=>{let t=Q.current;ec(r=>{if(!r)return null;let a=j.slice(0,r.start),n=j.slice(r.end),i="".concat(e.value," ");N(a+i+n);let l=a.length+i.length;return requestAnimationFrame(()=>{t&&(t.focus(),t.setSelectionRange(l,l))}),null})},[j]),ex=(0,n.useCallback)(e=>{let t=Q.current,r="/".concat(e.trigger).concat(e.allowEmpty&&"direct"===e.kind?"":" ");N(r),es(null),requestAnimationFrame(()=>{t&&(t.focus(),t.setSelectionRange(r.length,r.length))})},[]),ev=(0,n.useCallback)(e=>{let t=Q.current;if(!t||!J)return;let r=j.slice(0,J.start),a=j.slice(J.end),n="@".concat(e.relPath," ");N(r+n+a),ep();let i=r.length+n.length;requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(i,i)})},[j,J,ep]),eb=(0,n.useCallback)(async e=>{if(0!==e.length){P(!0);try{let a=new FormData;for(let t of e)a.append("files",t);let n=await fetch("/api/roots/".concat(t,"/attachments"),{method:"POST",body:a});if(!n.ok){var r;let e=await n.json().catch(()=>({}));A.oR.error(null!=(r=e.error)?r:h("chatInputForm.uploadFailed",{status:n.status}));return}let i=await n.json();L(e=>[...e,...i.files])}catch(e){A.oR.error(e instanceof Error?e.message:String(e))}finally{P(!1)}}},[t]),ek=j.trim().length>0||F.length>0,ew=m&&p?ek?"clarify":"stop":"send",ey=(0,n.useCallback)(async()=>{if(_)return;if("stop"===ew){if(!p)return;U(!0);try{await p()}finally{U(!1)}return}let e=j.trim();if(!e&&0===F.length||d&&"send"===ew)return;let a=function(e){var t,r,a;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=e.trim();if(!i.startsWith("/"))return null;let l=/^\/([a-z][a-z0-9-]*)(?:\s+([\s\S]*))?$/.exec(i);if(!l)return null;let s=l[1],o=null!==(t=null!=(a=T.find(e=>e.trigger===s))?a:null)&&void 0!==t?t:n.find(e=>e.trigger===s);return o?{def:o,payload:(null!=(r=l[2])?r:"").trim()}:null}(e);if(a&&"direct"===a.def.kind){U(!0);try{await O({cmd:a.def,payload:a.payload,rootId:t,topicId:r,router:y,t:h}),N("")}finally{U(!1)}return}U(!0);try{"clarify"===ew&&p&&await p(),await u({message:e,attachments:F})&&(N(""),L([]))}finally{U(!1)}},[j,F,_,d,ew,p,u,t,r,y,h]),ej=!_&&!M&&("stop"===ew||ek&&(!d||"clarify"===ew));return(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),ey()},onDragEnter:e=>{Array.from(e.dataTransfer.types).includes("Files")&&(e.preventDefault(),$(!0))},onDragOver:e=>{Array.from(e.dataTransfer.types).includes("Files")&&(e.preventDefault(),$(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||$(!1)},onDrop:e=>{e.preventDefault(),$(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eb(t)},className:(0,D.cn)("space-y-2 rounded-md transition-colors",B&&"ring-2 ring-ring/60 bg-accent/40"),children:[F.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:F.map((e,t)=>(0,a.jsx)(K,{attachment:e,onRemove:()=>L(t=>t.filter(t=>t!==e))},e.absPath+t))}),(0,a.jsxs)("div",{className:"flex items-end gap-2",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(R.T,{ref:Q,value:j,onChange:e=>{N(e.target.value),em(e.target.value,e.target.selectionStart),ef(e.target.value,e.target.selectionStart)},onKeyUp:e=>{let t=e.currentTarget;em(t.value,t.selectionStart),ef(t.value,t.selectionStart)},onClick:e=>{let t=e.currentTarget;em(t.value,t.selectionStart),ef(t.value,t.selectionStart)},onBlur:()=>{setTimeout(()=>{ep(),eg()},150)},onKeyDown:e=>{if(el){if("ArrowDown"===e.key){e.preventDefault(),es(e=>e?{...e,index:Math.min(e.items.length-1,e.index+1)}:null);return}if("ArrowUp"===e.key){e.preventDefault(),es(e=>e?{...e,index:Math.max(0,e.index-1)}:null);return}if("Tab"===e.key){e.preventDefault();let t=el.items[el.index];t&&ex(t);return}if("Escape"===e.key){e.preventDefault(),eg();return}}if(eo&&eo.items.length>0){if("ArrowDown"===e.key){e.preventDefault(),ec(e=>e?{...e,index:Math.min(e.items.length-1,e.index+1)}:null);return}if("ArrowUp"===e.key){e.preventDefault(),ec(e=>e?{...e,index:Math.max(0,e.index-1)}:null);return}if("Tab"===e.key){e.preventDefault();let t=eo.items[eo.index];t&&eh(t);return}if("Escape"===e.key){e.preventDefault(),ec(null);return}}if(J&&Y.length>0){if("ArrowDown"===e.key){e.preventDefault(),er(e=>Math.min(Y.length-1,e+1));return}if("ArrowUp"===e.key){e.preventDefault(),er(e=>Math.max(0,e-1));return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault();let t=Y[et];t&&ev(t);return}if("Escape"===e.key){e.preventDefault(),ep();return}}"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),ey())},onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length>0&&(e.preventDefault(),eb(t))},placeholder:l,rows:1,disabled:d||_,className:"resize-none min-h-[44px] max-h-60 text-base bg-background/70 border-transparent focus-visible:border-ring py-2.5 w-full"}),J&&(0,a.jsx)(H,{items:Y,index:et,loading:ea,onPick:ev,onHover:e=>er(e)}),el&&!J&&(0,a.jsx)(q,{items:el.items,index:el.index,onPick:ex,onHover:e=>es(t=>t?{...t,index:e}:null),topicAvailable:!!r}),eo&&!J&&!el&&(0,a.jsx)(W,{cmd:eo.cmd,items:eo.items,index:eo.index,onPick:eh,onHover:e=>ec(t=>t?{...t,index:e}:null)})]}),(0,a.jsx)("input",{ref:V,type:"file",multiple:!0,className:"hidden",onChange:e=>{var t;let r=Array.from(null!=(t=e.target.files)?t:[]);r.length>0&&eb(r),e.target.value=""}}),(0,a.jsx)(C.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>{var e;return null==(e=V.current)?void 0:e.click()},disabled:M||_||d,title:h("chatInputForm.attachTitle"),className:"h-11 w-11 shrink-0",children:M?(0,a.jsx)(v.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(b.A,{className:"h-4 w-4"})}),(0,a.jsx)(C.$,{type:"submit",size:"lg",disabled:!ej,variant:"stop"===ew?"destructive":"default",className:"h-11 px-6 shadow-md shrink-0",children:_?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{className:"mr-2 h-4 w-4 animate-spin"}),o]}):"stop"===ew?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(k.A,{className:"mr-2 h-4 w-4",fill:"currentColor"}),w]}):"clarify"===ew?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c,{className:"mr-2 h-4 w-4"}),x]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c,{className:"mr-2 h-4 w-4"}),s]})})]}),(0,a.jsx)("div",{className:"text-[10px] text-muted-foreground",children:h("chatInputForm.helperRow")})]})}async function O(e){var t,r,a;let{cmd:n,payload:i,rootId:l,topicId:s,router:o,t:c}=e;if("help"===n.id){let e=T.map(e=>"• ".concat(e.label," — ").concat(e.description));A.oR.info(c("chatInputForm.availableCommands",{list:e.join("\n")}),{duration:12e3});return}if("remember"===n.id){if(!i)return void A.oR.error(c("chatInputForm.rememberEmpty"));let e=await L(l,i);return void(e.ok?(A.oR.success(null!=(t=e.message)?t:c("chatInputForm.savedToKb")),(0,U.$d)(U.Zi.kbChanged(l))):A.oR.error(e.error))}if("delete-topic"===n.id){if(!s)return void A.oR.error(c("chatInputForm.topicOnlyCommand"));if(!confirm(c("chatInputForm.deleteTopicConfirm")))return;let e=await M(l,s);return void(e.ok?(A.oR.success(null!=(r=e.message)?r:c("chatInputForm.deleted")),(0,U.$d)(U.Zi.topicsChanged(l)),e.redirectTo&&o.push(e.redirectTo)):A.oR.error(e.error))}if("util"===n.id){let e=await P(l,i);if(!e.ok)return void A.oR.error(e.error);if("redirect"===e.kind)return void o.push(e.url);let t=e.items.slice(0,8).map(e=>"• ".concat(e.name," (").concat(e.scope,"/").concat(e.id,")")).join("\n");return void A.oR.message(c("chatInputForm.multipleMatches",{list:t}),{duration:12e3})}if("clear-project"===n.id){if(!confirm(c("chatInputForm.clearProjectConfirm")))return;let e=prompt(c("chatInputForm.clearProjectPrompt"));if((null==e?void 0:e.trim().toLowerCase())!==c("chatInputForm.clearProjectPhrase"))return void A.oR.message(c("chatInputForm.confirmFailed"));let t=await _(l);return void(t.ok?(A.oR.success(null!=(a=t.message)?a:c("chatInputForm.projectCleared")),(0,U.$d)(U.Zi.topicsChanged(l)),(0,U.$d)(U.Zi.kbChanged(l)),t.redirectTo&&o.push(t.redirectTo)):A.oR.error(t.error))}A.oR.error(c("chatInputForm.unknownCommand",{label:n.label}))}function q(e){let{items:t,index:r,onPick:n,onHover:l,topicAvailable:s}=e,o=(0,i.c)("roots");return(0,a.jsxs)("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50 max-h-80 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-lg",children:[(0,a.jsx)("div",{className:"px-3 py-1.5 text-[10px] uppercase tracking-wider text-muted-foreground border-b",children:o("chatInputForm.commandsPaletteHeader")}),(0,a.jsx)("ul",{children:t.map((e,t)=>{var i;let c=null!=(i=B[e.icon])?i:m.A,d="delete-topic"===e.id&&!s;return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),d||n(e)},onMouseEnter:()=>l(t),disabled:d,className:(0,D.cn)("w-full flex items-start gap-2 px-3 py-2 text-left",t===r?"bg-accent":"hover:bg-accent/60",d&&"opacity-40 cursor-not-allowed"),children:[(0,a.jsx)(c,{className:(0,D.cn)("h-3.5 w-3.5 mt-0.5 shrink-0","direct"===e.kind?"text-amber-600":"text-violet-600")}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"font-mono text-xs font-medium",children:e.label}),"direct"===e.kind&&(0,a.jsx)("span",{className:"text-[9px] uppercase tracking-wider text-amber-700",children:o("chatInputForm.directAction")}),e.requiresConfirm&&(0,a.jsx)("span",{className:"text-[9px] uppercase tracking-wider text-destructive",children:o("chatInputForm.withConfirm")})]}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug mt-0.5",children:e.description}),(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground/80 font-mono mt-0.5",children:e.usage})]})]})},e.id)})})]})}function H(e){let{items:t,index:r,loading:n,onPick:l,onHover:s}=e,o=(0,i.c)("roots");return(0,a.jsx)("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50 max-h-72 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-lg",children:n&&0===t.length?(0,a.jsxs)("div",{className:"px-3 py-2 text-xs text-muted-foreground flex items-center gap-2",children:[(0,a.jsx)(v.A,{className:"h-3 w-3 animate-spin"})," ",o("chatInputForm.mentionSearching")]}):0===t.length?(0,a.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground italic",children:o("chatInputForm.mentionNothing")}):(0,a.jsx)("ul",{children:t.map((e,t)=>{let n="kb"===e.kind?w.A:y.A;return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),l(e)},onMouseEnter:()=>s(t),className:(0,D.cn)("w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left",t===r?"bg-accent":"hover:bg-accent/60"),children:[(0,a.jsx)(n,{className:(0,D.cn)("h-3.5 w-3.5 shrink-0","kb"===e.kind?"text-primary":"text-muted-foreground")}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"truncate font-mono text-xs",children:e.relPath}),e.parent&&(0,a.jsx)("div",{className:"truncate text-[10px] text-muted-foreground",children:e.parent})]}),(0,a.jsx)("span",{className:(0,D.cn)("text-[10px] uppercase tracking-wider shrink-0","kb"===e.kind?"text-primary":"text-muted-foreground"),children:e.kind})]})},e.absPath)})})})}function K(e){var t;let{attachment:r,onRemove:n}=e,i=r.mime.startsWith("image/")?j.A:y.A;return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-1 text-[11px] max-w-[18rem]",children:[(0,a.jsx)(i,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate",title:r.name,children:r.name}),(0,a.jsx)("span",{className:"text-muted-foreground",children:(t=r.size)<1024?"".concat(t," B"):t<1048576?"".concat((t/1024).toFixed(1)," KB"):"".concat((t/1048576).toFixed(1)," MB")}),(0,a.jsx)("button",{type:"button",onClick:n,className:"ml-0.5 text-muted-foreground hover:text-foreground",children:(0,a.jsx)(N.A,{className:"h-3 w-3"})})]})}function W(e){var t;let{cmd:r,items:n,index:i,onPick:l,onHover:s}=e,o=null!=(t=B[r.icon])?t:m.A;return(0,a.jsxs)("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50 max-h-80 overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-lg",children:[(0,a.jsxs)("div",{className:"px-3 py-1.5 text-[10px] uppercase tracking-wider text-muted-foreground border-b flex items-center gap-2",children:[(0,a.jsx)(o,{className:"h-3 w-3"}),(0,a.jsxs)("span",{children:[r.label," \xb7 ",r.usage.replace(/^\/\S+\s*/,"")]})]}),(0,a.jsx)("ul",{children:n.map((e,t)=>(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),l(e)},onMouseEnter:()=>s(t),className:(0,D.cn)("w-full flex items-start gap-2 px-3 py-2 text-left",t===i?"bg-accent":"hover:bg-accent/60"),children:[(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 mt-0.5 shrink-0 text-violet-600"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"font-medium text-sm",children:e.label}),(0,a.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.value})]}),e.description&&(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground leading-snug mt-0.5 line-clamp-2",children:e.description})]})]})},e.value))})]})}},13506:(e,t,r)=>{r.d(t,{cn:()=>i});var a=r(47989),n=r(55701);function i(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.QP)((0,a.$)(t))}},63514:(e,t,r)=>{r.d(t,{$d:()=>i,S9:()=>l,Zi:()=>n});var a=r(99356);let n={rootsChanged:"reflex:roots-changed",topicsChanged:e=>"reflex:topics-changed:".concat(e),kbChanged:e=>"reflex:kb-changed:".concat(e)};function i(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}function l(e,t){(0,a.useEffect)(()=>{let r=e=>t(e.detail);return window.addEventListener(e,r),()=>window.removeEventListener(e,r)},[e,t])}},63602:(e,t,r)=>{r.d(t,{E:()=>l});var a=r(4624),n=r(49411),i=r(8096);function l(e){let{label:t,headerRight:r,children:l}=e,s=(0,n.c)("roots"),o=null!=t?t:s("commandBarFrame.label");return(0,a.jsx)("div",{className:"border-t bg-background",children:(0,a.jsx)("div",{className:"mx-auto max-w-3xl px-6 py-5",children:(0,a.jsx)("div",{className:"reflex-gradient rounded-2xl p-[2px] shadow-[0_8px_40px_-12px_oklch(0.55_0.2_290/0.45)]",children:(0,a.jsxs)("div",{className:"rounded-[14px] bg-background/85 backdrop-blur-xl px-5 py-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:"reflex-gradient inline-flex h-6 w-6 items-center justify-center rounded-full text-white shadow-sm",children:(0,a.jsx)(i.A,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:o}),r&&(0,a.jsx)("span",{className:"ml-auto flex items-center gap-1",children:r})]}),l]})})})})}},71651:(e,t,r)=>{r.d(t,{T:()=>i});var a=r(4624);r(99356);var n=r(13506);function i(e){let{className:t,...r}=e;return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,n.cn)("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",t),...r})}},85253:(e,t,r)=>{r.d(t,{$:()=>o});var a=r(4624);r(99356);var n=r(60621),i=r(50362),l=r(13506);let s=(0,n.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function o(e){let{className:t,variant:r="default",size:n="default",asChild:o=!1,...c}=e,d=o?i.bL:"button";return(0,a.jsx)(d,{"data-slot":"button","data-variant":r,"data-size":n,className:(0,l.cn)(s({variant:r,size:n,className:t})),...c})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7544],{3239:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(45804).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},8096:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(45804).A)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},13561:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(45804).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},39783:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(45804).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},79182:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(45804).A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},95265:(e,t,r)=>{r.d(t,{A:()=>l});let l=(0,r(45804).A)("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])},97544:(e,t,r)=>{r.d(t,{UtilityIframe:()=>w});var l=r(4624),s=r(99356),a=r(79182),n=r(49411),i=r(39783),o=r(13561),c=r(8096),u=r(3239),d=r(95265),p=r(54400),h=r.n(p),m=r(56221),x=r(7911);let f=(0,x.createServerReference)("405cdcdcb0153357309cbdfd6ea4f78daa27ecf5f6",x.callServer,void 0,x.findSourceMapURL,"getOrCreateUtilityHelperTopicAction"),y=(0,x.createServerReference)("60d39ef1f029bc97175fe7e6620d90366a0f9201ea",x.callServer,void 0,x.findSourceMapURL,"loadHelperTranscriptAction");function v(e){let{scope:t,utilityId:r,utilityName:p,rootId:x,requestSnapshot:v,onClose:w}=e,b=(0,n.c)("app"),[j,k]=(0,s.useState)(null),[N,S]=(0,s.useState)([]),[A,M]=(0,s.useState)(""),[T,E]=(0,s.useState)(null),[R,C]=(0,s.useTransition)(),[L,H]=(0,s.useState)(!1),O=(0,s.useRef)(null),I=(0,s.useRef)(null),P=(0,s.useRef)(""),[q,z]=(0,s.useState)("");(0,s.useEffect)(()=>{if(!x)return void E(b("utilities.helper.projectOnly"));let e=!1;return(async()=>{let t=await f({rootId:x,utilityId:r,utilityName:null!=p?p:r});if(e)return;if(!t.ok)return E(t.error);k(t.topicId);let l=await y(x,t.topicId);!e&&l.ok&&S(l.messages)})(),()=>{e=!0}},[x,r,p]),(0,s.useEffect)(()=>{if(!x||!j)return;let e=new EventSource("/api/roots/".concat(x,"/chat/").concat(j,"/stream?since=").concat(Number.MAX_SAFE_INTEGER));return I.current=e,e.addEventListener("event",e=>{try{let t=JSON.parse(e.data);"assistant-delta"===t.type&&"string"==typeof t.text?(P.current+=t.text,z(P.current),H(!0)):"turn-end"===t.type||"agent-end"===t.type?(P.current="",z(""),H(!1),(async()=>{let e=await y(x,j);e.ok&&S(e.messages)})()):t.type}catch(e){}}),e.onerror=()=>{},()=>{e.close(),I.current=null}},[x,j]),(0,s.useEffect)(()=>{let e=O.current;e&&(e.scrollTop=e.scrollHeight)},[N,q]);let _=()=>{let e=A.trim();e&&x&&j&&(M(""),S(t=>[...t,{role:"user",text:e,ts:new Date().toISOString()}]),C(async()=>{let t;try{t=await Promise.race([v(),new Promise(e=>setTimeout(()=>e(void 0),600))])}catch(e){}let r=void 0!==t?function(e,t){let r;try{r="string"==typeof t?t:JSON.stringify(t,null,2)}catch(e){r=String(t)}return r.length>4e3&&(r=r.slice(0,4e3)+"\n…[truncated]"),["[Mini-app context]",r,"[/context]\n",e].join("\n")}(e,t):e;try{let e=await fetch("/api/roots/".concat(x,"/chat/").concat(j,"/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:r})});if(!e.ok){var l;let t=await e.json().catch(()=>({}));m.oR.error(null!=(l=t.error)?l:"HTTP ".concat(e.status))}}catch(e){m.oR.error(String(e))}}))};return(0,l.jsxs)("aside",{className:"flex h-full flex-col border-l bg-card",children:[(0,l.jsxs)("header",{className:"border-b px-3 py-2 flex items-center gap-2",children:[(0,l.jsx)(a.A,{className:"h-3.5 w-3.5 text-violet-600"}),(0,l.jsx)("span",{className:"text-sm font-medium",children:b("utilities.helper.title")}),(0,l.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:b("utilities.helper.hint")}),x&&j&&(0,l.jsx)(h(),{href:"/roots/".concat(x,"/chat/").concat(j),className:"ml-auto p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:b("utilities.helper.openFull"),children:(0,l.jsx)(i.A,{className:"h-3.5 w-3.5"})}),w&&(0,l.jsx)("button",{type:"button",onClick:w,className:"p-1 rounded hover:bg-accent "+(x&&j?"":"ml-auto"),title:b("utilities.helper.hide"),children:(0,l.jsx)(o.A,{className:"h-3.5 w-3.5"})})]}),(0,l.jsxs)("div",{ref:O,className:"flex-1 overflow-y-auto px-3 py-2 space-y-2 text-sm",children:[T&&(0,l.jsx)("p",{className:"text-xs text-red-600",children:T}),!T&&0===N.length&&!q&&(0,l.jsxs)("div",{className:"text-xs text-muted-foreground flex items-start gap-2",children:[(0,l.jsx)(c.A,{className:"h-3 w-3 mt-0.5 text-violet-600 shrink-0"}),(0,l.jsx)("span",{children:b("utilities.helper.welcome")})]}),N.map((e,t)=>(0,l.jsx)(g,{role:e.role,text:e.text},t)),L&&q&&(0,l.jsx)(g,{role:"assistant",text:q,streaming:!0}),R&&!L&&(0,l.jsxs)("div",{className:"mr-6 rounded-md bg-muted/40 px-2 py-1.5 text-xs text-muted-foreground inline-flex items-center gap-2",children:[(0,l.jsx)(u.A,{className:"h-3 w-3 animate-spin"}),b("utilities.helper.thinking")]})]}),(0,l.jsxs)("div",{className:"border-t px-3 py-2 flex items-end gap-1.5",children:[(0,l.jsx)("textarea",{value:A,onChange:e=>M(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())},rows:1,placeholder:b("utilities.helper.placeholder"),disabled:R||!!T||!j,className:"flex-1 resize-none rounded border bg-background px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400 max-h-24"}),(0,l.jsx)("button",{type:"button",onClick:_,disabled:R||!A.trim()||!!T||!j,className:"inline-flex items-center justify-center rounded bg-violet-600 px-2 py-1 text-white hover:bg-violet-700 disabled:opacity-50",children:R?(0,l.jsx)(u.A,{className:"h-3 w-3 animate-spin"}):(0,l.jsx)(d.A,{className:"h-3 w-3"})})]})]})}function g(e){let{role:t,text:r,streaming:s}=e,a=(0,n.c)("app"),i=r;return("user"===t&&(i=i.replace(/^\s*\[Mini-app context\][\s\S]*?\[\/context\]\s*/,"").trim()),i.trim())?(0,l.jsxs)("div",{className:"user"===t?"ml-6 rounded-md bg-violet-50 dark:bg-violet-950/30 px-2 py-1.5":"mr-6 rounded-md bg-muted/40 px-2 py-1.5 whitespace-pre-wrap",children:[(0,l.jsxs)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:[a("user"===t?"utilities.helper.you":"assistant"===t?"utilities.helper.reflex":"utilities.helper.system"),s&&(0,l.jsx)("span",{className:"ml-1 text-violet-600",children:"●"})]}),i]}):null}function w(e){let{scope:t,id:r,rootId:i,className:o,title:c,agentChat:u,utilityName:d}=e,p=(0,n.c)("app"),h=(0,s.useRef)(null),m=(0,s.useRef)(null),[x,f]=(0,s.useState)(!0),y=i?"?rootId=".concat(encodeURIComponent(i)):"",g="/api/utilities/".concat(t,"/").concat(r,"/iframe").concat(y),w="/api/utilities/".concat(t,"/").concat(r,"/host").concat(y);(0,s.useEffect)(()=>{let e=async e=>{var t,r,l,s,a,n;let i=e.data;if(!i||e.source!==(null==(t=h.current)?void 0:t.contentWindow))return;if("snapshot-payload"===i.type){let e=m.current;e&&(clearTimeout(e.timer),m.current=null,e.resolve(i.snapshot));return}if("host-rpc"!==i.type)return;let o=i.id;try{let e=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:i.method,args:i.args})}),t=await e.json();null==(l=h.current)||null==(r=l.contentWindow)||r.postMessage(t.ok?{type:"host-rpc-result",id:o,ok:!0,result:t.result}:{type:"host-rpc-result",id:o,ok:!1,error:null!=(s=t.error)?s:"HTTP ".concat(e.status)},"*")}catch(e){null==(n=h.current)||null==(a=n.contentWindow)||a.postMessage({type:"host-rpc-result",id:o,ok:!1,error:e instanceof Error?e.message:String(e)},"*")}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[w]);let b=(0,l.jsx)("iframe",{ref:h,src:g,sandbox:"allow-scripts allow-forms allow-same-origin",className:null!=o?o:"h-full w-full border-0 bg-white",title:null!=c?c:"utility-".concat(r)});return u?(0,l.jsxs)("div",{className:"flex h-full w-full",children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0 relative",children:[b,!x&&(0,l.jsxs)("button",{type:"button",onClick:()=>f(!0),className:"absolute right-3 bottom-3 inline-flex items-center gap-1 rounded-full bg-violet-600 px-3 py-1.5 text-xs text-white shadow-lg hover:bg-violet-700",title:p("utilities.iframe.openHelper"),children:[(0,l.jsx)(a.A,{className:"h-3.5 w-3.5"}),p("utilities.iframe.helper")]})]}),x&&(0,l.jsx)("div",{className:"w-80 shrink-0",children:(0,l.jsx)(v,{scope:t,utilityId:r,...d?{utilityName:d}:{},...i?{rootId:i}:{},requestSnapshot:()=>{var e;let t=null==(e=h.current)?void 0:e.contentWindow;return t?(m.current&&(clearTimeout(m.current.timer),m.current.resolve(void 0),m.current=null),new Promise(e=>{let r=setTimeout(()=>{var t;(null==(t=m.current)?void 0:t.resolve)===e&&(m.current=null,e(void 0))},500);m.current={resolve:e,timer:r};try{t.postMessage({type:"request-snapshot"},"*")}catch(t){clearTimeout(r),m.current=null,e(void 0)}})):Promise.resolve(void 0)},onClose:()=>f(!1)})})]}):b}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[83],{11981:(e,t,r)=>{r.d(t,{t:()=>n});var a=r(7911);let n=(0,a.createServerReference)("602e9230549d15e3e2d7dbc093d910cb29119eddce",a.callServer,void 0,a.findSourceMapURL,"restoreWidgetAction")},66987:(e,t,r)=>{r.d(t,{v:()=>q});var a=r(4624),n=r(49411),s=r(5847),l=r(99356),i=r(87738),o=r(39783),c=r(43153),d=r(13561),u=r(41695),p=r(46972),m=r(84630),x=r(96447),h=r(54207),g=r(84860),f=r(41379),b=r(3239),v=r(85253),y=r(15523),j=r(64681),N=r(54400),w=r.n(N),k=r(49623),W=r(85785),C=r(43863),A=r(57308),S=r(35285),F=r(9598),R=r(56221),T=r(68682);function L(e){let{service:t,size:r=18,className:n}=e;return(0,a.jsx)("span",{className:"inline-flex items-center justify-center rounded-[5px] font-bold leading-none text-white shrink-0 "+(null!=n?n:""),style:{background:t.brand,width:r,height:r,fontSize:Math.max(8,Math.floor(.55*r)),letterSpacing:t.glyph.length>1?"-0.05em":"0"},"aria-hidden":!0,children:t.glyph})}var z=r(7911);let M=(0,z.createServerReference)("0071b07333e7efbb4f929e627e50a711f18f1be62e",z.callServer,void 0,z.findSourceMapURL,"getEnabledMapServicesAction"),U="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",E="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js";function I(e){let{point:t,services:r,interactive:s,onRemove:l}=e,i=(0,n.c)("roots");return(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[r.slice(0,4).map(e=>(0,a.jsx)("a",{href:e.urlFor(t.lat,t.lng),target:"_blank",rel:"noopener noreferrer",className:"rounded p-0.5 hover:ring-1 hover:ring-offset-1 hover:ring-violet-300",title:i("mapWidget.navigationTitle",{service:e.label}),children:(0,a.jsx)(L,{service:e,size:18})},e.id)),(0,a.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText("".concat(t.lat,", ").concat(t.lng)).then(()=>R.oR.success(i("mapWidget.coordsCopied"))).catch(()=>R.oR.error(i("mapWidget.clipboardUnavailable")))},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:i("mapWidget.copyCoords"),children:(0,a.jsx)(F.A,{className:"h-3 w-3"})}),s&&(0,a.jsx)("button",{type:"button",onClick:l,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-destructive",title:i("mapWidget.removePoint"),children:(0,a.jsx)(d.A,{className:"h-3 w-3"})})]})}function O(e){let{service:t,stops:r}=e,s=(0,n.c)("roots"),l=t.routeUrlFor(r),i=e=>{e.preventDefault(),e.stopPropagation(),navigator.clipboard.writeText(l).then(()=>R.oR.success(s("mapWidget.linkCopied",{service:t.label}))).catch(()=>R.oR.error(s("mapWidget.clipboardUnavailable")))};return(0,a.jsxs)("a",{href:l,target:"_blank",rel:"noopener noreferrer",onContextMenu:i,className:"inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[11px] hover:bg-accent",title:s("mapWidget.openTitle",{service:t.label}),children:[(0,a.jsx)(L,{service:t,size:16}),(0,a.jsx)("span",{className:"truncate max-w-[80px]",children:t.label}),(0,a.jsx)("button",{type:"button",onClick:i,className:"text-muted-foreground hover:text-foreground",title:s("mapWidget.copyLinkTitle"),children:(0,a.jsx)(F.A,{className:"h-2.5 w-2.5"})})]})}var _=r(8096);let P={markdown:function(e){var t;let{data:r}=e;return(0,a.jsx)("div",{className:"text-sm",children:(0,a.jsx)(s.p,{source:null!=(t=r.body)?t:""})})},"news-list":function(e){var t;let{data:r,readonly:s,onPatch:u}=e,p=(0,n.c)("roots"),m=null!=(t=r.items)?t:[],[x,h]=(0,l.useState)(m),[g,f]=(0,l.useTransition)(),b=(0,l.useRef)("");(0,l.useEffect)(()=>{let e=JSON.stringify(m);e!==b.current&&(b.current=e,h(m))},[r]);let v=e=>{h(e),u&&f(async()=>{try{await u({items:e})}catch(e){}})};return 0===x.length?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:p("newsListWidget.empty")}):(0,a.jsx)("ul",{className:"space-y-2",children:x.map((e,t)=>(0,a.jsxs)("li",{className:"group/row relative border-l-2 pl-2.5 py-0.5 transition ".concat(e.read?"border-muted-foreground/30 opacity-60":"border-violet-200"),children:[(0,a.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,a.jsx)(i.A,{className:"h-3 w-3 mt-1 shrink-0 ".concat(e.read?"text-muted-foreground":"text-violet-600")}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 pr-12",children:[e.url?(0,a.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[e.title,(0,a.jsx)(o.A,{className:"h-3 w-3 opacity-50"})]}):(0,a.jsx)("span",{className:"text-sm font-medium",children:e.title}),e.summary&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:e.summary}),(e.source||e.date)&&(0,a.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-0.5 flex gap-1.5",children:[e.source&&(0,a.jsx)("span",{children:e.source}),e.source&&e.date&&(0,a.jsx)("span",{children:"\xb7"}),e.date&&(0,a.jsx)("span",{className:"font-mono",children:e.date})]})]})]}),!s&&(0,a.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{!s&&v(x.map((e,r)=>r===t?{...e,read:!e.read}:e))},disabled:g,"aria-label":e.read?p("newsListWidget.markUnreadAria"):p("newsListWidget.markReadAria"),title:e.read?p("newsListWidget.markUnreadTitle"):p("newsListWidget.markReadTitle"),className:"p-1 rounded hover:bg-emerald-100 dark:hover:bg-emerald-950/40 text-muted-foreground hover:text-emerald-600 disabled:opacity-30",children:(0,a.jsx)(c.A,{className:"h-3 w-3"})}),(0,a.jsx)("button",{type:"button",onClick:()=>{!s&&v(x.filter((e,r)=>r!==t))},disabled:g,"aria-label":p("newsListWidget.dismissAria"),title:p("newsListWidget.dismissTitle"),className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(d.A,{className:"h-3 w-3"})})]})]},t))})},"link-list":function(e){var t;let{data:r,readonly:s,onPatch:i}=e,c=(0,n.c)("roots"),d=null!=(t=r.items)?t:[],[m,x]=(0,l.useState)(d),[h,g]=(0,l.useTransition)(),f=(0,l.useRef)("");return((0,l.useEffect)(()=>{let e=JSON.stringify(d);e!==f.current&&(f.current=e,x(d))},[r]),0===m.length)?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:c("linkListWidget.empty")}):(0,a.jsx)("ul",{className:"space-y-0.5",children:m.map((e,t)=>(0,a.jsxs)("li",{className:"group/row relative",children:[(0,a.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-start gap-1.5 rounded-md px-2 py-1.5 hover:bg-accent/40 transition",children:[(0,a.jsx)(u.A,{className:"h-3 w-3 mt-1 shrink-0 text-sky-600"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[e.title,(0,a.jsx)(o.A,{className:"h-3 w-3 opacity-50"})]}),e.hint&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:e.hint}),(0,a.jsx)("div",{className:"text-[10px] text-muted-foreground truncate font-mono mt-0.5",children:e.url})]})]}),!s&&(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{if(!s){var t;x(t=m.filter((t,r)=>r!==e)),i&&g(async()=>{try{await i({items:t})}catch(e){}})}})(t),disabled:h,"aria-label":c("linkListWidget.removeAria"),className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(p.A,{className:"h-3 w-3"})})]},t))})},kpi:function(e){var t;let{data:r}=e,s=(0,n.c)("roots"),l=null!=(t=r.items)?t:[];if(0===l.length)return(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:s("kpiWidget.empty")});let i=Math.min(l.length,3);return(0,a.jsx)("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(".concat(i,", minmax(0,1fr))")},children:l.map((e,t)=>(0,a.jsxs)("div",{className:"rounded-md border bg-card px-3 py-2 flex flex-col gap-0.5",children:[(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:e.label}),(0,a.jsxs)("div",{className:"flex items-baseline gap-1",children:[(0,a.jsx)("span",{className:"text-lg font-semibold tabular-nums",children:e.value}),"up"===e.delta&&(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 text-emerald-600"}),"down"===e.delta&&(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 text-rose-600"}),"flat"===e.delta&&(0,a.jsx)(h.A,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.hint&&(0,a.jsx)("div",{className:"text-[10px] text-muted-foreground leading-snug",children:e.hint})]},t))})},checklist:function(e){var t;let{data:r,readonly:s,onPatch:i}=e,o=(0,n.c)("roots"),d=null!=(t=r.items)?t:[],[u,m]=(0,l.useState)(d),[x,h]=(0,l.useTransition)(),[j,N]=(0,l.useState)(""),w=(0,l.useRef)("");(0,l.useEffect)(()=>{let e=JSON.stringify(d);e!==w.current&&(w.current=e,m(d))},[r]);let k=e=>{m(e),i&&h(async()=>{try{await i({items:e})}catch(e){}})},W=e=>{s||k(u.map((t,r)=>r===e?{...t,done:!t.done}:t))};return 0===u.length&&s?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:o("checklistWidget.empty")}):(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("ul",{className:"space-y-0.5",children:u.map((e,t)=>(0,a.jsxs)("li",{className:"group/row flex items-start gap-2 text-sm py-0.5 rounded hover:bg-accent/30 px-1 -mx-1 ".concat(e.done?"text-muted-foreground":""),children:[(0,a.jsx)("button",{type:"button",onClick:()=>W(t),disabled:s||x,"aria-label":e.done?o("checklistWidget.uncheckAria"):o("checklistWidget.checkAria"),className:"shrink-0 mt-0.5 disabled:opacity-50",children:e.done?(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 text-emerald-600"}):(0,a.jsx)(g.A,{className:"h-3.5 w-3.5 text-muted-foreground/60 hover:text-foreground"})}),(0,a.jsx)("span",{className:"flex-1 min-w-0 break-words ".concat(e.done?"line-through":""),onClick:()=>W(t),style:s?{}:{cursor:"pointer"},children:e.text}),!s&&(0,a.jsx)("button",{type:"button",onClick:()=>{!s&&k(u.filter((e,r)=>r!==t))},disabled:x,"aria-label":o("checklistWidget.removeAria"),className:"opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0 p-0.5 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(p.A,{className:"h-3 w-3"})})]},t))}),!s&&(0,a.jsxs)("form",{className:"flex items-center gap-1 pt-1",onSubmit:e=>{e.preventDefault(),(()=>{if(s)return;let e=j.trim();e&&(k([...u,{text:e,done:!1}]),N(""))})()},children:[(0,a.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,a.jsx)(y.p,{value:j,onChange:e=>N(e.target.value),placeholder:o("checklistWidget.newItemPlaceholder"),className:"h-7 text-xs flex-1 border-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 px-1",disabled:x}),j.trim()&&(0,a.jsx)(v.$,{type:"submit",size:"sm",variant:"ghost",className:"h-6 text-[10px] px-1.5",disabled:x,children:x?(0,a.jsx)(b.A,{className:"h-3 w-3 animate-spin"}):o("checklistWidget.add")})]})]})},quote:function(e){let{data:t}=e,r=(0,n.c)("roots");return(null==t?void 0:t.text)?(0,a.jsxs)("figure",{className:"relative pl-6",children:[(0,a.jsx)(j.A,{className:"h-5 w-5 absolute left-0 top-0 text-violet-300"}),(0,a.jsx)("blockquote",{className:"text-sm italic leading-relaxed",children:t.text}),t.attribution&&(0,a.jsxs)("figcaption",{className:"text-xs text-muted-foreground mt-1.5",children:["— ",t.attribution]})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:r("quoteWidget.empty")})},"kb-pinned":function(e){var t;let{rootId:r,data:s,readonly:i,onPatch:o}=e,c=(0,n.c)("roots"),u=null!=(t=s.items)?t:[],[p,m]=(0,l.useState)(u),[x,h]=(0,l.useTransition)(),g=(0,l.useRef)("");return((0,l.useEffect)(()=>{let e=JSON.stringify(u);e!==g.current&&(g.current=e,m(u))},[s]),0===p.length)?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:c("kbPinnedWidget.empty")}):(0,a.jsx)("ul",{className:"space-y-1",children:p.map((e,t)=>{var n;let s=e.rel.split("/").map(encodeURIComponent).join("/");return(0,a.jsxs)("li",{className:"group/row relative",children:[(0,a.jsxs)(w(),{href:"/roots/".concat(r,"/kb/").concat(s),className:"flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent/40 transition pr-7",children:[(0,a.jsx)(k.A,{className:"h-3 w-3 mt-0.5 shrink-0 text-emerald-700"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium truncate",children:null!=(n=e.title)?n:e.rel}),e.snippet&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed mt-0.5",children:e.snippet}),(0,a.jsx)("div",{className:"text-[10px] text-muted-foreground font-mono mt-0.5 truncate",children:e.rel})]})]}),!i&&(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{if(!i){var t;m(t=p.filter((t,r)=>r!==e)),o&&h(async()=>{try{await o({items:t})}catch(e){}})}})(t),disabled:x,"aria-label":c("kbPinnedWidget.unpinAria"),title:c("kbPinnedWidget.unpinTitle"),className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,a.jsx)(d.A,{className:"h-3 w-3"})})]},t)})})},progress:function(e){var t;let{data:r,readonly:s,onPatch:i}=e,o=(0,n.c)("roots"),c=null!=(t=r.items)?t:[],[d,u]=(0,l.useState)(c),[p,m]=(0,l.useTransition)(),x=(0,l.useRef)("");(0,l.useEffect)(()=>{let e=JSON.stringify(c);e!==x.current&&(x.current=e,u(c))},[r]);let h=(e,t)=>{if(!s){var r;u(r=d.map((r,a)=>a===e?{...r,current:Math.max(0,r.current+t)}:r)),i&&m(async()=>{try{await i({items:r})}catch(e){}})}};return 0===d.length?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:o("progressWidget.empty")}):(0,a.jsx)("ul",{className:"space-y-2.5",children:d.map((e,t)=>{let r=e.target>0?Math.max(0,Math.min(100,e.current/e.target*100)):0;return(0,a.jsxs)("li",{className:"space-y-1 group/row",children:[(0,a.jsxs)("div",{className:"flex items-baseline justify-between gap-2 text-sm",children:[(0,a.jsx)("span",{className:"truncate flex-1 min-w-0",children:e.label}),!s&&(0,a.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0",children:[(0,a.jsx)("button",{type:"button",onClick:()=>h(t,-1),disabled:p||e.current<=0,"aria-label":"−1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,a.jsx)(W.A,{className:"h-3 w-3"})}),(0,a.jsx)("button",{type:"button",onClick:()=>h(t,1),disabled:p,"aria-label":"+1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,a.jsx)(f.A,{className:"h-3 w-3"})})]}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:[e.current," / ",e.target,e.unit?" ".concat(e.unit):""]})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-muted overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-violet-600 transition-all",style:{width:"".concat(r,"%")}})})]},t)})})},image:function(e){var t;let{data:r}=e,s=(0,n.c)("roots");return(null==r?void 0:r.url)?(0,a.jsxs)("figure",{className:"space-y-1",children:[(0,a.jsx)("img",{src:r.url,alt:null!=(t=r.alt)?t:"",className:"rounded-md w-full h-auto border",loading:"lazy"}),r.caption&&(0,a.jsx)("figcaption",{className:"text-xs text-muted-foreground text-center",children:r.caption})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:s("imageWidget.empty")})},"stat-table":function(e){var t;let{data:r}=e,s=(0,n.c)("roots"),l=null!=(t=r.rows)?t:[];return 0===l.length?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:s("statTableWidget.empty")}):(0,a.jsx)("div",{className:"overflow-x-auto -mx-1",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[r.columns&&r.columns.length>0&&(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{className:"border-b",children:r.columns.map((e,t)=>(0,a.jsx)("th",{className:"text-left text-[10px] uppercase tracking-wider text-muted-foreground font-medium px-1.5 py-1.5",children:e},t))})}),(0,a.jsx)("tbody",{children:l.map((e,t)=>(0,a.jsx)("tr",{className:"border-b border-dashed last:border-b-0 hover:bg-accent/30",children:e.map((e,t)=>(0,a.jsx)("td",{className:"px-1.5 py-1.5 align-top",children:e},t))},t))})]})})},map:function(e){var t,r,s;let{data:i,readonly:o,onPatch:c}=e,u=(0,n.c)("roots"),m=(0,l.useRef)(null),x=(0,l.useRef)(null),[h,g]=(0,l.useState)(!1),[v,y]=(0,l.useState)(T.JY),[j,N]=(0,l.useState)(""),[w,k]=(0,l.useState)(!1),[W,F]=(0,l.useState)([]),[L,z]=(0,l.useState)(!1),[_,P]=(0,l.useState)([]),q=null!=(r=i.points)?r:[],B=null!=(s=null==(t=i.route)?void 0:t.stops)?s:[],D=L?_:B,J=(0,l.useMemo)(()=>D.map(e=>q[e]).filter(e=>!!e).map(e=>({lat:e.lat,lng:e.lng})),[D,q]),G=(0,l.useMemo)(()=>T.yp.filter(e=>v.includes(e.id)),[v]);(0,l.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await M();!e&&t.ok&&y(t.enabled)}catch(e){}})(),()=>{e=!0}},[]),(0,l.useEffect)(()=>{if(window.L)return void g(!0);if(!document.querySelector('link[href="'.concat(U,'"]'))){let e=document.createElement("link");e.rel="stylesheet",e.href=U,document.head.appendChild(e)}let e=document.querySelector('script[src="'.concat(E,'"]'));if(e){e.addEventListener("load",()=>g(!0)),window.L&&g(!0);return}let t=document.createElement("script");t.src=E,t.async=!0,t.onload=()=>g(!0),t.onerror=()=>R.oR.error(u("mapWidget.leafletLoadFailed")),document.head.appendChild(t)},[]),(0,l.useEffect)(()=>{var e,t,r;if(!h||!m.current)return;let a=window.L;if(!a||(x.current&&(x.current.remove(),x.current=null),0===q.length))return;let n=a.map(m.current,{scrollWheelZoom:!1,zoomControl:!0});x.current=n,a.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(n);let s=q.map((e,t)=>{let r=D.includes(t),s=function(e,t,r){let a=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),n=t.map(t=>{let r=t.urlFor(e.lat,e.lng);return'<a href="'.concat(a(r),'" target="_blank" rel="noopener noreferrer" ')+'title="'.concat(a(t.label),'" ')+'style="display:inline-flex;align-items:center;gap:4px;margin:2px 4px 2px 0;padding:2px 6px;border-radius:5px;border:1px solid #e5e7eb;text-decoration:none;font-size:11px;color:#111;background:#fff;">'+'<span style="display:inline-block;width:14px;height:14px;border-radius:3px;background:'.concat(t.brand,";")+"color:#fff;font-size:9px;font-weight:700;line-height:14px;text-align:center;"+"letter-spacing:".concat(t.glyph.length>1?"-0.05em":"0",'">').concat(a(t.glyph),"</span>")+"<span>".concat(a(t.label),"</span>")+"</a>"}).join("");return['<div style="font-family:inherit;min-width:200px">','<div style="font-weight:600;font-size:13px;margin-bottom:2px">'.concat(a(e.title),"</div>"),e.description?'<div style="font-size:12px;color:#666;margin-bottom:6px">'.concat(a(e.description),"</div>"):"",'<div style="font-family:monospace;font-size:10px;color:#888;margin-bottom:6px">'.concat(e.lat.toFixed(5),", ").concat(e.lng.toFixed(5),"</div>"),t.length>0?'<div style="font-size:10px;color:#888;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:2px">'.concat(a(r.openIn),"</div>").concat(n):"",'<div style="margin-top:6px"><button type="button" data-reflex-copy="'.concat(e.lat,", ").concat(e.lng,'" style="font-size:11px;padding:2px 8px;border:1px solid #ddd;border-radius:4px;background:#fff;cursor:pointer">\uD83D\uDCCB ').concat(a(r.copyCoords),"</button></div>"),"</div>"].filter(Boolean).join("")}(e,G,{openIn:u("mapWidget.openIn"),copyCoords:u("mapWidget.copyCoords")}),l=a.marker([e.lat,e.lng],{opacity:L&&!r?.55:1}).addTo(n);return l.bindPopup(s,{maxWidth:280}),l.on("click",()=>{L&&P(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}),l});J.length>=2&&a.polyline(J.map(e=>[e.lat,e.lng]),{color:null!=(t=null==(e=i.route)?void 0:e.color)?t:"#7c3aed",weight:4,opacity:.85,dashArray:L?"6,6":void 0}).addTo(n);let l=e=>{let t=e.target.closest("[data-reflex-copy]");if(t){let r=t.getAttribute("data-reflex-copy");r&&navigator.clipboard.writeText(r).then(()=>R.oR.success(u("mapWidget.copied"))).catch(()=>R.oR.error(u("mapWidget.clipboardUnavailable"))),e.preventDefault()}};if(m.current.addEventListener("click",l),i.center&&"number"==typeof i.zoom)n.setView([i.center.lat,i.center.lng],i.zoom);else if(1===q.length)n.setView([q[0].lat,q[0].lng],null!=(r=i.zoom)?r:12);else{let e=a.featureGroup(s);n.fitBounds(e.getBounds().pad(.2))}return()=>{var e;null==(e=m.current)||e.removeEventListener("click",l),n.remove(),x.current=null}},[h,i,v.join("|"),L,_.join(",")]);let Y=!o&&!!c,K=async()=>{let e=j.trim();if(e){k(!0),F([]);try{let t="".concat("https://nominatim.openstreetmap.org/search","?q=").concat(encodeURIComponent(e),"&format=json&limit=6"),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw Error("status ".concat(r.status));let a=await r.json();F(a),0===a.length&&R.oR.message(u("mapWidget.nothingFound"))}catch(e){R.oR.error(u("mapWidget.searchFailed",{error:e instanceof Error?e.message:String(e)}))}finally{k(!1)}}},V=async e=>{var t;if(!Y)return;let r=Number(e.lat),a=Number(e.lon);if(!Number.isFinite(r)||!Number.isFinite(a))return void R.oR.error(u("mapWidget.invalidCoordinates"));let n=(null==(t=e.display_name.split(",")[0])?void 0:t.trim())||e.display_name.slice(0,60),s={...i,points:[...q,{lat:r,lng:a,title:n,description:e.display_name}]};F([]),N(""),await (null==c?void 0:c(s))},Z=async e=>{var t,r;if(!Y)return;let a=q.filter((t,r)=>r!==e),n=i.route;if(null==(r=i.route)||null==(t=r.stops)?void 0:t.length){let t=i.route.stops.filter(t=>t!==e).map(t=>t>e?t-1:t);n=t.length>=2?{...i.route,stops:t}:void 0}let s={...i,points:a,...n?{route:n}:{route:void 0}};await (null==c?void 0:c(s))},H=async()=>{if(!Y)return;let e={...i,route:void 0};await (null==c?void 0:c(e)),z(!1),P([])},$=async()=>{var e;if(!Y)return;if(_.length<2)return void R.oR.error(u("mapWidget.routeNeedsTwo"));let t={...i,route:{...null!=(e=i.route)?e:{},stops:_}};await (null==c?void 0:c(t)),z(!1)};return 0!==q.length||Y?(0,a.jsxs)("div",{className:"space-y-2",children:[Y&&(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(C.A,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"}),(0,a.jsx)("input",{type:"search",value:j,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),K())},placeholder:u("mapWidget.searchPlaceholder"),className:"w-full rounded border bg-background pl-7 pr-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>void K(),disabled:w||!j.trim(),className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",children:[w?(0,a.jsx)(b.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(C.A,{className:"h-3 w-3"}),u("mapWidget.search")]}),L?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>void $(),className:"rounded px-2 py-1 text-xs bg-violet-600 text-white hover:bg-violet-700 inline-flex items-center gap-1",title:u("mapWidget.saveRouteTitle"),children:[(0,a.jsx)(A.A,{className:"h-3 w-3"})," ",u("mapWidget.save")]}),(0,a.jsx)("button",{type:"button",onClick:()=>{z(!1),P([])},className:"rounded border px-2 py-1 text-xs hover:bg-accent inline-flex items-center gap-1",title:u("mapWidget.cancelTitle"),children:(0,a.jsx)(d.A,{className:"h-3 w-3"})})]}):(0,a.jsxs)("button",{type:"button",onClick:()=>{P(B),z(!0)},disabled:q.length<2,className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",title:u("mapWidget.routeButtonTitle"),children:[(0,a.jsx)(A.A,{className:"h-3 w-3"}),u("mapWidget.route")]})]}),W.length>0&&(0,a.jsx)("ul",{className:"rounded border bg-card divide-y text-xs max-h-44 overflow-y-auto",children:W.map((e,t)=>(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:()=>void V(e),className:"w-full text-left flex items-start gap-2 px-2 py-1.5 hover:bg-accent",children:[(0,a.jsx)(f.A,{className:"h-3 w-3 mt-0.5 text-emerald-700 shrink-0"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block font-medium truncate",children:e.display_name.split(",")[0]}),(0,a.jsx)("span",{className:"block text-[10px] text-muted-foreground truncate",children:e.display_name})]})]})},t))}),L&&(0,a.jsx)("div",{className:"rounded border border-violet-200 bg-violet-50 dark:bg-violet-950/30 dark:border-violet-900/50 px-2 py-1.5 text-[11px] text-violet-900 dark:text-violet-200",children:u.rich("mapWidget.routeModeHint",{count:_.length,strong:e=>(0,a.jsx)("strong",{children:e})})})]}),(0,a.jsx)("div",{ref:m,className:"rounded-md border overflow-hidden bg-muted/30",style:{height:280}}),!L&&J.length>=2&&G.length>0&&(0,a.jsx)("div",{className:"rounded border bg-card px-2 py-1.5",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] font-medium",children:[(0,a.jsx)(A.A,{className:"h-3 w-3 text-violet-600"}),u("mapWidget.routeLabel",{count:J.length})]}),G.map(e=>(0,a.jsx)(O,{service:e,stops:J},e.id)),Y&&(0,a.jsxs)("button",{type:"button",onClick:()=>void H(),className:"ml-auto text-[10px] text-muted-foreground hover:text-destructive inline-flex items-center gap-0.5",title:u("mapWidget.deleteRouteTitle"),children:[(0,a.jsx)(p.A,{className:"h-3 w-3"}),u("mapWidget.delete")]})]})}),(0,a.jsx)("ul",{className:"space-y-1",children:q.map((e,t)=>{let r=D.indexOf(t);return(0,a.jsxs)("li",{className:"flex items-start gap-2 rounded-md border bg-card px-2 py-1.5 text-xs "+(L&&r>=0?"ring-1 ring-violet-400 border-violet-300":""),children:[L?(0,a.jsx)("button",{type:"button",onClick:()=>P(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]),className:"h-5 w-5 mt-0.5 shrink-0 rounded-full border text-[10px] font-mono inline-flex items-center justify-center "+(r>=0?"bg-violet-600 text-white border-violet-600":"bg-card text-muted-foreground"),title:r>=0?u("mapWidget.removeFromRoute"):u("mapWidget.addToRoute"),children:r>=0?r+1:"+"}):(0,a.jsx)(S.A,{className:"h-3 w-3 mt-1 shrink-0 "+(B.includes(t)?"text-violet-600":"text-emerald-700")}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"font-medium truncate",children:e.title}),e.description&&(0,a.jsx)("p",{className:"text-muted-foreground leading-snug mt-0.5 line-clamp-2",children:e.description}),(0,a.jsxs)("div",{className:"text-[10px] text-muted-foreground/80 font-mono mt-0.5",children:[e.lat.toFixed(5),", ",e.lng.toFixed(5)]})]}),(0,a.jsx)(I,{point:e,services:G,interactive:Y,onRemove:()=>void Z(t)})]},t)})})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:u("mapWidget.noPointsReadonly")})},"utility-card":function(e){let{rootId:t,data:r,readonly:s}=e,l=(0,n.c)("roots"),i="project"===r.utilityScope?"/utilities/project/".concat(r.utilityId,"?rootId=").concat(encodeURIComponent(t)):"/utilities/global/".concat(r.utilityId);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,a.jsx)(_.A,{className:"h-3 w-3 text-violet-600"}),(0,a.jsx)("span",{children:l("utilityCardWidget.miniAppLabel")}),(0,a.jsx)("span",{className:"font-mono normal-case tracking-normal text-muted-foreground/80",children:r.utilityId}),(0,a.jsxs)(w(),{href:i,className:"ml-auto inline-flex items-center gap-0.5 text-[10px] text-violet-700 hover:underline normal-case tracking-normal",title:l("utilityCardWidget.openFullTitle"),children:[l("utilityCardWidget.openLabel"),(0,a.jsx)(o.A,{className:"h-2.5 w-2.5"})]})]}),r.inner.title&&(0,a.jsx)("h4",{className:"text-sm font-medium",children:r.inner.title}),r.inner.description&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground -mt-1",children:r.inner.description}),(0,a.jsx)("div",{children:q(t,r.inner.kind,r.inner.data,{readonly:!0})})]})}};function q(e,t,r,n){var s;let l=P[t];return l?(0,a.jsx)(l,{rootId:e,data:r,readonly:null!=(s=null==n?void 0:n.readonly)&&s,onPatch:null==n?void 0:n.onPatch}):(0,a.jsx)(B,{kind:t})}function B(e){let{kind:t}=e,r=(0,n.c)("roots");return(0,a.jsx)("p",{className:"text-xs text-destructive",children:r.rich("widgetsCommon.unknownKind",{kind:t,code:e=>(0,a.jsx)("code",{className:"font-mono",children:e})})})}},68682:(e,t,r)=>{function a(e){return"".concat(e.lat,",").concat(e.lng)}function n(e){return"".concat(e.lng,",").concat(e.lat)}r.d(t,{JY:()=>l,yp:()=>s});let s=[{id:"google",label:"Google Maps",description:"Global, navigation + street view. Works everywhere except where the RF blocks it.",brand:"#4285F4",glyph:"G",urlFor:(e,t)=>"https://www.google.com/maps/dir/?api=1&destination=".concat(e,",").concat(t),routeUrlFor:e=>{if(e.length<2)return"";let t=a(e[0]),r=a(e[e.length-1]),n=e.slice(1,-1).map(a).join("|"),s=n?"&waypoints=".concat(encodeURIComponent(n)):"";return"https://www.google.com/maps/dir/?api=1&origin=".concat(t,"&destination=").concat(r).concat(s)}},{id:"yandex",label:"Yandex Maps",description:"CIS region, best RF detail and real-time traffic.",brand:"#FFCC00",glyph:"Y",urlFor:(e,t)=>"https://yandex.ru/maps/?rtext=~".concat(e,",").concat(t,"&rtt=auto"),routeUrlFor:e=>"https://yandex.ru/maps/?rtext=".concat(e.map(a).join("~"),"&rtt=auto")},{id:"2gis",label:"2GIS",description:"CIS region, precise addresses and POI. Uniquely strong on RF cities.",brand:"#1BA049",glyph:"2",urlFor:(e,t)=>"https://2gis.ru/routeSearch/to/".concat(t,",").concat(e),routeUrlFor:e=>{let t=n(e[0]),r=n(e[e.length-1]),a=e.slice(1,-1).map(e=>"/via/".concat(n(e))).join("");return"https://2gis.ru/routeSearch/rsType/car/from/".concat(t).concat(a,"/to/").concat(r)}},{id:"apple",label:"Apple Maps",description:"Opens in the native app on iOS/macOS, otherwise on the website.",brand:"#1d1d1f",glyph:"A",urlFor:(e,t)=>"https://maps.apple.com/?daddr=".concat(e,",").concat(t),routeUrlFor:e=>{let t=a(e[0]),r=e.slice(1).map(e=>"+to:".concat(a(e))).join("");return"https://maps.apple.com/?saddr=".concat(t,"&daddr=").concat(t).concat(r)}},{id:"osm",label:"OpenStreetMap",description:"Open data, no account required. Basic navigation.",brand:"#7EB73F",glyph:"OSM",urlFor:(e,t)=>"https://www.openstreetmap.org/directions?to=".concat(e,",").concat(t),routeUrlFor:e=>{let t=e.map(a).join(";");return"https://www.openstreetmap.org/directions?route=".concat(encodeURIComponent(t))}},{id:"waze",label:"Waze",description:"Car navigation with crowd-sourced traffic and alerts.",brand:"#33CCFF",glyph:"W",urlFor:(e,t)=>"https://waze.com/ul?ll=".concat(e,",").concat(t,"&navigate=yes"),routeUrlFor:e=>{let t=e[e.length-1];return"https://waze.com/ul?ll=".concat(t.lat,",").concat(t.lng,"&navigate=yes")}},{id:"organic",label:"Organic Maps",description:"Offline maps with open data. Opens in the app.",brand:"#006C35",glyph:"OM",urlFor:(e,t)=>"om://map?ll=".concat(e,",").concat(t),routeUrlFor:e=>{let t=e[0],r=e[e.length-1];return"om://route?sll=".concat(t.lat,",").concat(t.lng,"&saddr=&dll=").concat(r.lat,",").concat(r.lng,"&daddr=&type=vehicle")}}],l=["google","yandex","apple","osm"]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5097],{3239:(t,e,a)=>{a.d(e,{A:()=>r});let r=(0,a(45804).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},7911:(t,e,a)=>{Object.defineProperty(e,"__esModule",{value:!0}),!function(t,e){for(var a in e)Object.defineProperty(t,a,{enumerable:!0,get:e[a]})}(e,{callServer:function(){return r.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}});let r=a(48220),o=a(61088),n=a(84166)},45804:(t,e,a)=>{a.d(e,{A:()=>i});var r=a(99356);let o=function(){for(var t=arguments.length,e=Array(t),a=0;a<t;a++)e[a]=arguments[a];return e.filter((t,e,a)=>!!t&&""!==t.trim()&&a.indexOf(t)===e).join(" ").trim()};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=(0,r.forwardRef)((t,e)=>{let{color:a="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:d="",children:c,iconNode:u,...m}=t;return(0,r.createElement)("svg",{ref:e,...n,width:s,height:s,stroke:a,strokeWidth:l?24*Number(i)/Number(s):i,className:o("lucide",d),...m},[...u.map(t=>{let[e,a]=t;return(0,r.createElement)(e,a)}),...Array.isArray(c)?c:[c]])}),i=(t,e)=>{let a=(0,r.forwardRef)((a,n)=>{let{className:i,...l}=a;return(0,r.createElement)(s,{ref:n,iconNode:e,className:o("lucide-".concat(t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),i),...l})});return a.displayName="".concat(t),a}},56221:(t,e,a)=>{a.d(e,{l$:()=>w,oR:()=>p});var r=a(99356),o=a(16973),n=Array(12).fill(0),s=t=>{let{visible:e,className:a}=t;return r.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},r.createElement("div",{className:"sonner-spinner"},n.map((t,e)=>r.createElement("div",{className:"sonner-loading-bar",key:"spinner-bar-".concat(e)}))))},i=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),l=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),d=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),c=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),u=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),m=1,h=new class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:a,...r}=t,o="number"==typeof(null==t?void 0:t.id)||(null==(e=t.id)?void 0:e.length)>0?t.id:m++,n=this.toasts.find(t=>t.id===o),s=void 0===t.dismissible||t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),n?this.toasts=this.toasts.map(e=>e.id===o?(this.publish({...e,...t,id:o,title:a}),{...e,...t,id:o,dismissible:s,title:a}):e):this.addToast({title:a,...r,dismissible:s,id:o}),o},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(t=>{this.subscribers.forEach(e=>e({id:t.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{let a;if(!e)return;void 0!==e.loading&&(a=this.create({...e,promise:t,type:"loading",message:e.loading,description:"function"!=typeof e.description?e.description:void 0}));let o=t instanceof Promise?t:t(),n=void 0!==a,s,i=o.then(async t=>{if(s=["resolve",t],r.isValidElement(t))n=!1,this.create({id:a,type:"default",message:t});else if(f(t)&&!t.ok){n=!1;let r="function"==typeof e.error?await e.error("HTTP error! status: ".concat(t.status)):e.error,o="function"==typeof e.description?await e.description("HTTP error! status: ".concat(t.status)):e.description;this.create({id:a,type:"error",message:r,description:o})}else if(void 0!==e.success){n=!1;let r="function"==typeof e.success?await e.success(t):e.success,o="function"==typeof e.description?await e.description(t):e.description;this.create({id:a,type:"success",message:r,description:o})}}).catch(async t=>{if(s=["reject",t],void 0!==e.error){n=!1;let r="function"==typeof e.error?await e.error(t):e.error,o="function"==typeof e.description?await e.description(t):e.description;this.create({id:a,type:"error",message:r,description:o})}}).finally(()=>{var t;n&&(this.dismiss(a),a=void 0),null==(t=e.finally)||t.call(e)}),l=()=>new Promise((t,e)=>i.then(()=>"reject"===s[0]?e(s[1]):t(s[1])).catch(e));return"string"!=typeof a&&"number"!=typeof a?{unwrap:l}:Object.assign(a,{unwrap:l})},this.custom=(t,e)=>{let a=(null==e?void 0:e.id)||m++;return this.create({jsx:t(a),id:a,...e}),a},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},f=t=>t&&"object"==typeof t&&"ok"in t&&"boolean"==typeof t.ok&&"status"in t&&"number"==typeof t.status,p=Object.assign((t,e)=>{let a=(null==e?void 0:e.id)||m++;return h.addToast({title:t,...e,id:a}),a},{success:h.success,info:h.info,warning:h.warning,error:h.error,custom:h.custom,message:h.message,promise:h.promise,dismiss:h.dismiss,loading:h.loading},{getHistory:()=>h.toasts,getToasts:()=>h.getActiveToasts()});function g(t){return void 0!==t.label}function v(){for(var t=arguments.length,e=Array(t),a=0;a<t;a++)e[a]=arguments[a];return e.filter(Boolean).join(" ")}!function(t){let{insertAt:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"undefined"==typeof document)return;let a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===e&&a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var b=t=>{var e,a,o,n,m,h,f,p,b,y,w;let{invert:x,toast:E,unstyled:k,interacting:N,setHeights:S,visibleToasts:T,heights:B,index:C,toasts:M,expanded:R,removeToast:z,defaultRichColors:j,closeButton:A,style:I,cancelButtonStyle:Y,actionButtonStyle:L,className:P="",descriptionClassName:D="",duration:H,position:O,gap:U,loadingIcon:V,expandByDefault:W,classNames:_,icons:F,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:$}=t,[X,Z]=r.useState(null),[q,G]=r.useState(null),[J,Q]=r.useState(!1),[tt,te]=r.useState(!1),[ta,tr]=r.useState(!1),[to,tn]=r.useState(!1),[ts,ti]=r.useState(!1),[tl,td]=r.useState(0),[tc,tu]=r.useState(0),tm=r.useRef(E.duration||H||4e3),th=r.useRef(null),tf=r.useRef(null),tp=0===C,tg=C+1<=T,tv=E.type,tb=!1!==E.dismissible,ty=E.className||"",tw=E.descriptionClassName||"",tx=r.useMemo(()=>B.findIndex(t=>t.toastId===E.id)||0,[B,E.id]),tE=r.useMemo(()=>{var t;return null!=(t=E.closeButton)?t:A},[E.closeButton,A]),tk=r.useMemo(()=>E.duration||H||4e3,[E.duration,H]),tN=r.useRef(0),tS=r.useRef(0),tT=r.useRef(0),tB=r.useRef(null),[tC,tM]=O.split("-"),tR=r.useMemo(()=>B.reduce((t,e,a)=>a>=tx?t:t+e.height,0),[B,tx]),tz=(()=>{let[t,e]=r.useState(document.hidden);return r.useEffect(()=>{let t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),t})(),tj=E.invert||x,tA="loading"===tv;tS.current=r.useMemo(()=>tx*U+tR,[tx,tR]),r.useEffect(()=>{tm.current=tk},[tk]),r.useEffect(()=>{Q(!0)},[]),r.useEffect(()=>{let t=tf.current;if(t){let e=t.getBoundingClientRect().height;return tu(e),S(t=>[{toastId:E.id,height:e,position:E.position},...t]),()=>S(t=>t.filter(t=>t.toastId!==E.id))}},[S,E.id]),r.useLayoutEffect(()=>{if(!J)return;let t=tf.current,e=t.style.height;t.style.height="auto";let a=t.getBoundingClientRect().height;t.style.height=e,tu(a),S(t=>t.find(t=>t.toastId===E.id)?t.map(t=>t.toastId===E.id?{...t,height:a}:t):[{toastId:E.id,height:a,position:E.position},...t])},[J,E.title,E.description,S,E.id]);let tI=r.useCallback(()=>{te(!0),td(tS.current),S(t=>t.filter(t=>t.toastId!==E.id)),setTimeout(()=>{z(E)},200)},[E,z,S,tS]);return r.useEffect(()=>{let t;if((!E.promise||"loading"!==tv)&&E.duration!==1/0&&"loading"!==E.type)return R||N||$&&tz?(()=>{if(tT.current<tN.current){let t=new Date().getTime()-tN.current;tm.current=tm.current-t}tT.current=new Date().getTime()})():tm.current!==1/0&&(tN.current=new Date().getTime(),t=setTimeout(()=>{var t;null==(t=E.onAutoClose)||t.call(E,E),tI()},tm.current)),()=>clearTimeout(t)},[R,N,E,tv,$,tz,tI]),r.useEffect(()=>{E.delete&&tI()},[tI,E.delete]),r.createElement("li",{tabIndex:0,ref:tf,className:v(P,ty,null==_?void 0:_.toast,null==(e=null==E?void 0:E.classNames)?void 0:e.toast,null==_?void 0:_.default,null==_?void 0:_[tv],null==(a=null==E?void 0:E.classNames)?void 0:a[tv]),"data-sonner-toast":"","data-rich-colors":null!=(o=E.richColors)?o:j,"data-styled":!(E.jsx||E.unstyled||k),"data-mounted":J,"data-promise":!!E.promise,"data-swiped":ts,"data-removed":tt,"data-visible":tg,"data-y-position":tC,"data-x-position":tM,"data-index":C,"data-front":tp,"data-swiping":ta,"data-dismissible":tb,"data-type":tv,"data-invert":tj,"data-swipe-out":to,"data-swipe-direction":q,"data-expanded":!!(R||W&&J),style:{"--index":C,"--toasts-before":C,"--z-index":M.length-C,"--offset":"".concat(tt?tl:tS.current,"px"),"--initial-height":W?"auto":"".concat(tc,"px"),...I,...E.style},onDragEnd:()=>{tr(!1),Z(null),tB.current=null},onPointerDown:t=>{tA||!tb||(th.current=new Date,td(tS.current),t.target.setPointerCapture(t.pointerId),"BUTTON"!==t.target.tagName&&(tr(!0),tB.current={x:t.clientX,y:t.clientY}))},onPointerUp:()=>{var t,e,a,r;if(to||!tb)return;tB.current=null;let o=Number((null==(t=tf.current)?void 0:t.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),n=Number((null==(e=tf.current)?void 0:e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),s=new Date().getTime()-(null==(a=th.current)?void 0:a.getTime()),i="x"===X?o:n,l=Math.abs(i)/s;if(Math.abs(i)>=20||l>.11){td(tS.current),null==(r=E.onDismiss)||r.call(E,E),G("x"===X?o>0?"right":"left":n>0?"down":"up"),tI(),tn(!0),ti(!1);return}tr(!1),Z(null)},onPointerMove:e=>{var a,r,o,n;if(!tB.current||!tb||(null==(a=window.getSelection())?void 0:a.toString().length)>0)return;let s=e.clientY-tB.current.y,i=e.clientX-tB.current.x,l=null!=(r=t.swipeDirections)?r:function(t){let[e,a]=t.split("-"),r=[];return e&&r.push(e),a&&r.push(a),r}(O);!X&&(Math.abs(i)>1||Math.abs(s)>1)&&Z(Math.abs(i)>Math.abs(s)?"x":"y");let d={x:0,y:0};"y"===X?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&s<0||l.includes("bottom")&&s>0)&&(d.y=s):"x"===X&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&i<0||l.includes("right")&&i>0)&&(d.x=i),(Math.abs(d.x)>0||Math.abs(d.y)>0)&&ti(!0),null==(o=tf.current)||o.style.setProperty("--swipe-amount-x","".concat(d.x,"px")),null==(n=tf.current)||n.style.setProperty("--swipe-amount-y","".concat(d.y,"px"))}},tE&&!E.jsx?r.createElement("button",{"aria-label":K,"data-disabled":tA,"data-close-button":!0,onClick:tA||!tb?()=>{}:()=>{var t;tI(),null==(t=E.onDismiss)||t.call(E,E)},className:v(null==_?void 0:_.closeButton,null==(n=null==E?void 0:E.classNames)?void 0:n.closeButton)},null!=(m=null==F?void 0:F.close)?m:u):null,E.jsx||(0,r.isValidElement)(E.title)?E.jsx?E.jsx:"function"==typeof E.title?E.title():E.title:r.createElement(r.Fragment,null,tv||E.icon||E.promise?r.createElement("div",{"data-icon":"",className:v(null==_?void 0:_.icon,null==(h=null==E?void 0:E.classNames)?void 0:h.icon)},E.promise||"loading"===E.type&&!E.icon?E.icon||function(){var t,e,a;return null!=F&&F.loading?r.createElement("div",{className:v(null==_?void 0:_.loader,null==(t=null==E?void 0:E.classNames)?void 0:t.loader,"sonner-loader"),"data-visible":"loading"===tv},F.loading):V?r.createElement("div",{className:v(null==_?void 0:_.loader,null==(e=null==E?void 0:E.classNames)?void 0:e.loader,"sonner-loader"),"data-visible":"loading"===tv},V):r.createElement(s,{className:v(null==_?void 0:_.loader,null==(a=null==E?void 0:E.classNames)?void 0:a.loader),visible:"loading"===tv})}():null,"loading"!==E.type?E.icon||(null==F?void 0:F[tv])||(t=>{switch(t){case"success":return i;case"info":return d;case"warning":return l;case"error":return c;default:return null}})(tv):null):null,r.createElement("div",{"data-content":"",className:v(null==_?void 0:_.content,null==(f=null==E?void 0:E.classNames)?void 0:f.content)},r.createElement("div",{"data-title":"",className:v(null==_?void 0:_.title,null==(p=null==E?void 0:E.classNames)?void 0:p.title)},"function"==typeof E.title?E.title():E.title),E.description?r.createElement("div",{"data-description":"",className:v(D,tw,null==_?void 0:_.description,null==(b=null==E?void 0:E.classNames)?void 0:b.description)},"function"==typeof E.description?E.description():E.description):null),(0,r.isValidElement)(E.cancel)?E.cancel:E.cancel&&g(E.cancel)?r.createElement("button",{"data-button":!0,"data-cancel":!0,style:E.cancelButtonStyle||Y,onClick:t=>{var e,a;g(E.cancel)&&tb&&(null==(a=(e=E.cancel).onClick)||a.call(e,t),tI())},className:v(null==_?void 0:_.cancelButton,null==(y=null==E?void 0:E.classNames)?void 0:y.cancelButton)},E.cancel.label):null,(0,r.isValidElement)(E.action)?E.action:E.action&&g(E.action)?r.createElement("button",{"data-button":!0,"data-action":!0,style:E.actionButtonStyle||L,onClick:t=>{var e,a;g(E.action)&&(null==(a=(e=E.action).onClick)||a.call(e,t),t.defaultPrevented||tI())},className:v(null==_?void 0:_.actionButton,null==(w=null==E?void 0:E.classNames)?void 0:w.actionButton)},E.action.label):null))};function y(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let t=document.documentElement.getAttribute("dir");return"auto"!==t&&t?t:window.getComputedStyle(document.documentElement).direction}var w=(0,r.forwardRef)(function(t,e){let{invert:a,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:l,className:d,offset:c,mobileOffset:u,theme:m="light",richColors:f,duration:p,style:g,visibleToasts:v=3,toastOptions:w,dir:x=y(),gap:E=14,loadingIcon:k,icons:N,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:T}=t,[B,C]=r.useState([]),M=r.useMemo(()=>Array.from(new Set([n].concat(B.filter(t=>t.position).map(t=>t.position)))),[B,n]),[R,z]=r.useState([]),[j,A]=r.useState(!1),[I,Y]=r.useState(!1),[L,P]=r.useState("system"!==m?m:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=r.useRef(null),H=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=r.useRef(null),U=r.useRef(!1),V=r.useCallback(t=>{C(e=>{var a;return null!=(a=e.find(e=>e.id===t.id))&&a.delete||h.dismiss(t.id),e.filter(e=>{let{id:a}=e;return a!==t.id})})},[]);return r.useEffect(()=>h.subscribe(t=>{if(t.dismiss)return void C(e=>e.map(e=>e.id===t.id?{...e,delete:!0}:e));setTimeout(()=>{o.flushSync(()=>{C(e=>{let a=e.findIndex(e=>e.id===t.id);return -1!==a?[...e.slice(0,a),{...e[a],...t},...e.slice(a+1)]:[t,...e]})})})}),[]),r.useEffect(()=>{if("system"!==m)return void P(m);if("system"===m&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),"undefined"==typeof window)return;let t=window.matchMedia("(prefers-color-scheme: dark)");try{t.addEventListener("change",t=>{let{matches:e}=t;P(e?"dark":"light")})}catch(e){t.addListener(t=>{let{matches:e}=t;try{P(e?"dark":"light")}catch(t){console.error(t)}})}},[m]),r.useEffect(()=>{B.length<=1&&A(!1)},[B]),r.useEffect(()=>{let t=t=>{var e,a;s.every(e=>t[e]||t.code===e)&&(A(!0),null==(e=D.current)||e.focus()),"Escape"===t.code&&(document.activeElement===D.current||null!=(a=D.current)&&a.contains(document.activeElement))&&A(!1)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[s]),r.useEffect(()=>{if(D.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,U.current=!1)}},[D.current]),r.createElement("section",{ref:e,"aria-label":"".concat(S," ").concat(H),tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((e,o)=>{var n;let s,[m,h]=e.split("-");return B.length?r.createElement("ol",{key:e,dir:"auto"===x?y():x,tabIndex:-1,ref:D,className:d,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":m,"data-lifted":j&&B.length>1&&!i,"data-x-position":h,style:{"--front-toast-height":"".concat((null==(n=R[0])?void 0:n.height)||0,"px"),"--width":"".concat(356,"px"),"--gap":"".concat(E,"px"),...g,...(s={},[c,u].forEach((t,e)=>{let a=1===e,r=a?"--mobile-offset":"--offset",o=a?"16px":"32px";function n(t){["top","right","bottom","left"].forEach(e=>{s["".concat(r,"-").concat(e)]="number"==typeof t?"".concat(t,"px"):t})}"number"==typeof t||"string"==typeof t?n(t):"object"==typeof t?["top","right","bottom","left"].forEach(e=>{void 0===t[e]?s["".concat(r,"-").concat(e)]=o:s["".concat(r,"-").concat(e)]="number"==typeof t[e]?"".concat(t[e],"px"):t[e]}):n(o)}),s)},onBlur:t=>{U.current&&!t.currentTarget.contains(t.relatedTarget)&&(U.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:t=>{t.target instanceof HTMLElement&&"false"===t.target.dataset.dismissible||U.current||(U.current=!0,O.current=t.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{I||A(!1)},onDragEnd:()=>A(!1),onPointerDown:t=>{t.target instanceof HTMLElement&&"false"===t.target.dataset.dismissible||Y(!0)},onPointerUp:()=>Y(!1)},B.filter(t=>!t.position&&0===o||t.position===e).map((o,n)=>{var s,d;return r.createElement(b,{key:o.id,icons:N,index:n,toast:o,defaultRichColors:f,duration:null!=(s=null==w?void 0:w.duration)?s:p,className:null==w?void 0:w.className,descriptionClassName:null==w?void 0:w.descriptionClassName,invert:a,visibleToasts:v,closeButton:null!=(d=null==w?void 0:w.closeButton)?d:l,interacting:I,position:e,style:null==w?void 0:w.style,unstyled:null==w?void 0:w.unstyled,classNames:null==w?void 0:w.classNames,cancelButtonStyle:null==w?void 0:w.cancelButtonStyle,actionButtonStyle:null==w?void 0:w.actionButtonStyle,removeToast:V,toasts:B.filter(t=>t.position==o.position),heights:R.filter(t=>t.position==o.position),setHeights:z,expandByDefault:i,gap:E,loadingIcon:k,expanded:j,pauseWhenPageIsHidden:T,swipeDirections:t.swipeDirections})})):null}))})}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9776],{7911:(t,e,a)=>{Object.defineProperty(e,"__esModule",{value:!0}),!function(t,e){for(var a in e)Object.defineProperty(t,a,{enumerable:!0,get:e[a]})}(e,{callServer:function(){return r.callServer},createServerReference:function(){return n.createServerReference},findSourceMapURL:function(){return o.findSourceMapURL}});let r=a(48220),o=a(61088),n=a(84166)},45804:(t,e,a)=>{a.d(e,{A:()=>i});var r=a(99356);let o=function(){for(var t=arguments.length,e=Array(t),a=0;a<t;a++)e[a]=arguments[a];return e.filter((t,e,a)=>!!t&&""!==t.trim()&&a.indexOf(t)===e).join(" ").trim()};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=(0,r.forwardRef)((t,e)=>{let{color:a="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:d="",children:c,iconNode:u,...m}=t;return(0,r.createElement)("svg",{ref:e,...n,width:s,height:s,stroke:a,strokeWidth:l?24*Number(i)/Number(s):i,className:o("lucide",d),...m},[...u.map(t=>{let[e,a]=t;return(0,r.createElement)(e,a)}),...Array.isArray(c)?c:[c]])}),i=(t,e)=>{let a=(0,r.forwardRef)((a,n)=>{let{className:i,...l}=a;return(0,r.createElement)(s,{ref:n,iconNode:e,className:o("lucide-".concat(t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),i),...l})});return a.displayName="".concat(t),a}},56221:(t,e,a)=>{a.d(e,{l$:()=>w,oR:()=>p});var r=a(99356),o=a(16973),n=Array(12).fill(0),s=t=>{let{visible:e,className:a}=t;return r.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},r.createElement("div",{className:"sonner-spinner"},n.map((t,e)=>r.createElement("div",{className:"sonner-loading-bar",key:"spinner-bar-".concat(e)}))))},i=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),l=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),d=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),c=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),u=r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),m=1,h=new class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:a,...r}=t,o="number"==typeof(null==t?void 0:t.id)||(null==(e=t.id)?void 0:e.length)>0?t.id:m++,n=this.toasts.find(t=>t.id===o),s=void 0===t.dismissible||t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),n?this.toasts=this.toasts.map(e=>e.id===o?(this.publish({...e,...t,id:o,title:a}),{...e,...t,id:o,dismissible:s,title:a}):e):this.addToast({title:a,...r,dismissible:s,id:o}),o},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(t=>{this.subscribers.forEach(e=>e({id:t.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{let a;if(!e)return;void 0!==e.loading&&(a=this.create({...e,promise:t,type:"loading",message:e.loading,description:"function"!=typeof e.description?e.description:void 0}));let o=t instanceof Promise?t:t(),n=void 0!==a,s,i=o.then(async t=>{if(s=["resolve",t],r.isValidElement(t))n=!1,this.create({id:a,type:"default",message:t});else if(f(t)&&!t.ok){n=!1;let r="function"==typeof e.error?await e.error("HTTP error! status: ".concat(t.status)):e.error,o="function"==typeof e.description?await e.description("HTTP error! status: ".concat(t.status)):e.description;this.create({id:a,type:"error",message:r,description:o})}else if(void 0!==e.success){n=!1;let r="function"==typeof e.success?await e.success(t):e.success,o="function"==typeof e.description?await e.description(t):e.description;this.create({id:a,type:"success",message:r,description:o})}}).catch(async t=>{if(s=["reject",t],void 0!==e.error){n=!1;let r="function"==typeof e.error?await e.error(t):e.error,o="function"==typeof e.description?await e.description(t):e.description;this.create({id:a,type:"error",message:r,description:o})}}).finally(()=>{var t;n&&(this.dismiss(a),a=void 0),null==(t=e.finally)||t.call(e)}),l=()=>new Promise((t,e)=>i.then(()=>"reject"===s[0]?e(s[1]):t(s[1])).catch(e));return"string"!=typeof a&&"number"!=typeof a?{unwrap:l}:Object.assign(a,{unwrap:l})},this.custom=(t,e)=>{let a=(null==e?void 0:e.id)||m++;return this.create({jsx:t(a),id:a,...e}),a},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},f=t=>t&&"object"==typeof t&&"ok"in t&&"boolean"==typeof t.ok&&"status"in t&&"number"==typeof t.status,p=Object.assign((t,e)=>{let a=(null==e?void 0:e.id)||m++;return h.addToast({title:t,...e,id:a}),a},{success:h.success,info:h.info,warning:h.warning,error:h.error,custom:h.custom,message:h.message,promise:h.promise,dismiss:h.dismiss,loading:h.loading},{getHistory:()=>h.toasts,getToasts:()=>h.getActiveToasts()});function g(t){return void 0!==t.label}function v(){for(var t=arguments.length,e=Array(t),a=0;a<t;a++)e[a]=arguments[a];return e.filter(Boolean).join(" ")}!function(t){let{insertAt:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"undefined"==typeof document)return;let a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===e&&a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var b=t=>{var e,a,o,n,m,h,f,p,b,y,w;let{invert:x,toast:E,unstyled:k,interacting:N,setHeights:S,visibleToasts:T,heights:B,index:C,toasts:M,expanded:R,removeToast:z,defaultRichColors:j,closeButton:I,style:Y,cancelButtonStyle:A,actionButtonStyle:L,className:P="",descriptionClassName:D="",duration:H,position:O,gap:U,loadingIcon:V,expandByDefault:W,classNames:_,icons:F,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:$}=t,[X,Z]=r.useState(null),[q,G]=r.useState(null),[J,Q]=r.useState(!1),[tt,te]=r.useState(!1),[ta,tr]=r.useState(!1),[to,tn]=r.useState(!1),[ts,ti]=r.useState(!1),[tl,td]=r.useState(0),[tc,tu]=r.useState(0),tm=r.useRef(E.duration||H||4e3),th=r.useRef(null),tf=r.useRef(null),tp=0===C,tg=C+1<=T,tv=E.type,tb=!1!==E.dismissible,ty=E.className||"",tw=E.descriptionClassName||"",tx=r.useMemo(()=>B.findIndex(t=>t.toastId===E.id)||0,[B,E.id]),tE=r.useMemo(()=>{var t;return null!=(t=E.closeButton)?t:I},[E.closeButton,I]),tk=r.useMemo(()=>E.duration||H||4e3,[E.duration,H]),tN=r.useRef(0),tS=r.useRef(0),tT=r.useRef(0),tB=r.useRef(null),[tC,tM]=O.split("-"),tR=r.useMemo(()=>B.reduce((t,e,a)=>a>=tx?t:t+e.height,0),[B,tx]),tz=(()=>{let[t,e]=r.useState(document.hidden);return r.useEffect(()=>{let t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),t})(),tj=E.invert||x,tI="loading"===tv;tS.current=r.useMemo(()=>tx*U+tR,[tx,tR]),r.useEffect(()=>{tm.current=tk},[tk]),r.useEffect(()=>{Q(!0)},[]),r.useEffect(()=>{let t=tf.current;if(t){let e=t.getBoundingClientRect().height;return tu(e),S(t=>[{toastId:E.id,height:e,position:E.position},...t]),()=>S(t=>t.filter(t=>t.toastId!==E.id))}},[S,E.id]),r.useLayoutEffect(()=>{if(!J)return;let t=tf.current,e=t.style.height;t.style.height="auto";let a=t.getBoundingClientRect().height;t.style.height=e,tu(a),S(t=>t.find(t=>t.toastId===E.id)?t.map(t=>t.toastId===E.id?{...t,height:a}:t):[{toastId:E.id,height:a,position:E.position},...t])},[J,E.title,E.description,S,E.id]);let tY=r.useCallback(()=>{te(!0),td(tS.current),S(t=>t.filter(t=>t.toastId!==E.id)),setTimeout(()=>{z(E)},200)},[E,z,S,tS]);return r.useEffect(()=>{let t;if((!E.promise||"loading"!==tv)&&E.duration!==1/0&&"loading"!==E.type)return R||N||$&&tz?(()=>{if(tT.current<tN.current){let t=new Date().getTime()-tN.current;tm.current=tm.current-t}tT.current=new Date().getTime()})():tm.current!==1/0&&(tN.current=new Date().getTime(),t=setTimeout(()=>{var t;null==(t=E.onAutoClose)||t.call(E,E),tY()},tm.current)),()=>clearTimeout(t)},[R,N,E,tv,$,tz,tY]),r.useEffect(()=>{E.delete&&tY()},[tY,E.delete]),r.createElement("li",{tabIndex:0,ref:tf,className:v(P,ty,null==_?void 0:_.toast,null==(e=null==E?void 0:E.classNames)?void 0:e.toast,null==_?void 0:_.default,null==_?void 0:_[tv],null==(a=null==E?void 0:E.classNames)?void 0:a[tv]),"data-sonner-toast":"","data-rich-colors":null!=(o=E.richColors)?o:j,"data-styled":!(E.jsx||E.unstyled||k),"data-mounted":J,"data-promise":!!E.promise,"data-swiped":ts,"data-removed":tt,"data-visible":tg,"data-y-position":tC,"data-x-position":tM,"data-index":C,"data-front":tp,"data-swiping":ta,"data-dismissible":tb,"data-type":tv,"data-invert":tj,"data-swipe-out":to,"data-swipe-direction":q,"data-expanded":!!(R||W&&J),style:{"--index":C,"--toasts-before":C,"--z-index":M.length-C,"--offset":"".concat(tt?tl:tS.current,"px"),"--initial-height":W?"auto":"".concat(tc,"px"),...Y,...E.style},onDragEnd:()=>{tr(!1),Z(null),tB.current=null},onPointerDown:t=>{tI||!tb||(th.current=new Date,td(tS.current),t.target.setPointerCapture(t.pointerId),"BUTTON"!==t.target.tagName&&(tr(!0),tB.current={x:t.clientX,y:t.clientY}))},onPointerUp:()=>{var t,e,a,r;if(to||!tb)return;tB.current=null;let o=Number((null==(t=tf.current)?void 0:t.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),n=Number((null==(e=tf.current)?void 0:e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),s=new Date().getTime()-(null==(a=th.current)?void 0:a.getTime()),i="x"===X?o:n,l=Math.abs(i)/s;if(Math.abs(i)>=20||l>.11){td(tS.current),null==(r=E.onDismiss)||r.call(E,E),G("x"===X?o>0?"right":"left":n>0?"down":"up"),tY(),tn(!0),ti(!1);return}tr(!1),Z(null)},onPointerMove:e=>{var a,r,o,n;if(!tB.current||!tb||(null==(a=window.getSelection())?void 0:a.toString().length)>0)return;let s=e.clientY-tB.current.y,i=e.clientX-tB.current.x,l=null!=(r=t.swipeDirections)?r:function(t){let[e,a]=t.split("-"),r=[];return e&&r.push(e),a&&r.push(a),r}(O);!X&&(Math.abs(i)>1||Math.abs(s)>1)&&Z(Math.abs(i)>Math.abs(s)?"x":"y");let d={x:0,y:0};"y"===X?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&s<0||l.includes("bottom")&&s>0)&&(d.y=s):"x"===X&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&i<0||l.includes("right")&&i>0)&&(d.x=i),(Math.abs(d.x)>0||Math.abs(d.y)>0)&&ti(!0),null==(o=tf.current)||o.style.setProperty("--swipe-amount-x","".concat(d.x,"px")),null==(n=tf.current)||n.style.setProperty("--swipe-amount-y","".concat(d.y,"px"))}},tE&&!E.jsx?r.createElement("button",{"aria-label":K,"data-disabled":tI,"data-close-button":!0,onClick:tI||!tb?()=>{}:()=>{var t;tY(),null==(t=E.onDismiss)||t.call(E,E)},className:v(null==_?void 0:_.closeButton,null==(n=null==E?void 0:E.classNames)?void 0:n.closeButton)},null!=(m=null==F?void 0:F.close)?m:u):null,E.jsx||(0,r.isValidElement)(E.title)?E.jsx?E.jsx:"function"==typeof E.title?E.title():E.title:r.createElement(r.Fragment,null,tv||E.icon||E.promise?r.createElement("div",{"data-icon":"",className:v(null==_?void 0:_.icon,null==(h=null==E?void 0:E.classNames)?void 0:h.icon)},E.promise||"loading"===E.type&&!E.icon?E.icon||function(){var t,e,a;return null!=F&&F.loading?r.createElement("div",{className:v(null==_?void 0:_.loader,null==(t=null==E?void 0:E.classNames)?void 0:t.loader,"sonner-loader"),"data-visible":"loading"===tv},F.loading):V?r.createElement("div",{className:v(null==_?void 0:_.loader,null==(e=null==E?void 0:E.classNames)?void 0:e.loader,"sonner-loader"),"data-visible":"loading"===tv},V):r.createElement(s,{className:v(null==_?void 0:_.loader,null==(a=null==E?void 0:E.classNames)?void 0:a.loader),visible:"loading"===tv})}():null,"loading"!==E.type?E.icon||(null==F?void 0:F[tv])||(t=>{switch(t){case"success":return i;case"info":return d;case"warning":return l;case"error":return c;default:return null}})(tv):null):null,r.createElement("div",{"data-content":"",className:v(null==_?void 0:_.content,null==(f=null==E?void 0:E.classNames)?void 0:f.content)},r.createElement("div",{"data-title":"",className:v(null==_?void 0:_.title,null==(p=null==E?void 0:E.classNames)?void 0:p.title)},"function"==typeof E.title?E.title():E.title),E.description?r.createElement("div",{"data-description":"",className:v(D,tw,null==_?void 0:_.description,null==(b=null==E?void 0:E.classNames)?void 0:b.description)},"function"==typeof E.description?E.description():E.description):null),(0,r.isValidElement)(E.cancel)?E.cancel:E.cancel&&g(E.cancel)?r.createElement("button",{"data-button":!0,"data-cancel":!0,style:E.cancelButtonStyle||A,onClick:t=>{var e,a;g(E.cancel)&&tb&&(null==(a=(e=E.cancel).onClick)||a.call(e,t),tY())},className:v(null==_?void 0:_.cancelButton,null==(y=null==E?void 0:E.classNames)?void 0:y.cancelButton)},E.cancel.label):null,(0,r.isValidElement)(E.action)?E.action:E.action&&g(E.action)?r.createElement("button",{"data-button":!0,"data-action":!0,style:E.actionButtonStyle||L,onClick:t=>{var e,a;g(E.action)&&(null==(a=(e=E.action).onClick)||a.call(e,t),t.defaultPrevented||tY())},className:v(null==_?void 0:_.actionButton,null==(w=null==E?void 0:E.classNames)?void 0:w.actionButton)},E.action.label):null))};function y(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let t=document.documentElement.getAttribute("dir");return"auto"!==t&&t?t:window.getComputedStyle(document.documentElement).direction}var w=(0,r.forwardRef)(function(t,e){let{invert:a,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:l,className:d,offset:c,mobileOffset:u,theme:m="light",richColors:f,duration:p,style:g,visibleToasts:v=3,toastOptions:w,dir:x=y(),gap:E=14,loadingIcon:k,icons:N,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:T}=t,[B,C]=r.useState([]),M=r.useMemo(()=>Array.from(new Set([n].concat(B.filter(t=>t.position).map(t=>t.position)))),[B,n]),[R,z]=r.useState([]),[j,I]=r.useState(!1),[Y,A]=r.useState(!1),[L,P]=r.useState("system"!==m?m:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=r.useRef(null),H=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=r.useRef(null),U=r.useRef(!1),V=r.useCallback(t=>{C(e=>{var a;return null!=(a=e.find(e=>e.id===t.id))&&a.delete||h.dismiss(t.id),e.filter(e=>{let{id:a}=e;return a!==t.id})})},[]);return r.useEffect(()=>h.subscribe(t=>{if(t.dismiss)return void C(e=>e.map(e=>e.id===t.id?{...e,delete:!0}:e));setTimeout(()=>{o.flushSync(()=>{C(e=>{let a=e.findIndex(e=>e.id===t.id);return -1!==a?[...e.slice(0,a),{...e[a],...t},...e.slice(a+1)]:[t,...e]})})})}),[]),r.useEffect(()=>{if("system"!==m)return void P(m);if("system"===m&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),"undefined"==typeof window)return;let t=window.matchMedia("(prefers-color-scheme: dark)");try{t.addEventListener("change",t=>{let{matches:e}=t;P(e?"dark":"light")})}catch(e){t.addListener(t=>{let{matches:e}=t;try{P(e?"dark":"light")}catch(t){console.error(t)}})}},[m]),r.useEffect(()=>{B.length<=1&&I(!1)},[B]),r.useEffect(()=>{let t=t=>{var e,a;s.every(e=>t[e]||t.code===e)&&(I(!0),null==(e=D.current)||e.focus()),"Escape"===t.code&&(document.activeElement===D.current||null!=(a=D.current)&&a.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[s]),r.useEffect(()=>{if(D.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,U.current=!1)}},[D.current]),r.createElement("section",{ref:e,"aria-label":"".concat(S," ").concat(H),tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((e,o)=>{var n;let s,[m,h]=e.split("-");return B.length?r.createElement("ol",{key:e,dir:"auto"===x?y():x,tabIndex:-1,ref:D,className:d,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":m,"data-lifted":j&&B.length>1&&!i,"data-x-position":h,style:{"--front-toast-height":"".concat((null==(n=R[0])?void 0:n.height)||0,"px"),"--width":"".concat(356,"px"),"--gap":"".concat(E,"px"),...g,...(s={},[c,u].forEach((t,e)=>{let a=1===e,r=a?"--mobile-offset":"--offset",o=a?"16px":"32px";function n(t){["top","right","bottom","left"].forEach(e=>{s["".concat(r,"-").concat(e)]="number"==typeof t?"".concat(t,"px"):t})}"number"==typeof t||"string"==typeof t?n(t):"object"==typeof t?["top","right","bottom","left"].forEach(e=>{void 0===t[e]?s["".concat(r,"-").concat(e)]=o:s["".concat(r,"-").concat(e)]="number"==typeof t[e]?"".concat(t[e],"px"):t[e]}):n(o)}),s)},onBlur:t=>{U.current&&!t.currentTarget.contains(t.relatedTarget)&&(U.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:t=>{t.target instanceof HTMLElement&&"false"===t.target.dataset.dismissible||U.current||(U.current=!0,O.current=t.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{Y||I(!1)},onDragEnd:()=>I(!1),onPointerDown:t=>{t.target instanceof HTMLElement&&"false"===t.target.dataset.dismissible||A(!0)},onPointerUp:()=>A(!1)},B.filter(t=>!t.position&&0===o||t.position===e).map((o,n)=>{var s,d;return r.createElement(b,{key:o.id,icons:N,index:n,toast:o,defaultRichColors:f,duration:null!=(s=null==w?void 0:w.duration)?s:p,className:null==w?void 0:w.className,descriptionClassName:null==w?void 0:w.descriptionClassName,invert:a,visibleToasts:v,closeButton:null!=(d=null==w?void 0:w.closeButton)?d:l,interacting:Y,position:e,style:null==w?void 0:w.style,unstyled:null==w?void 0:w.unstyled,classNames:null==w?void 0:w.classNames,cancelButtonStyle:null==w?void 0:w.cancelButtonStyle,actionButtonStyle:null==w?void 0:w.actionButtonStyle,removeToast:V,toasts:B.filter(t=>t.position==o.position),heights:R.filter(t=>t.position==o.position),setHeights:z,expandByDefault:i,gap:E,loadingIcon:k,expanded:j,pauseWhenPageIsHidden:T,swipeDirections:t.swipeDirections})})):null}))})}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2494],{13506:(e,r,n)=>{"use strict";n.d(r,{cn:()=>s});var o=n(47989),i=n(55701);function s(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return(0,i.QP)((0,o.$)(r))}},32374:(e,r,n)=>{Promise.resolve().then(n.bind(n,91074)),Promise.resolve().then(n.bind(n,96253)),Promise.resolve().then(n.bind(n,28050)),Promise.resolve().then(n.bind(n,94904)),Promise.resolve().then(n.bind(n,13270)),Promise.resolve().then(n.bind(n,99730)),Promise.resolve().then(n.bind(n,89146)),Promise.resolve().then(n.bind(n,19078)),Promise.resolve().then(n.bind(n,67854)),Promise.resolve().then(n.bind(n,69050)),Promise.resolve().then(n.bind(n,63739)),Promise.resolve().then(n.bind(n,33976)),Promise.resolve().then(n.bind(n,12537)),Promise.resolve().then(n.bind(n,97485)),Promise.resolve().then(n.bind(n,41923)),Promise.resolve().then(n.bind(n,73868)),Promise.resolve().then(n.bind(n,53511)),Promise.resolve().then(n.bind(n,2018)),Promise.resolve().then(n.bind(n,18487)),Promise.resolve().then(n.bind(n,98346)),Promise.resolve().then(n.bind(n,14884)),Promise.resolve().then(n.bind(n,85314)),Promise.resolve().then(n.bind(n,17280)),Promise.resolve().then(n.bind(n,8855)),Promise.resolve().then(n.bind(n,86631)),Promise.resolve().then(n.bind(n,2604)),Promise.resolve().then(n.bind(n,27237)),Promise.resolve().then(n.bind(n,49455)),Promise.resolve().then(n.bind(n,39211)),Promise.resolve().then(n.bind(n,56360)),Promise.resolve().then(n.t.bind(n,54400,23))},91074:(e,r,n)=>{"use strict";n.d(r,{Separator:()=>t});var o=n(4624);n(99356);var i=n(44188),s=n(13506);function t(e){let{className:r,orientation:n="horizontal",decorative:t=!0,...l}=e;return(0,o.jsx)(i.b,{"data-slot":"separator",decorative:t,orientation:n,className:(0,s.cn)("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",r),...l})}}},e=>{e.O(0,[4400,1217,3335,4933,146,7358],()=>e(e.s=32374)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{13506:(e,t,s)=>{"use strict";s.d(t,{cn:()=>n});var a=s(47989),r=s(55701);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,r.QP)((0,a.$)(t))}},17328:(e,t,s)=>{"use strict";s.d(t,{AppSidebar:()=>T});var a=s(4624),r=s(99356),n=s(54400),l=s.n(n),i=s(69285),c=s(56221),o=s(49411),d=s(8096),u=s(72754),x=s(70762),h=s(69709),m=s(69205),p=s(9923),f=s(49623),g=s(3239),v=s(79182),b=s(42146),j=s(46972),N=s(93350),w=s(63514),y=s(80192),k=s(91074),A=s(85253),S=s(7911);let z=(0,S.createServerReference)("40930251adfbc5f2553990de7ada6a1100aed1690c",S.callServer,void 0,S.findSourceMapURL,"loadKbSectionsAction"),C=(0,S.createServerReference)("4092545769dd65089368bb8058fc7afd52f1ce88e0",S.callServer,void 0,S.findSourceMapURL,"loadTopicsAction"),R=(0,S.createServerReference)("00de78a30d1f02726db8d523a71da4c1f36e96c3f7",S.callServer,void 0,S.findSourceMapURL,"listRootsAction"),E=(0,S.createServerReference)("403e4f3de036fe384be3e5ea40c1312ed13dee7483",S.callServer,void 0,S.findSourceMapURL,"listAgentsAction");var I=s(39624),L=s(53296),_=s(50988),P=s(63622);function T(e){let{initialRoots:t}=e,s=(0,i.usePathname)(),n=(0,o.c)("app"),[c,h]=(0,r.useState)(t),m=(0,r.useCallback)(async()=>{let e=await R();e.ok&&h(e.entries)},[]);return((0,w.S9)(w.Zi.rootsChanged,m),(null==s?void 0:s.startsWith("/share/"))||"/share"===s)?null:(0,a.jsxs)("aside",{className:"w-72 shrink-0 border-r bg-muted/30 flex flex-col",children:[(0,a.jsxs)("div",{className:"px-4 py-4 flex items-center gap-2 border-b",children:[(0,a.jsx)("span",{className:"reflex-gradient inline-flex h-7 w-7 items-center justify-center rounded-lg text-white shadow-sm",children:(0,a.jsx)(d.A,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"leading-tight",children:[(0,a.jsx)(l(),{href:"/",className:"text-sm font-semibold tracking-tight hover:underline",children:"Reflex"}),(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:"knowledge base"})]})]}),(0,a.jsx)(y.F,{className:"flex-1",children:(0,a.jsxs)("nav",{className:"px-2 pt-3 pb-6",children:[(0,a.jsx)("div",{className:"px-2 mb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:n("sidebar.spaces")}),0===c.length?(0,a.jsx)("div",{className:"px-2 py-3 text-xs text-muted-foreground",children:n("sidebar.empty")}):(0,a.jsx)("ul",{className:"space-y-0.5",children:c.map(e=>{var t;return(0,a.jsx)($,{root:e,active:null!=(t=null==s?void 0:s.startsWith("/roots/".concat(e.id)))&&t},e.id)})}),(0,a.jsx)("div",{className:"mt-2 px-2",children:(0,a.jsx)(A.$,{asChild:!0,variant:"ghost",size:"sm",className:"h-7 w-full justify-start text-xs",children:(0,a.jsxs)(l(),{href:"/roots/new",children:[(0,a.jsx)(u.A,{className:"mr-1 h-3.5 w-3.5"})," ",n("sidebar.addSpace")]})})})]})}),(0,a.jsx)(k.Separator,{}),(0,a.jsxs)("div",{className:"px-2 py-2 space-y-0.5",children:[(0,a.jsx)(A.$,{asChild:!0,variant:"/utilities"===s||(null==s?void 0:s.startsWith("/utilities/"))?"secondary":"ghost",size:"sm",className:"w-full justify-start",children:(0,a.jsxs)(l(),{href:"/utilities",children:[(0,a.jsx)(I.A,{className:"mr-2 h-4 w-4"})," ",n("sidebar.utilities")]})}),(0,a.jsx)(A.$,{asChild:!0,variant:"/audit"===s?"secondary":"ghost",size:"sm",className:"w-full justify-start",children:(0,a.jsxs)(l(),{href:"/audit",children:[(0,a.jsx)(L.A,{className:"mr-2 h-4 w-4"})," ",n("sidebar.audit")]})}),(0,a.jsx)(A.$,{asChild:!0,variant:"/settings"===s?"secondary":"ghost",size:"sm",className:"w-full justify-start",children:(0,a.jsxs)(l(),{href:"/settings",children:[(0,a.jsx)(x.A,{className:"mr-2 h-4 w-4"})," Settings"]})})]})]})}function $(e){let{root:t,active:s}=e,n=(0,o.c)("app"),[c,d]=(0,r.useState)(s),[u,x]=(0,r.useState)(!1),[b,j]=(0,r.useState)(!1),[N,y]=(0,r.useState)(!1),[k,A]=(0,r.useState)(null),[S,R]=(0,r.useState)(null),[I,L]=(0,r.useState)(null),[P,T]=(0,r.useState)(!1),[$,U]=(0,r.useState)(!1),[Z,W]=(0,r.useState)(!1),O=(0,i.usePathname)();(0,r.useEffect)(()=>{s&&d(!0)},[s]);let V=(0,r.useCallback)(async()=>{T(!0);let e=await z(t.id);T(!1),e.ok?A(e.sections):A([])},[t.id]),K=(0,r.useCallback)(async()=>{U(!0);let e=await C(t.id);U(!1),e.ok?R(e.topics):R([])},[t.id]),Q=(0,r.useCallback)(async()=>{W(!0);let e=await E({rootId:t.id});W(!1),e.ok?L(e.agents):L([])},[t.id]);(0,w.S9)(w.Zi.kbChanged(t.id),()=>{u?V():A(null)}),(0,w.S9)(w.Zi.topicsChanged(t.id),()=>{b?K():R(null),N?Q():L(null)}),(0,r.useEffect)(()=>{if(!N)return;let e=setInterval(()=>{Q()},3e3);return()=>clearInterval(e)},[N,Q]);let q=async()=>{let e=!u;x(e),e&&null===k&&!P&&await V()},G=async()=>{let e=!b;j(e),e&&null===S&&!$&&await K()},H=async()=>{let e=!N;y(e),e&&null===I&&!Z&&await Q()},J=function(e){var t;let s=e.split("/").filter(Boolean);return null!=(t=s[s.length-1])?t:e}(t.path);return(0,a.jsxs)("li",{children:[(0,a.jsxs)("div",{className:"flex items-center group",children:[(0,a.jsx)("button",{type:"button",onClick:()=>d(e=>!e),className:"h-6 w-6 flex items-center justify-center text-muted-foreground hover:text-foreground shrink-0","aria-label":n(c?"sidebar.collapse":"sidebar.expand"),children:c?(0,a.jsx)(h.A,{className:"h-3.5 w-3.5"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})}),(0,a.jsxs)(l(),{href:"/roots/".concat(t.id),className:"flex-1 min-w-0 flex items-center gap-2 px-2 py-1 rounded-md text-sm hover:bg-accent ".concat(s?"bg-accent":""),children:[(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:J})]})]}),c&&(0,a.jsxs)("ul",{className:"ml-5 mt-0.5 space-y-0.5 border-l pl-1",children:[(0,a.jsxs)("li",{children:[(0,a.jsxs)("button",{type:"button",onClick:q,className:"w-full flex items-center gap-1 px-2 py-1 rounded-md text-xs text-muted-foreground hover:bg-accent hover:text-foreground",children:[u?(0,a.jsx)(h.A,{className:"h-3 w-3 shrink-0"}):(0,a.jsx)(m.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)(f.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:n("sidebar.kb")}),P&&(0,a.jsx)(g.A,{className:"ml-auto h-3 w-3 animate-spin shrink-0"})]}),u&&null!==k&&(0,a.jsx)(F,{rootId:t.id,sections:k,pathname:O})]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("button",{type:"button",onClick:G,className:"w-full flex items-center gap-1 px-2 py-1 rounded-md text-xs text-muted-foreground hover:bg-accent hover:text-foreground",children:[b?(0,a.jsx)(h.A,{className:"h-3 w-3 shrink-0"}):(0,a.jsx)(m.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)(v.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:n("sidebar.topics")}),$&&(0,a.jsx)(g.A,{className:"ml-auto h-3 w-3 animate-spin shrink-0"}),null!==S&&(0,a.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:S.length})]}),b&&null!==S&&(0,a.jsx)(B,{rootId:t.id,topics:S,pathname:O})]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("button",{type:"button",onClick:H,className:"w-full flex items-center gap-1 px-2 py-1 rounded-md text-xs text-muted-foreground hover:bg-accent hover:text-foreground",children:[N?(0,a.jsx)(h.A,{className:"h-3 w-3 shrink-0"}):(0,a.jsx)(m.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)(_.A,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:n("sidebar.agents")}),Z&&(0,a.jsx)(g.A,{className:"ml-auto h-3 w-3 animate-spin shrink-0"}),null!==I&&!Z&&(0,a.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:[I.filter(e=>D(e.status)).length,"/",I.length]})]}),N&&null!==I&&(0,a.jsx)(M,{agents:I,pathname:O})]})]})]})}function M(e){var t,s;let{agents:r,pathname:n}=e;if(0===r.length)return(0,a.jsx)(U,{});let l=new Map;for(let e of r){let s=e.parentId,a=null!=(t=l.get(s))?t:[];a.push(e),l.set(s,a)}let i=null!=(s=l.get(void 0))?s:[];return(0,a.jsx)("ul",{className:"ml-4 mt-0.5 space-y-0.5 border-l pl-1",children:i.map(e=>(0,a.jsx)(Z,{agent:e,byParent:l,pathname:n,depth:0},e.id))})}function U(){let e=(0,o.c)("app");return(0,a.jsx)("div",{className:"ml-4 px-3 py-1 text-[11px] italic text-muted-foreground",children:e("sidebar.noAgents")})}function Z(e){var t;let{agent:s,byParent:r,pathname:n,depth:i}=e,c=null!=(t=r.get(s.id))?t:[],o="/agents/".concat(s.id),d=n===o;return(0,a.jsxs)("li",{children:[(0,a.jsxs)(l(),{href:o,className:"flex items-center gap-1 px-2 py-1 text-[12px] rounded hover:bg-accent ".concat(d?"bg-accent":""),style:{paddingLeft:8*i+4},children:[D(s.status)?(0,a.jsx)(P.A,{className:"h-3 w-3 text-emerald-600 shrink-0 animate-pulse"}):(0,a.jsx)(_.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate flex-1",children:s.label}),(0,a.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground shrink-0",title:"".concat(s.harness," \xb7 ").concat(s.model),children:"claude-code"===s.harness?"claude":"ollama"===s.harness?"ollama":"codex"})]}),c.length>0&&(0,a.jsx)("ul",{className:"space-y-0.5",children:c.map(e=>(0,a.jsx)(Z,{agent:e,byParent:r,pathname:n,depth:i+1},e.id))})]})}function D(e){return"starting"===e||"running"===e}function F(e){let{rootId:t,sections:s,pathname:r}=e;return 0===s.length?(0,a.jsx)(W,{}):(0,a.jsx)("ul",{className:"ml-4 mt-0.5 space-y-0.5 border-l pl-1",children:s.map(e=>e.isDir?(0,a.jsx)(O,{rootId:t,section:e,pathname:r},e.rel):(0,a.jsx)("li",{children:(0,a.jsx)(V,{rootId:t,section:e,pathname:r})},e.rel))})}function W(){let e=(0,o.c)("app");return(0,a.jsx)("div",{className:"px-3 py-1 text-[11px] italic text-muted-foreground",children:e("sidebar.kbEmpty")})}function O(e){let{rootId:t,section:s,pathname:n}=e,[l,i]=(0,r.useState)(!1);return(0,a.jsxs)("li",{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("button",{type:"button",onClick:()=>i(e=>!e),className:"h-5 w-5 flex items-center justify-center text-muted-foreground hover:text-foreground shrink-0",children:l?(0,a.jsx)(h.A,{className:"h-3 w-3"}):(0,a.jsx)(m.A,{className:"h-3 w-3"})}),(0,a.jsx)(b.A,{className:"h-3 w-3 text-muted-foreground shrink-0 mr-1"}),(0,a.jsx)("span",{className:"text-[12px] flex-1 truncate",children:s.label})]}),l&&s.children&&(0,a.jsx)("ul",{className:"ml-4 space-y-0.5 border-l pl-1",children:s.children.map(e=>(0,a.jsx)("li",{children:(0,a.jsx)(V,{rootId:t,section:e,pathname:n})},e.rel))})]})}function V(e){let{rootId:t,section:s,pathname:r}=e;if(!s.fileRel)return null;let n=s.fileRel.split("/").map(encodeURIComponent).join("/"),i="/roots/".concat(t,"/kb/").concat(n),c=r===i;return(0,a.jsxs)(l(),{href:i,className:"flex items-center gap-1 px-2 py-1 text-[12px] rounded hover:bg-accent ".concat(c?"bg-accent":""),children:[(0,a.jsx)(f.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:s.label})]})}function B(e){let{rootId:t,topics:s,pathname:r}=e;return 0===s.length?(0,a.jsx)(K,{}):(0,a.jsx)("ul",{className:"ml-4 mt-0.5 space-y-0.5 border-l pl-1",children:s.map(e=>(0,a.jsx)(Q,{rootId:t,topic:e,pathname:r},e.id))})}function K(){let e=(0,o.c)("app");return(0,a.jsx)("div",{className:"ml-4 px-3 py-1 text-[11px] italic text-muted-foreground",children:e("sidebar.noTopics")})}function Q(e){let{rootId:t,topic:s,pathname:n}=e,d=(0,o.c)("app"),u="/roots/".concat(t,"/chat/").concat(s.id),x=n===u,[h,m]=(0,r.useTransition)(),p=(0,i.useRouter)();return(0,a.jsx)("li",{className:"group/topic",children:(0,a.jsxs)(l(),{href:u,className:"flex items-center gap-1 px-2 py-1 text-[12px] rounded hover:bg-accent ".concat(x?"bg-accent":""),children:[(0,a.jsx)(v.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,a.jsx)("span",{className:"truncate flex-1 min-w-0",children:s.title}),(0,a.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),confirm(d("sidebar.deleteTopicConfirm",{title:s.title}))&&m(async()=>{let e=await (0,N.L)(t,s.id);if(!e.ok){var a;c.oR.error(null!=(a=e.error)?a:d("sidebar.deleteFailed"));return}c.oR.success(d("sidebar.topicDeleted")),(0,w.$d)(w.Zi.topicsChanged(t)),x&&p.push("/roots/".concat(t))})},disabled:h,"aria-label":d("sidebar.deleteTopic"),title:d("sidebar.deleteTopic"),className:"opacity-0 group-hover/topic:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive shrink-0",children:h?(0,a.jsx)(g.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(j.A,{className:"h-3 w-3"})})]})})}},17848:(e,t,s)=>{Promise.resolve().then(s.bind(s,17328)),Promise.resolve().then(s.t.bind(s,60290,23)),Promise.resolve().then(s.bind(s,43450)),Promise.resolve().then(s.bind(s,52713))},43450:(e,t,s)=>{"use strict";s.d(t,{Toaster:()=>u});var a=s(4624),r=s(58726),n=s(42795),l=s(85924),i=s(69259),c=s(3239),o=s(41085),d=s(56221);let u=e=>{let{...t}=e,{theme:s="system"}=(0,o.D)();return(0,a.jsx)(d.l$,{theme:s,className:"toaster group",icons:{success:(0,a.jsx)(r.A,{className:"size-4"}),info:(0,a.jsx)(n.A,{className:"size-4"}),warning:(0,a.jsx)(l.A,{className:"size-4"}),error:(0,a.jsx)(i.A,{className:"size-4"}),loading:(0,a.jsx)(c.A,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...t})}},60290:()=>{},63514:(e,t,s)=>{"use strict";s.d(t,{$d:()=>n,S9:()=>l,Zi:()=>r});var a=s(99356);let r={rootsChanged:"reflex:roots-changed",topicsChanged:e=>"reflex:topics-changed:".concat(e),kbChanged:e=>"reflex:kb-changed:".concat(e)};function n(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}function l(e,t){(0,a.useEffect)(()=>{let s=e=>t(e.detail);return window.addEventListener(e,s),()=>window.removeEventListener(e,s)},[e,t])}},80192:(e,t,s)=>{"use strict";s.d(t,{F:()=>l});var a=s(4624);s(99356);var r=s(14884),n=s(13506);function l(e){let{className:t,children:s,...l}=e;return(0,a.jsxs)(r.Root,{"data-slot":"scroll-area",className:(0,n.cn)("relative",t),...l,children:[(0,a.jsx)(r.Viewport,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:s}),(0,a.jsx)(i,{}),(0,a.jsx)(r.Corner,{})]})}function i(e){let{className:t,orientation:s="vertical",...l}=e;return(0,a.jsx)(r.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:s,className:(0,n.cn)("flex touch-none p-px transition-colors select-none","vertical"===s&&"h-full w-2.5 border-l border-l-transparent","horizontal"===s&&"h-2.5 flex-col border-t border-t-transparent",t),...l,children:(0,a.jsx)(r.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}},85253:(e,t,s)=>{"use strict";s.d(t,{$:()=>c});var a=s(4624);s(99356);var r=s(60621),n=s(50362),l=s(13506);let i=(0,r.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function c(e){let{className:t,variant:s="default",size:r="default",asChild:c=!1,...o}=e,d=c?n.bL:"button";return(0,a.jsx)(d,{"data-slot":"button","data-variant":s,"data-size":r,className:(0,l.cn)(i({variant:s,size:r,className:t})),...o})}},91074:(e,t,s)=>{"use strict";s.d(t,{Separator:()=>l});var a=s(4624);s(99356);var r=s(44188),n=s(13506);function l(e){let{className:t,orientation:s="horizontal",decorative:l=!0,...i}=e;return(0,a.jsx)(r.b,{"data-slot":"separator",decorative:l,orientation:s,className:(0,n.cn)("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...i})}},93350:(e,t,s)=>{"use strict";s.d(t,{L:()=>r});var a=s(7911);let r=(0,a.createServerReference)("60c2a4c8a50ed88e5adf0646cff15ad227ad80c5ce",a.callServer,void 0,a.findSourceMapURL,"deleteTopicAction")}},e=>{e.O(0,[497,4400,1217,9411,9776,5041,4933,146,7358],()=>e(e.s=17848)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9566],{3239:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(45804).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},8096:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(45804).A)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},18759:(e,t,s)=>{"use strict";s.d(t,{OnboardingWizard:()=>N});var l=s(4624),a=s(99356),i=s(69285),n=s(49411),c=s(8096),d=s(3239),r=s(45804);let o=(0,r.A)("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);var m=s(86790);let x=(0,r.A)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);var u=s(58726);let p=(0,r.A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var h=s(54207),g=s(85924),v=s(56221),j=s(7911);let b=(0,j.createServerReference)("00237475cf7a60e9e00137297589fad3f3858b87f6",j.callServer,void 0,j.findSourceMapURL,"detectEnginesAction"),f=(0,j.createServerReference)("40c539b06087c30284cc382ec5ce15558f0a749add",j.callServer,void 0,j.findSourceMapURL,"runOnboardingAction");function N(e){var t,s,r;let{templates:g,initialLanguage:j,initialName:N}=e,w=(0,n.c)("onboarding"),C=(0,i.useRouter)(),[M,L]=(0,a.useState)(0),[S,R]=(0,a.useState)(N),[z,T]=(0,a.useState)(j||"russian"),[D,E]=(0,a.useState)(""),[_,H]=(0,a.useState)("claude"),[O,P]=(0,a.useState)({loading:!0,claudeAvailable:!1,codexAvailable:!1,ollamaAvailable:!1}),[F,q]=(0,a.useState)(new Set),[V,Z]=(0,a.useTransition)();(0,a.useEffect)(()=>{try{E(Intl.DateTimeFormat().resolvedOptions().timeZone||"")}catch(e){}(async()=>{let e=await b();P({loading:!1,claudeAvailable:e.claudeCli.available,...e.claudeCli.version?{claudeVersion:e.claudeCli.version}:{},codexAvailable:e.codexCli.available,...e.codexCli.version?{codexVersion:e.codexCli.version}:{},ollamaAvailable:e.ollama.available,...void 0!==e.ollama.modelsCount?{ollamaModels:e.ollama.modelsCount}:{}}),!e.claudeCli.available&&(e.codexCli.available?H("codex"):e.ollama.available&&H("ollama"))})()},[]);let U=(0,a.useMemo)(()=>0===M?S.trim().length>0&&z.trim().length>0:1===M?"claude"===_?O.claudeAvailable:"codex"===_?O.codexAvailable:O.ollamaAvailable:2!==M||F.size>0,[M,S,z,_,O,F]),B=[w("stepTitles.0"),w("stepTitles.1"),w("stepTitles.2"),w("stepTitles.3")];return(0,l.jsx)("div",{className:"min-h-screen flex flex-col items-center px-4 py-8",children:(0,l.jsxs)("div",{className:"w-full max-w-2xl space-y-4",children:[(0,l.jsxs)("header",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,l.jsx)(c.A,{className:"h-4 w-4 text-violet-600"}),(0,l.jsx)("span",{className:"font-medium",children:w("header.welcome")}),(0,l.jsx)("span",{className:"ml-auto text-xs",children:w("header.stepCounter",{current:M+1,total:4,title:B[M]})})]}),(0,l.jsx)(y,{current:M}),0===M&&(0,l.jsxs)(k,{children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold",children:w("step0.title")}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:w("step0.description")}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-xs font-medium",htmlFor:"name",children:w("step0.nameLabel")}),(0,l.jsx)("input",{id:"name",value:S,onChange:e=>R(e.target.value),autoFocus:!0,placeholder:w("step0.namePlaceholder"),className:"w-full rounded border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-xs font-medium",htmlFor:"lang",children:w("step0.languageLabel")}),(0,l.jsxs)("select",{id:"lang",value:z,onChange:e=>T(e.target.value),className:"w-full rounded border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-violet-400",children:[(0,l.jsx)("option",{value:"russian",children:w("step0.languageRu")}),(0,l.jsx)("option",{value:"english",children:w("step0.languageEn")}),(0,l.jsx)("option",{value:"espa\xf1ol",children:w("step0.languageEs")}),(0,l.jsx)("option",{value:"deutsch",children:w("step0.languageDe")}),(0,l.jsx)("option",{value:"fran\xe7ais",children:w("step0.languageFr")})]})]}),D&&(0,l.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:[w("step0.timezoneDetected")," ",(0,l.jsx)("code",{className:"font-mono",children:D})]})]}),1===M&&(0,l.jsxs)(k,{children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold",children:w("step1.title")}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:w("step1.description")}),O.loading?(0,l.jsxs)("p",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[(0,l.jsx)(d.A,{className:"h-4 w-4 animate-spin"}),w("step1.checking")]}):(0,l.jsxs)("div",{className:"grid gap-2",children:[(0,l.jsx)(A,{selected:"claude"===_,onSelect:()=>H("claude"),icon:(0,l.jsx)(o,{className:"h-5 w-5"}),title:w("step1.claudeTitle"),description:w("step1.claudeDescription"),installLinkLabel:w("step1.installLink"),status:O.claudeAvailable?{ok:!0,hint:null!=(t=O.claudeVersion)?t:w("step1.claudeReady")}:{ok:!1,hint:w("step1.claudeMissing"),link:"https://docs.anthropic.com/claude/docs/claude-code"}}),(0,l.jsx)(A,{selected:"codex"===_,onSelect:()=>H("codex"),icon:(0,l.jsx)(m.A,{className:"h-5 w-5"}),title:w("step1.codexTitle"),description:w("step1.codexDescription"),installLinkLabel:w("step1.installLink"),status:O.codexAvailable?{ok:!0,hint:null!=(s=O.codexVersion)?s:w("step1.codexReady")}:{ok:!1,hint:w("step1.codexMissing"),link:"https://github.com/openai/codex"}}),(0,l.jsx)(A,{selected:"ollama"===_,onSelect:()=>H("ollama"),icon:(0,l.jsx)(x,{className:"h-5 w-5"}),title:w("step1.ollamaTitle"),description:w("step1.ollamaDescription"),installLinkLabel:w("step1.installLink"),status:O.ollamaAvailable?{ok:!0,hint:w("step1.ollamaModels",{count:null!=(r=O.ollamaModels)?r:"?"})}:{ok:!1,hint:w("step1.ollamaMissing"),link:"https://ollama.com/download"}})]})]}),2===M&&(0,l.jsxs)(k,{children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold",children:w("step2.title")}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:w("step2.description")}),(0,l.jsx)("ul",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:g.map(e=>{let t=F.has(e.id);return(0,l.jsx)("li",{children:(0,l.jsx)("button",{type:"button",onClick:()=>{let t=new Set(F);t.has(e.id)?t.delete(e.id):t.add(e.id),q(t)},className:"w-full text-left rounded-lg border p-3 transition "+(t?"border-violet-500 bg-violet-50 dark:bg-violet-950/40":"hover:bg-accent"),children:(0,l.jsxs)("div",{className:"flex items-start gap-2",children:[(0,l.jsx)("span",{className:"text-2xl leading-none",children:e.emoji}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"font-medium flex items-center gap-1",children:[e.label,t&&(0,l.jsx)(u.A,{className:"h-3.5 w-3.5 text-violet-600"})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground leading-snug mt-0.5",children:e.description})]})]})})},e.id)})}),(0,l.jsx)("p",{className:"text-[11px] text-muted-foreground",children:w("step2.folderHint")})]}),3===M&&(0,l.jsxs)(k,{children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold",children:w("step3.title")}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:w("step3.description")}),(0,l.jsxs)("ul",{className:"text-sm space-y-1",children:[(0,l.jsxs)("li",{className:"flex items-center gap-2",children:[(0,l.jsx)(u.A,{className:"h-4 w-4 text-emerald-600"}),w("step3.profileLabel")," ",(0,l.jsx)("strong",{children:S})," \xb7 ",z," \xb7 ",D||w("step3.empty")]}),(0,l.jsxs)("li",{className:"flex items-center gap-2",children:[(0,l.jsx)(u.A,{className:"h-4 w-4 text-emerald-600"}),w("step3.engineLabel")," ",(0,l.jsx)("strong",{children:"claude"===_?w("step3.engineClaude"):"codex"===_?w("step3.engineCodex"):w("step3.engineOllama")})]}),(0,l.jsxs)("li",{className:"flex items-center gap-2",children:[(0,l.jsx)(u.A,{className:"h-4 w-4 text-emerald-600"}),w("step3.spacesLabel")," ",[...F].map(e=>{var t;return null==(t=g.find(t=>t.id===e))?void 0:t.label}).filter(Boolean).join(" \xb7 ")||w("step3.empty")]})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:w("step3.footer")})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[M>0&&(0,l.jsxs)("button",{type:"button",onClick:()=>L(e=>e-1),className:"inline-flex items-center gap-1 rounded border px-3 py-2 text-sm hover:bg-accent",children:[(0,l.jsx)(p,{className:"h-4 w-4"}),w("nav.back")]}),(0,l.jsx)("div",{className:"ml-auto"}),M<3?(0,l.jsxs)("button",{type:"button",onClick:()=>L(e=>e+1),disabled:!U,className:"inline-flex items-center gap-1 rounded bg-violet-600 px-4 py-2 text-sm font-medium text-white hover:bg-violet-700 disabled:opacity-50",children:[w("nav.next"),(0,l.jsx)(h.A,{className:"h-4 w-4"})]}):(0,l.jsxs)("button",{type:"button",onClick:()=>{Z(async()=>{let e=await f({userName:S.trim(),language:z.trim(),timezone:D.trim(),engine:_,templates:[...F]});if(!e.ok){var t;v.oR.error(null!=(t=e.error)?t:w("errors.generic"));return}v.oR.success(w("success.created",{spaces:e.spacesCreated,widgets:e.widgetsCreated})),C.push("/")})},disabled:V,className:"inline-flex items-center gap-1 rounded bg-emerald-600 px-4 py-2 text-sm font-medium text-white hover:bg-emerald-700 disabled:opacity-50",children:[V?(0,l.jsx)(d.A,{className:"h-4 w-4 animate-spin"}):(0,l.jsx)(c.A,{className:"h-4 w-4"}),w("nav.start")]})]})]})})}function k(e){let{children:t}=e;return(0,l.jsx)("section",{className:"rounded-xl border bg-card p-6 shadow-sm space-y-4",children:t})}function y(e){let{current:t}=e;return(0,l.jsx)("div",{className:"flex items-center gap-1",children:[0,1,2,3].map(e=>(0,l.jsx)("div",{className:"h-1 flex-1 rounded-full "+(e<=t?"bg-violet-600":"bg-muted")},e))})}function A(e){let{selected:t,onSelect:s,icon:a,title:i,description:n,status:c,installLinkLabel:d}=e;return(0,l.jsxs)("button",{type:"button",onClick:s,className:"w-full text-left rounded-lg border p-3 transition flex items-start gap-3 "+(t?"border-violet-500 bg-violet-50 dark:bg-violet-950/40":"hover:bg-accent"),children:[(0,l.jsx)("div",{className:"mt-0.5 text-violet-600",children:a}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"font-medium flex items-center gap-2",children:[i,t&&(0,l.jsx)(u.A,{className:"h-3.5 w-3.5 text-violet-600"})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground leading-snug mt-0.5",children:n}),(0,l.jsxs)("div",{className:"mt-1.5 inline-flex items-center gap-1 text-[11px] "+(c.ok?"text-emerald-700":"text-amber-700"),children:[c.ok?(0,l.jsx)(u.A,{className:"h-3 w-3"}):(0,l.jsx)(g.A,{className:"h-3 w-3"}),(0,l.jsx)("span",{children:c.hint}),c.link&&(0,l.jsx)("a",{href:c.link,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"underline ml-1",children:d})]})]})]})}},54207:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(45804).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},58726:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(45804).A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},69285:(e,t,s)=>{"use strict";var l=s(48849);s.o(l,"usePathname")&&s.d(t,{usePathname:function(){return l.usePathname}}),s.o(l,"useRouter")&&s.d(t,{useRouter:function(){return l.useRouter}})},81641:(e,t,s)=>{Promise.resolve().then(s.bind(s,18759))},85924:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(45804).A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},86790:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(45804).A)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])}},e=>{e.O(0,[9411,9776,4933,146,7358],()=>e(e.s=81641)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{63392:(e,r,n)=>{Promise.resolve().then(n.bind(n,89061)),Promise.resolve().then(n.bind(n,96253)),Promise.resolve().then(n.bind(n,28050)),Promise.resolve().then(n.bind(n,94904)),Promise.resolve().then(n.bind(n,13270)),Promise.resolve().then(n.bind(n,99730)),Promise.resolve().then(n.bind(n,89146)),Promise.resolve().then(n.bind(n,19078)),Promise.resolve().then(n.bind(n,67854)),Promise.resolve().then(n.bind(n,69050)),Promise.resolve().then(n.bind(n,63739)),Promise.resolve().then(n.bind(n,33976)),Promise.resolve().then(n.bind(n,12537)),Promise.resolve().then(n.bind(n,97485)),Promise.resolve().then(n.bind(n,41923)),Promise.resolve().then(n.bind(n,73868)),Promise.resolve().then(n.bind(n,53511)),Promise.resolve().then(n.bind(n,2018)),Promise.resolve().then(n.bind(n,18487)),Promise.resolve().then(n.bind(n,98346)),Promise.resolve().then(n.bind(n,14884)),Promise.resolve().then(n.bind(n,85314)),Promise.resolve().then(n.bind(n,17280)),Promise.resolve().then(n.bind(n,8855)),Promise.resolve().then(n.bind(n,86631)),Promise.resolve().then(n.bind(n,2604)),Promise.resolve().then(n.bind(n,27237)),Promise.resolve().then(n.bind(n,49455)),Promise.resolve().then(n.bind(n,39211)),Promise.resolve().then(n.bind(n,56360)),Promise.resolve().then(n.t.bind(n,54400,23))},74315:(e,r,n)=>{"use strict";n.d(r,{h:()=>s});var i=n(7911);let s=(0,i.createServerReference)("70d832b2b293dcfd4d90e921c48bb3e66580f5f99d",i.callServer,void 0,i.findSourceMapURL,"generateTopicTitleAction")},83567:(e,r,n)=>{"use strict";n.d(r,{g:()=>s});var i=n(7911);let s=(0,i.createServerReference)("7889187bb0f915b7eca03da06e2185f398edf521a7",i.callServer,void 0,i.findSourceMapURL,"startTopicAction")},89061:(e,r,n)=>{"use strict";n.d(r,{UniversalChatBar:()=>v});var i=n(4624),s=n(99356),t=n(69285),o=n(69709),l=n(95265),d=n(56221),a=n(49411),c=n(83567),m=n(74315),b=n(88528),u=n(63602),h=n(63514);function v(e){var r,n,v;let{spaces:p}=e,f=(0,t.useRouter)(),x=(0,a.c)("app"),[P,g]=(0,s.useState)(null!=(n=null==(r=p[0])?void 0:r.id)?n:""),[w,j]=(0,s.useState)(!1),[,k]=(0,s.useTransition)(),N=(0,s.useRef)(null),S=null!=(v=p.find(e=>e.id===P))?v:p[0];if((0,s.useEffect)(()=>{if(!w)return;let e=e=>{var r;(null==(r=N.current)?void 0:r.contains(e.target))||j(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[w]),!S)return(0,i.jsx)("div",{className:"border-t bg-background",children:(0,i.jsxs)("div",{className:"mx-auto max-w-3xl px-6 py-5 text-center text-xs text-muted-foreground",children:[x("universal.createFirstSpace1")," ",(0,i.jsx)("a",{href:"/onboarding?force=1",className:"underline",children:x("universal.wizardLink")})," ",x("universal.or")," ",(0,i.jsx)("a",{href:"/roots/new",className:"underline",children:x("universal.manualLink")}),"."]})});let L=p.length>1?(0,i.jsxs)("div",{className:"relative",ref:N,children:[(0,i.jsxs)("button",{type:"button",onClick:()=>j(e=>!e),className:"inline-flex items-center gap-1 rounded-full border bg-card/80 px-2 py-0.5 text-[10px] font-medium hover:bg-accent normal-case tracking-normal",title:x("universal.pickSpace"),children:[(0,i.jsx)("span",{className:"text-muted-foreground",children:x("universal.in")}),(0,i.jsx)("span",{children:S.label}),(0,i.jsx)(o.A,{className:"h-3 w-3 text-muted-foreground"})]}),w&&(0,i.jsx)("ul",{className:"absolute bottom-full right-0 mb-1 min-w-[200px] max-h-60 overflow-y-auto rounded-md border bg-popover shadow-lg z-40 py-1",children:p.map(e=>(0,i.jsx)("li",{children:(0,i.jsx)("button",{type:"button",onClick:()=>{g(e.id),j(!1)},className:"block w-full text-left px-3 py-1.5 text-sm hover:bg-accent "+(e.id===S.id?"font-semibold":""),children:e.label})},e.id))})]}):null,y=async e=>await new Promise(r=>{k(async()=>{let n=await (0,c.g)(S.id,e.message,e.attachments);if(!n.ok){d.oR.error(n.error),r(!1);return}(0,h.$d)(h.Zi.topicsChanged(S.id)),e.message.trim()&&(0,m.h)(S.id,n.topicId,e.message).then(e=>{e.ok&&(0,h.$d)(h.Zi.topicsChanged(S.id))}),f.push("/roots/".concat(S.id,"/chat/").concat(n.topicId)),r(!0)})});return(0,i.jsx)(u.E,{label:x("universal.label"),...L?{headerRight:L}:{},children:(0,i.jsx)(b.L,{rootId:S.id,placeholder:x("universal.placeholder"),submitLabel:x("universal.submitLabel"),pendingLabel:x("universal.pendingLabel"),SubmitIcon:l.A,onSubmit:y},S.id)})}}},e=>{e.O(0,[4400,1217,9411,3335,5097,3954,5779,4933,146,7358],()=>e(e.s=63392)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{14777:(e,r,n)=>{"use strict";n.d(r,{g:()=>s});var i=n(7911);let s=(0,i.createServerReference)("78d12bf078b77e342c117678b70a4104ecdf74c3d7",i.callServer,void 0,i.findSourceMapURL,"startTopicAction")},63392:(e,r,n)=>{Promise.resolve().then(n.bind(n,89061)),Promise.resolve().then(n.bind(n,96253)),Promise.resolve().then(n.bind(n,28050)),Promise.resolve().then(n.bind(n,94904)),Promise.resolve().then(n.bind(n,13270)),Promise.resolve().then(n.bind(n,99730)),Promise.resolve().then(n.bind(n,89146)),Promise.resolve().then(n.bind(n,19078)),Promise.resolve().then(n.bind(n,67854)),Promise.resolve().then(n.bind(n,69050)),Promise.resolve().then(n.bind(n,63739)),Promise.resolve().then(n.bind(n,33976)),Promise.resolve().then(n.bind(n,12537)),Promise.resolve().then(n.bind(n,97485)),Promise.resolve().then(n.bind(n,41923)),Promise.resolve().then(n.bind(n,73868)),Promise.resolve().then(n.bind(n,53511)),Promise.resolve().then(n.bind(n,2018)),Promise.resolve().then(n.bind(n,18487)),Promise.resolve().then(n.bind(n,98346)),Promise.resolve().then(n.bind(n,14884)),Promise.resolve().then(n.bind(n,85314)),Promise.resolve().then(n.bind(n,17280)),Promise.resolve().then(n.bind(n,8855)),Promise.resolve().then(n.bind(n,86631)),Promise.resolve().then(n.bind(n,2604)),Promise.resolve().then(n.bind(n,27237)),Promise.resolve().then(n.bind(n,49455)),Promise.resolve().then(n.bind(n,39211)),Promise.resolve().then(n.bind(n,56360)),Promise.resolve().then(n.t.bind(n,54400,23))},70885:(e,r,n)=>{"use strict";n.d(r,{h:()=>s});var i=n(7911);let s=(0,i.createServerReference)("708c38608029960899f79a68beb1401258ac0f4c87",i.callServer,void 0,i.findSourceMapURL,"generateTopicTitleAction")},89061:(e,r,n)=>{"use strict";n.d(r,{UniversalChatBar:()=>v});var i=n(4624),s=n(99356),t=n(69285),o=n(69709),l=n(95265),a=n(56221),d=n(49411),c=n(14777),m=n(70885),u=n(12734),b=n(63602),h=n(63514);function v(e){var r,n,v;let{spaces:p}=e,f=(0,t.useRouter)(),x=(0,d.c)("app"),[P,g]=(0,s.useState)(null!=(n=null==(r=p[0])?void 0:r.id)?n:""),[w,j]=(0,s.useState)(!1),[,k]=(0,s.useTransition)(),N=(0,s.useRef)(null),S=null!=(v=p.find(e=>e.id===P))?v:p[0];if((0,s.useEffect)(()=>{if(!w)return;let e=e=>{var r;(null==(r=N.current)?void 0:r.contains(e.target))||j(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[w]),!S)return(0,i.jsx)("div",{className:"border-t bg-background",children:(0,i.jsxs)("div",{className:"mx-auto max-w-3xl px-6 py-5 text-center text-xs text-muted-foreground",children:[x("universal.createFirstSpace1")," ",(0,i.jsx)("a",{href:"/onboarding?force=1",className:"underline",children:x("universal.wizardLink")})," ",x("universal.or")," ",(0,i.jsx)("a",{href:"/roots/new",className:"underline",children:x("universal.manualLink")}),"."]})});let L=p.length>1?(0,i.jsxs)("div",{className:"relative",ref:N,children:[(0,i.jsxs)("button",{type:"button",onClick:()=>j(e=>!e),className:"inline-flex items-center gap-1 rounded-full border bg-card/80 px-2 py-0.5 text-[10px] font-medium hover:bg-accent normal-case tracking-normal",title:x("universal.pickSpace"),children:[(0,i.jsx)("span",{className:"text-muted-foreground",children:x("universal.in")}),(0,i.jsx)("span",{children:S.label}),(0,i.jsx)(o.A,{className:"h-3 w-3 text-muted-foreground"})]}),w&&(0,i.jsx)("ul",{className:"absolute bottom-full right-0 mb-1 min-w-[200px] max-h-60 overflow-y-auto rounded-md border bg-popover shadow-lg z-40 py-1",children:p.map(e=>(0,i.jsx)("li",{children:(0,i.jsx)("button",{type:"button",onClick:()=>{g(e.id),j(!1)},className:"block w-full text-left px-3 py-1.5 text-sm hover:bg-accent "+(e.id===S.id?"font-semibold":""),children:e.label})},e.id))})]}):null,y=async e=>await new Promise(r=>{k(async()=>{let n=await (0,c.g)(S.id,e.message,e.attachments);if(!n.ok){a.oR.error(n.error),r(!1);return}(0,h.$d)(h.Zi.topicsChanged(S.id)),e.message.trim()&&(0,m.h)(S.id,n.topicId,e.message).then(e=>{e.ok&&(0,h.$d)(h.Zi.topicsChanged(S.id))}),f.push("/roots/".concat(S.id,"/chat/").concat(n.topicId)),r(!0)})});return(0,i.jsx)(b.E,{label:x("universal.label"),...L?{headerRight:L}:{},children:(0,i.jsx)(u.L,{rootId:S.id,placeholder:x("universal.placeholder"),submitLabel:x("universal.submitLabel"),pendingLabel:x("universal.pendingLabel"),SubmitIcon:l.A,onSubmit:y},S.id)})}}},e=>{e.O(0,[4400,1217,9411,9776,3335,2038,7529,4933,146,7358],()=>e(e.s=63392)),_N_E=e.O()}]);