import{cE as e,bh as t,P as o,a8 as i}from"./cec18ad9a-DiLjrOUd.js";import{r as n,j as s}from"./vendor-react-AXa6hZO5.js";import{bK as r,J3 as a,J4 as c,J5 as d,J6 as l}from"./index-C_tZnXTW.js";import{M as u}from"./vendor-intl-BdADXLLt.js";const p=".claudemcpcontent.com",m=/^([0-9a-f]{32})\.claudemcpcontent\.com$/i;async function f(e){const t=(new TextEncoder).encode(e),o=await globalThis.crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(o)).map(e=>e.toString(16).padStart(2,"0")).join("").slice(0,32)}async function E(e,t){return f(e+t)}class h extends Error{constructor(){super(...arguments),this.name="DomainValidationError"}}class b extends h{constructor(){super(...arguments),this.name="UiDomainLocalConnectorError"}}class g extends h{constructor(){super(...arguments),this.name="UiDomainFormatError"}}class _ extends h{constructor(){super(...arguments),this.name="UiDomainMismatchError"}}async function R(e,t){if(!t)throw new b("ui.domain cannot be used with local connectors. Stable sandbox origins require a remote connector with a verified URL.");const o=e.toLowerCase().match(m);if(!o)throw k(t),new g(`Invalid ui.domain format: expected "{hash}.claudemcpcontent.com", got "${e}".`);const i=o[1],n=await async function(e){return f(e)}(t);if(i!==n)throw k(t),new _(`ui.domain mismatch: expected "${n}${p}", but got "${e}".`);return i}function k(t){const o=e(t)??"<unparseable URL>";console.error(`[mcp-ext-apps-host] ui.domain validation failed for connector "${o}". Compute the expected ui.domain by substituting your full connector URL into: node -e "console.log(require('crypto').createHash('sha256').update('<YOUR_CONNECTOR_URL>').digest('hex').slice(0,32)+'.claudemcpcontent.com')"`)}function y(e,t,o){const i=new URL(e.href);if(x(i))return i;const n=o?`staging-${t}`:t,s=i.hostname.split(".");return s.length>=2&&(s[0]=n,i.hostname=s.join(".")),i}function O(e,t,o){const i=new URL(e.href);if(x(i))return i;const n=o?`staging-${t}`:t,s=i.hostname.split(".");return s.length>=2&&(s[0]=n,i.hostname=s.join(".")),i}function x(e){return!e.hostname.endsWith(p)}const A=Object.freeze(Object.defineProperty({__proto__:null,WiggleSharingModals:function({artifactVersion:e,sharedVersions:p,onClose:m,onUpdate:f,projectUuid:E}){const h=r(E),{publishedArtifactsBaseUrl:b}=t(),{copyToClipboard:g}=o(),[_,R]=n.useState("latest"),{mutateAsync:k,isPending:y}=a(e.uuid),O=e.published_artifact_uuid?"publish":"share",x=c(O,{artifact_uuid:e.artifact_uuid,artifact_version_uuid:e.uuid,message_uuid:e.message_uuid,published_artifact_uuid:e.published_artifact_uuid},b,_);return"share"===O?s.jsx(d,{isOpen:!0,isProjectArtifact:!!h.data?.is_private,isLoading:y,sharedLink:x||"",isShared:"shared"===e.visibility,onClose:m,linkMode:_,onLinkModeChange:R,sharedVersions:p,handleClickShareButton:async()=>{await k({visibility:"shared"});const t=c(O,{artifact_uuid:e.artifact_uuid,artifact_version_uuid:e.uuid,message_uuid:e.message_uuid,published_artifact_uuid:e.published_artifact_uuid},b,_);await g(t||""),f()},updateSharedState:async e=>{"loading"!==e&&(await k({visibility:e}),f())}}):"publish"===O&&e.published_artifact_uuid&&!e.published_artifact_deleted_at?s.jsx(i,{isOpen:!0,hasCloseButton:!0,modalSize:"lg",onClose:m,title:s.jsx("span",{className:"text-text-200 font-claude-response text-xl font-medium",children:s.jsx(u,{defaultMessage:"Publish artifact",id:"D1fyBhklj/"})}),children:s.jsx("div",{className:"mt-2 flex flex-col gap-2.5",children:s.jsx(l,{artifactUuid:e.published_artifact_uuid,publishedLink:x||"",onUnpublish:f,onClose:m})})}):null}},Symbol.toStringTag,{value:"Module"}));
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/var T={comments:{lineComment:"COMMENT"},brackets:[["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:":",close:"."}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`"},{open:'"',close:'"'},{open:"'",close:"'"},{open:":",close:"."}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|COMMENT\\s+)#region"),end:new RegExp("^\\s*(::\\s*|COMMENT\\s+)#endregion")}}};const N=Object.freeze(Object.defineProperty({__proto__:null,conf:T,language:{tokenPostfix:".lexon",ignoreCase:!0,keywords:["lexon","lex","clause","terms","contracts","may","pay","pays","appoints","into","to"],typeKeywords:["amount","person","key","time","date","asset","text"],operators:["less","greater","equal","le","gt","or","and","add","added","subtract","subtracted","multiply","multiplied","times","divide","divided","is","be","certified"],symbols:/[=><!~?:&|+\-*\/\^%]+/,tokenizer:{root:[[/^(\s*)(comment:?(?:\s.*|))$/,["","comment"]],[/"/,{token:"identifier.quote",bracket:"@open",next:"@quoted_identifier"}],["LEX$",{token:"keyword",bracket:"@open",next:"@identifier_until_period"}],["LEXON",{token:"keyword",bracket:"@open",next:"@semver"}],[":",{token:"delimiter",bracket:"@open",next:"@identifier_until_period"}],[/[a-z_$][\w$]*/,{cases:{"@operators":"operator","@typeKeywords":"keyword.type","@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\.\d*\.\d*/,"number.semver"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"]],quoted_identifier:[[/[^\\"]+/,"identifier"],[/"/,{token:"identifier.quote",bracket:"@close",next:"@pop"}]],space_identifier_until_period:[[":","delimiter"],[" ",{token:"white",next:"@identifier_rest"}]],identifier_until_period:[{include:"@whitespace"},[":",{token:"delimiter",next:"@identifier_rest"}],[/[^\\.]+/,"identifier"],[/\./,{token:"delimiter",bracket:"@close",next:"@pop"}]],identifier_rest:[[/[^\\.]+/,"identifier"],[/\./,{token:"delimiter",bracket:"@close",next:"@pop"}]],semver:[{include:"@whitespace"},[":","delimiter"],[/\d*\.\d*\.\d*/,{token:"number.semver",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"]]}}},Symbol.toStringTag,{value:"Module"}));
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/const w=Object.freeze(Object.defineProperty({__proto__:null,conf:{comments:{blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"(*",close:"*)"},{open:"<*",close:"*>"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}]},language:{defaultToken:"",tokenPostfix:".m3",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["AND","ANY","ARRAY","AS","BEGIN","BITS","BRANDED","BY","CASE","CONST","DIV","DO","ELSE","ELSIF","END","EVAL","EXCEPT","EXCEPTION","EXIT","EXPORTS","FINALLY","FOR","FROM","GENERIC","IF","IMPORT","IN","INTERFACE","LOCK","LOOP","METHODS","MOD","MODULE","NOT","OBJECT","OF","OR","OVERRIDES","PROCEDURE","RAISE","RAISES","READONLY","RECORD","REF","REPEAT","RETURN","REVEAL","SET","THEN","TO","TRY","TYPE","TYPECASE","UNSAFE","UNTIL","UNTRACED","VALUE","VAR","WHILE","WITH"],reservedConstNames:["ABS","ADR","ADRSIZE","BITSIZE","BYTESIZE","CEILING","DEC","DISPOSE","FALSE","FIRST","FLOAT","FLOOR","INC","ISTYPE","LAST","LOOPHOLE","MAX","MIN","NARROW","NEW","NIL","NUMBER","ORD","ROUND","SUBARRAY","TRUE","TRUNC","TYPECODE","VAL"],reservedTypeNames:["ADDRESS","ANY","BOOLEAN","CARDINAL","CHAR","EXTENDED","INTEGER","LONGCARD","LONGINT","LONGREAL","MUTEX","NULL","REAL","REFANY","ROOT","TEXT"],operators:["+","-","*","/","&","^","."],relations:["=","#","<","<=",">",">=","<:",":"],delimiters:["|","..","=>",",",";",":="],symbols:/[>=<#.,:;+\-*/&^]+/,escapes:/\\(?:[\\fnrt"']|[0-7]{3})/,tokenizer:{root:[[/_\w*/,"invalid"],[/[a-zA-Z][a-zA-Z0-9_]*/,{cases:{"@keywords":{token:"keyword.$0"},"@reservedConstNames":{token:"constant.reserved.$0"},"@reservedTypeNames":{token:"type.reserved.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[0-9]+\.[0-9]+(?:[DdEeXx][\+\-]?[0-9]+)?/,"number.float"],[/[0-9]+(?:\_[0-9a-fA-F]+)?L?/,"number"],[/@symbols/,{cases:{"@operators":"operators","@relations":"operators","@delimiters":"delimiter","@default":"invalid"}}],[/'[^\\']'/,"string.char"],[/(')(@escapes)(')/,["string.char","string.escape","string.char"]],[/'/,"invalid"],[/"([^"\\]|\\.)*$/,"invalid"],[/"/,"string.text","@text"]],text:[[/[^\\"]+/,"string.text"],[/@escapes/,"string.escape"],[/\\./,"invalid"],[/"/,"string.text","@pop"]],comment:[[/\(\*/,"comment","@push"],[/\*\)/,"comment","@pop"],[/./,"comment"]],pragma:[[/<\*/,"keyword.pragma","@push"],[/\*>/,"keyword.pragma","@pop"],[/./,"keyword.pragma"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/<\*/,"keyword.pragma","@pragma"]]}}},Symbol.toStringTag,{value:"Module"}));export{A as W,O as a,y as b,E as c,N as l,w as m,R as v};
