PageSourceSearch

https://algorobot.net/assets/index-A6QpAMo-.js

js algorobot.net collected 2026-10-05 23:18:27 UTC 28,751 bytes, 12 lines download raw bytes

1import{a as r,K as y,I as W,v as N,ar as xe,P as U,J as O,c as S,aI as bt,ak as J,S as H,T as ve,O as ye,ao as Z,ap as mt,H as Ye,aj as qe,a6 as Ze,al as Je,aq as ft,r as D,aJ as pe,ai as ht,_ as xt,a9 as ae,u as Se,a2 as se,o as Ce,t as k,i as u,b as e,w as q,d as Ie,aK as _e,aL as K,aM as vt,aG as Qe,aN as fe,Y,W as R,aO as ne,p as $e,q as yt,a4 as ge,aP as St,aQ as Ct,a8 as It,aR as _t,F as he,aS as He,aT as $t,aU as wt,aV as kt,aW as Rt,aX as At,s as Tt,aY as Dt,aZ as be,C as Pt,z as Et,M as me}from"./index-DKJN2VxA.js";import{d as Lt,g as we,h as ke,F as Mt,c as Ft,a as Xe,b as Bt,u as et,T as G}from"./MKJEDDFV-CtmcrBeq.js";import{P as Re,a as Ae,b as Te,c as Ot}from"./PanelBody-Jn7k0AGP.js";import{E as B,S as te}from"./ErrorToast-_EO7zYtf.js";import{C as tt}from"./ConfirmationModal-C4uHjjUw.js";import{c as Gt}from"./FN6EICGO-xNinxXWy.js";import{c as Vt}from"./index-6bhPgWFP.js";import Nt from"./NotFound-BSyHUCmu.js";import"./PLLNVYER-BZ6cm6vJ.js";var Ut={};xt(Ut,{Description:()=>ke,ErrorMessage:()=>we,Item:()=>nt,ItemControl:()=>De,ItemDescription:()=>Pe,ItemIndicator:()=>Ee,ItemInput:()=>at,ItemLabel:()=>Le,Label:()=>Me,RadioGroup:()=>ce,Root:()=>st,useRadioGroupContext:()=>ie});var rt=ye();function ie(){const t=ve(rt);if(t===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return t}var ot=ye();function Q(){const t=ve(ot);if(t===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return t}function nt(t){const o=et(),s=ie(),n=`${o.generateId("item")}-${Ye()}`,a=W({id:n},t),[l,d]=O(a,["value","disabled","onPointerDown"]),[i,m]=S(),[f,h]=S(),[_,A]=S(),[g,v]=S(),[I,$]=S(!1),M=D(()=>s.isDefaultValue(l.value)),P=D(()=>s.isSelectedValue(l.value)),j=D(()=>l.disabled||o.isDisabled()||!1),X=w=>{Z(w,l.onPointerDown),I()&&w.preventDefault()},z=D(()=>({...o.dataset(),"data-disabled":j()?"":void 0,"data-checked":P()?"":void 0})),b={value:()=>l.value,dataset:z,isDefault:M,isSelected:P,isDisabled:j,inputId:i,labelId:f,descriptionId:_,inputRef:g,select:()=>s.setSelectedValue(l.value),generateId:ht(()=>d.id),registerInput:pe(m),registerLabel:pe(h),registerDescription:pe(A),setIsFocused:$,setInputRef:v};return r(ot.Provider,{value:b,get children(){return r(U,y({as:"div",role:"group",onPointerDown:X},z,d))}})}function De(t){const o=Q(),s=W({id:o.generateId("control")},t),[n,a]=O(s,["onClick","onKeyDown"]);return r(U,y({as:"div",onClick:i=>{Z(i,n.onClick),o.select(),o.inputRef()?.focus()},onKeyDown:i=>{Z(i,n.onKeyDown),i.key===mt.Space&&(o.select(),o.inputRef()?.focus())}},()=>o.dataset(),a))}function Pe(t){const o=Q(),s=W({id:o.generateId("description")},t);return N(()=>xe(o.registerDescription(s.id))),r(U,y({as:"div"},()=>o.dataset(),s))}function Ee(t){const o=Q(),s=W({id:o.generateId("indicator")},t),[n,a]=O(s,["ref","forceMount"]),[l,d]=S(),{present:i}=bt({show:()=>n.forceMount||o.isSelected(),element:()=>l()??null});return r(H,{get when(){return i()},get children(){return r(U,y({as:"div",ref(m){var f=J(d,n.ref);typeof f=="function"&&f(m)}},()=>o.dataset(),a))}})}function at(t){const o=et(),s=ie(),n=Q(),a=W({id:n.generateId("input")},t),[l,d]=O(a,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),i=()=>[l["aria-labelledby"],n.labelId(),l["aria-labelledby"]!=null&&d["aria-label"]!=null?d.id:void 0].filter(Boolean).join(" ")||void 0,m=()=>[l["aria-describedby"],n.descriptionId(),s.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[f,h]=S(!1),_=v=>{if(Z(v,l.onChange),v.stopPropagation(),!f()){s.setSelectedValue(n.value());const I=v.target;I.checked=n.isSelected()}h(!1)},A=v=>{Z(v,l.onFocus),n.setIsFocused(!0)},g=v=>{Z(v,l.onBlur),n.setIsFocused(!1)};return N(Ze([()=>n.isSelected(),()=>n.value()],v=>{if(!v[0]&&v[1]===n.value())return;h(!0);const I=n.inputRef();I?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),I?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),N(()=>xe(n.registerInput(d.id))),r(U,y({as:"input",ref(v){var I=J(n.setInputRef,l.ref);typeof I=="function"&&I(v)},type:"radio",get name(){return o.name()}
1,get value(){return n.value()},get checked(){return n.isSelected()},get required(){return o.isRequired()},get disabled(){return n.isDisabled()},get readonly(){return o.isReadOnly()},get style(){return Je({...ft},l.style)},get"aria-labelledby"(){return i()},get"aria-describedby"(){return m()},onChange:_,onFocus:A,onBlur:g},()=>n.dataset(),d))}function Le(t){const o=Q(),s=W({id:o.generateId("label")},t);return N(()=>xe(o.registerLabel(s.id))),r(U,y({as:"label",get for(){return o.inputId()}},()=>o.dataset(),s))}function Me(t){return r(Lt,y({as:"span"},t))}function st(t){let o;const s=`radiogroup-${Ye()}`,n=W({id:s,orientation:"vertical"},t),[a,l,d]=O(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],Mt),[i,m]=Gt({value:()=>a.value,defaultValue:()=>a.defaultValue,onChange:$=>a.onChange?.($)}),{formControlContext:f}=Ft(l);Xe(()=>o,()=>m(a.defaultValue??""));const h=()=>f.getAriaLabelledBy(qe(l.id),d["aria-label"],a["aria-labelledby"]),_=()=>f.getAriaDescribedBy(a["aria-describedby"]),A=$=>$===t.defaultValue,g=$=>$===i(),I={ariaDescribedBy:_,isDefaultValue:A,isSelectedValue:g,setSelectedValue:$=>{if(!(f.isReadOnly()||f.isDisabled())&&(m($),o))for(const M of o.querySelectorAll("[type='radio']")){const P=M;P.checked=g(P.value)}}};return r(Bt.Provider,{value:f,get children(){return r(rt.Provider,{value:I,get children(){return r(U,y({as:"div",ref($){var M=J(P=>o=P,a.ref);typeof M=="function"&&M($)},role:"radiogroup",get id(){return qe(l.id)},get"aria-invalid"(){return f.validationState()==="invalid"||void 0},get"aria-required"(){return f.isRequired()||void 0},get"aria-disabled"(){return f.isDisabled()||void 0},get"aria-readonly"(){return f.isReadOnly()||void 0},get"aria-orientation"(){return a.orientation},get"aria-labelledby"(){return h()},get"aria-describedby"(){return _()}},()=>f.dataset(),d))}})}})}var ce=Object.assign(st,{Description:ke,ErrorMessage:we,Item:nt,ItemControl:De,ItemDescription:Pe,ItemIndicator:Ee,ItemInput:at,ItemLabel:Le,Label:Me}),zt=k('<button class="flex items-center gap-x-1.5 text-sm font-semibold text-text-secondary transition-colors hover:text-text-primary"><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 16 16"fill=currentColor class="h-4 w-4"><path fill-rule=evenodd d="M14 8a.75.75 0 0 1-.75.75H4.56l3.22 3.22a.75.75 0 1 1-1.06 1.06l-4.5-4.5a.75.75 0 0 1 0-1.06l4.5-4.5a.75.75 0 0 1 1.06 1.06L4.56 7.25H13.25A.75.75 0 0 1 14 8Z"clip-rule=evenodd>'),qt=k('<div class="space-y-8 p-4 sm:p-6"><div class=pt-4><button class="w-full rounded-lg bg-interactive-primary-base px-4 py-3 text-sm sm:text-base font-semibold text-text-on-interactive transition-colors hover:bg-interactive-primary-hover disabled:cursor-not-allowed disabled:bg-surface-secondary disabled:text-text-secondary">'),Ht=k('<div class="p-4 text-text-secondary sm:p-6">');function Kt(t){const o=ae(),s=Se(),n=D(()=>se.find(g=>g.id===t.robotId)),[a,l]=S(""),[d,i]=S(""),[m,f]=S(!1);Ce(()=>{_e(t.robotId,"basic-parameters",1),n()||K(t.robotId,s.getAccessTokenSilently)}),N(()=>{const g=n();g&&(l(g.userGivenName),i(g.description||""))});const h=()=>{vt(t.robotId,"basic-parameters","user_clicked_back"),t.onBack()},_=async()=>{if(!a().trim()||m())return;f(!0);const g={user_given_name:a(),description:d()};try{await Qe(`/user-robots/${t.robotId}`,g,s.getAccessTokenSilently),await K(t.robotId,s.getAccessTokenSilently),fe(t.robotId,"basic-parameters",1),o(`/app/robot-setup/${t.robotId}/assign-account`)}catch(v){const I=Y(v);R.show($=>r(B,y($,{get title(){return e("robotSetup.saveFailedTitle")},description:I}))),ne(t.robotId,"basic-parameters","api_error")}finally{f(!1)}},A=r(Re,{get title(){return e("robotSetup.configTitle")},get description(){return e("robotSetup.configDescription")},get actionComponent(){return(()=>{var g=zt();return g.firstChild,g.$$click=h,u(g,()=>e("robotSetup.backToStrategy"),null),g})()}});return r(Ae,{headerContent:A,get children(){return r(Te,{get children(){return r(H,{get when(){return n()},get fallback(){return(()=>{var g=Ht();return u(g,()=>e("robotSetup.loadingOrNotFound")),g})()},get children(){var g=qt(),v=g.firstChild,I=v.firstChild;return u(g,r(G,{get value(){return a()},onChange:l,class:"flex flex-col gap-2",get children(){return[r(G.Label,{class:"text-sm sm:text-base font-semibold text-text-primary",get children(){return e("robotSetup.nameLabel")}}),r(G.Description,{class:"text-xs sm:text-sm text-text-secondary",get children(){return e("robotSetup.nameDescription")}}),r(G.Input,{get placeholder(){return e("robotSetup.namePlaceholder")},class:"w-full rounded-lg border border-border-primary bg-surface-secondary px-3 py-2 text-text-primary placeholder:text-text-secondary/50 focus:border-text-accent focus:outline-none focus:ring-2 focus:ring-text-accent/50"})]}}),v),u(g,r(G,{get value(){return d()},onChange:i,class:"flex flex-col gap-2",get children(){return[r(G.Label,{class:"text-sm sm:text-base font-semibold text-text-primary",get children(){return e("robotSetup.descriptionLabel")}}),r(G.Description,{class:"text-xs sm:text-sm text-text-secondary",get children(){return e("robotSetup.descriptionDescription")}}),r(G.TextArea,{get placeholder(){return e("robotSetup.descriptionPlaceholder")},class:"w-full min-h-[80px] rounded-lg border border-border-primary bg-surface-secondary px-3 py-2 text-text-primary placeholder:text-text-secondary/50 focus:border-text-accent focus:outline-none focus:ring-2 focus:ring-text-accent/50",autoResize:!0})]}}),v),I.$$click=_,u(I,(()=>{var $=q(()=>!!m());return()=>$()?e("common.saving"):e("robotSetup.saveContinue")})()),Ie(()=>I.disabled=!a().trim()||m()),g}})}})}})}$e(["click"]);var Wt=k('<div class="space-y-8 p-4 sm:p-6"><div class="flex flex-col gap-2"><h3 class="text-base font-semibold text-text-primary"></h3><p class="text-sm text-text-secondary"></p><div class="mt-1 flex flex-col items-center gap-y-3"><textarea class="w-full rounded-lg border border-border-primary bg-surface-secondary px-3 py-2 font-mono text-sm text-text-secondary"rows=6 readonly></textarea><button class="w-full rounded-lg border px-4 py-3 text-base font-semibold transition-colors"></button></div></div><div class="flex flex-col gap-2"><h3 class="text-base font-semibold text-text-primary"></h3><p class="text-sm text-text-secondary"></p><div class="mt-1 flex flex-col items-center gap-y-3"><div class="w-full truncate rounded-lg border border-border-primary bg-surface-secondary px-3 py-2 font-mono text-sm text-text-secondary"></div><button class="w-full rounded-lg border px-4 py-3 text-base font-semibold transition-colors disabled:cursor-not-allowed"></button></div></div><div class="flex flex-col gap-3"><h3 class="text-base font-semibold text-text-primary"></h3><p class="text-sm text-text-secondary"></p><div class=mt-2><button class="w-full rounded-lg border px-4 py-3 text-base font-semibold transition-colors disabled:cursor-not-allowed"></button></div></div><div class=pt-4><button class="w-full rounded-lg bg-interactive-primary-base px-4 py-3 text-base font-semibold text-text-on-interactive transition-colors hover:bg-interactive-primary-hover disabled:cursor-not-allowed disabled:bg-surface-secondary disabled:text-text-secondary">'),jt=k("<p>"),Yt=k("<p class=mt-3>"),Zt=k('<div class="p-4 text-text-secondary sm:p-6">');const Jt="https://testhook.algorobot.net",Qt="https://livehook.algorobot.net";function Xt(t){const o=ae(),s=Se(),n=D(()=>se.find(b=>b.id===t.robotId)),[a,l]=S(!1),[d,i]=S(!1),[m,f]=S(!1),[h,_]=S(!1),[A,g]=S(!1);Ce(()=>{_e(t.robotId,"instructions",3),n()||K(t.robotId,s.getAccessTokenSilently)});const v=D(()=>{const b=n(),w=s.backendUser()?.user_webhook_id;return!b||!w?e("common.loading"):b.robotType==="REAL"?`${Qt}/${w}`:`${Jt}/${w}`}),[I]=yt(()=>t.robotId,b=>It(b,s.getAccessTokenSilently)),$=D(()=>{const b=n(),w=s.backendUser()?.user_id,E=I();return!b||!w?e("common.loading"):I.loading?e("common.loading"):E?`{
2  "version": "1",
3  "user_robot_id": "${t.robotId}",
4  "robot_secret": "${E}",
5  "message": {{strategy.order.alert_message}}
6}`:e("common.loading")}),M=async()=>{try{await navigator.clipboard.writeText(v()),R.show(b=>r(te,y(b,{get title(){return e("common.success")},get description(){return e("robotSetup.webhookCopySuccess")}}))),i(!0)}catch(b){console.error("Failed to copy text: ",b)}},P=async()=>{const b=$();if(b===e("common.loading")){R.show(w=>r(B,y(w,{get title(){return e("common.notReady")},get description(){return e("robotSetup.messageNotReady")}})));return}try{await navigator.clipboard.writeText(b),l(!0),R.show(w=>r(te,y(w,{get title(){return e("common.success")},get description(){return e("robotSetup.alertCopySuccess")}})))}catch{R.show(E=>r(B,y(E,{get title(){return e("common.error")},get description(){return e("robotSetup.messageCopyFailed")}})))}},j=()=>{f(!0),g(!1)},X=async()=>
6{if(!h()){_(!0);try{await Qe(`/user-robots/${t.robotId}`,{status:"ACTIVE"},s.getAccessTokenSilently),await Promise.all([K(t.robotId,s.getAccessTokenSilently),St(s.getAccessTokenSilently)]),R.show(b=>r(te,y(b,{get title(){return e("common.success")},get description(){return e("robotSetup.completeSuccess")}}))),Ct(t.robotId),o("/app/my-robots",{replace:!0})}catch(b){const w=Y(b);R.show(E=>r(B,y(E,{get title(){return e("robotSetup.completeFailedTitle")},description:w}))),ne(t.robotId,"instructions","complete_setup_error")}finally{_(!1)}}},z=r(Re,{get title(){return e("robotSetup.instructionsTitle")},get description(){return e("robotSetup.instructionsDescription")}});return r(Ae,{headerContent:z,get children(){return[r(Te,{get children(){return r(H,{get when(){return n()},get fallback(){return(()=>{var b=Zt();return u(b,()=>e("robotSetup.loadingOrNotFound")),b})()},get children(){var b=Wt(),w=b.firstChild,E=w.firstChild,c=E.nextSibling,x=c.nextSibling,p=x.firstChild,F=p.nextSibling,ee=w.nextSibling,T=ee.firstChild,L=T.nextSibling,le=L.nextSibling,Fe=le.firstChild,re=Fe.nextSibling,de=ee.nextSibling,Be=de.firstChild,Oe=Be.nextSibling,lt=Oe.nextSibling,oe=lt.firstChild,dt=de.nextSibling,ue=dt.firstChild;return u(E,()=>e("robotSetup.copyAlertTitle")),u(c,()=>e("robotSetup.copyAlertDescription")),u(p,$),F.$$click=P,u(F,(()=>{var C=q(()=>!!a());return()=>C()?`✓ ${e("robotSetup.alertCopied")}`:e("robotSetup.copyAlert")})()),u(T,()=>e("robotSetup.copyWebhookTitle")),u(L,()=>e("robotSetup.copyWebhookDescription")),u(Fe,v),re.$$click=M,u(re,(()=>{var C=q(()=>!!d());return()=>C()?`✓ ${e("robotSetup.webhookCopied")}`:e("robotSetup.copyWebhook")})()),u(Be,()=>e("robotSetup.pasteConfirmTitle")),u(Oe,()=>e("robotSetup.pasteConfirmDescription")),oe.$$click=()=>g(!0),u(oe,(()=>{var C=q(()=>!!m());return()=>C()?`✓ ${e("robotSetup.pasted")}`:e("robotSetup.confirmPasted")})()),ue.$$click=X,u(ue,(()=>{var C=q(()=>!!h());return()=>C()?e("robotSetup.completing"):q(()=>!!m())()?e("robotSetup.completeAndReturn"):e("robotSetup.completePreviousSteps")})()),Ie(C=>{var ut={"border-interactive-ghost-border text-interactive-ghost-text hover:bg-interactive-ghost-hover-bg":!a(),"border-bunker-700 bg-surface-secondary text-text-secondary cursor-default":a()},Ge=!a(),Ve=!a(),pt={"border-interactive-ghost-border text-interactive-ghost-text hover:bg-interactive-ghost-hover-bg":!d(),"border-bunker-700 bg-surface-secondary text-text-secondary cursor-default":d(),"border-border-primary text-text-secondary":!a()},Ne=!d(),Ue=!d(),gt={"border-interactive-ghost-border text-interactive-ghost-text hover:bg-interactive-ghost-hover-bg":!m(),"border-bunker-700 bg-surface-secondary text-text-secondary cursor-default":m(),"border-border-primary text-text-secondary":!d()},ze=!m()||h();return C.e=ge(F,ut,C.e),Ge!==C.t&&ee.classList.toggle("opacity-50",C.t=Ge),Ve!==C.a&&(re.disabled=C.a=Ve),C.o=ge(re,pt,C.o),Ne!==C.i&&de.classList.toggle("opacity-50",C.i=Ne),Ue!==C.n&&(oe.disabled=C.n=Ue),C.s=ge(oe,gt,C.s),ze!==C.h&&(ue.disabled=C.h=ze),C},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),b}})}}),r(tt,{get isOpen(){return A()},onOpenChange:g,get title(){return e("robotSetup.importantConfirmTitle")},get confirmText(){return e("robotSetup.understandContinue")},get cancelText(){return e("robotSetup.checkAgain")},onConfirm:j,get children(){return[(()=>{var b=jt();return u(b,()=>e("robotSetup.confirmWebhookBody")),b})(),(()=>{var b=Yt();return u(b,()=>e("robotSetup.confirmCompletionBody")),b})()]}})]}})}$e(["click"]);var it=ye();function ct(){const t=ve(it);if(t===void 0)throw new Error("[kobalte]: `useSegmentedControlContext` must be used within a `SegmentedControl` component");return t}function er(t){const o=ct(),[s,n]=O(t,["style"]),[a,l]=S(),[d,i]=S(!1),m=()=>{const h=o.selectedItem();if(!h){l(void 0);return}l({width:`${h.offsetWidth}px`,height:`${h.offsetHeight}px`,transform:f(h),"transition-duration":d()?"0ms":void 0})},f=h=>{const _=getComputedStyle(h.parentElement),A=h.offsetLeft-Number.parseFloat(_.paddingLeft),g=h.offsetTop-Number.parseFloat(_.paddingTop);return`translate(${A}px, ${g}px)`};return N(Ze(o.selectedItem,()=>{i(!a()),m(),i(!1)})),Vt(o.root,()=>{_t(()=>{i(!0),m(),i(!1)})}),r(U,y({as:"div",role:"presentation",get style(){return Je(a(),s.style)},get"data-resizing"(){return d()},get"data-orientation"(){return o.orientation()}},n))}var tr=t=>{const o=ie(),s=ct(),[n,a]=O(t,["ref"]),[l,d]=S();return N(()=>{const i=l();i&&o.isSelectedValue(t.value)&&s.setSelectedItem(i)}),r(ce.Item,y({ref(i){var m=J(d,n.ref);typeof m=="function"&&m(i)}},a))},rr=t=>{const o=Q(),[s,n]=O(t,["ref"]),[a,l]=S();return Xe(a,()=>{requestAnimationFrame(()=>{o.isDefault()&&o.select()})}),r(ce.ItemInput,y({ref(d){var i=J(l,s.ref);typeof i=="function"&&i(d)}},n))},or=t=>{const o=y({defaultValue:t.value,orientation:"horizontal"},t),[s,n]=O(o,["ref"]),[a,l]=S(),[d,i]=S(),m={value:()=>n.value,defaultValue:()=>n.defaultValue,orientation:()=>n.orientation,root:a,selectedItem:d,setSelectedItem:i};return N(()=>{m.value()||i(void 0)}),r(it.Provider,{value:m,get children(){return r(ce,y({ref(f){var h=J(l,s.ref);typeof h=="function"&&h(f)}},n))}})},V=Object.assign(or,{Description:ke,ErrorMessage:we,Indicator:er,Item:tr,ItemControl:De,ItemDescription:Pe,ItemIndicator:Ee,ItemInput:rr,ItemLabel:Le,Label:Me}),nr=k('<div class="rounded-lg border border-neon-red-800 bg-neon-red-950/30 p-4"><div class=flex><div class=flex-shrink-0><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 20 20"fill=currentColor aria-hidden=true class="h-5 w-5 text-neon-red-500"><path fill-rule=evenodd d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z"clip-rule=evenodd></path></svg></div><div class=ml-3><h3 class="text-sm font-medium text-neon-red-200"></h3><div class="mt-2 space-y-1 text-sm text-neon-red-300"></div><div class=mt-3><a target=_blank rel="noopener noreferrer"class="text-sm font-medium text-interactive-base hover:text-interactive-base-hover underline decoration-interactive-base/30 underline-offset-4 transition-colors">'),ar=k("<p>• "),Ke=k('<span class="font-semibold text-sm sm:text-base">'),We=k('<span class="text-xs mt-1">'),sr=k('<div class="flex flex-col sm:flex-row flex-wrap gap-3"><button class="group flex flex-col justify-center border-dashed items-center h-full w-36 gap-2 text-center cursor-pointer rounded-xl border px-4 py-5 text-sm font-medium shadow-sm transition-all border-neon-blue-200 bg-surface-primary text-neon-blue-200 hover:bg-surface-secondary hover:shadow-md"><div class="flex items-center justify-center w-8 h-8 rounded-full bg-surface-primary/50 text-text-secondary transition-colors group-hover:text-text-primary"><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 16 16"fill=currentColor class="h-5 w-5"><path d="M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z"></path></svg></div><span class=font-semibold>'),ir=k('<div class=pt-4><button class="w-full rounded-lg bg-interactive-primary-base px-4 py-3 text-sm sm:text-base font-semibold text-text-on-interactive transition-colors hover:bg-interactive-primary-hover disabled:cursor-not-allowed disabled:bg-surface-secondary disabled:text-text-secondary">'),cr=k('<div class="space-y-8 p-4 sm:p-6">'),lr=k("<p>"),dr=k('<ul class="mt-3 list-disc space-y-1 pl-5 text-text-secondary">'),ur=k("<p class=mt-4>"),pr=k('<div class="p-4 sm:p-6 text-text-secondary">'),gr=k('<span class="font-bold text-xs mt-1">'),br=k("<li>");function mr(t){return(()=>{var o=nr(),s=o.firstChild,n=s.firstChild,a=n.nextSibling,l=a.firstChild,d=l.nextSibling,i=d.nextSibling,m=i.firstChild;return u(l,()=>e("robotSetup.blockerTitle")),u(d,r(he,{get each(){return t.blockers},children:f=>(()=>{var h=ar();return h.firstChild,u(h,()=>f.displayMessage,null),h}
6)()})),Tt(m,"href",Dt),u(m,()=>e("robotSetup.supportLink")),o})()}function fr(t){return t.code==="ENABLE_DERIVATIVES_TRADING"?e("robotSetup.actionEnableDerivatives",t.params):t.code==="ENABLE_HEDGE_MODE"?e("robotSetup.actionEnableHedgeMode",t.params):e("robotSetup.actionUnknown")}function je(t){const o=t.params;return t.code==="REFERRAL_REQUIRED"?be("account.referral_required",o):t.code==="REFERRAL_STATUS_UNKNOWN"?be("account.referral_status_unknown",o):t.code.includes(".")?be(t.code,o):e("robotSetup.accountBlockedDescription")}function hr(t){const o=ae(),s=Se(),n=D(()=>se.find(c=>c.id===t.robotId)),[a,l]=S(""),[d,i]=S("selecting"),[m,f]=S([]),[h,_]=S([]),[A,g]=S(!1),v=D(()=>["analyzing","applying","assigning"].includes(d())),I="paper_mode";Ce(()=>{_e(t.robotId,"assign-account",2),He.length===0&&$t(s.getAccessTokenSilently),a()&&(i("selecting"),f([]),_([])),n()||K(t.robotId,s.getAccessTokenSilently)});const $=()=>{const c=`/app/robot-setup/${t.robotId}/assign-account`;o(`/app/profile/add-exchange-account?redirect=${encodeURIComponent(c)}`)},M=c=>{l(c),i("selecting"),f([]),_([])},P=async()=>{const c=d();v()||!a()||(a()===I?await b():(c==="selecting"||c==="blocked")&&await j())},j=async()=>{i("analyzing"),_([]);try{const c=await wt(a(),s.getAccessTokenSilently);if(c.status==="READY")i("ready_to_assign"),R.show(x=>r(te,y(x,{get title(){return e("robotSetup.accountReadyTitle")},get description(){return e("robotSetup.accountReadyDescription")}}))),await z();else if(c.status==="BLOCKED"){const x=c.blockers.map(p=>({code:p.code,params:p.params,displayMessage:je(p),failedAction:p.failed_action}));_(x),i("selecting"),R.show(p=>r(B,y(p,{get title(){return e("robotSetup.accountBlockedTitle")},get description(){return x[0]?.displayMessage||e("robotSetup.accountBlockedDescription")}})))}else{const x=c.actions.map(p=>({code:p.code,params:p.params,displayMessage:fr(p)}));f(x),g(!0),i("selecting")}}catch(c){const x=Y(c);R.show(p=>r(B,y(p,{get title(){return e("robotSetup.accountCheckFailedTitle")},description:x}))),i("selecting")}},X=async()=>{g(!1),i("applying");try{const c=m().map(p=>p.code),x=await kt(a(),c,s.getAccessTokenSilently);if(x.status==="READY")i("ready_to_assign"),R.show(p=>r(te,y(p,{get title(){return e("robotSetup.accountConfiguredTitle")},get description(){return e("robotSetup.accountConfiguredDescription")}}))),await z();else{const p=x.blockers.map(F=>({code:F.code,params:F.params,displayMessage:je(F),failedAction:F.failed_action}));_(p),i("blocked")}}catch(c){const x=Y(c);R.show(p=>r(B,y(p,{get title(){return e("robotSetup.actionFailedTitle")},description:x}))),i("selecting")}},z=async()=>{i("assigning");try{await Rt(t.robotId,a(),s.getAccessTokenSilently),await K(t.robotId,s.getAccessTokenSilently),fe(t.robotId,"assign-account",2),o(`/app/robot-setup/${t.robotId}/instructions`)}catch(c){const x=Y(c);R.show(p=>r(B,y(p,{get title(){return e("robotSetup.accountAssignFailedTitle")},description:x}))),ne(t.robotId,"assign-account","final_assignment_error"),i("selecting")}},b=async()=>{i("assigning");try{await At(t.robotId,s.getAccessTokenSilently),await K(t.robotId,s.getAccessTokenSilently),fe(t.robotId,"assign-account",2),o(`/app/robot-setup/${t.robotId}/instructions`)}catch(c){const x=Y(c);R.show(p=>r(B,y(p,{get title(){return e("robotSetup.actionFailedTitle")},description:x}))),ne(t.robotId,"assign-account","paper_assignment_error"),i("selecting")}},w=D(()=>{if(a()===I)return d()==="assigning"?e("common.saving"):e("robotSetup.paperContinue");const c=d();return c==="selecting"?e("robotSetup.checkContinue"):c==="analyzing"?e("robotSetup.analyzing"):c==="applying"?e("robotSetup.applying"):c==="blocked"?e("common.tryAgain"):c==="ready_to_assign"?e("robotSetup.assigning"):c==="assigning"?e("common.saving"):e("robotSetup.checkContinue")}),E=r(Re,{get title(){return e("robotSetup.assignTitle")},get description(){return e("robotSetup.assignDescription")}});return r(Ae,{headerContent:E,get children(){return[r(Te,{get children(){return r(H,{get when(){return n()},get fallback(){return(()=>{var c=pr();return u(c,()=>e("common.loading")),c})()},get children(){var c=cr();return u(c,r(H,{when:!0,get children(){return r(V,{class:"flex flex-col gap-6",get value(){return a()},onChange:M,get children(){return[r(V.Label,{class:"text-base sm:text-lg font-semibold text-text-primary tracking-tight",get children(){return e("robotSetup.availableAccounts")}}),(()=>{var x=sr(),p=x.firstChild,F=p.firstChild,ee=F.nextSibling;return u(x,r(V.Item,{value:I,class:"w-full sm:w-auto",get children(){return[r(V.ItemInput,{}),r(V.ItemLabel,{class:`group flex flex-col justify-center items-center h-full w-full sm:w-44 min-h-[60
6px] text-center cursor-pointer rounded-xl border px-4 py-4 text-xs sm:text-sm font-medium shadow-sm transition-all
7                                            border-interactive-ghost-border bg-surface-primary text-interactive-ghost-text
8                                            hover:bg-surface-secondary hover:shadow-md
9                                            data-[checked]:border-transparent data-[checked]:bg-neon-green-800 data-[checked]:text-neon-green-100`,get children(){return[(()=>{var T=Ke();return u(T,()=>e("robotSetup.paperAccount")),T})(),(()=>{var T=We();return u(T,()=>e("robotSetup.simulation")),T})()]}})]}}),p),u(x,r(he,{each:He,children:T=>r(V.Item,{get value(){return T.accountId},get children(){return[r(V.ItemInput,{}),r(V.ItemLabel,{class:`group flex flex-col justify-center items-center h-full w-36 text-center cursor-pointer rounded-xl border px-4 py-3 text-sm font-medium shadow-sm transition-all
10                                                    border-interactive-ghost-border bg-surface-primary text-interactive-ghost-text
11                                                    hover:bg-surface-secondary hover:shadow-md
12                                                    data-[checked]:border-transparent data-[checked]:bg-neon-green-800 data-[checked]:text-neon-green-100`,get children(){return[(()=>{var L=Ke();return u(L,()=>T.name),L})(),(()=>{var L=gr();return u(L,()=>T.exchangeName.toUpperCase()),L})(),(()=>{var L=We();return u(L,(()=>{var le=q(()=>!!T.isDemo);return()=>le()?e("common.demo"):e("account.live")})()),L})()]}})]}})}),p),p.$$click=$,u(ee,()=>e("robotSetup.addNewAccount")),x})()]}})}}),null),u(c,r(H,{when:!0,get children(){return[r(H,{get when(){return h().length>0},get children(){return r(mr,{get blockers(){return h()}})}}),(()=>{var x=ir(),p=x.firstChild;return p.$$click=P,u(p,w),Ie(()=>p.disabled=!a()||v()),x})()]}}),null),c}})}}),r(tt,{get isOpen(){return A()},onOpenChange:g,get title(){return e("robotSetup.configurationConfirmTitle")},get confirmText(){return e("robotSetup.configurationConfirmButton")},get cancelText(){return e("common.cancel")},onConfirm:X,get children(){return[(()=>{var c=lr();return u(c,()=>e("robotSetup.configurationConfirmBody")),c})(),(()=>{var c=dr();return u(c,r(he,{get each(){return m()},children:x=>(()=>{var p=br();return u(p,()=>x.displayMessage),p})()})),c})(),(()=>{var c=ur();return u(c,()=>e("robotSetup.configurationConfirmFooter")),c})()]}})]}})}$e(["click"]);function kr(){const t=ae(),o=Pt(),s=D(()=>se.find(a=>a.id===o.id)),n=()=>{const a=s();t(a?`/app/strategies/${a.robotTemplateId}`:"/app/strategies")};return r(Ot,{get children(){return r(Et,{get fallback(){return r(Nt,{})},get children(){return[r(me,{get when(){return o.step==="basic-parameters"},get children(){return r(Kt,{get robotId(){return o.id},onBack:n})}}),r(me,{get when(){return o.step==="assign-account"},get children(){return r(hr,{get robotId(){return o.id}})}}),r(me,{get when(){return o.step==="instructions"},get children(){return r(Xt,{get robotId(){return o.id},robotType:"REAL"})}})]}})}})}export{kr as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.