@nullplatform/mcp 0.1.2 → 0.1.3

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.
@@ -824,7 +824,7 @@ Boolean requesting whether a visible border and background is provided by the ho
824
824
  - "model": Tool visible to and callable by the agent
825
825
  - "app": Tool callable by the app from this server only`),csp:c.never().optional(),permissions:c.never().optional()}),AS=c.object({mimeTypes:c.array(c.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),ZS=c.object({method:c.literal("ui/download-file"),params:c.object({contents:c.array(c.union([bl,xl])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),LS=c.object({method:c.literal("ui/message"),params:c.object({role:c.literal("user").describe('Message role, currently only "user" is supported.'),content:c.array(Bt).describe("Message content blocks (text, image, etc.).")})}),MS=c.object({method:c.literal("ui/notifications/sandbox-resource-ready"),params:c.object({html:c.string().describe("HTML content to load into the inner iframe."),sandbox:c.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Nl.optional().describe("CSP configuration from resource metadata."),permissions:Tl.optional().describe("Sandbox permissions from resource metadata.")})}),O_=c.object({method:c.literal("ui/notifications/tool-result"),params:Wt.describe("Standard MCP tool execution result.")}),Qm=c.object({toolInfo:c.object({id:Ht.optional().describe("JSON-RPC id of the tools/call request."),tool:ni.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:h_.optional().describe("Current color theme preference."),styles:w_.optional().describe("Style configuration for theming the app."),displayMode:Wr.optional().describe("How the UI is currently displayed."),availableDisplayModes:c.array(Wr).optional().describe("Display modes the host supports."),containerDimensions:c.union([c.object({height:c.number().describe("Fixed container height in pixels.")}),c.object({maxHeight:c.union([c.number(),c.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(c.union([c.object({width:c.number().describe("Fixed container width in pixels.")}),c.object({maxWidth:c.union([c.number(),c.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
826
826
  container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:c.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:c.string().optional().describe("User's timezone in IANA format."),userAgent:c.string().optional().describe("Host application identifier."),platform:c.union([c.literal("web"),c.literal("desktop"),c.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:c.object({touch:c.boolean().optional().describe("Whether the device supports touch input."),hover:c.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:c.object({top:c.number().describe("Top safe area inset in pixels."),right:c.number().describe("Right safe area inset in pixels."),bottom:c.number().describe("Bottom safe area inset in pixels."),left:c.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),R_=c.object({method:c.literal("ui/notifications/host-context-changed"),params:Qm.describe("Partial context update containing only changed fields.")}),FS=c.object({method:c.literal("ui/update-model-context"),params:c.object({content:c.array(Bt).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:c.record(c.string(),c.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),qS=c.object({method:c.literal("ui/initialize"),params:c.object({appInfo:Mr.describe("App identification (name and version)."),appCapabilities:j_.describe("Features and capabilities this app provides."),protocolVersion:c.string().describe("Protocol version this app supports.")})}),E_=c.object({protocolVersion:c.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Mr.describe("Host application identification and version."),hostCapabilities:P_.describe("Features and capabilities provided by the host."),hostContext:Qm.describe("Rich context about the host environment.")}).passthrough(),U_={target:"draft-2020-12"};async function Km(e,r){let n=e["~standard"];if(n.jsonSchema)return n.jsonSchema[r](U_);if(n.vendor==="zod"){let{z:i}=await Promise.resolve().then(()=>(Cr(),sl));return i.toJSONSchema(e,{io:r})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Gm(e,r,n=""){let i=await e["~standard"].validate(r);if(i.issues){let t=i.issues.map(o=>{let a=o.path?.map(s=>typeof s=="object"?s.key:s).join(".");return a?`${a}: ${o.message}`:o.message}).join("; ");throw Error(n+t)}return i.value}function Ym(e,r=document.documentElement){for(let[n,i]of Object.entries(e))i!==void 0&&r.style.setProperty(n,i)}function Xm(e){if(document.getElementById("__mcp-host-fonts"))return;let r=document.createElement("style");r.id="__mcp-host-fonts",r.textContent=e,document.head.appendChild(r)}var ai=class ai extends Pl{constructor(n,i={},t={autoResize:!0}){super(t);M(this,"_appInfo");M(this,"_capabilities");M(this,"options");M(this,"_hostCapabilities");M(this,"_hostInfo");M(this,"_hostContext");M(this,"_registeredTools",{});M(this,"_initializedSent",!1);M(this,"eventSchemas",{toolinput:$_,toolinputpartial:k_,toolresult:O_,toolcancelled:z_,hostcontextchanged:R_});M(this,"_everHadListener",new Set);M(this,"_toolHandlersInitialized",!1);M(this,"_onteardown");M(this,"_oncalltool");M(this,"_onlisttools");M(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=i,this.options=t,t.allowUnsafeEval||c.config({jitless:!0}),this.setRequestHandler(Vt,o=>(console.log("Received ping:",o.params),{})),this.setEventHandler("hostcontextchanged",void 0)}_assertInitialized(n){if(this._initializedSent)return;let i=`[ext-apps] App.${n}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(i);console.warn(`${i}. This will throw in a future release.`)}_assertHandlerTiming(n){if(!ai.ONE_SHOT_EVENTS.has(n)||this._everHadListener.has(n)||(this._everHadListener.add(n),!this._initializedSent))return;let i=`[ext-apps] "${String(n)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(i);console.warn(i)}setEventHandler(n,i){i&&this._assertHandlerTiming(n),super.setEventHandler(n,i)}addEventListener(n,i){this._assertHandlerTiming(n),super.addEventListener(n,i)}onEventDispatch(n,i){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...i})}registerCapabilities(n){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=Bm(this._capabilities,n)}registerTool(n,i,t){if(this._registeredTools[n])throw Error(`Tool ${n} is already registered`);let o=this,a=()=>{o._initializedSent&&o._capabilities.tools?.listChanged&&o.sendToolListChanged()},s=i.inputSchema!==void 0,p={title:i.title,description:i.description,inputSchema:i.inputSchema,outputSchema:i.outputSchema,annotations:i.annotations,_meta:i._meta,enabled:!0,enable(){this.enabled=!0,a()},disable(){this.enabled=!1,a()},update(u){Object.assign(this,u),a()},remove(){o._registeredTools[n]===p&&(delete o._registeredTools[n],a())},handler:async(u,d)=>{if(!p.enabled)throw Error(`Tool ${n} is disabled`);let l;if(s){let _=p.inputSchema,f=_?await Gm(_,u??{},`Invalid input for tool ${n}: `):u??{};l=await t(f,d)}else l=await t(d);return p.outputSchema&&!l.isError&&(l.structuredContent=await Gm(p.outputSchema,l.structuredContent,`Invalid output for tool ${n}: `)),l}};return this._registeredTools[n]=p,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),a(),p}ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(n,i)=>{let t=this._registeredTools[n.name];if(!t)throw Error(`Tool ${n.name} not found`);return t.handler(n.arguments,i)},this.onlisttools=async(n,i)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([t,o])=>o.enabled).map(async([t,o])=>{let a={name:t,title:o.title,description:o.description,inputSchema:o.inputSchema?await Km(o.inputSchema,"input"):{type:"object",properties:{}}};return o.outputSchema&&(a.outputSchema=await Km(o.outputSchema,"output")),o.annotations&&(a.annotations=o.annotations),o._meta&&(a._meta=o._meta),a}))}))}async sendToolListChanged(n={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:n})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(I_,(i,t)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(i.params,t)})}get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(kl,(i,t)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(i.params,t)})}get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler($l,(i,t)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(i.params,t)})}assertCapabilityForMethod(n){switch(n){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${n})`);break}}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,i){if(this._assertInitialized("callServerTool"),typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},Wt,{onprogress:()=>{},resetTimeoutOnProgress:!0,...i})}async readServerResource(n,i){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:n},hl,i)}async listServerResources(n,i){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:n},fl,i)}async createSamplingMessage(n,i){this._assertInitialized("createSamplingMessage");let t=n.tools?Sl:zl;return await this.request({method:"sampling/createMessage",params:n},t,i)}sendMessage(n,i){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:n},x_,i)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,i){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:n},Bo,i)}openLink(n,i){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:n},y_,i)}downloadFile(n,i){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:n},b_,i)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,i){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:n},N_,i)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,i=0,t=0,o=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let s=document.documentElement,p=s.style.height;s.style.height="max-content";let u=Math.ceil(s.getBoundingClientRect().height);s.style.height=p;let d=Math.ceil(window.innerWidth);(d!==i||u!==t)&&(i=d,t=u,this.sendSizeChanged({width:d,height:u}))}))};o();let a=new ResizeObserver(o);return a.observe(document.documentElement),a.observe(document.body),()=>a.disconnect()}async connect(n=new jl(window.parent,window.parent),i){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(n);try{let t=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:f_}},E_,i);if(t===void 0)throw Error(`Server sent invalid initialize result: ${t}`);this._hostCapabilities=t.hostCapabilities,this._hostInfo=t.hostInfo,this._hostContext=t.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(t){throw this.close(),t}}};M(ai,"ONE_SHOT_EVENTS",new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]));var ii=ai;function D_(e){if(!e)return;let r=e.trim().toLowerCase(),n,i,t,o=/^#([0-9a-f]{3}|[0-9a-f]{6})$/.exec(r)?.[1];if(o){let a=o.length===3?o.split("").map(s=>s+s).join(""):o;n=parseInt(a.slice(0,2),16),i=parseInt(a.slice(2,4),16),t=parseInt(a.slice(4,6),16)}else{let a=/^rgba?\(\s*([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)/.exec(r);a&&([n,i,t]=[Number(a[1]),Number(a[2]),Number(a[3])]);let s=/^hsla?\(\s*[\d.]+[ ,]+[\d.]+%?[ ,]+([\d.]+)%/.exec(r);if(s)return Number(s[1])/100}if(!(n===void 0||i===void 0||t===void 0))return(.2126*n+.7152*i+.0722*t)/255}function ef(e){if(!e)return;let r=document.documentElement,n=e.theme==="dark"||e.theme==="light"?e.theme:void 0,i=e.styles?.variables;if(!n&&i){let t=D_(i["--color-background-primary"]??i["--color-background-secondary"]);t!==void 0&&(n=t<.5?"dark":"light")}n&&(r.classList.toggle("dark",n==="dark"),r.classList.toggle("light",n==="light"),r.style.colorScheme=n);try{i&&Ym(i),e.styles?.css?.fonts&&Xm(e.styles.css.fonts)}catch{}console.debug("[np-widget] theme:",e.theme,"->",n??"os-fallback","| tokens:",!!i,"| fonts:",!!e.styles?.css?.fonts)}function tf(e){let[r,n]=de(null),[i,t]=de(!1),o=ve(null);we(()=>{let u=new ii({name:e,version:"0.3.0"},{},{autoResize:!0});o.current=u,u.ontoolresult=d=>n(d),u.onhostcontextchanged=d=>ef(d),u.connect().then(()=>{ef(u.getHostContext()),t(!0)}).catch(()=>t(!1))},[e]);let a=Fe(async(u,d)=>{if(!o.current)throw new Error("not connected");return await o.current.callServerTool({name:u,arguments:d})},[]),s=Fe(u=>{o.current?.sendMessage({role:"user",content:[{type:"text",text:u}]}).catch(()=>{})},[]),p=Fe(u=>{try{o.current?.updateModelContext({content:[{type:"text",text:u}]}).catch(()=>{})}catch{}},[]);return{result:r,call:a,send:s,brief:p,connected:i}}var C_={"confirm.yes":"Yes, do it","confirm.no":"Cancel","chooser.pick":"pick a scope:","term.empty":"no output yet\u2026","term.copyLine":"copy line",hint:"Next:","panel.scopes":"Scopes","panel.releases":"Releases","panel.latestBuild":"Latest build","panel.noScopes":"No scopes yet \u2014 create one to have somewhere to deploy.","panel.scopePlaceholder":"scope name, e.g. dev","panel.typePlaceholder":"type\u2026","panel.createScope":"Create scope","panel.ship":"ship","panel.live":"live","panel.openRollout":"Open rollout","panel.nothingDeployed":"nothing deployed","panel.noReleases":"none yet","panel.noBuild":"none \u2014 push a commit so CI builds","panel.deployLatest":"Deploy latest","panel.logs":"Logs","panel.metrics":"Metrics","panel.pickType":"Pick a scope type and create again.","panel.waitingData":"waiting for data\u2026","panel.backToList":"apps","rollout.deployingTo":"Deploying to {scope}","rollout.release":"release","rollout.backToApp":"app","rollout.trafficLabel":"Traffic on new version","rollout.live":"{pct}% live","rollout.movingTo":"moving to {pct}%","rollout.move":"Move traffic","rollout.finalize":"Finalize","rollout.rollback":"Rollback","rollout.confirmFinalize":"Finalize and retire the old version?","rollout.confirmRollback":"Return ALL traffic to the previous version?","rollout.log":"Deployment log","rollout.waiting":"waiting for activity\u2026","rollout.failed":"Failed: {message}","rollout.deployment":"Deployment #{id}","rollout.busyMove":"Moving traffic\u2026","rollout.busyFinalize":"Finalizing\u2026","rollout.busyRollback":"Rolling back\u2026","rollout.autoDone":"Done \u2014 the release is fully live.","rollout.autoRolledBack":"Rolled back \u2014 previous version is serving traffic.","rollout.autoFailed":"Deployment failed \u2014 previous version keeps serving.","rollout.autoWaiting":"Waiting for instances \u2014 controls unlock when the rollout is running.","rollout.autoFull":"All traffic on the new version \u2014 finalize to retire the old one.","rollout.autoLabel":"Auto-advance","rollout.autoOff":"off","rollout.trafficHelp":"Drag to move traffic now; auto-advance ramps it to 100%.","rollout.appLogs":"Application logs","rollout.appLogsEmpty":"no application logs yet\u2026","logs.title":"{app} \xB7 logs","logs.heading":"Logs","logs.filter":"filter\u2026","logs.live":"live","logs.refresh":"Refresh","logs.updated":"updated {time}","logs.wrap":"Wrap","logs.copyAll":"Copy all","logs.copied":"Copied","logs.rangeLive":"Live","logs.range15m":"Last 15m","logs.range1h":"Last 1h","logs.range6h":"Last 6h","logs.range24h":"Last 24h","logs.rangeCustom":"Custom\u2026","logs.apply":"Apply","logs.from":"From","logs.to":"To","logs.empty":"no log lines yet\u2026","logs.noMatch":"nothing matches the filter","logs.count":"{count} line(s){scope}","logs.scopeSuffix":" \xB7 scope {scope}","logs.refreshFailed":"refresh failed: {message}","metrics.title":"{app} \xB7 {scope} metrics","metrics.heading":"Metrics","metrics.live":"live","metrics.loading":"loading {window}\u2026","metrics.refreshFailed":"refresh failed: {message}","metrics.noData":"no datapoints in this window","metrics.avgMax":"avg {avg} \xB7 max {max}","params.title":"{app} \xB7 parameters","params.heading":"Parameters","params.name":"Name","params.value":"Value","params.secret":"Secret","params.add":"+ Add","params.save":"Save changes","params.applyNote":"Changed values apply on the next deploy.","params.unavailable":"Existing values can't be listed here \u2014 new ones can still be added below.","params.saving":"Saving {count} parameter(s)\u2026","params.saved":"Saved \u2014 values apply on the next deploy.","params.saveFailed":"Save failed: {message}","createApp.title":"Create application","createApp.name":"Name","createApp.namespace":"Namespace","createApp.repository":"Repository","createApp.newRepo":"New repository","createApp.importRepo":"Import existing","createApp.template":"Template","createApp.noTemplates":"No templates available","createApp.repoUrl":"Repository URL","createApp.editName":"Customize the repository name","createApp.lockName":"Reset to the generated name","createApp.importUrl":"Existing repository URL","createApp.monorepo":"This repository is a monorepo","createApp.appPath":"Application path inside the repository","createApp.submit":"Create application","createApp.needName":"Name is required.","createApp.needNamespace":"Pick a namespace.","createApp.needTemplate":"Pick a template for the new repository.","createApp.needImportUrl":"Enter the repository URL to import.","createApp.noBaseUrl":"This account has no git provider configured \u2014 use \u201CImport existing\u201D.","createApp.creating":"Creating {name}\u2026 (links the repo, wires CI \u2014 takes a few seconds)","createApp.failed":"Failed: {message}","createApp.created":`{name} created (#{id}, {status}).
827
- Push a commit to trigger the first build, then deploy.`,"findApps.count":"{count} application(s)","findApps.filter":"filter\u2026","findApps.across":"across {ns} namespace(s)","findApps.noMatch":"Nothing matches the filter.","findApps.page":"{from}\u2013{to} of {total}","findApps.prevPage":"Previous page","findApps.nextPage":"Next page","findApps.hint":"Click an application to open its panel."},A_={"confirm.yes":"S\xED, hacelo","confirm.no":"Cancelar","chooser.pick":"eleg\xED un scope:","term.empty":"sin salida todav\xEDa\u2026","term.copyLine":"copiar l\xEDnea",hint:"Siguiente:","panel.scopes":"Scopes","panel.releases":"Releases","panel.latestBuild":"\xDAltimo build","panel.noScopes":"Sin scopes todav\xEDa \u2014 cre\xE1 uno para tener d\xF3nde deployar.","panel.scopePlaceholder":"nombre del scope, p. ej. dev","panel.typePlaceholder":"tipo\u2026","panel.createScope":"Crear scope","panel.ship":"publicar","panel.live":"en vivo","panel.openRollout":"Abrir rollout","panel.nothingDeployed":"nada deployado","panel.noReleases":"ninguna todav\xEDa","panel.noBuild":"ninguno \u2014 pushe\xE1 un commit para que CI compile","panel.deployLatest":"Deployar lo \xFAltimo","panel.logs":"Logs","panel.metrics":"M\xE9tricas","panel.pickType":"Eleg\xED un tipo de scope y cre\xE1 de nuevo.","panel.waitingData":"esperando datos\u2026","panel.backToList":"apps","rollout.deployingTo":"Deployando a {scope}","rollout.release":"release","rollout.backToApp":"app","rollout.trafficLabel":"Tr\xE1fico en la versi\xF3n nueva","rollout.live":"{pct}% en vivo","rollout.movingTo":"yendo a {pct}%","rollout.move":"Mover tr\xE1fico","rollout.finalize":"Finalizar","rollout.rollback":"Revertir","rollout.confirmFinalize":"\xBFFinalizar y retirar la versi\xF3n anterior?","rollout.confirmRollback":"\xBFDevolver TODO el tr\xE1fico a la versi\xF3n anterior?","rollout.log":"Log del deployment","rollout.waiting":"esperando actividad\u2026","rollout.failed":"Fall\xF3: {message}","rollout.deployment":"Deployment #{id}","rollout.busyMove":"Moviendo tr\xE1fico\u2026","rollout.busyFinalize":"Finalizando\u2026","rollout.busyRollback":"Revirtiendo\u2026","rollout.autoDone":"Listo \u2014 la release est\xE1 completamente en vivo.","rollout.autoRolledBack":"Revertido \u2014 la versi\xF3n anterior est\xE1 sirviendo tr\xE1fico.","rollout.autoFailed":"El deployment fall\xF3 \u2014 la versi\xF3n anterior sigue sirviendo.","rollout.autoWaiting":"Esperando instancias \u2014 los controles se habilitan cuando el rollout est\xE1 corriendo.","rollout.autoFull":"Todo el tr\xE1fico en la versi\xF3n nueva \u2014 finaliz\xE1 para retirar la anterior.","rollout.autoLabel":"Auto-avance","rollout.autoOff":"off","rollout.trafficHelp":"Arrastr\xE1 para mover el tr\xE1fico ahora; el auto-avance sube hasta 100%.","rollout.appLogs":"Logs de la aplicaci\xF3n","rollout.appLogsEmpty":"sin logs de la aplicaci\xF3n todav\xEDa\u2026","logs.title":"{app} \xB7 logs","logs.heading":"Logs","logs.filter":"filtrar\u2026","logs.live":"vivo","logs.refresh":"Refrescar","logs.updated":"actualizado {time}","logs.wrap":"Ajustar","logs.copyAll":"Copiar todo","logs.copied":"Copiado","logs.rangeLive":"En vivo","logs.range15m":"\xDAltimos 15m","logs.range1h":"\xDAltima 1h","logs.range6h":"\xDAltimas 6h","logs.range24h":"\xDAltimas 24h","logs.rangeCustom":"Personalizado\u2026","logs.apply":"Aplicar","logs.from":"Desde","logs.to":"Hasta","logs.empty":"sin l\xEDneas de log todav\xEDa\u2026","logs.noMatch":"nada coincide con el filtro","logs.count":"{count} l\xEDnea(s){scope}","logs.scopeSuffix":" \xB7 scope {scope}","logs.refreshFailed":"fall\xF3 el refresh: {message}","metrics.title":"{app} \xB7 m\xE9tricas de {scope}","metrics.heading":"M\xE9tricas","metrics.live":"vivo","metrics.loading":"cargando {window}\u2026","metrics.refreshFailed":"fall\xF3 el refresh: {message}","metrics.noData":"sin datapoints en esta ventana","metrics.avgMax":"prom {avg} \xB7 m\xE1x {max}","params.title":"{app} \xB7 par\xE1metros","params.heading":"Par\xE1metros","params.name":"Nombre","params.value":"Valor","params.secret":"Secreto","params.add":"+ Agregar","params.save":"Guardar cambios","params.applyNote":"Los valores cambiados aplican en el pr\xF3ximo deploy.","params.unavailable":"Los valores existentes no se pueden listar ac\xE1 \u2014 igual pod\xE9s agregar nuevos abajo.","params.saving":"Guardando {count} par\xE1metro(s)\u2026","params.saved":"Guardado \u2014 los valores aplican en el pr\xF3ximo deploy.","params.saveFailed":"Fall\xF3 el guardado: {message}","createApp.title":"Crear aplicaci\xF3n","createApp.name":"Nombre","createApp.namespace":"Namespace","createApp.repository":"Repositorio","createApp.newRepo":"Nuevo repositorio","createApp.importRepo":"Importar existente","createApp.template":"Template","createApp.noTemplates":"Sin templates disponibles","createApp.repoUrl":"URL del repositorio","createApp.editName":"Personalizar el nombre del repositorio","createApp.lockName":"Volver al nombre generado","createApp.importUrl":"URL del repositorio existente","createApp.monorepo":"Este repositorio es un monorepo","createApp.appPath":"Ruta de la aplicaci\xF3n dentro del repositorio","createApp.submit":"Crear aplicaci\xF3n","createApp.needName":"El nombre es obligatorio.","createApp.needNamespace":"Eleg\xED un namespace.","createApp.needTemplate":"Eleg\xED un template para el nuevo repositorio.","createApp.needImportUrl":"Ingres\xE1 la URL del repositorio a importar.","createApp.noBaseUrl":"Esta cuenta no tiene proveedor de git configurado \u2014 us\xE1 \u201CImportar existente\u201D.","createApp.creating":"Creando {name}\u2026 (vincula el repo, conecta CI \u2014 tarda unos segundos)","createApp.failed":"Fall\xF3: {message}","createApp.created":`{name} creada (#{id}, {status}).
828
- Pushe\xE1 un commit para disparar el primer build y despu\xE9s deploy\xE1.`,"findApps.count":"{count} aplicaci\xF3n(es)","findApps.filter":"filtrar\u2026","findApps.across":"en {ns} namespace(s)","findApps.noMatch":"Nada coincide con el filtro.","findApps.page":"{from}\u2013{to} de {total}","findApps.prevPage":"P\xE1gina anterior","findApps.nextPage":"P\xE1gina siguiente","findApps.hint":"Hac\xE9 clic en una aplicaci\xF3n para abrir su panel."},Z_={en:C_,es:A_};function rf(e){return e?.structuredContent?._locale==="es"?"es":"en"}function nf(e){let r=Z_[e];return(n,i)=>r[n].replace(/\{(\w+)\}/g,(t,o)=>i?.[o]!==void 0?String(i[o]):t)}var of=nn(nf("en")),af=of.Provider,Kt=()=>yi(of),sf=e=>nf(e);function cf(e){return{render:function(r){$u(r,e)},unmount:function(){zu(e)}}}function lf(e){let r=document.getElementById("root");r&&cf(r).render(e)}var L_=0;function h(e,r,n,i,t,o){r||(r={});var a,s,p=r;if("ref"in p)for(s in p={},r)s=="ref"?a=r[s]:p[s]=r[s];var u={type:e,props:p,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--L_,__i:-1,__u:0,__source:t,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)p[s]===void 0&&(p[s]=a[s]);return E.vnode&&E.vnode(u),u}var M_={clock:{body:h(V,{children:[h("circle",{cx:"12",cy:"12",r:"10"}),h("polyline",{points:"12 6 12 12 16 14"})]})},play:{fill:!0,body:h("polygon",{points:"6 3 20 12 6 21 6 3"})},pause:{fill:!0,body:h(V,{children:[h("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),h("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]})},refresh:{body:h(V,{children:[h("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),h("polyline",{points:"21 3 21 8 16 8"})]})},rocket:{body:h(V,{children:[h("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),h("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),h("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),h("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})},logs:{body:h(V,{children:[h("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),h("polyline",{points:"14 2 14 8 20 8"}),h("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),h("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),h("line",{x1:"10",y1:"9",x2:"8",y2:"9"})]})},metrics:{body:h(V,{children:[h("polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17"}),h("polyline",{points:"16 7 22 7 22 13"})]})},lock:{body:h(V,{children:[h("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),h("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})},edit:{body:h("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})},copy:{body:h(V,{children:[h("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),h("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})},check:{body:h("polyline",{points:"20 6 9 17 4 12"})},chevronDown:{body:h("polyline",{points:"6 9 12 15 18 9"})},chevronLeft:{body:h("polyline",{points:"15 18 9 12 15 6"})},chevronRight:{body:h("polyline",{points:"9 18 15 12 9 6"})},arrowLeft:{body:h(V,{children:[h("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),h("polyline",{points:"12 19 5 12 12 5"})]})}},Ke=({name:e,size:r=14,className:n})=>{let i=M_[e];return h("svg",{className:["icon",n].filter(Boolean).join(" "),width:r,height:r,viewBox:"0 0 24 24",fill:i.fill?"currentColor":"none",stroke:i.fill?"none":"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:i.body})};var Ol=({children:e})=>h("div",{className:"card",children:e}),Rl=({children:e})=>h("div",{className:"row",children:e});var uf=({tone:e,children:r})=>h("div",{className:`note${e?` ${e}`:""}`,children:r});var Ge=({variant:e,on:r,className:n,...i})=>h("button",{className:[e,r?"on":"",n].filter(Boolean).join(" "),...i});var X=({w:e="100%",h:r=12,r:n=6})=>h("div",{className:"skel",style:{width:e,height:r,borderRadius:n}}),pf=({variant:e})=>h(Ol,{children:[h(Rl,{children:[h(X,{w:170,h:16}),e!=="form"&&h(V,{children:[h("div",{className:"grow"}),h(X,{w:110,h:28,r:8})]})]}),e==="list"&&h("div",{className:"skel-rows",children:[0,1,2,3,4,5].map(r=>h("div",{className:"skel-row",children:[h(X,{w:8,h:8,r:999}),h(X,{w:140,h:13}),h("div",{className:"grow"}),h(X,{w:90,h:11})]},r))}),e==="panel"&&h(V,{children:[h("div",{className:"section",children:[h(X,{w:64,h:10}),h("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:10},children:[0,1].map(r=>h("div",{className:"skel-card",children:[h(X,{w:r?"45%":"55%",h:14}),h("div",{style:{height:8}}),h(X,{w:r?"70%":"85%",h:11})]},r))})]}),h("div",{className:"section",children:[h(X,{w:64,h:10}),h("div",{style:{marginTop:10,display:"flex",gap:8},children:[0,1,2].map(r=>h(X,{w:72,h:24,r:999},r))})]}),h("div",{className:"section",style:{display:"flex",gap:8},children:[h(X,{w:132,h:34,r:9}),h(X,{w:80,h:34,r:9})]})]}),e==="table"&&h("div",{className:"skel-rows",children:[0,1,2,3].map(r=>h("div",{className:"skel-row",children:[h(X,{w:"30%",h:13}),h("div",{className:"grow"}),h(X,{w:"42%",h:13}),h(X,{w:18,h:13})]},r))}),e==="grid"&&h("div",{className:"skel-grid",children:[0,1,2,3].map(r=>h("div",{className:"skel-card",children:[h(X,{w:"50%",h:10}),h("div",{style:{height:8}}),h(X,{w:"35%",h:20}),h("div",{style:{height:8}}),h(X,{w:"100%",h:40,r:8})]},r))}),e==="logs"&&h("div",{style:{marginTop:14},children:h(X,{w:"100%",h:150,r:10})}),e==="form"&&h("div",{className:"skel-rows",children:[[0,1,2].map(r=>h("div",{children:[h(X,{w:88,h:10}),h("div",{style:{height:7}}),h(X,{w:"100%",h:32,r:8})]},r)),h(X,{w:150,h:34,r:9})]})]}),F_=({lines:e,height:r,minHeight:n,tsMode:i="time",empty:t,wrap:o=!0,follow:a=!1})=>{let s=Kt(),p=t??s("term.empty"),u=ve(null),d=ve(!1);we(()=>{let f=u.current;f&&((!d.current||a)&&(f.scrollTop=f.scrollHeight),d.current=!0)},[a,e.length]);let l=f=>i==="relative"?Iu(f):dt(f,i),_=f=>{let g=f.source?`[${f.source}] `:"";xi(`${dt(f.ts??f.timestamp,"datetime")} ${g}${f.message??""}`.trim())};return h("div",{className:`term${o?"":" nowrap"}`,ref:u,style:r||n?{...r?{height:r}:{},...n?{minHeight:n}:{}}:void 0,children:e.length===0?p:e.slice(-300).map((f,g)=>{let x=H_(f.message);return h("div",{className:`logline${x?` ${x}`:""}`,children:[h("span",{className:"t",children:l(f.ts??f.timestamp)}),h("span",{className:"msg",children:(f.source?`[${f.source}] `:"")+(f.message??"")}),h("button",{type:"button",className:"copyline",title:s("term.copyLine"),"aria-label":s("term.copyLine"),onClick:()=>_(f),children:h(Ke,{name:"copy",size:13})})]},g)})})};function q_(e){return`${dt(e.ts??e.timestamp,"datetime")} ${e.source?`[${e.source}] `:""}${e.message??""}`.trim()}var df=({lines:e,height:r,minHeight:n,empty:i,follow:t=!1,controls:o=!0,defaultWrap:a=!0,defaultTsMode:s="datetime"})=>{let p=Kt(),[u,d]=de(a),[l,_]=de(!1),f=async()=>{await xi(e.map(q_).join(`
827
+ Push a commit to trigger the first build, then deploy.`,"findApps.count":"{count} application(s)","findApps.filter":"filter\u2026","findApps.across":"across {ns} namespace(s)","findApps.noMatch":"Nothing matches the filter.","findApps.loadMore":"Load {more} more","findApps.hint":"Click an application to open its panel."},A_={"confirm.yes":"S\xED, hacelo","confirm.no":"Cancelar","chooser.pick":"eleg\xED un scope:","term.empty":"sin salida todav\xEDa\u2026","term.copyLine":"copiar l\xEDnea",hint:"Siguiente:","panel.scopes":"Scopes","panel.releases":"Releases","panel.latestBuild":"\xDAltimo build","panel.noScopes":"Sin scopes todav\xEDa \u2014 cre\xE1 uno para tener d\xF3nde deployar.","panel.scopePlaceholder":"nombre del scope, p. ej. dev","panel.typePlaceholder":"tipo\u2026","panel.createScope":"Crear scope","panel.ship":"publicar","panel.live":"en vivo","panel.openRollout":"Abrir rollout","panel.nothingDeployed":"nada deployado","panel.noReleases":"ninguna todav\xEDa","panel.noBuild":"ninguno \u2014 pushe\xE1 un commit para que CI compile","panel.deployLatest":"Deployar lo \xFAltimo","panel.logs":"Logs","panel.metrics":"M\xE9tricas","panel.pickType":"Eleg\xED un tipo de scope y cre\xE1 de nuevo.","panel.waitingData":"esperando datos\u2026","panel.backToList":"apps","rollout.deployingTo":"Deployando a {scope}","rollout.release":"release","rollout.backToApp":"app","rollout.trafficLabel":"Tr\xE1fico en la versi\xF3n nueva","rollout.live":"{pct}% en vivo","rollout.movingTo":"yendo a {pct}%","rollout.move":"Mover tr\xE1fico","rollout.finalize":"Finalizar","rollout.rollback":"Revertir","rollout.confirmFinalize":"\xBFFinalizar y retirar la versi\xF3n anterior?","rollout.confirmRollback":"\xBFDevolver TODO el tr\xE1fico a la versi\xF3n anterior?","rollout.log":"Log del deployment","rollout.waiting":"esperando actividad\u2026","rollout.failed":"Fall\xF3: {message}","rollout.deployment":"Deployment #{id}","rollout.busyMove":"Moviendo tr\xE1fico\u2026","rollout.busyFinalize":"Finalizando\u2026","rollout.busyRollback":"Revirtiendo\u2026","rollout.autoDone":"Listo \u2014 la release est\xE1 completamente en vivo.","rollout.autoRolledBack":"Revertido \u2014 la versi\xF3n anterior est\xE1 sirviendo tr\xE1fico.","rollout.autoFailed":"El deployment fall\xF3 \u2014 la versi\xF3n anterior sigue sirviendo.","rollout.autoWaiting":"Esperando instancias \u2014 los controles se habilitan cuando el rollout est\xE1 corriendo.","rollout.autoFull":"Todo el tr\xE1fico en la versi\xF3n nueva \u2014 finaliz\xE1 para retirar la anterior.","rollout.autoLabel":"Auto-avance","rollout.autoOff":"off","rollout.trafficHelp":"Arrastr\xE1 para mover el tr\xE1fico ahora; el auto-avance sube hasta 100%.","rollout.appLogs":"Logs de la aplicaci\xF3n","rollout.appLogsEmpty":"sin logs de la aplicaci\xF3n todav\xEDa\u2026","logs.title":"{app} \xB7 logs","logs.heading":"Logs","logs.filter":"filtrar\u2026","logs.live":"vivo","logs.refresh":"Refrescar","logs.updated":"actualizado {time}","logs.wrap":"Ajustar","logs.copyAll":"Copiar todo","logs.copied":"Copiado","logs.rangeLive":"En vivo","logs.range15m":"\xDAltimos 15m","logs.range1h":"\xDAltima 1h","logs.range6h":"\xDAltimas 6h","logs.range24h":"\xDAltimas 24h","logs.rangeCustom":"Personalizado\u2026","logs.apply":"Aplicar","logs.from":"Desde","logs.to":"Hasta","logs.empty":"sin l\xEDneas de log todav\xEDa\u2026","logs.noMatch":"nada coincide con el filtro","logs.count":"{count} l\xEDnea(s){scope}","logs.scopeSuffix":" \xB7 scope {scope}","logs.refreshFailed":"fall\xF3 el refresh: {message}","metrics.title":"{app} \xB7 m\xE9tricas de {scope}","metrics.heading":"M\xE9tricas","metrics.live":"vivo","metrics.loading":"cargando {window}\u2026","metrics.refreshFailed":"fall\xF3 el refresh: {message}","metrics.noData":"sin datapoints en esta ventana","metrics.avgMax":"prom {avg} \xB7 m\xE1x {max}","params.title":"{app} \xB7 par\xE1metros","params.heading":"Par\xE1metros","params.name":"Nombre","params.value":"Valor","params.secret":"Secreto","params.add":"+ Agregar","params.save":"Guardar cambios","params.applyNote":"Los valores cambiados aplican en el pr\xF3ximo deploy.","params.unavailable":"Los valores existentes no se pueden listar ac\xE1 \u2014 igual pod\xE9s agregar nuevos abajo.","params.saving":"Guardando {count} par\xE1metro(s)\u2026","params.saved":"Guardado \u2014 los valores aplican en el pr\xF3ximo deploy.","params.saveFailed":"Fall\xF3 el guardado: {message}","createApp.title":"Crear aplicaci\xF3n","createApp.name":"Nombre","createApp.namespace":"Namespace","createApp.repository":"Repositorio","createApp.newRepo":"Nuevo repositorio","createApp.importRepo":"Importar existente","createApp.template":"Template","createApp.noTemplates":"Sin templates disponibles","createApp.repoUrl":"URL del repositorio","createApp.editName":"Personalizar el nombre del repositorio","createApp.lockName":"Volver al nombre generado","createApp.importUrl":"URL del repositorio existente","createApp.monorepo":"Este repositorio es un monorepo","createApp.appPath":"Ruta de la aplicaci\xF3n dentro del repositorio","createApp.submit":"Crear aplicaci\xF3n","createApp.needName":"El nombre es obligatorio.","createApp.needNamespace":"Eleg\xED un namespace.","createApp.needTemplate":"Eleg\xED un template para el nuevo repositorio.","createApp.needImportUrl":"Ingres\xE1 la URL del repositorio a importar.","createApp.noBaseUrl":"Esta cuenta no tiene proveedor de git configurado \u2014 us\xE1 \u201CImportar existente\u201D.","createApp.creating":"Creando {name}\u2026 (vincula el repo, conecta CI \u2014 tarda unos segundos)","createApp.failed":"Fall\xF3: {message}","createApp.created":`{name} creada (#{id}, {status}).
828
+ Pushe\xE1 un commit para disparar el primer build y despu\xE9s deploy\xE1.`,"findApps.count":"{count} aplicaci\xF3n(es)","findApps.filter":"filtrar\u2026","findApps.across":"en {ns} namespace(s)","findApps.noMatch":"Nada coincide con el filtro.","findApps.loadMore":"Cargar {more} m\xE1s","findApps.hint":"Hac\xE9 clic en una aplicaci\xF3n para abrir su panel."},Z_={en:C_,es:A_};function rf(e){return e?.structuredContent?._locale==="es"?"es":"en"}function nf(e){let r=Z_[e];return(n,i)=>r[n].replace(/\{(\w+)\}/g,(t,o)=>i?.[o]!==void 0?String(i[o]):t)}var of=nn(nf("en")),af=of.Provider,Kt=()=>yi(of),sf=e=>nf(e);function cf(e){return{render:function(r){$u(r,e)},unmount:function(){zu(e)}}}function lf(e){let r=document.getElementById("root");r&&cf(r).render(e)}var L_=0;function h(e,r,n,i,t,o){r||(r={});var a,s,p=r;if("ref"in p)for(s in p={},r)s=="ref"?a=r[s]:p[s]=r[s];var u={type:e,props:p,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--L_,__i:-1,__u:0,__source:t,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)p[s]===void 0&&(p[s]=a[s]);return E.vnode&&E.vnode(u),u}var M_={clock:{body:h(V,{children:[h("circle",{cx:"12",cy:"12",r:"10"}),h("polyline",{points:"12 6 12 12 16 14"})]})},play:{fill:!0,body:h("polygon",{points:"6 3 20 12 6 21 6 3"})},pause:{fill:!0,body:h(V,{children:[h("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),h("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]})},refresh:{body:h(V,{children:[h("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),h("polyline",{points:"21 3 21 8 16 8"})]})},rocket:{body:h(V,{children:[h("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),h("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),h("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),h("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})},logs:{body:h(V,{children:[h("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),h("polyline",{points:"14 2 14 8 20 8"}),h("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),h("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),h("line",{x1:"10",y1:"9",x2:"8",y2:"9"})]})},metrics:{body:h(V,{children:[h("polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17"}),h("polyline",{points:"16 7 22 7 22 13"})]})},lock:{body:h(V,{children:[h("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),h("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})},edit:{body:h("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})},copy:{body:h(V,{children:[h("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),h("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})},check:{body:h("polyline",{points:"20 6 9 17 4 12"})},chevronDown:{body:h("polyline",{points:"6 9 12 15 18 9"})},chevronLeft:{body:h("polyline",{points:"15 18 9 12 15 6"})},chevronRight:{body:h("polyline",{points:"9 18 15 12 9 6"})},arrowLeft:{body:h(V,{children:[h("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),h("polyline",{points:"12 19 5 12 12 5"})]})}},Ke=({name:e,size:r=14,className:n})=>{let i=M_[e];return h("svg",{className:["icon",n].filter(Boolean).join(" "),width:r,height:r,viewBox:"0 0 24 24",fill:i.fill?"currentColor":"none",stroke:i.fill?"none":"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:i.body})};var Ol=({children:e})=>h("div",{className:"card",children:e}),Rl=({children:e})=>h("div",{className:"row",children:e});var uf=({tone:e,children:r})=>h("div",{className:`note${e?` ${e}`:""}`,children:r});var Ge=({variant:e,on:r,className:n,...i})=>h("button",{className:[e,r?"on":"",n].filter(Boolean).join(" "),...i});var X=({w:e="100%",h:r=12,r:n=6})=>h("div",{className:"skel",style:{width:e,height:r,borderRadius:n}}),pf=({variant:e})=>h(Ol,{children:[h(Rl,{children:[h(X,{w:170,h:16}),e!=="form"&&h(V,{children:[h("div",{className:"grow"}),h(X,{w:110,h:28,r:8})]})]}),e==="list"&&h("div",{className:"skel-rows",children:[0,1,2,3,4,5].map(r=>h("div",{className:"skel-row",children:[h(X,{w:8,h:8,r:999}),h(X,{w:140,h:13}),h("div",{className:"grow"}),h(X,{w:90,h:11})]},r))}),e==="panel"&&h(V,{children:[h("div",{className:"section",children:[h(X,{w:64,h:10}),h("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:10},children:[0,1].map(r=>h("div",{className:"skel-card",children:[h(X,{w:r?"45%":"55%",h:14}),h("div",{style:{height:8}}),h(X,{w:r?"70%":"85%",h:11})]},r))})]}),h("div",{className:"section",children:[h(X,{w:64,h:10}),h("div",{style:{marginTop:10,display:"flex",gap:8},children:[0,1,2].map(r=>h(X,{w:72,h:24,r:999},r))})]}),h("div",{className:"section",style:{display:"flex",gap:8},children:[h(X,{w:132,h:34,r:9}),h(X,{w:80,h:34,r:9})]})]}),e==="table"&&h("div",{className:"skel-rows",children:[0,1,2,3].map(r=>h("div",{className:"skel-row",children:[h(X,{w:"30%",h:13}),h("div",{className:"grow"}),h(X,{w:"42%",h:13}),h(X,{w:18,h:13})]},r))}),e==="grid"&&h("div",{className:"skel-grid",children:[0,1,2,3].map(r=>h("div",{className:"skel-card",children:[h(X,{w:"50%",h:10}),h("div",{style:{height:8}}),h(X,{w:"35%",h:20}),h("div",{style:{height:8}}),h(X,{w:"100%",h:40,r:8})]},r))}),e==="logs"&&h("div",{style:{marginTop:14},children:h(X,{w:"100%",h:150,r:10})}),e==="form"&&h("div",{className:"skel-rows",children:[[0,1,2].map(r=>h("div",{children:[h(X,{w:88,h:10}),h("div",{style:{height:7}}),h(X,{w:"100%",h:32,r:8})]},r)),h(X,{w:150,h:34,r:9})]})]}),F_=({lines:e,height:r,minHeight:n,tsMode:i="time",empty:t,wrap:o=!0,follow:a=!1})=>{let s=Kt(),p=t??s("term.empty"),u=ve(null),d=ve(!1);we(()=>{let f=u.current;f&&((!d.current||a)&&(f.scrollTop=f.scrollHeight),d.current=!0)},[a,e.length]);let l=f=>i==="relative"?Iu(f):dt(f,i),_=f=>{let g=f.source?`[${f.source}] `:"";xi(`${dt(f.ts??f.timestamp,"datetime")} ${g}${f.message??""}`.trim())};return h("div",{className:`term${o?"":" nowrap"}`,ref:u,style:r||n?{...r?{height:r}:{},...n?{minHeight:n}:{}}:void 0,children:e.length===0?p:e.slice(-300).map((f,g)=>{let x=H_(f.message);return h("div",{className:`logline${x?` ${x}`:""}`,children:[h("span",{className:"t",children:l(f.ts??f.timestamp)}),h("span",{className:"msg",children:(f.source?`[${f.source}] `:"")+(f.message??"")}),h("button",{type:"button",className:"copyline",title:s("term.copyLine"),"aria-label":s("term.copyLine"),onClick:()=>_(f),children:h(Ke,{name:"copy",size:13})})]},g)})})};function q_(e){return`${dt(e.ts??e.timestamp,"datetime")} ${e.source?`[${e.source}] `:""}${e.message??""}`.trim()}var df=({lines:e,height:r,minHeight:n,empty:i,follow:t=!1,controls:o=!0,defaultWrap:a=!0,defaultTsMode:s="datetime"})=>{let p=Kt(),[u,d]=de(a),[l,_]=de(!1),f=async()=>{await xi(e.map(q_).join(`
829
829
  `))&&(_(!0),setTimeout(()=>_(!1),1500))};return h(V,{children:[o?h("div",{className:"toolbar",children:[h(Ge,{variant:"small",on:u,onClick:()=>d(g=>!g),children:p("logs.wrap")}),h(Ge,{variant:"small",className:"hasicon",onClick:()=>{f()},children:l?h(V,{children:[h(Ke,{name:"check"})," ",p("logs.copied")]}):p("logs.copyAll")})]}):null,h("div",{style:o?{marginTop:10}:void 0,children:h(F_,{lines:e,tsMode:s,wrap:u,follow:t,empty:i,height:r,minHeight:n})})]})};function H_(e){let r=e??"";if(/\b(error|err|fatal|exception|panic|fail(ed|ure)?)\b/i.test(r))return"err";if(/\bwarn(ing)?\b/i.test(r))return"warn"}var mf=({scopes:e,onPick:r})=>{let n=Kt();return h("div",{className:"row",style:{marginTop:10},children:[h("span",{className:"sub",children:n("chooser.pick")}),e.map(i=>h(Ge,{variant:"small",onClick:()=>r(i.name),children:i.name},i.name))]})};var V_=["live","15m","1h","6h","24h"],gf={"15m":9e5,"1h":36e5,"6h":216e5,"24h":864e5},ff={live:"logs.rangeLive","15m":"logs.range15m","1h":"logs.range1h","6h":"logs.range6h","24h":"logs.range24h",custom:"logs.rangeCustom"},El=e=>{if(!e)return;let r=new Date(e);return Number.isNaN(r.getTime())?void 0:r.toISOString().replace(/\.\d{3}Z$/,".000Z")},Ul=e=>{let r=n=>String(n).padStart(2,"0");return`${e.getFullYear()}-${r(e.getMonth()+1)}-${r(e.getDate())}T${r(e.getHours())}:${r(e.getMinutes())}`},J_=({value:e,fromRef:r,toRef:n,onPreset:i,onApplyCustom:t})=>{let o=Kt(),[a,s]=de(!1),p=ve(null);return we(()=>{if(!a)return;let u=d=>{p.current&&!p.current.contains(d.target)&&s(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]),h("div",{className:"timerange",ref:p,children:[h(Ge,{variant:"small",className:"hasicon",on:a,onClick:()=>s(u=>!u),children:[h(Ke,{name:"clock"})," ",o(ff[e])," ",h(Ke,{name:"chevronDown",size:12,className:"tr-caret"})]}),h("div",{className:`tr-panel${a?"":" tr-closed"}`,children:[h("div",{className:"tr-presets",children:V_.map(u=>h("button",{type:"button",className:`tr-preset${e===u?" on":""}`,onClick:()=>{i(u),s(!1)},children:o(ff[u])},u))}),h("div",{className:"tr-custom",children:[h("div",{className:"label",children:o("logs.rangeCustom")}),h("label",{className:"tr-field",children:[h("span",{className:"sub",children:o("logs.from")}),h("input",{type:"datetime-local",ref:r,defaultValue:Ul(new Date(Date.now()-(gf["1h"]??36e5)))})]}),h("label",{className:"tr-field",children:[h("span",{className:"sub",children:o("logs.to")}),h("input",{type:"datetime-local",ref:n,defaultValue:Ul(new Date)})]}),h(Ge,{variant:"primary",onClick:()=>{t(),s(!1)},children:o("logs.apply")})]})]})]})};function B_(){let{result:e,call:r,connected:n}=tf("np-logs"),i=pt(()=>sf(rf(e)),[e]),[t,o]=de(""),[a,s]=de(!1),[p,u]=de(null),[d,l]=de("live"),[_,f]=de({lines:[]}),g=ve(_);g.current=_;let x=ve(null),k=ve(null),j=Fe(U=>{let G=U;if(G){if(Array.isArray(G.choose_scope)&&G.choose_scope.length){f(he=>({...he,app:G.app??he.app,appName:G.app_name??he.appName,chooser:G.choose_scope}));return}Array.isArray(G.lines)&&f(he=>({...he,app:G.app??he.app,appName:G.app_name??he.appName,scope:G.scope??he.scope,scopes:G.scopes??he.scopes,lines:G.lines??[],chooser:void 0}))}},[]);we(()=>j(e?.structuredContent),[e,j]);let b=U=>U==="live"?{}:U==="custom"?{start_time:El(x.current?.value),end_time:El(k.current?.value)}:{start_time:El(Ul(new Date(Date.now()-(gf[U]??36e5))))},I=Fe(async(U={})=>{let{app:G,scope:he}=g.current;if(!G)return;let Kr={app:G,lines:100},Dl=U.scope??he;Dl&&(Kr.scope=Dl),U.start_time&&(Kr.start_time=U.start_time),U.end_time&&(Kr.end_time=U.end_time);try{j((await r(Su.applicationLogList,Kr)).structuredContent),u(new Date().toISOString())}catch(hf){f(vf=>({...vf,note:i("logs.refreshFailed",{message:wu(hf)})}))}},[j,r,i]),O=ve(I);O.current=I,we(()=>{if(!a||d==="custom")return;let U=()=>{O.current(b(d))},G=setInterval(U,4e3);return U(),()=>clearInterval(G)},[a,d]);let le=ve(!1);we(()=>{le.current||!n||!_.app||(le.current=!0,!_.chooser&&!a&&O.current(b(d)))},[n,_.app,_.chooser]);let Re=U=>{l(U),a||I(b(U))},Ee=()=>{l("custom"),s(!1),I(b("custom"))},Ue=pt(()=>{let U=t.toLowerCase();return U?_.lines.filter(G=>(G.message??"").toLowerCase().includes(U)):_.lines},[_.lines,t]),xe=_.scope?i("logs.scopeSuffix",{scope:_.scope}):"";return e?h(af,{value:i,children:h(Ol,{children:[h(Rl,{children:[h("div",{className:"title grow",children:_.appName?i("logs.title",{app:_.appName}):i("logs.heading")}),a&&p?h("span",{className:"live",children:[h("span",{className:"live-dot"}),i("logs.updated",{time:dt(p,"time")})]}):null,h(Ge,{variant:"small",className:"hasicon",on:a,disabled:d==="custom",onClick:()=>s(U=>!U),children:[h(Ke,{name:a?"pause":"play"})," ",i("logs.live")]}),h(Ge,{variant:"small",className:"hasicon",title:i("logs.refresh"),"aria-label":i("logs.refresh"),onClick:()=>{I(b(d))},children:h(Ke,{name:"refresh"})})]}),_.chooser?h(mf,{scopes:_.chooser,onPick:U=>{f(G=>({...G,scope:U,chooser:void 0})),I({scope:U,...b(d)})}}):h(V,{children:[h("div",{className:"toolbar",children:[_.scopes?.length?h("select",{value:_.scope??"",onChange:U=>{let G=U.target.value;f(he=>({...he,scope:G})),I({scope:G,...b(d)})},children:_.scopes.map(U=>h("option",{value:U.name,children:U.name},U.name))}):null,h(J_,{value:d,fromRef:x,toRef:k,onPreset:Re,onApplyCustom:Ee}),h("input",{className:"grow",type:"text",placeholder:i("logs.filter"),value:t,style:{minWidth:160},onChange:U=>o(U.target.value)})]}),h(df,{lines:Ue,follow:a&&d!=="custom",empty:i(t?"logs.noMatch":"logs.empty"),minHeight:240})]}),h(uf,{children:_.note??i("logs.count",{count:Ue.length,scope:xe})})]})}):h(pf,{variant:"logs"})}lf(h(B_,{}));})();
830
830
  </script></body></html>
@@ -1,8 +1,8 @@
1
1
  {
2
- "create-app": "ui://widgets/create-app.3e6a9841.html",
3
- "find-apps": "ui://widgets/find-apps.eb69dbc9.html",
4
- "logs": "ui://widgets/logs.35997696.html",
5
- "metrics": "ui://widgets/metrics.f0094a1b.html",
6
- "np-panel": "ui://widgets/np-panel.b175395a.html",
7
- "params": "ui://widgets/params.b8319d2a.html"
2
+ "create-app": "ui://widgets/create-app.3e48aafa.html",
3
+ "find-apps": "ui://widgets/find-apps.cfe2ced1.html",
4
+ "logs": "ui://widgets/logs.04cce1fa.html",
5
+ "metrics": "ui://widgets/metrics.35226fea.html",
6
+ "np-panel": "ui://widgets/np-panel.505fbd50.html",
7
+ "params": "ui://widgets/params.b1c84ea9.html"
8
8
  }
@@ -824,6 +824,6 @@ Boolean requesting whether a visible border and background is provided by the ho
824
824
  - "model": Tool visible to and callable by the agent
825
825
  - "app": Tool callable by the app from this server only`),csp:c.never().optional(),permissions:c.never().optional()}),$S=c.object({mimeTypes:c.array(c.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),kS=c.object({method:c.literal("ui/download-file"),params:c.object({contents:c.array(c.union([fu,gu])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),zS=c.object({method:c.literal("ui/message"),params:c.object({role:c.literal("user").describe('Message role, currently only "user" is supported.'),content:c.array(Mt).describe("Message content blocks (text, image, etc.).")})}),SS=c.object({method:c.literal("ui/notifications/sandbox-resource-ready"),params:c.object({html:c.string().describe("HTML content to load into the inner iframe."),sandbox:c.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:zu.optional().describe("CSP configuration from resource metadata."),permissions:Su.optional().describe("Sandbox permissions from resource metadata.")})}),b_=c.object({method:c.literal("ui/notifications/tool-result"),params:Ft.describe("Standard MCP tool execution result.")}),Fm=c.object({toolInfo:c.object({id:Ct.optional().describe("JSON-RPC id of the tools/call request."),tool:Qo.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:o_.optional().describe("Current color theme preference."),styles:f_.optional().describe("Style configuration for theming the app."),displayMode:Fr.optional().describe("How the UI is currently displayed."),availableDisplayModes:c.array(Fr).optional().describe("Display modes the host supports."),containerDimensions:c.union([c.object({height:c.number().describe("Fixed container height in pixels.")}),c.object({maxHeight:c.union([c.number(),c.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(c.union([c.object({width:c.number().describe("Fixed container width in pixels.")}),c.object({maxWidth:c.union([c.number(),c.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
826
826
  container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:c.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:c.string().optional().describe("User's timezone in IANA format."),userAgent:c.string().optional().describe("Host application identifier."),platform:c.union([c.literal("web"),c.literal("desktop"),c.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:c.object({touch:c.boolean().optional().describe("Whether the device supports touch input."),hover:c.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:c.object({top:c.number().describe("Top safe area inset in pixels."),right:c.number().describe("Right safe area inset in pixels."),bottom:c.number().describe("Bottom safe area inset in pixels."),left:c.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),x_=c.object({method:c.literal("ui/notifications/host-context-changed"),params:Fm.describe("Partial context update containing only changed fields.")}),wS=c.object({method:c.literal("ui/update-model-context"),params:c.object({content:c.array(Mt).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:c.record(c.string(),c.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),IS=c.object({method:c.literal("ui/initialize"),params:c.object({appInfo:Er.describe("App identification (name and version)."),appCapabilities:v_.describe("Features and capabilities this app provides."),protocolVersion:c.string().describe("Protocol version this app supports.")})}),$_=c.object({protocolVersion:c.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Er.describe("Host application identification and version."),hostCapabilities:h_.describe("Features and capabilities provided by the host."),hostContext:Fm.describe("Rich context about the host environment.")}).passthrough(),k_={target:"draft-2020-12"};async function Lm(e,r){let n=e["~standard"];if(n.jsonSchema)return n.jsonSchema[r](k_);if(n.vendor==="zod"){let{z:i}=await Promise.resolve().then(()=>(Tr(),tu));return i.toJSONSchema(e,{io:r})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Mm(e,r,n=""){let i=await e["~standard"].validate(r);if(i.issues){let t=i.issues.map(o=>{let a=o.path?.map(s=>typeof s=="object"?s.key:s).join(".");return a?`${a}: ${o.message}`:o.message}).join("; ");throw Error(n+t)}return i.value}function qm(e,r=document.documentElement){for(let[n,i]of Object.entries(e))i!==void 0&&r.style.setProperty(n,i)}function Hm(e){if(document.getElementById("__mcp-host-fonts"))return;let r=document.createElement("style");r.id="__mcp-host-fonts",r.textContent=e,document.head.appendChild(r)}var ei=class ei extends $u{constructor(n,i={},t={autoResize:!0}){super(t);L(this,"_appInfo");L(this,"_capabilities");L(this,"options");L(this,"_hostCapabilities");L(this,"_hostInfo");L(this,"_hostContext");L(this,"_registeredTools",{});L(this,"_initializedSent",!1);L(this,"eventSchemas",{toolinput:l_,toolinputpartial:p_,toolresult:b_,toolcancelled:d_,hostcontextchanged:x_});L(this,"_everHadListener",new Set);L(this,"_toolHandlersInitialized",!1);L(this,"_onteardown");L(this,"_oncalltool");L(this,"_onlisttools");L(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=i,this.options=t,t.allowUnsafeEval||c.config({jitless:!0}),this.setRequestHandler(Zt,o=>(console.log("Received ping:",o.params),{})),this.setEventHandler("hostcontextchanged",void 0)}_assertInitialized(n){if(this._initializedSent)return;let i=`[ext-apps] App.${n}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(i);console.warn(`${i}. This will throw in a future release.`)}_assertHandlerTiming(n){if(!ei.ONE_SHOT_EVENTS.has(n)||this._everHadListener.has(n)||(this._everHadListener.add(n),!this._initializedSent))return;let i=`[ext-apps] "${String(n)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(i);console.warn(i)}setEventHandler(n,i){i&&this._assertHandlerTiming(n),super.setEventHandler(n,i)}addEventListener(n,i){this._assertHandlerTiming(n),super.addEventListener(n,i)}onEventDispatch(n,i){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...i})}registerCapabilities(n){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=Cm(this._capabilities,n)}registerTool(n,i,t){if(this._registeredTools[n])throw Error(`Tool ${n} is already registered`);let o=this,a=()=>{o._initializedSent&&o._capabilities.tools?.listChanged&&o.sendToolListChanged()},s=i.inputSchema!==void 0,l={title:i.title,description:i.description,inputSchema:i.inputSchema,outputSchema:i.outputSchema,annotations:i.annotations,_meta:i._meta,enabled:!0,enable(){this.enabled=!0,a()},disable(){this.enabled=!1,a()},update(p){Object.assign(this,p),a()},remove(){o._registeredTools[n]===l&&(delete o._registeredTools[n],a())},handler:async(p,f)=>{if(!l.enabled)throw Error(`Tool ${n} is disabled`);let u;if(s){let v=l.inputSchema,g=v?await Mm(v,p??{},`Invalid input for tool ${n}: `):p??{};u=await t(g,f)}else u=await t(f);return l.outputSchema&&!u.isError&&(u.structuredContent=await Mm(l.outputSchema,u.structuredContent,`Invalid output for tool ${n}: `)),u}};return this._registeredTools[n]=l,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),a(),l}ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(n,i)=>{let t=this._registeredTools[n.name];if(!t)throw Error(`Tool ${n.name} not found`);return t.handler(n.arguments,i)},this.onlisttools=async(n,i)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([t,o])=>o.enabled).map(async([t,o])=>{let a={name:t,title:o.title,description:o.description,inputSchema:o.inputSchema?await Lm(o.inputSchema,"input"):{type:"object",properties:{}}};return o.outputSchema&&(a.outputSchema=await Lm(o.outputSchema,"output")),o.annotations&&(a.annotations=o.annotations),o._meta&&(a._meta=o._meta),a}))}))}async sendToolListChanged(n={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:n})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(g_,(i,t)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(i.params,t)})}get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(vu,(i,t)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(i.params,t)})}get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(hu,(i,t)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(i.params,t)})}assertCapabilityForMethod(n){switch(n){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${n})`);break}}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,i){if(this._assertInitialized("callServerTool"),typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},Ft,{onprogress:()=>{},resetTimeoutOnProgress:!0,...i})}async readServerResource(n,i){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:n},lu,i)}async listServerResources(n,i){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:n},cu,i)}async createSamplingMessage(n,i){this._assertInitialized("createSamplingMessage");let t=n.tools?yu:_u;return await this.request({method:"sampling/createMessage",params:n},t,i)}sendMessage(n,i){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:n},u_,i)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,i){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:n},Mo,i)}openLink(n,i){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:n},s_,i)}downloadFile(n,i){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:n},c_,i)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,i){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:n},__,i)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,i=0,t=0,o=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let s=document.documentElement,l=s.style.height;s.style.height="max-content";let p=Math.ceil(s.getBoundingClientRect().height);s.style.height=l;let f=Math.ceil(window.innerWidth);(f!==i||p!==t)&&(i=f,t=p,this.sendSizeChanged({width:f,height:p}))}))};o();let a=new ResizeObserver(o);return a.observe(document.documentElement),a.observe(document.body),()=>a.disconnect()}async connect(n=new ku(window.parent,window.parent),i){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(n);try{let t=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:r_}},$_,i);if(t===void 0)throw Error(`Server sent invalid initialize result: ${t}`);this._hostCapabilities=t.hostCapabilities,this._hostInfo=t.hostInfo,this._hostContext=t.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(t){throw this.close(),t}}};L(ei,"ONE_SHOT_EVENTS",new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]));var Xo=ei;function z_(e){if(!e)return;let r=e.trim().toLowerCase(),n,i,t,o=/^#([0-9a-f]{3}|[0-9a-f]{6})$/.exec(r)?.[1];if(o){let a=o.length===3?o.split("").map(s=>s+s).join(""):o;n=parseInt(a.slice(0,2),16),i=parseInt(a.slice(2,4),16),t=parseInt(a.slice(4,6),16)}else{let a=/^rgba?\(\s*([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)/.exec(r);a&&([n,i,t]=[Number(a[1]),Number(a[2]),Number(a[3])]);let s=/^hsla?\(\s*[\d.]+[ ,]+[\d.]+%?[ ,]+([\d.]+)%/.exec(r);if(s)return Number(s[1])/100}if(!(n===void 0||i===void 0||t===void 0))return(.2126*n+.7152*i+.0722*t)/255}function Vm(e){if(!e)return;let r=document.documentElement,n=e.theme==="dark"||e.theme==="light"?e.theme:void 0,i=e.styles?.variables;if(!n&&i){let t=z_(i["--color-background-primary"]??i["--color-background-secondary"]);t!==void 0&&(n=t<.5?"dark":"light")}n&&(r.classList.toggle("dark",n==="dark"),r.classList.toggle("light",n==="light"),r.style.colorScheme=n);try{i&&qm(i),e.styles?.css?.fonts&&Hm(e.styles.css.fonts)}catch{}console.debug("[np-widget] theme:",e.theme,"->",n??"os-fallback","| tokens:",!!i,"| fonts:",!!e.styles?.css?.fonts)}function Jm(e){let[r,n]=Ue(null),[i,t]=Ue(!1),o=Ee(null);Pe(()=>{let p=new Xo({name:e,version:"0.3.0"},{},{autoResize:!0});o.current=p,p.ontoolresult=f=>n(f),p.onhostcontextchanged=f=>Vm(f),p.connect().then(()=>{Vm(p.getHostContext()),t(!0)}).catch(()=>t(!1))},[e]);let a=De(async(p,f)=>{if(!o.current)throw new Error("not connected");return await o.current.callServerTool({name:p,arguments:f})},[]),s=De(p=>{o.current?.sendMessage({role:"user",content:[{type:"text",text:p}]}).catch(()=>{})},[]),l=De(p=>{try{o.current?.updateModelContext({content:[{type:"text",text:p}]}).catch(()=>{})}catch{}},[]);return{result:r,call:a,send:s,brief:l,connected:i}}var S_={"confirm.yes":"Yes, do it","confirm.no":"Cancel","chooser.pick":"pick a scope:","term.empty":"no output yet\u2026","term.copyLine":"copy line",hint:"Next:","panel.scopes":"Scopes","panel.releases":"Releases","panel.latestBuild":"Latest build","panel.noScopes":"No scopes yet \u2014 create one to have somewhere to deploy.","panel.scopePlaceholder":"scope name, e.g. dev","panel.typePlaceholder":"type\u2026","panel.createScope":"Create scope","panel.ship":"ship","panel.live":"live","panel.openRollout":"Open rollout","panel.nothingDeployed":"nothing deployed","panel.noReleases":"none yet","panel.noBuild":"none \u2014 push a commit so CI builds","panel.deployLatest":"Deploy latest","panel.logs":"Logs","panel.metrics":"Metrics","panel.pickType":"Pick a scope type and create again.","panel.waitingData":"waiting for data\u2026","panel.backToList":"apps","rollout.deployingTo":"Deploying to {scope}","rollout.release":"release","rollout.backToApp":"app","rollout.trafficLabel":"Traffic on new version","rollout.live":"{pct}% live","rollout.movingTo":"moving to {pct}%","rollout.move":"Move traffic","rollout.finalize":"Finalize","rollout.rollback":"Rollback","rollout.confirmFinalize":"Finalize and retire the old version?","rollout.confirmRollback":"Return ALL traffic to the previous version?","rollout.log":"Deployment log","rollout.waiting":"waiting for activity\u2026","rollout.failed":"Failed: {message}","rollout.deployment":"Deployment #{id}","rollout.busyMove":"Moving traffic\u2026","rollout.busyFinalize":"Finalizing\u2026","rollout.busyRollback":"Rolling back\u2026","rollout.autoDone":"Done \u2014 the release is fully live.","rollout.autoRolledBack":"Rolled back \u2014 previous version is serving traffic.","rollout.autoFailed":"Deployment failed \u2014 previous version keeps serving.","rollout.autoWaiting":"Waiting for instances \u2014 controls unlock when the rollout is running.","rollout.autoFull":"All traffic on the new version \u2014 finalize to retire the old one.","rollout.autoLabel":"Auto-advance","rollout.autoOff":"off","rollout.trafficHelp":"Drag to move traffic now; auto-advance ramps it to 100%.","rollout.appLogs":"Application logs","rollout.appLogsEmpty":"no application logs yet\u2026","logs.title":"{app} \xB7 logs","logs.heading":"Logs","logs.filter":"filter\u2026","logs.live":"live","logs.refresh":"Refresh","logs.updated":"updated {time}","logs.wrap":"Wrap","logs.copyAll":"Copy all","logs.copied":"Copied","logs.rangeLive":"Live","logs.range15m":"Last 15m","logs.range1h":"Last 1h","logs.range6h":"Last 6h","logs.range24h":"Last 24h","logs.rangeCustom":"Custom\u2026","logs.apply":"Apply","logs.from":"From","logs.to":"To","logs.empty":"no log lines yet\u2026","logs.noMatch":"nothing matches the filter","logs.count":"{count} line(s){scope}","logs.scopeSuffix":" \xB7 scope {scope}","logs.refreshFailed":"refresh failed: {message}","metrics.title":"{app} \xB7 {scope} metrics","metrics.heading":"Metrics","metrics.live":"live","metrics.loading":"loading {window}\u2026","metrics.refreshFailed":"refresh failed: {message}","metrics.noData":"no datapoints in this window","metrics.avgMax":"avg {avg} \xB7 max {max}","params.title":"{app} \xB7 parameters","params.heading":"Parameters","params.name":"Name","params.value":"Value","params.secret":"Secret","params.add":"+ Add","params.save":"Save changes","params.applyNote":"Changed values apply on the next deploy.","params.unavailable":"Existing values can't be listed here \u2014 new ones can still be added below.","params.saving":"Saving {count} parameter(s)\u2026","params.saved":"Saved \u2014 values apply on the next deploy.","params.saveFailed":"Save failed: {message}","createApp.title":"Create application","createApp.name":"Name","createApp.namespace":"Namespace","createApp.repository":"Repository","createApp.newRepo":"New repository","createApp.importRepo":"Import existing","createApp.template":"Template","createApp.noTemplates":"No templates available","createApp.repoUrl":"Repository URL","createApp.editName":"Customize the repository name","createApp.lockName":"Reset to the generated name","createApp.importUrl":"Existing repository URL","createApp.monorepo":"This repository is a monorepo","createApp.appPath":"Application path inside the repository","createApp.submit":"Create application","createApp.needName":"Name is required.","createApp.needNamespace":"Pick a namespace.","createApp.needTemplate":"Pick a template for the new repository.","createApp.needImportUrl":"Enter the repository URL to import.","createApp.noBaseUrl":"This account has no git provider configured \u2014 use \u201CImport existing\u201D.","createApp.creating":"Creating {name}\u2026 (links the repo, wires CI \u2014 takes a few seconds)","createApp.failed":"Failed: {message}","createApp.created":`{name} created (#{id}, {status}).
827
- Push a commit to trigger the first build, then deploy.`,"findApps.count":"{count} application(s)","findApps.filter":"filter\u2026","findApps.across":"across {ns} namespace(s)","findApps.noMatch":"Nothing matches the filter.","findApps.page":"{from}\u2013{to} of {total}","findApps.prevPage":"Previous page","findApps.nextPage":"Next page","findApps.hint":"Click an application to open its panel."},w_={"confirm.yes":"S\xED, hacelo","confirm.no":"Cancelar","chooser.pick":"eleg\xED un scope:","term.empty":"sin salida todav\xEDa\u2026","term.copyLine":"copiar l\xEDnea",hint:"Siguiente:","panel.scopes":"Scopes","panel.releases":"Releases","panel.latestBuild":"\xDAltimo build","panel.noScopes":"Sin scopes todav\xEDa \u2014 cre\xE1 uno para tener d\xF3nde deployar.","panel.scopePlaceholder":"nombre del scope, p. ej. dev","panel.typePlaceholder":"tipo\u2026","panel.createScope":"Crear scope","panel.ship":"publicar","panel.live":"en vivo","panel.openRollout":"Abrir rollout","panel.nothingDeployed":"nada deployado","panel.noReleases":"ninguna todav\xEDa","panel.noBuild":"ninguno \u2014 pushe\xE1 un commit para que CI compile","panel.deployLatest":"Deployar lo \xFAltimo","panel.logs":"Logs","panel.metrics":"M\xE9tricas","panel.pickType":"Eleg\xED un tipo de scope y cre\xE1 de nuevo.","panel.waitingData":"esperando datos\u2026","panel.backToList":"apps","rollout.deployingTo":"Deployando a {scope}","rollout.release":"release","rollout.backToApp":"app","rollout.trafficLabel":"Tr\xE1fico en la versi\xF3n nueva","rollout.live":"{pct}% en vivo","rollout.movingTo":"yendo a {pct}%","rollout.move":"Mover tr\xE1fico","rollout.finalize":"Finalizar","rollout.rollback":"Revertir","rollout.confirmFinalize":"\xBFFinalizar y retirar la versi\xF3n anterior?","rollout.confirmRollback":"\xBFDevolver TODO el tr\xE1fico a la versi\xF3n anterior?","rollout.log":"Log del deployment","rollout.waiting":"esperando actividad\u2026","rollout.failed":"Fall\xF3: {message}","rollout.deployment":"Deployment #{id}","rollout.busyMove":"Moviendo tr\xE1fico\u2026","rollout.busyFinalize":"Finalizando\u2026","rollout.busyRollback":"Revirtiendo\u2026","rollout.autoDone":"Listo \u2014 la release est\xE1 completamente en vivo.","rollout.autoRolledBack":"Revertido \u2014 la versi\xF3n anterior est\xE1 sirviendo tr\xE1fico.","rollout.autoFailed":"El deployment fall\xF3 \u2014 la versi\xF3n anterior sigue sirviendo.","rollout.autoWaiting":"Esperando instancias \u2014 los controles se habilitan cuando el rollout est\xE1 corriendo.","rollout.autoFull":"Todo el tr\xE1fico en la versi\xF3n nueva \u2014 finaliz\xE1 para retirar la anterior.","rollout.autoLabel":"Auto-avance","rollout.autoOff":"off","rollout.trafficHelp":"Arrastr\xE1 para mover el tr\xE1fico ahora; el auto-avance sube hasta 100%.","rollout.appLogs":"Logs de la aplicaci\xF3n","rollout.appLogsEmpty":"sin logs de la aplicaci\xF3n todav\xEDa\u2026","logs.title":"{app} \xB7 logs","logs.heading":"Logs","logs.filter":"filtrar\u2026","logs.live":"vivo","logs.refresh":"Refrescar","logs.updated":"actualizado {time}","logs.wrap":"Ajustar","logs.copyAll":"Copiar todo","logs.copied":"Copiado","logs.rangeLive":"En vivo","logs.range15m":"\xDAltimos 15m","logs.range1h":"\xDAltima 1h","logs.range6h":"\xDAltimas 6h","logs.range24h":"\xDAltimas 24h","logs.rangeCustom":"Personalizado\u2026","logs.apply":"Aplicar","logs.from":"Desde","logs.to":"Hasta","logs.empty":"sin l\xEDneas de log todav\xEDa\u2026","logs.noMatch":"nada coincide con el filtro","logs.count":"{count} l\xEDnea(s){scope}","logs.scopeSuffix":" \xB7 scope {scope}","logs.refreshFailed":"fall\xF3 el refresh: {message}","metrics.title":"{app} \xB7 m\xE9tricas de {scope}","metrics.heading":"M\xE9tricas","metrics.live":"vivo","metrics.loading":"cargando {window}\u2026","metrics.refreshFailed":"fall\xF3 el refresh: {message}","metrics.noData":"sin datapoints en esta ventana","metrics.avgMax":"prom {avg} \xB7 m\xE1x {max}","params.title":"{app} \xB7 par\xE1metros","params.heading":"Par\xE1metros","params.name":"Nombre","params.value":"Valor","params.secret":"Secreto","params.add":"+ Agregar","params.save":"Guardar cambios","params.applyNote":"Los valores cambiados aplican en el pr\xF3ximo deploy.","params.unavailable":"Los valores existentes no se pueden listar ac\xE1 \u2014 igual pod\xE9s agregar nuevos abajo.","params.saving":"Guardando {count} par\xE1metro(s)\u2026","params.saved":"Guardado \u2014 los valores aplican en el pr\xF3ximo deploy.","params.saveFailed":"Fall\xF3 el guardado: {message}","createApp.title":"Crear aplicaci\xF3n","createApp.name":"Nombre","createApp.namespace":"Namespace","createApp.repository":"Repositorio","createApp.newRepo":"Nuevo repositorio","createApp.importRepo":"Importar existente","createApp.template":"Template","createApp.noTemplates":"Sin templates disponibles","createApp.repoUrl":"URL del repositorio","createApp.editName":"Personalizar el nombre del repositorio","createApp.lockName":"Volver al nombre generado","createApp.importUrl":"URL del repositorio existente","createApp.monorepo":"Este repositorio es un monorepo","createApp.appPath":"Ruta de la aplicaci\xF3n dentro del repositorio","createApp.submit":"Crear aplicaci\xF3n","createApp.needName":"El nombre es obligatorio.","createApp.needNamespace":"Eleg\xED un namespace.","createApp.needTemplate":"Eleg\xED un template para el nuevo repositorio.","createApp.needImportUrl":"Ingres\xE1 la URL del repositorio a importar.","createApp.noBaseUrl":"Esta cuenta no tiene proveedor de git configurado \u2014 us\xE1 \u201CImportar existente\u201D.","createApp.creating":"Creando {name}\u2026 (vincula el repo, conecta CI \u2014 tarda unos segundos)","createApp.failed":"Fall\xF3: {message}","createApp.created":`{name} creada (#{id}, {status}).
828
- Pushe\xE1 un commit para disparar el primer build y despu\xE9s deploy\xE1.`,"findApps.count":"{count} aplicaci\xF3n(es)","findApps.filter":"filtrar\u2026","findApps.across":"en {ns} namespace(s)","findApps.noMatch":"Nada coincide con el filtro.","findApps.page":"{from}\u2013{to} de {total}","findApps.prevPage":"P\xE1gina anterior","findApps.nextPage":"P\xE1gina siguiente","findApps.hint":"Hac\xE9 clic en una aplicaci\xF3n para abrir su panel."},I_={en:S_,es:w_};function Bm(e){return e?.structuredContent?._locale==="es"?"es":"en"}function Wm(e){let r=I_[e];return(n,i)=>r[n].replace(/\{(\w+)\}/g,(t,o)=>i?.[o]!==void 0?String(i[o]):t)}var Km=Gr(Wm("en")),Gm=Km.Provider,Qm=()=>fi(Km),Ym=e=>Wm(e);function Xm(e){return{render:function(r){fl(r,e)},unmount:function(){hl(e)}}}function ef(e){let r=document.getElementById("root");r&&Xm(r).render(e)}var P_=0;function _(e,r,n,i,t,o){r||(r={});var a,s,l=r;if("ref"in l)for(s in l={},r)s=="ref"?a=r[s]:l[s]=r[s];var p={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--P_,__i:-1,__u:0,__source:t,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return R.vnode&&R.vnode(p),p}var j_={clock:{body:_(W,{children:[_("circle",{cx:"12",cy:"12",r:"10"}),_("polyline",{points:"12 6 12 12 16 14"})]})},play:{fill:!0,body:_("polygon",{points:"6 3 20 12 6 21 6 3"})},pause:{fill:!0,body:_(W,{children:[_("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),_("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]})},refresh:{body:_(W,{children:[_("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),_("polyline",{points:"21 3 21 8 16 8"})]})},rocket:{body:_(W,{children:[_("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),_("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),_("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),_("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})},logs:{body:_(W,{children:[_("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),_("polyline",{points:"14 2 14 8 20 8"}),_("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),_("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),_("line",{x1:"10",y1:"9",x2:"8",y2:"9"})]})},metrics:{body:_(W,{children:[_("polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17"}),_("polyline",{points:"16 7 22 7 22 13"})]})},lock:{body:_(W,{children:[_("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),_("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})},edit:{body:_("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})},copy:{body:_(W,{children:[_("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),_("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})},check:{body:_("polyline",{points:"20 6 9 17 4 12"})},chevronDown:{body:_("polyline",{points:"6 9 12 15 18 9"})},chevronLeft:{body:_("polyline",{points:"15 18 9 12 15 6"})},chevronRight:{body:_("polyline",{points:"9 18 15 12 9 6"})},arrowLeft:{body:_(W,{children:[_("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),_("polyline",{points:"12 19 5 12 12 5"})]})}},wu=({name:e,size:r=14,className:n})=>{let i=j_[e];return _("svg",{className:["icon",n].filter(Boolean).join(" "),width:r,height:r,viewBox:"0 0 24 24",fill:i.fill?"currentColor":"none",stroke:i.fill?"none":"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:i.body})};var Iu=({children:e})=>_("div",{className:"card",children:e}),Pu=({children:e})=>_("div",{className:"row",children:e});var tf=({tone:e,children:r})=>_("div",{className:`note${e?` ${e}`:""}`,children:r});var ti=({variant:e,on:r,className:n,...i})=>_("button",{className:[e,r?"on":"",n].filter(Boolean).join(" "),...i});var Q=({w:e="100%",h:r=12,r:n=6})=>_("div",{className:"skel",style:{width:e,height:r,borderRadius:n}}),rf=({variant:e})=>_(Iu,{children:[_(Pu,{children:[_(Q,{w:170,h:16}),e!=="form"&&_(W,{children:[_("div",{className:"grow"}),_(Q,{w:110,h:28,r:8})]})]}),e==="list"&&_("div",{className:"skel-rows",children:[0,1,2,3,4,5].map(r=>_("div",{className:"skel-row",children:[_(Q,{w:8,h:8,r:999}),_(Q,{w:140,h:13}),_("div",{className:"grow"}),_(Q,{w:90,h:11})]},r))}),e==="panel"&&_(W,{children:[_("div",{className:"section",children:[_(Q,{w:64,h:10}),_("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:10},children:[0,1].map(r=>_("div",{className:"skel-card",children:[_(Q,{w:r?"45%":"55%",h:14}),_("div",{style:{height:8}}),_(Q,{w:r?"70%":"85%",h:11})]},r))})]}),_("div",{className:"section",children:[_(Q,{w:64,h:10}),_("div",{style:{marginTop:10,display:"flex",gap:8},children:[0,1,2].map(r=>_(Q,{w:72,h:24,r:999},r))})]}),_("div",{className:"section",style:{display:"flex",gap:8},children:[_(Q,{w:132,h:34,r:9}),_(Q,{w:80,h:34,r:9})]})]}),e==="table"&&_("div",{className:"skel-rows",children:[0,1,2,3].map(r=>_("div",{className:"skel-row",children:[_(Q,{w:"30%",h:13}),_("div",{className:"grow"}),_(Q,{w:"42%",h:13}),_(Q,{w:18,h:13})]},r))}),e==="grid"&&_("div",{className:"skel-grid",children:[0,1,2,3].map(r=>_("div",{className:"skel-card",children:[_(Q,{w:"50%",h:10}),_("div",{style:{height:8}}),_(Q,{w:"35%",h:20}),_("div",{style:{height:8}}),_(Q,{w:"100%",h:40,r:8})]},r))}),e==="logs"&&_("div",{style:{marginTop:14},children:_(Q,{w:"100%",h:150,r:10})}),e==="form"&&_("div",{className:"skel-rows",children:[[0,1,2].map(r=>_("div",{children:[_(Q,{w:88,h:10}),_("div",{style:{height:7}}),_(Q,{w:"100%",h:32,r:8})]},r)),_(Q,{w:150,h:34,r:9})]})]});var nf=({points:e})=>{let r=Ee(null);return Pe(()=>{let n=r.current;if(!n)return;let i=window.devicePixelRatio||1,t=n.clientWidth||200,o=n.clientHeight||44;n.width=t*i,n.height=o*i;let a=n.getContext("2d");if(!a)return;a.scale(i,i),a.clearRect(0,0,t,o);let s=getComputedStyle(document.documentElement);if(!e.length){a.fillStyle=s.getPropertyValue("--muted"),a.font="11px sans-serif",a.fillText("no data",4,o/2);return}let l=e.map(d=>d.v),p=Math.min(...l),f=Math.max(...l)-p||1,u=s.getPropertyValue("--accent").trim()||"#6366f1",v=d=>d/Math.max(1,e.length-1)*(t-4)+2,g=d=>o-5-(d-p)/f*(o-12);a.beginPath(),e.forEach((d,b)=>{b===0?a.moveTo(v(b),g(d.v)):a.lineTo(v(b),g(d.v))}),a.strokeStyle=u,a.lineWidth=1.6,a.stroke(),a.lineTo(v(e.length-1),o-2),a.lineTo(v(0),o-2),a.closePath(),a.globalAlpha=.12,a.fillStyle=u,a.fill(),a.globalAlpha=1},[e]),_("canvas",{ref:r})},of=({scopes:e,onPick:r})=>{let n=Qm();return _("div",{className:"row",style:{marginTop:10},children:[_("span",{className:"sub",children:n("chooser.pick")}),e.map(i=>_(ti,{variant:"small",onClick:()=>r(i.name),children:i.name},i.name))]})};var N_=["1h","3h","24h","7d"];function T_(){let{result:e,call:r,connected:n}=Jm("np-metrics"),i=Bm(e),t=Wt(()=>Ym(i),[i]),[o,a]=Ue(!1),[s,l]=Ue({win:"3h",series:[]}),p=Ee(s);p.current=s;let f=De(g=>{let d=g;if(d){if(Array.isArray(d.choose_scope)&&d.choose_scope.length){l(b=>({...b,app:d.app??b.app,appName:d.app_name??b.appName,chooser:d.choose_scope}));return}Array.isArray(d.series)&&l(b=>({...b,app:d.app??b.app,appName:d.app_name??b.appName,scope:d.scope??b.scope,win:d.window??b.win,series:d.series??[],chooser:void 0,note:d.series?.some(k=>k.points.length)?void 0:t("metrics.noData")}))}},[t]);Pe(()=>f(e?.structuredContent),[e,f]);let u=De(async(g={})=>{let{app:d,scope:b,win:k}=p.current;if(d){l(I=>({...I,note:t("metrics.loading",{window:g.win??k})}));try{let I={app:d,window:g.win??k};(g.scope??b)&&(I.scope=g.scope??b),f((await r(vl.applicationMetricList,I)).structuredContent)}catch(I){l(x=>({...x,note:t("metrics.refreshFailed",{message:_l(I)})}))}}},[f,r,t]);Pe(()=>{if(!o)return;let g=setInterval(()=>{u()},3e4);return u(),()=>clearInterval(g)},[o,u]);let v=Ee(!1);return Pe(()=>{v.current||!n||!s.app||(v.current=!0,!s.chooser&&!o&&u())},[n,s.app,s.chooser]),e?_(Gm,{value:t,children:_(Iu,{children:[_(Pu,{children:[_("div",{className:"title grow",children:s.appName?t("metrics.title",{app:s.appName,scope:s.scope??""}):t("metrics.heading")}),N_.map(g=>_(ti,{variant:"small",on:s.win===g,onClick:()=>{l(d=>({...d,win:g})),u({win:g})},children:g},g)),_(ti,{variant:"small",className:"hasicon",on:o,onClick:()=>a(g=>!g),children:[_(wu,{name:o?"pause":"play"})," ",t("metrics.live")]})]}),s.chooser?_(of,{scopes:s.chooser,onPick:g=>{l(d=>({...d,scope:g,chooser:void 0})),u({scope:g})}}):_("div",{className:"grid",children:s.series.map(g=>_("div",{className:"metric-card",children:[_("div",{className:"label",children:g.label}),_("div",{className:"val",children:[en(g.last)," ",_("small",{children:g.unit})]}),_(nf,{points:g.points}),_("div",{className:"sub",style:{marginTop:4,fontSize:11},children:t("metrics.avgMax",{avg:en(g.avg),max:en(g.max)})})]},g.id))}),_(tf,{children:s.note})]})}):_(rf,{variant:"grid"})}ef(_(T_,{}));})();
827
+ Push a commit to trigger the first build, then deploy.`,"findApps.count":"{count} application(s)","findApps.filter":"filter\u2026","findApps.across":"across {ns} namespace(s)","findApps.noMatch":"Nothing matches the filter.","findApps.loadMore":"Load {more} more","findApps.hint":"Click an application to open its panel."},w_={"confirm.yes":"S\xED, hacelo","confirm.no":"Cancelar","chooser.pick":"eleg\xED un scope:","term.empty":"sin salida todav\xEDa\u2026","term.copyLine":"copiar l\xEDnea",hint:"Siguiente:","panel.scopes":"Scopes","panel.releases":"Releases","panel.latestBuild":"\xDAltimo build","panel.noScopes":"Sin scopes todav\xEDa \u2014 cre\xE1 uno para tener d\xF3nde deployar.","panel.scopePlaceholder":"nombre del scope, p. ej. dev","panel.typePlaceholder":"tipo\u2026","panel.createScope":"Crear scope","panel.ship":"publicar","panel.live":"en vivo","panel.openRollout":"Abrir rollout","panel.nothingDeployed":"nada deployado","panel.noReleases":"ninguna todav\xEDa","panel.noBuild":"ninguno \u2014 pushe\xE1 un commit para que CI compile","panel.deployLatest":"Deployar lo \xFAltimo","panel.logs":"Logs","panel.metrics":"M\xE9tricas","panel.pickType":"Eleg\xED un tipo de scope y cre\xE1 de nuevo.","panel.waitingData":"esperando datos\u2026","panel.backToList":"apps","rollout.deployingTo":"Deployando a {scope}","rollout.release":"release","rollout.backToApp":"app","rollout.trafficLabel":"Tr\xE1fico en la versi\xF3n nueva","rollout.live":"{pct}% en vivo","rollout.movingTo":"yendo a {pct}%","rollout.move":"Mover tr\xE1fico","rollout.finalize":"Finalizar","rollout.rollback":"Revertir","rollout.confirmFinalize":"\xBFFinalizar y retirar la versi\xF3n anterior?","rollout.confirmRollback":"\xBFDevolver TODO el tr\xE1fico a la versi\xF3n anterior?","rollout.log":"Log del deployment","rollout.waiting":"esperando actividad\u2026","rollout.failed":"Fall\xF3: {message}","rollout.deployment":"Deployment #{id}","rollout.busyMove":"Moviendo tr\xE1fico\u2026","rollout.busyFinalize":"Finalizando\u2026","rollout.busyRollback":"Revirtiendo\u2026","rollout.autoDone":"Listo \u2014 la release est\xE1 completamente en vivo.","rollout.autoRolledBack":"Revertido \u2014 la versi\xF3n anterior est\xE1 sirviendo tr\xE1fico.","rollout.autoFailed":"El deployment fall\xF3 \u2014 la versi\xF3n anterior sigue sirviendo.","rollout.autoWaiting":"Esperando instancias \u2014 los controles se habilitan cuando el rollout est\xE1 corriendo.","rollout.autoFull":"Todo el tr\xE1fico en la versi\xF3n nueva \u2014 finaliz\xE1 para retirar la anterior.","rollout.autoLabel":"Auto-avance","rollout.autoOff":"off","rollout.trafficHelp":"Arrastr\xE1 para mover el tr\xE1fico ahora; el auto-avance sube hasta 100%.","rollout.appLogs":"Logs de la aplicaci\xF3n","rollout.appLogsEmpty":"sin logs de la aplicaci\xF3n todav\xEDa\u2026","logs.title":"{app} \xB7 logs","logs.heading":"Logs","logs.filter":"filtrar\u2026","logs.live":"vivo","logs.refresh":"Refrescar","logs.updated":"actualizado {time}","logs.wrap":"Ajustar","logs.copyAll":"Copiar todo","logs.copied":"Copiado","logs.rangeLive":"En vivo","logs.range15m":"\xDAltimos 15m","logs.range1h":"\xDAltima 1h","logs.range6h":"\xDAltimas 6h","logs.range24h":"\xDAltimas 24h","logs.rangeCustom":"Personalizado\u2026","logs.apply":"Aplicar","logs.from":"Desde","logs.to":"Hasta","logs.empty":"sin l\xEDneas de log todav\xEDa\u2026","logs.noMatch":"nada coincide con el filtro","logs.count":"{count} l\xEDnea(s){scope}","logs.scopeSuffix":" \xB7 scope {scope}","logs.refreshFailed":"fall\xF3 el refresh: {message}","metrics.title":"{app} \xB7 m\xE9tricas de {scope}","metrics.heading":"M\xE9tricas","metrics.live":"vivo","metrics.loading":"cargando {window}\u2026","metrics.refreshFailed":"fall\xF3 el refresh: {message}","metrics.noData":"sin datapoints en esta ventana","metrics.avgMax":"prom {avg} \xB7 m\xE1x {max}","params.title":"{app} \xB7 par\xE1metros","params.heading":"Par\xE1metros","params.name":"Nombre","params.value":"Valor","params.secret":"Secreto","params.add":"+ Agregar","params.save":"Guardar cambios","params.applyNote":"Los valores cambiados aplican en el pr\xF3ximo deploy.","params.unavailable":"Los valores existentes no se pueden listar ac\xE1 \u2014 igual pod\xE9s agregar nuevos abajo.","params.saving":"Guardando {count} par\xE1metro(s)\u2026","params.saved":"Guardado \u2014 los valores aplican en el pr\xF3ximo deploy.","params.saveFailed":"Fall\xF3 el guardado: {message}","createApp.title":"Crear aplicaci\xF3n","createApp.name":"Nombre","createApp.namespace":"Namespace","createApp.repository":"Repositorio","createApp.newRepo":"Nuevo repositorio","createApp.importRepo":"Importar existente","createApp.template":"Template","createApp.noTemplates":"Sin templates disponibles","createApp.repoUrl":"URL del repositorio","createApp.editName":"Personalizar el nombre del repositorio","createApp.lockName":"Volver al nombre generado","createApp.importUrl":"URL del repositorio existente","createApp.monorepo":"Este repositorio es un monorepo","createApp.appPath":"Ruta de la aplicaci\xF3n dentro del repositorio","createApp.submit":"Crear aplicaci\xF3n","createApp.needName":"El nombre es obligatorio.","createApp.needNamespace":"Eleg\xED un namespace.","createApp.needTemplate":"Eleg\xED un template para el nuevo repositorio.","createApp.needImportUrl":"Ingres\xE1 la URL del repositorio a importar.","createApp.noBaseUrl":"Esta cuenta no tiene proveedor de git configurado \u2014 us\xE1 \u201CImportar existente\u201D.","createApp.creating":"Creando {name}\u2026 (vincula el repo, conecta CI \u2014 tarda unos segundos)","createApp.failed":"Fall\xF3: {message}","createApp.created":`{name} creada (#{id}, {status}).
828
+ Pushe\xE1 un commit para disparar el primer build y despu\xE9s deploy\xE1.`,"findApps.count":"{count} aplicaci\xF3n(es)","findApps.filter":"filtrar\u2026","findApps.across":"en {ns} namespace(s)","findApps.noMatch":"Nada coincide con el filtro.","findApps.loadMore":"Cargar {more} m\xE1s","findApps.hint":"Hac\xE9 clic en una aplicaci\xF3n para abrir su panel."},I_={en:S_,es:w_};function Bm(e){return e?.structuredContent?._locale==="es"?"es":"en"}function Wm(e){let r=I_[e];return(n,i)=>r[n].replace(/\{(\w+)\}/g,(t,o)=>i?.[o]!==void 0?String(i[o]):t)}var Km=Gr(Wm("en")),Gm=Km.Provider,Qm=()=>fi(Km),Ym=e=>Wm(e);function Xm(e){return{render:function(r){fl(r,e)},unmount:function(){hl(e)}}}function ef(e){let r=document.getElementById("root");r&&Xm(r).render(e)}var P_=0;function _(e,r,n,i,t,o){r||(r={});var a,s,l=r;if("ref"in l)for(s in l={},r)s=="ref"?a=r[s]:l[s]=r[s];var p={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--P_,__i:-1,__u:0,__source:t,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return R.vnode&&R.vnode(p),p}var j_={clock:{body:_(W,{children:[_("circle",{cx:"12",cy:"12",r:"10"}),_("polyline",{points:"12 6 12 12 16 14"})]})},play:{fill:!0,body:_("polygon",{points:"6 3 20 12 6 21 6 3"})},pause:{fill:!0,body:_(W,{children:[_("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),_("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]})},refresh:{body:_(W,{children:[_("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),_("polyline",{points:"21 3 21 8 16 8"})]})},rocket:{body:_(W,{children:[_("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),_("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),_("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),_("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})},logs:{body:_(W,{children:[_("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),_("polyline",{points:"14 2 14 8 20 8"}),_("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),_("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),_("line",{x1:"10",y1:"9",x2:"8",y2:"9"})]})},metrics:{body:_(W,{children:[_("polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17"}),_("polyline",{points:"16 7 22 7 22 13"})]})},lock:{body:_(W,{children:[_("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),_("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})},edit:{body:_("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})},copy:{body:_(W,{children:[_("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),_("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})},check:{body:_("polyline",{points:"20 6 9 17 4 12"})},chevronDown:{body:_("polyline",{points:"6 9 12 15 18 9"})},chevronLeft:{body:_("polyline",{points:"15 18 9 12 15 6"})},chevronRight:{body:_("polyline",{points:"9 18 15 12 9 6"})},arrowLeft:{body:_(W,{children:[_("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),_("polyline",{points:"12 19 5 12 12 5"})]})}},wu=({name:e,size:r=14,className:n})=>{let i=j_[e];return _("svg",{className:["icon",n].filter(Boolean).join(" "),width:r,height:r,viewBox:"0 0 24 24",fill:i.fill?"currentColor":"none",stroke:i.fill?"none":"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:i.body})};var Iu=({children:e})=>_("div",{className:"card",children:e}),Pu=({children:e})=>_("div",{className:"row",children:e});var tf=({tone:e,children:r})=>_("div",{className:`note${e?` ${e}`:""}`,children:r});var ti=({variant:e,on:r,className:n,...i})=>_("button",{className:[e,r?"on":"",n].filter(Boolean).join(" "),...i});var Q=({w:e="100%",h:r=12,r:n=6})=>_("div",{className:"skel",style:{width:e,height:r,borderRadius:n}}),rf=({variant:e})=>_(Iu,{children:[_(Pu,{children:[_(Q,{w:170,h:16}),e!=="form"&&_(W,{children:[_("div",{className:"grow"}),_(Q,{w:110,h:28,r:8})]})]}),e==="list"&&_("div",{className:"skel-rows",children:[0,1,2,3,4,5].map(r=>_("div",{className:"skel-row",children:[_(Q,{w:8,h:8,r:999}),_(Q,{w:140,h:13}),_("div",{className:"grow"}),_(Q,{w:90,h:11})]},r))}),e==="panel"&&_(W,{children:[_("div",{className:"section",children:[_(Q,{w:64,h:10}),_("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:10},children:[0,1].map(r=>_("div",{className:"skel-card",children:[_(Q,{w:r?"45%":"55%",h:14}),_("div",{style:{height:8}}),_(Q,{w:r?"70%":"85%",h:11})]},r))})]}),_("div",{className:"section",children:[_(Q,{w:64,h:10}),_("div",{style:{marginTop:10,display:"flex",gap:8},children:[0,1,2].map(r=>_(Q,{w:72,h:24,r:999},r))})]}),_("div",{className:"section",style:{display:"flex",gap:8},children:[_(Q,{w:132,h:34,r:9}),_(Q,{w:80,h:34,r:9})]})]}),e==="table"&&_("div",{className:"skel-rows",children:[0,1,2,3].map(r=>_("div",{className:"skel-row",children:[_(Q,{w:"30%",h:13}),_("div",{className:"grow"}),_(Q,{w:"42%",h:13}),_(Q,{w:18,h:13})]},r))}),e==="grid"&&_("div",{className:"skel-grid",children:[0,1,2,3].map(r=>_("div",{className:"skel-card",children:[_(Q,{w:"50%",h:10}),_("div",{style:{height:8}}),_(Q,{w:"35%",h:20}),_("div",{style:{height:8}}),_(Q,{w:"100%",h:40,r:8})]},r))}),e==="logs"&&_("div",{style:{marginTop:14},children:_(Q,{w:"100%",h:150,r:10})}),e==="form"&&_("div",{className:"skel-rows",children:[[0,1,2].map(r=>_("div",{children:[_(Q,{w:88,h:10}),_("div",{style:{height:7}}),_(Q,{w:"100%",h:32,r:8})]},r)),_(Q,{w:150,h:34,r:9})]})]});var nf=({points:e})=>{let r=Ee(null);return Pe(()=>{let n=r.current;if(!n)return;let i=window.devicePixelRatio||1,t=n.clientWidth||200,o=n.clientHeight||44;n.width=t*i,n.height=o*i;let a=n.getContext("2d");if(!a)return;a.scale(i,i),a.clearRect(0,0,t,o);let s=getComputedStyle(document.documentElement);if(!e.length){a.fillStyle=s.getPropertyValue("--muted"),a.font="11px sans-serif",a.fillText("no data",4,o/2);return}let l=e.map(d=>d.v),p=Math.min(...l),f=Math.max(...l)-p||1,u=s.getPropertyValue("--accent").trim()||"#6366f1",v=d=>d/Math.max(1,e.length-1)*(t-4)+2,g=d=>o-5-(d-p)/f*(o-12);a.beginPath(),e.forEach((d,b)=>{b===0?a.moveTo(v(b),g(d.v)):a.lineTo(v(b),g(d.v))}),a.strokeStyle=u,a.lineWidth=1.6,a.stroke(),a.lineTo(v(e.length-1),o-2),a.lineTo(v(0),o-2),a.closePath(),a.globalAlpha=.12,a.fillStyle=u,a.fill(),a.globalAlpha=1},[e]),_("canvas",{ref:r})},of=({scopes:e,onPick:r})=>{let n=Qm();return _("div",{className:"row",style:{marginTop:10},children:[_("span",{className:"sub",children:n("chooser.pick")}),e.map(i=>_(ti,{variant:"small",onClick:()=>r(i.name),children:i.name},i.name))]})};var N_=["1h","3h","24h","7d"];function T_(){let{result:e,call:r,connected:n}=Jm("np-metrics"),i=Bm(e),t=Wt(()=>Ym(i),[i]),[o,a]=Ue(!1),[s,l]=Ue({win:"3h",series:[]}),p=Ee(s);p.current=s;let f=De(g=>{let d=g;if(d){if(Array.isArray(d.choose_scope)&&d.choose_scope.length){l(b=>({...b,app:d.app??b.app,appName:d.app_name??b.appName,chooser:d.choose_scope}));return}Array.isArray(d.series)&&l(b=>({...b,app:d.app??b.app,appName:d.app_name??b.appName,scope:d.scope??b.scope,win:d.window??b.win,series:d.series??[],chooser:void 0,note:d.series?.some(k=>k.points.length)?void 0:t("metrics.noData")}))}},[t]);Pe(()=>f(e?.structuredContent),[e,f]);let u=De(async(g={})=>{let{app:d,scope:b,win:k}=p.current;if(d){l(I=>({...I,note:t("metrics.loading",{window:g.win??k})}));try{let I={app:d,window:g.win??k};(g.scope??b)&&(I.scope=g.scope??b),f((await r(vl.applicationMetricList,I)).structuredContent)}catch(I){l(x=>({...x,note:t("metrics.refreshFailed",{message:_l(I)})}))}}},[f,r,t]);Pe(()=>{if(!o)return;let g=setInterval(()=>{u()},3e4);return u(),()=>clearInterval(g)},[o,u]);let v=Ee(!1);return Pe(()=>{v.current||!n||!s.app||(v.current=!0,!s.chooser&&!o&&u())},[n,s.app,s.chooser]),e?_(Gm,{value:t,children:_(Iu,{children:[_(Pu,{children:[_("div",{className:"title grow",children:s.appName?t("metrics.title",{app:s.appName,scope:s.scope??""}):t("metrics.heading")}),N_.map(g=>_(ti,{variant:"small",on:s.win===g,onClick:()=>{l(d=>({...d,win:g})),u({win:g})},children:g},g)),_(ti,{variant:"small",className:"hasicon",on:o,onClick:()=>a(g=>!g),children:[_(wu,{name:o?"pause":"play"})," ",t("metrics.live")]})]}),s.chooser?_(of,{scopes:s.chooser,onPick:g=>{l(d=>({...d,scope:g,chooser:void 0})),u({scope:g})}}):_("div",{className:"grid",children:s.series.map(g=>_("div",{className:"metric-card",children:[_("div",{className:"label",children:g.label}),_("div",{className:"val",children:[en(g.last)," ",_("small",{children:g.unit})]}),_(nf,{points:g.points}),_("div",{className:"sub",style:{marginTop:4,fontSize:11},children:t("metrics.avgMax",{avg:en(g.avg),max:en(g.max)})})]},g.id))}),_(tf,{children:s.note})]})}):_(rf,{variant:"grid"})}ef(_(T_,{}));})();
829
829
  </script></body></html>
@@ -825,7 +825,7 @@ Boolean requesting whether a visible border and background is provided by the ho
825
825
  - "app": Tool callable by the app from this server only`),csp:c.never().optional(),permissions:c.never().optional()}),PS=c.object({mimeTypes:c.array(c.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),jS=c.object({method:c.literal("ui/download-file"),params:c.object({contents:c.array(c.union([ll,ul])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),NS=c.object({method:c.literal("ui/message"),params:c.object({role:c.literal("user").describe('Message role, currently only "user" is supported.'),content:c.array(Bt).describe("Message content blocks (text, image, etc.).")})}),TS=c.object({method:c.literal("ui/notifications/sandbox-resource-ready"),params:c.object({html:c.string().describe("HTML content to load into the inner iframe."),sandbox:c.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:yl.optional().describe("CSP configuration from resource metadata."),permissions:bl.optional().describe("Sandbox permissions from resource metadata.")})}),v_=c.object({method:c.literal("ui/notifications/tool-result"),params:Jt.describe("Standard MCP tool execution result.")}),pm=c.object({toolInfo:c.object({id:qt.optional().describe("JSON-RPC id of the tools/call request."),tool:Jo.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:t_.optional().describe("Current color theme preference."),styles:p_.optional().describe("Style configuration for theming the app."),displayMode:qr.optional().describe("How the UI is currently displayed."),availableDisplayModes:c.array(qr).optional().describe("Display modes the host supports."),containerDimensions:c.union([c.object({height:c.number().describe("Fixed container height in pixels.")}),c.object({maxHeight:c.union([c.number(),c.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(c.union([c.object({width:c.number().describe("Fixed container width in pixels.")}),c.object({maxWidth:c.union([c.number(),c.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
826
826
  container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:c.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:c.string().optional().describe("User's timezone in IANA format."),userAgent:c.string().optional().describe("Host application identifier."),platform:c.union([c.literal("web"),c.literal("desktop"),c.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:c.object({touch:c.boolean().optional().describe("Whether the device supports touch input."),hover:c.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:c.object({top:c.number().describe("Top safe area inset in pixels."),right:c.number().describe("Right safe area inset in pixels."),bottom:c.number().describe("Bottom safe area inset in pixels."),left:c.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),__=c.object({method:c.literal("ui/notifications/host-context-changed"),params:pm.describe("Partial context update containing only changed fields.")}),OS=c.object({method:c.literal("ui/update-model-context"),params:c.object({content:c.array(Bt).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:c.record(c.string(),c.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),RS=c.object({method:c.literal("ui/initialize"),params:c.object({appInfo:Dr.describe("App identification (name and version)."),appCapabilities:f_.describe("Features and capabilities this app provides."),protocolVersion:c.string().describe("Protocol version this app supports.")})}),y_=c.object({protocolVersion:c.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Dr.describe("Host application identification and version."),hostCapabilities:m_.describe("Features and capabilities provided by the host."),hostContext:pm.describe("Rich context about the host environment.")}).passthrough(),b_={target:"draft-2020-12"};async function lm(e,r){let n=e["~standard"];if(n.jsonSchema)return n.jsonSchema[r](b_);if(n.vendor==="zod"){let{z:i}=await Promise.resolve().then(()=>(Or(),Gc));return i.toJSONSchema(e,{io:r})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function um(e,r,n=""){let i=await e["~standard"].validate(r);if(i.issues){let t=i.issues.map(o=>{let a=o.path?.map(s=>typeof s=="object"?s.key:s).join(".");return a?`${a}: ${o.message}`:o.message}).join("; ");throw Error(n+t)}return i.value}function dm(e,r=document.documentElement){for(let[n,i]of Object.entries(e))i!==void 0&&r.style.setProperty(n,i)}function mm(e){if(document.getElementById("__mcp-host-fonts"))return;let r=document.createElement("style");r.id="__mcp-host-fonts",r.textContent=e,document.head.appendChild(r)}var Go=class Go extends vl{constructor(n,i={},t={autoResize:!0}){super(t);M(this,"_appInfo");M(this,"_capabilities");M(this,"options");M(this,"_hostCapabilities");M(this,"_hostInfo");M(this,"_hostContext");M(this,"_registeredTools",{});M(this,"_initializedSent",!1);M(this,"eventSchemas",{toolinput:s_,toolinputpartial:c_,toolresult:v_,toolcancelled:l_,hostcontextchanged:__});M(this,"_everHadListener",new Set);M(this,"_toolHandlersInitialized",!1);M(this,"_onteardown");M(this,"_oncalltool");M(this,"_onlisttools");M(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=i,this.options=t,t.allowUnsafeEval||c.config({jitless:!0}),this.setRequestHandler(Ht,o=>(console.log("Received ping:",o.params),{})),this.setEventHandler("hostcontextchanged",void 0)}_assertInitialized(n){if(this._initializedSent)return;let i=`[ext-apps] App.${n}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(i);console.warn(`${i}. This will throw in a future release.`)}_assertHandlerTiming(n){if(!Go.ONE_SHOT_EVENTS.has(n)||this._everHadListener.has(n)||(this._everHadListener.add(n),!this._initializedSent))return;let i=`[ext-apps] "${String(n)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(i);console.warn(i)}setEventHandler(n,i){i&&this._assertHandlerTiming(n),super.setEventHandler(n,i)}addEventListener(n,i){this._assertHandlerTiming(n),super.addEventListener(n,i)}onEventDispatch(n,i){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...i})}registerCapabilities(n){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=sm(this._capabilities,n)}registerTool(n,i,t){if(this._registeredTools[n])throw Error(`Tool ${n} is already registered`);let o=this,a=()=>{o._initializedSent&&o._capabilities.tools?.listChanged&&o.sendToolListChanged()},s=i.inputSchema!==void 0,u={title:i.title,description:i.description,inputSchema:i.inputSchema,outputSchema:i.outputSchema,annotations:i.annotations,_meta:i._meta,enabled:!0,enable(){this.enabled=!0,a()},disable(){this.enabled=!1,a()},update(p){Object.assign(this,p),a()},remove(){o._registeredTools[n]===u&&(delete o._registeredTools[n],a())},handler:async(p,m)=>{if(!u.enabled)throw Error(`Tool ${n} is disabled`);let l;if(s){let _=u.inputSchema,g=_?await um(_,p??{},`Invalid input for tool ${n}: `):p??{};l=await t(g,m)}else l=await t(m);return u.outputSchema&&!l.isError&&(l.structuredContent=await um(u.outputSchema,l.structuredContent,`Invalid output for tool ${n}: `)),l}};return this._registeredTools[n]=u,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),a(),u}ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(n,i)=>{let t=this._registeredTools[n.name];if(!t)throw Error(`Tool ${n.name} not found`);return t.handler(n.arguments,i)},this.onlisttools=async(n,i)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([t,o])=>o.enabled).map(async([t,o])=>{let a={name:t,title:o.title,description:o.description,inputSchema:o.inputSchema?await lm(o.inputSchema,"input"):{type:"object",properties:{}}};return o.outputSchema&&(a.outputSchema=await lm(o.outputSchema,"output")),o.annotations&&(a.annotations=o.annotations),o._meta&&(a._meta=o._meta),a}))}))}async sendToolListChanged(n={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:n})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(d_,(i,t)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(i.params,t)})}get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(dl,(i,t)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(i.params,t)})}get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(pl,(i,t)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(i.params,t)})}assertCapabilityForMethod(n){switch(n){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${n})`);break}}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,i){if(this._assertInitialized("callServerTool"),typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},Jt,{onprogress:()=>{},resetTimeoutOnProgress:!0,...i})}async readServerResource(n,i){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:n},il,i)}async listServerResources(n,i){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:n},nl,i)}async createSamplingMessage(n,i){this._assertInitialized("createSamplingMessage");let t=n.tools?fl:ml;return await this.request({method:"sampling/createMessage",params:n},t,i)}sendMessage(n,i){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:n},a_,i)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,i){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:n},Co,i)}openLink(n,i){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:n},o_,i)}downloadFile(n,i){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:n},i_,i)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,i){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:n},g_,i)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,i=0,t=0,o=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let s=document.documentElement,u=s.style.height;s.style.height="max-content";let p=Math.ceil(s.getBoundingClientRect().height);s.style.height=u;let m=Math.ceil(window.innerWidth);(m!==i||p!==t)&&(i=m,t=p,this.sendSizeChanged({width:m,height:p}))}))};o();let a=new ResizeObserver(o);return a.observe(document.documentElement),a.observe(document.body),()=>a.disconnect()}async connect(n=new _l(window.parent,window.parent),i){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(n);try{let t=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Xv}},y_,i);if(t===void 0)throw Error(`Server sent invalid initialize result: ${t}`);this._hostCapabilities=t.hostCapabilities,this._hostInfo=t.hostInfo,this._hostContext=t.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(t){throw this.close(),t}}};M(Go,"ONE_SHOT_EVENTS",new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]));var Ko=Go;var ni,U,vm,x_,We,fm,_m,ym,xl,Yo,Hr,bm,wl,$l,kl,xm,ei={},ti=[],$_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Vr=Array.isArray;function Ae(e,r){for(var n in r)e[n]=r[n];return e}function Il(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Br(e,r,n){var i,t,o,a={};for(o in r)o=="key"?i=r[o]:o=="ref"?t=r[o]:a[o]=r[o];if(arguments.length>2&&(a.children=arguments.length>3?ni.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Xo(e,a,i,t,null)}function Xo(e,r,n,i,t){var o={type:e,props:r,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:t??++vm,__i:-1,__u:0};return t==null&&U.vnode!=null&&U.vnode(o),o}function Z(e){return e.children}function ke(e,r){this.props=e,this.context=r}function Wt(e,r){if(r==null)return e.__?Wt(e.__,e.__i+1):null;for(var n;r<e.__k.length;r++)if((n=e.__k[r])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Wt(e):null}function k_(e){if(e.__P&&e.__d){var r=e.__v,n=r.__e,i=[],t=[],o=Ae({},r);o.__v=r.__v+1,U.vnode&&U.vnode(o),Pl(e.__P,o,r,e.__n,e.__P.namespaceURI,32&r.__u?[n]:null,i,n??Wt(r),!!(32&r.__u),t),o.__v=r.__v,o.__.__k[o.__i]=o,Sm(i,o,t),r.__e=r.__=null,o.__e!=n&&$m(o)}}function $m(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(r){if(r!=null&&r.__e!=null)return e.__e=e.__c.base=r.__e}),$m(e)}function zl(e){(!e.__d&&(e.__d=!0)&&We.push(e)&&!ri.__r++||fm!=U.debounceRendering)&&((fm=U.debounceRendering)||_m)(ri)}function ri(){try{for(var e,r=1;We.length;)We.length>r&&We.sort(ym),e=We.shift(),r=We.length,k_(e)}finally{We.length=ri.__r=0}}function km(e,r,n,i,t,o,a,s,u,p,m){var l,_,g,h,x,$,k,b=i&&i.__k||ti,S=r.length;for(u=z_(n,r,b,u,S),l=0;l<S;l++)(g=n.__k[l])!=null&&(_=g.__i!=-1&&b[g.__i]||ei,g.__i=l,$=Pl(e,g,_,t,o,a,s,u,p,m),h=g.__e,g.ref&&_.ref!=g.ref&&(_.ref&&jl(_.ref,null,g),m.push(g.ref,g.__c||h,g)),x==null&&h!=null&&(x=h),(k=!!(4&g.__u))||_.__k===g.__k?(u=zm(g,u,e,k),k&&_.__e&&(_.__e=null)):typeof g.type=="function"&&$!==void 0?u=$:h&&(u=h.nextSibling),g.__u&=-7);return n.__e=x,u}function z_(e,r,n,i,t){var o,a,s,u,p,m=n.length,l=m,_=0;for(e.__k=new Array(t),o=0;o<t;o++)(a=r[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=e.__k[o]=Xo(null,a,null,null,null):Vr(a)?a=e.__k[o]=Xo(Z,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[o]=Xo(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,u=o+_,a.__=e,a.__b=e.__b+1,s=null,(p=a.__i=S_(a,n,u,l))!=-1&&(l--,(s=n[p])&&(s.__u|=2)),s==null||s.__v==null?(p==-1&&(t>m?_--:t<m&&_++),typeof a.type!="function"&&(a.__u|=4)):p!=u&&(p==u-1?_--:p==u+1?_++:(p>u?_--:_++,a.__u|=4))):e.__k[o]=null;if(l)for(o=0;o<m;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==i&&(i=Wt(s)),Im(s,s));return i}function zm(e,r,n,i){var t,o;if(typeof e.type=="function"){for(t=e.__k,o=0;t&&o<t.length;o++)t[o]&&(t[o].__=e,r=zm(t[o],r,n,i));return r}e.__e!=r&&(i&&(r&&e.type&&!r.parentNode&&(r=Wt(e)),n.insertBefore(e.__e,r||null)),r=e.__e);do r=r&&r.nextSibling;while(r!=null&&r.nodeType==8);return r}function Jr(e,r){return r=r||[],e==null||typeof e=="boolean"||(Vr(e)?e.some(function(n){Jr(n,r)}):r.push(e)),r}function S_(e,r,n,i){var t,o,a,s=e.key,u=e.type,p=r[n],m=p!=null&&(2&p.__u)==0;if(p===null&&s==null||m&&s==p.key&&u==p.type)return n;if(i>(m?1:0)){for(t=n-1,o=n+1;t>=0||o<r.length;)if((p=r[a=t>=0?t--:o++])!=null&&(2&p.__u)==0&&s==p.key&&u==p.type)return a}return-1}function gm(e,r,n){r[0]=="-"?e.setProperty(r,n??""):e[r]=n==null?"":typeof n!="number"||$_.test(r)?n:n+"px"}function Qo(e,r,n,i,t){var o,a;e:if(r=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(r in i)n&&r in n||gm(e.style,r,"");if(n)for(r in n)i&&n[r]==i[r]||gm(e.style,r,n[r])}else if(r[0]=="o"&&r[1]=="n")o=r!=(r=r.replace(bm,"$1")),a=r.toLowerCase(),r=a in e||r=="onFocusOut"||r=="onFocusIn"?a.slice(2):r.slice(2),e.l||(e.l={}),e.l[r+o]=n,n?i?n[Hr]=i[Hr]:(n[Hr]=wl,e.addEventListener(r,o?kl:$l,o)):e.removeEventListener(r,o?kl:$l,o);else{if(t=="http://www.w3.org/2000/svg")r=r.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(r!="width"&&r!="height"&&r!="href"&&r!="list"&&r!="form"&&r!="tabIndex"&&r!="download"&&r!="rowSpan"&&r!="colSpan"&&r!="role"&&r!="popover"&&r in e)try{e[r]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&r[4]!="-"?e.removeAttribute(r):e.setAttribute(r,r=="popover"&&n==1?"":n))}}function hm(e){return function(r){if(this.l){var n=this.l[r.type+e];if(r[Yo]==null)r[Yo]=wl++;else if(r[Yo]<n[Hr])return;return n(U.event?U.event(r):r)}}}function Pl(e,r,n,i,t,o,a,s,u,p){var m,l,_,g,h,x,$,k,b,S,N,q,oe,we,ut,Ie=r.type;if(r.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),o=[s=r.__e=n.__e]),(m=U.__b)&&m(r);e:if(typeof Ie=="function")try{if(k=r.props,b=Ie.prototype&&Ie.prototype.render,S=(m=Ie.contextType)&&i[m.__c],N=m?S?S.props.value:m.__:i,n.__c?$=(l=r.__c=n.__c).__=l.__E:(b?r.__c=l=new Ie(k,N):(r.__c=l=new ke(k,N),l.constructor=Ie,l.render=I_),S&&S.sub(l),l.state||(l.state={}),l.__n=i,_=l.__d=!0,l.__h=[],l._sb=[]),b&&l.__s==null&&(l.__s=l.state),b&&Ie.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=Ae({},l.__s)),Ae(l.__s,Ie.getDerivedStateFromProps(k,l.__s))),g=l.props,h=l.state,l.__v=r,_)b&&Ie.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),b&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(b&&Ie.getDerivedStateFromProps==null&&k!==g&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(k,N),r.__v==n.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(k,l.__s,N)===!1){r.__v!=n.__v&&(l.props=k,l.state=l.__s,l.__d=!1),r.__e=n.__e,r.__k=n.__k,r.__k.some(function(pt){pt&&(pt.__=r)}),ti.push.apply(l.__h,l._sb),l._sb=[],l.__h.length&&a.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(k,l.__s,N),b&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(g,h,x)})}if(l.context=N,l.props=k,l.__P=e,l.__e=!1,q=U.__r,oe=0,b)l.state=l.__s,l.__d=!1,q&&q(r),m=l.render(l.props,l.state,l.context),ti.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,q&&q(r),m=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++oe<25);l.state=l.__s,l.getChildContext!=null&&(i=Ae(Ae({},i),l.getChildContext())),b&&!_&&l.getSnapshotBeforeUpdate!=null&&(x=l.getSnapshotBeforeUpdate(g,h)),we=m!=null&&m.type===Z&&m.key==null?wm(m.props.children):m,s=km(e,Vr(we)?we:[we],r,n,i,t,o,a,s,u,p),l.base=r.__e,r.__u&=-161,l.__h.length&&a.push(l),$&&(l.__E=l.__=null)}catch(pt){if(r.__v=null,u||o!=null)if(pt.then){for(r.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,r.__e=s}else{for(ut=o.length;ut--;)Il(o[ut]);Sl(r)}else r.__e=n.__e,r.__k=n.__k,pt.then||Sl(r);U.__e(pt,r,n)}else o==null&&r.__v==n.__v?(r.__k=n.__k,r.__e=n.__e):s=r.__e=w_(n.__e,r,n,i,t,o,a,u,p);return(m=U.diffed)&&m(r),128&r.__u?void 0:s}function Sl(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Sl))}function Sm(e,r,n){for(var i=0;i<n.length;i++)jl(n[i],n[++i],n[++i]);U.__c&&U.__c(r,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(o){o.call(t)})}catch(o){U.__e(o,t.__v)}})}function wm(e){return typeof e!="object"||e==null||e.__b>0?e:Vr(e)?e.map(wm):e.constructor!==void 0?null:Ae({},e)}function w_(e,r,n,i,t,o,a,s,u){var p,m,l,_,g,h,x,$=n.props||ei,k=r.props,b=r.type;if(b=="svg"?t="http://www.w3.org/2000/svg":b=="math"?t="http://www.w3.org/1998/Math/MathML":t||(t="http://www.w3.org/1999/xhtml"),o!=null){for(p=0;p<o.length;p++)if((g=o[p])&&"setAttribute"in g==!!b&&(b?g.localName==b:g.nodeType==3)){e=g,o[p]=null;break}}if(e==null){if(b==null)return document.createTextNode(k);e=document.createElementNS(t,b,k.is&&k),s&&(U.__m&&U.__m(r,o),s=!1),o=null}if(b==null)$===k||s&&e.data==k||(e.data=k);else{if(o=b=="textarea"&&k.defaultValue!=null?null:o&&ni.call(e.childNodes),!s&&o!=null)for($={},p=0;p<e.attributes.length;p++)$[(g=e.attributes[p]).name]=g.value;for(p in $)g=$[p],p=="dangerouslySetInnerHTML"?l=g:p=="children"||p in k||p=="value"&&"defaultValue"in k||p=="checked"&&"defaultChecked"in k||Qo(e,p,null,g,t);for(p in k)g=k[p],p=="children"?_=g:p=="dangerouslySetInnerHTML"?m=g:p=="value"?h=g:p=="checked"?x=g:s&&typeof g!="function"||$[p]===g||Qo(e,p,g,$[p],t);if(m)s||l&&(m.__html==l.__html||m.__html==e.innerHTML)||(e.innerHTML=m.__html),r.__k=[];else if(l&&(e.innerHTML=""),km(r.type=="template"?e.content:e,Vr(_)?_:[_],r,n,i,b=="foreignObject"?"http://www.w3.org/1999/xhtml":t,o,a,o?o[0]:n.__k&&Wt(n,0),s,u),o!=null)for(p=o.length;p--;)Il(o[p]);s&&b!="textarea"||(p="value",b=="progress"&&h==null?e.removeAttribute("value"):h!=null&&(h!==e[p]||b=="progress"&&!h||b=="option"&&h!=$[p])&&Qo(e,p,h,$[p],t),p="checked",x!=null&&x!=e[p]&&Qo(e,p,x,$[p],t))}return e}function jl(e,r,n){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&r==null||(e.__u=e(r))}else e.current=r}catch(t){U.__e(t,n)}}function Im(e,r,n){var i,t;if(U.unmount&&U.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||jl(i,null,r)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){U.__e(o,r)}i.base=i.__P=null}if(i=e.__k)for(t=0;t<i.length;t++)i[t]&&Im(i[t],r,n||typeof e.type!="function");n||Il(e.__e),e.__c=e.__=e.__e=void 0}function I_(e,r,n){return this.constructor(e,n)}function Nl(e,r,n){var i,t,o,a;r==document&&(r=document.documentElement),U.__&&U.__(e,r),t=(i=typeof n=="function")?null:n&&n.__k||r.__k,o=[],a=[],Pl(r,e=(!i&&n||r).__k=Br(Z,null,[e]),t||ei,ei,r.namespaceURI,!i&&n?[n]:t?null:r.firstChild?ni.call(r.childNodes):null,o,!i&&n?n:t?t.__e:r.firstChild,i,a),Sm(o,e,a)}function oi(e){function r(n){var i,t;return this.getChildContext||(i=new Set,(t={})[r.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(o){this.props.value!=o.value&&i.forEach(function(a){a.__e=!0,zl(a)})},this.sub=function(o){i.add(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i&&i.delete(o),a&&a.call(o)}}),n.children}return r.__c="__cC"+xm++,r.__=e,r.Provider=r.__l=(r.Consumer=function(n,i){return n.children(i)}).contextType=r,r}ni=ti.slice,U={__e:function(e,r,n,i){for(var t,o,a;r=r.__;)if((t=r.__c)&&!t.__)try{if((o=t.constructor)&&o.getDerivedStateFromError!=null&&(t.setState(o.getDerivedStateFromError(e)),a=t.__d),t.componentDidCatch!=null&&(t.componentDidCatch(e,i||{}),a=t.__d),a)return t.__E=t}catch(s){e=s}throw e}},vm=0,x_=function(e){return e!=null&&e.constructor===void 0},ke.prototype.setState=function(e,r){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ae({},this.state),typeof e=="function"&&(e=e(Ae({},n),this.props)),e&&Ae(n,e),e!=null&&this.__v&&(r&&this._sb.push(r),zl(this))},ke.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),zl(this))},ke.prototype.render=Z,We=[],_m=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ym=function(e,r){return e.__v.__b-r.__v.__b},ri.__r=0,xl=Math.random().toString(8),Yo="__d"+xl,Hr="__a"+xl,bm=/(PointerCapture)$|Capture$/i,wl=0,$l=hm(!1),kl=hm(!0),xm=0;var Kt,Q,Tl,Pm,Wr=0,Dm=[],te=U,jm=te.__b,Nm=te.__r,Tm=te.diffed,Om=te.__c,Rm=te.unmount,Um=te.__;function ai(e,r){te.__h&&te.__h(Q,e,Wr||r),Wr=0;var n=Q.__H||(Q.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ie(e){return Wr=1,Cm(Zm,e)}function Cm(e,r,n){var i=ai(Kt++,2);if(i.t=e,!i.__c&&(i.__=[n?n(r):Zm(void 0,r),function(s){var u=i.__N?i.__N[0]:i.__[0],p=i.t(u,s);u!==p&&(i.__N=[p,i.__[1]],i.__c.setState({}))}],i.__c=Q,!Q.__f)){var t=function(s,u,p){if(!i.__c.__H)return!0;var m=i.__c.__H.__.filter(function(_){return _.__c});if(m.every(function(_){return!_.__N}))return!o||o.call(this,s,u,p);var l=i.__c.props!==s;return m.some(function(_){if(_.__N){var g=_.__[0];_.__=_.__N,_.__N=void 0,g!==_.__[0]&&(l=!0)}}),o&&o.call(this,s,u,p)||l};Q.__f=!0;var o=Q.shouldComponentUpdate,a=Q.componentWillUpdate;Q.componentWillUpdate=function(s,u,p){if(this.__e){var m=o;o=void 0,t(s,u,p),o=m}a&&a.call(this,s,u,p)},Q.shouldComponentUpdate=t}return i.__N||i.__}function ze(e,r){var n=ai(Kt++,3);!te.__s&&Am(n.__H,r)&&(n.__=e,n.u=r,Q.__H.__h.push(n))}function Se(e){return Wr=5,Kr(function(){return{current:e}},[])}function Kr(e,r){var n=ai(Kt++,7);return Am(n.__H,r)&&(n.__=e(),n.__H=r,n.__h=e),n.__}function Ze(e,r){return Wr=8,Kr(function(){return e},r)}function Rl(e){var r=Q.context[e.__c],n=ai(Kt++,9);return n.c=e,r?(n.__==null&&(n.__=!0,r.sub(Q)),r.props.value):e.__}function P_(){for(var e;e=Dm.shift();){var r=e.__H;if(e.__P&&r)try{r.__h.some(ii),r.__h.some(Ol),r.__h=[]}catch(n){r.__h=[],te.__e(n,e.__v)}}}te.__b=function(e){Q=null,jm&&jm(e)},te.__=function(e,r){e&&r.__k&&r.__k.__m&&(e.__m=r.__k.__m),Um&&Um(e,r)},te.__r=function(e){Nm&&Nm(e),Kt=0;var r=(Q=e.__c).__H;r&&(Tl===Q?(r.__h=[],Q.__h=[],r.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(r.__h.some(ii),r.__h.some(Ol),r.__h=[],Kt=0)),Tl=Q},te.diffed=function(e){Tm&&Tm(e);var r=e.__c;r&&r.__H&&(r.__H.__h.length&&(Dm.push(r)!==1&&Pm===te.requestAnimationFrame||((Pm=te.requestAnimationFrame)||j_)(P_)),r.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Tl=Q=null},te.__c=function(e,r){r.some(function(n){try{n.__h.some(ii),n.__h=n.__h.filter(function(i){return!i.__||Ol(i)})}catch(i){r.some(function(t){t.__h&&(t.__h=[])}),r=[],te.__e(i,n.__v)}}),Om&&Om(e,r)},te.unmount=function(e){Rm&&Rm(e);var r,n=e.__c;n&&n.__H&&(n.__H.__.some(function(i){try{ii(i)}catch(t){r=t}}),n.__H=void 0,r&&te.__e(r,n.__v))};var Em=typeof requestAnimationFrame=="function";function j_(e){var r,n=function(){clearTimeout(i),Em&&cancelAnimationFrame(r),setTimeout(e)},i=setTimeout(n,35);Em&&(r=requestAnimationFrame(n))}function ii(e){var r=Q,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Q=r}function Ol(e){var r=Q;e.__c=e.__(),Q=r}function Am(e,r){return!e||e.length!==r.length||r.some(function(n,i){return n!==e[i]})}function Zm(e,r){return typeof r=="function"?r(e):r}function T_(e,r){for(var n in r)e[n]=r[n];return e}function Lm(e,r){for(var n in e)if(n!=="__source"&&!(n in r))return!0;for(var i in r)if(i!=="__source"&&e[i]!==r[i])return!0;return!1}function Mm(e,r){this.props=e,this.context=r}(Mm.prototype=new ke).isPureReactComponent=!0,Mm.prototype.shouldComponentUpdate=function(e,r){return Lm(this.props,e)||Lm(this.state,r)};var Fm=U.__b;U.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Fm&&Fm(e)};var WS=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var O_=U.__e;U.__e=function(e,r,n,i){if(e.then){for(var t,o=r;o=o.__;)if((t=o.__c)&&t.__c)return r.__e==null&&(r.__e=n.__e,r.__k=n.__k),t.__c(e,r)}O_(e,r,n,i)};var qm=U.unmount;function Km(e,r,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(i){typeof i.__c=="function"&&i.__c()}),e.__c.__H=null),(e=T_({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=r),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(i){return Km(i,r,n)})),e}function Gm(e,r,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(i){return Gm(i,r,n)}),e.__c&&e.__c.__P===r&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ul(){this.__u=0,this.o=null,this.__b=null}function Qm(e){var r=e.__&&e.__.__c;return r&&r.__a&&r.__a(e)}function si(){this.i=null,this.l=null}U.unmount=function(e){var r=e.__c;r&&(r.__z=!0),r&&r.__R&&r.__R(),r&&32&e.__u&&(e.type=null),qm&&qm(e)},(Ul.prototype=new ke).__c=function(e,r){var n=r.__c,i=this;i.o==null&&(i.o=[]),i.o.push(n);var t=Qm(i.__v),o=!1,a=function(){o||i.__z||(o=!0,n.__R=null,t?t(u):u())};n.__R=a;var s=n.__P;n.__P=null;var u=function(){if(!--i.__u){if(i.state.__a){var p=i.state.__a;i.__v.__k[0]=Gm(p,p.__c.__P,p.__c.__O)}var m;for(i.setState({__a:i.__b=null});m=i.o.pop();)m.__P=s,m.forceUpdate()}};i.__u++||32&r.__u||i.setState({__a:i.__b=i.__v.__k[0]}),e.then(a,a)},Ul.prototype.componentWillUnmount=function(){this.o=[]},Ul.prototype.render=function(e,r){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=Km(this.__b,n,i.__O=i.__P)}this.__b=null}var t=r.__a&&Br(Z,null,e.fallback);return t&&(t.__u&=-33),[Br(Z,null,r.__a?null:e.children),t]};var Hm=function(e,r,n){if(++n[1]===n[0]&&e.l.delete(r),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(si.prototype=new ke).__a=function(e){var r=this,n=Qm(r.__v),i=r.l.get(e);return i[0]++,function(t){var o=function(){r.props.revealOrder?(i.push(t),Hm(r,e,i)):t()};n?n(o):o()}},si.prototype.render=function(e){this.i=null,this.l=new Map;var r=Jr(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&r.reverse();for(var n=r.length;n--;)this.l.set(r[n],this.i=[1,0,this.i]);return e.children},si.prototype.componentDidUpdate=si.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(r,n){Hm(e,n,r)})};var R_=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,U_=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,E_=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,D_=/[A-Z0-9]/g,C_=typeof document<"u",A_=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Ym(e,r,n){return r.__k==null&&(r.textContent=""),Nl(e,r),typeof n=="function"&&n(),e?e.__c:null}ke.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(ke.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(r){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:r})}})});var Vm=U.event;U.event=function(e){return Vm&&(e=Vm(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Xm,Z_={configurable:!0,get:function(){return this.class}},Bm=U.vnode;U.vnode=function(e){typeof e.type=="string"&&(function(r){var n=r.props,i=r.type,t={},o=i.indexOf("-")==-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||C_&&a==="children"&&i==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===!0?s="":u==="translate"&&s==="no"?s=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||i!=="input"&&i!=="textarea"||A_(n.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":E_.test(a)&&(a=u):u=a="oninput":o&&U_.test(a)?a=a.replace(D_,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&t[a=u]&&(a="oninputCapture"),t[a]=s}}i=="select"&&(t.multiple&&Array.isArray(t.value)&&(t.value=Jr(n.children).forEach(function(p){p.props.selected=t.value.indexOf(p.props.value)!=-1})),t.defaultValue!=null&&(t.value=Jr(n.children).forEach(function(p){p.props.selected=t.multiple?t.defaultValue.indexOf(p.props.value)!=-1:t.defaultValue==p.props.value}))),n.class&&!n.className?(t.class=n.class,Object.defineProperty(t,"className",Z_)):n.className&&(t.class=t.className=n.className),r.props=t})(e),e.$$typeof=R_,Bm&&Bm(e)};var Jm=U.__r;U.__r=function(e){Jm&&Jm(e),Xm=e.__c};var Wm=U.diffed;U.diffed=function(e){Wm&&Wm(e);var r=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in r&&r.value!==n.value&&(n.value=r.value==null?"":r.value),Xm=null};function ef(e){return!!e.__k&&(Nl(null,e),!0)}var rf=e=>(e?.content??[]).map(r=>r.text??"").join(`
827
827
  `);function L_(e){if(!e)return;let r=e.trim().toLowerCase(),n,i,t,o=/^#([0-9a-f]{3}|[0-9a-f]{6})$/.exec(r)?.[1];if(o){let a=o.length===3?o.split("").map(s=>s+s).join(""):o;n=parseInt(a.slice(0,2),16),i=parseInt(a.slice(2,4),16),t=parseInt(a.slice(4,6),16)}else{let a=/^rgba?\(\s*([\d.]+)[ ,]+([\d.]+)[ ,]+([\d.]+)/.exec(r);a&&([n,i,t]=[Number(a[1]),Number(a[2]),Number(a[3])]);let s=/^hsla?\(\s*[\d.]+[ ,]+[\d.]+%?[ ,]+([\d.]+)%/.exec(r);if(s)return Number(s[1])/100}if(!(n===void 0||i===void 0||t===void 0))return(.2126*n+.7152*i+.0722*t)/255}function tf(e){if(!e)return;let r=document.documentElement,n=e.theme==="dark"||e.theme==="light"?e.theme:void 0,i=e.styles?.variables;if(!n&&i){let t=L_(i["--color-background-primary"]??i["--color-background-secondary"]);t!==void 0&&(n=t<.5?"dark":"light")}n&&(r.classList.toggle("dark",n==="dark"),r.classList.toggle("light",n==="light"),r.style.colorScheme=n);try{i&&dm(i),e.styles?.css?.fonts&&mm(e.styles.css.fonts)}catch{}console.debug("[np-widget] theme:",e.theme,"->",n??"os-fallback","| tokens:",!!i,"| fonts:",!!e.styles?.css?.fonts)}function nf(e){let[r,n]=ie(null),[i,t]=ie(!1),o=Se(null);ze(()=>{let p=new Ko({name:e,version:"0.3.0"},{},{autoResize:!0});o.current=p,p.ontoolresult=m=>n(m),p.onhostcontextchanged=m=>tf(m),p.connect().then(()=>{tf(p.getHostContext()),t(!0)}).catch(()=>t(!1))},[e]);let a=Ze(async(p,m)=>{if(!o.current)throw new Error("not connected");return await o.current.callServerTool({name:p,arguments:m})},[]),s=Ze(p=>{o.current?.sendMessage({role:"user",content:[{type:"text",text:p}]}).catch(()=>{})},[]),u=Ze(p=>{try{o.current?.updateModelContext({content:[{type:"text",text:p}]}).catch(()=>{})}catch{}},[]);return{result:r,call:a,send:s,brief:u,connected:i}}function of(e){return{render:function(r){Ym(r,e)},unmount:function(){ef(e)}}}function af(e){let r=document.getElementById("root");r&&of(r).render(e)}var st=new Set(["finalized","cancelled","rolled_back","failed","deleted","creating_approval_denied"]),El=[0,1,5,10,25,50,75,90,95,99,100],ci=e=>El.reduce((r,n)=>Math.abs(n-e)<Math.abs(r-e)?n:r,0),sf=e=>(e??"").replace(/_/g," ");function cf(e){return e?st.has(e)?e==="finalized"?"ok":"bad":e==="active"||e==="successful"?"ok":e==="running"||e==="switching_traffic"?"run":"wait":"wait"}function li(e,r="time"){if(!e)return"";let n=new Date(e);if(Number.isNaN(n.getTime()))return"";let i=n.toISOString();return r==="time"?i.slice(11,19):i.slice(5,19).replace("T"," ")}function lf(e){return e instanceof Error?e.message:String(e)}function uf(e){if(!e)return"";let r=new Date(e).getTime();if(Number.isNaN(r))return"";let n=Math.max(0,Math.round((Date.now()-r)/1e3));if(n<60)return`${n}s`;let i=Math.round(n/60);if(i<60)return`${i}m`;let t=Math.round(i/60);return t<24?`${t}h`:`${Math.round(t/24)}d`}async function Dl(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();let n=document.execCommand("copy");return r.remove(),n}catch{return!1}}var M_={"confirm.yes":"Yes, do it","confirm.no":"Cancel","chooser.pick":"pick a scope:","term.empty":"no output yet\u2026","term.copyLine":"copy line",hint:"Next:","panel.scopes":"Scopes","panel.releases":"Releases","panel.latestBuild":"Latest build","panel.noScopes":"No scopes yet \u2014 create one to have somewhere to deploy.","panel.scopePlaceholder":"scope name, e.g. dev","panel.typePlaceholder":"type\u2026","panel.createScope":"Create scope","panel.ship":"ship","panel.live":"live","panel.openRollout":"Open rollout","panel.nothingDeployed":"nothing deployed","panel.noReleases":"none yet","panel.noBuild":"none \u2014 push a commit so CI builds","panel.deployLatest":"Deploy latest","panel.logs":"Logs","panel.metrics":"Metrics","panel.pickType":"Pick a scope type and create again.","panel.waitingData":"waiting for data\u2026","panel.backToList":"apps","rollout.deployingTo":"Deploying to {scope}","rollout.release":"release","rollout.backToApp":"app","rollout.trafficLabel":"Traffic on new version","rollout.live":"{pct}% live","rollout.movingTo":"moving to {pct}%","rollout.move":"Move traffic","rollout.finalize":"Finalize","rollout.rollback":"Rollback","rollout.confirmFinalize":"Finalize and retire the old version?","rollout.confirmRollback":"Return ALL traffic to the previous version?","rollout.log":"Deployment log","rollout.waiting":"waiting for activity\u2026","rollout.failed":"Failed: {message}","rollout.deployment":"Deployment #{id}","rollout.busyMove":"Moving traffic\u2026","rollout.busyFinalize":"Finalizing\u2026","rollout.busyRollback":"Rolling back\u2026","rollout.autoDone":"Done \u2014 the release is fully live.","rollout.autoRolledBack":"Rolled back \u2014 previous version is serving traffic.","rollout.autoFailed":"Deployment failed \u2014 previous version keeps serving.","rollout.autoWaiting":"Waiting for instances \u2014 controls unlock when the rollout is running.","rollout.autoFull":"All traffic on the new version \u2014 finalize to retire the old one.","rollout.autoLabel":"Auto-advance","rollout.autoOff":"off","rollout.trafficHelp":"Drag to move traffic now; auto-advance ramps it to 100%.","rollout.appLogs":"Application logs","rollout.appLogsEmpty":"no application logs yet\u2026","logs.title":"{app} \xB7 logs","logs.heading":"Logs","logs.filter":"filter\u2026","logs.live":"live","logs.refresh":"Refresh","logs.updated":"updated {time}","logs.wrap":"Wrap","logs.copyAll":"Copy all","logs.copied":"Copied","logs.rangeLive":"Live","logs.range15m":"Last 15m","logs.range1h":"Last 1h","logs.range6h":"Last 6h","logs.range24h":"Last 24h","logs.rangeCustom":"Custom\u2026","logs.apply":"Apply","logs.from":"From","logs.to":"To","logs.empty":"no log lines yet\u2026","logs.noMatch":"nothing matches the filter","logs.count":"{count} line(s){scope}","logs.scopeSuffix":" \xB7 scope {scope}","logs.refreshFailed":"refresh failed: {message}","metrics.title":"{app} \xB7 {scope} metrics","metrics.heading":"Metrics","metrics.live":"live","metrics.loading":"loading {window}\u2026","metrics.refreshFailed":"refresh failed: {message}","metrics.noData":"no datapoints in this window","metrics.avgMax":"avg {avg} \xB7 max {max}","params.title":"{app} \xB7 parameters","params.heading":"Parameters","params.name":"Name","params.value":"Value","params.secret":"Secret","params.add":"+ Add","params.save":"Save changes","params.applyNote":"Changed values apply on the next deploy.","params.unavailable":"Existing values can't be listed here \u2014 new ones can still be added below.","params.saving":"Saving {count} parameter(s)\u2026","params.saved":"Saved \u2014 values apply on the next deploy.","params.saveFailed":"Save failed: {message}","createApp.title":"Create application","createApp.name":"Name","createApp.namespace":"Namespace","createApp.repository":"Repository","createApp.newRepo":"New repository","createApp.importRepo":"Import existing","createApp.template":"Template","createApp.noTemplates":"No templates available","createApp.repoUrl":"Repository URL","createApp.editName":"Customize the repository name","createApp.lockName":"Reset to the generated name","createApp.importUrl":"Existing repository URL","createApp.monorepo":"This repository is a monorepo","createApp.appPath":"Application path inside the repository","createApp.submit":"Create application","createApp.needName":"Name is required.","createApp.needNamespace":"Pick a namespace.","createApp.needTemplate":"Pick a template for the new repository.","createApp.needImportUrl":"Enter the repository URL to import.","createApp.noBaseUrl":"This account has no git provider configured \u2014 use \u201CImport existing\u201D.","createApp.creating":"Creating {name}\u2026 (links the repo, wires CI \u2014 takes a few seconds)","createApp.failed":"Failed: {message}","createApp.created":`{name} created (#{id}, {status}).
828
- Push a commit to trigger the first build, then deploy.`,"findApps.count":"{count} application(s)","findApps.filter":"filter\u2026","findApps.across":"across {ns} namespace(s)","findApps.noMatch":"Nothing matches the filter.","findApps.page":"{from}\u2013{to} of {total}","findApps.prevPage":"Previous page","findApps.nextPage":"Next page","findApps.hint":"Click an application to open its panel."},F_={"confirm.yes":"S\xED, hacelo","confirm.no":"Cancelar","chooser.pick":"eleg\xED un scope:","term.empty":"sin salida todav\xEDa\u2026","term.copyLine":"copiar l\xEDnea",hint:"Siguiente:","panel.scopes":"Scopes","panel.releases":"Releases","panel.latestBuild":"\xDAltimo build","panel.noScopes":"Sin scopes todav\xEDa \u2014 cre\xE1 uno para tener d\xF3nde deployar.","panel.scopePlaceholder":"nombre del scope, p. ej. dev","panel.typePlaceholder":"tipo\u2026","panel.createScope":"Crear scope","panel.ship":"publicar","panel.live":"en vivo","panel.openRollout":"Abrir rollout","panel.nothingDeployed":"nada deployado","panel.noReleases":"ninguna todav\xEDa","panel.noBuild":"ninguno \u2014 pushe\xE1 un commit para que CI compile","panel.deployLatest":"Deployar lo \xFAltimo","panel.logs":"Logs","panel.metrics":"M\xE9tricas","panel.pickType":"Eleg\xED un tipo de scope y cre\xE1 de nuevo.","panel.waitingData":"esperando datos\u2026","panel.backToList":"apps","rollout.deployingTo":"Deployando a {scope}","rollout.release":"release","rollout.backToApp":"app","rollout.trafficLabel":"Tr\xE1fico en la versi\xF3n nueva","rollout.live":"{pct}% en vivo","rollout.movingTo":"yendo a {pct}%","rollout.move":"Mover tr\xE1fico","rollout.finalize":"Finalizar","rollout.rollback":"Revertir","rollout.confirmFinalize":"\xBFFinalizar y retirar la versi\xF3n anterior?","rollout.confirmRollback":"\xBFDevolver TODO el tr\xE1fico a la versi\xF3n anterior?","rollout.log":"Log del deployment","rollout.waiting":"esperando actividad\u2026","rollout.failed":"Fall\xF3: {message}","rollout.deployment":"Deployment #{id}","rollout.busyMove":"Moviendo tr\xE1fico\u2026","rollout.busyFinalize":"Finalizando\u2026","rollout.busyRollback":"Revirtiendo\u2026","rollout.autoDone":"Listo \u2014 la release est\xE1 completamente en vivo.","rollout.autoRolledBack":"Revertido \u2014 la versi\xF3n anterior est\xE1 sirviendo tr\xE1fico.","rollout.autoFailed":"El deployment fall\xF3 \u2014 la versi\xF3n anterior sigue sirviendo.","rollout.autoWaiting":"Esperando instancias \u2014 los controles se habilitan cuando el rollout est\xE1 corriendo.","rollout.autoFull":"Todo el tr\xE1fico en la versi\xF3n nueva \u2014 finaliz\xE1 para retirar la anterior.","rollout.autoLabel":"Auto-avance","rollout.autoOff":"off","rollout.trafficHelp":"Arrastr\xE1 para mover el tr\xE1fico ahora; el auto-avance sube hasta 100%.","rollout.appLogs":"Logs de la aplicaci\xF3n","rollout.appLogsEmpty":"sin logs de la aplicaci\xF3n todav\xEDa\u2026","logs.title":"{app} \xB7 logs","logs.heading":"Logs","logs.filter":"filtrar\u2026","logs.live":"vivo","logs.refresh":"Refrescar","logs.updated":"actualizado {time}","logs.wrap":"Ajustar","logs.copyAll":"Copiar todo","logs.copied":"Copiado","logs.rangeLive":"En vivo","logs.range15m":"\xDAltimos 15m","logs.range1h":"\xDAltima 1h","logs.range6h":"\xDAltimas 6h","logs.range24h":"\xDAltimas 24h","logs.rangeCustom":"Personalizado\u2026","logs.apply":"Aplicar","logs.from":"Desde","logs.to":"Hasta","logs.empty":"sin l\xEDneas de log todav\xEDa\u2026","logs.noMatch":"nada coincide con el filtro","logs.count":"{count} l\xEDnea(s){scope}","logs.scopeSuffix":" \xB7 scope {scope}","logs.refreshFailed":"fall\xF3 el refresh: {message}","metrics.title":"{app} \xB7 m\xE9tricas de {scope}","metrics.heading":"M\xE9tricas","metrics.live":"vivo","metrics.loading":"cargando {window}\u2026","metrics.refreshFailed":"fall\xF3 el refresh: {message}","metrics.noData":"sin datapoints en esta ventana","metrics.avgMax":"prom {avg} \xB7 m\xE1x {max}","params.title":"{app} \xB7 par\xE1metros","params.heading":"Par\xE1metros","params.name":"Nombre","params.value":"Valor","params.secret":"Secreto","params.add":"+ Agregar","params.save":"Guardar cambios","params.applyNote":"Los valores cambiados aplican en el pr\xF3ximo deploy.","params.unavailable":"Los valores existentes no se pueden listar ac\xE1 \u2014 igual pod\xE9s agregar nuevos abajo.","params.saving":"Guardando {count} par\xE1metro(s)\u2026","params.saved":"Guardado \u2014 los valores aplican en el pr\xF3ximo deploy.","params.saveFailed":"Fall\xF3 el guardado: {message}","createApp.title":"Crear aplicaci\xF3n","createApp.name":"Nombre","createApp.namespace":"Namespace","createApp.repository":"Repositorio","createApp.newRepo":"Nuevo repositorio","createApp.importRepo":"Importar existente","createApp.template":"Template","createApp.noTemplates":"Sin templates disponibles","createApp.repoUrl":"URL del repositorio","createApp.editName":"Personalizar el nombre del repositorio","createApp.lockName":"Volver al nombre generado","createApp.importUrl":"URL del repositorio existente","createApp.monorepo":"Este repositorio es un monorepo","createApp.appPath":"Ruta de la aplicaci\xF3n dentro del repositorio","createApp.submit":"Crear aplicaci\xF3n","createApp.needName":"El nombre es obligatorio.","createApp.needNamespace":"Eleg\xED un namespace.","createApp.needTemplate":"Eleg\xED un template para el nuevo repositorio.","createApp.needImportUrl":"Ingres\xE1 la URL del repositorio a importar.","createApp.noBaseUrl":"Esta cuenta no tiene proveedor de git configurado \u2014 us\xE1 \u201CImportar existente\u201D.","createApp.creating":"Creando {name}\u2026 (vincula el repo, conecta CI \u2014 tarda unos segundos)","createApp.failed":"Fall\xF3: {message}","createApp.created":`{name} creada (#{id}, {status}).
829
- Pushe\xE1 un commit para disparar el primer build y despu\xE9s deploy\xE1.`,"findApps.count":"{count} aplicaci\xF3n(es)","findApps.filter":"filtrar\u2026","findApps.across":"en {ns} namespace(s)","findApps.noMatch":"Nada coincide con el filtro.","findApps.page":"{from}\u2013{to} de {total}","findApps.prevPage":"P\xE1gina anterior","findApps.nextPage":"P\xE1gina siguiente","findApps.hint":"Hac\xE9 clic en una aplicaci\xF3n para abrir su panel."},q_={en:M_,es:F_};function pf(e){return e?.structuredContent?._locale==="es"?"es":"en"}function df(e){let r=q_[e];return(n,i)=>r[n].replace(/\{(\w+)\}/g,(t,o)=>i?.[o]!==void 0?String(i[o]):t)}var mf=oi(df("en")),ff=mf.Provider,Ue=()=>Rl(mf),gf=e=>df(e);var H_=0;function d(e,r,n,i,t,o){r||(r={});var a,s,u=r;if("ref"in u)for(s in u={},r)s=="ref"?a=r[s]:u[s]=r[s];var p={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--H_,__i:-1,__u:0,__source:t,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return U.vnode&&U.vnode(p),p}var V_={clock:{body:d(Z,{children:[d("circle",{cx:"12",cy:"12",r:"10"}),d("polyline",{points:"12 6 12 12 16 14"})]})},play:{fill:!0,body:d("polygon",{points:"6 3 20 12 6 21 6 3"})},pause:{fill:!0,body:d(Z,{children:[d("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),d("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]})},refresh:{body:d(Z,{children:[d("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),d("polyline",{points:"21 3 21 8 16 8"})]})},rocket:{body:d(Z,{children:[d("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),d("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),d("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),d("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})},logs:{body:d(Z,{children:[d("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d("polyline",{points:"14 2 14 8 20 8"}),d("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),d("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),d("line",{x1:"10",y1:"9",x2:"8",y2:"9"})]})},metrics:{body:d(Z,{children:[d("polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17"}),d("polyline",{points:"16 7 22 7 22 13"})]})},lock:{body:d(Z,{children:[d("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),d("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})},edit:{body:d("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})},copy:{body:d(Z,{children:[d("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})},check:{body:d("polyline",{points:"20 6 9 17 4 12"})},chevronDown:{body:d("polyline",{points:"6 9 12 15 18 9"})},chevronLeft:{body:d("polyline",{points:"15 18 9 12 15 6"})},chevronRight:{body:d("polyline",{points:"9 18 15 12 9 6"})},arrowLeft:{body:d(Z,{children:[d("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),d("polyline",{points:"12 19 5 12 12 5"})]})}},Le=({name:e,size:r=14,className:n})=>{let i=V_[e];return d("svg",{className:["icon",n].filter(Boolean).join(" "),width:r,height:r,viewBox:"0 0 24 24",fill:i.fill?"currentColor":"none",stroke:i.fill?"none":"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:i.body})};var Cl=({children:e})=>d("div",{className:"card",children:e}),ct=({children:e})=>d("div",{className:"row",children:e}),Al=({title:e,sub:r,right:n})=>d(ct,{children:[d("div",{className:"grow",children:[d("div",{className:"title",children:e}),r?d("div",{className:"sub",children:r}):null]}),n]}),lt=({label:e,children:r})=>d("div",{className:"section",children:[e?d("div",{className:"label",children:e}):null,r]}),ui=({status:e})=>d("span",{className:`pill ${cf(e)}`,children:sf(e)||"\u2026"}),Gr=({tone:e,children:r})=>d("div",{className:`note${e?` ${e}`:""}`,children:r}),hf=({children:e})=>{let r=Ue();return e?d("div",{className:"hint",children:[r("hint")," ",e]}):null},de=({variant:e,on:r,className:n,...i})=>d("button",{className:[e,r?"on":"",n].filter(Boolean).join(" "),...i});var Zl=({text:e,onYes:r,children:n})=>{let i=Ue(),[t,o]=ie(!1);return t?d("span",{className:"row",style:{gap:8},children:[d("span",{style:{fontSize:13},children:e}),d(de,{variant:"danger",onClick:()=>{o(!1),r()},children:i("confirm.yes")}),d(de,{onClick:()=>o(!1),children:i("confirm.no")})]}):d("span",{onClickCapture:a=>{a.stopPropagation(),o(!0)},children:n})},Y=({w:e="100%",h:r=12,r:n=6})=>d("div",{className:"skel",style:{width:e,height:r,borderRadius:n}}),vf=({variant:e})=>d(Cl,{children:[d(ct,{children:[d(Y,{w:170,h:16}),e!=="form"&&d(Z,{children:[d("div",{className:"grow"}),d(Y,{w:110,h:28,r:8})]})]}),e==="list"&&d("div",{className:"skel-rows",children:[0,1,2,3,4,5].map(r=>d("div",{className:"skel-row",children:[d(Y,{w:8,h:8,r:999}),d(Y,{w:140,h:13}),d("div",{className:"grow"}),d(Y,{w:90,h:11})]},r))}),e==="panel"&&d(Z,{children:[d("div",{className:"section",children:[d(Y,{w:64,h:10}),d("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:10},children:[0,1].map(r=>d("div",{className:"skel-card",children:[d(Y,{w:r?"45%":"55%",h:14}),d("div",{style:{height:8}}),d(Y,{w:r?"70%":"85%",h:11})]},r))})]}),d("div",{className:"section",children:[d(Y,{w:64,h:10}),d("div",{style:{marginTop:10,display:"flex",gap:8},children:[0,1,2].map(r=>d(Y,{w:72,h:24,r:999},r))})]}),d("div",{className:"section",style:{display:"flex",gap:8},children:[d(Y,{w:132,h:34,r:9}),d(Y,{w:80,h:34,r:9})]})]}),e==="table"&&d("div",{className:"skel-rows",children:[0,1,2,3].map(r=>d("div",{className:"skel-row",children:[d(Y,{w:"30%",h:13}),d("div",{className:"grow"}),d(Y,{w:"42%",h:13}),d(Y,{w:18,h:13})]},r))}),e==="grid"&&d("div",{className:"skel-grid",children:[0,1,2,3].map(r=>d("div",{className:"skel-card",children:[d(Y,{w:"50%",h:10}),d("div",{style:{height:8}}),d(Y,{w:"35%",h:20}),d("div",{style:{height:8}}),d(Y,{w:"100%",h:40,r:8})]},r))}),e==="logs"&&d("div",{style:{marginTop:14},children:d(Y,{w:"100%",h:150,r:10})}),e==="form"&&d("div",{className:"skel-rows",children:[[0,1,2].map(r=>d("div",{children:[d(Y,{w:88,h:10}),d("div",{style:{height:7}}),d(Y,{w:"100%",h:32,r:8})]},r)),d(Y,{w:150,h:34,r:9})]})]}),B_=({lines:e,height:r,minHeight:n,tsMode:i="time",empty:t,wrap:o=!0,follow:a=!1})=>{let s=Ue(),u=t??s("term.empty"),p=Se(null),m=Se(!1);ze(()=>{let g=p.current;g&&((!m.current||a)&&(g.scrollTop=g.scrollHeight),m.current=!0)},[a,e.length]);let l=g=>i==="relative"?uf(g):li(g,i),_=g=>{let h=g.source?`[${g.source}] `:"";Dl(`${li(g.ts??g.timestamp,"datetime")} ${h}${g.message??""}`.trim())};return d("div",{className:`term${o?"":" nowrap"}`,ref:p,style:r||n?{...r?{height:r}:{},...n?{minHeight:n}:{}}:void 0,children:e.length===0?u:e.slice(-300).map((g,h)=>{let x=W_(g.message);return d("div",{className:`logline${x?` ${x}`:""}`,children:[d("span",{className:"t",children:l(g.ts??g.timestamp)}),d("span",{className:"msg",children:(g.source?`[${g.source}] `:"")+(g.message??"")}),d("button",{type:"button",className:"copyline",title:s("term.copyLine"),"aria-label":s("term.copyLine"),onClick:()=>_(g),children:d(Le,{name:"copy",size:13})})]},h)})})};function J_(e){return`${li(e.ts??e.timestamp,"datetime")} ${e.source?`[${e.source}] `:""}${e.message??""}`.trim()}var Ll=({lines:e,height:r,minHeight:n,empty:i,follow:t=!1,controls:o=!0,defaultWrap:a=!0,defaultTsMode:s="datetime"})=>{let u=Ue(),[p,m]=ie(a),[l,_]=ie(!1),g=async()=>{await Dl(e.map(J_).join(`
828
+ Push a commit to trigger the first build, then deploy.`,"findApps.count":"{count} application(s)","findApps.filter":"filter\u2026","findApps.across":"across {ns} namespace(s)","findApps.noMatch":"Nothing matches the filter.","findApps.loadMore":"Load {more} more","findApps.hint":"Click an application to open its panel."},F_={"confirm.yes":"S\xED, hacelo","confirm.no":"Cancelar","chooser.pick":"eleg\xED un scope:","term.empty":"sin salida todav\xEDa\u2026","term.copyLine":"copiar l\xEDnea",hint:"Siguiente:","panel.scopes":"Scopes","panel.releases":"Releases","panel.latestBuild":"\xDAltimo build","panel.noScopes":"Sin scopes todav\xEDa \u2014 cre\xE1 uno para tener d\xF3nde deployar.","panel.scopePlaceholder":"nombre del scope, p. ej. dev","panel.typePlaceholder":"tipo\u2026","panel.createScope":"Crear scope","panel.ship":"publicar","panel.live":"en vivo","panel.openRollout":"Abrir rollout","panel.nothingDeployed":"nada deployado","panel.noReleases":"ninguna todav\xEDa","panel.noBuild":"ninguno \u2014 pushe\xE1 un commit para que CI compile","panel.deployLatest":"Deployar lo \xFAltimo","panel.logs":"Logs","panel.metrics":"M\xE9tricas","panel.pickType":"Eleg\xED un tipo de scope y cre\xE1 de nuevo.","panel.waitingData":"esperando datos\u2026","panel.backToList":"apps","rollout.deployingTo":"Deployando a {scope}","rollout.release":"release","rollout.backToApp":"app","rollout.trafficLabel":"Tr\xE1fico en la versi\xF3n nueva","rollout.live":"{pct}% en vivo","rollout.movingTo":"yendo a {pct}%","rollout.move":"Mover tr\xE1fico","rollout.finalize":"Finalizar","rollout.rollback":"Revertir","rollout.confirmFinalize":"\xBFFinalizar y retirar la versi\xF3n anterior?","rollout.confirmRollback":"\xBFDevolver TODO el tr\xE1fico a la versi\xF3n anterior?","rollout.log":"Log del deployment","rollout.waiting":"esperando actividad\u2026","rollout.failed":"Fall\xF3: {message}","rollout.deployment":"Deployment #{id}","rollout.busyMove":"Moviendo tr\xE1fico\u2026","rollout.busyFinalize":"Finalizando\u2026","rollout.busyRollback":"Revirtiendo\u2026","rollout.autoDone":"Listo \u2014 la release est\xE1 completamente en vivo.","rollout.autoRolledBack":"Revertido \u2014 la versi\xF3n anterior est\xE1 sirviendo tr\xE1fico.","rollout.autoFailed":"El deployment fall\xF3 \u2014 la versi\xF3n anterior sigue sirviendo.","rollout.autoWaiting":"Esperando instancias \u2014 los controles se habilitan cuando el rollout est\xE1 corriendo.","rollout.autoFull":"Todo el tr\xE1fico en la versi\xF3n nueva \u2014 finaliz\xE1 para retirar la anterior.","rollout.autoLabel":"Auto-avance","rollout.autoOff":"off","rollout.trafficHelp":"Arrastr\xE1 para mover el tr\xE1fico ahora; el auto-avance sube hasta 100%.","rollout.appLogs":"Logs de la aplicaci\xF3n","rollout.appLogsEmpty":"sin logs de la aplicaci\xF3n todav\xEDa\u2026","logs.title":"{app} \xB7 logs","logs.heading":"Logs","logs.filter":"filtrar\u2026","logs.live":"vivo","logs.refresh":"Refrescar","logs.updated":"actualizado {time}","logs.wrap":"Ajustar","logs.copyAll":"Copiar todo","logs.copied":"Copiado","logs.rangeLive":"En vivo","logs.range15m":"\xDAltimos 15m","logs.range1h":"\xDAltima 1h","logs.range6h":"\xDAltimas 6h","logs.range24h":"\xDAltimas 24h","logs.rangeCustom":"Personalizado\u2026","logs.apply":"Aplicar","logs.from":"Desde","logs.to":"Hasta","logs.empty":"sin l\xEDneas de log todav\xEDa\u2026","logs.noMatch":"nada coincide con el filtro","logs.count":"{count} l\xEDnea(s){scope}","logs.scopeSuffix":" \xB7 scope {scope}","logs.refreshFailed":"fall\xF3 el refresh: {message}","metrics.title":"{app} \xB7 m\xE9tricas de {scope}","metrics.heading":"M\xE9tricas","metrics.live":"vivo","metrics.loading":"cargando {window}\u2026","metrics.refreshFailed":"fall\xF3 el refresh: {message}","metrics.noData":"sin datapoints en esta ventana","metrics.avgMax":"prom {avg} \xB7 m\xE1x {max}","params.title":"{app} \xB7 par\xE1metros","params.heading":"Par\xE1metros","params.name":"Nombre","params.value":"Valor","params.secret":"Secreto","params.add":"+ Agregar","params.save":"Guardar cambios","params.applyNote":"Los valores cambiados aplican en el pr\xF3ximo deploy.","params.unavailable":"Los valores existentes no se pueden listar ac\xE1 \u2014 igual pod\xE9s agregar nuevos abajo.","params.saving":"Guardando {count} par\xE1metro(s)\u2026","params.saved":"Guardado \u2014 los valores aplican en el pr\xF3ximo deploy.","params.saveFailed":"Fall\xF3 el guardado: {message}","createApp.title":"Crear aplicaci\xF3n","createApp.name":"Nombre","createApp.namespace":"Namespace","createApp.repository":"Repositorio","createApp.newRepo":"Nuevo repositorio","createApp.importRepo":"Importar existente","createApp.template":"Template","createApp.noTemplates":"Sin templates disponibles","createApp.repoUrl":"URL del repositorio","createApp.editName":"Personalizar el nombre del repositorio","createApp.lockName":"Volver al nombre generado","createApp.importUrl":"URL del repositorio existente","createApp.monorepo":"Este repositorio es un monorepo","createApp.appPath":"Ruta de la aplicaci\xF3n dentro del repositorio","createApp.submit":"Crear aplicaci\xF3n","createApp.needName":"El nombre es obligatorio.","createApp.needNamespace":"Eleg\xED un namespace.","createApp.needTemplate":"Eleg\xED un template para el nuevo repositorio.","createApp.needImportUrl":"Ingres\xE1 la URL del repositorio a importar.","createApp.noBaseUrl":"Esta cuenta no tiene proveedor de git configurado \u2014 us\xE1 \u201CImportar existente\u201D.","createApp.creating":"Creando {name}\u2026 (vincula el repo, conecta CI \u2014 tarda unos segundos)","createApp.failed":"Fall\xF3: {message}","createApp.created":`{name} creada (#{id}, {status}).
829
+ Pushe\xE1 un commit para disparar el primer build y despu\xE9s deploy\xE1.`,"findApps.count":"{count} aplicaci\xF3n(es)","findApps.filter":"filtrar\u2026","findApps.across":"en {ns} namespace(s)","findApps.noMatch":"Nada coincide con el filtro.","findApps.loadMore":"Cargar {more} m\xE1s","findApps.hint":"Hac\xE9 clic en una aplicaci\xF3n para abrir su panel."},q_={en:M_,es:F_};function pf(e){return e?.structuredContent?._locale==="es"?"es":"en"}function df(e){let r=q_[e];return(n,i)=>r[n].replace(/\{(\w+)\}/g,(t,o)=>i?.[o]!==void 0?String(i[o]):t)}var mf=oi(df("en")),ff=mf.Provider,Ue=()=>Rl(mf),gf=e=>df(e);var H_=0;function d(e,r,n,i,t,o){r||(r={});var a,s,u=r;if("ref"in u)for(s in u={},r)s=="ref"?a=r[s]:u[s]=r[s];var p={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--H_,__i:-1,__u:0,__source:t,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return U.vnode&&U.vnode(p),p}var V_={clock:{body:d(Z,{children:[d("circle",{cx:"12",cy:"12",r:"10"}),d("polyline",{points:"12 6 12 12 16 14"})]})},play:{fill:!0,body:d("polygon",{points:"6 3 20 12 6 21 6 3"})},pause:{fill:!0,body:d(Z,{children:[d("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),d("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]})},refresh:{body:d(Z,{children:[d("path",{d:"M21 12a9 9 0 1 1-2.64-6.36"}),d("polyline",{points:"21 3 21 8 16 8"})]})},rocket:{body:d(Z,{children:[d("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),d("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),d("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),d("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})},logs:{body:d(Z,{children:[d("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d("polyline",{points:"14 2 14 8 20 8"}),d("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),d("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),d("line",{x1:"10",y1:"9",x2:"8",y2:"9"})]})},metrics:{body:d(Z,{children:[d("polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17"}),d("polyline",{points:"16 7 22 7 22 13"})]})},lock:{body:d(Z,{children:[d("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),d("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})},edit:{body:d("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})},copy:{body:d(Z,{children:[d("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})},check:{body:d("polyline",{points:"20 6 9 17 4 12"})},chevronDown:{body:d("polyline",{points:"6 9 12 15 18 9"})},chevronLeft:{body:d("polyline",{points:"15 18 9 12 15 6"})},chevronRight:{body:d("polyline",{points:"9 18 15 12 9 6"})},arrowLeft:{body:d(Z,{children:[d("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),d("polyline",{points:"12 19 5 12 12 5"})]})}},Le=({name:e,size:r=14,className:n})=>{let i=V_[e];return d("svg",{className:["icon",n].filter(Boolean).join(" "),width:r,height:r,viewBox:"0 0 24 24",fill:i.fill?"currentColor":"none",stroke:i.fill?"none":"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:i.body})};var Cl=({children:e})=>d("div",{className:"card",children:e}),ct=({children:e})=>d("div",{className:"row",children:e}),Al=({title:e,sub:r,right:n})=>d(ct,{children:[d("div",{className:"grow",children:[d("div",{className:"title",children:e}),r?d("div",{className:"sub",children:r}):null]}),n]}),lt=({label:e,children:r})=>d("div",{className:"section",children:[e?d("div",{className:"label",children:e}):null,r]}),ui=({status:e})=>d("span",{className:`pill ${cf(e)}`,children:sf(e)||"\u2026"}),Gr=({tone:e,children:r})=>d("div",{className:`note${e?` ${e}`:""}`,children:r}),hf=({children:e})=>{let r=Ue();return e?d("div",{className:"hint",children:[r("hint")," ",e]}):null},de=({variant:e,on:r,className:n,...i})=>d("button",{className:[e,r?"on":"",n].filter(Boolean).join(" "),...i});var Zl=({text:e,onYes:r,children:n})=>{let i=Ue(),[t,o]=ie(!1);return t?d("span",{className:"row",style:{gap:8},children:[d("span",{style:{fontSize:13},children:e}),d(de,{variant:"danger",onClick:()=>{o(!1),r()},children:i("confirm.yes")}),d(de,{onClick:()=>o(!1),children:i("confirm.no")})]}):d("span",{onClickCapture:a=>{a.stopPropagation(),o(!0)},children:n})},Y=({w:e="100%",h:r=12,r:n=6})=>d("div",{className:"skel",style:{width:e,height:r,borderRadius:n}}),vf=({variant:e})=>d(Cl,{children:[d(ct,{children:[d(Y,{w:170,h:16}),e!=="form"&&d(Z,{children:[d("div",{className:"grow"}),d(Y,{w:110,h:28,r:8})]})]}),e==="list"&&d("div",{className:"skel-rows",children:[0,1,2,3,4,5].map(r=>d("div",{className:"skel-row",children:[d(Y,{w:8,h:8,r:999}),d(Y,{w:140,h:13}),d("div",{className:"grow"}),d(Y,{w:90,h:11})]},r))}),e==="panel"&&d(Z,{children:[d("div",{className:"section",children:[d(Y,{w:64,h:10}),d("div",{style:{marginTop:10,display:"flex",flexDirection:"column",gap:10},children:[0,1].map(r=>d("div",{className:"skel-card",children:[d(Y,{w:r?"45%":"55%",h:14}),d("div",{style:{height:8}}),d(Y,{w:r?"70%":"85%",h:11})]},r))})]}),d("div",{className:"section",children:[d(Y,{w:64,h:10}),d("div",{style:{marginTop:10,display:"flex",gap:8},children:[0,1,2].map(r=>d(Y,{w:72,h:24,r:999},r))})]}),d("div",{className:"section",style:{display:"flex",gap:8},children:[d(Y,{w:132,h:34,r:9}),d(Y,{w:80,h:34,r:9})]})]}),e==="table"&&d("div",{className:"skel-rows",children:[0,1,2,3].map(r=>d("div",{className:"skel-row",children:[d(Y,{w:"30%",h:13}),d("div",{className:"grow"}),d(Y,{w:"42%",h:13}),d(Y,{w:18,h:13})]},r))}),e==="grid"&&d("div",{className:"skel-grid",children:[0,1,2,3].map(r=>d("div",{className:"skel-card",children:[d(Y,{w:"50%",h:10}),d("div",{style:{height:8}}),d(Y,{w:"35%",h:20}),d("div",{style:{height:8}}),d(Y,{w:"100%",h:40,r:8})]},r))}),e==="logs"&&d("div",{style:{marginTop:14},children:d(Y,{w:"100%",h:150,r:10})}),e==="form"&&d("div",{className:"skel-rows",children:[[0,1,2].map(r=>d("div",{children:[d(Y,{w:88,h:10}),d("div",{style:{height:7}}),d(Y,{w:"100%",h:32,r:8})]},r)),d(Y,{w:150,h:34,r:9})]})]}),B_=({lines:e,height:r,minHeight:n,tsMode:i="time",empty:t,wrap:o=!0,follow:a=!1})=>{let s=Ue(),u=t??s("term.empty"),p=Se(null),m=Se(!1);ze(()=>{let g=p.current;g&&((!m.current||a)&&(g.scrollTop=g.scrollHeight),m.current=!0)},[a,e.length]);let l=g=>i==="relative"?uf(g):li(g,i),_=g=>{let h=g.source?`[${g.source}] `:"";Dl(`${li(g.ts??g.timestamp,"datetime")} ${h}${g.message??""}`.trim())};return d("div",{className:`term${o?"":" nowrap"}`,ref:p,style:r||n?{...r?{height:r}:{},...n?{minHeight:n}:{}}:void 0,children:e.length===0?u:e.slice(-300).map((g,h)=>{let x=W_(g.message);return d("div",{className:`logline${x?` ${x}`:""}`,children:[d("span",{className:"t",children:l(g.ts??g.timestamp)}),d("span",{className:"msg",children:(g.source?`[${g.source}] `:"")+(g.message??"")}),d("button",{type:"button",className:"copyline",title:s("term.copyLine"),"aria-label":s("term.copyLine"),onClick:()=>_(g),children:d(Le,{name:"copy",size:13})})]},h)})})};function J_(e){return`${li(e.ts??e.timestamp,"datetime")} ${e.source?`[${e.source}] `:""}${e.message??""}`.trim()}var Ll=({lines:e,height:r,minHeight:n,empty:i,follow:t=!1,controls:o=!0,defaultWrap:a=!0,defaultTsMode:s="datetime"})=>{let u=Ue(),[p,m]=ie(a),[l,_]=ie(!1),g=async()=>{await Dl(e.map(J_).join(`
830
830
  `))&&(_(!0),setTimeout(()=>_(!1),1500))};return d(Z,{children:[o?d("div",{className:"toolbar",children:[d(de,{variant:"small",on:p,onClick:()=>m(h=>!h),children:u("logs.wrap")}),d(de,{variant:"small",className:"hasicon",onClick:()=>{g()},children:l?d(Z,{children:[d(Le,{name:"check"})," ",u("logs.copied")]}):u("logs.copyAll")})]}):null,d("div",{style:o?{marginTop:10}:void 0,children:d(B_,{lines:e,tsMode:s,wrap:p,follow:t,empty:i,height:r,minHeight:n})})]})};function W_(e){let r=e??"";if(/\b(error|err|fatal|exception|panic|fail(ed|ure)?)\b/i.test(r))return"err";if(/\bwarn(ing)?\b/i.test(r))return"warn"}var _f=({current:e,desired:r})=>{let n=Ue(),i=e??0;return d(Z,{children:[d("div",{className:"bar",children:[d("div",{className:"ghost",style:{width:`${r??i}%`}}),d("div",{className:"fill",style:{width:`${i}%`}})]}),d("div",{className:"traffic-nums",children:[d("span",{children:n("rollout.live",{pct:i})}),d("span",{children:r!=null&&r!==i?n("rollout.movingTo",{pct:r}):""})]})]})},yf=({value:e,disabled:r,onChange:n,onCommit:i})=>d("input",{type:"range",min:0,max:100,step:1,value:e,disabled:r,onChange:t=>n(ci(Number(t.target.value))),onPointerUp:t=>i?.(ci(Number(t.target.value))),onKeyUp:t=>i?.(ci(Number(t.target.value))),list:"np-snap-marks"}),bf=()=>d("datalist",{id:"np-snap-marks",children:El.map(e=>d("option",{value:e},e))});var xe={applicationCreate:"application_create",applicationList:"application_list",applicationGet:"application_get",applicationLogList:"application_log_list",applicationMetricList:"application_metric_list",applicationBuildList:"application_build_list",applicationParameterList:"application_parameter_list",applicationParameterCreate:"application_parameter_create",applicationDeploymentCreate:"application_deployment_create",applicationDeploymentUpdate:"application_deployment_update",applicationReleaseCreate:"application_release_create",applicationScopeCreate:"application_scope_create",applicationServiceList:"application_service_list",applicationApprovalList:"application_approval_list",organizationGet:"organization_get",playbookGet:"playbook_get"};var K_=({scope:e,onOpenRollout:r})=>{let n=Ue(),i=e.current_deployment,t=i&&!st.has(i.status)?i:void 0,o=Object.entries(e.dimensions??{}),a=i?`${e.live_release?.semver??`release #${i.release_id}`}${i.traffic!==null&&i.traffic!==void 0?` \xB7 ${i.traffic}%`:""}`:"";return d("div",{className:"scope-card",children:[d(ct,{children:[d("strong",{children:e.name}),d(ui,{status:t?t.status:e.status}),o.length?d("span",{className:"dims",children:o.map(([s,u])=>d("span",{className:"dim",children:[s,"=",u]},s))}):null,d("span",{className:"grow"}),t&&d(de,{variant:"small",onClick:()=>r({id:t.id,status:t.status,traffic:t.traffic??null,desired_traffic:null}),children:n("panel.openRollout")})]}),d(ct,{children:[d("span",{className:"sub grow",children:i?`${n("panel.live")}: ${a}`:n("panel.nothingDeployed")}),e.domain&&i?d("a",{href:`https://${e.domain}`,children:e.domain}):null]})]})},G_=({overview:e,busy:r,note:n,act:i,onOpenRollout:t,send:o,onBack:a})=>{let s=Ue(),u=e.application,p=`#${u.id}`,[m,l]=ie("dev"),[_,g]=ie(""),[h,x]=ie(()=>e.scopes[0]?.name??""),$=e.latest_build;return d(Z,{children:[d(Al,{title:`${u.name} \xB7 #${u.id}`,sub:[u.namespace,u.repository_url].filter(Boolean).join(" \xB7 "),right:d(Z,{children:[a&&d(de,{variant:"linklike",className:"hasicon",onClick:a,children:[d(Le,{name:"arrowLeft",size:13})," ",s("panel.backToList")]}),d(ui,{status:u.status})]})}),d(lt,{label:s("panel.scopes"),children:[e.scopes.map(k=>d(K_,{scope:k,onOpenRollout:t},k.id)),e.scopes.length===0&&d(Z,{children:[d(Gr,{children:s("panel.noScopes")}),d(ct,{children:[d("input",{type:"text",placeholder:s("panel.scopePlaceholder"),value:m,onChange:k=>l(k.target.value)}),e.scope_types?.length?d("select",{value:_,onChange:k=>g(k.target.value),children:[d("option",{value:"",children:s("panel.typePlaceholder")}),e.scope_types.map(k=>d("option",{value:k.type??k.name,children:k.name??k.type},k.type??k.name))]}):null,d(de,{variant:"primary",disabled:r,onClick:()=>{let k={app:p,name:m.trim()||"dev"};_&&(k.type=_),i(xe.applicationScopeCreate,k,s("panel.createScope"))},children:s("panel.createScope")})]})]})]}),d(lt,{label:s("panel.releases"),children:d("div",{className:"chips",children:[e.releases.slice(0,6).map(k=>d("span",{className:"chip",children:[k.semver,k.live_on.length?d("span",{className:"live",children:[d("span",{className:"live-dot"})," ",s("panel.live")]}):e.scopes.length?d(de,{variant:"chipbtn",disabled:r,onClick:()=>i(xe.applicationDeploymentCreate,{app:p,version:k.semver},`${s("rollout.move")} ${k.semver}`),children:s("panel.ship")}):null]},k.id)),e.releases.length===0&&d("span",{className:"sub",children:s("panel.noReleases")})]})}),d(lt,{label:s("panel.latestBuild"),children:d("div",{className:"sub",children:$?`#${$.id} ${$.branch??""} @${String($.commit??"").slice(0,8)} (${$.status})`:s("panel.noBuild")})}),d(ct,{children:d("div",{className:"row",style:{marginTop:12,gap:8},children:[d(de,{variant:"primary",className:"hasicon",disabled:r||e.scopes.length===0,onClick:()=>i(xe.applicationDeploymentCreate,{app:p,...e.scopes.length>1&&h?{scope:h}:{}},s("panel.deployLatest")),children:[d(Le,{name:"rocket"})," ",s("panel.deployLatest")]}),e.scopes.length>1&&d("select",{value:h,onChange:k=>x(k.target.value),children:e.scopes.map(k=>d("option",{value:k.name,children:k.name},k.id))}),d(de,{className:"hasicon",onClick:()=>o(`Show the logs of ${u.name}`),children:[d(Le,{name:"logs"})," ",s("panel.logs")]}),d(de,{className:"hasicon",onClick:()=>o(`Show the performance metrics of ${u.name}`),children:[d(Le,{name:"metrics"})," ",s("panel.metrics")]})]})}),d(hf,{children:e.hint?.replace(/`/g,"").replace(/\*\*/g,"")}),d(Gr,{tone:n?.tone,children:n?.text})]})},Q_=[25,50,75,100],Y_=[5,10,30,60],X_=({dep:e,busy:r,note:n,act:i,call:t,onBack:o})=>{let a=Ue(),[s,u]=ie(e.desired_traffic??e.traffic??0),[p,m]=ie(0),[l,_]=ie([]),g=Se(!1),h=Se(e);h.current=e,ze(()=>{g.current||u(e.desired_traffic??e.traffic??0)},[e.desired_traffic,e.traffic]);let x=!!e.terminal||st.has(e.status),$=e.status==="running";ze(()=>{if(!p)return;let b=setInterval(()=>{let S=h.current;if(st.has(S.status)||S.status!=="running")return;let N=Q_.find(q=>q>(S.traffic??0));N!==void 0&&i(xe.applicationDeploymentUpdate,{deployment_id:S.id,percent:N},a("rollout.busyMove"))},p*1e3);return()=>clearInterval(b)},[p,i,a]),ze(()=>{if(!e.application_id||!e.scope_name)return;let b=!0,S=async()=>{try{let oe=(await t(xe.applicationLogList,{app:`#${e.application_id}`,scope:e.scope_name,lines:80})).structuredContent?.lines;b&&Array.isArray(oe)&&_(oe)}catch{}};if(S(),st.has(e.status))return()=>{b=!1};let N=setInterval(S,5e3);return()=>{b=!1,clearInterval(N)}},[e.application_id,e.scope_name,e.status,t]);let k=x?e.status==="finalized"?a("rollout.autoDone"):e.status==="rolled_back"||e.status==="cancelled"?a("rollout.autoRolledBack"):e.status==="failed"?a("rollout.autoFailed"):"":$?(e.traffic??0)===100?a("rollout.autoFull"):"":a("rollout.autoWaiting");return d(Z,{children:[d(Al,{title:e.scope_name?a("rollout.deployingTo",{scope:e.scope_name}):a("rollout.deployment",{id:e.id}),sub:[e.release_semver?`${a("rollout.release")} ${e.release_semver}`:null,`#${e.id}`].filter(Boolean).join(" \xB7 "),right:d(Z,{children:[d(ui,{status:e.status}),o&&d(de,{variant:"linklike",className:"hasicon",onClick:o,children:[d(Le,{name:"arrowLeft",size:13})," ",a("rollout.backToApp")]})]})}),d(lt,{label:a("rollout.trafficLabel"),children:[d(_f,{current:e.traffic,desired:e.desired_traffic}),d(yf,{value:s,disabled:x||r||!$,onChange:b=>{g.current=!0,u(b)},onCommit:b=>{g.current=!1,i(xe.applicationDeploymentUpdate,{deployment_id:e.id,percent:b},a("rollout.busyMove"))}}),d(bf,{}),d("div",{className:"sub",style:{marginTop:6},children:a("rollout.trafficHelp")}),d("div",{className:"row",style:{marginTop:12,gap:8},children:[d("label",{className:"auto",children:[d("span",{className:"sub",children:a("rollout.autoLabel")}),d("select",{value:p,disabled:x||!$,onChange:b=>m(Number(b.target.value)),children:[d("option",{value:0,children:a("rollout.autoOff")}),Y_.map(b=>d("option",{value:b,children:[b,"s"]},b))]})]}),d("span",{className:"grow"}),d(Zl,{text:a("rollout.confirmFinalize"),onYes:()=>i(xe.applicationDeploymentUpdate,{deployment_id:e.id,action:"finalize"},a("rollout.busyFinalize")),children:d(de,{disabled:x||r||!$,children:a("rollout.finalize")})}),d(Zl,{text:a("rollout.confirmRollback"),onYes:()=>i(xe.applicationDeploymentUpdate,{deployment_id:e.id,action:"rollback"},a("rollout.busyRollback")),children:d(de,{variant:"danger",disabled:x||r,children:a("rollout.rollback")})})]}),d(Gr,{tone:n?.tone,children:n?.text||k})]}),d(lt,{label:a("rollout.log"),children:d(Ll,{lines:e.messages??[],height:140,follow:$,controls:!1,empty:a("rollout.waiting")})}),d(lt,{label:a("rollout.appLogs"),children:d(Ll,{lines:l,height:160,follow:$,empty:a("rollout.appLogsEmpty")})})]})};function xf({source:e,bridge:r,onBack:n}){let{call:i,send:t,brief:o}=r,a=Kr(()=>gf(pf(e)),[e]),[s,u]=ie({kind:"empty"}),[p,m]=ie(!1),[l,_]=ie(),g=Se(null),h=Se(s);h.current=s;let x=Ze(S=>{let N=S?.structuredContent;if(!N)return!1;if(N.deployment){let q=N.deployment;return q.application_id&&(g.current=`#${q.application_id}`),u(oe=>({kind:"rollout",dep:oe.kind==="rollout"?{...oe.dep,...q}:q})),!0}if(N.application)return g.current=`#${N.application.id}`,u({kind:"overview",overview:N}),!0;if(Array.isArray(N.scope_types)&&h.current.kind==="overview"){let q={...h.current.overview,scope_types:N.scope_types};return u({kind:"overview",overview:q}),_({text:a("panel.pickType")}),!0}return!1},[a]);ze(()=>{x(e)&&_(void 0)},[e,x]);let $=s.kind==="rollout"?s.dep.status:void 0;ze(()=>{let S=$!==void 0&&!st.has($)?2500:s.kind==="overview"?6e3:0;if(!S)return;let N=setInterval(async()=>{try{let q=h.current;q.kind==="rollout"?x(await i(xe.applicationGet,{deployment:q.dep.id})):q.kind==="overview"&&g.current&&x(await i(xe.applicationGet,{app:g.current}))}catch{}},S);return()=>clearInterval(N)},[s.kind,x,i,$]);let k=Ze((S,N,q)=>{(async()=>{m(!0),_({text:q});try{let oe=await i(S,N),we=rf(oe);x(oe)?_(void 0):_({text:we.slice(0,220)}),o(`[panel] user ran ${S} from the widget. Result: ${we.slice(0,300)}`)}catch(oe){_({tone:"bad",text:a("rollout.failed",{message:lf(oe)})})}m(!1)})()},[x,o,i,a]),b=Ze(()=>{let S=g.current;S&&i(xe.applicationGet,{app:S}).then(x).catch(()=>{})},[x,i]);return d(ff,{value:a,children:d(Cl,{children:[s.kind==="overview"&&d(G_,{overview:s.overview,busy:p,note:l,act:k,send:t,onBack:n,onOpenRollout:S=>u({kind:"rollout",dep:S})}),s.kind==="rollout"&&d(X_,{dep:s.dep,busy:p,note:l,act:k,call:i,onBack:g.current?b:n}),s.kind==="empty"&&d(Gr,{children:a("panel.waitingData")})]})})}function ey(){let{result:e,call:r,send:n,brief:i}=nf("np-panel");return e?d(xf,{source:e,bridge:{call:r,send:n,brief:i}}):d(vf,{variant:"panel"})}af(d(ey,{}));})();
831
831
  </script></body></html>