dev3000 0.0.117 → 0.0.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdp-monitor.d.ts +1 -0
- package/dist/cdp-monitor.d.ts.map +1 -1
- package/dist/cdp-monitor.js +11 -2
- package/dist/cdp-monitor.js.map +1 -1
- package/mcp-server/.next/BUILD_ID +1 -1
- package/mcp-server/.next/build-manifest.json +2 -2
- package/mcp-server/.next/fallback-build-manifest.json +2 -2
- package/mcp-server/.next/prerender-manifest.json +3 -3
- package/mcp-server/.next/server/app/.well-known/workflow/v1/step/route.js +1 -1
- package/mcp-server/.next/server/app/.well-known/workflow/v1/step/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/_global-error.html +2 -2
- package/mcp-server/.next/server/app/_global-error.rsc +1 -1
- package/mcp-server/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/_not-found.html +1 -1
- package/mcp-server/.next/server/app/_not-found.rsc +2 -2
- package/mcp-server/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/mcp-server/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/mcp-server/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/mcp-server/.next/server/app/api/cloud/fix-workflow/route.js +1 -1
- package/mcp-server/.next/server/app/api/cloud/fix-workflow/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/api/cloud/start-fix/route.js +1 -1
- package/mcp-server/.next/server/app/api/cloud/start-fix/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/api/jank/[session]/route.js +1 -1
- package/mcp-server/.next/server/app/api/jank/[session]/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/auth/error/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/auth/error.html +1 -1
- package/mcp-server/.next/server/app/auth/error.rsc +2 -2
- package/mcp-server/.next/server/app/auth/error.segments/_full.segment.rsc +2 -2
- package/mcp-server/.next/server/app/auth/error.segments/_head.segment.rsc +1 -1
- package/mcp-server/.next/server/app/auth/error.segments/_index.segment.rsc +2 -2
- package/mcp-server/.next/server/app/auth/error.segments/_tree.segment.rsc +2 -2
- package/mcp-server/.next/server/app/auth/error.segments/auth/error/__PAGE__.segment.rsc +1 -1
- package/mcp-server/.next/server/app/auth/error.segments/auth/error.segment.rsc +1 -1
- package/mcp-server/.next/server/app/auth/error.segments/auth.segment.rsc +1 -1
- package/mcp-server/.next/server/app/index.html +1 -1
- package/mcp-server/.next/server/app/index.rsc +2 -2
- package/mcp-server/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/mcp-server/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/mcp-server/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/mcp-server/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/mcp-server/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/mcp-server/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/mcp/route.js +1 -1
- package/mcp-server/.next/server/app/mcp/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/signin/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/video/[session]/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/workflows/[id]/report/page.js +1 -1
- package/mcp-server/.next/server/app/workflows/[id]/report/page.js.nft.json +1 -1
- package/mcp-server/.next/server/app/workflows/[id]/report/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/workflows/new/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/workflows/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/chunks/{[root-of-the-server]__ec6a1335._.js → [root-of-the-server]__1095b0eb._.js} +2 -2
- package/mcp-server/.next/server/chunks/[root-of-the-server]__1095b0eb._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__157de66b._.js +111 -111
- package/mcp-server/.next/server/chunks/[root-of-the-server]__157de66b._.js.map +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__18ce35ee._.js +3 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__18ce35ee._.js.map +1 -0
- package/mcp-server/.next/server/chunks/{[root-of-the-server]__2920484d._.js → [root-of-the-server]__29c39fca._.js} +2 -2
- package/mcp-server/.next/server/chunks/{[root-of-the-server]__2920484d._.js.map → [root-of-the-server]__29c39fca._.js.map} +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__55642730._.js +3 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__55642730._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__730a8fd0._.js +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__730a8fd0._.js.map +1 -1
- package/mcp-server/.next/server/chunks/{[root-of-the-server]__ece7a7f7._.js → [root-of-the-server]__951b3108._.js} +2 -2
- package/mcp-server/.next/server/chunks/{[root-of-the-server]__bcb77a22._.js → [root-of-the-server]__fd11bb92._.js} +2 -2
- package/mcp-server/.next/server/chunks/bee4f_next_dist_esm_build_templates_app-route_1ece9366.js +83 -53
- package/mcp-server/.next/server/chunks/bee4f_next_dist_esm_build_templates_app-route_1ece9366.js.map +1 -1
- package/mcp-server/.next/server/chunks/mcp-server_app_api_cloud_fix-workflow_steps_ts_b65f3271._.js +19 -19
- package/mcp-server/.next/server/chunks/mcp-server_app_api_cloud_fix-workflow_steps_ts_b65f3271._.js.map +1 -1
- package/mcp-server/.next/server/chunks/mcp-server_lib_workflow-storage_ts_30ca7761._.js +3 -0
- package/mcp-server/.next/server/chunks/mcp-server_lib_workflow-storage_ts_30ca7761._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__bb161645._.js → [root-of-the-server]__34cc4876._.js} +2 -2
- package/mcp-server/.next/server/chunks/ssr/_cd4dc25e._.js.map +1 -1
- package/mcp-server/.next/server/chunks/ssr/mcp-server_app_workflows_new_new-workflow-client_tsx_1312c046._.js +1 -1
- package/mcp-server/.next/server/chunks/ssr/mcp-server_app_workflows_new_new-workflow-client_tsx_1312c046._.js.map +1 -1
- package/mcp-server/.next/server/server-reference-manifest.js +1 -1
- package/mcp-server/.next/server/server-reference-manifest.json +1 -1
- package/mcp-server/.next/static/chunks/{93db5737a327ab0c.js → 7b9a23e7f572d8a7.js} +1 -1
- package/mcp-server/.next/static/chunks/98585d170d82e3e8.css +1 -0
- package/mcp-server/app/api/cloud/fix-workflow/steps.ts +35 -4
- package/mcp-server/app/api/cloud/fix-workflow/workflow.ts +53 -1
- package/mcp-server/app/api/cloud/start-fix/route.ts +11 -2
- package/mcp-server/app/api/workflows/route.ts +36 -14
- package/mcp-server/app/workflows/new-workflow-modal.tsx +90 -23
- package/package.json +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__c1681338._.js +0 -3
- package/mcp-server/.next/server/chunks/[root-of-the-server]__c1681338._.js.map +0 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__ec6a1335._.js.map +0 -1
- package/mcp-server/.next/static/chunks/000849a6a897f531.css +0 -1
- /package/mcp-server/.next/server/chunks/{[root-of-the-server]__ece7a7f7._.js.map → [root-of-the-server]__951b3108._.js.map} +0 -0
- /package/mcp-server/.next/server/chunks/{[root-of-the-server]__bcb77a22._.js.map → [root-of-the-server]__fd11bb92._.js.map} +0 -0
- /package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__bb161645._.js.map → [root-of-the-server]__34cc4876._.js.map} +0 -0
- /package/mcp-server/.next/static/{3tu8GDHzRVmtUnaVw3VqB → GVm-012A2JbRg9oviNAqV}/_buildManifest.js +0 -0
- /package/mcp-server/.next/static/{3tu8GDHzRVmtUnaVw3VqB → GVm-012A2JbRg9oviNAqV}/_clientMiddlewareManifest.json +0 -0
- /package/mcp-server/.next/static/{3tu8GDHzRVmtUnaVw3VqB → GVm-012A2JbRg9oviNAqV}/_ssgManifest.js +0 -0
|
@@ -3,6 +3,6 @@ module.exports=[7362,a=>{"use strict";var b=a.i(55205),c=a.i(11805),d=a.i(33857)
|
|
|
3
3
|
- less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
|
|
4
4
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
5
5
|
|
|
6
|
-
Defaulting to \`null\`.`));let l=F(g,k)?g:null,m=D(l)?i(l,k):void 0;return(0,b.jsx)(w,{scope:f,value:l,max:k,children:(0,b.jsx)(q.div,{"aria-valuemax":k,"aria-valuemin":0,"aria-valuenow":D(l)?l:void 0,"aria-valuetext":m,role:"progressbar","data-state":C(l,k),"data-value":l??void 0,"data-max":k,...j,ref:c})})});y.displayName=t;var z="ProgressIndicator",A=d.forwardRef((a,c)=>{let{__scopeProgress:d,...e}=a,f=x(z,d);return(0,b.jsx)(q.div,{"data-state":C(f.value,f.max),"data-value":f.value??void 0,"data-max":f.max,...e,ref:c})});function B(a,b){return`${Math.round(a/b*100)}%`}function C(a,b){return null==a?"indeterminate":a===b?"complete":"loading"}function D(a){return"number"==typeof a}function E(a){return D(a)&&!isNaN(a)&&a>0}function F(a,b){return D(a)&&!isNaN(a)&&a<=b&&a>=0}function G({className:a,value:c,...d}){return(0,b.jsx)(y,{"data-slot":"progress",className:(0,i.cn)("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",a),...d,children:(0,b.jsx)(A,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(c||0)}%)`}})})}function H(a,[b,c]){return Math.min(c,Math.max(b,a))}A.displayName=z;var I=a.i(59653),J=a.i(90078),K=a.i(72973),L=a.i(56828),M=new WeakMap;function N(a,b){var c,d;let e,f,g;if("at"in Array.prototype)return Array.prototype.at.call(a,b);let h=(c=a,d=b,e=c.length,(g=(f=O(d))>=0?f:e+f)<0||g>=e?-1:g);return -1===h?void 0:a[h]}function O(a){return a!=a||0===a?0:Math.trunc(a)}(class a extends Map{#a;constructor(a){super(a),this.#a=[...super.keys()],M.set(this,!0)}set(a,b){return M.get(this)&&(this.has(a)?this.#a[this.#a.indexOf(a)]=a:this.#a.push(a)),super.set(a,b),this}insert(a,b,c){let d,e=this.has(b),f=this.#a.length,g=O(a),h=g>=0?g:f+g,i=h<0||h>=f?-1:h;if(i===this.size||e&&i===this.size-1||-1===i)return this.set(b,c),this;let j=this.size+ +!e;g<0&&h++;let k=[...this.#a],l=!1;for(let a=h;a<j;a++)if(h===a){let f=k[a];k[a]===b&&(f=k[a+1]),e&&this.delete(b),d=this.get(f),this.set(b,c)}else{l||k[a-1]!==b||(l=!0);let c=k[l?a:a-1],e=d;d=this.get(c),this.delete(c),this.set(c,e)}return this}with(b,c,d){let e=new a(this);return e.insert(b,c,d),e}before(a){let b=this.#a.indexOf(a)-1;if(!(b<0))return this.entryAt(b)}setBefore(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d,b,c)}after(a){let b=this.#a.indexOf(a);if(-1!==(b=-1===b||b===this.size-1?-1:b+1))return this.entryAt(b)}setAfter(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d+1,b,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#a=[],super.clear()}delete(a){let b=super.delete(a);return b&&this.#a.splice(this.#a.indexOf(a),1),b}deleteAt(a){let b=this.keyAt(a);return void 0!==b&&this.delete(b)}at(a){let b=N(this.#a,a);if(void 0!==b)return this.get(b)}entryAt(a){let b=N(this.#a,a);if(void 0!==b)return[b,this.get(b)]}indexOf(a){return this.#a.indexOf(a)}keyAt(a){return N(this.#a,a)}from(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return d;c++}}findIndex(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return c;c++}return -1}filter(b,c){let d=[],e=0;for(let a of this)Reflect.apply(b,c,[a,e,this])&&d.push(a),e++;return new a(d)}map(b,c){let d=[],e=0;for(let a of this)d.push([a[0],Reflect.apply(b,c,[a,e,this])]),e++;return new a(d)}reduce(...a){let[b,c]=a,d=0,e=c??this.at(0);for(let c of this)e=0===d&&1===a.length?c:Reflect.apply(b,this,[e,c,d,this]),d++;return e}reduceRight(...a){let[b,c]=a,d=c??this.at(-1);for(let c=this.size-1;c>=0;c--){let e=this.at(c);d=c===this.size-1&&1===a.length?e:Reflect.apply(b,this,[d,e,c,this])}return d}toSorted(b){return new a([...this.entries()].sort(b))}toReversed(){let b=new a;for(let a=this.size-1;a>=0;a--){let c=this.keyAt(a),d=this.get(c);b.set(c,d)}return b}toSpliced(...b){let c=[...this.entries()];return c.splice(...b),new a(c)}slice(b,c){let d=new a,e=this.size-1;if(void 0===b)return d;b<0&&(b+=this.size),void 0!==c&&c>0&&(e=c-1);for(let a=b;a<=e;a++){let b=this.keyAt(a),c=this.get(b);d.set(b,c)}return d}every(a,b){let c=0;for(let d of this){if(!Reflect.apply(a,b,[d,c,this]))return!1;c++}return!0}some(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return!0;c++}return!1}});var P=d.createContext(void 0),Q=a.i(6041),R=a.i(41761),S=a.i(9730),T=a.i(35598);let U=["top","right","bottom","left"],V=Math.min,W=Math.max,X=Math.round,Y=Math.floor,Z=a=>({x:a,y:a}),$={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function aa(a,b){return"function"==typeof a?a(b):a}function ab(a){return a.split("-")[0]}function ac(a){return a.split("-")[1]}function ad(a){return"x"===a?"y":"x"}function ae(a){return"y"===a?"height":"width"}let af=new Set(["top","bottom"]);function ag(a){return af.has(ab(a))?"y":"x"}function ah(a){return a.replace(/start|end/g,a=>_[a])}let ai=["left","right"],aj=["right","left"],ak=["top","bottom"],al=["bottom","top"];function am(a){return a.replace(/left|right|bottom|top/g,a=>$[a])}function an(a){return"number"!=typeof a?{top:0,right:0,bottom:0,left:0,...a}:{top:a,right:a,bottom:a,left:a}}function ao(a){let{x:b,y:c,width:d,height:e}=a;return{width:d,height:e,top:c,left:b,right:b+d,bottom:c+e,x:b,y:c}}function ap(a,b,c){let d,{reference:e,floating:f}=a,g=ag(b),h=ad(ag(b)),i=ae(h),j=ab(b),k="y"===g,l=e.x+e.width/2-f.width/2,m=e.y+e.height/2-f.height/2,n=e[i]/2-f[i]/2;switch(j){case"top":d={x:l,y:e.y-f.height};break;case"bottom":d={x:l,y:e.y+e.height};break;case"right":d={x:e.x+e.width,y:m};break;case"left":d={x:e.x-f.width,y:m};break;default:d={x:e.x,y:e.y}}switch(ac(b)){case"start":d[h]-=n*(c&&k?-1:1);break;case"end":d[h]+=n*(c&&k?-1:1)}return d}let aq=async(a,b,c)=>{let{placement:d="bottom",strategy:e="absolute",middleware:f=[],platform:g}=c,h=f.filter(Boolean),i=await (null==g.isRTL?void 0:g.isRTL(b)),j=await g.getElementRects({reference:a,floating:b,strategy:e}),{x:k,y:l}=ap(j,d,i),m=d,n={},o=0;for(let c=0;c<h.length;c++){let{name:f,fn:p}=h[c],{x:q,y:r,data:s,reset:t}=await p({x:k,y:l,initialPlacement:d,placement:m,strategy:e,middlewareData:n,rects:j,platform:g,elements:{reference:a,floating:b}});k=null!=q?q:k,l=null!=r?r:l,n={...n,[f]:{...n[f],...s}},t&&o<=50&&(o++,"object"==typeof t&&(t.placement&&(m=t.placement),t.rects&&(j=!0===t.rects?await g.getElementRects({reference:a,floating:b,strategy:e}):t.rects),{x:k,y:l}=ap(j,m,i)),c=-1)}return{x:k,y:l,placement:m,strategy:e,middlewareData:n}};async function ar(a,b){var c;void 0===b&&(b={});let{x:d,y:e,platform:f,rects:g,elements:h,strategy:i}=a,{boundary:j="clippingAncestors",rootBoundary:k="viewport",elementContext:l="floating",altBoundary:m=!1,padding:n=0}=aa(b,a),o=an(n),p=h[m?"floating"===l?"reference":"floating":l],q=ao(await f.getClippingRect({element:null==(c=await (null==f.isElement?void 0:f.isElement(p)))||c?p:p.contextElement||await (null==f.getDocumentElement?void 0:f.getDocumentElement(h.floating)),boundary:j,rootBoundary:k,strategy:i})),r="floating"===l?{x:d,y:e,width:g.floating.width,height:g.floating.height}:g.reference,s=await (null==f.getOffsetParent?void 0:f.getOffsetParent(h.floating)),t=await (null==f.isElement?void 0:f.isElement(s))&&await (null==f.getScale?void 0:f.getScale(s))||{x:1,y:1},u=ao(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:r,offsetParent:s,strategy:i}):r);return{top:(q.top-u.top+o.top)/t.y,bottom:(u.bottom-q.bottom+o.bottom)/t.y,left:(q.left-u.left+o.left)/t.x,right:(u.right-q.right+o.right)/t.x}}function as(a,b){return{top:a.top-b.height,right:a.right-b.width,bottom:a.bottom-b.height,left:a.left-b.width}}function at(a){return U.some(b=>a[b]>=0)}let au=new Set(["left","top"]);async function av(a,b){let{placement:c,platform:d,elements:e}=a,f=await (null==d.isRTL?void 0:d.isRTL(e.floating)),g=ab(c),h=ac(c),i="y"===ag(c),j=au.has(g)?-1:1,k=f&&i?-1:1,l=aa(b,a),{mainAxis:m,crossAxis:n,alignmentAxis:o}="number"==typeof l?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return h&&"number"==typeof o&&(n="end"===h?-1*o:o),i?{x:n*k,y:m*j}:{x:m*j,y:n*k}}function aw(a){return function(a){return!1}(a)?(a.nodeName||"").toLowerCase():"#document"}function ax(a){var b;return(null==a||null==(b=a.ownerDocument)?void 0:b.defaultView)||window}function ay(a){var b;return null==(b=(function(a){return!1}(a)?a.ownerDocument:a.document)||window.document)?void 0:b.documentElement}function az(a){return!1}let aA=new Set(["inline","contents"]);function aB(a){let{overflow:b,overflowX:c,overflowY:d,display:e}=aM(a);return/auto|scroll|overlay|hidden|clip/.test(b+d+c)&&!aA.has(e)}let aC=new Set(["table","td","th"]),aD=[":popover-open",":modal"];function aE(a){return aD.some(b=>{try{return a.matches(b)}catch(a){return!1}})}let aF=["transform","translate","scale","rotate","perspective"],aG=["transform","translate","scale","rotate","perspective","filter"],aH=["paint","layout","strict","content"];function aI(a){let b=aJ(),c=a;return aF.some(a=>!!c[a]&&"none"!==c[a])||!!c.containerType&&"normal"!==c.containerType||!b&&!!c.backdropFilter&&"none"!==c.backdropFilter||!b&&!!c.filter&&"none"!==c.filter||aG.some(a=>(c.willChange||"").includes(a))||aH.some(a=>(c.contain||"").includes(a))}function aJ(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let aK=new Set(["html","body","#document"]);function aL(a){return aK.has(aw(a))}function aM(a){return ax(a).getComputedStyle(a)}function aN(a){return{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function aO(a){if("html"===aw(a))return a;let b=a.assignedSlot||a.parentNode||!1||ay(a);return b}function aP(a,b,c){var d;void 0===b&&(b=[]),void 0===c&&(c=!0);let e=function a(b){let c=aO(b);return aL(c)?b.ownerDocument?b.ownerDocument.body:b.body:a(c)}(a),f=e===(null==(d=a.ownerDocument)?void 0:d.body),g=ax(e);if(f){let a=aQ(g);return b.concat(g,g.visualViewport||[],aB(e)?e:[],a&&c?aP(a):[])}return b.concat(e,aP(e,[],c))}function aQ(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function aR(a){let b=aM(a),c=parseFloat(b.width)||0,d=parseFloat(b.height)||0,e=!1,f=e?a.offsetWidth:c,g=e?a.offsetHeight:d,h=X(c)!==f||X(d)!==g;return h&&(c=f,d=g),{width:c,height:d,$:h}}function aS(a){return 0,a.contextElement}function aT(a){let b=aS(a);1;return Z(1)}let aU=Z(0);function aV(a){let b=ax(a);return aJ()&&b.visualViewport?{x:b.visualViewport.offsetLeft,y:b.visualViewport.offsetTop}:aU}function aW(a,b,c,d){var e;void 0===b&&(b=!1),void 0===c&&(c=!1);let f=a.getBoundingClientRect(),g=aS(a),h=Z(1);b&&(d||(h=aT(a)));let i=(void 0===(e=c)&&(e=!1),d&&(!e||d===ax(g))&&e)?aV(g):Z(0),j=(f.left+i.x)/h.x,k=(f.top+i.y)/h.y,l=f.width/h.x,m=f.height/h.y;if(g){let a=ax(g),b=d,c=a,e=aQ(c);for(;e&&d&&b!==c;){let a=aT(e),b=e.getBoundingClientRect(),d=aM(e),f=b.left+(e.clientLeft+parseFloat(d.paddingLeft))*a.x,g=b.top+(e.clientTop+parseFloat(d.paddingTop))*a.y;j*=a.x,k*=a.y,l*=a.x,m*=a.y,j+=f,k+=g,e=aQ(c=ax(e))}}return ao({width:l,height:m,x:j,y:k})}function aX(a,b){let c=aN(a).scrollLeft;return b?b.left+c:aW(ay(a)).left+c}function aY(a,b){let c=a.getBoundingClientRect();return{x:c.left+b.scrollLeft-aX(a,c),y:c.top+b.scrollTop}}function aZ(a,b,c){var d;let e;if("viewport"===b)e=function(a,b){let c=ax(a),d=ay(a),e=c.visualViewport,f=d.clientWidth,g=d.clientHeight,h=0,i=0;if(e){f=e.width,g=e.height;let a=aJ();(!a||a&&"fixed"===b)&&(h=e.offsetLeft,i=e.offsetTop)}let j=aX(d);if(j<=0){let a=d.ownerDocument,b=a.body,c=getComputedStyle(b),e="CSS1Compat"===a.compatMode&&parseFloat(c.marginLeft)+parseFloat(c.marginRight)||0,g=Math.abs(d.clientWidth-b.clientWidth-e);g<=25&&(f-=g)}else j<=25&&(f+=j);return{width:f,height:g,x:h,y:i}}(a,c);else if("document"===b){let b,c,f,g,h,i,j;d=ay(a),b=ay(d),c=aN(d),f=d.ownerDocument.body,g=W(b.scrollWidth,b.clientWidth,f.scrollWidth,f.clientWidth),h=W(b.scrollHeight,b.clientHeight,f.scrollHeight,f.clientHeight),i=-c.scrollLeft+aX(d),j=-c.scrollTop,"rtl"===aM(f).direction&&(i+=W(b.clientWidth,f.clientWidth)-g),e={width:g,height:h,x:i,y:j}}else{1;{let c=aV(a);e={x:b.x-c.x,y:b.y-c.y,width:b.width,height:b.height}}}return ao(e)}function a$(a){return"static"===aM(a).position}function a_(a,b){1;return null}function a0(a,b){var c;let d=ax(a);if(aE(a))return d;1;{let b=aO(a);for(;b&&!aL(b);){0;b=aO(b)}return d}}let a1=async function(a){let b=this.getOffsetParent||a0,c=this.getDimensions,d=await c(a.floating);return{reference:function(a,b,c){var d;let e=(d=0,!1),f=ay(b),g="fixed"===c,h=aW(a,!0,g,b),i={scrollLeft:0,scrollTop:0},j=Z(0);if(e||!e&&!g)if(("body"!==aw(b)||aB(f))&&(i=aN(b)),e){let a=aW(b,!0,g,b);j.x=a.x+b.clientLeft,j.y=a.y+b.clientTop}else f&&(j.x=aX(f));g&&!e&&f&&(j.x=aX(f));let k=!f||e||g?Z(0):aY(f,i);return{x:h.left+i.scrollLeft-j.x-k.x,y:h.top+i.scrollTop-j.y-k.y,width:h.width,height:h.height}}(a.reference,await b(a.floating),a.strategy),floating:{x:0,y:0,width:d.width,height:d.height}}},a2={convertOffsetParentRelativeRectToViewportRelativeRect:function(a){var b,c;let{elements:d,rect:e,offsetParent:f,strategy:g}=a,h="fixed"===g,i=ay(f),j=!!d&&aE(d.floating);if(f===i||j&&h)return e;let k={scrollLeft:0,scrollTop:0},l=Z(1),m=Z(0),n=(b=0,!1);(n||!n&&!h)&&(("body"!==aw(f)||aB(i))&&(k=aN(f)),c=0,0);let o=!i||n||h?Z(0):aY(i,k);return{width:e.width*l.x,height:e.height*l.y,x:e.x*l.x-k.scrollLeft*l.x+m.x+o.x,y:e.y*l.y-k.scrollTop*l.y+m.y+o.y}},getDocumentElement:ay,getClippingRect:function(a){let{element:b,boundary:c,rootBoundary:d,strategy:e}=a,f=[..."clippingAncestors"===c?aE(b)?[]:function(a,b){var c;let d=b.get(a);if(d)return d;let e=aP(a,[],!1).filter(a=>{var b;return b=0,!1}),f="fixed"===aM(a).position,g=f?aO(a):a;return c=0,b.set(a,e),e}(b,this._c):[].concat(c),d],g=f[0],h=f.reduce((a,c)=>{let d=aZ(b,c,e);return a.top=W(d.top,a.top),a.right=V(d.right,a.right),a.bottom=V(d.bottom,a.bottom),a.left=W(d.left,a.left),a},aZ(b,g,e));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}},getOffsetParent:a0,getElementRects:a1,getClientRects:function(a){return Array.from(a.getClientRects())},getDimensions:function(a){let{width:b,height:c}=aR(a);return{width:b,height:c}},getScale:aT,isElement:az,isRTL:function(a){return"rtl"===aM(a).direction}};function a3(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}let a4=a=>({name:"arrow",options:a,async fn(b){let{x:c,y:d,placement:e,rects:f,platform:g,elements:h,middlewareData:i}=b,{element:j,padding:k=0}=aa(a,b)||{};if(null==j)return{};let l=an(k),m={x:c,y:d},n=ad(ag(e)),o=ae(n),p=await g.getDimensions(j),q="y"===n,r=q?"clientHeight":"clientWidth",s=f.reference[o]+f.reference[n]-m[n]-f.floating[o],t=m[n]-f.reference[n],u=await (null==g.getOffsetParent?void 0:g.getOffsetParent(j)),v=u?u[r]:0;v&&await (null==g.isElement?void 0:g.isElement(u))||(v=h.floating[r]||f.floating[o]);let w=v/2-p[o]/2-1,x=V(l[q?"top":"left"],w),y=V(l[q?"bottom":"right"],w),z=v-p[o]-y,A=v/2-p[o]/2+(s/2-t/2),B=W(x,V(A,z)),C=!i.arrow&&null!=ac(e)&&A!==B&&f.reference[o]/2-(A<x?x:y)-p[o]/2<0,D=C?A<x?A-x:A-z:0;return{[n]:m[n]+D,data:{[n]:B,centerOffset:A-B-D,...C&&{alignmentOffset:D}},reset:C}}});var a5="undefined"!=typeof document?d.useLayoutEffect:function(){};function a6(a,b){let c,d,e;if(a===b)return!0;if(typeof a!=typeof b)return!1;if("function"==typeof a&&a.toString()===b.toString())return!0;if(a&&b&&"object"==typeof a){if(Array.isArray(a)){if((c=a.length)!==b.length)return!1;for(d=c;0!=d--;)if(!a6(a[d],b[d]))return!1;return!0}if((c=(e=Object.keys(a)).length)!==Object.keys(b).length)return!1;for(d=c;0!=d--;)if(!({}).hasOwnProperty.call(b,e[d]))return!1;for(d=c;0!=d--;){let c=e[d];if(("_owner"!==c||!a.$$typeof)&&!a6(a[c],b[c]))return!1}return!0}return a!=a&&b!=b}function a7(a,b){let c=1;return Math.round(b*c)/c}function a8(a){let b=d.useRef(a);return a5(()=>{b.current=a}),b}var a9=a.i(20354),ba=d.forwardRef((a,c)=>{let{children:d,width:e=10,height:f=5,...g}=a;return(0,b.jsx)(a9.Primitive.svg,{...g,ref:c,width:e,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?d:(0,b.jsx)("polygon",{points:"0,0 30,0 15,10"})})});ba.displayName="Arrow";var bb=a.i(29123),bc=a.i(78434),bd=a.i(13386),be="Popper",[bf,bg]=(0,J.createContextScope)(be),[bh,bi]=bf(be),bj=a=>{let{__scopePopper:c,children:e}=a,[f,g]=d.useState(null);return(0,b.jsx)(bh,{scope:c,anchor:f,onAnchorChange:g,children:e})};bj.displayName=be;var bk="PopperAnchor",bl=d.forwardRef((a,c)=>{let{__scopePopper:e,virtualRef:f,...g}=a,h=bi(bk,e),i=d.useRef(null),j=(0,K.useComposedRefs)(c,i),k=d.useRef(null);return d.useEffect(()=>{let a=k.current;k.current=f?.current||i.current,a!==k.current&&h.onAnchorChange(k.current)}),f?null:(0,b.jsx)(a9.Primitive.div,{...g,ref:j})});bl.displayName=bk;var bm="PopperContent",[bn,bo]=bf(bm),bp=d.forwardRef((a,c)=>{var e,f,g,h,i,j,k,l,m,n,p,q,r;let{__scopePopper:s,side:t="bottom",sideOffset:u=0,align:v="center",alignOffset:w=0,arrowPadding:x=0,avoidCollisions:y=!0,collisionBoundary:z=[],collisionPadding:A=0,sticky:B="partial",hideWhenDetached:C=!1,updatePositionStrategy:D="optimized",onPlaced:E,...F}=a,G=bi(bm,s),[H,I]=d.useState(null),J=(0,K.useComposedRefs)(c,a=>I(a)),[L,M]=d.useState(null),N=(0,bd.useSize)(L),O=N?.width??0,P=N?.height??0,Q="number"==typeof A?A:{top:0,right:0,bottom:0,left:0,...A},R=Array.isArray(z)?z:[z],S=R.length>0,T={padding:Q,boundary:R.filter(bt),altBoundary:S},{refs:U,floatingStyles:X,placement:Z,isPositioned:$,middlewareData:_}=function(a){void 0===a&&(a={});let{placement:b="bottom",strategy:c="absolute",middleware:e=[],platform:f,elements:{reference:g,floating:h}={},transform:i=!0,whileElementsMounted:j,open:k}=a,[l,m]=d.useState({x:0,y:0,strategy:c,placement:b,middlewareData:{},isPositioned:!1}),[n,p]=d.useState(e);a6(n,e)||p(e);let[q,r]=d.useState(null),[s,t]=d.useState(null),u=d.useCallback(a=>{a!==y.current&&(y.current=a,r(a))},[]),v=d.useCallback(a=>{a!==z.current&&(z.current=a,t(a))},[]),w=g||q,x=h||s,y=d.useRef(null),z=d.useRef(null),A=d.useRef(l),B=null!=j,C=a8(j),D=a8(f),E=a8(k),F=d.useCallback(()=>{var a,d;let e,f,g;if(!y.current||!z.current)return;let h={placement:b,strategy:c,middleware:n};D.current&&(h.platform=D.current),(a=y.current,d=z.current,e=new Map,g={...(f={platform:a2,...h}).platform,_c:e},aq(a,d,{...f,platform:g})).then(a=>{let b={...a,isPositioned:!1!==E.current};G.current&&!a6(A.current,b)&&(A.current=b,o.flushSync(()=>{m(b)}))})},[n,b,c,D,E]);a5(()=>{!1===k&&A.current.isPositioned&&(A.current.isPositioned=!1,m(a=>({...a,isPositioned:!1})))},[k]);let G=d.useRef(!1);a5(()=>(G.current=!0,()=>{G.current=!1}),[]),a5(()=>{if(w&&(y.current=w),x&&(z.current=x),w&&x){if(C.current)return C.current(w,x,F);F()}},[w,x,F,C,B]);let H=d.useMemo(()=>({reference:y,floating:z,setReference:u,setFloating:v}),[u,v]),I=d.useMemo(()=>({reference:w,floating:x}),[w,x]),J=d.useMemo(()=>{let a={position:c,left:0,top:0};if(!I.floating)return a;let b=a7(I.floating,l.x),d=a7(I.floating,l.y);if(i)return{...a,transform:"translate("+b+"px, "+d+"px)",...(I.floating,false)};return{position:c,left:b,top:d}},[c,i,I.floating,l.x,l.y]);return d.useMemo(()=>({...l,update:F,refs:H,elements:I,floatingStyles:J}),[l,F,H,I,J])}({strategy:"fixed",placement:t+("center"!==v?"-"+v:""),whileElementsMounted:(...a)=>(function(a,b,c,d){let e;void 0===d&&(d={});let{ancestorScroll:f=!0,ancestorResize:g=!0,elementResize:h="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:j=!1}=d,k=aS(a),l=f||g?[...k?aP(k):[],...aP(b)]:[];l.forEach(a=>{f&&a.addEventListener("scroll",c,{passive:!0}),g&&a.addEventListener("resize",c)});let m=k&&i?function(a,b){let c,d=null,e=ay(a);function f(){var a;clearTimeout(c),null==(a=d)||a.disconnect(),d=null}return!function g(h,i){void 0===h&&(h=!1),void 0===i&&(i=1),f();let j=a.getBoundingClientRect(),{left:k,top:l,width:m,height:n}=j;if(h||b(),!m||!n)return;let o={rootMargin:-Y(l)+"px "+-Y(e.clientWidth-(k+m))+"px "+-Y(e.clientHeight-(l+n))+"px "+-Y(k)+"px",threshold:W(0,V(1,i))||1},p=!0;function q(b){let d=b[0].intersectionRatio;if(d!==i){if(!p)return g();d?g(!1,d):c=setTimeout(()=>{g(!1,1e-7)},1e3)}1!==d||a3(j,a.getBoundingClientRect())||g(),p=!1}try{d=new IntersectionObserver(q,{...o,root:e.ownerDocument})}catch(a){d=new IntersectionObserver(q,o)}d.observe(a)}(!0),f}(k,c):null,n=-1,o=null;h&&(o=new ResizeObserver(a=>{let[d]=a;d&&d.target===k&&o&&(o.unobserve(b),cancelAnimationFrame(n),n=requestAnimationFrame(()=>{var a;null==(a=o)||a.observe(b)})),c()}),k&&!j&&o.observe(k),o.observe(b));let p=j?aW(a):null;return j&&function b(){let d=aW(a);p&&!a3(p,d)&&c(),p=d,e=requestAnimationFrame(b)}(),c(),()=>{var a;l.forEach(a=>{f&&a.removeEventListener("scroll",c),g&&a.removeEventListener("resize",c)}),null==m||m(),null==(a=o)||a.disconnect(),o=null,j&&cancelAnimationFrame(e)}})(...a,{animationFrame:"always"===D}),elements:{reference:G.anchor},middleware:[{...{name:"offset",options:f=e={mainAxis:u+P,alignmentAxis:w},async fn(a){var b,c;let{x:d,y:e,placement:g,middlewareData:h}=a,i=await av(a,f);return g===(null==(b=h.offset)?void 0:b.placement)&&null!=(c=h.arrow)&&c.alignmentOffset?{}:{x:d+i.x,y:e+i.y,data:{...i,placement:g}}}},options:[e,void 0]},y&&{...{name:"shift",options:i=h={mainAxis:!0,crossAxis:!1,limiter:"partial"===B?{...(g=void 0,{options:g={},fn(a){let{x:b,y:c,placement:d,rects:e,middlewareData:f}=a,{offset:h=0,mainAxis:i=!0,crossAxis:j=!0}=aa(g,a),k={x:b,y:c},l=ag(d),m=ad(l),n=k[m],o=k[l],p=aa(h,a),q="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(i){let a="y"===m?"height":"width",b=e.reference[m]-e.floating[a]+q.mainAxis,c=e.reference[m]+e.reference[a]-q.mainAxis;n<b?n=b:n>c&&(n=c)}if(j){var r,s;let a="y"===m?"width":"height",b=au.has(ab(d)),c=e.reference[l]-e.floating[a]+(b&&(null==(r=f.offset)?void 0:r[l])||0)+(b?0:q.crossAxis),g=e.reference[l]+e.reference[a]+(b?0:(null==(s=f.offset)?void 0:s[l])||0)-(b?q.crossAxis:0);o<c?o=c:o>g&&(o=g)}return{[m]:n,[l]:o}}}),options:[void 0,void 0]}:void 0,...T},async fn(a){let{x:b,y:c,placement:d}=a,{mainAxis:e=!0,crossAxis:f=!1,limiter:g={fn:a=>{let{x:b,y:c}=a;return{x:b,y:c}}},...h}=aa(i,a),j={x:b,y:c},k=await ar(a,h),l=ag(ab(d)),m=ad(l),n=j[m],o=j[l];if(e){let a="y"===m?"top":"left",b="y"===m?"bottom":"right",c=n+k[a],d=n-k[b];n=W(c,V(n,d))}if(f){let a="y"===l?"top":"left",b="y"===l?"bottom":"right",c=o+k[a],d=o-k[b];o=W(c,V(o,d))}let p=g.fn({...a,[m]:n,[l]:o});return{...p,data:{x:p.x-b,y:p.y-c,enabled:{[m]:e,[l]:f}}}}},options:[h,void 0]},y&&{...{name:"flip",options:k=j={...T},async fn(a){var b,c,d,e,f,g,h,i;let j,l,m,{placement:n,middlewareData:o,rects:p,initialPlacement:q,platform:r,elements:s}=a,{mainAxis:t=!0,crossAxis:u=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...z}=aa(k,a);if(null!=(b=o.arrow)&&b.alignmentOffset)return{};let A=ab(n),B=ag(q),C=ab(q)===q,D=await (null==r.isRTL?void 0:r.isRTL(s.floating)),E=v||(C||!y?[am(q)]:(j=am(q),[ah(q),j,ah(j)])),F="none"!==x;!v&&F&&E.push(...(l=ac(q),m=function(a,b,c){switch(a){case"top":case"bottom":if(c)return b?aj:ai;return b?ai:aj;case"left":case"right":return b?ak:al;default:return[]}}(ab(q),"start"===x,D),l&&(m=m.map(a=>a+"-"+l),y&&(m=m.concat(m.map(ah)))),m));let G=[q,...E],H=await ar(a,z),I=[],J=(null==(c=o.flip)?void 0:c.overflows)||[];if(t&&I.push(H[A]),u){let a,b,c,d,e=(g=n,h=p,void 0===(i=D)&&(i=!1),a=ac(g),c=ae(b=ad(ag(g))),d="x"===b?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top",h.reference[c]>h.floating[c]&&(d=am(d)),[d,am(d)]);I.push(H[e[0]],H[e[1]])}if(J=[...J,{placement:n,overflows:I}],!I.every(a=>a<=0)){let a=((null==(d=o.flip)?void 0:d.index)||0)+1,b=G[a];if(b&&("alignment"!==u||B===ag(b)||J.every(a=>ag(a.placement)!==B||a.overflows[0]>0)))return{data:{index:a,overflows:J},reset:{placement:b}};let c=null==(e=J.filter(a=>a.overflows[0]<=0).sort((a,b)=>a.overflows[1]-b.overflows[1])[0])?void 0:e.placement;if(!c)switch(w){case"bestFit":{let a=null==(f=J.filter(a=>{if(F){let b=ag(a.placement);return b===B||"y"===b}return!0}).map(a=>[a.placement,a.overflows.filter(a=>a>0).reduce((a,b)=>a+b,0)]).sort((a,b)=>a[1]-b[1])[0])?void 0:f[0];a&&(c=a);break}case"initialPlacement":c=q}if(n!==c)return{reset:{placement:c}}}return{}}},options:[j,void 0]},{...{name:"size",options:m=l={...T,apply:({elements:a,rects:b,availableWidth:c,availableHeight:d})=>{let{width:e,height:f}=b.reference,g=a.floating.style;g.setProperty("--radix-popper-available-width",`${c}px`),g.setProperty("--radix-popper-available-height",`${d}px`),g.setProperty("--radix-popper-anchor-width",`${e}px`),g.setProperty("--radix-popper-anchor-height",`${f}px`)}},async fn(a){var b,c;let d,e,{placement:f,rects:g,platform:h,elements:i}=a,{apply:j=()=>{},...k}=aa(m,a),l=await ar(a,k),n=ab(f),o=ac(f),p="y"===ag(f),{width:q,height:r}=g.floating;"top"===n||"bottom"===n?(d=n,e=o===(await (null==h.isRTL?void 0:h.isRTL(i.floating))?"start":"end")?"left":"right"):(e=n,d="end"===o?"top":"bottom");let s=r-l.top-l.bottom,t=q-l.left-l.right,u=V(r-l[d],s),v=V(q-l[e],t),w=!a.middlewareData.shift,x=u,y=v;if(null!=(b=a.middlewareData.shift)&&b.enabled.x&&(y=t),null!=(c=a.middlewareData.shift)&&c.enabled.y&&(x=s),w&&!o){let a=W(l.left,0),b=W(l.right,0),c=W(l.top,0),d=W(l.bottom,0);p?y=q-2*(0!==a||0!==b?a+b:W(l.left,l.right)):x=r-2*(0!==c||0!==d?c+d:W(l.top,l.bottom))}await j({...a,availableWidth:y,availableHeight:x});let z=await h.getDimensions(i.floating);return q!==z.width||r!==z.height?{reset:{rects:!0}}:{}}},options:[l,void 0]},L&&{...{name:"arrow",options:p=n={element:L,padding:x},fn(a){let{element:b,padding:c}="function"==typeof p?p(a):p;return b&&({}).hasOwnProperty.call(b,"current")?null!=b.current?a4({element:b.current,padding:c}).fn(a):{}:b?a4({element:b,padding:c}).fn(a):{}}},options:[n,void 0]},bu({arrowWidth:O,arrowHeight:P}),C&&{...{name:"hide",options:r=q={strategy:"referenceHidden",...T},async fn(a){let{rects:b}=a,{strategy:c="referenceHidden",...d}=aa(r,a);switch(c){case"referenceHidden":{let c=as(await ar(a,{...d,elementContext:"reference"}),b.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:at(c)}}}case"escaped":{let c=as(await ar(a,{...d,altBoundary:!0}),b.floating);return{data:{escapedOffsets:c,escaped:at(c)}}}default:return{}}}},options:[q,void 0]}]}),[af,an]=bv(Z),ao=(0,bb.useCallbackRef)(E);(0,bc.useLayoutEffect)(()=>{$&&ao?.()},[$,ao]);let ap=_.arrow?.x,aw=_.arrow?.y,ax=_.arrow?.centerOffset!==0,[az,aA]=d.useState();return(0,bc.useLayoutEffect)(()=>{H&&aA(window.getComputedStyle(H).zIndex)},[H]),(0,b.jsx)("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:$?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:az,"--radix-popper-transform-origin":[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:(0,b.jsx)(bn,{scope:s,placedSide:af,onArrowChange:M,arrowX:ap,arrowY:aw,shouldHideArrow:ax,children:(0,b.jsx)(a9.Primitive.div,{"data-side":af,"data-align":an,...F,ref:J,style:{...F.style,animation:$?void 0:"none"}})})})});bp.displayName=bm;var bq="PopperArrow",br={top:"bottom",right:"left",bottom:"top",left:"right"},bs=d.forwardRef(function(a,c){let{__scopePopper:d,...e}=a,f=bo(bq,d),g=br[f.placedSide];return(0,b.jsx)("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[g]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:(0,b.jsx)(ba,{...e,ref:c,style:{...e.style,display:"block"}})})});function bt(a){return null!==a}bs.displayName=bq;var bu=a=>({name:"transformOrigin",options:a,fn(b){let{placement:c,rects:d,middlewareData:e}=b,f=e.arrow?.centerOffset!==0,g=f?0:a.arrowWidth,h=f?0:a.arrowHeight,[i,j]=bv(c),k={start:"0%",center:"50%",end:"100%"}[j],l=(e.arrow?.x??0)+g/2,m=(e.arrow?.y??0)+h/2,n="",o="";return"bottom"===i?(n=f?k:`${l}px`,o=`${-h}px`):"top"===i?(n=f?k:`${l}px`,o=`${d.floating.height+h}px`):"right"===i?(n=`${-h}px`,o=f?k:`${m}px`):"left"===i&&(n=`${d.floating.width+h}px`,o=f?k:`${m}px`),{data:{x:n,y:o}}}});function bv(a){let[b,c="center"]=a.split("-");return[b,c]}var bw=a.i(39710),bx=a.i(64527),by=a.i(5160),bz=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});d.forwardRef((a,c)=>(0,b.jsx)(a9.Primitive.span,{...a,ref:c,style:{...bz,...a.style}})).displayName="VisuallyHidden";var bA=a.i(16164),bB=a.i(75274),bC=[" ","Enter","ArrowUp","ArrowDown"],bD=[" ","Enter"],bE="Select",[bF,bG,bH]=function(a){let c=a+"CollectionProvider",[e,f]=(0,J.createContextScope)(c),[g,h]=e(c,{collectionRef:{current:null},itemMap:new Map}),i=a=>{let{scope:c,children:e}=a,f=d.default.useRef(null),h=d.default.useRef(new Map).current;return(0,b.jsx)(g,{scope:c,itemMap:h,collectionRef:f,children:e})};i.displayName=c;let j=a+"CollectionSlot",k=(0,L.createSlot)(j),l=d.default.forwardRef((a,c)=>{let{scope:d,children:e}=a,f=h(j,d),g=(0,K.useComposedRefs)(c,f.collectionRef);return(0,b.jsx)(k,{ref:g,children:e})});l.displayName=j;let m=a+"CollectionItemSlot",n="data-radix-collection-item",o=(0,L.createSlot)(m),p=d.default.forwardRef((a,c)=>{let{scope:e,children:f,...g}=a,i=d.default.useRef(null),j=(0,K.useComposedRefs)(c,i),k=h(m,e);return d.default.useEffect(()=>(k.itemMap.set(i,{ref:i,...g}),()=>void k.itemMap.delete(i))),(0,b.jsx)(o,{...{[n]:""},ref:j,children:f})});return p.displayName=m,[{Provider:i,Slot:l,ItemSlot:p},function(b){let c=h(a+"CollectionConsumer",b);return d.default.useCallback(()=>{let a=c.collectionRef.current;if(!a)return[];let b=Array.from(a.querySelectorAll(`[${n}]`));return Array.from(c.itemMap.values()).sort((a,c)=>b.indexOf(a.ref.current)-b.indexOf(c.ref.current))},[c.collectionRef,c.itemMap])},f]}(bE),[bI,bJ]=(0,J.createContextScope)(bE,[bH,bg]),bK=bg(),[bL,bM]=bI(bE),[bN,bO]=bI(bE),bP=a=>{let c,{__scopeSelect:e,children:f,open:g,defaultOpen:h,onOpenChange:i,value:j,defaultValue:k,onValueChange:l,dir:m,name:n,autoComplete:o,disabled:p,required:q,form:r}=a,s=bK(e),[t,u]=d.useState(null),[v,w]=d.useState(null),[x,y]=d.useState(!1),z=(c=d.useContext(P),m||c||"ltr"),[A,B]=(0,bx.useControllableState)({prop:g,defaultProp:h??!1,onChange:i,caller:bE}),[C,D]=(0,bx.useControllableState)({prop:j,defaultProp:k,onChange:l,caller:bE}),E=d.useRef(null),F=!t||r||!!t.closest("form"),[G,H]=d.useState(new Set),I=Array.from(G).map(a=>a.props.value).join(";");return(0,b.jsx)(bj,{...s,children:(0,b.jsxs)(bL,{required:q,scope:e,trigger:t,onTriggerChange:u,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:x,onValueNodeHasChildrenChange:y,contentId:(0,T.useId)(),value:C,onValueChange:D,open:A,onOpenChange:B,dir:z,triggerPointerDownPosRef:E,disabled:p,children:[(0,b.jsx)(bF.Provider,{scope:e,children:(0,b.jsx)(bN,{scope:a.__scopeSelect,onNativeOptionAdd:d.useCallback(a=>{H(b=>new Set(b).add(a))},[]),onNativeOptionRemove:d.useCallback(a=>{H(b=>{let c=new Set(b);return c.delete(a),c})},[]),children:f})}),F?(0,b.jsxs)(co,{"aria-hidden":!0,required:q,tabIndex:-1,name:n,autoComplete:o,value:C,onChange:a=>D(a.target.value),disabled:p,form:r,children:[void 0===C?(0,b.jsx)("option",{value:""}):null,Array.from(G)]},I):null]})})};bP.displayName=bE;var bQ="SelectTrigger",bR=d.forwardRef((a,c)=>{let{__scopeSelect:e,disabled:f=!1,...g}=a,h=bK(e),i=bM(bQ,e),j=i.disabled||f,k=(0,K.useComposedRefs)(c,i.onTriggerChange),l=bG(e),m=d.useRef("touch"),[n,o,p]=cq(a=>{let b=l().filter(a=>!a.disabled),c=b.find(a=>a.value===i.value),d=cr(b,a,c);void 0!==d&&i.onValueChange(d.value)}),q=a=>{j||(i.onOpenChange(!0),p()),a&&(i.triggerPointerDownPosRef.current={x:Math.round(a.pageX),y:Math.round(a.pageY)})};return(0,b.jsx)(bl,{asChild:!0,...h,children:(0,b.jsx)(a9.Primitive.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:j,"data-disabled":j?"":void 0,"data-placeholder":cp(i.value)?"":void 0,...g,ref:k,onClick:(0,I.composeEventHandlers)(g.onClick,a=>{a.currentTarget.focus(),"mouse"!==m.current&&q(a)}),onPointerDown:(0,I.composeEventHandlers)(g.onPointerDown,a=>{m.current=a.pointerType;let b=a.target;b.hasPointerCapture(a.pointerId)&&b.releasePointerCapture(a.pointerId),0===a.button&&!1===a.ctrlKey&&"mouse"===a.pointerType&&(q(a),a.preventDefault())}),onKeyDown:(0,I.composeEventHandlers)(g.onKeyDown,a=>{let b=""!==n.current;a.ctrlKey||a.altKey||a.metaKey||1!==a.key.length||o(a.key),(!b||" "!==a.key)&&bC.includes(a.key)&&(q(),a.preventDefault())})})})});bR.displayName=bQ;var bS="SelectValue",bT=d.forwardRef((a,c)=>{let{__scopeSelect:d,className:e,style:f,children:g,placeholder:h="",...i}=a,j=bM(bS,d),{onValueNodeHasChildrenChange:k}=j,l=void 0!==g,m=(0,K.useComposedRefs)(c,j.onValueNodeChange);return(0,bc.useLayoutEffect)(()=>{k(l)},[k,l]),(0,b.jsx)(a9.Primitive.span,{...i,ref:m,style:{pointerEvents:"none"},children:cp(j.value)?(0,b.jsx)(b.Fragment,{children:h}):g})});bT.displayName=bS;var bU=d.forwardRef((a,c)=>{let{__scopeSelect:d,children:e,...f}=a;return(0,b.jsx)(a9.Primitive.span,{"aria-hidden":!0,...f,ref:c,children:e||"▼"})});bU.displayName="SelectIcon";var bV=a=>(0,b.jsx)(bw.Portal,{asChild:!0,...a});bV.displayName="SelectPortal";var bW="SelectContent",bX=d.forwardRef((a,c)=>{let e=bM(bW,a.__scopeSelect),[f,g]=d.useState();return((0,bc.useLayoutEffect)(()=>{g(new DocumentFragment)},[]),e.open)?(0,b.jsx)(b_,{...a,ref:c}):f?o.createPortal((0,b.jsx)(bY,{scope:a.__scopeSelect,children:(0,b.jsx)(bF.Slot,{scope:a.__scopeSelect,children:(0,b.jsx)("div",{children:a.children})})}),f):null});bX.displayName=bW;var[bY,bZ]=bI(bW),b$=(0,L.createSlot)("SelectContent.RemoveScroll"),b_=d.forwardRef((a,c)=>{let{__scopeSelect:e,position:f="item-aligned",onCloseAutoFocus:g,onEscapeKeyDown:h,onPointerDownOutside:i,side:j,sideOffset:k,align:l,alignOffset:m,arrowPadding:n,collisionBoundary:o,collisionPadding:p,sticky:q,hideWhenDetached:r,avoidCollisions:s,...t}=a,u=bM(bW,e),[v,w]=d.useState(null),[x,y]=d.useState(null),z=(0,K.useComposedRefs)(c,a=>w(a)),[A,B]=d.useState(null),[C,D]=d.useState(null),E=bG(e),[F,G]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(v)return(0,bA.hideOthers)(v)},[v]),(0,R.useFocusGuards)();let J=d.useCallback(a=>{let[b,...c]=E().map(a=>a.ref.current),[d]=c.slice(-1),e=document.activeElement;for(let c of a)if(c===e||(c?.scrollIntoView({block:"nearest"}),c===b&&x&&(x.scrollTop=0),c===d&&x&&(x.scrollTop=x.scrollHeight),c?.focus(),document.activeElement!==e))return},[E,x]),L=d.useCallback(()=>J([A,v]),[J,A,v]);d.useEffect(()=>{F&&L()},[F,L]);let{onOpenChange:M,triggerPointerDownPosRef:N}=u;d.useEffect(()=>{if(v){let a={x:0,y:0},b=b=>{a={x:Math.abs(Math.round(b.pageX)-(N.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(N.current?.y??0))}},c=c=>{a.x<=10&&a.y<=10?c.preventDefault():v.contains(c.target)||M(!1),document.removeEventListener("pointermove",b),N.current=null};return null!==N.current&&(document.addEventListener("pointermove",b),document.addEventListener("pointerup",c,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",c,{capture:!0})}}},[v,M,N]),d.useEffect(()=>{let a=()=>M(!1);return window.addEventListener("blur",a),window.addEventListener("resize",a),()=>{window.removeEventListener("blur",a),window.removeEventListener("resize",a)}},[M]);let[O,P]=cq(a=>{let b=E().filter(a=>!a.disabled),c=b.find(a=>a.ref.current===document.activeElement),d=cr(b,a,c);d&&setTimeout(()=>d.ref.current.focus())}),T=d.useCallback((a,b,c)=>{let d=!H.current&&!c;(void 0!==u.value&&u.value===b||d)&&(B(a),d&&(H.current=!0))},[u.value]),U=d.useCallback(()=>v?.focus(),[v]),V=d.useCallback((a,b,c)=>{let d=!H.current&&!c;(void 0!==u.value&&u.value===b||d)&&D(a)},[u.value]),W="popper"===f?b1:b0,X=W===b1?{side:j,sideOffset:k,align:l,alignOffset:m,arrowPadding:n,collisionBoundary:o,collisionPadding:p,sticky:q,hideWhenDetached:r,avoidCollisions:s}:{};return(0,b.jsx)(bY,{scope:e,content:v,viewport:x,onViewportChange:y,itemRefCallback:T,selectedItem:A,onItemLeave:U,itemTextRefCallback:V,focusSelectedItem:L,selectedItemText:C,position:f,isPositioned:F,searchRef:O,children:(0,b.jsx)(bB.RemoveScroll,{as:b$,allowPinchZoom:!0,children:(0,b.jsx)(S.FocusScope,{asChild:!0,trapped:u.open,onMountAutoFocus:a=>{a.preventDefault()},onUnmountAutoFocus:(0,I.composeEventHandlers)(g,a=>{u.trigger?.focus({preventScroll:!0}),a.preventDefault()}),children:(0,b.jsx)(Q.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:i,onFocusOutside:a=>a.preventDefault(),onDismiss:()=>u.onOpenChange(!1),children:(0,b.jsx)(W,{role:"listbox",id:u.contentId,"data-state":u.open?"open":"closed",dir:u.dir,onContextMenu:a=>a.preventDefault(),...t,...X,onPlaced:()=>G(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...t.style},onKeyDown:(0,I.composeEventHandlers)(t.onKeyDown,a=>{let b=a.ctrlKey||a.altKey||a.metaKey;if("Tab"===a.key&&a.preventDefault(),b||1!==a.key.length||P(a.key),["ArrowUp","ArrowDown","Home","End"].includes(a.key)){let b=E().filter(a=>!a.disabled).map(a=>a.ref.current);if(["ArrowUp","End"].includes(a.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(a.key)){let c=a.target,d=b.indexOf(c);b=b.slice(d+1)}setTimeout(()=>J(b)),a.preventDefault()}})})})})})})});b_.displayName="SelectContentImpl";var b0=d.forwardRef((a,c)=>{let{__scopeSelect:e,onPlaced:f,...g}=a,h=bM(bW,e),i=bZ(bW,e),[j,k]=d.useState(null),[l,m]=d.useState(null),n=(0,K.useComposedRefs)(c,a=>m(a)),o=bG(e),p=d.useRef(!1),q=d.useRef(!0),{viewport:r,selectedItem:s,selectedItemText:t,focusSelectedItem:u}=i,v=d.useCallback(()=>{if(h.trigger&&h.valueNode&&j&&l&&r&&s&&t){let a=h.trigger.getBoundingClientRect(),b=l.getBoundingClientRect(),c=h.valueNode.getBoundingClientRect(),d=t.getBoundingClientRect();if("rtl"!==h.dir){let e=d.left-b.left,f=c.left-e,g=a.left-f,h=a.width+g,i=Math.max(h,b.width),k=H(f,[10,Math.max(10,window.innerWidth-10-i)]);j.style.minWidth=h+"px",j.style.left=k+"px"}else{let e=b.right-d.right,f=window.innerWidth-c.right-e,g=window.innerWidth-a.right-f,h=a.width+g,i=Math.max(h,b.width),k=H(f,[10,Math.max(10,window.innerWidth-10-i)]);j.style.minWidth=h+"px",j.style.right=k+"px"}let e=o(),g=window.innerHeight-20,i=r.scrollHeight,k=window.getComputedStyle(l),m=parseInt(k.borderTopWidth,10),n=parseInt(k.paddingTop,10),q=parseInt(k.borderBottomWidth,10),u=m+n+i+parseInt(k.paddingBottom,10)+q,v=Math.min(5*s.offsetHeight,u),w=window.getComputedStyle(r),x=parseInt(w.paddingTop,10),y=parseInt(w.paddingBottom,10),z=a.top+a.height/2-10,A=s.offsetHeight/2,B=m+n+(s.offsetTop+A);if(B<=z){let a=e.length>0&&s===e[e.length-1].ref.current;j.style.bottom="0px";let b=Math.max(g-z,A+(a?y:0)+(l.clientHeight-r.offsetTop-r.offsetHeight)+q);j.style.height=B+b+"px"}else{let a=e.length>0&&s===e[0].ref.current;j.style.top="0px";let b=Math.max(z,m+r.offsetTop+(a?x:0)+A);j.style.height=b+(u-B)+"px",r.scrollTop=B-z+r.offsetTop}j.style.margin="10px 0",j.style.minHeight=v+"px",j.style.maxHeight=g+"px",f?.(),requestAnimationFrame(()=>p.current=!0)}},[o,h.trigger,h.valueNode,j,l,r,s,t,h.dir,f]);(0,bc.useLayoutEffect)(()=>v(),[v]);let[w,x]=d.useState();(0,bc.useLayoutEffect)(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]);let y=d.useCallback(a=>{a&&!0===q.current&&(v(),u?.(),q.current=!1)},[v,u]);return(0,b.jsx)(b2,{scope:e,contentWrapper:j,shouldExpandOnScrollRef:p,onScrollButtonChange:y,children:(0,b.jsx)("div",{ref:k,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:(0,b.jsx)(a9.Primitive.div,{...g,ref:n,style:{boxSizing:"border-box",maxHeight:"100%",...g.style}})})})});b0.displayName="SelectItemAlignedPosition";var b1=d.forwardRef((a,c)=>{let{__scopeSelect:d,align:e="start",collisionPadding:f=10,...g}=a,h=bK(d);return(0,b.jsx)(bp,{...h,...g,ref:c,align:e,collisionPadding:f,style:{boxSizing:"border-box",...g.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});b1.displayName="SelectPopperPosition";var[b2,b3]=bI(bW,{}),b4="SelectViewport",b5=d.forwardRef((a,c)=>{let{__scopeSelect:e,nonce:f,...g}=a,h=bZ(b4,e),i=b3(b4,e),j=(0,K.useComposedRefs)(c,h.onViewportChange),k=d.useRef(0);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:f}),(0,b.jsx)(bF.Slot,{scope:e,children:(0,b.jsx)(a9.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...g,ref:j,style:{position:"relative",flex:1,overflow:"hidden auto",...g.style},onScroll:(0,I.composeEventHandlers)(g.onScroll,a=>{let b=a.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:d}=i;if(d?.current&&c){let a=Math.abs(k.current-b.scrollTop);if(a>0){let d=window.innerHeight-20,e=Math.max(parseFloat(c.style.minHeight),parseFloat(c.style.height));if(e<d){let f=e+a,g=Math.min(d,f),h=f-g;c.style.height=g+"px","0px"===c.style.bottom&&(b.scrollTop=h>0?h:0,c.style.justifyContent="flex-end")}}}k.current=b.scrollTop})})})]})});b5.displayName=b4;var b6="SelectGroup",[b7,b8]=bI(b6);d.forwardRef((a,c)=>{let{__scopeSelect:d,...e}=a,f=(0,T.useId)();return(0,b.jsx)(b7,{scope:d,id:f,children:(0,b.jsx)(a9.Primitive.div,{role:"group","aria-labelledby":f,...e,ref:c})})}).displayName=b6;var b9="SelectLabel";d.forwardRef((a,c)=>{let{__scopeSelect:d,...e}=a,f=b8(b9,d);return(0,b.jsx)(a9.Primitive.div,{id:f.id,...e,ref:c})}).displayName=b9;var ca="SelectItem",[cb,cc]=bI(ca),cd=d.forwardRef((a,c)=>{let{__scopeSelect:e,value:f,disabled:g=!1,textValue:h,...i}=a,j=bM(ca,e),k=bZ(ca,e),l=j.value===f,[m,n]=d.useState(h??""),[o,p]=d.useState(!1),q=(0,K.useComposedRefs)(c,a=>k.itemRefCallback?.(a,f,g)),r=(0,T.useId)(),s=d.useRef("touch"),t=()=>{g||(j.onValueChange(f),j.onOpenChange(!1))};if(""===f)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,b.jsx)(cb,{scope:e,value:f,disabled:g,textId:r,isSelected:l,onItemTextChange:d.useCallback(a=>{n(b=>b||(a?.textContent??"").trim())},[]),children:(0,b.jsx)(bF.ItemSlot,{scope:e,value:f,disabled:g,textValue:m,children:(0,b.jsx)(a9.Primitive.div,{role:"option","aria-labelledby":r,"data-highlighted":o?"":void 0,"aria-selected":l&&o,"data-state":l?"checked":"unchecked","aria-disabled":g||void 0,"data-disabled":g?"":void 0,tabIndex:g?void 0:-1,...i,ref:q,onFocus:(0,I.composeEventHandlers)(i.onFocus,()=>p(!0)),onBlur:(0,I.composeEventHandlers)(i.onBlur,()=>p(!1)),onClick:(0,I.composeEventHandlers)(i.onClick,()=>{"mouse"!==s.current&&t()}),onPointerUp:(0,I.composeEventHandlers)(i.onPointerUp,()=>{"mouse"===s.current&&t()}),onPointerDown:(0,I.composeEventHandlers)(i.onPointerDown,a=>{s.current=a.pointerType}),onPointerMove:(0,I.composeEventHandlers)(i.onPointerMove,a=>{s.current=a.pointerType,g?k.onItemLeave?.():"mouse"===s.current&&a.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,I.composeEventHandlers)(i.onPointerLeave,a=>{a.currentTarget===document.activeElement&&k.onItemLeave?.()}),onKeyDown:(0,I.composeEventHandlers)(i.onKeyDown,a=>{(k.searchRef?.current===""||" "!==a.key)&&(bD.includes(a.key)&&t()," "===a.key&&a.preventDefault())})})})})});cd.displayName=ca;var ce="SelectItemText",cf=d.forwardRef((a,c)=>{let{__scopeSelect:e,className:f,style:g,...h}=a,i=bM(ce,e),j=bZ(ce,e),k=cc(ce,e),l=bO(ce,e),[m,n]=d.useState(null),p=(0,K.useComposedRefs)(c,a=>n(a),k.onItemTextChange,a=>j.itemTextRefCallback?.(a,k.value,k.disabled)),q=m?.textContent,r=d.useMemo(()=>(0,b.jsx)("option",{value:k.value,disabled:k.disabled,children:q},k.value),[k.disabled,k.value,q]),{onNativeOptionAdd:s,onNativeOptionRemove:t}=l;return(0,bc.useLayoutEffect)(()=>(s(r),()=>t(r)),[s,t,r]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a9.Primitive.span,{id:k.textId,...h,ref:p}),k.isSelected&&i.valueNode&&!i.valueNodeHasChildren?o.createPortal(h.children,i.valueNode):null]})});cf.displayName=ce;var cg="SelectItemIndicator",ch=d.forwardRef((a,c)=>{let{__scopeSelect:d,...e}=a;return cc(cg,d).isSelected?(0,b.jsx)(a9.Primitive.span,{"aria-hidden":!0,...e,ref:c}):null});ch.displayName=cg;var ci="SelectScrollUpButton",cj=d.forwardRef((a,c)=>{let e=bZ(ci,a.__scopeSelect),f=b3(ci,a.__scopeSelect),[g,h]=d.useState(!1),i=(0,K.useComposedRefs)(c,f.onScrollButtonChange);return(0,bc.useLayoutEffect)(()=>{if(e.viewport&&e.isPositioned){let a=function(){h(b.scrollTop>0)},b=e.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),g?(0,b.jsx)(cm,{...a,ref:i,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=e;a&&b&&(a.scrollTop=a.scrollTop-b.offsetHeight)}}):null});cj.displayName=ci;var ck="SelectScrollDownButton",cl=d.forwardRef((a,c)=>{let e=bZ(ck,a.__scopeSelect),f=b3(ck,a.__scopeSelect),[g,h]=d.useState(!1),i=(0,K.useComposedRefs)(c,f.onScrollButtonChange);return(0,bc.useLayoutEffect)(()=>{if(e.viewport&&e.isPositioned){let a=function(){let a=b.scrollHeight-b.clientHeight;h(Math.ceil(b.scrollTop)<a)},b=e.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),g?(0,b.jsx)(cm,{...a,ref:i,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=e;a&&b&&(a.scrollTop=a.scrollTop+b.offsetHeight)}}):null});cl.displayName=ck;var cm=d.forwardRef((a,c)=>{let{__scopeSelect:e,onAutoScroll:f,...g}=a,h=bZ("SelectScrollButton",e),i=d.useRef(null),j=bG(e),k=d.useCallback(()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)},[]);return d.useEffect(()=>()=>k(),[k]),(0,bc.useLayoutEffect)(()=>{let a=j().find(a=>a.ref.current===document.activeElement);a?.ref.current?.scrollIntoView({block:"nearest"})},[j]),(0,b.jsx)(a9.Primitive.div,{"aria-hidden":!0,...g,ref:c,style:{flexShrink:0,...g.style},onPointerDown:(0,I.composeEventHandlers)(g.onPointerDown,()=>{null===i.current&&(i.current=window.setInterval(f,50))}),onPointerMove:(0,I.composeEventHandlers)(g.onPointerMove,()=>{h.onItemLeave?.(),null===i.current&&(i.current=window.setInterval(f,50))}),onPointerLeave:(0,I.composeEventHandlers)(g.onPointerLeave,()=>{k()})})});d.forwardRef((a,c)=>{let{__scopeSelect:d,...e}=a;return(0,b.jsx)(a9.Primitive.div,{"aria-hidden":!0,...e,ref:c})}).displayName="SelectSeparator";var cn="SelectArrow";d.forwardRef((a,c)=>{let{__scopeSelect:d,...e}=a,f=bK(d),g=bM(cn,d),h=bZ(cn,d);return g.open&&"popper"===h.position?(0,b.jsx)(bs,{...f,...e,ref:c}):null}).displayName=cn;var co=d.forwardRef(({__scopeSelect:a,value:c,...e},f)=>{let g=d.useRef(null),h=(0,K.useComposedRefs)(f,g),i=(0,by.usePrevious)(c);return d.useEffect(()=>{let a=g.current;if(!a)return;let b=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(i!==c&&b){let d=new Event("change",{bubbles:!0});b.call(a,c),a.dispatchEvent(d)}},[i,c]),(0,b.jsx)(a9.Primitive.select,{...e,style:{...bz,...e.style},ref:h,defaultValue:c})});function cp(a){return""===a||void 0===a}function cq(a){let b=(0,bb.useCallbackRef)(a),c=d.useRef(""),e=d.useRef(0),f=d.useCallback(a=>{let d=c.current+a;b(d),function a(b){c.current=b,window.clearTimeout(e.current),""!==b&&(e.current=window.setTimeout(()=>a(""),1e3))}(d)},[b]),g=d.useCallback(()=>{c.current="",window.clearTimeout(e.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(e.current),[]),[c,f,g]}function cr(a,b,c){var d,e;let f=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,g=c?a.indexOf(c):-1,h=(d=a,e=Math.max(g,0),d.map((a,b)=>d[(e+b)%d.length]));1===f.length&&(h=h.filter(a=>a!==c));let i=h.find(a=>a.textValue.toLowerCase().startsWith(f.toLowerCase()));return i!==c?i:void 0}co.displayName="SelectBubbleInput";var cs=a.i(35497);let ct=(0,e.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),cu=(0,e.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function cv({...a}){return(0,b.jsx)(bP,{"data-slot":"select",...a})}function cw({...a}){return(0,b.jsx)(bT,{"data-slot":"select-value",...a})}function cx({className:a,size:c="default",children:d,...e}){return(0,b.jsxs)(bR,{"data-slot":"select-trigger","data-size":c,className:(0,i.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),...e,children:[d,(0,b.jsx)(bU,{asChild:!0,children:(0,b.jsx)(ct,{className:"size-4 opacity-50"})})]})}function cy({className:a,children:c,position:d="popper",align:e="center",...f}){return(0,b.jsx)(bV,{children:(0,b.jsxs)(bX,{"data-slot":"select-content",className:(0,i.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===d&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:d,align:e,...f,children:[(0,b.jsx)(cA,{}),(0,b.jsx)(b5,{className:(0,i.cn)("p-1","popper"===d&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:c}),(0,b.jsx)(cB,{})]})})}function cz({className:a,children:c,...d}){return(0,b.jsxs)(cd,{"data-slot":"select-item",className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",a),...d,children:[(0,b.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,b.jsx)(ch,{children:(0,b.jsx)(cs.CheckIcon,{className:"size-4"})})}),(0,b.jsx)(cf,{children:c})]})}function cA({className:a,...c}){return(0,b.jsx)(cj,{"data-slot":"select-scroll-up-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",a),...c,children:(0,b.jsx)(cu,{className:"size-4"})})}function cB({className:a,...c}){return(0,b.jsx)(cl,{"data-slot":"select-scroll-down-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",a),...c,children:(0,b.jsx)(ct,{className:"size-4"})})}let cC=(0,e.default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);function cD({className:a,...c}){return(0,b.jsx)(cC,{role:"status","aria-label":"Loading",className:(0,i.cn)("size-4 animate-spin",a),...c})}function cE({isOpen:a,onClose:e,userId:h}){let i,j,o,p=(0,c.useRouter)(),q=(0,c.useSearchParams)(),r=(0,d.useId)(),t=(0,d.useId)(),u=(0,d.useId)(),v=(i=q.get("type"),j=q.get("team"),o=q.get("project"),i?o?"options":j?"project":"team":"type"),[w,x]=(0,d.useState)(v),[y,z]=(0,d.useState)(q.get("type")||""),[A,B]=(0,d.useState)([]),[C,D]=(0,d.useState)(null),[E,F]=(0,d.useState)([]),[H,I]=(0,d.useState)(null),[J,K]=(0,d.useState)(!1),[L,M]=(0,d.useState)(!1),[N,O]=(0,d.useState)(null),[P,Q]=(0,d.useState)(""),[R,S]=(0,d.useState)(null),[T,U]=(0,d.useState)("main"),[V,W]=(0,d.useState)(!0),[X,Y]=(0,d.useState)(""),[Z,$]=(0,d.useState)(!1),[_,aa]=(0,d.useState)(!1),[ab,ac]=(0,d.useState)([]),[ad,ae]=(0,d.useState)(!1),[af,ag]=(0,d.useState)(!1),ah=(0,d.useRef)(null);async function ai(){K(!0);try{let a=await fetch("/api/teams"),b=await a.json();if(b.success){let a=[...b.teams].sort((a,b)=>a.isPersonal&&!b.isPersonal?-1:!a.isPersonal&&b.isPersonal?1:a.name.localeCompare(b.name,void 0,{sensitivity:"base"}));B(a)}}catch(a){console.error("Failed to load teams:",a)}finally{K(!1)}}async function aj(a,b){ae(!0),ag(!1);try{let c=b.isPersonal?`/api/projects/branches?projectId=${a.id}`:`/api/projects/branches?projectId=${a.id}&teamId=${b.id}`;console.log("Fetching branches from:",c);let d=await fetch(c),e=await d.json();if(console.log("Branches response:",e),e.success&&e.branches){if(ac(e.branches),e.branches.length>0&&!e.branches.some(a=>a.name===T)){let a=e.branches.find(a=>"main"===a.name);U(a?.name||e.branches[0].name)}}else ag(!0),console.warn("Failed to fetch branches:",e.error)}catch(a){console.error("Failed to load branches:",a),ag(!0)}finally{ae(!1)}}async function ak(a){M(!0),O(null);try{let b=a.isPersonal?"/api/projects":`/api/projects?teamId=${a.id}`;console.log("Fetching projects from:",b);let c=await fetch(b),d=await c.json();if(console.log("Projects response:",d),d.success)F(d.projects),0===d.projects.length&&O("No projects found for this account");else{let a=`Failed to fetch projects: ${d.error||"Unknown error"}`;console.error(a),O(a)}}catch(b){let a=`Failed to load projects: ${b instanceof Error?b.message:String(b)}`;console.error(a,b),O(a)}finally{M(!1)}}async function al(){if(console.log("[Start Workflow] Function called"),console.log("[Start Workflow] selectedProject:",H),console.log("[Start Workflow] selectedTeam:",C),!H||!C)return void console.log("[Start Workflow] Missing project or team, returning");x("running"),Q("Starting workflow...");try{let a,b;console.log("[Start Workflow] latestDeployments:",H.latestDeployments);let c=H.latestDeployments[0];if(!c)throw Error("No deployments found for this project");let d=`https://${c.url}`;console.log("[Start Workflow] devUrl:",d),H.link?.org&&H.link?.repo&&(a=H.link.org,b=H.link.repo);let e={devUrl:d,projectName:H.name,userId:h,bypassToken:X};a&&b&&(e.repoUrl=`https://github.com/${a}/${b}`,e.repoBranch=c.gitSource?.sha||T||"main",console.log(`[Start Workflow] Using git reference: ${e.repoBranch} (${c.gitSource?.sha?"SHA from deployment":"branch name"})`)),V&&a&&b&&(e.repoOwner=a,e.repoName=b,e.baseBranch=T);let f=["Starting workflow...",a&&b?"Creating development sandbox...":null,"Fetching deployment logs...","Analyzing errors with AI...","Generating fix proposal...",V?"Writing code...":null].filter(Boolean),g=0;Q(f[g]);let i=setInterval(()=>{++g<f.length&&Q(f[g])},3e3),j="https://d3k-mcp.vercel.sh/api/cloud/start-fix";console.log("[Start Workflow] API URL:",j),console.log("[Start Workflow] Request body:",e);let k=new AbortController,l=setTimeout(()=>k.abort(),6e5);try{console.log("[Start Workflow] Making fetch request..."),console.log("[Start Workflow] About to stringify body...");let a=JSON.stringify(e);console.log("[Start Workflow] Body stringified successfully, length:",a.length),console.log("[Start Workflow] Calling fetch with URL:",j);let b=await fetch("/api/auth/token"),c=(await b.json()).accessToken,d={"Content-Type":"application/json"};c&&(d.Authorization=`Bearer ${c}`);let f=await fetch(j,{method:"POST",headers:d,body:a,credentials:"include",signal:k.signal});if(console.log("[Start Workflow] Fetch completed, status:",f.status),clearTimeout(l),clearInterval(i),!f.ok){let a=await f.text();throw Error(`API returned ${f.status}: ${a}`)}let g=await f.json();g.success?(S(g),Q("Workflow completed successfully!")):Q(`Workflow failed: ${g.error}`)}catch(a){if(clearTimeout(l),clearInterval(i),a instanceof Error&&"AbortError"===a.name)throw Error("Workflow timed out after 5 minutes");throw a}}catch(b){console.error("[Start Workflow] OUTER ERROR caught:",b),console.error("[Start Workflow] Error type:",b?.constructor?.name),console.error("[Start Workflow] Error stack:",b instanceof Error?b.stack:"no stack");let a=b instanceof Error?b.message:String(b);b instanceof TypeError&&"Failed to fetch"===a&&(a="Network error: Unable to connect to API. This might be a CORS issue, network problem, or Content Security Policy blocking the request."),Q(`Error: ${a}`)}}return((0,d.useEffect)(()=>{if(!a||"running"===w)return;let b=q.get("type"),c=q.get("team"),d=q.get("project");b&&b!==y&&z(b);let e=b?d?"options":c?"project":"team":"type";e!==w&&x(e),b||(z(""),D(null),I(null))},[a,q,w,y]),(0,d.useEffect)(()=>{a||(x("type"),z(""),D(null),I(null),F([]),B([]),Q(""),S(null),U("main"),W(!0),Y(""),aa(!1),O(null),ac([]),ae(!1),ag(!1),ah.current=null,p.replace("/workflows",{scroll:!1}))},[a,p]),(0,d.useEffect)(()=>{["team","project","options"].includes(w)&&0===A.length&&!J&&ai()},[w,A.length,J]),(0,d.useEffect)(()=>{let a=q.get("team");if(a&&A.length>0&&(!C||C.id!==a)){let b=A.find(b=>b.id===a);b&&D(b)}},[A,q,C]),(0,d.useEffect)(()=>{C&&!L&&ah.current!==C.id&&(ah.current=C.id,ak(C))},[C,L]),(0,d.useEffect)(()=>{H&&C&&"options"===w&&0===ab.length&&!ad&&!af&&aj(H,C)},[H,C,w,ab.length,ad,af]),(0,d.useEffect)(()=>{!async function(){if(console.log("[Bypass Token] useEffect triggered - step:",w,"selectedProject:",H?.name),!H)return console.log("[Bypass Token] No selected project, skipping check");if("options"!==w)return console.log("[Bypass Token] Not on options step, skipping check");let a=`d3k_bypass_token_${H.id}`,b=localStorage.getItem(a);b&&(console.log("[Bypass Token] Found stored token for project",H.id),Y(b));let c=H.latestDeployments[0];if(!c)return console.log("[Bypass Token] No latest deployment, skipping check");$(!0),console.log("[Bypass Token] Checking deployment protection...");try{let a=`https://${c.url}`;console.log("[Bypass Token] Checking URL:",a);let b=await fetch("/api/projects/check-protection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),d=await b.json();console.log("[Bypass Token] Protection check result:",d),aa(d.isProtected)}catch(a){console.error("[Bypass Token] Failed to check deployment protection:",a),aa(!1)}finally{$(!1)}}()},[H,w]),(0,d.useEffect)(()=>{let a=q.get("project");if(a&&E.length>0&&(!H||H.id!==a)){let b=E.find(b=>b.id===a);b&&I(b)}},[E,q,H]),a)?(0,b.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,b.jsx)("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[90vh] overflow-y-auto",children:(0,b.jsxs)("div",{className:"p-6",children:[(0,b.jsxs)("div",{className:"flex justify-between items-start mb-6",children:[(0,b.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"New d3k Workflow"}),(0,b.jsx)("button",{type:"button",onClick:e,className:"text-gray-400 hover:text-gray-600","aria-label":"Close modal",children:(0,b.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,b.jsxs)("div",{className:"mb-8",children:[(0,b.jsx)("div",{className:"flex items-center",children:["type","team","project","options","running"].map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center flex-1",children:[(0,b.jsx)("div",{className:`w-8 h-8 rounded-full flex items-center justify-center ${w===a?"bg-blue-600 text-white":["type","team","project","options","running"].indexOf(w)>["type","team","project","options","running"].indexOf(a)?"bg-green-600 text-white":"bg-gray-200 text-gray-600"}`,children:c+1}),c<4&&(0,b.jsx)("div",{className:"flex-1 mx-2",children:(0,b.jsx)(G,{value:100*(["type","team","project","options","running"].indexOf(w)>c),className:"h-1"})})]},a))}),(0,b.jsx)("div",{className:"flex items-center mt-2",children:["Type","Team","Project","Options","Run"].map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center flex-1",children:[(0,b.jsx)("span",{className:"text-xs text-gray-600 w-8 text-center",children:a}),c<4&&(0,b.jsx)("div",{className:"flex-1 mx-2"})]},a))})]}),"type"===w&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Select Workflow Type"}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)(g.default,{href:"/workflows/new?type=cloud-fix",className:"block w-full p-4 border-2 border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-50 text-left transition-colors",children:[(0,b.jsx)("div",{className:"font-semibold",children:"CLS Detection & Fix"}),(0,b.jsx)("div",{className:"text-sm text-gray-600 mt-1",children:"Analyze deployment logs for errors and generate fix proposals"})]}),(0,b.jsxs)(g.default,{href:"/workflows/new?type=next-16-migration",className:"block w-full p-4 border-2 border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-50 text-left transition-colors",children:[(0,b.jsx)("div",{className:"font-semibold",children:"Next.js 16 Migration"}),(0,b.jsx)("div",{className:"text-sm text-gray-600 mt-1",children:"Upgrade your project to Next.js 16 with automated codemods and fixes"})]})]}),(0,b.jsx)("div",{className:"mt-4 h-10","aria-hidden":"true"})]}),"team"===w&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Select Team"}),J?(0,b.jsx)("div",{className:"text-center py-8 text-gray-500",children:"Loading teams..."}):(0,b.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:A.map(a=>(0,b.jsxs)(g.default,{href:`/workflows/new?type=${y}&team=${a.id}`,className:"block w-full p-4 border-2 border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-50 text-left transition-colors",children:[(0,b.jsx)("div",{className:"font-semibold",children:a.name}),(0,b.jsxs)("div",{className:"text-sm text-gray-600",children:[a.isPersonal?"Personal Account":"Team"," • ",a.id]})]},a.id))}),(0,b.jsx)(g.default,{href:"/workflows/new",className:"mt-4 inline-block px-4 py-2 text-gray-600 hover:text-gray-800",children:"← Back"})]}),"project"===w&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Select Project"}),C&&(0,b.jsxs)("div",{className:"mb-4 text-sm text-gray-600",children:["Team: ",(0,b.jsx)("span",{className:"font-semibold",children:C.name})]}),N&&(0,b.jsxs)(k,{variant:"destructive",className:"mb-4",children:[(0,b.jsx)(f,{className:"h-4 w-4"}),(0,b.jsx)(l,{children:"Error"}),(0,b.jsx)(m,{children:N})]}),L?(0,b.jsx)("div",{className:"text-center py-8 text-gray-500",children:"Loading projects..."}):0===E.length?(0,b.jsx)("div",{className:"text-center py-8 text-gray-500",children:N?"Unable to load projects":"No projects found"}):(0,b.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:E.map(a=>(0,b.jsxs)(g.default,{href:`/workflows/new?type=${y}&team=${C?.id}&project=${a.id}`,className:"block w-full p-4 border-2 border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-50 text-left transition-colors",children:[(0,b.jsx)("div",{className:"font-semibold",children:a.name}),(0,b.jsxs)("div",{className:"text-sm text-gray-600 mt-1",children:[a.framework&&(0,b.jsxs)("span",{className:"mr-2",children:["Framework: ",a.framework]}),a.latestDeployments[0]&&(0,b.jsxs)("span",{children:["Latest: ",a.latestDeployments[0].url]})]})]},a.id))}),(0,b.jsx)(g.default,{href:`/workflows/new?type=${y}`,className:"mt-4 inline-block px-4 py-2 text-gray-600 hover:text-gray-800",children:"← Back"})]}),"options"===w&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Configure Options"}),H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"mb-6 p-4 bg-gray-50 rounded-lg",children:[(0,b.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Selected Project:"}),(0,b.jsx)("div",{className:"font-semibold",children:H.name})]}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,b.jsx)(n.Checkbox,{id:t,checked:V,onCheckedChange:a=>W(!0===a)}),(0,b.jsx)(s,{htmlFor:t,className:"text-sm font-normal cursor-pointer",children:"Automatically create GitHub PR with fixes"})]}),V&&H?.link?.repo&&(0,b.jsxs)("div",{children:[(0,b.jsx)(s,{htmlFor:r,className:"mb-2",children:"Base Branch"}),ad?(0,b.jsx)("div",{className:"text-sm text-gray-500 py-2",children:"Loading branches..."}):ab.length>0?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(cv,{value:T,onValueChange:U,children:[(0,b.jsx)(cx,{id:r,className:"w-full",children:(0,b.jsx)(cw,{placeholder:"Select a branch"})}),(0,b.jsx)(cy,{children:ab.map(a=>(0,b.jsxs)(cz,{value:a.name,children:[a.name," (deployed"," ",new Date(a.lastDeployment.createdAt).toLocaleDateString(),")"]},a.name))})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Showing branches with recent deployments (last ",ab.length," branch",1!==ab.length?"es":"",")"]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("input",{type:"text",id:r,value:T,onChange:a=>U(a.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md",placeholder:"main"}),af&&(0,b.jsx)("p",{className:"text-xs text-amber-600 mt-1",children:"Unable to load branches automatically. Please enter the branch name manually."})]})]}),V&&!H?.link?.repo&&(0,b.jsx)("div",{className:"text-sm text-amber-600",children:"This project is not connected to a GitHub repository. PRs cannot be created automatically."}),Z&&(0,b.jsx)("div",{className:"text-sm text-gray-500",children:"Checking deployment protection..."}),_&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("label",{htmlFor:u,className:"block text-sm font-medium text-gray-700 mb-1",children:["Deployment Protection Bypass Token",(0,b.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,b.jsx)("input",{type:"text",id:u,value:X,onChange:a=>{let b=a.target.value;if(Y(b),H&&b){let a=`d3k_bypass_token_${H.id}`;localStorage.setItem(a,b),console.log("[Bypass Token] Saved token to localStorage for project",H.id)}},className:"w-full px-3 py-2 border border-gray-300 rounded-md font-mono text-sm",placeholder:"Enter your 32-character bypass token",required:!0}),(0,b.jsxs)("p",{className:"mt-1 text-xs text-gray-500",children:["This deployment is protected. Get your bypass token from"," ",C&&H?(0,b.jsx)("a",{href:`https://vercel.com/${C.slug}/${H.name}/settings/deployment-protection#protection-bypass-for-automation`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:"Project Settings → Deployment Protection"}):(0,b.jsx)("a",{href:"https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/protection-bypass-automation",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:"Vercel Dashboard → Project Settings → Deployment Protection"})]})]})]}),(0,b.jsxs)("div",{className:"flex gap-3 mt-6",children:[(0,b.jsx)(g.default,{href:`/workflows/new?type=${y}&team=${C?.id}`,className:"px-4 py-2 text-gray-600 hover:text-gray-800",children:"← Back"}),(0,b.jsx)("button",{type:"button",onClick:al,disabled:_&&!X,className:"flex-1 px-6 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Start Workflow"})]})]}):(0,b.jsxs)("div",{className:"text-center py-8 text-gray-500",children:[(0,b.jsx)(cD,{className:"mx-auto mb-2"}),"Loading project details..."]})]}),"running"===w&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Workflow Status"}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)(k,{variant:P.includes("Error")||P.includes("failed")?"destructive":"default",className:P.includes("Error")||P.includes("failed")?"":"bg-blue-50 border-blue-200",children:[P.includes("Error")||P.includes("failed")?(0,b.jsx)(f,{className:"h-4 w-4"}):!P.includes("completed successfully")&&(0,b.jsx)(cD,{className:"h-4 w-4"}),(0,b.jsx)(m,{className:P.includes("Error")||P.includes("failed")?"":"text-blue-900",children:P})]}),R&&(0,b.jsxs)("div",{className:"space-y-3",children:[R.blobUrl&&R.runId&&(0,b.jsxs)(k,{className:"bg-green-50 border-green-200",children:[(0,b.jsx)(l,{className:"text-green-900",children:"Fix Proposal Generated"}),(0,b.jsx)(m,{children:(0,b.jsx)(g.default,{href:`/workflows/${R.runId}/report`,className:"text-primary hover:underline",children:"View Report"})})]}),R.pr?.prUrl&&(0,b.jsxs)(k,{className:"bg-green-50 border-green-200",children:[(0,b.jsx)(l,{className:"text-green-900",children:"GitHub PR Created"}),(0,b.jsx)(m,{children:(0,b.jsx)("a",{href:R.pr.prUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"View Pull Request"})})]})]}),R&&(0,b.jsx)("button",{type:"button",onClick:()=>{e(),p.push("/workflows")},className:"w-full px-6 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700",children:"Done"})]})]})]})})}):null}function cF({user:a}){let e=(0,c.useRouter)();return(0,b.jsx)("div",{children:(0,b.jsx)(d.Suspense,{fallback:(0,b.jsx)("div",{children:"Loading..."}),children:(0,b.jsx)(cE,{isOpen:!0,onClose:()=>{e.push("/workflows")},userId:a.id})})})}a.s(["default",()=>cF],7362)}];
|
|
6
|
+
Defaulting to \`null\`.`));let l=F(g,k)?g:null,m=D(l)?i(l,k):void 0;return(0,b.jsx)(w,{scope:f,value:l,max:k,children:(0,b.jsx)(q.div,{"aria-valuemax":k,"aria-valuemin":0,"aria-valuenow":D(l)?l:void 0,"aria-valuetext":m,role:"progressbar","data-state":C(l,k),"data-value":l??void 0,"data-max":k,...j,ref:c})})});y.displayName=t;var z="ProgressIndicator",A=d.forwardRef((a,c)=>{let{__scopeProgress:d,...e}=a,f=x(z,d);return(0,b.jsx)(q.div,{"data-state":C(f.value,f.max),"data-value":f.value??void 0,"data-max":f.max,...e,ref:c})});function B(a,b){return`${Math.round(a/b*100)}%`}function C(a,b){return null==a?"indeterminate":a===b?"complete":"loading"}function D(a){return"number"==typeof a}function E(a){return D(a)&&!isNaN(a)&&a>0}function F(a,b){return D(a)&&!isNaN(a)&&a<=b&&a>=0}function G({className:a,value:c,...d}){return(0,b.jsx)(y,{"data-slot":"progress",className:(0,i.cn)("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",a),...d,children:(0,b.jsx)(A,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(c||0)}%)`}})})}function H(a,[b,c]){return Math.min(c,Math.max(b,a))}A.displayName=z;var I=a.i(59653),J=a.i(90078),K=a.i(72973),L=a.i(56828),M=new WeakMap;function N(a,b){var c,d;let e,f,g;if("at"in Array.prototype)return Array.prototype.at.call(a,b);let h=(c=a,d=b,e=c.length,(g=(f=O(d))>=0?f:e+f)<0||g>=e?-1:g);return -1===h?void 0:a[h]}function O(a){return a!=a||0===a?0:Math.trunc(a)}(class a extends Map{#a;constructor(a){super(a),this.#a=[...super.keys()],M.set(this,!0)}set(a,b){return M.get(this)&&(this.has(a)?this.#a[this.#a.indexOf(a)]=a:this.#a.push(a)),super.set(a,b),this}insert(a,b,c){let d,e=this.has(b),f=this.#a.length,g=O(a),h=g>=0?g:f+g,i=h<0||h>=f?-1:h;if(i===this.size||e&&i===this.size-1||-1===i)return this.set(b,c),this;let j=this.size+ +!e;g<0&&h++;let k=[...this.#a],l=!1;for(let a=h;a<j;a++)if(h===a){let f=k[a];k[a]===b&&(f=k[a+1]),e&&this.delete(b),d=this.get(f),this.set(b,c)}else{l||k[a-1]!==b||(l=!0);let c=k[l?a:a-1],e=d;d=this.get(c),this.delete(c),this.set(c,e)}return this}with(b,c,d){let e=new a(this);return e.insert(b,c,d),e}before(a){let b=this.#a.indexOf(a)-1;if(!(b<0))return this.entryAt(b)}setBefore(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d,b,c)}after(a){let b=this.#a.indexOf(a);if(-1!==(b=-1===b||b===this.size-1?-1:b+1))return this.entryAt(b)}setAfter(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d+1,b,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#a=[],super.clear()}delete(a){let b=super.delete(a);return b&&this.#a.splice(this.#a.indexOf(a),1),b}deleteAt(a){let b=this.keyAt(a);return void 0!==b&&this.delete(b)}at(a){let b=N(this.#a,a);if(void 0!==b)return this.get(b)}entryAt(a){let b=N(this.#a,a);if(void 0!==b)return[b,this.get(b)]}indexOf(a){return this.#a.indexOf(a)}keyAt(a){return N(this.#a,a)}from(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return d;c++}}findIndex(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return c;c++}return -1}filter(b,c){let d=[],e=0;for(let a of this)Reflect.apply(b,c,[a,e,this])&&d.push(a),e++;return new a(d)}map(b,c){let d=[],e=0;for(let a of this)d.push([a[0],Reflect.apply(b,c,[a,e,this])]),e++;return new a(d)}reduce(...a){let[b,c]=a,d=0,e=c??this.at(0);for(let c of this)e=0===d&&1===a.length?c:Reflect.apply(b,this,[e,c,d,this]),d++;return e}reduceRight(...a){let[b,c]=a,d=c??this.at(-1);for(let c=this.size-1;c>=0;c--){let e=this.at(c);d=c===this.size-1&&1===a.length?e:Reflect.apply(b,this,[d,e,c,this])}return d}toSorted(b){return new a([...this.entries()].sort(b))}toReversed(){let b=new a;for(let a=this.size-1;a>=0;a--){let c=this.keyAt(a),d=this.get(c);b.set(c,d)}return b}toSpliced(...b){let c=[...this.entries()];return c.splice(...b),new a(c)}slice(b,c){let d=new a,e=this.size-1;if(void 0===b)return d;b<0&&(b+=this.size),void 0!==c&&c>0&&(e=c-1);for(let a=b;a<=e;a++){let b=this.keyAt(a),c=this.get(b);d.set(b,c)}return d}every(a,b){let c=0;for(let d of this){if(!Reflect.apply(a,b,[d,c,this]))return!1;c++}return!0}some(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return!0;c++}return!1}});var P=d.createContext(void 0),Q=a.i(6041),R=a.i(41761),S=a.i(9730),T=a.i(35598);let U=["top","right","bottom","left"],V=Math.min,W=Math.max,X=Math.round,Y=Math.floor,Z=a=>({x:a,y:a}),$={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function aa(a,b){return"function"==typeof a?a(b):a}function ab(a){return a.split("-")[0]}function ac(a){return a.split("-")[1]}function ad(a){return"x"===a?"y":"x"}function ae(a){return"y"===a?"height":"width"}let af=new Set(["top","bottom"]);function ag(a){return af.has(ab(a))?"y":"x"}function ah(a){return a.replace(/start|end/g,a=>_[a])}let ai=["left","right"],aj=["right","left"],ak=["top","bottom"],al=["bottom","top"];function am(a){return a.replace(/left|right|bottom|top/g,a=>$[a])}function an(a){return"number"!=typeof a?{top:0,right:0,bottom:0,left:0,...a}:{top:a,right:a,bottom:a,left:a}}function ao(a){let{x:b,y:c,width:d,height:e}=a;return{width:d,height:e,top:c,left:b,right:b+d,bottom:c+e,x:b,y:c}}function ap(a,b,c){let d,{reference:e,floating:f}=a,g=ag(b),h=ad(ag(b)),i=ae(h),j=ab(b),k="y"===g,l=e.x+e.width/2-f.width/2,m=e.y+e.height/2-f.height/2,n=e[i]/2-f[i]/2;switch(j){case"top":d={x:l,y:e.y-f.height};break;case"bottom":d={x:l,y:e.y+e.height};break;case"right":d={x:e.x+e.width,y:m};break;case"left":d={x:e.x-f.width,y:m};break;default:d={x:e.x,y:e.y}}switch(ac(b)){case"start":d[h]-=n*(c&&k?-1:1);break;case"end":d[h]+=n*(c&&k?-1:1)}return d}let aq=async(a,b,c)=>{let{placement:d="bottom",strategy:e="absolute",middleware:f=[],platform:g}=c,h=f.filter(Boolean),i=await (null==g.isRTL?void 0:g.isRTL(b)),j=await g.getElementRects({reference:a,floating:b,strategy:e}),{x:k,y:l}=ap(j,d,i),m=d,n={},o=0;for(let c=0;c<h.length;c++){let{name:f,fn:p}=h[c],{x:q,y:r,data:s,reset:t}=await p({x:k,y:l,initialPlacement:d,placement:m,strategy:e,middlewareData:n,rects:j,platform:g,elements:{reference:a,floating:b}});k=null!=q?q:k,l=null!=r?r:l,n={...n,[f]:{...n[f],...s}},t&&o<=50&&(o++,"object"==typeof t&&(t.placement&&(m=t.placement),t.rects&&(j=!0===t.rects?await g.getElementRects({reference:a,floating:b,strategy:e}):t.rects),{x:k,y:l}=ap(j,m,i)),c=-1)}return{x:k,y:l,placement:m,strategy:e,middlewareData:n}};async function ar(a,b){var c;void 0===b&&(b={});let{x:d,y:e,platform:f,rects:g,elements:h,strategy:i}=a,{boundary:j="clippingAncestors",rootBoundary:k="viewport",elementContext:l="floating",altBoundary:m=!1,padding:n=0}=aa(b,a),o=an(n),p=h[m?"floating"===l?"reference":"floating":l],q=ao(await f.getClippingRect({element:null==(c=await (null==f.isElement?void 0:f.isElement(p)))||c?p:p.contextElement||await (null==f.getDocumentElement?void 0:f.getDocumentElement(h.floating)),boundary:j,rootBoundary:k,strategy:i})),r="floating"===l?{x:d,y:e,width:g.floating.width,height:g.floating.height}:g.reference,s=await (null==f.getOffsetParent?void 0:f.getOffsetParent(h.floating)),t=await (null==f.isElement?void 0:f.isElement(s))&&await (null==f.getScale?void 0:f.getScale(s))||{x:1,y:1},u=ao(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:r,offsetParent:s,strategy:i}):r);return{top:(q.top-u.top+o.top)/t.y,bottom:(u.bottom-q.bottom+o.bottom)/t.y,left:(q.left-u.left+o.left)/t.x,right:(u.right-q.right+o.right)/t.x}}function as(a,b){return{top:a.top-b.height,right:a.right-b.width,bottom:a.bottom-b.height,left:a.left-b.width}}function at(a){return U.some(b=>a[b]>=0)}let au=new Set(["left","top"]);async function av(a,b){let{placement:c,platform:d,elements:e}=a,f=await (null==d.isRTL?void 0:d.isRTL(e.floating)),g=ab(c),h=ac(c),i="y"===ag(c),j=au.has(g)?-1:1,k=f&&i?-1:1,l=aa(b,a),{mainAxis:m,crossAxis:n,alignmentAxis:o}="number"==typeof l?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return h&&"number"==typeof o&&(n="end"===h?-1*o:o),i?{x:n*k,y:m*j}:{x:m*j,y:n*k}}function aw(a){return function(a){return!1}(a)?(a.nodeName||"").toLowerCase():"#document"}function ax(a){var b;return(null==a||null==(b=a.ownerDocument)?void 0:b.defaultView)||window}function ay(a){var b;return null==(b=(function(a){return!1}(a)?a.ownerDocument:a.document)||window.document)?void 0:b.documentElement}function az(a){return!1}let aA=new Set(["inline","contents"]);function aB(a){let{overflow:b,overflowX:c,overflowY:d,display:e}=aM(a);return/auto|scroll|overlay|hidden|clip/.test(b+d+c)&&!aA.has(e)}let aC=new Set(["table","td","th"]),aD=[":popover-open",":modal"];function aE(a){return aD.some(b=>{try{return a.matches(b)}catch(a){return!1}})}let aF=["transform","translate","scale","rotate","perspective"],aG=["transform","translate","scale","rotate","perspective","filter"],aH=["paint","layout","strict","content"];function aI(a){let b=aJ(),c=a;return aF.some(a=>!!c[a]&&"none"!==c[a])||!!c.containerType&&"normal"!==c.containerType||!b&&!!c.backdropFilter&&"none"!==c.backdropFilter||!b&&!!c.filter&&"none"!==c.filter||aG.some(a=>(c.willChange||"").includes(a))||aH.some(a=>(c.contain||"").includes(a))}function aJ(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let aK=new Set(["html","body","#document"]);function aL(a){return aK.has(aw(a))}function aM(a){return ax(a).getComputedStyle(a)}function aN(a){return{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function aO(a){if("html"===aw(a))return a;let b=a.assignedSlot||a.parentNode||!1||ay(a);return b}function aP(a,b,c){var d;void 0===b&&(b=[]),void 0===c&&(c=!0);let e=function a(b){let c=aO(b);return aL(c)?b.ownerDocument?b.ownerDocument.body:b.body:a(c)}(a),f=e===(null==(d=a.ownerDocument)?void 0:d.body),g=ax(e);if(f){let a=aQ(g);return b.concat(g,g.visualViewport||[],aB(e)?e:[],a&&c?aP(a):[])}return b.concat(e,aP(e,[],c))}function aQ(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function aR(a){let b=aM(a),c=parseFloat(b.width)||0,d=parseFloat(b.height)||0,e=!1,f=e?a.offsetWidth:c,g=e?a.offsetHeight:d,h=X(c)!==f||X(d)!==g;return h&&(c=f,d=g),{width:c,height:d,$:h}}function aS(a){return 0,a.contextElement}function aT(a){let b=aS(a);1;return Z(1)}let aU=Z(0);function aV(a){let b=ax(a);return aJ()&&b.visualViewport?{x:b.visualViewport.offsetLeft,y:b.visualViewport.offsetTop}:aU}function aW(a,b,c,d){var e;void 0===b&&(b=!1),void 0===c&&(c=!1);let f=a.getBoundingClientRect(),g=aS(a),h=Z(1);b&&(d||(h=aT(a)));let i=(void 0===(e=c)&&(e=!1),d&&(!e||d===ax(g))&&e)?aV(g):Z(0),j=(f.left+i.x)/h.x,k=(f.top+i.y)/h.y,l=f.width/h.x,m=f.height/h.y;if(g){let a=ax(g),b=d,c=a,e=aQ(c);for(;e&&d&&b!==c;){let a=aT(e),b=e.getBoundingClientRect(),d=aM(e),f=b.left+(e.clientLeft+parseFloat(d.paddingLeft))*a.x,g=b.top+(e.clientTop+parseFloat(d.paddingTop))*a.y;j*=a.x,k*=a.y,l*=a.x,m*=a.y,j+=f,k+=g,e=aQ(c=ax(e))}}return ao({width:l,height:m,x:j,y:k})}function aX(a,b){let c=aN(a).scrollLeft;return b?b.left+c:aW(ay(a)).left+c}function aY(a,b){let c=a.getBoundingClientRect();return{x:c.left+b.scrollLeft-aX(a,c),y:c.top+b.scrollTop}}function aZ(a,b,c){var d;let e;if("viewport"===b)e=function(a,b){let c=ax(a),d=ay(a),e=c.visualViewport,f=d.clientWidth,g=d.clientHeight,h=0,i=0;if(e){f=e.width,g=e.height;let a=aJ();(!a||a&&"fixed"===b)&&(h=e.offsetLeft,i=e.offsetTop)}let j=aX(d);if(j<=0){let a=d.ownerDocument,b=a.body,c=getComputedStyle(b),e="CSS1Compat"===a.compatMode&&parseFloat(c.marginLeft)+parseFloat(c.marginRight)||0,g=Math.abs(d.clientWidth-b.clientWidth-e);g<=25&&(f-=g)}else j<=25&&(f+=j);return{width:f,height:g,x:h,y:i}}(a,c);else if("document"===b){let b,c,f,g,h,i,j;d=ay(a),b=ay(d),c=aN(d),f=d.ownerDocument.body,g=W(b.scrollWidth,b.clientWidth,f.scrollWidth,f.clientWidth),h=W(b.scrollHeight,b.clientHeight,f.scrollHeight,f.clientHeight),i=-c.scrollLeft+aX(d),j=-c.scrollTop,"rtl"===aM(f).direction&&(i+=W(b.clientWidth,f.clientWidth)-g),e={width:g,height:h,x:i,y:j}}else{1;{let c=aV(a);e={x:b.x-c.x,y:b.y-c.y,width:b.width,height:b.height}}}return ao(e)}function a$(a){return"static"===aM(a).position}function a_(a,b){1;return null}function a0(a,b){var c;let d=ax(a);if(aE(a))return d;1;{let b=aO(a);for(;b&&!aL(b);){0;b=aO(b)}return d}}let a1=async function(a){let b=this.getOffsetParent||a0,c=this.getDimensions,d=await c(a.floating);return{reference:function(a,b,c){var d;let e=(d=0,!1),f=ay(b),g="fixed"===c,h=aW(a,!0,g,b),i={scrollLeft:0,scrollTop:0},j=Z(0);if(e||!e&&!g)if(("body"!==aw(b)||aB(f))&&(i=aN(b)),e){let a=aW(b,!0,g,b);j.x=a.x+b.clientLeft,j.y=a.y+b.clientTop}else f&&(j.x=aX(f));g&&!e&&f&&(j.x=aX(f));let k=!f||e||g?Z(0):aY(f,i);return{x:h.left+i.scrollLeft-j.x-k.x,y:h.top+i.scrollTop-j.y-k.y,width:h.width,height:h.height}}(a.reference,await b(a.floating),a.strategy),floating:{x:0,y:0,width:d.width,height:d.height}}},a2={convertOffsetParentRelativeRectToViewportRelativeRect:function(a){var b,c;let{elements:d,rect:e,offsetParent:f,strategy:g}=a,h="fixed"===g,i=ay(f),j=!!d&&aE(d.floating);if(f===i||j&&h)return e;let k={scrollLeft:0,scrollTop:0},l=Z(1),m=Z(0),n=(b=0,!1);(n||!n&&!h)&&(("body"!==aw(f)||aB(i))&&(k=aN(f)),c=0,0);let o=!i||n||h?Z(0):aY(i,k);return{width:e.width*l.x,height:e.height*l.y,x:e.x*l.x-k.scrollLeft*l.x+m.x+o.x,y:e.y*l.y-k.scrollTop*l.y+m.y+o.y}},getDocumentElement:ay,getClippingRect:function(a){let{element:b,boundary:c,rootBoundary:d,strategy:e}=a,f=[..."clippingAncestors"===c?aE(b)?[]:function(a,b){var c;let d=b.get(a);if(d)return d;let e=aP(a,[],!1).filter(a=>{var b;return b=0,!1}),f="fixed"===aM(a).position,g=f?aO(a):a;return c=0,b.set(a,e),e}(b,this._c):[].concat(c),d],g=f[0],h=f.reduce((a,c)=>{let d=aZ(b,c,e);return a.top=W(d.top,a.top),a.right=V(d.right,a.right),a.bottom=V(d.bottom,a.bottom),a.left=W(d.left,a.left),a},aZ(b,g,e));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}},getOffsetParent:a0,getElementRects:a1,getClientRects:function(a){return Array.from(a.getClientRects())},getDimensions:function(a){let{width:b,height:c}=aR(a);return{width:b,height:c}},getScale:aT,isElement:az,isRTL:function(a){return"rtl"===aM(a).direction}};function a3(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}let a4=a=>({name:"arrow",options:a,async fn(b){let{x:c,y:d,placement:e,rects:f,platform:g,elements:h,middlewareData:i}=b,{element:j,padding:k=0}=aa(a,b)||{};if(null==j)return{};let l=an(k),m={x:c,y:d},n=ad(ag(e)),o=ae(n),p=await g.getDimensions(j),q="y"===n,r=q?"clientHeight":"clientWidth",s=f.reference[o]+f.reference[n]-m[n]-f.floating[o],t=m[n]-f.reference[n],u=await (null==g.getOffsetParent?void 0:g.getOffsetParent(j)),v=u?u[r]:0;v&&await (null==g.isElement?void 0:g.isElement(u))||(v=h.floating[r]||f.floating[o]);let w=v/2-p[o]/2-1,x=V(l[q?"top":"left"],w),y=V(l[q?"bottom":"right"],w),z=v-p[o]-y,A=v/2-p[o]/2+(s/2-t/2),B=W(x,V(A,z)),C=!i.arrow&&null!=ac(e)&&A!==B&&f.reference[o]/2-(A<x?x:y)-p[o]/2<0,D=C?A<x?A-x:A-z:0;return{[n]:m[n]+D,data:{[n]:B,centerOffset:A-B-D,...C&&{alignmentOffset:D}},reset:C}}});var a5="undefined"!=typeof document?d.useLayoutEffect:function(){};function a6(a,b){let c,d,e;if(a===b)return!0;if(typeof a!=typeof b)return!1;if("function"==typeof a&&a.toString()===b.toString())return!0;if(a&&b&&"object"==typeof a){if(Array.isArray(a)){if((c=a.length)!==b.length)return!1;for(d=c;0!=d--;)if(!a6(a[d],b[d]))return!1;return!0}if((c=(e=Object.keys(a)).length)!==Object.keys(b).length)return!1;for(d=c;0!=d--;)if(!({}).hasOwnProperty.call(b,e[d]))return!1;for(d=c;0!=d--;){let c=e[d];if(("_owner"!==c||!a.$$typeof)&&!a6(a[c],b[c]))return!1}return!0}return a!=a&&b!=b}function a7(a,b){let c=1;return Math.round(b*c)/c}function a8(a){let b=d.useRef(a);return a5(()=>{b.current=a}),b}var a9=a.i(20354),ba=d.forwardRef((a,c)=>{let{children:d,width:e=10,height:f=5,...g}=a;return(0,b.jsx)(a9.Primitive.svg,{...g,ref:c,width:e,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?d:(0,b.jsx)("polygon",{points:"0,0 30,0 15,10"})})});ba.displayName="Arrow";var bb=a.i(29123),bc=a.i(78434),bd=a.i(13386),be="Popper",[bf,bg]=(0,J.createContextScope)(be),[bh,bi]=bf(be),bj=a=>{let{__scopePopper:c,children:e}=a,[f,g]=d.useState(null);return(0,b.jsx)(bh,{scope:c,anchor:f,onAnchorChange:g,children:e})};bj.displayName=be;var bk="PopperAnchor",bl=d.forwardRef((a,c)=>{let{__scopePopper:e,virtualRef:f,...g}=a,h=bi(bk,e),i=d.useRef(null),j=(0,K.useComposedRefs)(c,i),k=d.useRef(null);return d.useEffect(()=>{let a=k.current;k.current=f?.current||i.current,a!==k.current&&h.onAnchorChange(k.current)}),f?null:(0,b.jsx)(a9.Primitive.div,{...g,ref:j})});bl.displayName=bk;var bm="PopperContent",[bn,bo]=bf(bm),bp=d.forwardRef((a,c)=>{var e,f,g,h,i,j,k,l,m,n,p,q,r;let{__scopePopper:s,side:t="bottom",sideOffset:u=0,align:v="center",alignOffset:w=0,arrowPadding:x=0,avoidCollisions:y=!0,collisionBoundary:z=[],collisionPadding:A=0,sticky:B="partial",hideWhenDetached:C=!1,updatePositionStrategy:D="optimized",onPlaced:E,...F}=a,G=bi(bm,s),[H,I]=d.useState(null),J=(0,K.useComposedRefs)(c,a=>I(a)),[L,M]=d.useState(null),N=(0,bd.useSize)(L),O=N?.width??0,P=N?.height??0,Q="number"==typeof A?A:{top:0,right:0,bottom:0,left:0,...A},R=Array.isArray(z)?z:[z],S=R.length>0,T={padding:Q,boundary:R.filter(bt),altBoundary:S},{refs:U,floatingStyles:X,placement:Z,isPositioned:$,middlewareData:_}=function(a){void 0===a&&(a={});let{placement:b="bottom",strategy:c="absolute",middleware:e=[],platform:f,elements:{reference:g,floating:h}={},transform:i=!0,whileElementsMounted:j,open:k}=a,[l,m]=d.useState({x:0,y:0,strategy:c,placement:b,middlewareData:{},isPositioned:!1}),[n,p]=d.useState(e);a6(n,e)||p(e);let[q,r]=d.useState(null),[s,t]=d.useState(null),u=d.useCallback(a=>{a!==y.current&&(y.current=a,r(a))},[]),v=d.useCallback(a=>{a!==z.current&&(z.current=a,t(a))},[]),w=g||q,x=h||s,y=d.useRef(null),z=d.useRef(null),A=d.useRef(l),B=null!=j,C=a8(j),D=a8(f),E=a8(k),F=d.useCallback(()=>{var a,d;let e,f,g;if(!y.current||!z.current)return;let h={placement:b,strategy:c,middleware:n};D.current&&(h.platform=D.current),(a=y.current,d=z.current,e=new Map,g={...(f={platform:a2,...h}).platform,_c:e},aq(a,d,{...f,platform:g})).then(a=>{let b={...a,isPositioned:!1!==E.current};G.current&&!a6(A.current,b)&&(A.current=b,o.flushSync(()=>{m(b)}))})},[n,b,c,D,E]);a5(()=>{!1===k&&A.current.isPositioned&&(A.current.isPositioned=!1,m(a=>({...a,isPositioned:!1})))},[k]);let G=d.useRef(!1);a5(()=>(G.current=!0,()=>{G.current=!1}),[]),a5(()=>{if(w&&(y.current=w),x&&(z.current=x),w&&x){if(C.current)return C.current(w,x,F);F()}},[w,x,F,C,B]);let H=d.useMemo(()=>({reference:y,floating:z,setReference:u,setFloating:v}),[u,v]),I=d.useMemo(()=>({reference:w,floating:x}),[w,x]),J=d.useMemo(()=>{let a={position:c,left:0,top:0};if(!I.floating)return a;let b=a7(I.floating,l.x),d=a7(I.floating,l.y);if(i)return{...a,transform:"translate("+b+"px, "+d+"px)",...(I.floating,false)};return{position:c,left:b,top:d}},[c,i,I.floating,l.x,l.y]);return d.useMemo(()=>({...l,update:F,refs:H,elements:I,floatingStyles:J}),[l,F,H,I,J])}({strategy:"fixed",placement:t+("center"!==v?"-"+v:""),whileElementsMounted:(...a)=>(function(a,b,c,d){let e;void 0===d&&(d={});let{ancestorScroll:f=!0,ancestorResize:g=!0,elementResize:h="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:j=!1}=d,k=aS(a),l=f||g?[...k?aP(k):[],...aP(b)]:[];l.forEach(a=>{f&&a.addEventListener("scroll",c,{passive:!0}),g&&a.addEventListener("resize",c)});let m=k&&i?function(a,b){let c,d=null,e=ay(a);function f(){var a;clearTimeout(c),null==(a=d)||a.disconnect(),d=null}return!function g(h,i){void 0===h&&(h=!1),void 0===i&&(i=1),f();let j=a.getBoundingClientRect(),{left:k,top:l,width:m,height:n}=j;if(h||b(),!m||!n)return;let o={rootMargin:-Y(l)+"px "+-Y(e.clientWidth-(k+m))+"px "+-Y(e.clientHeight-(l+n))+"px "+-Y(k)+"px",threshold:W(0,V(1,i))||1},p=!0;function q(b){let d=b[0].intersectionRatio;if(d!==i){if(!p)return g();d?g(!1,d):c=setTimeout(()=>{g(!1,1e-7)},1e3)}1!==d||a3(j,a.getBoundingClientRect())||g(),p=!1}try{d=new IntersectionObserver(q,{...o,root:e.ownerDocument})}catch(a){d=new IntersectionObserver(q,o)}d.observe(a)}(!0),f}(k,c):null,n=-1,o=null;h&&(o=new ResizeObserver(a=>{let[d]=a;d&&d.target===k&&o&&(o.unobserve(b),cancelAnimationFrame(n),n=requestAnimationFrame(()=>{var a;null==(a=o)||a.observe(b)})),c()}),k&&!j&&o.observe(k),o.observe(b));let p=j?aW(a):null;return j&&function b(){let d=aW(a);p&&!a3(p,d)&&c(),p=d,e=requestAnimationFrame(b)}(),c(),()=>{var a;l.forEach(a=>{f&&a.removeEventListener("scroll",c),g&&a.removeEventListener("resize",c)}),null==m||m(),null==(a=o)||a.disconnect(),o=null,j&&cancelAnimationFrame(e)}})(...a,{animationFrame:"always"===D}),elements:{reference:G.anchor},middleware:[{...{name:"offset",options:f=e={mainAxis:u+P,alignmentAxis:w},async fn(a){var b,c;let{x:d,y:e,placement:g,middlewareData:h}=a,i=await av(a,f);return g===(null==(b=h.offset)?void 0:b.placement)&&null!=(c=h.arrow)&&c.alignmentOffset?{}:{x:d+i.x,y:e+i.y,data:{...i,placement:g}}}},options:[e,void 0]},y&&{...{name:"shift",options:i=h={mainAxis:!0,crossAxis:!1,limiter:"partial"===B?{...(g=void 0,{options:g={},fn(a){let{x:b,y:c,placement:d,rects:e,middlewareData:f}=a,{offset:h=0,mainAxis:i=!0,crossAxis:j=!0}=aa(g,a),k={x:b,y:c},l=ag(d),m=ad(l),n=k[m],o=k[l],p=aa(h,a),q="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(i){let a="y"===m?"height":"width",b=e.reference[m]-e.floating[a]+q.mainAxis,c=e.reference[m]+e.reference[a]-q.mainAxis;n<b?n=b:n>c&&(n=c)}if(j){var r,s;let a="y"===m?"width":"height",b=au.has(ab(d)),c=e.reference[l]-e.floating[a]+(b&&(null==(r=f.offset)?void 0:r[l])||0)+(b?0:q.crossAxis),g=e.reference[l]+e.reference[a]+(b?0:(null==(s=f.offset)?void 0:s[l])||0)-(b?q.crossAxis:0);o<c?o=c:o>g&&(o=g)}return{[m]:n,[l]:o}}}),options:[void 0,void 0]}:void 0,...T},async fn(a){let{x:b,y:c,placement:d}=a,{mainAxis:e=!0,crossAxis:f=!1,limiter:g={fn:a=>{let{x:b,y:c}=a;return{x:b,y:c}}},...h}=aa(i,a),j={x:b,y:c},k=await ar(a,h),l=ag(ab(d)),m=ad(l),n=j[m],o=j[l];if(e){let a="y"===m?"top":"left",b="y"===m?"bottom":"right",c=n+k[a],d=n-k[b];n=W(c,V(n,d))}if(f){let a="y"===l?"top":"left",b="y"===l?"bottom":"right",c=o+k[a],d=o-k[b];o=W(c,V(o,d))}let p=g.fn({...a,[m]:n,[l]:o});return{...p,data:{x:p.x-b,y:p.y-c,enabled:{[m]:e,[l]:f}}}}},options:[h,void 0]},y&&{...{name:"flip",options:k=j={...T},async fn(a){var b,c,d,e,f,g,h,i;let j,l,m,{placement:n,middlewareData:o,rects:p,initialPlacement:q,platform:r,elements:s}=a,{mainAxis:t=!0,crossAxis:u=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...z}=aa(k,a);if(null!=(b=o.arrow)&&b.alignmentOffset)return{};let A=ab(n),B=ag(q),C=ab(q)===q,D=await (null==r.isRTL?void 0:r.isRTL(s.floating)),E=v||(C||!y?[am(q)]:(j=am(q),[ah(q),j,ah(j)])),F="none"!==x;!v&&F&&E.push(...(l=ac(q),m=function(a,b,c){switch(a){case"top":case"bottom":if(c)return b?aj:ai;return b?ai:aj;case"left":case"right":return b?ak:al;default:return[]}}(ab(q),"start"===x,D),l&&(m=m.map(a=>a+"-"+l),y&&(m=m.concat(m.map(ah)))),m));let G=[q,...E],H=await ar(a,z),I=[],J=(null==(c=o.flip)?void 0:c.overflows)||[];if(t&&I.push(H[A]),u){let a,b,c,d,e=(g=n,h=p,void 0===(i=D)&&(i=!1),a=ac(g),c=ae(b=ad(ag(g))),d="x"===b?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top",h.reference[c]>h.floating[c]&&(d=am(d)),[d,am(d)]);I.push(H[e[0]],H[e[1]])}if(J=[...J,{placement:n,overflows:I}],!I.every(a=>a<=0)){let a=((null==(d=o.flip)?void 0:d.index)||0)+1,b=G[a];if(b&&("alignment"!==u||B===ag(b)||J.every(a=>ag(a.placement)!==B||a.overflows[0]>0)))return{data:{index:a,overflows:J},reset:{placement:b}};let c=null==(e=J.filter(a=>a.overflows[0]<=0).sort((a,b)=>a.overflows[1]-b.overflows[1])[0])?void 0:e.placement;if(!c)switch(w){case"bestFit":{let a=null==(f=J.filter(a=>{if(F){let b=ag(a.placement);return b===B||"y"===b}return!0}).map(a=>[a.placement,a.overflows.filter(a=>a>0).reduce((a,b)=>a+b,0)]).sort((a,b)=>a[1]-b[1])[0])?void 0:f[0];a&&(c=a);break}case"initialPlacement":c=q}if(n!==c)return{reset:{placement:c}}}return{}}},options:[j,void 0]},{...{name:"size",options:m=l={...T,apply:({elements:a,rects:b,availableWidth:c,availableHeight:d})=>{let{width:e,height:f}=b.reference,g=a.floating.style;g.setProperty("--radix-popper-available-width",`${c}px`),g.setProperty("--radix-popper-available-height",`${d}px`),g.setProperty("--radix-popper-anchor-width",`${e}px`),g.setProperty("--radix-popper-anchor-height",`${f}px`)}},async fn(a){var b,c;let d,e,{placement:f,rects:g,platform:h,elements:i}=a,{apply:j=()=>{},...k}=aa(m,a),l=await ar(a,k),n=ab(f),o=ac(f),p="y"===ag(f),{width:q,height:r}=g.floating;"top"===n||"bottom"===n?(d=n,e=o===(await (null==h.isRTL?void 0:h.isRTL(i.floating))?"start":"end")?"left":"right"):(e=n,d="end"===o?"top":"bottom");let s=r-l.top-l.bottom,t=q-l.left-l.right,u=V(r-l[d],s),v=V(q-l[e],t),w=!a.middlewareData.shift,x=u,y=v;if(null!=(b=a.middlewareData.shift)&&b.enabled.x&&(y=t),null!=(c=a.middlewareData.shift)&&c.enabled.y&&(x=s),w&&!o){let a=W(l.left,0),b=W(l.right,0),c=W(l.top,0),d=W(l.bottom,0);p?y=q-2*(0!==a||0!==b?a+b:W(l.left,l.right)):x=r-2*(0!==c||0!==d?c+d:W(l.top,l.bottom))}await j({...a,availableWidth:y,availableHeight:x});let z=await h.getDimensions(i.floating);return q!==z.width||r!==z.height?{reset:{rects:!0}}:{}}},options:[l,void 0]},L&&{...{name:"arrow",options:p=n={element:L,padding:x},fn(a){let{element:b,padding:c}="function"==typeof p?p(a):p;return b&&({}).hasOwnProperty.call(b,"current")?null!=b.current?a4({element:b.current,padding:c}).fn(a):{}:b?a4({element:b,padding:c}).fn(a):{}}},options:[n,void 0]},bu({arrowWidth:O,arrowHeight:P}),C&&{...{name:"hide",options:r=q={strategy:"referenceHidden",...T},async fn(a){let{rects:b}=a,{strategy:c="referenceHidden",...d}=aa(r,a);switch(c){case"referenceHidden":{let c=as(await ar(a,{...d,elementContext:"reference"}),b.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:at(c)}}}case"escaped":{let c=as(await ar(a,{...d,altBoundary:!0}),b.floating);return{data:{escapedOffsets:c,escaped:at(c)}}}default:return{}}}},options:[q,void 0]}]}),[af,an]=bv(Z),ao=(0,bb.useCallbackRef)(E);(0,bc.useLayoutEffect)(()=>{$&&ao?.()},[$,ao]);let ap=_.arrow?.x,aw=_.arrow?.y,ax=_.arrow?.centerOffset!==0,[az,aA]=d.useState();return(0,bc.useLayoutEffect)(()=>{H&&aA(window.getComputedStyle(H).zIndex)},[H]),(0,b.jsx)("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:$?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:az,"--radix-popper-transform-origin":[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:(0,b.jsx)(bn,{scope:s,placedSide:af,onArrowChange:M,arrowX:ap,arrowY:aw,shouldHideArrow:ax,children:(0,b.jsx)(a9.Primitive.div,{"data-side":af,"data-align":an,...F,ref:J,style:{...F.style,animation:$?void 0:"none"}})})})});bp.displayName=bm;var bq="PopperArrow",br={top:"bottom",right:"left",bottom:"top",left:"right"},bs=d.forwardRef(function(a,c){let{__scopePopper:d,...e}=a,f=bo(bq,d),g=br[f.placedSide];return(0,b.jsx)("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[g]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:(0,b.jsx)(ba,{...e,ref:c,style:{...e.style,display:"block"}})})});function bt(a){return null!==a}bs.displayName=bq;var bu=a=>({name:"transformOrigin",options:a,fn(b){let{placement:c,rects:d,middlewareData:e}=b,f=e.arrow?.centerOffset!==0,g=f?0:a.arrowWidth,h=f?0:a.arrowHeight,[i,j]=bv(c),k={start:"0%",center:"50%",end:"100%"}[j],l=(e.arrow?.x??0)+g/2,m=(e.arrow?.y??0)+h/2,n="",o="";return"bottom"===i?(n=f?k:`${l}px`,o=`${-h}px`):"top"===i?(n=f?k:`${l}px`,o=`${d.floating.height+h}px`):"right"===i?(n=`${-h}px`,o=f?k:`${m}px`):"left"===i&&(n=`${d.floating.width+h}px`,o=f?k:`${m}px`),{data:{x:n,y:o}}}});function bv(a){let[b,c="center"]=a.split("-");return[b,c]}var bw=a.i(39710),bx=a.i(64527),by=a.i(5160),bz=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});d.forwardRef((a,c)=>(0,b.jsx)(a9.Primitive.span,{...a,ref:c,style:{...bz,...a.style}})).displayName="VisuallyHidden";var bA=a.i(16164),bB=a.i(75274),bC=[" ","Enter","ArrowUp","ArrowDown"],bD=[" ","Enter"],bE="Select",[bF,bG,bH]=function(a){let c=a+"CollectionProvider",[e,f]=(0,J.createContextScope)(c),[g,h]=e(c,{collectionRef:{current:null},itemMap:new Map}),i=a=>{let{scope:c,children:e}=a,f=d.default.useRef(null),h=d.default.useRef(new Map).current;return(0,b.jsx)(g,{scope:c,itemMap:h,collectionRef:f,children:e})};i.displayName=c;let j=a+"CollectionSlot",k=(0,L.createSlot)(j),l=d.default.forwardRef((a,c)=>{let{scope:d,children:e}=a,f=h(j,d),g=(0,K.useComposedRefs)(c,f.collectionRef);return(0,b.jsx)(k,{ref:g,children:e})});l.displayName=j;let m=a+"CollectionItemSlot",n="data-radix-collection-item",o=(0,L.createSlot)(m),p=d.default.forwardRef((a,c)=>{let{scope:e,children:f,...g}=a,i=d.default.useRef(null),j=(0,K.useComposedRefs)(c,i),k=h(m,e);return d.default.useEffect(()=>(k.itemMap.set(i,{ref:i,...g}),()=>void k.itemMap.delete(i))),(0,b.jsx)(o,{...{[n]:""},ref:j,children:f})});return p.displayName=m,[{Provider:i,Slot:l,ItemSlot:p},function(b){let c=h(a+"CollectionConsumer",b);return d.default.useCallback(()=>{let a=c.collectionRef.current;if(!a)return[];let b=Array.from(a.querySelectorAll(`[${n}]`));return Array.from(c.itemMap.values()).sort((a,c)=>b.indexOf(a.ref.current)-b.indexOf(c.ref.current))},[c.collectionRef,c.itemMap])},f]}(bE),[bI,bJ]=(0,J.createContextScope)(bE,[bH,bg]),bK=bg(),[bL,bM]=bI(bE),[bN,bO]=bI(bE),bP=a=>{let c,{__scopeSelect:e,children:f,open:g,defaultOpen:h,onOpenChange:i,value:j,defaultValue:k,onValueChange:l,dir:m,name:n,autoComplete:o,disabled:p,required:q,form:r}=a,s=bK(e),[t,u]=d.useState(null),[v,w]=d.useState(null),[x,y]=d.useState(!1),z=(c=d.useContext(P),m||c||"ltr"),[A,B]=(0,bx.useControllableState)({prop:g,defaultProp:h??!1,onChange:i,caller:bE}),[C,D]=(0,bx.useControllableState)({prop:j,defaultProp:k,onChange:l,caller:bE}),E=d.useRef(null),F=!t||r||!!t.closest("form"),[G,H]=d.useState(new Set),I=Array.from(G).map(a=>a.props.value).join(";");return(0,b.jsx)(bj,{...s,children:(0,b.jsxs)(bL,{required:q,scope:e,trigger:t,onTriggerChange:u,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:x,onValueNodeHasChildrenChange:y,contentId:(0,T.useId)(),value:C,onValueChange:D,open:A,onOpenChange:B,dir:z,triggerPointerDownPosRef:E,disabled:p,children:[(0,b.jsx)(bF.Provider,{scope:e,children:(0,b.jsx)(bN,{scope:a.__scopeSelect,onNativeOptionAdd:d.useCallback(a=>{H(b=>new Set(b).add(a))},[]),onNativeOptionRemove:d.useCallback(a=>{H(b=>{let c=new Set(b);return c.delete(a),c})},[]),children:f})}),F?(0,b.jsxs)(co,{"aria-hidden":!0,required:q,tabIndex:-1,name:n,autoComplete:o,value:C,onChange:a=>D(a.target.value),disabled:p,form:r,children:[void 0===C?(0,b.jsx)("option",{value:""}):null,Array.from(G)]},I):null]})})};bP.displayName=bE;var bQ="SelectTrigger",bR=d.forwardRef((a,c)=>{let{__scopeSelect:e,disabled:f=!1,...g}=a,h=bK(e),i=bM(bQ,e),j=i.disabled||f,k=(0,K.useComposedRefs)(c,i.onTriggerChange),l=bG(e),m=d.useRef("touch"),[n,o,p]=cq(a=>{let b=l().filter(a=>!a.disabled),c=b.find(a=>a.value===i.value),d=cr(b,a,c);void 0!==d&&i.onValueChange(d.value)}),q=a=>{j||(i.onOpenChange(!0),p()),a&&(i.triggerPointerDownPosRef.current={x:Math.round(a.pageX),y:Math.round(a.pageY)})};return(0,b.jsx)(bl,{asChild:!0,...h,children:(0,b.jsx)(a9.Primitive.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:j,"data-disabled":j?"":void 0,"data-placeholder":cp(i.value)?"":void 0,...g,ref:k,onClick:(0,I.composeEventHandlers)(g.onClick,a=>{a.currentTarget.focus(),"mouse"!==m.current&&q(a)}),onPointerDown:(0,I.composeEventHandlers)(g.onPointerDown,a=>{m.current=a.pointerType;let b=a.target;b.hasPointerCapture(a.pointerId)&&b.releasePointerCapture(a.pointerId),0===a.button&&!1===a.ctrlKey&&"mouse"===a.pointerType&&(q(a),a.preventDefault())}),onKeyDown:(0,I.composeEventHandlers)(g.onKeyDown,a=>{let b=""!==n.current;a.ctrlKey||a.altKey||a.metaKey||1!==a.key.length||o(a.key),(!b||" "!==a.key)&&bC.includes(a.key)&&(q(),a.preventDefault())})})})});bR.displayName=bQ;var bS="SelectValue",bT=d.forwardRef((a,c)=>{let{__scopeSelect:d,className:e,style:f,children:g,placeholder:h="",...i}=a,j=bM(bS,d),{onValueNodeHasChildrenChange:k}=j,l=void 0!==g,m=(0,K.useComposedRefs)(c,j.onValueNodeChange);return(0,bc.useLayoutEffect)(()=>{k(l)},[k,l]),(0,b.jsx)(a9.Primitive.span,{...i,ref:m,style:{pointerEvents:"none"},children:cp(j.value)?(0,b.jsx)(b.Fragment,{children:h}):g})});bT.displayName=bS;var bU=d.forwardRef((a,c)=>{let{__scopeSelect:d,children:e,...f}=a;return(0,b.jsx)(a9.Primitive.span,{"aria-hidden":!0,...f,ref:c,children:e||"▼"})});bU.displayName="SelectIcon";var bV=a=>(0,b.jsx)(bw.Portal,{asChild:!0,...a});bV.displayName="SelectPortal";var bW="SelectContent",bX=d.forwardRef((a,c)=>{let e=bM(bW,a.__scopeSelect),[f,g]=d.useState();return((0,bc.useLayoutEffect)(()=>{g(new DocumentFragment)},[]),e.open)?(0,b.jsx)(b_,{...a,ref:c}):f?o.createPortal((0,b.jsx)(bY,{scope:a.__scopeSelect,children:(0,b.jsx)(bF.Slot,{scope:a.__scopeSelect,children:(0,b.jsx)("div",{children:a.children})})}),f):null});bX.displayName=bW;var[bY,bZ]=bI(bW),b$=(0,L.createSlot)("SelectContent.RemoveScroll"),b_=d.forwardRef((a,c)=>{let{__scopeSelect:e,position:f="item-aligned",onCloseAutoFocus:g,onEscapeKeyDown:h,onPointerDownOutside:i,side:j,sideOffset:k,align:l,alignOffset:m,arrowPadding:n,collisionBoundary:o,collisionPadding:p,sticky:q,hideWhenDetached:r,avoidCollisions:s,...t}=a,u=bM(bW,e),[v,w]=d.useState(null),[x,y]=d.useState(null),z=(0,K.useComposedRefs)(c,a=>w(a)),[A,B]=d.useState(null),[C,D]=d.useState(null),E=bG(e),[F,G]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(v)return(0,bA.hideOthers)(v)},[v]),(0,R.useFocusGuards)();let J=d.useCallback(a=>{let[b,...c]=E().map(a=>a.ref.current),[d]=c.slice(-1),e=document.activeElement;for(let c of a)if(c===e||(c?.scrollIntoView({block:"nearest"}),c===b&&x&&(x.scrollTop=0),c===d&&x&&(x.scrollTop=x.scrollHeight),c?.focus(),document.activeElement!==e))return},[E,x]),L=d.useCallback(()=>J([A,v]),[J,A,v]);d.useEffect(()=>{F&&L()},[F,L]);let{onOpenChange:M,triggerPointerDownPosRef:N}=u;d.useEffect(()=>{if(v){let a={x:0,y:0},b=b=>{a={x:Math.abs(Math.round(b.pageX)-(N.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(N.current?.y??0))}},c=c=>{a.x<=10&&a.y<=10?c.preventDefault():v.contains(c.target)||M(!1),document.removeEventListener("pointermove",b),N.current=null};return null!==N.current&&(document.addEventListener("pointermove",b),document.addEventListener("pointerup",c,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",c,{capture:!0})}}},[v,M,N]),d.useEffect(()=>{let a=()=>M(!1);return window.addEventListener("blur",a),window.addEventListener("resize",a),()=>{window.removeEventListener("blur",a),window.removeEventListener("resize",a)}},[M]);let[O,P]=cq(a=>{let b=E().filter(a=>!a.disabled),c=b.find(a=>a.ref.current===document.activeElement),d=cr(b,a,c);d&&setTimeout(()=>d.ref.current.focus())}),T=d.useCallback((a,b,c)=>{let d=!H.current&&!c;(void 0!==u.value&&u.value===b||d)&&(B(a),d&&(H.current=!0))},[u.value]),U=d.useCallback(()=>v?.focus(),[v]),V=d.useCallback((a,b,c)=>{let d=!H.current&&!c;(void 0!==u.value&&u.value===b||d)&&D(a)},[u.value]),W="popper"===f?b1:b0,X=W===b1?{side:j,sideOffset:k,align:l,alignOffset:m,arrowPadding:n,collisionBoundary:o,collisionPadding:p,sticky:q,hideWhenDetached:r,avoidCollisions:s}:{};return(0,b.jsx)(bY,{scope:e,content:v,viewport:x,onViewportChange:y,itemRefCallback:T,selectedItem:A,onItemLeave:U,itemTextRefCallback:V,focusSelectedItem:L,selectedItemText:C,position:f,isPositioned:F,searchRef:O,children:(0,b.jsx)(bB.RemoveScroll,{as:b$,allowPinchZoom:!0,children:(0,b.jsx)(S.FocusScope,{asChild:!0,trapped:u.open,onMountAutoFocus:a=>{a.preventDefault()},onUnmountAutoFocus:(0,I.composeEventHandlers)(g,a=>{u.trigger?.focus({preventScroll:!0}),a.preventDefault()}),children:(0,b.jsx)(Q.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:i,onFocusOutside:a=>a.preventDefault(),onDismiss:()=>u.onOpenChange(!1),children:(0,b.jsx)(W,{role:"listbox",id:u.contentId,"data-state":u.open?"open":"closed",dir:u.dir,onContextMenu:a=>a.preventDefault(),...t,...X,onPlaced:()=>G(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...t.style},onKeyDown:(0,I.composeEventHandlers)(t.onKeyDown,a=>{let b=a.ctrlKey||a.altKey||a.metaKey;if("Tab"===a.key&&a.preventDefault(),b||1!==a.key.length||P(a.key),["ArrowUp","ArrowDown","Home","End"].includes(a.key)){let b=E().filter(a=>!a.disabled).map(a=>a.ref.current);if(["ArrowUp","End"].includes(a.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(a.key)){let c=a.target,d=b.indexOf(c);b=b.slice(d+1)}setTimeout(()=>J(b)),a.preventDefault()}})})})})})})});b_.displayName="SelectContentImpl";var b0=d.forwardRef((a,c)=>{let{__scopeSelect:e,onPlaced:f,...g}=a,h=bM(bW,e),i=bZ(bW,e),[j,k]=d.useState(null),[l,m]=d.useState(null),n=(0,K.useComposedRefs)(c,a=>m(a)),o=bG(e),p=d.useRef(!1),q=d.useRef(!0),{viewport:r,selectedItem:s,selectedItemText:t,focusSelectedItem:u}=i,v=d.useCallback(()=>{if(h.trigger&&h.valueNode&&j&&l&&r&&s&&t){let a=h.trigger.getBoundingClientRect(),b=l.getBoundingClientRect(),c=h.valueNode.getBoundingClientRect(),d=t.getBoundingClientRect();if("rtl"!==h.dir){let e=d.left-b.left,f=c.left-e,g=a.left-f,h=a.width+g,i=Math.max(h,b.width),k=H(f,[10,Math.max(10,window.innerWidth-10-i)]);j.style.minWidth=h+"px",j.style.left=k+"px"}else{let e=b.right-d.right,f=window.innerWidth-c.right-e,g=window.innerWidth-a.right-f,h=a.width+g,i=Math.max(h,b.width),k=H(f,[10,Math.max(10,window.innerWidth-10-i)]);j.style.minWidth=h+"px",j.style.right=k+"px"}let e=o(),g=window.innerHeight-20,i=r.scrollHeight,k=window.getComputedStyle(l),m=parseInt(k.borderTopWidth,10),n=parseInt(k.paddingTop,10),q=parseInt(k.borderBottomWidth,10),u=m+n+i+parseInt(k.paddingBottom,10)+q,v=Math.min(5*s.offsetHeight,u),w=window.getComputedStyle(r),x=parseInt(w.paddingTop,10),y=parseInt(w.paddingBottom,10),z=a.top+a.height/2-10,A=s.offsetHeight/2,B=m+n+(s.offsetTop+A);if(B<=z){let a=e.length>0&&s===e[e.length-1].ref.current;j.style.bottom="0px";let b=Math.max(g-z,A+(a?y:0)+(l.clientHeight-r.offsetTop-r.offsetHeight)+q);j.style.height=B+b+"px"}else{let a=e.length>0&&s===e[0].ref.current;j.style.top="0px";let b=Math.max(z,m+r.offsetTop+(a?x:0)+A);j.style.height=b+(u-B)+"px",r.scrollTop=B-z+r.offsetTop}j.style.margin="10px 0",j.style.minHeight=v+"px",j.style.maxHeight=g+"px",f?.(),requestAnimationFrame(()=>p.current=!0)}},[o,h.trigger,h.valueNode,j,l,r,s,t,h.dir,f]);(0,bc.useLayoutEffect)(()=>v(),[v]);let[w,x]=d.useState();(0,bc.useLayoutEffect)(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]);let y=d.useCallback(a=>{a&&!0===q.current&&(v(),u?.(),q.current=!1)},[v,u]);return(0,b.jsx)(b2,{scope:e,contentWrapper:j,shouldExpandOnScrollRef:p,onScrollButtonChange:y,children:(0,b.jsx)("div",{ref:k,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:(0,b.jsx)(a9.Primitive.div,{...g,ref:n,style:{boxSizing:"border-box",maxHeight:"100%",...g.style}})})})});b0.displayName="SelectItemAlignedPosition";var b1=d.forwardRef((a,c)=>{let{__scopeSelect:d,align:e="start",collisionPadding:f=10,...g}=a,h=bK(d);return(0,b.jsx)(bp,{...h,...g,ref:c,align:e,collisionPadding:f,style:{boxSizing:"border-box",...g.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});b1.displayName="SelectPopperPosition";var[b2,b3]=bI(bW,{}),b4="SelectViewport",b5=d.forwardRef((a,c)=>{let{__scopeSelect:e,nonce:f,...g}=a,h=bZ(b4,e),i=b3(b4,e),j=(0,K.useComposedRefs)(c,h.onViewportChange),k=d.useRef(0);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:f}),(0,b.jsx)(bF.Slot,{scope:e,children:(0,b.jsx)(a9.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...g,ref:j,style:{position:"relative",flex:1,overflow:"hidden auto",...g.style},onScroll:(0,I.composeEventHandlers)(g.onScroll,a=>{let b=a.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:d}=i;if(d?.current&&c){let a=Math.abs(k.current-b.scrollTop);if(a>0){let d=window.innerHeight-20,e=Math.max(parseFloat(c.style.minHeight),parseFloat(c.style.height));if(e<d){let f=e+a,g=Math.min(d,f),h=f-g;c.style.height=g+"px","0px"===c.style.bottom&&(b.scrollTop=h>0?h:0,c.style.justifyContent="flex-end")}}}k.current=b.scrollTop})})})]})});b5.displayName=b4;var b6="SelectGroup",[b7,b8]=bI(b6);d.forwardRef((a,c)=>{let{__scopeSelect:d,...e}=a,f=(0,T.useId)();return(0,b.jsx)(b7,{scope:d,id:f,children:(0,b.jsx)(a9.Primitive.div,{role:"group","aria-labelledby":f,...e,ref:c})})}).displayName=b6;var b9="SelectLabel";d.forwardRef((a,c)=>{let{__scopeSelect:d,...e}=a,f=b8(b9,d);return(0,b.jsx)(a9.Primitive.div,{id:f.id,...e,ref:c})}).displayName=b9;var ca="SelectItem",[cb,cc]=bI(ca),cd=d.forwardRef((a,c)=>{let{__scopeSelect:e,value:f,disabled:g=!1,textValue:h,...i}=a,j=bM(ca,e),k=bZ(ca,e),l=j.value===f,[m,n]=d.useState(h??""),[o,p]=d.useState(!1),q=(0,K.useComposedRefs)(c,a=>k.itemRefCallback?.(a,f,g)),r=(0,T.useId)(),s=d.useRef("touch"),t=()=>{g||(j.onValueChange(f),j.onOpenChange(!1))};if(""===f)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,b.jsx)(cb,{scope:e,value:f,disabled:g,textId:r,isSelected:l,onItemTextChange:d.useCallback(a=>{n(b=>b||(a?.textContent??"").trim())},[]),children:(0,b.jsx)(bF.ItemSlot,{scope:e,value:f,disabled:g,textValue:m,children:(0,b.jsx)(a9.Primitive.div,{role:"option","aria-labelledby":r,"data-highlighted":o?"":void 0,"aria-selected":l&&o,"data-state":l?"checked":"unchecked","aria-disabled":g||void 0,"data-disabled":g?"":void 0,tabIndex:g?void 0:-1,...i,ref:q,onFocus:(0,I.composeEventHandlers)(i.onFocus,()=>p(!0)),onBlur:(0,I.composeEventHandlers)(i.onBlur,()=>p(!1)),onClick:(0,I.composeEventHandlers)(i.onClick,()=>{"mouse"!==s.current&&t()}),onPointerUp:(0,I.composeEventHandlers)(i.onPointerUp,()=>{"mouse"===s.current&&t()}),onPointerDown:(0,I.composeEventHandlers)(i.onPointerDown,a=>{s.current=a.pointerType}),onPointerMove:(0,I.composeEventHandlers)(i.onPointerMove,a=>{s.current=a.pointerType,g?k.onItemLeave?.():"mouse"===s.current&&a.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,I.composeEventHandlers)(i.onPointerLeave,a=>{a.currentTarget===document.activeElement&&k.onItemLeave?.()}),onKeyDown:(0,I.composeEventHandlers)(i.onKeyDown,a=>{(k.searchRef?.current===""||" "!==a.key)&&(bD.includes(a.key)&&t()," "===a.key&&a.preventDefault())})})})})});cd.displayName=ca;var ce="SelectItemText",cf=d.forwardRef((a,c)=>{let{__scopeSelect:e,className:f,style:g,...h}=a,i=bM(ce,e),j=bZ(ce,e),k=cc(ce,e),l=bO(ce,e),[m,n]=d.useState(null),p=(0,K.useComposedRefs)(c,a=>n(a),k.onItemTextChange,a=>j.itemTextRefCallback?.(a,k.value,k.disabled)),q=m?.textContent,r=d.useMemo(()=>(0,b.jsx)("option",{value:k.value,disabled:k.disabled,children:q},k.value),[k.disabled,k.value,q]),{onNativeOptionAdd:s,onNativeOptionRemove:t}=l;return(0,bc.useLayoutEffect)(()=>(s(r),()=>t(r)),[s,t,r]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a9.Primitive.span,{id:k.textId,...h,ref:p}),k.isSelected&&i.valueNode&&!i.valueNodeHasChildren?o.createPortal(h.children,i.valueNode):null]})});cf.displayName=ce;var cg="SelectItemIndicator",ch=d.forwardRef((a,c)=>{let{__scopeSelect:d,...e}=a;return cc(cg,d).isSelected?(0,b.jsx)(a9.Primitive.span,{"aria-hidden":!0,...e,ref:c}):null});ch.displayName=cg;var ci="SelectScrollUpButton",cj=d.forwardRef((a,c)=>{let e=bZ(ci,a.__scopeSelect),f=b3(ci,a.__scopeSelect),[g,h]=d.useState(!1),i=(0,K.useComposedRefs)(c,f.onScrollButtonChange);return(0,bc.useLayoutEffect)(()=>{if(e.viewport&&e.isPositioned){let a=function(){h(b.scrollTop>0)},b=e.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),g?(0,b.jsx)(cm,{...a,ref:i,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=e;a&&b&&(a.scrollTop=a.scrollTop-b.offsetHeight)}}):null});cj.displayName=ci;var ck="SelectScrollDownButton",cl=d.forwardRef((a,c)=>{let e=bZ(ck,a.__scopeSelect),f=b3(ck,a.__scopeSelect),[g,h]=d.useState(!1),i=(0,K.useComposedRefs)(c,f.onScrollButtonChange);return(0,bc.useLayoutEffect)(()=>{if(e.viewport&&e.isPositioned){let a=function(){let a=b.scrollHeight-b.clientHeight;h(Math.ceil(b.scrollTop)<a)},b=e.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),g?(0,b.jsx)(cm,{...a,ref:i,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=e;a&&b&&(a.scrollTop=a.scrollTop+b.offsetHeight)}}):null});cl.displayName=ck;var cm=d.forwardRef((a,c)=>{let{__scopeSelect:e,onAutoScroll:f,...g}=a,h=bZ("SelectScrollButton",e),i=d.useRef(null),j=bG(e),k=d.useCallback(()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)},[]);return d.useEffect(()=>()=>k(),[k]),(0,bc.useLayoutEffect)(()=>{let a=j().find(a=>a.ref.current===document.activeElement);a?.ref.current?.scrollIntoView({block:"nearest"})},[j]),(0,b.jsx)(a9.Primitive.div,{"aria-hidden":!0,...g,ref:c,style:{flexShrink:0,...g.style},onPointerDown:(0,I.composeEventHandlers)(g.onPointerDown,()=>{null===i.current&&(i.current=window.setInterval(f,50))}),onPointerMove:(0,I.composeEventHandlers)(g.onPointerMove,()=>{h.onItemLeave?.(),null===i.current&&(i.current=window.setInterval(f,50))}),onPointerLeave:(0,I.composeEventHandlers)(g.onPointerLeave,()=>{k()})})});d.forwardRef((a,c)=>{let{__scopeSelect:d,...e}=a;return(0,b.jsx)(a9.Primitive.div,{"aria-hidden":!0,...e,ref:c})}).displayName="SelectSeparator";var cn="SelectArrow";d.forwardRef((a,c)=>{let{__scopeSelect:d,...e}=a,f=bK(d),g=bM(cn,d),h=bZ(cn,d);return g.open&&"popper"===h.position?(0,b.jsx)(bs,{...f,...e,ref:c}):null}).displayName=cn;var co=d.forwardRef(({__scopeSelect:a,value:c,...e},f)=>{let g=d.useRef(null),h=(0,K.useComposedRefs)(f,g),i=(0,by.usePrevious)(c);return d.useEffect(()=>{let a=g.current;if(!a)return;let b=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(i!==c&&b){let d=new Event("change",{bubbles:!0});b.call(a,c),a.dispatchEvent(d)}},[i,c]),(0,b.jsx)(a9.Primitive.select,{...e,style:{...bz,...e.style},ref:h,defaultValue:c})});function cp(a){return""===a||void 0===a}function cq(a){let b=(0,bb.useCallbackRef)(a),c=d.useRef(""),e=d.useRef(0),f=d.useCallback(a=>{let d=c.current+a;b(d),function a(b){c.current=b,window.clearTimeout(e.current),""!==b&&(e.current=window.setTimeout(()=>a(""),1e3))}(d)},[b]),g=d.useCallback(()=>{c.current="",window.clearTimeout(e.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(e.current),[]),[c,f,g]}function cr(a,b,c){var d,e;let f=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,g=c?a.indexOf(c):-1,h=(d=a,e=Math.max(g,0),d.map((a,b)=>d[(e+b)%d.length]));1===f.length&&(h=h.filter(a=>a!==c));let i=h.find(a=>a.textValue.toLowerCase().startsWith(f.toLowerCase()));return i!==c?i:void 0}co.displayName="SelectBubbleInput";var cs=a.i(35497);let ct=(0,e.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),cu=(0,e.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function cv({...a}){return(0,b.jsx)(bP,{"data-slot":"select",...a})}function cw({...a}){return(0,b.jsx)(bT,{"data-slot":"select-value",...a})}function cx({className:a,size:c="default",children:d,...e}){return(0,b.jsxs)(bR,{"data-slot":"select-trigger","data-size":c,className:(0,i.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),...e,children:[d,(0,b.jsx)(bU,{asChild:!0,children:(0,b.jsx)(ct,{className:"size-4 opacity-50"})})]})}function cy({className:a,children:c,position:d="popper",align:e="center",...f}){return(0,b.jsx)(bV,{children:(0,b.jsxs)(bX,{"data-slot":"select-content",className:(0,i.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===d&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:d,align:e,...f,children:[(0,b.jsx)(cA,{}),(0,b.jsx)(b5,{className:(0,i.cn)("p-1","popper"===d&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:c}),(0,b.jsx)(cB,{})]})})}function cz({className:a,children:c,...d}){return(0,b.jsxs)(cd,{"data-slot":"select-item",className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",a),...d,children:[(0,b.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,b.jsx)(ch,{children:(0,b.jsx)(cs.CheckIcon,{className:"size-4"})})}),(0,b.jsx)(cf,{children:c})]})}function cA({className:a,...c}){return(0,b.jsx)(cj,{"data-slot":"select-scroll-up-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",a),...c,children:(0,b.jsx)(cu,{className:"size-4"})})}function cB({className:a,...c}){return(0,b.jsx)(cl,{"data-slot":"select-scroll-down-button",className:(0,i.cn)("flex cursor-default items-center justify-center py-1",a),...c,children:(0,b.jsx)(ct,{className:"size-4"})})}let cC=(0,e.default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);function cD({className:a,...c}){return(0,b.jsx)(cC,{role:"status","aria-label":"Loading",className:(0,i.cn)("size-4 animate-spin",a),...c})}function cE({isOpen:a,onClose:e,userId:h}){let i,j,o,p=(0,c.useRouter)(),q=(0,c.useSearchParams)(),r=(0,d.useId)(),t=(0,d.useId)(),u=(0,d.useId)(),v=(i=q.get("type"),j=q.get("team"),o=q.get("project"),i?o?"options":j?"project":"team":"type"),[w,x]=(0,d.useState)(v),[y,z]=(0,d.useState)(q.get("type")||""),[A,B]=(0,d.useState)([]),[C,D]=(0,d.useState)(null),[E,F]=(0,d.useState)([]),[H,I]=(0,d.useState)(null),[J,K]=(0,d.useState)(!1),[L,M]=(0,d.useState)(!1),[N,O]=(0,d.useState)(null),[P,Q]=(0,d.useState)(""),[R,S]=(0,d.useState)(null),[T,U]=(0,d.useState)(null),[V,W]=(0,d.useState)(null),[X,Y]=(0,d.useState)("main"),[Z,$]=(0,d.useState)(!0),[_,aa]=(0,d.useState)(""),[ab,ac]=(0,d.useState)(!1),[ad,ae]=(0,d.useState)(!1),[af,ag]=(0,d.useState)([]),[ah,ai]=(0,d.useState)(!1),[aj,ak]=(0,d.useState)(!1),al=(0,d.useRef)(null);async function am(){K(!0);try{let a=await fetch("/api/teams"),b=await a.json();if(b.success){let a=[...b.teams].sort((a,b)=>a.isPersonal&&!b.isPersonal?-1:!a.isPersonal&&b.isPersonal?1:a.name.localeCompare(b.name,void 0,{sensitivity:"base"}));B(a)}}catch(a){console.error("Failed to load teams:",a)}finally{K(!1)}}async function an(a,b){ai(!0),ak(!1);try{let c=b.isPersonal?`/api/projects/branches?projectId=${a.id}`:`/api/projects/branches?projectId=${a.id}&teamId=${b.id}`;console.log("Fetching branches from:",c);let d=await fetch(c),e=await d.json();if(console.log("Branches response:",e),e.success&&e.branches){if(ag(e.branches),e.branches.length>0&&!e.branches.some(a=>a.name===X)){let a=e.branches.find(a=>"main"===a.name);Y(a?.name||e.branches[0].name)}}else ak(!0),console.warn("Failed to fetch branches:",e.error)}catch(a){console.error("Failed to load branches:",a),ak(!0)}finally{ai(!1)}}async function ao(a){M(!0),O(null);try{let b=a.isPersonal?"/api/projects":`/api/projects?teamId=${a.id}`;console.log("Fetching projects from:",b);let c=await fetch(b),d=await c.json();if(console.log("Projects response:",d),d.success)F(d.projects),0===d.projects.length&&O("No projects found for this account");else{let a=`Failed to fetch projects: ${d.error||"Unknown error"}`;console.error(a),O(a)}}catch(b){let a=`Failed to load projects: ${b instanceof Error?b.message:String(b)}`;console.error(a,b),O(a)}finally{M(!1)}}async function ap(){if(console.log("[Start Workflow] Function called"),console.log("[Start Workflow] selectedProject:",H),console.log("[Start Workflow] selectedTeam:",C),!H||!C)return void console.log("[Start Workflow] Missing project or team, returning");x("running"),Q("Starting workflow...");try{let a,b;console.log("[Start Workflow] latestDeployments:",H.latestDeployments);let c=H.latestDeployments[0];if(!c)throw Error("No deployments found for this project");let d=`https://${c.url}`;console.log("[Start Workflow] devUrl:",d),H.link?.org&&H.link?.repo&&(a=H.link.org,b=H.link.repo);let e={devUrl:d,projectName:H.name,userId:h,bypassToken:_};a&&b&&(e.repoUrl=`https://github.com/${a}/${b}`,e.repoBranch=c.gitSource?.sha||X||"main",console.log(`[Start Workflow] Using git reference: ${e.repoBranch} (${c.gitSource?.sha?"SHA from deployment":"branch name"})`)),Z&&a&&b&&(e.repoOwner=a,e.repoName=b,e.baseBranch=X),Q("Starting workflow...");let f="https://d3k-mcp.vercel.sh/api/cloud/start-fix";console.log("[Start Workflow] API URL:",f),console.log("[Start Workflow] Request body:",e);let g=new AbortController,i=setTimeout(()=>g.abort(),6e5);try{console.log("[Start Workflow] Making fetch request..."),console.log("[Start Workflow] About to stringify body...");let a=JSON.stringify(e);console.log("[Start Workflow] Body stringified successfully, length:",a.length),console.log("[Start Workflow] Calling fetch with URL:",f);let b=await fetch("/api/auth/token"),c=(await b.json()).accessToken,d={"Content-Type":"application/json"};c&&(d.Authorization=`Bearer ${c}`);let h=await fetch(f,{method:"POST",headers:d,body:a,credentials:"include",signal:g.signal});if(console.log("[Start Workflow] Fetch completed, status:",h.status),clearTimeout(i),!h.ok){let a=await h.text();throw Error(`API returned ${h.status}: ${a}`)}let j=await h.json();j.runId&&U(j.runId),j.success?(S(j),Q("Workflow completed successfully!")):Q(`Workflow failed: ${j.error}`)}catch(a){if(clearTimeout(i),a instanceof Error&&"AbortError"===a.name)throw Error("Workflow timed out after 10 minutes");throw a}}catch(b){console.error("[Start Workflow] OUTER ERROR caught:",b),console.error("[Start Workflow] Error type:",b?.constructor?.name),console.error("[Start Workflow] Error stack:",b instanceof Error?b.stack:"no stack");let a=b instanceof Error?b.message:String(b);b instanceof TypeError&&"Failed to fetch"===a&&(a="Network error: Unable to connect to API. This might be a CORS issue, network problem, or Content Security Policy blocking the request."),Q(`Error: ${a}`)}}return((0,d.useEffect)(()=>{if(!a||"running"===w)return;let b=q.get("type"),c=q.get("team"),d=q.get("project");b&&b!==y&&z(b);let e=b?d?"options":c?"project":"team":"type";e!==w&&x(e),b||(z(""),D(null),I(null))},[a,q,w,y]),(0,d.useEffect)(()=>{a||(x("type"),z(""),D(null),I(null),F([]),B([]),Q(""),S(null),U(null),W(null),Y("main"),$(!0),aa(""),ae(!1),O(null),ag([]),ai(!1),ak(!1),al.current=null,p.replace("/workflows",{scroll:!1}))},[a,p]),(0,d.useEffect)(()=>{["team","project","options"].includes(w)&&0===A.length&&!J&&am()},[w,A.length,J]),(0,d.useEffect)(()=>{let a=q.get("team");if(a&&A.length>0&&(!C||C.id!==a)){let b=A.find(b=>b.id===a);b&&D(b)}},[A,q,C]),(0,d.useEffect)(()=>{C&&!L&&al.current!==C.id&&(al.current=C.id,ao(C))},[C,L]),(0,d.useEffect)(()=>{H&&C&&"options"===w&&0===af.length&&!ah&&!aj&&an(H,C)},[H,C,w,af.length,ah,aj]),(0,d.useEffect)(()=>{if(!h||"running"!==w)return;let a=async()=>{try{let a=await fetch(`https://d3k-mcp.vercel.sh/api/workflows?userId=${h}`);if(!a.ok)return;let b=await a.json();if(!b.success||!b.runs)return;let c=null;if(T?c=b.runs.find(a=>a.id===T):H&&(c=b.runs.find(a=>a.projectName===H.name&&"running"===a.status))&&U(c.id),!c)return;c.currentStep&&Q(c.currentStep),c.sandboxUrl&&W(c.sandboxUrl),"done"===c.status?(Q("Workflow completed successfully!"),S({success:!0,blobUrl:c.reportBlobUrl,runId:c.id,pr:c.prUrl?{prUrl:c.prUrl}:null})):"failure"===c.status&&Q(`Workflow failed: ${c.error||"Unknown error"}`)}catch(a){console.error("[Poll Status] Error:",a)}},b=setInterval(a,3e3);return a(),()=>clearInterval(b)},[T,h,w]),(0,d.useEffect)(()=>{!async function(){if(console.log("[Bypass Token] useEffect triggered - step:",w,"selectedProject:",H?.name),!H)return console.log("[Bypass Token] No selected project, skipping check");if("options"!==w)return console.log("[Bypass Token] Not on options step, skipping check");let a=`d3k_bypass_token_${H.id}`,b=localStorage.getItem(a);b&&(console.log("[Bypass Token] Found stored token for project",H.id),aa(b));let c=H.latestDeployments[0];if(!c)return console.log("[Bypass Token] No latest deployment, skipping check");ac(!0),console.log("[Bypass Token] Checking deployment protection...");try{let a=`https://${c.url}`;console.log("[Bypass Token] Checking URL:",a);let b=await fetch("/api/projects/check-protection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),d=await b.json();console.log("[Bypass Token] Protection check result:",d),ae(d.isProtected)}catch(a){console.error("[Bypass Token] Failed to check deployment protection:",a),ae(!1)}finally{ac(!1)}}()},[H,w]),(0,d.useEffect)(()=>{let a=q.get("project");if(a&&E.length>0&&(!H||H.id!==a)){let b=E.find(b=>b.id===a);b&&I(b)}},[E,q,H]),a)?(0,b.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,b.jsx)("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[90vh] overflow-y-auto",children:(0,b.jsxs)("div",{className:"p-6",children:[(0,b.jsxs)("div",{className:"flex justify-between items-start mb-6",children:[(0,b.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"New d3k Workflow"}),(0,b.jsx)("button",{type:"button",onClick:e,className:"text-gray-400 hover:text-gray-600","aria-label":"Close modal",children:(0,b.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,b.jsxs)("div",{className:"mb-8",children:[(0,b.jsx)("div",{className:"flex items-center",children:["type","team","project","options","running"].map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center flex-1",children:[(0,b.jsx)("div",{className:`w-8 h-8 rounded-full flex items-center justify-center ${w===a?"bg-blue-600 text-white":["type","team","project","options","running"].indexOf(w)>["type","team","project","options","running"].indexOf(a)?"bg-green-600 text-white":"bg-gray-200 text-gray-600"}`,children:c+1}),c<4&&(0,b.jsx)("div",{className:"flex-1 mx-2",children:(0,b.jsx)(G,{value:100*(["type","team","project","options","running"].indexOf(w)>c),className:"h-1"})})]},a))}),(0,b.jsx)("div",{className:"flex items-center mt-2",children:["Type","Team","Project","Options","Run"].map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center flex-1",children:[(0,b.jsx)("span",{className:"text-xs text-gray-600 w-8 text-center",children:a}),c<4&&(0,b.jsx)("div",{className:"flex-1 mx-2"})]},a))})]}),"type"===w&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Select Workflow Type"}),(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)(g.default,{href:"/workflows/new?type=cloud-fix",className:"block w-full p-4 border-2 border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-50 text-left transition-colors",children:[(0,b.jsx)("div",{className:"font-semibold",children:"CLS Detection & Fix"}),(0,b.jsx)("div",{className:"text-sm text-gray-600 mt-1",children:"Analyze deployment logs for errors and generate fix proposals"})]}),(0,b.jsxs)(g.default,{href:"/workflows/new?type=next-16-migration",className:"block w-full p-4 border-2 border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-50 text-left transition-colors",children:[(0,b.jsx)("div",{className:"font-semibold",children:"Next.js 16 Migration"}),(0,b.jsx)("div",{className:"text-sm text-gray-600 mt-1",children:"Upgrade your project to Next.js 16 with automated codemods and fixes"})]})]}),(0,b.jsx)("div",{className:"mt-4 h-10","aria-hidden":"true"})]}),"team"===w&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Select Team"}),J?(0,b.jsx)("div",{className:"text-center py-8 text-gray-500",children:"Loading teams..."}):(0,b.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:A.map(a=>(0,b.jsxs)(g.default,{href:`/workflows/new?type=${y}&team=${a.id}`,className:"block w-full p-4 border-2 border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-50 text-left transition-colors",children:[(0,b.jsx)("div",{className:"font-semibold",children:a.name}),(0,b.jsxs)("div",{className:"text-sm text-gray-600",children:[a.isPersonal?"Personal Account":"Team"," • ",a.id]})]},a.id))}),(0,b.jsx)(g.default,{href:"/workflows/new",className:"mt-4 inline-block px-4 py-2 text-gray-600 hover:text-gray-800",children:"← Back"})]}),"project"===w&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Select Project"}),C&&(0,b.jsxs)("div",{className:"mb-4 text-sm text-gray-600",children:["Team: ",(0,b.jsx)("span",{className:"font-semibold",children:C.name})]}),N&&(0,b.jsxs)(k,{variant:"destructive",className:"mb-4",children:[(0,b.jsx)(f,{className:"h-4 w-4"}),(0,b.jsx)(l,{children:"Error"}),(0,b.jsx)(m,{children:N})]}),L?(0,b.jsx)("div",{className:"text-center py-8 text-gray-500",children:"Loading projects..."}):0===E.length?(0,b.jsx)("div",{className:"text-center py-8 text-gray-500",children:N?"Unable to load projects":"No projects found"}):(0,b.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:E.map(a=>(0,b.jsxs)(g.default,{href:`/workflows/new?type=${y}&team=${C?.id}&project=${a.id}`,className:"block w-full p-4 border-2 border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-50 text-left transition-colors",children:[(0,b.jsx)("div",{className:"font-semibold",children:a.name}),(0,b.jsxs)("div",{className:"text-sm text-gray-600 mt-1",children:[a.framework&&(0,b.jsxs)("span",{className:"mr-2",children:["Framework: ",a.framework]}),a.latestDeployments[0]&&(0,b.jsxs)("span",{children:["Latest: ",a.latestDeployments[0].url]})]})]},a.id))}),(0,b.jsx)(g.default,{href:`/workflows/new?type=${y}`,className:"mt-4 inline-block px-4 py-2 text-gray-600 hover:text-gray-800",children:"← Back"})]}),"options"===w&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Configure Options"}),H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"mb-6 p-4 bg-gray-50 rounded-lg",children:[(0,b.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Selected Project:"}),(0,b.jsx)("div",{className:"font-semibold",children:H.name})]}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,b.jsx)(n.Checkbox,{id:t,checked:Z,onCheckedChange:a=>$(!0===a)}),(0,b.jsx)(s,{htmlFor:t,className:"text-sm font-normal cursor-pointer",children:"Automatically create GitHub PR with fixes"})]}),Z&&H?.link?.repo&&(0,b.jsxs)("div",{children:[(0,b.jsx)(s,{htmlFor:r,className:"mb-2",children:"Base Branch"}),ah?(0,b.jsx)("div",{className:"text-sm text-gray-500 py-2",children:"Loading branches..."}):af.length>0?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(cv,{value:X,onValueChange:Y,children:[(0,b.jsx)(cx,{id:r,className:"w-full",children:(0,b.jsx)(cw,{placeholder:"Select a branch"})}),(0,b.jsx)(cy,{children:af.map(a=>(0,b.jsxs)(cz,{value:a.name,children:[a.name," (deployed"," ",new Date(a.lastDeployment.createdAt).toLocaleDateString(),")"]},a.name))})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Showing branches with recent deployments (last ",af.length," branch",1!==af.length?"es":"",")"]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("input",{type:"text",id:r,value:X,onChange:a=>Y(a.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md",placeholder:"main"}),aj&&(0,b.jsx)("p",{className:"text-xs text-amber-600 mt-1",children:"Unable to load branches automatically. Please enter the branch name manually."})]})]}),Z&&!H?.link?.repo&&(0,b.jsx)("div",{className:"text-sm text-amber-600",children:"This project is not connected to a GitHub repository. PRs cannot be created automatically."}),ab&&(0,b.jsx)("div",{className:"text-sm text-gray-500",children:"Checking deployment protection..."}),ad&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("label",{htmlFor:u,className:"block text-sm font-medium text-gray-700 mb-1",children:["Deployment Protection Bypass Token",(0,b.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,b.jsx)("input",{type:"text",id:u,value:_,onChange:a=>{let b=a.target.value;if(aa(b),H&&b){let a=`d3k_bypass_token_${H.id}`;localStorage.setItem(a,b),console.log("[Bypass Token] Saved token to localStorage for project",H.id)}},className:"w-full px-3 py-2 border border-gray-300 rounded-md font-mono text-sm",placeholder:"Enter your 32-character bypass token",required:!0}),(0,b.jsxs)("p",{className:"mt-1 text-xs text-gray-500",children:["This deployment is protected. Get your bypass token from"," ",C&&H?(0,b.jsx)("a",{href:`https://vercel.com/${C.slug}/${H.name}/settings/deployment-protection#protection-bypass-for-automation`,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:"Project Settings → Deployment Protection"}):(0,b.jsx)("a",{href:"https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/protection-bypass-automation",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:"Vercel Dashboard → Project Settings → Deployment Protection"})]})]})]}),(0,b.jsxs)("div",{className:"flex gap-3 mt-6",children:[(0,b.jsx)(g.default,{href:`/workflows/new?type=${y}&team=${C?.id}`,className:"px-4 py-2 text-gray-600 hover:text-gray-800",children:"← Back"}),(0,b.jsx)("button",{type:"button",onClick:ap,disabled:ad&&!_,className:"flex-1 px-6 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Start Workflow"})]})]}):(0,b.jsxs)("div",{className:"text-center py-8 text-gray-500",children:[(0,b.jsx)(cD,{className:"mx-auto mb-2"}),"Loading project details..."]})]}),"running"===w&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Workflow Status"}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)(k,{variant:P.includes("Error")||P.includes("failed")?"destructive":"default",className:P.includes("Error")||P.includes("failed")?"":"bg-blue-50 border-blue-200",children:[P.includes("Error")||P.includes("failed")?(0,b.jsx)(f,{className:"h-4 w-4"}):!P.includes("completed successfully")&&(0,b.jsx)(cD,{className:"h-4 w-4"}),(0,b.jsx)(m,{className:P.includes("Error")||P.includes("failed")?"":"text-blue-900",children:P})]}),V&&!R&&(0,b.jsx)(k,{className:"bg-yellow-50 border-yellow-200",children:(0,b.jsxs)(m,{className:"text-yellow-900",children:[(0,b.jsx)("span",{className:"font-medium",children:"Sandbox:"})," ",(0,b.jsx)("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline font-mono text-sm",children:V})]})}),R&&(0,b.jsxs)("div",{className:"space-y-3",children:[R.blobUrl&&R.runId&&(0,b.jsxs)(k,{className:"bg-green-50 border-green-200",children:[(0,b.jsx)(l,{className:"text-green-900",children:"Fix Proposal Generated"}),(0,b.jsx)(m,{children:(0,b.jsx)(g.default,{href:`/workflows/${R.runId}/report`,className:"text-primary hover:underline",children:"View Report"})})]}),R.pr?.prUrl&&(0,b.jsxs)(k,{className:"bg-green-50 border-green-200",children:[(0,b.jsx)(l,{className:"text-green-900",children:"GitHub PR Created"}),(0,b.jsx)(m,{children:(0,b.jsx)("a",{href:R.pr.prUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"View Pull Request"})})]})]}),R&&(0,b.jsx)("button",{type:"button",onClick:()=>{e(),p.push("/workflows")},className:"w-full px-6 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700",children:"Done"})]})]})]})})}):null}function cF({user:a}){let e=(0,c.useRouter)();return(0,b.jsx)("div",{children:(0,b.jsx)(d.Suspense,{fallback:(0,b.jsx)("div",{children:"Loading..."}),children:(0,b.jsx)(cE,{isOpen:!0,onClose:()=>{e.push("/workflows")},userId:a.id})})})}a.s(["default",()=>cF],7362)}];
|
|
7
7
|
|
|
8
8
|
//# sourceMappingURL=mcp-server_app_workflows_new_new-workflow-client_tsx_1312c046._.js.map
|