@interactive-inc/claude-funnel 0.58.0 → 0.58.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/claude.d.ts +5 -5
- package/dist/claude.js +1 -1
- package/dist/connectors/discord.d.ts +3 -3
- package/dist/connectors/gh.d.ts +4 -4
- package/dist/connectors/schedule.d.ts +1 -1
- package/dist/connectors/slack.d.ts +2 -2
- package/dist/diagnostics.d.ts +1 -1
- package/dist/docs.d.ts +1 -1
- package/dist/doctor.d.ts +1 -1
- package/dist/{file-process-guard-DI1742H5.d.ts → file-process-guard-B3IFCj_G.d.ts} +5 -5
- package/dist/{funnel-diagnostics-qWy5tPSq.d.ts → funnel-diagnostics-K-wON25Y.d.ts} +1 -1
- package/dist/{funnel-doctor-BF3Rdgk0.d.ts → funnel-doctor-vxO96TCA.d.ts} +2 -2
- package/dist/funnel-log-sqlite-sink-B_5_4ybn.js +301 -0
- package/dist/{funnel-recovery-BUBsu7WX.d.ts → funnel-recovery-COExL9MD.d.ts} +1 -1
- package/dist/gateway.d.ts +2 -2
- package/dist/gateway.js +1 -1
- package/dist/{index-tP67P1Sy.d.ts → index-B9iyugar.d.ts} +13 -13
- package/dist/index.d.ts +16 -16
- package/dist/index.js +1 -1
- package/dist/{local-config-sync-BY20ixEV.d.ts → local-config-sync--f739oCJ.d.ts} +8 -8
- package/dist/local-config.d.ts +2 -2
- package/dist/local-config.js +1 -1
- package/dist/logger.d.ts +384 -0
- package/dist/logger.js +281 -0
- package/dist/{memory-diagnostic-log-CvqobDDs.js → memory-diagnostic-log-5LzwJ_F7.js} +1 -298
- package/dist/{memory-token-prompter-DOgptiIb.d.ts → memory-token-prompter-BlFwK9k7.d.ts} +2 -2
- package/dist/{profiles-EHTeCOqB.d.ts → profiles-g2qGVOWv.d.ts} +3 -3
- package/dist/profiles.d.ts +1 -1
- package/dist/recovery.d.ts +1 -1
- package/dist/{schedule-listener-DKh0hnkK.d.ts → schedule-listener-DoMPjHZj.d.ts} +2 -2
- package/dist/{settings-reader-CBrgz01o.d.ts → settings-reader-DPwqOVUm.d.ts} +1 -1
- package/dist/{slack-listener-DFW9vck4.d.ts → slack-listener-Dj9NFbAJ.d.ts} +1 -1
- package/package.json +1 -1
- /package/dist/{connector-adapter-BkYC6qiK.d.ts → connector-adapter-DGacCppE.d.ts} +0 -0
- /package/dist/{diagnostic-log-Bxe7Bbvw.d.ts → diagnostic-log-Cb3v8P7p.d.ts} +0 -0
- /package/dist/{discord-connector-schema-CWHVNIcB.d.ts → discord-connector-schema-CQyfDkLD.d.ts} +0 -0
- /package/dist/{file-system-Wub9Nto4.d.ts → file-system-DxpnnUVb.d.ts} +0 -0
- /package/dist/{funnel-docs-dXPokzr5.d.ts → funnel-docs-DYBs1-H_.d.ts} +0 -0
- /package/dist/{gh-connector-schema-CU1ojfIF.d.ts → gh-connector-schema-CZzwzvqY.d.ts} +0 -0
- /package/dist/{memory-token-prompter-vBXxY20-.js → memory-token-prompter-C7vREzCL.js} +0 -0
- /package/dist/{process-runner-D5I_jhYQ.d.ts → process-runner-Cx5O_fTf.d.ts} +0 -0
- /package/dist/{settings-schema-zhnMIa8I.d.ts → settings-schema-1hh11jnN.d.ts} +0 -0
package/dist/bin.js
CHANGED
|
@@ -606,7 +606,7 @@ Since you have not provided a token or authorize, you might be missing one or mo
|
|
|
606
606
|
* Copyright(c) 2013 Roman Shtylman
|
|
607
607
|
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
608
608
|
* MIT Licensed
|
|
609
|
-
*/var AM=oe1(),vA6=b("events").EventEmitter,U60=se1(),G60=$00(),J60=vd(),q60=A00(),x60=H60();i7=B60.exports=bA6;function bA6(){var $=function(Y,Q,X){$.handle(Y,Q,X)};return U60($,vA6.prototype,!1),U60($,G60,!1),$.request=Object.create(q60,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.response=Object.create(x60,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.init(),$}i7.application=G60;i7.request=q60;i7.response=x60;i7.Route=J60.Route;i7.Router=J60;i7.json=AM.json;i7.raw=AM.raw;i7.static=V60();i7.text=AM.text;i7.urlencoded=AM.urlencoded});var b60=q((z8)=>{var _A6=z8&&z8.__createBinding||(Object.create?function($,Y,Q,X){if(X===void 0)X=Q;var z=Object.getOwnPropertyDescriptor(Y,Q);if(!z||("get"in z?!Y.__esModule:z.writable||z.configurable))z={enumerable:!0,get:function(){return Y[Q]}};Object.defineProperty($,X,z)}:function($,Y,Q,X){if(X===void 0)X=Q;$[X]=Y[Q]}),AA6=z8&&z8.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),N60=z8&&z8.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))_A6(Y,$,Q)}return AA6(Y,$),Y},RM=z8&&z8.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(z8,"__esModule",{value:!0});z8.buildBodyParserMiddleware=z8.verifySignatureAndParseBody=z8.verifySignatureAndParseRawBody=z8.respondToUrlVerification=z8.respondToSslCheck=void 0;var RA6=RM(b("crypto")),TA6=b("http"),fA6=b("https"),kA6=RM(b("querystring")),L60=p8(),SA6=vJ(),F60=N60(D60()),EA6=RM(pI()),CA6=RM(iI()),NQ=N$(),YH=N60(EJ()),uA6=nI(),cA6=aI(),yA6=["ALPNProtocols","clientCertEngine","enableTrace","handshakeTimeout","rejectUnauthorized","requestCert","sessionTimeout","SNICallback","ticketKeys","pskCallback","pskIdentityHint","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","passphrase","pfx","secureOptions","secureProtocol","sessionIdContext"],ld="The receiver cannot be started because private state was mutated. Please report this to the maintainers.",gA6=($,Y,Q)=>{if($.body?.ssl_check){Y.send();return}Q()};z8.respondToSslCheck=gA6;var hA6=($,Y,Q)=>{if($.body?.type&&$.body.type==="url_verification"){Y.json({challenge:$.body.challenge});return}Q()};z8.respondToUrlVerification=hA6;class P60{app;server;bolt;logger;processBeforeResponse;signatureVerification;router;installer=void 0;installerOptions;customPropertiesExtractor;dispatchErrorHandler;processEventErrorHandler;unhandledRequestHandler;unhandledRequestTimeoutMillis;constructor({signingSecret:$="",logger:Y=void 0,logLevel:Q=L60.LogLevel.INFO,endpoints:X={events:"/slack/events"},processBeforeResponse:z=!1,signatureVerification:Z=!0,clientId:K=void 0,clientSecret:W=void 0,stateSecret:H=void 0,redirectUri:w=void 0,installationStore:V=void 0,scopes:U=void 0,installerOptions:G={},app:J=void 0,router:x=void 0,customPropertiesExtractor:D=(I)=>({}),dispatchErrorHandler:B=YH.defaultAsyncDispatchErrorHandler,processEventErrorHandler:L=YH.defaultProcessEventErrorHandler,unhandledRequestHandler:j=YH.defaultUnhandledRequestHandler,unhandledRequestTimeoutMillis:F=3001}){if(this.app=J!==void 0?J:(0,F60.default)(),typeof Y<"u")this.logger=Y;else this.logger=new L60.ConsoleLogger,this.logger.setLevel(Q);this.signatureVerification=Z;let M=[this.signatureVerification?j60(this.logger,$):M60(this.logger),z8.respondToSslCheck,z8.respondToUrlVerification,this.requestHandler.bind(this)];this.processBeforeResponse=z;let c=typeof X==="string"?[X]:Object.values(X);this.router=x!==void 0?x:(0,F60.Router)();for(let p of c)this.router.post(p,...M);if(this.customPropertiesExtractor=D,this.dispatchErrorHandler=B,this.processEventErrorHandler=L,this.unhandledRequestHandler=j,this.unhandledRequestTimeoutMillis=F,(0,cA6.verifyRedirectOpts)({redirectUri:w,redirectUriPath:G.redirectUriPath}),K!==void 0&&W!==void 0&&(G.stateVerification===!1||H!==void 0||G.stateStore!==void 0))this.installer=new SA6.InstallProvider({clientId:K,clientSecret:W,stateSecret:H,installationStore:V,logLevel:Q,logger:Y,directInstall:G.directInstall,stateStore:G.stateStore,stateVerification:G.stateVerification,legacyStateVerification:G.legacyStateVerification,stateCookieName:G.stateCookieName,stateCookieExpirationSeconds:G.stateCookieExpirationSeconds,renderHtmlForInstallPath:G.renderHtmlForInstallPath,authVersion:G.authVersion??"v2",clientOptions:G.clientOptions,authorizationUrl:G.authorizationUrl});let e={metadata:G.metadata,scopes:U??[],userScopes:G.userScopes,redirectUri:w};if(this.installer!==void 0){let{installer:p}=this,g=G.redirectUriPath===void 0?"/slack/oauth_redirect":G.redirectUriPath,{callbackOptions:l,stateVerification:K1}=G;this.router.use(g,async(R1,_1)=>{try{if(K1===!1)await p.handleCallback(R1,_1,l,e);else await p.handleCallback(R1,_1,l)}catch(h1){await this.dispatchErrorHandler({error:h1,logger:this.logger,request:R1,response:_1})}});let w1=G.installPath===void 0?"/slack/install":G.installPath,{installPathOptions:v1}=G;this.router.get(w1,async(R1,_1,h1)=>{try{try{await p.handleInstallPath(R1,_1,v1,e)}catch(C1){h1(C1)}}catch(C1){await this.dispatchErrorHandler({error:C1,logger:this.logger,request:R1,response:_1})}})}this.app.use(this.router)}async requestHandler($,Y){let Q=new uA6.HTTPResponseAck({logger:this.logger,processBeforeResponse:this.processBeforeResponse,unhandledRequestHandler:this.unhandledRequestHandler,unhandledRequestTimeoutMillis:this.unhandledRequestTimeoutMillis,httpRequest:$,httpRequestBody:$.body,httpResponse:Y}),X={body:$.body,ack:Q.bind(),retryNum:YH.extractRetryNumFromHTTPRequest($),retryReason:YH.extractRetryReasonFromHTTPRequest($),customProperties:this.customPropertiesExtractor($)};try{if(await this.bolt?.processEvent(X),Q.storedResponse!==void 0)YH.buildContentResponse(Y,Q.storedResponse),this.logger.debug("stored response sent")}catch(z){if(await this.processEventErrorHandler({error:z,logger:this.logger,request:$,response:Y,storedResponse:Q.storedResponse}))Q.ack()}}init($){this.bolt=$}start($,Y={}){let Q=TA6.createServer;if(Object.keys(Y).filter((X)=>yA6.includes(X)).length>0)Q=fA6.createServer;if(this.server!==void 0)return Promise.reject(new NQ.ReceiverInconsistentStateError("The receiver cannot be started because it was already started."));return this.server=Q(Y,this.app),new Promise((X,z)=>{if(this.server===void 0)throw new NQ.ReceiverInconsistentStateError(ld);this.server.on("error",(Z)=>{if(this.server===void 0)throw new NQ.ReceiverInconsistentStateError(ld);this.server.close(),z(Z)}),this.server.on("close",()=>{this.server=void 0}),this.server.listen($,()=>{if(this.server===void 0)return z(new NQ.ReceiverInconsistentStateError(ld));return X(this.server)})})}stop(){if(this.server===void 0)return Promise.reject(new NQ.ReceiverInconsistentStateError("The receiver cannot be stopped because it was not started."));return new Promise(($,Y)=>{this.server?.close((Q)=>{if(Q!==void 0)return Y(Q);return this.server=void 0,$()})})}}z8.default=P60;function mA6($,Y){return j60($,Y)}z8.verifySignatureAndParseRawBody=mA6;function j60($,Y){return async(Q,X,z)=>{let Z=await v60(Q);try{Q.body=I60(typeof Y==="string"?Y:await Y(),Z,Q.headers)}catch(K){if(K){if(K instanceof NQ.ReceiverAuthenticityError){nd($,"Request verification failed",K),X.status(401).send();return}nd($,"Parsing request body failed",K),X.status(400).send();return}}z()}}function nd($,Y,Q){let X="code"in Q?`${Y} (code: ${Q.code}, message: ${Q.message})`:`${Y} (error: ${Q})`;$.warn(X)}function pA6($,Y,Q,X){if(Q===void 0||X===void 0)throw new NQ.ReceiverAuthenticityError("Slack request signing verification failed. Some headers are missing.");let z=Number(X);if(Number.isNaN(z))throw new NQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is invalid.");let Z=Math.floor(Date.now()/1000)-300;if(z<Z)throw new NQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is too old.");let K=RA6.default.createHmac("sha256",$),[W,H]=Q.split("=");if(K.update(`${W}:${z}:${Y}`),!(0,CA6.default)(H,K.digest("hex")))throw new NQ.ReceiverAuthenticityError("Slack request signing verification failed. Signature mismatch.")}function I60($,Y,Q){let{"x-slack-signature":X,"x-slack-request-timestamp":z,"content-type":Z}=Q;return pA6($,Y,X,z),O60(Y,Z)}z8.verifySignatureAndParseBody=I60;function M60($){return async(Y,Q,X)=>{let z=await v60(Y);try{let{"content-type":Z}=Y.headers;Y.body=O60(z,Z)}catch(Z){if(Z){nd($,"Parsing request body failed",Z),Q.status(400).send();return}}X()}}z8.buildBodyParserMiddleware=M60;function O60($,Y){if(Y==="application/x-www-form-urlencoded"){let Q=kA6.default.parse($);if(typeof Q.payload==="string")return JSON.parse(Q.payload);return Q}return JSON.parse($)}async function v60($){if("rawBody"in $&&$.rawBody)return Promise.resolve($.rawBody.toString());return(await(0,EA6.default)($)).toString()}});var f60=q((R60)=>{Object.defineProperty(R60,"__esModule",{value:!0});R60.DefaultThreadContextStore=void 0;var _60=dd();class A60{context={};async get($){let{context:Y,client:Q,payload:X,logger:z}=$;if(z.debug("DefaultAssistantThreadStore: get method called"),this.context.channel_id)return this.context;let{channelId:Z,threadTs:K}=(0,_60.extractThreadInfo)(X),W=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!W.messages)return{};let H=W.messages.find((V)=>!("subtype"in V)&&V.user===Y.botUserId);return(H?.metadata?H.metadata.event_payload:null)||{}}async save($){let{context:Y,client:Q,payload:X,logger:z}=$,{channelId:Z,threadTs:K,context:W}=(0,_60.extractThreadInfo)(X);z.debug("DefaultAssistantThreadStore: save method called");let H=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!H.messages)return;let w=H.messages.find((V)=>!("subtype"in V)&&V.user===Y.botUserId);if(w?.ts){let V={channel:Z,ts:w.ts,text:w.text,blocks:w.blocks?w.blocks:[],metadata:{event_type:"assistant_thread_context",event_payload:W}};await Q.chat.update(V)}this.context=W}}R60.DefaultThreadContextStore=A60});var dd=q((u8)=>{var iA6=u8&&u8.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(u8,"__esModule",{value:!0});u8.extractThreadInfo=u8.processAssistantMiddleware=u8.validate=u8.isAssistantMessage=u8.matchesConstraints=u8.isAssistantEvent=u8.enrichAssistantArgs=u8.Assistant=void 0;var lA6=f60(),k60=Zi(),P4=N$(),TM=lj(),nA6=iA6(nj()),dA6=new Set(["assistant_thread_started","assistant_thread_context_changed","message"]);class S60{threadContextStore;threadStarted;threadContextChanged;userMessage;constructor($){y60($);let{threadContextStore:Y=new lA6.DefaultThreadContextStore,threadStarted:Q,threadContextChanged:X=(Z)=>Y.save(Z),userMessage:z}=$;this.threadContextStore=Y,this.threadStarted=Array.isArray(Q)?Q:[Q],this.threadContextChanged=Array.isArray(X)?X:[X],this.userMessage=Array.isArray(z)?z:[z]}getMiddleware(){return async($)=>{if(C60($)&&u60($))return this.processEvent($);return $.next()}}async processEvent($){let{payload:Y}=$,Q=E60(this.threadContextStore,$),X=this.getAssistantMiddleware(Y);return g60(Q,X)}getAssistantMiddleware($){switch($.type){case"assistant_thread_started":return this.threadStarted;case"assistant_thread_context_changed":return this.threadContextChanged;case"message":return this.userMessage;default:return[]}}}u8.Assistant=S60;function E60($,Y){let{next:Q,...X}=Y,z={...X};return z.getThreadContext=()=>$.get(Y),z.saveThreadContext=()=>$.save(Y),z.say=aA6(z),z.sayStream=oA6(z),z.setStatus=rA6(z),z.setSuggestedPrompts=sA6(z),z.setTitle=tA6(z),z}u8.enrichAssistantArgs=E60;function C60($){return dA6.has($.payload.type)}u8.isAssistantEvent=C60;function u60($){return $.payload.type==="message"?c60($.payload):!0}u8.matchesConstraints=u60;function c60($){let Y="channel"in $&&"thread_ts"in $,Q="channel_type"in $&&$.channel_type==="im"&&(!("subtype"in $)||$.subtype==="file_share"||$.subtype===void 0);return Y&&Q}u8.isAssistantMessage=c60;function y60($){if(typeof $!=="object")throw new P4.AssistantInitializationError("Assistant expects a configuration object as the argument");let Y=["threadStarted","userMessage"],Q=[];for(let z of Y)if($[z]===void 0)Q.push(z);if(Q.length>0){let z=`Assistant is missing required keys: ${Q.join(", ")}`;throw new P4.AssistantInitializationError(z)}let X=["threadStarted","userMessage"];if("threadContextChanged"in $)X.push("threadContextChanged");for(let z of X)if(typeof $[z]!=="function"&&!Array.isArray($[z])){let Z=`Assistant ${z} property must be a function or an array of functions`;throw new P4.AssistantInitializationError(Z)}if($.threadContextStore){if(typeof $.threadContextStore!=="object")throw new P4.AssistantInitializationError("Assistant expects threadContextStore to be a configuration object");let z=["get","save"],Z=[];for(let W of z)if($.threadContextStore&&$.threadContextStore[W]===void 0)Z.push(W);if(Z.length>0){let W=`threadContextStore is missing required keys: ${Z.join(", ")}`;throw new P4.AssistantInitializationError(W)}let K=["get","save"];for(let W of K)if($.threadContextStore&&typeof $.threadContextStore[W]!=="function"){let H=`threadContextStore ${W} property must be a function`;throw new P4.AssistantInitializationError(H)}}}u8.validate=y60;async function g60($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,nA6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}u8.processAssistantMiddleware=g60;function aA6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z,context:Z}=QH(Q);return async(K)=>{let W=Z.channel_id?Z:await $.getThreadContext(),H=typeof K==="string"?{text:K,channel:X,thread_ts:z}:{...K,channel:X,thread_ts:z};if(W||H.metadata)H.metadata={event_type:H.metadata?.event_type??"assistant_thread_context",event_payload:{...W,...H.metadata?.event_payload??{}}};return Y.chat.postMessage(H)}}function oA6($){let{client:Y,context:Q,payload:X}=$,{channelId:z,threadTs:Z}=QH(X);return(0,k60.createSayStream)(Y,Q,z,Z)}function rA6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=QH(Q);return(0,k60.createSetStatus)(Y,X,z)}function sA6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=QH(Q);return(Z)=>{let{prompts:K,title:W}=Z;return Y.assistant.threads.setSuggestedPrompts({channel_id:X,thread_ts:z,prompts:K,title:W})}}function tA6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=QH(Q);return(Z)=>Y.assistant.threads.setTitle({channel_id:X,thread_ts:z,title:Z})}function QH($){let Y={};if("assistant_thread"in $&&(0,TM.isRecord)($.assistant_thread)){if((0,TM.isRecord)($.assistant_thread.context))Y=$.assistant_thread.context}let Q=(0,TM.extractEventChannelId)($),X=(0,TM.extractEventThreadTs)($);if(!Q||!X){let z=[];if(!Q)z.push("channel_id");if(!X)z.push("thread_ts");throw new P4.AssistantMissingPropertyError(`Assistant message event is missing required properties: ${z.join(", ")}`)}return{channelId:Q,threadTs:X,context:Y}}u8.extractThreadInfo=QH});var n60=q((d9)=>{var eA6=d9&&d9.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(d9,"__esModule",{value:!0});d9.prepareStepArgs=d9.isStepEvent=d9.processStepMiddleware=d9.validate=d9.WorkflowStep=void 0;var fM=N$(),$R6=eA6(nj()),YR6=new Set(["workflow_step_edit","workflow_step","workflow_step_execute"]);class h60{callbackId;edit;save;execute;constructor($,Y){m60($,Y);let{save:Q,edit:X,execute:z}=Y;this.callbackId=$,this.save=Array.isArray(Q)?Q:[Q],this.edit=Array.isArray(X)?X:[X],this.execute=Array.isArray(z)?z:[z]}getMiddleware(){return async($)=>{if(i60($)&&this.matchesConstraints($))return this.processEvent($);return $.next()}}matchesConstraints($){return $.payload.callback_id===this.callbackId}async processEvent($){let{payload:Y}=$,Q=l60($),X=this.getStepMiddleware(Y);return p60(Q,X)}getStepMiddleware($){switch($.type){case"workflow_step_edit":return this.edit;case"workflow_step":return this.save;case"workflow_step_execute":return this.execute;default:return[]}}}d9.WorkflowStep=h60;function m60($,Y){if(typeof $!=="string")throw new fM.WorkflowStepInitializationError("WorkflowStep expects a callback_id as the first argument");if(typeof Y!=="object")throw new fM.WorkflowStepInitializationError("WorkflowStep expects a configuration object as the second argument");let Q=["save","edit","execute"],X=[];for(let Z of Q)if(Y[Z]===void 0)X.push(Z);if(X.length>0){let Z=`WorkflowStep is missing required keys: ${X.join(", ")}`;throw new fM.WorkflowStepInitializationError(Z)}let z=["save","edit","execute"];for(let Z of z)if(typeof Y[Z]!=="function"&&!Array.isArray(Y[Z])){let K=`WorkflowStep ${Z} property must be a function or an array of functions`;throw new fM.WorkflowStepInitializationError(K)}}d9.validate=m60;async function p60($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,$R6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}d9.processStepMiddleware=p60;function i60($){return YR6.has($.payload.type)}d9.isStepEvent=i60;function kM($){return $.botToken!==void 0?$.botToken:$.userToken}function QR6($){let{context:Y,client:Q,body:{callback_id:X,trigger_id:z}}=$,Z=kM(Y);return(K)=>Q.views.open({token:Z,trigger_id:z,view:{callback_id:X,type:"workflow_step",...K}})}function XR6($){let{context:Y,client:Q,body:{workflow_step:{workflow_step_edit_id:X}}}=$,z=kM(Y);return(Z={})=>Q.workflows.updateStep({token:z,workflow_step_edit_id:X,...Z})}function zR6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=kM(Y);return(Z={})=>Q.workflows.stepCompleted({token:z,workflow_step_execute_id:X,...Z})}function ZR6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=kM(Y);return(Z)=>{let{error:K}=Z;return Q.workflows.stepFailed({token:z,workflow_step_execute_id:X,error:K})}}function l60($){let{next:Y,...Q}=$,X={...Q};switch(X.payload.type){case"workflow_step_edit":X.step=X.action.workflow_step,X.configure=QR6(X);break;case"workflow_step":X.step=X.body.workflow_step,X.update=XR6(X);break;case"workflow_step_execute":X.step=X.event.workflow_step,X.complete=zR6(X),X.fail=ZR6(X);break;default:break}return X}d9.prepareStepArgs=l60});var s60=q((o1)=>{var d60=o1&&o1.__createBinding||(Object.create?function($,Y,Q,X){if(X===void 0)X=Q;var z=Object.getOwnPropertyDescriptor(Y,Q);if(!z||("get"in z?!Y.__esModule:z.writable||z.configurable))z={enumerable:!0,get:function(){return Y[Q]}};Object.defineProperty($,X,z)}:function($,Y,Q,X){if(X===void 0)X=Q;$[X]=Y[Q]}),KR6=o1&&o1.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),ad=o1&&o1.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))d60(Y,$,Q)}return KR6(Y,$),Y},od=o1&&o1.__exportStar||function($,Y){for(var Q in $)if(Q!=="default"&&!Object.prototype.hasOwnProperty.call(Y,Q))d60(Y,$,Q)},Vq=o1&&o1.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(o1,"__esModule",{value:!0});o1.webApi=o1.types=o1.FileInstallationStore=o1.MemoryInstallationStore=o1.WorkflowStep=o1.Assistant=o1.buildReceiverRoutes=o1.MemoryStore=o1.defaultProcessEventErrorHandler=o1.HTTPResponseAck=o1.HTTPModuleFunctions=o1.AwsLambdaReceiver=o1.HTTPReceiver=o1.SocketModeReceiver=o1.ExpressReceiver=o1.isValidSlackRequest=o1.verifySlackRequest=o1.App=o1.LogLevel=void 0;var a60=Vq(cn());o1.App=a60.default;var WR6=cn();Object.defineProperty(o1,"LogLevel",{enumerable:!0,get:function(){return WR6.LogLevel}});o1.default=a60.default;var o60=Vn();Object.defineProperty(o1,"verifySlackRequest",{enumerable:!0,get:function(){return o60.verifySlackRequest}});Object.defineProperty(o1,"isValidSlackRequest",{enumerable:!0,get:function(){return o60.isValidSlackRequest}});var HR6=Vq(Dt1());o1.AwsLambdaReceiver=HR6.default;var wR6=Vq(b60());o1.ExpressReceiver=wR6.default;var VR6=Vq(Gn());o1.HTTPReceiver=VR6.default;var UR6=Vq(fn());o1.SocketModeReceiver=UR6.default;o1.HTTPModuleFunctions=ad(EJ());var GR6=nI();Object.defineProperty(o1,"HTTPResponseAck",{enumerable:!0,get:function(){return GR6.HTTPResponseAck}});var JR6=Tn();Object.defineProperty(o1,"defaultProcessEventErrorHandler",{enumerable:!0,get:function(){return JR6.defaultProcessEventErrorHandler}});od(N$(),o1);od(ij(),o1);od(Sn(),o1);var qR6=Ki();Object.defineProperty(o1,"MemoryStore",{enumerable:!0,get:function(){return qR6.MemoryStore}});var xR6=dI();Object.defineProperty(o1,"buildReceiverRoutes",{enumerable:!0,get:function(){return xR6.buildReceiverRoutes}});var BR6=dd();Object.defineProperty(o1,"Assistant",{enumerable:!0,get:function(){return BR6.Assistant}});var DR6=n60();Object.defineProperty(o1,"WorkflowStep",{enumerable:!0,get:function(){return DR6.WorkflowStep}});var r60=vJ();Object.defineProperty(o1,"MemoryInstallationStore",{enumerable:!0,get:function(){return r60.MemoryInstallationStore}});Object.defineProperty(o1,"FileInstallationStore",{enumerable:!0,get:function(){return r60.FileInstallationStore}});o1.types=ad(QJ());o1.webApi=ad($i())});import{homedir as Gf6}from"os";var Ao={name:"@interactive-inc/claude-funnel",version:"0.58.0",description:"Hub CLI that routes external events (Slack / GitHub / Discord) to Claude Code agents through subscription channels over MCP.",keywords:["bun","claude","claude-code","cli","discord","github","mcp","slack"],homepage:"https://github.com/interactive-inc/open-claude-funnel#readme",bugs:{url:"https://github.com/interactive-inc/open-claude-funnel/issues"},license:"MIT",author:"Interactive Inc.",repository:{type:"git",url:"git+https://github.com/interactive-inc/open-claude-funnel.git"},bin:{fnl:"./dist/bin.js",funnel:"./dist/bin.js"},files:["dist/**/*","funnel.schema.json","README.md","LICENSE"],type:"module",main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.js"},"./claude":{types:"./dist/claude.d.ts",import:"./dist/claude.js",default:"./dist/claude.js"},"./gateway":{types:"./dist/gateway.d.ts",import:"./dist/gateway.js",default:"./dist/gateway.js"},"./profiles":{types:"./dist/profiles.d.ts",import:"./dist/profiles.js",default:"./dist/profiles.js"},"./local-config":{types:"./dist/local-config.d.ts",import:"./dist/local-config.js",default:"./dist/local-config.js"},"./diagnostics":{types:"./dist/diagnostics.d.ts",import:"./dist/diagnostics.js",default:"./dist/diagnostics.js"},"./recovery":{types:"./dist/recovery.d.ts",import:"./dist/recovery.js",default:"./dist/recovery.js"},"./doctor":{types:"./dist/doctor.d.ts",import:"./dist/doctor.js",default:"./dist/doctor.js"},"./docs":{types:"./dist/docs.d.ts",import:"./dist/docs.js",default:"./dist/docs.js"},"./connectors/slack":{types:"./dist/connectors/slack.d.ts",import:"./dist/connectors/slack.js",default:"./dist/connectors/slack.js"},"./connectors/discord":{types:"./dist/connectors/discord.d.ts",import:"./dist/connectors/discord.js",default:"./dist/connectors/discord.js"},"./connectors/gh":{types:"./dist/connectors/gh.d.ts",import:"./dist/connectors/gh.js",default:"./dist/connectors/gh.js"},"./connectors/schedule":{types:"./dist/connectors/schedule.d.ts",import:"./dist/connectors/schedule.js",default:"./dist/connectors/schedule.js"},"./logger":{types:"./dist/logger.d.ts",import:"./dist/logger.js",default:"./dist/logger.js"},"./bin":"./dist/bin.js","./package.json":"./package.json"},publishConfig:{access:"public"},scripts:{prepack:"make build"},dependencies:{"@hono/zod-validator":"^0.8.0","@modelcontextprotocol/sdk":"^1.29.0","@slack/bolt":"^4.7.2","@slack/web-api":"^7.16.0","discord.js":"^14.26.4",hono:"^4.12.19",yaml:"^2.9.0",zod:"^4.4.3"},devDependencies:{"@types/bun":"^1.3.14","@typescript/native-preview":"^7.0.0-dev.20260516.1","vite-plus":"^0.1.21",vitest:"^4.1.8"},engines:{bun:">=1.3.0"}};var Q0=class extends Error{res;status;constructor($=500,Y){super(Y?.message,{cause:Y?.cause});this.res=Y?.res,this.status=$}getResponse(){if(this.res)return new Response(this.res.body,{status:this.status,headers:this.res.headers});return new Response(this.message,{status:this.status})}};var N={};t7(N,{xor:()=>Hs,xid:()=>Tr,void:()=>Qs,uuidv7:()=>Ir,uuidv6:()=>jr,uuidv4:()=>Pr,uuid:()=>Nr,util:()=>x1,url:()=>Mr,uppercase:()=>d4,unknown:()=>SZ,union:()=>zB,undefined:()=>$s,ulid:()=>Rr,uint64:()=>tr,uint32:()=>or,tuple:()=>iA,trim:()=>e4,treeifyError:()=>E3,transform:()=>KB,toUpperCase:()=>Y2,toLowerCase:()=>$2,toJSONSchema:()=>Tx,templateLiteral:()=>js,symbol:()=>er,superRefine:()=>LR,success:()=>Ls,stringbool:()=>Rs,stringFormat:()=>mr,string:()=>kH,strictObject:()=>Ks,startsWith:()=>o4,slugify:()=>Q2,size:()=>TZ,setErrorMap:()=>$Q0,set:()=>Js,safeParseAsync:()=>LA,safeParse:()=>DA,safeEncodeAsync:()=>OA,safeEncode:()=>IA,safeDecodeAsync:()=>vA,safeDecode:()=>MA,registry:()=>Qx,regexes:()=>t9,regex:()=>l4,refine:()=>DR,record:()=>lA,readonly:()=>UR,property:()=>bx,promise:()=>Is,prettifyError:()=>C3,preprocess:()=>fs,prefault:()=>XR,positive:()=>Ix,pipe:()=>cx,partialRecord:()=>Vs,parseAsync:()=>BA,parse:()=>xA,overwrite:()=>e7,optional:()=>EH,object:()=>Zs,number:()=>_A,nullish:()=>Ds,nullable:()=>CH,null:()=>kA,normalize:()=>t4,nonpositive:()=>Ox,nonoptional:()=>zR,nonnegative:()=>vx,never:()=>XB,negative:()=>Mx,nativeEnum:()=>qs,nanoid:()=>br,nan:()=>Fs,multipleOf:()=>lX,minSize:()=>cY,minLength:()=>fQ,mime:()=>s4,meta:()=>_s,maxSize:()=>nX,maxLength:()=>fZ,map:()=>Gs,mac:()=>Sr,lte:()=>e9,lt:()=>CY,lowercase:()=>n4,looseRecord:()=>Us,looseObject:()=>Ws,locales:()=>AH,literal:()=>xs,length:()=>kZ,lazy:()=>qR,ksuid:()=>fr,keyof:()=>zs,jwt:()=>hr,json:()=>Ts,iso:()=>Z2,ipv6:()=>Er,ipv4:()=>kr,invertCodec:()=>Ps,intersection:()=>mA,int64:()=>sr,int32:()=>ar,int:()=>ux,instanceof:()=>As,includes:()=>a4,httpUrl:()=>Or,hostname:()=>pr,hex:()=>ir,hash:()=>lr,guid:()=>Fr,gte:()=>o$,gt:()=>uY,globalRegistry:()=>W$,getErrorMap:()=>YQ0,function:()=>Ms,fromJSONSchema:()=>Ss,formatError:()=>LH,float64:()=>dr,float32:()=>nr,flattenError:()=>DH,file:()=>Bs,exactOptional:()=>tA,enum:()=>ZB,endsWith:()=>r4,encodeAsync:()=>PA,encode:()=>FA,emoji:()=>vr,email:()=>Lr,e164:()=>gr,discriminatedUnion:()=>ws,describe:()=>bs,decodeAsync:()=>jA,decode:()=>NA,date:()=>Xs,custom:()=>vs,cuid2:()=>Ar,cuid:()=>_r,core:()=>kQ,config:()=>H8,coerce:()=>NR,codec:()=>Ns,clone:()=>d$,cidrv6:()=>ur,cidrv4:()=>Cr,check:()=>Os,catch:()=>WR,boolean:()=>AA,bigint:()=>rr,base64url:()=>yr,base64:()=>cr,array:()=>gH,any:()=>Ys,_function:()=>Ms,_default:()=>YR,_ZodString:()=>yx,ZodXor:()=>yA,ZodXID:()=>nx,ZodVoid:()=>uA,ZodUnknown:()=>EA,ZodUnion:()=>mH,ZodUndefined:()=>TA,ZodUUID:()=>yY,ZodURL:()=>cH,ZodULID:()=>lx,ZodType:()=>x0,ZodTuple:()=>pA,ZodTransform:()=>rA,ZodTemplateLiteral:()=>GR,ZodSymbol:()=>RA,ZodSuccess:()=>ZR,ZodStringFormat:()=>H6,ZodString:()=>H2,ZodSet:()=>dA,ZodRecord:()=>K2,ZodRealError:()=>M9,ZodReadonly:()=>VR,ZodPromise:()=>xR,ZodPreprocess:()=>wR,ZodPrefault:()=>QR,ZodPipe:()=>pH,ZodOptional:()=>WB,ZodObject:()=>hH,ZodNumberFormat:()=>EZ,ZodNumber:()=>V2,ZodNullable:()=>eA,ZodNull:()=>fA,ZodNonOptional:()=>HB,ZodNever:()=>CA,ZodNanoID:()=>mx,ZodNaN:()=>HR,ZodMap:()=>nA,ZodMAC:()=>bA,ZodLiteral:()=>aA,ZodLazy:()=>JR,ZodKSUID:()=>dx,ZodJWT:()=>YB,ZodIssueCode:()=>eY0,ZodIntersection:()=>hA,ZodISOTime:()=>Ex,ZodISODuration:()=>Cx,ZodISODateTime:()=>kx,ZodISODate:()=>Sx,ZodIPv6:()=>ox,ZodIPv4:()=>ax,ZodGUID:()=>SH,ZodFunction:()=>BR,ZodFirstPartyTypeKind:()=>FR,ZodFile:()=>oA,ZodExactOptional:()=>sA,ZodError:()=>sY0,ZodEnum:()=>W2,ZodEmoji:()=>hx,ZodEmail:()=>gx,ZodE164:()=>$B,ZodDiscriminatedUnion:()=>gA,ZodDefault:()=>$R,ZodDate:()=>yH,ZodCustomStringFormat:()=>w2,ZodCustom:()=>lH,ZodCodec:()=>iH,ZodCatch:()=>KR,ZodCUID2:()=>ix,ZodCUID:()=>px,ZodCIDRv6:()=>sx,ZodCIDRv4:()=>rx,ZodBoolean:()=>U2,ZodBigIntFormat:()=>QB,ZodBigInt:()=>G2,ZodBase64URL:()=>ex,ZodBase64:()=>tx,ZodArray:()=>cA,ZodAny:()=>SA,TimePrecision:()=>ib,NEVER:()=>I3,$output:()=>cb,$input:()=>yb,$brand:()=>M3});var kQ={};t7(kQ,{version:()=>fO,util:()=>x1,treeifyError:()=>E3,toJSONSchema:()=>Tx,toDotPath:()=>Co,safeParseAsync:()=>c3,safeParse:()=>u3,safeEncodeAsync:()=>e90,safeEncode:()=>s90,safeDecodeAsync:()=>$70,safeDecode:()=>t90,registry:()=>Qx,regexes:()=>t9,process:()=>z6,prettifyError:()=>C3,parseAsync:()=>Sq,parse:()=>kq,meta:()=>M_,locales:()=>AH,isValidJWT:()=>Zr,isValidBase64URL:()=>zr,isValidBase64:()=>$v,initializeContext:()=>dX,globalRegistry:()=>W$,globalConfig:()=>vZ,formatError:()=>LH,flattenError:()=>DH,finalize:()=>oX,extractDefs:()=>aX,encodeAsync:()=>o90,encode:()=>d90,describe:()=>I_,decodeAsync:()=>r90,decode:()=>a90,createToJSONSchemaMethod:()=>v_,createStandardJSONSchemaMethod:()=>z2,config:()=>H8,clone:()=>d$,_xor:()=>bY0,_xid:()=>Jx,_void:()=>q_,_uuidv7:()=>Wx,_uuidv6:()=>Kx,_uuidv4:()=>Zx,_uuid:()=>zx,_url:()=>TH,_uppercase:()=>d4,_unknown:()=>G_,_union:()=>vY0,_undefined:()=>w_,_ulid:()=>Gx,_uint64:()=>W_,_uint32:()=>Y_,_tuple:()=>RY0,_trim:()=>e4,_transform:()=>uY0,_toUpperCase:()=>Y2,_toLowerCase:()=>$2,_templateLiteral:()=>nY0,_symbol:()=>H_,_superRefine:()=>j_,_success:()=>mY0,_stringbool:()=>O_,_stringFormat:()=>X2,_string:()=>hb,_startsWith:()=>o4,_slugify:()=>Q2,_size:()=>TZ,_set:()=>kY0,_safeParseAsync:()=>m4,_safeParse:()=>h4,_safeEncodeAsync:()=>hq,_safeEncode:()=>yq,_safeDecodeAsync:()=>mq,_safeDecode:()=>gq,_regex:()=>l4,_refine:()=>P_,_record:()=>TY0,_readonly:()=>lY0,_property:()=>bx,_promise:()=>aY0,_positive:()=>Ix,_pipe:()=>iY0,_parseAsync:()=>g4,_parse:()=>y4,_overwrite:()=>e7,_optional:()=>cY0,_number:()=>ob,_nullable:()=>yY0,_null:()=>V_,_normalize:()=>t4,_nonpositive:()=>Ox,_nonoptional:()=>hY0,_nonnegative:()=>vx,_never:()=>J_,_negative:()=>Mx,_nativeEnum:()=>EY0,_nanoid:()=>wx,_nan:()=>D_,_multipleOf:()=>lX,_minSize:()=>cY,_minLength:()=>fQ,_min:()=>o$,_mime:()=>s4,_maxSize:()=>nX,_maxLength:()=>fZ,_max:()=>e9,_map:()=>fY0,_mac:()=>pb,_lte:()=>e9,_lt:()=>CY,_lowercase:()=>n4,_literal:()=>CY0,_length:()=>kZ,_lazy:()=>dY0,_ksuid:()=>qx,_jwt:()=>jx,_isoTime:()=>db,_isoDuration:()=>ab,_isoDateTime:()=>lb,_isoDate:()=>nb,_ipv6:()=>Bx,_ipv4:()=>xx,_intersection:()=>AY0,_int64:()=>K_,_int32:()=>$_,_int:()=>sb,_includes:()=>a4,_guid:()=>RH,_gte:()=>o$,_gt:()=>uY,_float64:()=>eb,_float32:()=>tb,_file:()=>F_,_enum:()=>SY0,_endsWith:()=>r4,_encodeAsync:()=>uq,_encode:()=>Eq,_emoji:()=>Hx,_email:()=>Xx,_e164:()=>Px,_discriminatedUnion:()=>_Y0,_default:()=>gY0,_decodeAsync:()=>cq,_decode:()=>Cq,_date:()=>x_,_custom:()=>N_,_cuid2:()=>Ux,_cuid:()=>Vx,_coercedString:()=>mb,_coercedNumber:()=>rb,_coercedDate:()=>B_,_coercedBoolean:()=>X_,_coercedBigint:()=>Z_,_cidrv6:()=>Lx,_cidrv4:()=>Dx,_check:()=>qr,_catch:()=>pY0,_boolean:()=>Q_,_bigint:()=>z_,_base64url:()=>Nx,_base64:()=>Fx,_array:()=>L_,_any:()=>U_,TimePrecision:()=>ib,NEVER:()=>I3,JSONSchemaGenerator:()=>VA,JSONSchema:()=>xr,Doc:()=>nq,$output:()=>cb,$input:()=>yb,$constructor:()=>y,$brand:()=>M3,$ZodXor:()=>Lv,$ZodXID:()=>pO,$ZodVoid:()=>qv,$ZodUnknown:()=>Gv,$ZodUnion:()=>IH,$ZodUndefined:()=>wv,$ZodUUID:()=>EO,$ZodURL:()=>uO,$ZodULID:()=>mO,$ZodType:()=>Z0,$ZodTuple:()=>eq,$ZodTransform:()=>bv,$ZodTemplateLiteral:()=>cv,$ZodSymbol:()=>Hv,$ZodSuccess:()=>kv,$ZodStringFormat:()=>W6,$ZodString:()=>RZ,$ZodSet:()=>Iv,$ZodRegistry:()=>gb,$ZodRecord:()=>Pv,$ZodRealError:()=>I9,$ZodReadonly:()=>uv,$ZodPromise:()=>gv,$ZodPreprocess:()=>Cv,$ZodPrefault:()=>Tv,$ZodPipe:()=>Yx,$ZodOptional:()=>$x,$ZodObjectJIT:()=>Dv,$ZodObject:()=>Hr,$ZodNumberFormat:()=>Kv,$ZodNumber:()=>sq,$ZodNullable:()=>Av,$ZodNull:()=>Vv,$ZodNonOptional:()=>fv,$ZodNever:()=>Jv,$ZodNanoID:()=>yO,$ZodNaN:()=>Ev,$ZodMap:()=>jv,$ZodMAC:()=>sO,$ZodLiteral:()=>Ov,$ZodLazy:()=>hv,$ZodKSUID:()=>iO,$ZodJWT:()=>zv,$ZodIntersection:()=>Nv,$ZodISOTime:()=>dO,$ZodISODuration:()=>aO,$ZodISODateTime:()=>lO,$ZodISODate:()=>nO,$ZodIPv6:()=>rO,$ZodIPv4:()=>oO,$ZodGUID:()=>SO,$ZodFunction:()=>yv,$ZodFile:()=>vv,$ZodExactOptional:()=>_v,$ZodError:()=>BH,$ZodEnum:()=>Mv,$ZodEncodeError:()=>bZ,$ZodEmoji:()=>cO,$ZodEmail:()=>CO,$ZodE164:()=>Xv,$ZodDiscriminatedUnion:()=>Fv,$ZodDefault:()=>Rv,$ZodDate:()=>xv,$ZodCustomStringFormat:()=>Zv,$ZodCustom:()=>mv,$ZodCodec:()=>MH,$ZodCheckUpperCase:()=>OO,$ZodCheckStringFormat:()=>p4,$ZodCheckStartsWith:()=>bO,$ZodCheckSizeEquals:()=>FO,$ZodCheckRegex:()=>IO,$ZodCheckProperty:()=>AO,$ZodCheckOverwrite:()=>TO,$ZodCheckNumberFormat:()=>xO,$ZodCheckMultipleOf:()=>qO,$ZodCheckMinSize:()=>LO,$ZodCheckMinLength:()=>PO,$ZodCheckMimeType:()=>RO,$ZodCheckMaxSize:()=>DO,$ZodCheckMaxLength:()=>NO,$ZodCheckLowerCase:()=>MO,$ZodCheckLessThan:()=>iq,$ZodCheckLengthEquals:()=>jO,$ZodCheckIncludes:()=>vO,$ZodCheckGreaterThan:()=>lq,$ZodCheckEndsWith:()=>_O,$ZodCheckBigIntFormat:()=>BO,$ZodCheck:()=>q6,$ZodCatch:()=>Sv,$ZodCUID2:()=>hO,$ZodCUID:()=>gO,$ZodCIDRv6:()=>eO,$ZodCIDRv4:()=>tO,$ZodBoolean:()=>jH,$ZodBigIntFormat:()=>Wv,$ZodBigInt:()=>tq,$ZodBase64URL:()=>Qv,$ZodBase64:()=>Yv,$ZodAsyncError:()=>EY,$ZodArray:()=>Bv,$ZodAny:()=>Uv});var Ro,I3=Object.freeze({status:"aborted"});function y($,Y,Q){function X(W,H){if(!W._zod)Object.defineProperty(W,"_zod",{value:{def:H,constr:K,traits:new Set},enumerable:!1});if(W._zod.traits.has($))return;W._zod.traits.add($),Y(W,H);let w=K.prototype,V=Object.keys(w);for(let U=0;U<V.length;U++){let G=V[U];if(!(G in W))W[G]=w[G].bind(W)}}let z=Q?.Parent??Object;class Z extends z{}Object.defineProperty(Z,"name",{value:$});function K(W){var H;let w=Q?.Parent?new Z:this;X(w,W),(H=w._zod).deferred??(H.deferred=[]);for(let V of w._zod.deferred)V();return w}return Object.defineProperty(K,"init",{value:X}),Object.defineProperty(K,Symbol.hasInstance,{value:(W)=>{if(Q?.Parent&&W instanceof Q.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(K,"name",{value:$}),K}var M3=Symbol("zod_brand");class EY extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class bZ extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(Ro=globalThis).__zod_globalConfig??(Ro.__zod_globalConfig={});var vZ=globalThis.__zod_globalConfig;function H8($){if($)Object.assign(vZ,$);return vZ}var x1={};t7(x1,{unwrapMessage:()=>VH,uint8ArrayToHex:()=>l90,uint8ArrayToBase64url:()=>p90,uint8ArrayToBase64:()=>ko,stringifyPrimitive:()=>G1,slugify:()=>b3,shallowClone:()=>A3,safeExtend:()=>u90,required:()=>g90,randomString:()=>R90,propertyKeyTypes:()=>JH,promiseAllObject:()=>A90,primitiveTypes:()=>R3,prefixIssues:()=>j9,pick:()=>S90,partial:()=>y90,parsedType:()=>q1,optionalKeys:()=>T3,omit:()=>E90,objectClone:()=>v90,numKeys:()=>T90,nullish:()=>hX,normalizeParams:()=>D1,mergeDefs:()=>TQ,merge:()=>c90,jsonStringifyReplacer:()=>C4,joinValues:()=>i,issue:()=>c4,isPlainObject:()=>pX,isObject:()=>_Z,hexToUint8Array:()=>i90,getSizableOrigin:()=>qH,getParsedType:()=>f90,getLengthableOrigin:()=>xH,getEnumValues:()=>UH,getElementAtPath:()=>_90,floatSafeRemainder:()=>v3,finalizeIssue:()=>a$,extend:()=>C90,explicitlyAborted:()=>S3,escapeRegex:()=>x7,esc:()=>Tq,defineLazy:()=>I0,createTransparentProxy:()=>k90,cloneDef:()=>b90,clone:()=>d$,cleanRegex:()=>GH,cleanEnum:()=>h90,captureStackTrace:()=>fq,cached:()=>u4,base64urlToUint8Array:()=>m90,base64ToUint8Array:()=>fo,assignProp:()=>mX,assertNotEqual:()=>j90,assertNever:()=>M90,assertIs:()=>I90,assertEqual:()=>P90,assert:()=>O90,allowsEval:()=>_3,aborted:()=>iX,NUMBER_FORMAT_RANGES:()=>f3,Class:()=>So,BIGINT_FORMAT_RANGES:()=>k3});function P90($){return $}function j90($){return $}function I90($){}function M90($){throw Error("Unexpected value in exhaustive check")}function O90($){}function UH($){let Y=Object.values($).filter((X)=>typeof X==="number");return Object.entries($).filter(([X,z])=>Y.indexOf(+X)===-1).map(([X,z])=>z)}function i($,Y="|"){return $.map((Q)=>G1(Q)).join(Y)}function C4($,Y){if(typeof Y==="bigint")return Y.toString();return Y}function u4($){return{get value(){{let Q=$();return Object.defineProperty(this,"value",{value:Q}),Q}throw Error("cached value already set")}}}function hX($){return $===null||$===void 0}function GH($){let Y=$.startsWith("^")?1:0,Q=$.endsWith("$")?$.length-1:$.length;return $.slice(Y,Q)}function v3($,Y){let Q=$/Y,X=Math.round(Q),z=Number.EPSILON*Math.max(Math.abs(Q),1);if(Math.abs(Q-X)<z)return 0;return Q-X}var To=Symbol("evaluating");function I0($,Y,Q){let X=void 0;Object.defineProperty($,Y,{get(){if(X===To)return;if(X===void 0)X=To,X=Q();return X},set(z){Object.defineProperty($,Y,{value:z})},configurable:!0})}function v90($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function mX($,Y,Q){Object.defineProperty($,Y,{value:Q,writable:!0,enumerable:!0,configurable:!0})}function TQ(...$){let Y={};for(let Q of $){let X=Object.getOwnPropertyDescriptors(Q);Object.assign(Y,X)}return Object.defineProperties({},Y)}function b90($){return TQ($._zod.def)}function _90($,Y){if(!Y)return $;return Y.reduce((Q,X)=>Q?.[X],$)}function A90($){let Y=Object.keys($),Q=Y.map((X)=>$[X]);return Promise.all(Q).then((X)=>{let z={};for(let Z=0;Z<Y.length;Z++)z[Y[Z]]=X[Z];return z})}function R90($=10){let Q="";for(let X=0;X<$;X++)Q+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return Q}function Tq($){return JSON.stringify($)}function b3($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var fq="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function _Z($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var _3=u4(()=>{if(vZ.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function pX($){if(_Z($)===!1)return!1;let Y=$.constructor;if(Y===void 0)return!0;if(typeof Y!=="function")return!0;let Q=Y.prototype;if(_Z(Q)===!1)return!1;if(Object.prototype.hasOwnProperty.call(Q,"isPrototypeOf")===!1)return!1;return!0}function A3($){if(pX($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function T90($){let Y=0;for(let Q in $)if(Object.prototype.hasOwnProperty.call($,Q))Y++;return Y}var f90=($)=>{let Y=typeof $;switch(Y){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${Y}`)}},JH=new Set(["string","number","symbol"]),R3=new Set(["string","number","bigint","boolean","symbol","undefined"]);function x7($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d$($,Y,Q){let X=new $._zod.constr(Y??$._zod.def);if(!Y||Q?.parent)X._zod.parent=$;return X}function D1($){let Y=$;if(!Y)return{};if(typeof Y==="string")return{error:()=>Y};if(Y?.message!==void 0){if(Y?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");Y.error=Y.message}if(delete Y.message,typeof Y.error==="string")return{...Y,error:()=>Y.error};return Y}function k90($){let Y;return new Proxy({},{get(Q,X,z){return Y??(Y=$()),Reflect.get(Y,X,z)},set(Q,X,z,Z){return Y??(Y=$()),Reflect.set(Y,X,z,Z)},has(Q,X){return Y??(Y=$()),Reflect.has(Y,X)},deleteProperty(Q,X){return Y??(Y=$()),Reflect.deleteProperty(Y,X)},ownKeys(Q){return Y??(Y=$()),Reflect.ownKeys(Y)},getOwnPropertyDescriptor(Q,X){return Y??(Y=$()),Reflect.getOwnPropertyDescriptor(Y,X)},defineProperty(Q,X,z){return Y??(Y=$()),Reflect.defineProperty(Y,X,z)}})}function G1($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function T3($){return Object.keys($).filter((Y)=>{return $[Y]._zod.optin==="optional"&&$[Y]._zod.optout==="optional"})}var f3={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},k3={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function S90($,Y){let Q=$._zod.def,X=Q.checks;if(X&&X.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let Z=TQ($._zod.def,{get shape(){let K={};for(let W in Y){if(!(W in Q.shape))throw Error(`Unrecognized key: "${W}"`);if(!Y[W])continue;K[W]=Q.shape[W]}return mX(this,"shape",K),K},checks:[]});return d$($,Z)}function E90($,Y){let Q=$._zod.def,X=Q.checks;if(X&&X.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let Z=TQ($._zod.def,{get shape(){let K={...$._zod.def.shape};for(let W in Y){if(!(W in Q.shape))throw Error(`Unrecognized key: "${W}"`);if(!Y[W])continue;delete K[W]}return mX(this,"shape",K),K},checks:[]});return d$($,Z)}function C90($,Y){if(!pX(Y))throw Error("Invalid input to extend: expected a plain object");let Q=$._zod.def.checks;if(Q&&Q.length>0){let Z=$._zod.def.shape;for(let K in Y)if(Object.getOwnPropertyDescriptor(Z,K)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let z=TQ($._zod.def,{get shape(){let Z={...$._zod.def.shape,...Y};return mX(this,"shape",Z),Z}});return d$($,z)}function u90($,Y){if(!pX(Y))throw Error("Invalid input to safeExtend: expected a plain object");let Q=TQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y};return mX(this,"shape",X),X}});return d$($,Q)}function c90($,Y){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let Q=TQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y._zod.def.shape};return mX(this,"shape",X),X},get catchall(){return Y._zod.def.catchall},checks:Y._zod.def.checks??[]});return d$($,Q)}function y90($,Y,Q){let z=Y._zod.def.checks;if(z&&z.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let K=TQ(Y._zod.def,{get shape(){let W=Y._zod.def.shape,H={...W};if(Q)for(let w in Q){if(!(w in W))throw Error(`Unrecognized key: "${w}"`);if(!Q[w])continue;H[w]=$?new $({type:"optional",innerType:W[w]}):W[w]}else for(let w in W)H[w]=$?new $({type:"optional",innerType:W[w]}):W[w];return mX(this,"shape",H),H},checks:[]});return d$(Y,K)}function g90($,Y,Q){let X=TQ(Y._zod.def,{get shape(){let z=Y._zod.def.shape,Z={...z};if(Q)for(let K in Q){if(!(K in Z))throw Error(`Unrecognized key: "${K}"`);if(!Q[K])continue;Z[K]=new $({type:"nonoptional",innerType:z[K]})}else for(let K in z)Z[K]=new $({type:"nonoptional",innerType:z[K]});return mX(this,"shape",Z),Z}});return d$(Y,X)}function iX($,Y=0){if($.aborted===!0)return!0;for(let Q=Y;Q<$.issues.length;Q++)if($.issues[Q]?.continue!==!0)return!0;return!1}function S3($,Y=0){if($.aborted===!0)return!0;for(let Q=Y;Q<$.issues.length;Q++)if($.issues[Q]?.continue===!1)return!0;return!1}function j9($,Y){return Y.map((Q)=>{var X;return(X=Q).path??(X.path=[]),Q.path.unshift($),Q})}function VH($){return typeof $==="string"?$:$?.message}function a$($,Y,Q){let X=$.message?$.message:VH($.inst?._zod.def?.error?.($))??VH(Y?.error?.($))??VH(Q.customError?.($))??VH(Q.localeError?.($))??"Invalid input",{inst:z,continue:Z,input:K,...W}=$;if(W.path??(W.path=[]),W.message=X,Y?.reportInput)W.input=K;return W}function qH($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function xH($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function q1($){let Y=typeof $;switch(Y){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let Q=$;if(Q&&Object.getPrototypeOf(Q)!==Object.prototype&&"constructor"in Q&&Q.constructor)return Q.constructor.name}}return Y}function c4(...$){let[Y,Q,X]=$;if(typeof Y==="string")return{message:Y,code:"custom",input:Q,inst:X};return{...Y}}function h90($){return Object.entries($).filter(([Y,Q])=>{return Number.isNaN(Number.parseInt(Y,10))}).map((Y)=>Y[1])}function fo($){let Y=atob($),Q=new Uint8Array(Y.length);for(let X=0;X<Y.length;X++)Q[X]=Y.charCodeAt(X);return Q}function ko($){let Y="";for(let Q=0;Q<$.length;Q++)Y+=String.fromCharCode($[Q]);return btoa(Y)}function m90($){let Y=$.replace(/-/g,"+").replace(/_/g,"/"),Q="=".repeat((4-Y.length%4)%4);return fo(Y+Q)}function p90($){return ko($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function i90($){let Y=$.replace(/^0x/,"");if(Y.length%2!==0)throw Error("Invalid hex string length");let Q=new Uint8Array(Y.length/2);for(let X=0;X<Y.length;X+=2)Q[X/2]=Number.parseInt(Y.slice(X,X+2),16);return Q}function l90($){return Array.from($).map((Y)=>Y.toString(16).padStart(2,"0")).join("")}class So{constructor(...$){}}var Eo=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,C4,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},BH=y("$ZodError",Eo),I9=y("$ZodError",Eo,{Parent:Error});function DH($,Y=(Q)=>Q.message){let Q={},X=[];for(let z of $.issues)if(z.path.length>0)Q[z.path[0]]=Q[z.path[0]]||[],Q[z.path[0]].push(Y(z));else X.push(Y(z));return{formErrors:X,fieldErrors:Q}}function LH($,Y=(Q)=>Q.message){let Q={_errors:[]},X=(z,Z=[])=>{for(let K of z.issues)if(K.code==="invalid_union"&&K.errors.length)K.errors.map((W)=>X({issues:W},[...Z,...K.path]));else if(K.code==="invalid_key")X({issues:K.issues},[...Z,...K.path]);else if(K.code==="invalid_element")X({issues:K.issues},[...Z,...K.path]);else{let W=[...Z,...K.path];if(W.length===0)Q._errors.push(Y(K));else{let H=Q,w=0;while(w<W.length){let V=W[w];if(w!==W.length-1)H[V]=H[V]||{_errors:[]};else H[V]=H[V]||{_errors:[]},H[V]._errors.push(Y(K));H=H[V],w++}}}};return X($),Q}function E3($,Y=(Q)=>Q.message){let Q={errors:[]},X=(z,Z=[])=>{var K,W;for(let H of z.issues)if(H.code==="invalid_union"&&H.errors.length)H.errors.map((w)=>X({issues:w},[...Z,...H.path]));else if(H.code==="invalid_key")X({issues:H.issues},[...Z,...H.path]);else if(H.code==="invalid_element")X({issues:H.issues},[...Z,...H.path]);else{let w=[...Z,...H.path];if(w.length===0){Q.errors.push(Y(H));continue}let V=Q,U=0;while(U<w.length){let G=w[U],J=U===w.length-1;if(typeof G==="string")V.properties??(V.properties={}),(K=V.properties)[G]??(K[G]={errors:[]}),V=V.properties[G];else V.items??(V.items=[]),(W=V.items)[G]??(W[G]={errors:[]}),V=V.items[G];if(J)V.errors.push(Y(H));U++}}};return X($),Q}function Co($){let Y=[],Q=$.map((X)=>typeof X==="object"?X.key:X);for(let X of Q)if(typeof X==="number")Y.push(`[${X}]`);else if(typeof X==="symbol")Y.push(`[${JSON.stringify(String(X))}]`);else if(/[^\w$]/.test(X))Y.push(`[${JSON.stringify(X)}]`);else{if(Y.length)Y.push(".");Y.push(X)}return Y.join("")}function C3($){let Y=[],Q=[...$.issues].sort((X,z)=>(X.path??[]).length-(z.path??[]).length);for(let X of Q)if(Y.push(`\u2716 ${X.message}`),X.path?.length)Y.push(` \u2192 at ${Co(X.path)}`);return Y.join(`
|
|
609
|
+
*/var AM=oe1(),vA6=b("events").EventEmitter,U60=se1(),G60=$00(),J60=vd(),q60=A00(),x60=H60();i7=B60.exports=bA6;function bA6(){var $=function(Y,Q,X){$.handle(Y,Q,X)};return U60($,vA6.prototype,!1),U60($,G60,!1),$.request=Object.create(q60,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.response=Object.create(x60,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.init(),$}i7.application=G60;i7.request=q60;i7.response=x60;i7.Route=J60.Route;i7.Router=J60;i7.json=AM.json;i7.raw=AM.raw;i7.static=V60();i7.text=AM.text;i7.urlencoded=AM.urlencoded});var b60=q((z8)=>{var _A6=z8&&z8.__createBinding||(Object.create?function($,Y,Q,X){if(X===void 0)X=Q;var z=Object.getOwnPropertyDescriptor(Y,Q);if(!z||("get"in z?!Y.__esModule:z.writable||z.configurable))z={enumerable:!0,get:function(){return Y[Q]}};Object.defineProperty($,X,z)}:function($,Y,Q,X){if(X===void 0)X=Q;$[X]=Y[Q]}),AA6=z8&&z8.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),N60=z8&&z8.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))_A6(Y,$,Q)}return AA6(Y,$),Y},RM=z8&&z8.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(z8,"__esModule",{value:!0});z8.buildBodyParserMiddleware=z8.verifySignatureAndParseBody=z8.verifySignatureAndParseRawBody=z8.respondToUrlVerification=z8.respondToSslCheck=void 0;var RA6=RM(b("crypto")),TA6=b("http"),fA6=b("https"),kA6=RM(b("querystring")),L60=p8(),SA6=vJ(),F60=N60(D60()),EA6=RM(pI()),CA6=RM(iI()),NQ=N$(),YH=N60(EJ()),uA6=nI(),cA6=aI(),yA6=["ALPNProtocols","clientCertEngine","enableTrace","handshakeTimeout","rejectUnauthorized","requestCert","sessionTimeout","SNICallback","ticketKeys","pskCallback","pskIdentityHint","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","passphrase","pfx","secureOptions","secureProtocol","sessionIdContext"],ld="The receiver cannot be started because private state was mutated. Please report this to the maintainers.",gA6=($,Y,Q)=>{if($.body?.ssl_check){Y.send();return}Q()};z8.respondToSslCheck=gA6;var hA6=($,Y,Q)=>{if($.body?.type&&$.body.type==="url_verification"){Y.json({challenge:$.body.challenge});return}Q()};z8.respondToUrlVerification=hA6;class P60{app;server;bolt;logger;processBeforeResponse;signatureVerification;router;installer=void 0;installerOptions;customPropertiesExtractor;dispatchErrorHandler;processEventErrorHandler;unhandledRequestHandler;unhandledRequestTimeoutMillis;constructor({signingSecret:$="",logger:Y=void 0,logLevel:Q=L60.LogLevel.INFO,endpoints:X={events:"/slack/events"},processBeforeResponse:z=!1,signatureVerification:Z=!0,clientId:K=void 0,clientSecret:W=void 0,stateSecret:H=void 0,redirectUri:w=void 0,installationStore:V=void 0,scopes:U=void 0,installerOptions:G={},app:J=void 0,router:x=void 0,customPropertiesExtractor:D=(I)=>({}),dispatchErrorHandler:B=YH.defaultAsyncDispatchErrorHandler,processEventErrorHandler:L=YH.defaultProcessEventErrorHandler,unhandledRequestHandler:j=YH.defaultUnhandledRequestHandler,unhandledRequestTimeoutMillis:F=3001}){if(this.app=J!==void 0?J:(0,F60.default)(),typeof Y<"u")this.logger=Y;else this.logger=new L60.ConsoleLogger,this.logger.setLevel(Q);this.signatureVerification=Z;let M=[this.signatureVerification?j60(this.logger,$):M60(this.logger),z8.respondToSslCheck,z8.respondToUrlVerification,this.requestHandler.bind(this)];this.processBeforeResponse=z;let c=typeof X==="string"?[X]:Object.values(X);this.router=x!==void 0?x:(0,F60.Router)();for(let p of c)this.router.post(p,...M);if(this.customPropertiesExtractor=D,this.dispatchErrorHandler=B,this.processEventErrorHandler=L,this.unhandledRequestHandler=j,this.unhandledRequestTimeoutMillis=F,(0,cA6.verifyRedirectOpts)({redirectUri:w,redirectUriPath:G.redirectUriPath}),K!==void 0&&W!==void 0&&(G.stateVerification===!1||H!==void 0||G.stateStore!==void 0))this.installer=new SA6.InstallProvider({clientId:K,clientSecret:W,stateSecret:H,installationStore:V,logLevel:Q,logger:Y,directInstall:G.directInstall,stateStore:G.stateStore,stateVerification:G.stateVerification,legacyStateVerification:G.legacyStateVerification,stateCookieName:G.stateCookieName,stateCookieExpirationSeconds:G.stateCookieExpirationSeconds,renderHtmlForInstallPath:G.renderHtmlForInstallPath,authVersion:G.authVersion??"v2",clientOptions:G.clientOptions,authorizationUrl:G.authorizationUrl});let e={metadata:G.metadata,scopes:U??[],userScopes:G.userScopes,redirectUri:w};if(this.installer!==void 0){let{installer:p}=this,g=G.redirectUriPath===void 0?"/slack/oauth_redirect":G.redirectUriPath,{callbackOptions:l,stateVerification:K1}=G;this.router.use(g,async(R1,_1)=>{try{if(K1===!1)await p.handleCallback(R1,_1,l,e);else await p.handleCallback(R1,_1,l)}catch(h1){await this.dispatchErrorHandler({error:h1,logger:this.logger,request:R1,response:_1})}});let w1=G.installPath===void 0?"/slack/install":G.installPath,{installPathOptions:v1}=G;this.router.get(w1,async(R1,_1,h1)=>{try{try{await p.handleInstallPath(R1,_1,v1,e)}catch(C1){h1(C1)}}catch(C1){await this.dispatchErrorHandler({error:C1,logger:this.logger,request:R1,response:_1})}})}this.app.use(this.router)}async requestHandler($,Y){let Q=new uA6.HTTPResponseAck({logger:this.logger,processBeforeResponse:this.processBeforeResponse,unhandledRequestHandler:this.unhandledRequestHandler,unhandledRequestTimeoutMillis:this.unhandledRequestTimeoutMillis,httpRequest:$,httpRequestBody:$.body,httpResponse:Y}),X={body:$.body,ack:Q.bind(),retryNum:YH.extractRetryNumFromHTTPRequest($),retryReason:YH.extractRetryReasonFromHTTPRequest($),customProperties:this.customPropertiesExtractor($)};try{if(await this.bolt?.processEvent(X),Q.storedResponse!==void 0)YH.buildContentResponse(Y,Q.storedResponse),this.logger.debug("stored response sent")}catch(z){if(await this.processEventErrorHandler({error:z,logger:this.logger,request:$,response:Y,storedResponse:Q.storedResponse}))Q.ack()}}init($){this.bolt=$}start($,Y={}){let Q=TA6.createServer;if(Object.keys(Y).filter((X)=>yA6.includes(X)).length>0)Q=fA6.createServer;if(this.server!==void 0)return Promise.reject(new NQ.ReceiverInconsistentStateError("The receiver cannot be started because it was already started."));return this.server=Q(Y,this.app),new Promise((X,z)=>{if(this.server===void 0)throw new NQ.ReceiverInconsistentStateError(ld);this.server.on("error",(Z)=>{if(this.server===void 0)throw new NQ.ReceiverInconsistentStateError(ld);this.server.close(),z(Z)}),this.server.on("close",()=>{this.server=void 0}),this.server.listen($,()=>{if(this.server===void 0)return z(new NQ.ReceiverInconsistentStateError(ld));return X(this.server)})})}stop(){if(this.server===void 0)return Promise.reject(new NQ.ReceiverInconsistentStateError("The receiver cannot be stopped because it was not started."));return new Promise(($,Y)=>{this.server?.close((Q)=>{if(Q!==void 0)return Y(Q);return this.server=void 0,$()})})}}z8.default=P60;function mA6($,Y){return j60($,Y)}z8.verifySignatureAndParseRawBody=mA6;function j60($,Y){return async(Q,X,z)=>{let Z=await v60(Q);try{Q.body=I60(typeof Y==="string"?Y:await Y(),Z,Q.headers)}catch(K){if(K){if(K instanceof NQ.ReceiverAuthenticityError){nd($,"Request verification failed",K),X.status(401).send();return}nd($,"Parsing request body failed",K),X.status(400).send();return}}z()}}function nd($,Y,Q){let X="code"in Q?`${Y} (code: ${Q.code}, message: ${Q.message})`:`${Y} (error: ${Q})`;$.warn(X)}function pA6($,Y,Q,X){if(Q===void 0||X===void 0)throw new NQ.ReceiverAuthenticityError("Slack request signing verification failed. Some headers are missing.");let z=Number(X);if(Number.isNaN(z))throw new NQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is invalid.");let Z=Math.floor(Date.now()/1000)-300;if(z<Z)throw new NQ.ReceiverAuthenticityError("Slack request signing verification failed. Timestamp is too old.");let K=RA6.default.createHmac("sha256",$),[W,H]=Q.split("=");if(K.update(`${W}:${z}:${Y}`),!(0,CA6.default)(H,K.digest("hex")))throw new NQ.ReceiverAuthenticityError("Slack request signing verification failed. Signature mismatch.")}function I60($,Y,Q){let{"x-slack-signature":X,"x-slack-request-timestamp":z,"content-type":Z}=Q;return pA6($,Y,X,z),O60(Y,Z)}z8.verifySignatureAndParseBody=I60;function M60($){return async(Y,Q,X)=>{let z=await v60(Y);try{let{"content-type":Z}=Y.headers;Y.body=O60(z,Z)}catch(Z){if(Z){nd($,"Parsing request body failed",Z),Q.status(400).send();return}}X()}}z8.buildBodyParserMiddleware=M60;function O60($,Y){if(Y==="application/x-www-form-urlencoded"){let Q=kA6.default.parse($);if(typeof Q.payload==="string")return JSON.parse(Q.payload);return Q}return JSON.parse($)}async function v60($){if("rawBody"in $&&$.rawBody)return Promise.resolve($.rawBody.toString());return(await(0,EA6.default)($)).toString()}});var f60=q((R60)=>{Object.defineProperty(R60,"__esModule",{value:!0});R60.DefaultThreadContextStore=void 0;var _60=dd();class A60{context={};async get($){let{context:Y,client:Q,payload:X,logger:z}=$;if(z.debug("DefaultAssistantThreadStore: get method called"),this.context.channel_id)return this.context;let{channelId:Z,threadTs:K}=(0,_60.extractThreadInfo)(X),W=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!W.messages)return{};let H=W.messages.find((V)=>!("subtype"in V)&&V.user===Y.botUserId);return(H?.metadata?H.metadata.event_payload:null)||{}}async save($){let{context:Y,client:Q,payload:X,logger:z}=$,{channelId:Z,threadTs:K,context:W}=(0,_60.extractThreadInfo)(X);z.debug("DefaultAssistantThreadStore: save method called");let H=await Q.conversations.replies({channel:Z,ts:K,oldest:K,include_all_metadata:!0,limit:4});if(!H.messages)return;let w=H.messages.find((V)=>!("subtype"in V)&&V.user===Y.botUserId);if(w?.ts){let V={channel:Z,ts:w.ts,text:w.text,blocks:w.blocks?w.blocks:[],metadata:{event_type:"assistant_thread_context",event_payload:W}};await Q.chat.update(V)}this.context=W}}R60.DefaultThreadContextStore=A60});var dd=q((u8)=>{var iA6=u8&&u8.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(u8,"__esModule",{value:!0});u8.extractThreadInfo=u8.processAssistantMiddleware=u8.validate=u8.isAssistantMessage=u8.matchesConstraints=u8.isAssistantEvent=u8.enrichAssistantArgs=u8.Assistant=void 0;var lA6=f60(),k60=Zi(),P4=N$(),TM=lj(),nA6=iA6(nj()),dA6=new Set(["assistant_thread_started","assistant_thread_context_changed","message"]);class S60{threadContextStore;threadStarted;threadContextChanged;userMessage;constructor($){y60($);let{threadContextStore:Y=new lA6.DefaultThreadContextStore,threadStarted:Q,threadContextChanged:X=(Z)=>Y.save(Z),userMessage:z}=$;this.threadContextStore=Y,this.threadStarted=Array.isArray(Q)?Q:[Q],this.threadContextChanged=Array.isArray(X)?X:[X],this.userMessage=Array.isArray(z)?z:[z]}getMiddleware(){return async($)=>{if(C60($)&&u60($))return this.processEvent($);return $.next()}}async processEvent($){let{payload:Y}=$,Q=E60(this.threadContextStore,$),X=this.getAssistantMiddleware(Y);return g60(Q,X)}getAssistantMiddleware($){switch($.type){case"assistant_thread_started":return this.threadStarted;case"assistant_thread_context_changed":return this.threadContextChanged;case"message":return this.userMessage;default:return[]}}}u8.Assistant=S60;function E60($,Y){let{next:Q,...X}=Y,z={...X};return z.getThreadContext=()=>$.get(Y),z.saveThreadContext=()=>$.save(Y),z.say=aA6(z),z.sayStream=oA6(z),z.setStatus=rA6(z),z.setSuggestedPrompts=sA6(z),z.setTitle=tA6(z),z}u8.enrichAssistantArgs=E60;function C60($){return dA6.has($.payload.type)}u8.isAssistantEvent=C60;function u60($){return $.payload.type==="message"?c60($.payload):!0}u8.matchesConstraints=u60;function c60($){let Y="channel"in $&&"thread_ts"in $,Q="channel_type"in $&&$.channel_type==="im"&&(!("subtype"in $)||$.subtype==="file_share"||$.subtype===void 0);return Y&&Q}u8.isAssistantMessage=c60;function y60($){if(typeof $!=="object")throw new P4.AssistantInitializationError("Assistant expects a configuration object as the argument");let Y=["threadStarted","userMessage"],Q=[];for(let z of Y)if($[z]===void 0)Q.push(z);if(Q.length>0){let z=`Assistant is missing required keys: ${Q.join(", ")}`;throw new P4.AssistantInitializationError(z)}let X=["threadStarted","userMessage"];if("threadContextChanged"in $)X.push("threadContextChanged");for(let z of X)if(typeof $[z]!=="function"&&!Array.isArray($[z])){let Z=`Assistant ${z} property must be a function or an array of functions`;throw new P4.AssistantInitializationError(Z)}if($.threadContextStore){if(typeof $.threadContextStore!=="object")throw new P4.AssistantInitializationError("Assistant expects threadContextStore to be a configuration object");let z=["get","save"],Z=[];for(let W of z)if($.threadContextStore&&$.threadContextStore[W]===void 0)Z.push(W);if(Z.length>0){let W=`threadContextStore is missing required keys: ${Z.join(", ")}`;throw new P4.AssistantInitializationError(W)}let K=["get","save"];for(let W of K)if($.threadContextStore&&typeof $.threadContextStore[W]!=="function"){let H=`threadContextStore ${W} property must be a function`;throw new P4.AssistantInitializationError(H)}}}u8.validate=y60;async function g60($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,nA6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}u8.processAssistantMiddleware=g60;function aA6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z,context:Z}=QH(Q);return async(K)=>{let W=Z.channel_id?Z:await $.getThreadContext(),H=typeof K==="string"?{text:K,channel:X,thread_ts:z}:{...K,channel:X,thread_ts:z};if(W||H.metadata)H.metadata={event_type:H.metadata?.event_type??"assistant_thread_context",event_payload:{...W,...H.metadata?.event_payload??{}}};return Y.chat.postMessage(H)}}function oA6($){let{client:Y,context:Q,payload:X}=$,{channelId:z,threadTs:Z}=QH(X);return(0,k60.createSayStream)(Y,Q,z,Z)}function rA6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=QH(Q);return(0,k60.createSetStatus)(Y,X,z)}function sA6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=QH(Q);return(Z)=>{let{prompts:K,title:W}=Z;return Y.assistant.threads.setSuggestedPrompts({channel_id:X,thread_ts:z,prompts:K,title:W})}}function tA6($){let{client:Y,payload:Q}=$,{channelId:X,threadTs:z}=QH(Q);return(Z)=>Y.assistant.threads.setTitle({channel_id:X,thread_ts:z,title:Z})}function QH($){let Y={};if("assistant_thread"in $&&(0,TM.isRecord)($.assistant_thread)){if((0,TM.isRecord)($.assistant_thread.context))Y=$.assistant_thread.context}let Q=(0,TM.extractEventChannelId)($),X=(0,TM.extractEventThreadTs)($);if(!Q||!X){let z=[];if(!Q)z.push("channel_id");if(!X)z.push("thread_ts");throw new P4.AssistantMissingPropertyError(`Assistant message event is missing required properties: ${z.join(", ")}`)}return{channelId:Q,threadTs:X,context:Y}}u8.extractThreadInfo=QH});var n60=q((d9)=>{var eA6=d9&&d9.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(d9,"__esModule",{value:!0});d9.prepareStepArgs=d9.isStepEvent=d9.processStepMiddleware=d9.validate=d9.WorkflowStep=void 0;var fM=N$(),$R6=eA6(nj()),YR6=new Set(["workflow_step_edit","workflow_step","workflow_step_execute"]);class h60{callbackId;edit;save;execute;constructor($,Y){m60($,Y);let{save:Q,edit:X,execute:z}=Y;this.callbackId=$,this.save=Array.isArray(Q)?Q:[Q],this.edit=Array.isArray(X)?X:[X],this.execute=Array.isArray(z)?z:[z]}getMiddleware(){return async($)=>{if(i60($)&&this.matchesConstraints($))return this.processEvent($);return $.next()}}matchesConstraints($){return $.payload.callback_id===this.callbackId}async processEvent($){let{payload:Y}=$,Q=l60($),X=this.getStepMiddleware(Y);return p60(Q,X)}getStepMiddleware($){switch($.type){case"workflow_step_edit":return this.edit;case"workflow_step":return this.save;case"workflow_step_execute":return this.execute;default:return[]}}}d9.WorkflowStep=h60;function m60($,Y){if(typeof $!=="string")throw new fM.WorkflowStepInitializationError("WorkflowStep expects a callback_id as the first argument");if(typeof Y!=="object")throw new fM.WorkflowStepInitializationError("WorkflowStep expects a configuration object as the second argument");let Q=["save","edit","execute"],X=[];for(let Z of Q)if(Y[Z]===void 0)X.push(Z);if(X.length>0){let Z=`WorkflowStep is missing required keys: ${X.join(", ")}`;throw new fM.WorkflowStepInitializationError(Z)}let z=["save","edit","execute"];for(let Z of z)if(typeof Y[Z]!=="function"&&!Array.isArray(Y[Z])){let K=`WorkflowStep ${Z} property must be a function or an array of functions`;throw new fM.WorkflowStepInitializationError(K)}}d9.validate=m60;async function p60($,Y){let{context:Q,client:X,logger:z}=$,Z=[...Y],K=Z.pop();if(K!==void 0)await(0,$R6.default)(Z,$,Q,X,z,async()=>K({...$,context:Q,client:X,logger:z}))}d9.processStepMiddleware=p60;function i60($){return YR6.has($.payload.type)}d9.isStepEvent=i60;function kM($){return $.botToken!==void 0?$.botToken:$.userToken}function QR6($){let{context:Y,client:Q,body:{callback_id:X,trigger_id:z}}=$,Z=kM(Y);return(K)=>Q.views.open({token:Z,trigger_id:z,view:{callback_id:X,type:"workflow_step",...K}})}function XR6($){let{context:Y,client:Q,body:{workflow_step:{workflow_step_edit_id:X}}}=$,z=kM(Y);return(Z={})=>Q.workflows.updateStep({token:z,workflow_step_edit_id:X,...Z})}function zR6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=kM(Y);return(Z={})=>Q.workflows.stepCompleted({token:z,workflow_step_execute_id:X,...Z})}function ZR6($){let{context:Y,client:Q,payload:{workflow_step:{workflow_step_execute_id:X}}}=$,z=kM(Y);return(Z)=>{let{error:K}=Z;return Q.workflows.stepFailed({token:z,workflow_step_execute_id:X,error:K})}}function l60($){let{next:Y,...Q}=$,X={...Q};switch(X.payload.type){case"workflow_step_edit":X.step=X.action.workflow_step,X.configure=QR6(X);break;case"workflow_step":X.step=X.body.workflow_step,X.update=XR6(X);break;case"workflow_step_execute":X.step=X.event.workflow_step,X.complete=zR6(X),X.fail=ZR6(X);break;default:break}return X}d9.prepareStepArgs=l60});var s60=q((o1)=>{var d60=o1&&o1.__createBinding||(Object.create?function($,Y,Q,X){if(X===void 0)X=Q;var z=Object.getOwnPropertyDescriptor(Y,Q);if(!z||("get"in z?!Y.__esModule:z.writable||z.configurable))z={enumerable:!0,get:function(){return Y[Q]}};Object.defineProperty($,X,z)}:function($,Y,Q,X){if(X===void 0)X=Q;$[X]=Y[Q]}),KR6=o1&&o1.__setModuleDefault||(Object.create?function($,Y){Object.defineProperty($,"default",{enumerable:!0,value:Y})}:function($,Y){$.default=Y}),ad=o1&&o1.__importStar||function($){if($&&$.__esModule)return $;var Y={};if($!=null){for(var Q in $)if(Q!=="default"&&Object.prototype.hasOwnProperty.call($,Q))d60(Y,$,Q)}return KR6(Y,$),Y},od=o1&&o1.__exportStar||function($,Y){for(var Q in $)if(Q!=="default"&&!Object.prototype.hasOwnProperty.call(Y,Q))d60(Y,$,Q)},Vq=o1&&o1.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(o1,"__esModule",{value:!0});o1.webApi=o1.types=o1.FileInstallationStore=o1.MemoryInstallationStore=o1.WorkflowStep=o1.Assistant=o1.buildReceiverRoutes=o1.MemoryStore=o1.defaultProcessEventErrorHandler=o1.HTTPResponseAck=o1.HTTPModuleFunctions=o1.AwsLambdaReceiver=o1.HTTPReceiver=o1.SocketModeReceiver=o1.ExpressReceiver=o1.isValidSlackRequest=o1.verifySlackRequest=o1.App=o1.LogLevel=void 0;var a60=Vq(cn());o1.App=a60.default;var WR6=cn();Object.defineProperty(o1,"LogLevel",{enumerable:!0,get:function(){return WR6.LogLevel}});o1.default=a60.default;var o60=Vn();Object.defineProperty(o1,"verifySlackRequest",{enumerable:!0,get:function(){return o60.verifySlackRequest}});Object.defineProperty(o1,"isValidSlackRequest",{enumerable:!0,get:function(){return o60.isValidSlackRequest}});var HR6=Vq(Dt1());o1.AwsLambdaReceiver=HR6.default;var wR6=Vq(b60());o1.ExpressReceiver=wR6.default;var VR6=Vq(Gn());o1.HTTPReceiver=VR6.default;var UR6=Vq(fn());o1.SocketModeReceiver=UR6.default;o1.HTTPModuleFunctions=ad(EJ());var GR6=nI();Object.defineProperty(o1,"HTTPResponseAck",{enumerable:!0,get:function(){return GR6.HTTPResponseAck}});var JR6=Tn();Object.defineProperty(o1,"defaultProcessEventErrorHandler",{enumerable:!0,get:function(){return JR6.defaultProcessEventErrorHandler}});od(N$(),o1);od(ij(),o1);od(Sn(),o1);var qR6=Ki();Object.defineProperty(o1,"MemoryStore",{enumerable:!0,get:function(){return qR6.MemoryStore}});var xR6=dI();Object.defineProperty(o1,"buildReceiverRoutes",{enumerable:!0,get:function(){return xR6.buildReceiverRoutes}});var BR6=dd();Object.defineProperty(o1,"Assistant",{enumerable:!0,get:function(){return BR6.Assistant}});var DR6=n60();Object.defineProperty(o1,"WorkflowStep",{enumerable:!0,get:function(){return DR6.WorkflowStep}});var r60=vJ();Object.defineProperty(o1,"MemoryInstallationStore",{enumerable:!0,get:function(){return r60.MemoryInstallationStore}});Object.defineProperty(o1,"FileInstallationStore",{enumerable:!0,get:function(){return r60.FileInstallationStore}});o1.types=ad(QJ());o1.webApi=ad($i())});import{homedir as Gf6}from"os";var Ao={name:"@interactive-inc/claude-funnel",version:"0.58.1",description:"Hub CLI that routes external events (Slack / GitHub / Discord) to Claude Code agents through subscription channels over MCP.",keywords:["bun","claude","claude-code","cli","discord","github","mcp","slack"],homepage:"https://github.com/interactive-inc/open-claude-funnel#readme",bugs:{url:"https://github.com/interactive-inc/open-claude-funnel/issues"},license:"MIT",author:"Interactive Inc.",repository:{type:"git",url:"git+https://github.com/interactive-inc/open-claude-funnel.git"},bin:{fnl:"./dist/bin.js",funnel:"./dist/bin.js"},files:["dist/**/*","funnel.schema.json","README.md","LICENSE"],type:"module",main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.js"},"./claude":{types:"./dist/claude.d.ts",import:"./dist/claude.js",default:"./dist/claude.js"},"./gateway":{types:"./dist/gateway.d.ts",import:"./dist/gateway.js",default:"./dist/gateway.js"},"./profiles":{types:"./dist/profiles.d.ts",import:"./dist/profiles.js",default:"./dist/profiles.js"},"./local-config":{types:"./dist/local-config.d.ts",import:"./dist/local-config.js",default:"./dist/local-config.js"},"./diagnostics":{types:"./dist/diagnostics.d.ts",import:"./dist/diagnostics.js",default:"./dist/diagnostics.js"},"./recovery":{types:"./dist/recovery.d.ts",import:"./dist/recovery.js",default:"./dist/recovery.js"},"./doctor":{types:"./dist/doctor.d.ts",import:"./dist/doctor.js",default:"./dist/doctor.js"},"./docs":{types:"./dist/docs.d.ts",import:"./dist/docs.js",default:"./dist/docs.js"},"./connectors/slack":{types:"./dist/connectors/slack.d.ts",import:"./dist/connectors/slack.js",default:"./dist/connectors/slack.js"},"./connectors/discord":{types:"./dist/connectors/discord.d.ts",import:"./dist/connectors/discord.js",default:"./dist/connectors/discord.js"},"./connectors/gh":{types:"./dist/connectors/gh.d.ts",import:"./dist/connectors/gh.js",default:"./dist/connectors/gh.js"},"./connectors/schedule":{types:"./dist/connectors/schedule.d.ts",import:"./dist/connectors/schedule.js",default:"./dist/connectors/schedule.js"},"./logger":{types:"./dist/logger.d.ts",import:"./dist/logger.js",default:"./dist/logger.js"},"./bin":"./dist/bin.js","./package.json":"./package.json"},publishConfig:{access:"public"},scripts:{prepack:"make build"},dependencies:{"@hono/zod-validator":"^0.8.0","@modelcontextprotocol/sdk":"^1.29.0","@slack/bolt":"^4.7.2","@slack/web-api":"^7.16.0","discord.js":"^14.26.4",hono:"^4.12.19",yaml:"^2.9.0",zod:"^4.4.3"},devDependencies:{"@types/bun":"^1.3.14","@typescript/native-preview":"^7.0.0-dev.20260516.1","vite-plus":"^0.1.21",vitest:"^4.1.8"},engines:{bun:">=1.3.0"}};var Q0=class extends Error{res;status;constructor($=500,Y){super(Y?.message,{cause:Y?.cause});this.res=Y?.res,this.status=$}getResponse(){if(this.res)return new Response(this.res.body,{status:this.status,headers:this.res.headers});return new Response(this.message,{status:this.status})}};var N={};t7(N,{xor:()=>Hs,xid:()=>Tr,void:()=>Qs,uuidv7:()=>Ir,uuidv6:()=>jr,uuidv4:()=>Pr,uuid:()=>Nr,util:()=>x1,url:()=>Mr,uppercase:()=>d4,unknown:()=>SZ,union:()=>zB,undefined:()=>$s,ulid:()=>Rr,uint64:()=>tr,uint32:()=>or,tuple:()=>iA,trim:()=>e4,treeifyError:()=>E3,transform:()=>KB,toUpperCase:()=>Y2,toLowerCase:()=>$2,toJSONSchema:()=>Tx,templateLiteral:()=>js,symbol:()=>er,superRefine:()=>LR,success:()=>Ls,stringbool:()=>Rs,stringFormat:()=>mr,string:()=>kH,strictObject:()=>Ks,startsWith:()=>o4,slugify:()=>Q2,size:()=>TZ,setErrorMap:()=>$Q0,set:()=>Js,safeParseAsync:()=>LA,safeParse:()=>DA,safeEncodeAsync:()=>OA,safeEncode:()=>IA,safeDecodeAsync:()=>vA,safeDecode:()=>MA,registry:()=>Qx,regexes:()=>t9,regex:()=>l4,refine:()=>DR,record:()=>lA,readonly:()=>UR,property:()=>bx,promise:()=>Is,prettifyError:()=>C3,preprocess:()=>fs,prefault:()=>XR,positive:()=>Ix,pipe:()=>cx,partialRecord:()=>Vs,parseAsync:()=>BA,parse:()=>xA,overwrite:()=>e7,optional:()=>EH,object:()=>Zs,number:()=>_A,nullish:()=>Ds,nullable:()=>CH,null:()=>kA,normalize:()=>t4,nonpositive:()=>Ox,nonoptional:()=>zR,nonnegative:()=>vx,never:()=>XB,negative:()=>Mx,nativeEnum:()=>qs,nanoid:()=>br,nan:()=>Fs,multipleOf:()=>lX,minSize:()=>cY,minLength:()=>fQ,mime:()=>s4,meta:()=>_s,maxSize:()=>nX,maxLength:()=>fZ,map:()=>Gs,mac:()=>Sr,lte:()=>e9,lt:()=>CY,lowercase:()=>n4,looseRecord:()=>Us,looseObject:()=>Ws,locales:()=>AH,literal:()=>xs,length:()=>kZ,lazy:()=>qR,ksuid:()=>fr,keyof:()=>zs,jwt:()=>hr,json:()=>Ts,iso:()=>Z2,ipv6:()=>Er,ipv4:()=>kr,invertCodec:()=>Ps,intersection:()=>mA,int64:()=>sr,int32:()=>ar,int:()=>ux,instanceof:()=>As,includes:()=>a4,httpUrl:()=>Or,hostname:()=>pr,hex:()=>ir,hash:()=>lr,guid:()=>Fr,gte:()=>o$,gt:()=>uY,globalRegistry:()=>W$,getErrorMap:()=>YQ0,function:()=>Ms,fromJSONSchema:()=>Ss,formatError:()=>LH,float64:()=>dr,float32:()=>nr,flattenError:()=>DH,file:()=>Bs,exactOptional:()=>tA,enum:()=>ZB,endsWith:()=>r4,encodeAsync:()=>PA,encode:()=>FA,emoji:()=>vr,email:()=>Lr,e164:()=>gr,discriminatedUnion:()=>ws,describe:()=>bs,decodeAsync:()=>jA,decode:()=>NA,date:()=>Xs,custom:()=>vs,cuid2:()=>Ar,cuid:()=>_r,core:()=>kQ,config:()=>H8,coerce:()=>NR,codec:()=>Ns,clone:()=>d$,cidrv6:()=>ur,cidrv4:()=>Cr,check:()=>Os,catch:()=>WR,boolean:()=>AA,bigint:()=>rr,base64url:()=>yr,base64:()=>cr,array:()=>gH,any:()=>Ys,_function:()=>Ms,_default:()=>YR,_ZodString:()=>yx,ZodXor:()=>yA,ZodXID:()=>nx,ZodVoid:()=>uA,ZodUnknown:()=>EA,ZodUnion:()=>mH,ZodUndefined:()=>TA,ZodUUID:()=>yY,ZodURL:()=>cH,ZodULID:()=>lx,ZodType:()=>x0,ZodTuple:()=>pA,ZodTransform:()=>rA,ZodTemplateLiteral:()=>GR,ZodSymbol:()=>RA,ZodSuccess:()=>ZR,ZodStringFormat:()=>H6,ZodString:()=>H2,ZodSet:()=>dA,ZodRecord:()=>K2,ZodRealError:()=>M9,ZodReadonly:()=>VR,ZodPromise:()=>xR,ZodPreprocess:()=>wR,ZodPrefault:()=>QR,ZodPipe:()=>pH,ZodOptional:()=>WB,ZodObject:()=>hH,ZodNumberFormat:()=>EZ,ZodNumber:()=>V2,ZodNullable:()=>eA,ZodNull:()=>fA,ZodNonOptional:()=>HB,ZodNever:()=>CA,ZodNanoID:()=>mx,ZodNaN:()=>HR,ZodMap:()=>nA,ZodMAC:()=>bA,ZodLiteral:()=>aA,ZodLazy:()=>JR,ZodKSUID:()=>dx,ZodJWT:()=>YB,ZodIssueCode:()=>eY0,ZodIntersection:()=>hA,ZodISOTime:()=>Ex,ZodISODuration:()=>Cx,ZodISODateTime:()=>kx,ZodISODate:()=>Sx,ZodIPv6:()=>ox,ZodIPv4:()=>ax,ZodGUID:()=>SH,ZodFunction:()=>BR,ZodFirstPartyTypeKind:()=>FR,ZodFile:()=>oA,ZodExactOptional:()=>sA,ZodError:()=>sY0,ZodEnum:()=>W2,ZodEmoji:()=>hx,ZodEmail:()=>gx,ZodE164:()=>$B,ZodDiscriminatedUnion:()=>gA,ZodDefault:()=>$R,ZodDate:()=>yH,ZodCustomStringFormat:()=>w2,ZodCustom:()=>lH,ZodCodec:()=>iH,ZodCatch:()=>KR,ZodCUID2:()=>ix,ZodCUID:()=>px,ZodCIDRv6:()=>sx,ZodCIDRv4:()=>rx,ZodBoolean:()=>U2,ZodBigIntFormat:()=>QB,ZodBigInt:()=>G2,ZodBase64URL:()=>ex,ZodBase64:()=>tx,ZodArray:()=>cA,ZodAny:()=>SA,TimePrecision:()=>ib,NEVER:()=>I3,$output:()=>cb,$input:()=>yb,$brand:()=>M3});var kQ={};t7(kQ,{version:()=>fO,util:()=>x1,treeifyError:()=>E3,toJSONSchema:()=>Tx,toDotPath:()=>Co,safeParseAsync:()=>c3,safeParse:()=>u3,safeEncodeAsync:()=>e90,safeEncode:()=>s90,safeDecodeAsync:()=>$70,safeDecode:()=>t90,registry:()=>Qx,regexes:()=>t9,process:()=>z6,prettifyError:()=>C3,parseAsync:()=>Sq,parse:()=>kq,meta:()=>M_,locales:()=>AH,isValidJWT:()=>Zr,isValidBase64URL:()=>zr,isValidBase64:()=>$v,initializeContext:()=>dX,globalRegistry:()=>W$,globalConfig:()=>vZ,formatError:()=>LH,flattenError:()=>DH,finalize:()=>oX,extractDefs:()=>aX,encodeAsync:()=>o90,encode:()=>d90,describe:()=>I_,decodeAsync:()=>r90,decode:()=>a90,createToJSONSchemaMethod:()=>v_,createStandardJSONSchemaMethod:()=>z2,config:()=>H8,clone:()=>d$,_xor:()=>bY0,_xid:()=>Jx,_void:()=>q_,_uuidv7:()=>Wx,_uuidv6:()=>Kx,_uuidv4:()=>Zx,_uuid:()=>zx,_url:()=>TH,_uppercase:()=>d4,_unknown:()=>G_,_union:()=>vY0,_undefined:()=>w_,_ulid:()=>Gx,_uint64:()=>W_,_uint32:()=>Y_,_tuple:()=>RY0,_trim:()=>e4,_transform:()=>uY0,_toUpperCase:()=>Y2,_toLowerCase:()=>$2,_templateLiteral:()=>nY0,_symbol:()=>H_,_superRefine:()=>j_,_success:()=>mY0,_stringbool:()=>O_,_stringFormat:()=>X2,_string:()=>hb,_startsWith:()=>o4,_slugify:()=>Q2,_size:()=>TZ,_set:()=>kY0,_safeParseAsync:()=>m4,_safeParse:()=>h4,_safeEncodeAsync:()=>hq,_safeEncode:()=>yq,_safeDecodeAsync:()=>mq,_safeDecode:()=>gq,_regex:()=>l4,_refine:()=>P_,_record:()=>TY0,_readonly:()=>lY0,_property:()=>bx,_promise:()=>aY0,_positive:()=>Ix,_pipe:()=>iY0,_parseAsync:()=>g4,_parse:()=>y4,_overwrite:()=>e7,_optional:()=>cY0,_number:()=>ob,_nullable:()=>yY0,_null:()=>V_,_normalize:()=>t4,_nonpositive:()=>Ox,_nonoptional:()=>hY0,_nonnegative:()=>vx,_never:()=>J_,_negative:()=>Mx,_nativeEnum:()=>EY0,_nanoid:()=>wx,_nan:()=>D_,_multipleOf:()=>lX,_minSize:()=>cY,_minLength:()=>fQ,_min:()=>o$,_mime:()=>s4,_maxSize:()=>nX,_maxLength:()=>fZ,_max:()=>e9,_map:()=>fY0,_mac:()=>pb,_lte:()=>e9,_lt:()=>CY,_lowercase:()=>n4,_literal:()=>CY0,_length:()=>kZ,_lazy:()=>dY0,_ksuid:()=>qx,_jwt:()=>jx,_isoTime:()=>db,_isoDuration:()=>ab,_isoDateTime:()=>lb,_isoDate:()=>nb,_ipv6:()=>Bx,_ipv4:()=>xx,_intersection:()=>AY0,_int64:()=>K_,_int32:()=>$_,_int:()=>sb,_includes:()=>a4,_guid:()=>RH,_gte:()=>o$,_gt:()=>uY,_float64:()=>eb,_float32:()=>tb,_file:()=>F_,_enum:()=>SY0,_endsWith:()=>r4,_encodeAsync:()=>uq,_encode:()=>Eq,_emoji:()=>Hx,_email:()=>Xx,_e164:()=>Px,_discriminatedUnion:()=>_Y0,_default:()=>gY0,_decodeAsync:()=>cq,_decode:()=>Cq,_date:()=>x_,_custom:()=>N_,_cuid2:()=>Ux,_cuid:()=>Vx,_coercedString:()=>mb,_coercedNumber:()=>rb,_coercedDate:()=>B_,_coercedBoolean:()=>X_,_coercedBigint:()=>Z_,_cidrv6:()=>Lx,_cidrv4:()=>Dx,_check:()=>qr,_catch:()=>pY0,_boolean:()=>Q_,_bigint:()=>z_,_base64url:()=>Nx,_base64:()=>Fx,_array:()=>L_,_any:()=>U_,TimePrecision:()=>ib,NEVER:()=>I3,JSONSchemaGenerator:()=>VA,JSONSchema:()=>xr,Doc:()=>nq,$output:()=>cb,$input:()=>yb,$constructor:()=>y,$brand:()=>M3,$ZodXor:()=>Lv,$ZodXID:()=>pO,$ZodVoid:()=>qv,$ZodUnknown:()=>Gv,$ZodUnion:()=>IH,$ZodUndefined:()=>wv,$ZodUUID:()=>EO,$ZodURL:()=>uO,$ZodULID:()=>mO,$ZodType:()=>Z0,$ZodTuple:()=>eq,$ZodTransform:()=>bv,$ZodTemplateLiteral:()=>cv,$ZodSymbol:()=>Hv,$ZodSuccess:()=>kv,$ZodStringFormat:()=>W6,$ZodString:()=>RZ,$ZodSet:()=>Iv,$ZodRegistry:()=>gb,$ZodRecord:()=>Pv,$ZodRealError:()=>I9,$ZodReadonly:()=>uv,$ZodPromise:()=>gv,$ZodPreprocess:()=>Cv,$ZodPrefault:()=>Tv,$ZodPipe:()=>Yx,$ZodOptional:()=>$x,$ZodObjectJIT:()=>Dv,$ZodObject:()=>Hr,$ZodNumberFormat:()=>Kv,$ZodNumber:()=>sq,$ZodNullable:()=>Av,$ZodNull:()=>Vv,$ZodNonOptional:()=>fv,$ZodNever:()=>Jv,$ZodNanoID:()=>yO,$ZodNaN:()=>Ev,$ZodMap:()=>jv,$ZodMAC:()=>sO,$ZodLiteral:()=>Ov,$ZodLazy:()=>hv,$ZodKSUID:()=>iO,$ZodJWT:()=>zv,$ZodIntersection:()=>Nv,$ZodISOTime:()=>dO,$ZodISODuration:()=>aO,$ZodISODateTime:()=>lO,$ZodISODate:()=>nO,$ZodIPv6:()=>rO,$ZodIPv4:()=>oO,$ZodGUID:()=>SO,$ZodFunction:()=>yv,$ZodFile:()=>vv,$ZodExactOptional:()=>_v,$ZodError:()=>BH,$ZodEnum:()=>Mv,$ZodEncodeError:()=>bZ,$ZodEmoji:()=>cO,$ZodEmail:()=>CO,$ZodE164:()=>Xv,$ZodDiscriminatedUnion:()=>Fv,$ZodDefault:()=>Rv,$ZodDate:()=>xv,$ZodCustomStringFormat:()=>Zv,$ZodCustom:()=>mv,$ZodCodec:()=>MH,$ZodCheckUpperCase:()=>OO,$ZodCheckStringFormat:()=>p4,$ZodCheckStartsWith:()=>bO,$ZodCheckSizeEquals:()=>FO,$ZodCheckRegex:()=>IO,$ZodCheckProperty:()=>AO,$ZodCheckOverwrite:()=>TO,$ZodCheckNumberFormat:()=>xO,$ZodCheckMultipleOf:()=>qO,$ZodCheckMinSize:()=>LO,$ZodCheckMinLength:()=>PO,$ZodCheckMimeType:()=>RO,$ZodCheckMaxSize:()=>DO,$ZodCheckMaxLength:()=>NO,$ZodCheckLowerCase:()=>MO,$ZodCheckLessThan:()=>iq,$ZodCheckLengthEquals:()=>jO,$ZodCheckIncludes:()=>vO,$ZodCheckGreaterThan:()=>lq,$ZodCheckEndsWith:()=>_O,$ZodCheckBigIntFormat:()=>BO,$ZodCheck:()=>q6,$ZodCatch:()=>Sv,$ZodCUID2:()=>hO,$ZodCUID:()=>gO,$ZodCIDRv6:()=>eO,$ZodCIDRv4:()=>tO,$ZodBoolean:()=>jH,$ZodBigIntFormat:()=>Wv,$ZodBigInt:()=>tq,$ZodBase64URL:()=>Qv,$ZodBase64:()=>Yv,$ZodAsyncError:()=>EY,$ZodArray:()=>Bv,$ZodAny:()=>Uv});var Ro,I3=Object.freeze({status:"aborted"});function y($,Y,Q){function X(W,H){if(!W._zod)Object.defineProperty(W,"_zod",{value:{def:H,constr:K,traits:new Set},enumerable:!1});if(W._zod.traits.has($))return;W._zod.traits.add($),Y(W,H);let w=K.prototype,V=Object.keys(w);for(let U=0;U<V.length;U++){let G=V[U];if(!(G in W))W[G]=w[G].bind(W)}}let z=Q?.Parent??Object;class Z extends z{}Object.defineProperty(Z,"name",{value:$});function K(W){var H;let w=Q?.Parent?new Z:this;X(w,W),(H=w._zod).deferred??(H.deferred=[]);for(let V of w._zod.deferred)V();return w}return Object.defineProperty(K,"init",{value:X}),Object.defineProperty(K,Symbol.hasInstance,{value:(W)=>{if(Q?.Parent&&W instanceof Q.Parent)return!0;return W?._zod?.traits?.has($)}}),Object.defineProperty(K,"name",{value:$}),K}var M3=Symbol("zod_brand");class EY extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class bZ extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(Ro=globalThis).__zod_globalConfig??(Ro.__zod_globalConfig={});var vZ=globalThis.__zod_globalConfig;function H8($){if($)Object.assign(vZ,$);return vZ}var x1={};t7(x1,{unwrapMessage:()=>VH,uint8ArrayToHex:()=>l90,uint8ArrayToBase64url:()=>p90,uint8ArrayToBase64:()=>ko,stringifyPrimitive:()=>G1,slugify:()=>b3,shallowClone:()=>A3,safeExtend:()=>u90,required:()=>g90,randomString:()=>R90,propertyKeyTypes:()=>JH,promiseAllObject:()=>A90,primitiveTypes:()=>R3,prefixIssues:()=>j9,pick:()=>S90,partial:()=>y90,parsedType:()=>q1,optionalKeys:()=>T3,omit:()=>E90,objectClone:()=>v90,numKeys:()=>T90,nullish:()=>hX,normalizeParams:()=>D1,mergeDefs:()=>TQ,merge:()=>c90,jsonStringifyReplacer:()=>C4,joinValues:()=>i,issue:()=>c4,isPlainObject:()=>pX,isObject:()=>_Z,hexToUint8Array:()=>i90,getSizableOrigin:()=>qH,getParsedType:()=>f90,getLengthableOrigin:()=>xH,getEnumValues:()=>UH,getElementAtPath:()=>_90,floatSafeRemainder:()=>v3,finalizeIssue:()=>a$,extend:()=>C90,explicitlyAborted:()=>S3,escapeRegex:()=>x7,esc:()=>Tq,defineLazy:()=>I0,createTransparentProxy:()=>k90,cloneDef:()=>b90,clone:()=>d$,cleanRegex:()=>GH,cleanEnum:()=>h90,captureStackTrace:()=>fq,cached:()=>u4,base64urlToUint8Array:()=>m90,base64ToUint8Array:()=>fo,assignProp:()=>mX,assertNotEqual:()=>j90,assertNever:()=>M90,assertIs:()=>I90,assertEqual:()=>P90,assert:()=>O90,allowsEval:()=>_3,aborted:()=>iX,NUMBER_FORMAT_RANGES:()=>f3,Class:()=>So,BIGINT_FORMAT_RANGES:()=>k3});function P90($){return $}function j90($){return $}function I90($){}function M90($){throw Error("Unexpected value in exhaustive check")}function O90($){}function UH($){let Y=Object.values($).filter((X)=>typeof X==="number");return Object.entries($).filter(([X,z])=>Y.indexOf(+X)===-1).map(([X,z])=>z)}function i($,Y="|"){return $.map((Q)=>G1(Q)).join(Y)}function C4($,Y){if(typeof Y==="bigint")return Y.toString();return Y}function u4($){return{get value(){{let Q=$();return Object.defineProperty(this,"value",{value:Q}),Q}throw Error("cached value already set")}}}function hX($){return $===null||$===void 0}function GH($){let Y=$.startsWith("^")?1:0,Q=$.endsWith("$")?$.length-1:$.length;return $.slice(Y,Q)}function v3($,Y){let Q=$/Y,X=Math.round(Q),z=Number.EPSILON*Math.max(Math.abs(Q),1);if(Math.abs(Q-X)<z)return 0;return Q-X}var To=Symbol("evaluating");function I0($,Y,Q){let X=void 0;Object.defineProperty($,Y,{get(){if(X===To)return;if(X===void 0)X=To,X=Q();return X},set(z){Object.defineProperty($,Y,{value:z})},configurable:!0})}function v90($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function mX($,Y,Q){Object.defineProperty($,Y,{value:Q,writable:!0,enumerable:!0,configurable:!0})}function TQ(...$){let Y={};for(let Q of $){let X=Object.getOwnPropertyDescriptors(Q);Object.assign(Y,X)}return Object.defineProperties({},Y)}function b90($){return TQ($._zod.def)}function _90($,Y){if(!Y)return $;return Y.reduce((Q,X)=>Q?.[X],$)}function A90($){let Y=Object.keys($),Q=Y.map((X)=>$[X]);return Promise.all(Q).then((X)=>{let z={};for(let Z=0;Z<Y.length;Z++)z[Y[Z]]=X[Z];return z})}function R90($=10){let Q="";for(let X=0;X<$;X++)Q+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return Q}function Tq($){return JSON.stringify($)}function b3($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var fq="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function _Z($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var _3=u4(()=>{if(vZ.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function pX($){if(_Z($)===!1)return!1;let Y=$.constructor;if(Y===void 0)return!0;if(typeof Y!=="function")return!0;let Q=Y.prototype;if(_Z(Q)===!1)return!1;if(Object.prototype.hasOwnProperty.call(Q,"isPrototypeOf")===!1)return!1;return!0}function A3($){if(pX($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function T90($){let Y=0;for(let Q in $)if(Object.prototype.hasOwnProperty.call($,Q))Y++;return Y}var f90=($)=>{let Y=typeof $;switch(Y){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${Y}`)}},JH=new Set(["string","number","symbol"]),R3=new Set(["string","number","bigint","boolean","symbol","undefined"]);function x7($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d$($,Y,Q){let X=new $._zod.constr(Y??$._zod.def);if(!Y||Q?.parent)X._zod.parent=$;return X}function D1($){let Y=$;if(!Y)return{};if(typeof Y==="string")return{error:()=>Y};if(Y?.message!==void 0){if(Y?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");Y.error=Y.message}if(delete Y.message,typeof Y.error==="string")return{...Y,error:()=>Y.error};return Y}function k90($){let Y;return new Proxy({},{get(Q,X,z){return Y??(Y=$()),Reflect.get(Y,X,z)},set(Q,X,z,Z){return Y??(Y=$()),Reflect.set(Y,X,z,Z)},has(Q,X){return Y??(Y=$()),Reflect.has(Y,X)},deleteProperty(Q,X){return Y??(Y=$()),Reflect.deleteProperty(Y,X)},ownKeys(Q){return Y??(Y=$()),Reflect.ownKeys(Y)},getOwnPropertyDescriptor(Q,X){return Y??(Y=$()),Reflect.getOwnPropertyDescriptor(Y,X)},defineProperty(Q,X,z){return Y??(Y=$()),Reflect.defineProperty(Y,X,z)}})}function G1($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function T3($){return Object.keys($).filter((Y)=>{return $[Y]._zod.optin==="optional"&&$[Y]._zod.optout==="optional"})}var f3={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},k3={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function S90($,Y){let Q=$._zod.def,X=Q.checks;if(X&&X.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let Z=TQ($._zod.def,{get shape(){let K={};for(let W in Y){if(!(W in Q.shape))throw Error(`Unrecognized key: "${W}"`);if(!Y[W])continue;K[W]=Q.shape[W]}return mX(this,"shape",K),K},checks:[]});return d$($,Z)}function E90($,Y){let Q=$._zod.def,X=Q.checks;if(X&&X.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let Z=TQ($._zod.def,{get shape(){let K={...$._zod.def.shape};for(let W in Y){if(!(W in Q.shape))throw Error(`Unrecognized key: "${W}"`);if(!Y[W])continue;delete K[W]}return mX(this,"shape",K),K},checks:[]});return d$($,Z)}function C90($,Y){if(!pX(Y))throw Error("Invalid input to extend: expected a plain object");let Q=$._zod.def.checks;if(Q&&Q.length>0){let Z=$._zod.def.shape;for(let K in Y)if(Object.getOwnPropertyDescriptor(Z,K)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let z=TQ($._zod.def,{get shape(){let Z={...$._zod.def.shape,...Y};return mX(this,"shape",Z),Z}});return d$($,z)}function u90($,Y){if(!pX(Y))throw Error("Invalid input to safeExtend: expected a plain object");let Q=TQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y};return mX(this,"shape",X),X}});return d$($,Q)}function c90($,Y){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let Q=TQ($._zod.def,{get shape(){let X={...$._zod.def.shape,...Y._zod.def.shape};return mX(this,"shape",X),X},get catchall(){return Y._zod.def.catchall},checks:Y._zod.def.checks??[]});return d$($,Q)}function y90($,Y,Q){let z=Y._zod.def.checks;if(z&&z.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let K=TQ(Y._zod.def,{get shape(){let W=Y._zod.def.shape,H={...W};if(Q)for(let w in Q){if(!(w in W))throw Error(`Unrecognized key: "${w}"`);if(!Q[w])continue;H[w]=$?new $({type:"optional",innerType:W[w]}):W[w]}else for(let w in W)H[w]=$?new $({type:"optional",innerType:W[w]}):W[w];return mX(this,"shape",H),H},checks:[]});return d$(Y,K)}function g90($,Y,Q){let X=TQ(Y._zod.def,{get shape(){let z=Y._zod.def.shape,Z={...z};if(Q)for(let K in Q){if(!(K in Z))throw Error(`Unrecognized key: "${K}"`);if(!Q[K])continue;Z[K]=new $({type:"nonoptional",innerType:z[K]})}else for(let K in z)Z[K]=new $({type:"nonoptional",innerType:z[K]});return mX(this,"shape",Z),Z}});return d$(Y,X)}function iX($,Y=0){if($.aborted===!0)return!0;for(let Q=Y;Q<$.issues.length;Q++)if($.issues[Q]?.continue!==!0)return!0;return!1}function S3($,Y=0){if($.aborted===!0)return!0;for(let Q=Y;Q<$.issues.length;Q++)if($.issues[Q]?.continue===!1)return!0;return!1}function j9($,Y){return Y.map((Q)=>{var X;return(X=Q).path??(X.path=[]),Q.path.unshift($),Q})}function VH($){return typeof $==="string"?$:$?.message}function a$($,Y,Q){let X=$.message?$.message:VH($.inst?._zod.def?.error?.($))??VH(Y?.error?.($))??VH(Q.customError?.($))??VH(Q.localeError?.($))??"Invalid input",{inst:z,continue:Z,input:K,...W}=$;if(W.path??(W.path=[]),W.message=X,Y?.reportInput)W.input=K;return W}function qH($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function xH($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function q1($){let Y=typeof $;switch(Y){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let Q=$;if(Q&&Object.getPrototypeOf(Q)!==Object.prototype&&"constructor"in Q&&Q.constructor)return Q.constructor.name}}return Y}function c4(...$){let[Y,Q,X]=$;if(typeof Y==="string")return{message:Y,code:"custom",input:Q,inst:X};return{...Y}}function h90($){return Object.entries($).filter(([Y,Q])=>{return Number.isNaN(Number.parseInt(Y,10))}).map((Y)=>Y[1])}function fo($){let Y=atob($),Q=new Uint8Array(Y.length);for(let X=0;X<Y.length;X++)Q[X]=Y.charCodeAt(X);return Q}function ko($){let Y="";for(let Q=0;Q<$.length;Q++)Y+=String.fromCharCode($[Q]);return btoa(Y)}function m90($){let Y=$.replace(/-/g,"+").replace(/_/g,"/"),Q="=".repeat((4-Y.length%4)%4);return fo(Y+Q)}function p90($){return ko($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function i90($){let Y=$.replace(/^0x/,"");if(Y.length%2!==0)throw Error("Invalid hex string length");let Q=new Uint8Array(Y.length/2);for(let X=0;X<Y.length;X+=2)Q[X/2]=Number.parseInt(Y.slice(X,X+2),16);return Q}function l90($){return Array.from($).map((Y)=>Y.toString(16).padStart(2,"0")).join("")}class So{constructor(...$){}}var Eo=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,C4,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},BH=y("$ZodError",Eo),I9=y("$ZodError",Eo,{Parent:Error});function DH($,Y=(Q)=>Q.message){let Q={},X=[];for(let z of $.issues)if(z.path.length>0)Q[z.path[0]]=Q[z.path[0]]||[],Q[z.path[0]].push(Y(z));else X.push(Y(z));return{formErrors:X,fieldErrors:Q}}function LH($,Y=(Q)=>Q.message){let Q={_errors:[]},X=(z,Z=[])=>{for(let K of z.issues)if(K.code==="invalid_union"&&K.errors.length)K.errors.map((W)=>X({issues:W},[...Z,...K.path]));else if(K.code==="invalid_key")X({issues:K.issues},[...Z,...K.path]);else if(K.code==="invalid_element")X({issues:K.issues},[...Z,...K.path]);else{let W=[...Z,...K.path];if(W.length===0)Q._errors.push(Y(K));else{let H=Q,w=0;while(w<W.length){let V=W[w];if(w!==W.length-1)H[V]=H[V]||{_errors:[]};else H[V]=H[V]||{_errors:[]},H[V]._errors.push(Y(K));H=H[V],w++}}}};return X($),Q}function E3($,Y=(Q)=>Q.message){let Q={errors:[]},X=(z,Z=[])=>{var K,W;for(let H of z.issues)if(H.code==="invalid_union"&&H.errors.length)H.errors.map((w)=>X({issues:w},[...Z,...H.path]));else if(H.code==="invalid_key")X({issues:H.issues},[...Z,...H.path]);else if(H.code==="invalid_element")X({issues:H.issues},[...Z,...H.path]);else{let w=[...Z,...H.path];if(w.length===0){Q.errors.push(Y(H));continue}let V=Q,U=0;while(U<w.length){let G=w[U],J=U===w.length-1;if(typeof G==="string")V.properties??(V.properties={}),(K=V.properties)[G]??(K[G]={errors:[]}),V=V.properties[G];else V.items??(V.items=[]),(W=V.items)[G]??(W[G]={errors:[]}),V=V.items[G];if(J)V.errors.push(Y(H));U++}}};return X($),Q}function Co($){let Y=[],Q=$.map((X)=>typeof X==="object"?X.key:X);for(let X of Q)if(typeof X==="number")Y.push(`[${X}]`);else if(typeof X==="symbol")Y.push(`[${JSON.stringify(String(X))}]`);else if(/[^\w$]/.test(X))Y.push(`[${JSON.stringify(X)}]`);else{if(Y.length)Y.push(".");Y.push(X)}return Y.join("")}function C3($){let Y=[],Q=[...$.issues].sort((X,z)=>(X.path??[]).length-(z.path??[]).length);for(let X of Q)if(Y.push(`\u2716 ${X.message}`),X.path?.length)Y.push(` \u2192 at ${Co(X.path)}`);return Y.join(`
|
|
610
610
|
`)}var y4=($)=>(Y,Q,X,z)=>{let Z=X?{...X,async:!1}:{async:!1},K=Y._zod.run({value:Q,issues:[]},Z);if(K instanceof Promise)throw new EY;if(K.issues.length){let W=new(z?.Err??$)(K.issues.map((H)=>a$(H,Z,H8())));throw fq(W,z?.callee),W}return K.value},kq=y4(I9),g4=($)=>async(Y,Q,X,z)=>{let Z=X?{...X,async:!0}:{async:!0},K=Y._zod.run({value:Q,issues:[]},Z);if(K instanceof Promise)K=await K;if(K.issues.length){let W=new(z?.Err??$)(K.issues.map((H)=>a$(H,Z,H8())));throw fq(W,z?.callee),W}return K.value},Sq=g4(I9),h4=($)=>(Y,Q,X)=>{let z=X?{...X,async:!1}:{async:!1},Z=Y._zod.run({value:Q,issues:[]},z);if(Z instanceof Promise)throw new EY;return Z.issues.length?{success:!1,error:new($??BH)(Z.issues.map((K)=>a$(K,z,H8())))}:{success:!0,data:Z.value}},u3=h4(I9),m4=($)=>async(Y,Q,X)=>{let z=X?{...X,async:!0}:{async:!0},Z=Y._zod.run({value:Q,issues:[]},z);if(Z instanceof Promise)Z=await Z;return Z.issues.length?{success:!1,error:new $(Z.issues.map((K)=>a$(K,z,H8())))}:{success:!0,data:Z.value}},c3=m4(I9),Eq=($)=>(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return y4($)(Y,Q,z)},d90=Eq(I9),Cq=($)=>(Y,Q,X)=>{return y4($)(Y,Q,X)},a90=Cq(I9),uq=($)=>async(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return g4($)(Y,Q,z)},o90=uq(I9),cq=($)=>async(Y,Q,X)=>{return g4($)(Y,Q,X)},r90=cq(I9),yq=($)=>(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return h4($)(Y,Q,z)},s90=yq(I9),gq=($)=>(Y,Q,X)=>{return h4($)(Y,Q,X)},t90=gq(I9),hq=($)=>async(Y,Q,X)=>{let z=X?{...X,direction:"backward"}:{direction:"backward"};return m4($)(Y,Q,z)},e90=hq(I9),mq=($)=>async(Y,Q,X)=>{return m4($)(Y,Q,X)},$70=mq(I9);var t9={};t7(t9,{xid:()=>m3,uuid7:()=>z70,uuid6:()=>X70,uuid4:()=>Q70,uuid:()=>AZ,uppercase:()=>JO,unicodeEmail:()=>uo,undefined:()=>UO,ulid:()=>h3,time:()=>zO,string:()=>KO,sha512_hex:()=>O70,sha512_base64url:()=>b70,sha512_base64:()=>v70,sha384_hex:()=>j70,sha384_base64url:()=>M70,sha384_base64:()=>I70,sha256_hex:()=>F70,sha256_base64url:()=>P70,sha256_base64:()=>N70,sha1_hex:()=>B70,sha1_base64url:()=>L70,sha1_base64:()=>D70,rfc5322Email:()=>K70,number:()=>FH,null:()=>VO,nanoid:()=>i3,md5_hex:()=>J70,md5_base64url:()=>x70,md5_base64:()=>q70,mac:()=>s3,lowercase:()=>GO,ksuid:()=>p3,ipv6:()=>r3,ipv4:()=>o3,integer:()=>HO,idnEmail:()=>W70,httpProtocol:()=>YO,html5Email:()=>Z70,hostname:()=>V70,hex:()=>G70,guid:()=>n3,extendedDuration:()=>Y70,emoji:()=>a3,email:()=>d3,e164:()=>QO,duration:()=>l3,domain:()=>U70,datetime:()=>ZO,date:()=>XO,cuid2:()=>g3,cuid:()=>y3,cidrv6:()=>e3,cidrv4:()=>t3,browserEmail:()=>H70,boolean:()=>wO,bigint:()=>WO,base64url:()=>pq,base64:()=>$O});var y3=/^[cC][0-9a-z]{6,}$/,g3=/^[0-9a-z]+$/,h3=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,m3=/^[0-9a-vA-V]{20}$/,p3=/^[A-Za-z0-9]{27}$/,i3=/^[a-zA-Z0-9_-]{21}$/,l3=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Y70=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,n3=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,AZ=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Q70=AZ(4),X70=AZ(6),z70=AZ(7),d3=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Z70=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,K70=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,uo=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,W70=uo,H70=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,w70="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function a3(){return new RegExp(w70,"u")}var o3=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,r3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,s3=($)=>{let Y=x7($??":");return new RegExp(`^(?:[0-9A-F]{2}${Y}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${Y}){5}[0-9a-f]{2}$`)},t3=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,e3=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$O=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,pq=/^[A-Za-z0-9_-]*$/,V70=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,U70=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,YO=/^https?$/,QO=/^\+[1-9]\d{6,14}$/,co="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",XO=new RegExp(`^${co}$`);function yo($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function zO($){return new RegExp(`^${yo($)}$`)}function ZO($){let Y=yo({precision:$.precision}),Q=["Z"];if($.local)Q.push("");if($.offset)Q.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let X=`${Y}(?:${Q.join("|")})`;return new RegExp(`^${co}T(?:${X})$`)}var KO=($)=>{let Y=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Y}$`)},WO=/^-?\d+n?$/,HO=/^-?\d+$/,FH=/^-?\d+(?:\.\d+)?$/,wO=/^(?:true|false)$/i,VO=/^null$/i;var UO=/^undefined$/i;var GO=/^[^A-Z]*$/,JO=/^[^a-z]*$/,G70=/^[0-9a-fA-F]*$/;function NH($,Y){return new RegExp(`^[A-Za-z0-9+/]{${$}}${Y}$`)}function PH($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var J70=/^[0-9a-fA-F]{32}$/,q70=NH(22,"=="),x70=PH(22),B70=/^[0-9a-fA-F]{40}$/,D70=NH(27,"="),L70=PH(27),F70=/^[0-9a-fA-F]{64}$/,N70=NH(43,"="),P70=PH(43),j70=/^[0-9a-fA-F]{96}$/,I70=NH(64,""),M70=PH(64),O70=/^[0-9a-fA-F]{128}$/,v70=NH(86,"=="),b70=PH(86);var q6=y("$ZodCheck",($,Y)=>{var Q;$._zod??($._zod={}),$._zod.def=Y,(Q=$._zod).onattach??(Q.onattach=[])}),ho={number:"number",bigint:"bigint",object:"date"},iq=y("$ZodCheckLessThan",($,Y)=>{q6.init($,Y);let Q=ho[typeof Y.value];$._zod.onattach.push((X)=>{let z=X._zod.bag,Z=(Y.inclusive?z.maximum:z.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(Y.value<Z)if(Y.inclusive)z.maximum=Y.value;else z.exclusiveMaximum=Y.value}),$._zod.check=(X)=>{if(Y.inclusive?X.value<=Y.value:X.value<Y.value)return;X.issues.push({origin:Q,code:"too_big",maximum:typeof Y.value==="object"?Y.value.getTime():Y.value,input:X.value,inclusive:Y.inclusive,inst:$,continue:!Y.abort})}}),lq=y("$ZodCheckGreaterThan",($,Y)=>{q6.init($,Y);let Q=ho[typeof Y.value];$._zod.onattach.push((X)=>{let z=X._zod.bag,Z=(Y.inclusive?z.minimum:z.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(Y.value>Z)if(Y.inclusive)z.minimum=Y.value;else z.exclusiveMinimum=Y.value}),$._zod.check=(X)=>{if(Y.inclusive?X.value>=Y.value:X.value>Y.value)return;X.issues.push({origin:Q,code:"too_small",minimum:typeof Y.value==="object"?Y.value.getTime():Y.value,input:X.value,inclusive:Y.inclusive,inst:$,continue:!Y.abort})}}),qO=y("$ZodCheckMultipleOf",($,Y)=>{q6.init($,Y),$._zod.onattach.push((Q)=>{var X;(X=Q._zod.bag).multipleOf??(X.multipleOf=Y.value)}),$._zod.check=(Q)=>{if(typeof Q.value!==typeof Y.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof Q.value==="bigint"?Q.value%Y.value===BigInt(0):v3(Q.value,Y.value)===0)return;Q.issues.push({origin:typeof Q.value,code:"not_multiple_of",divisor:Y.value,input:Q.value,inst:$,continue:!Y.abort})}}),xO=y("$ZodCheckNumberFormat",($,Y)=>{q6.init($,Y),Y.format=Y.format||"float64";let Q=Y.format?.includes("int"),X=Q?"int":"number",[z,Z]=f3[Y.format];$._zod.onattach.push((K)=>{let W=K._zod.bag;if(W.format=Y.format,W.minimum=z,W.maximum=Z,Q)W.pattern=HO}),$._zod.check=(K)=>{let W=K.value;if(Q){if(!Number.isInteger(W)){K.issues.push({expected:X,format:Y.format,code:"invalid_type",continue:!1,input:W,inst:$});return}if(!Number.isSafeInteger(W)){if(W>0)K.issues.push({input:W,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:X,inclusive:!0,continue:!Y.abort});else K.issues.push({input:W,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:X,inclusive:!0,continue:!Y.abort});return}}if(W<z)K.issues.push({origin:"number",input:W,code:"too_small",minimum:z,inclusive:!0,inst:$,continue:!Y.abort});if(W>Z)K.issues.push({origin:"number",input:W,code:"too_big",maximum:Z,inclusive:!0,inst:$,continue:!Y.abort})}}),BO=y("$ZodCheckBigIntFormat",($,Y)=>{q6.init($,Y);let[Q,X]=k3[Y.format];$._zod.onattach.push((z)=>{let Z=z._zod.bag;Z.format=Y.format,Z.minimum=Q,Z.maximum=X}),$._zod.check=(z)=>{let Z=z.value;if(Z<Q)z.issues.push({origin:"bigint",input:Z,code:"too_small",minimum:Q,inclusive:!0,inst:$,continue:!Y.abort});if(Z>X)z.issues.push({origin:"bigint",input:Z,code:"too_big",maximum:X,inclusive:!0,inst:$,continue:!Y.abort})}}),DO=y("$ZodCheckMaxSize",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!hX(z)&&z.size!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag.maximum??Number.POSITIVE_INFINITY;if(Y.maximum<z)X._zod.bag.maximum=Y.maximum}),$._zod.check=(X)=>{let z=X.value;if(z.size<=Y.maximum)return;X.issues.push({origin:qH(z),code:"too_big",maximum:Y.maximum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),LO=y("$ZodCheckMinSize",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!hX(z)&&z.size!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(Y.minimum>z)X._zod.bag.minimum=Y.minimum}),$._zod.check=(X)=>{let z=X.value;if(z.size>=Y.minimum)return;X.issues.push({origin:qH(z),code:"too_small",minimum:Y.minimum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),FO=y("$ZodCheckSizeEquals",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!hX(z)&&z.size!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag;z.minimum=Y.size,z.maximum=Y.size,z.size=Y.size}),$._zod.check=(X)=>{let z=X.value,Z=z.size;if(Z===Y.size)return;let K=Z>Y.size;X.issues.push({origin:qH(z),...K?{code:"too_big",maximum:Y.size}:{code:"too_small",minimum:Y.size},inclusive:!0,exact:!0,input:X.value,inst:$,continue:!Y.abort})}}),NO=y("$ZodCheckMaxLength",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!hX(z)&&z.length!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag.maximum??Number.POSITIVE_INFINITY;if(Y.maximum<z)X._zod.bag.maximum=Y.maximum}),$._zod.check=(X)=>{let z=X.value;if(z.length<=Y.maximum)return;let K=xH(z);X.issues.push({origin:K,code:"too_big",maximum:Y.maximum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),PO=y("$ZodCheckMinLength",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!hX(z)&&z.length!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(Y.minimum>z)X._zod.bag.minimum=Y.minimum}),$._zod.check=(X)=>{let z=X.value;if(z.length>=Y.minimum)return;let K=xH(z);X.issues.push({origin:K,code:"too_small",minimum:Y.minimum,inclusive:!0,input:z,inst:$,continue:!Y.abort})}}),jO=y("$ZodCheckLengthEquals",($,Y)=>{var Q;q6.init($,Y),(Q=$._zod.def).when??(Q.when=(X)=>{let z=X.value;return!hX(z)&&z.length!==void 0}),$._zod.onattach.push((X)=>{let z=X._zod.bag;z.minimum=Y.length,z.maximum=Y.length,z.length=Y.length}),$._zod.check=(X)=>{let z=X.value,Z=z.length;if(Z===Y.length)return;let K=xH(z),W=Z>Y.length;X.issues.push({origin:K,...W?{code:"too_big",maximum:Y.length}:{code:"too_small",minimum:Y.length},inclusive:!0,exact:!0,input:X.value,inst:$,continue:!Y.abort})}}),p4=y("$ZodCheckStringFormat",($,Y)=>{var Q,X;if(q6.init($,Y),$._zod.onattach.push((z)=>{let Z=z._zod.bag;if(Z.format=Y.format,Y.pattern)Z.patterns??(Z.patterns=new Set),Z.patterns.add(Y.pattern)}),Y.pattern)(Q=$._zod).check??(Q.check=(z)=>{if(Y.pattern.lastIndex=0,Y.pattern.test(z.value))return;z.issues.push({origin:"string",code:"invalid_format",format:Y.format,input:z.value,...Y.pattern?{pattern:Y.pattern.toString()}:{},inst:$,continue:!Y.abort})});else(X=$._zod).check??(X.check=()=>{})}),IO=y("$ZodCheckRegex",($,Y)=>{p4.init($,Y),$._zod.check=(Q)=>{if(Y.pattern.lastIndex=0,Y.pattern.test(Q.value))return;Q.issues.push({origin:"string",code:"invalid_format",format:"regex",input:Q.value,pattern:Y.pattern.toString(),inst:$,continue:!Y.abort})}}),MO=y("$ZodCheckLowerCase",($,Y)=>{Y.pattern??(Y.pattern=GO),p4.init($,Y)}),OO=y("$ZodCheckUpperCase",($,Y)=>{Y.pattern??(Y.pattern=JO),p4.init($,Y)}),vO=y("$ZodCheckIncludes",($,Y)=>{q6.init($,Y);let Q=x7(Y.includes),X=new RegExp(typeof Y.position==="number"?`^.{${Y.position}}${Q}`:Q);Y.pattern=X,$._zod.onattach.push((z)=>{let Z=z._zod.bag;Z.patterns??(Z.patterns=new Set),Z.patterns.add(X)}),$._zod.check=(z)=>{if(z.value.includes(Y.includes,Y.position))return;z.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:Y.includes,input:z.value,inst:$,continue:!Y.abort})}}),bO=y("$ZodCheckStartsWith",($,Y)=>{q6.init($,Y);let Q=new RegExp(`^${x7(Y.prefix)}.*`);Y.pattern??(Y.pattern=Q),$._zod.onattach.push((X)=>{let z=X._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(Q)}),$._zod.check=(X)=>{if(X.value.startsWith(Y.prefix))return;X.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:Y.prefix,input:X.value,inst:$,continue:!Y.abort})}}),_O=y("$ZodCheckEndsWith",($,Y)=>{q6.init($,Y);let Q=new RegExp(`.*${x7(Y.suffix)}$`);Y.pattern??(Y.pattern=Q),$._zod.onattach.push((X)=>{let z=X._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(Q)}),$._zod.check=(X)=>{if(X.value.endsWith(Y.suffix))return;X.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:Y.suffix,input:X.value,inst:$,continue:!Y.abort})}});function go($,Y,Q){if($.issues.length)Y.issues.push(...j9(Q,$.issues))}var AO=y("$ZodCheckProperty",($,Y)=>{q6.init($,Y),$._zod.check=(Q)=>{let X=Y.schema._zod.run({value:Q.value[Y.property],issues:[]},{});if(X instanceof Promise)return X.then((z)=>go(z,Q,Y.property));go(X,Q,Y.property);return}}),RO=y("$ZodCheckMimeType",($,Y)=>{q6.init($,Y);let Q=new Set(Y.mime);$._zod.onattach.push((X)=>{X._zod.bag.mime=Y.mime}),$._zod.check=(X)=>{if(Q.has(X.value.type))return;X.issues.push({code:"invalid_value",values:Y.mime,input:X.value.type,inst:$,continue:!Y.abort})}}),TO=y("$ZodCheckOverwrite",($,Y)=>{q6.init($,Y),$._zod.check=(Q)=>{Q.value=Y.tx(Q.value)}});class nq{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let Q=$.split(`
|
|
611
611
|
`).filter((Z)=>Z),X=Math.min(...Q.map((Z)=>Z.length-Z.trimStart().length)),z=Q.map((Z)=>Z.slice(X)).map((Z)=>" ".repeat(this.indent*2)+Z);for(let Z of z)this.content.push(Z)}compile(){let $=Function,Y=this?.args,X=[...(this?.content??[""]).map((z)=>` ${z}`)];return new $(...Y,X.join(`
|
|
612
612
|
`))}}var fO={major:4,minor:4,patch:3};var Z0=y("$ZodType",($,Y)=>{var Q;$??($={}),$._zod.def=Y,$._zod.bag=$._zod.bag||{},$._zod.version=fO;let X=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))X.unshift($);for(let z of X)for(let Z of z._zod.onattach)Z($);if(X.length===0)(Q=$._zod).deferred??(Q.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let z=(K,W,H)=>{let w=iX(K),V;for(let U of W){if(U._zod.def.when){if(S3(K))continue;if(!U._zod.def.when(K))continue}else if(w)continue;let G=K.issues.length,J=U._zod.check(K);if(J instanceof Promise&&H?.async===!1)throw new EY;if(V||J instanceof Promise)V=(V??Promise.resolve()).then(async()=>{if(await J,K.issues.length===G)return;if(!w)w=iX(K,G)});else{if(K.issues.length===G)continue;if(!w)w=iX(K,G)}}if(V)return V.then(()=>{return K});return K},Z=(K,W,H)=>{if(iX(K))return K.aborted=!0,K;let w=z(W,X,H);if(w instanceof Promise){if(H.async===!1)throw new EY;return w.then((V)=>$._zod.parse(V,H))}return $._zod.parse(w,H)};$._zod.run=(K,W)=>{if(W.skipChecks)return $._zod.parse(K,W);if(W.direction==="backward"){let w=$._zod.parse({value:K.value,issues:[]},{...W,skipChecks:!0});if(w instanceof Promise)return w.then((V)=>{return Z(V,K,W)});return Z(w,K,W)}let H=$._zod.parse(K,W);if(H instanceof Promise){if(W.async===!1)throw new EY;return H.then((w)=>z(w,X,W))}return z(H,X,W)}}I0($,"~standard",()=>({validate:(z)=>{try{let Z=u3($,z);return Z.success?{value:Z.data}:{issues:Z.error?.issues}}catch(Z){return c3($,z).then((K)=>K.success?{value:K.data}:{issues:K.error?.issues})}},vendor:"zod",version:1}))}),RZ=y("$ZodString",($,Y)=>{Z0.init($,Y),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??KO($._zod.bag),$._zod.parse=(Q,X)=>{if(Y.coerce)try{Q.value=String(Q.value)}catch(z){}if(typeof Q.value==="string")return Q;return Q.issues.push({expected:"string",code:"invalid_type",input:Q.value,inst:$}),Q}}),W6=y("$ZodStringFormat",($,Y)=>{p4.init($,Y),RZ.init($,Y)}),SO=y("$ZodGUID",($,Y)=>{Y.pattern??(Y.pattern=n3),W6.init($,Y)}),EO=y("$ZodUUID",($,Y)=>{if(Y.version){let X={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[Y.version];if(X===void 0)throw Error(`Invalid UUID version: "${Y.version}"`);Y.pattern??(Y.pattern=AZ(X))}else Y.pattern??(Y.pattern=AZ());W6.init($,Y)}),CO=y("$ZodEmail",($,Y)=>{Y.pattern??(Y.pattern=d3),W6.init($,Y)}),uO=y("$ZodURL",($,Y)=>{W6.init($,Y),$._zod.check=(Q)=>{try{let X=Q.value.trim();if(!Y.normalize&&Y.protocol?.source===YO.source){if(!/^https?:\/\//i.test(X)){Q.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:Q.value,inst:$,continue:!Y.abort});return}}let z=new URL(X);if(Y.hostname){if(Y.hostname.lastIndex=0,!Y.hostname.test(z.hostname))Q.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Y.hostname.source,input:Q.value,inst:$,continue:!Y.abort})}if(Y.protocol){if(Y.protocol.lastIndex=0,!Y.protocol.test(z.protocol.endsWith(":")?z.protocol.slice(0,-1):z.protocol))Q.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:Y.protocol.source,input:Q.value,inst:$,continue:!Y.abort})}if(Y.normalize)Q.value=z.href;else Q.value=X;return}catch(X){Q.issues.push({code:"invalid_format",format:"url",input:Q.value,inst:$,continue:!Y.abort})}}}),cO=y("$ZodEmoji",($,Y)=>{Y.pattern??(Y.pattern=a3()),W6.init($,Y)}),yO=y("$ZodNanoID",($,Y)=>{Y.pattern??(Y.pattern=i3),W6.init($,Y)}),gO=y("$ZodCUID",($,Y)=>{Y.pattern??(Y.pattern=y3),W6.init($,Y)}),hO=y("$ZodCUID2",($,Y)=>{Y.pattern??(Y.pattern=g3),W6.init($,Y)}),mO=y("$ZodULID",($,Y)=>{Y.pattern??(Y.pattern=h3),W6.init($,Y)}),pO=y("$ZodXID",($,Y)=>{Y.pattern??(Y.pattern=m3),W6.init($,Y)}),iO=y("$ZodKSUID",($,Y)=>{Y.pattern??(Y.pattern=p3),W6.init($,Y)}),lO=y("$ZodISODateTime",($,Y)=>{Y.pattern??(Y.pattern=ZO(Y)),W6.init($,Y)}),nO=y("$ZodISODate",($,Y)=>{Y.pattern??(Y.pattern=XO),W6.init($,Y)}),dO=y("$ZodISOTime",($,Y)=>{Y.pattern??(Y.pattern=zO(Y)),W6.init($,Y)}),aO=y("$ZodISODuration",($,Y)=>{Y.pattern??(Y.pattern=l3),W6.init($,Y)}),oO=y("$ZodIPv4",($,Y)=>{Y.pattern??(Y.pattern=o3),W6.init($,Y),$._zod.bag.format="ipv4"}),rO=y("$ZodIPv6",($,Y)=>{Y.pattern??(Y.pattern=r3),W6.init($,Y),$._zod.bag.format="ipv6",$._zod.check=(Q)=>{try{new URL(`http://[${Q.value}]`)}catch{Q.issues.push({code:"invalid_format",format:"ipv6",input:Q.value,inst:$,continue:!Y.abort})}}}),sO=y("$ZodMAC",($,Y)=>{Y.pattern??(Y.pattern=s3(Y.delimiter)),W6.init($,Y),$._zod.bag.format="mac"}),tO=y("$ZodCIDRv4",($,Y)=>{Y.pattern??(Y.pattern=t3),W6.init($,Y)}),eO=y("$ZodCIDRv6",($,Y)=>{Y.pattern??(Y.pattern=e3),W6.init($,Y),$._zod.check=(Q)=>{let X=Q.value.split("/");try{if(X.length!==2)throw Error();let[z,Z]=X;if(!Z)throw Error();let K=Number(Z);if(`${K}`!==Z)throw Error();if(K<0||K>128)throw Error();new URL(`http://[${z}]`)}catch{Q.issues.push({code:"invalid_format",format:"cidrv6",input:Q.value,inst:$,continue:!Y.abort})}}});function $v($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var Yv=y("$ZodBase64",($,Y)=>{Y.pattern??(Y.pattern=$O),W6.init($,Y),$._zod.bag.contentEncoding="base64",$._zod.check=(Q)=>{if($v(Q.value))return;Q.issues.push({code:"invalid_format",format:"base64",input:Q.value,inst:$,continue:!Y.abort})}});function zr($){if(!pq.test($))return!1;let Y=$.replace(/[-_]/g,(X)=>X==="-"?"+":"/"),Q=Y.padEnd(Math.ceil(Y.length/4)*4,"=");return $v(Q)}var Qv=y("$ZodBase64URL",($,Y)=>{Y.pattern??(Y.pattern=pq),W6.init($,Y),$._zod.bag.contentEncoding="base64url",$._zod.check=(Q)=>{if(zr(Q.value))return;Q.issues.push({code:"invalid_format",format:"base64url",input:Q.value,inst:$,continue:!Y.abort})}}),Xv=y("$ZodE164",($,Y)=>{Y.pattern??(Y.pattern=QO),W6.init($,Y)});function Zr($,Y=null){try{let Q=$.split(".");if(Q.length!==3)return!1;let[X]=Q;if(!X)return!1;let z=JSON.parse(atob(X));if("typ"in z&&z?.typ!=="JWT")return!1;if(!z.alg)return!1;if(Y&&(!("alg"in z)||z.alg!==Y))return!1;return!0}catch{return!1}}var zv=y("$ZodJWT",($,Y)=>{W6.init($,Y),$._zod.check=(Q)=>{if(Zr(Q.value,Y.alg))return;Q.issues.push({code:"invalid_format",format:"jwt",input:Q.value,inst:$,continue:!Y.abort})}}),Zv=y("$ZodCustomStringFormat",($,Y)=>{W6.init($,Y),$._zod.check=(Q)=>{if(Y.fn(Q.value))return;Q.issues.push({code:"invalid_format",format:Y.format,input:Q.value,inst:$,continue:!Y.abort})}}),sq=y("$ZodNumber",($,Y)=>{Z0.init($,Y),$._zod.pattern=$._zod.bag.pattern??FH,$._zod.parse=(Q,X)=>{if(Y.coerce)try{Q.value=Number(Q.value)}catch(K){}let z=Q.value;if(typeof z==="number"&&!Number.isNaN(z)&&Number.isFinite(z))return Q;let Z=typeof z==="number"?Number.isNaN(z)?"NaN":!Number.isFinite(z)?"Infinity":void 0:void 0;return Q.issues.push({expected:"number",code:"invalid_type",input:z,inst:$,...Z?{received:Z}:{}}),Q}}),Kv=y("$ZodNumberFormat",($,Y)=>{xO.init($,Y),sq.init($,Y)}),jH=y("$ZodBoolean",($,Y)=>{Z0.init($,Y),$._zod.pattern=wO,$._zod.parse=(Q,X)=>{if(Y.coerce)try{Q.value=Boolean(Q.value)}catch(Z){}let z=Q.value;if(typeof z==="boolean")return Q;return Q.issues.push({expected:"boolean",code:"invalid_type",input:z,inst:$}),Q}}),tq=y("$ZodBigInt",($,Y)=>{Z0.init($,Y),$._zod.pattern=WO,$._zod.parse=(Q,X)=>{if(Y.coerce)try{Q.value=BigInt(Q.value)}catch(z){}if(typeof Q.value==="bigint")return Q;return Q.issues.push({expected:"bigint",code:"invalid_type",input:Q.value,inst:$}),Q}}),Wv=y("$ZodBigIntFormat",($,Y)=>{BO.init($,Y),tq.init($,Y)}),Hv=y("$ZodSymbol",($,Y)=>{Z0.init($,Y),$._zod.parse=(Q,X)=>{let z=Q.value;if(typeof z==="symbol")return Q;return Q.issues.push({expected:"symbol",code:"invalid_type",input:z,inst:$}),Q}}),wv=y("$ZodUndefined",($,Y)=>{Z0.init($,Y),$._zod.pattern=UO,$._zod.values=new Set([void 0]),$._zod.parse=(Q,X)=>{let z=Q.value;if(typeof z>"u")return Q;return Q.issues.push({expected:"undefined",code:"invalid_type",input:z,inst:$}),Q}}),Vv=y("$ZodNull",($,Y)=>{Z0.init($,Y),$._zod.pattern=VO,$._zod.values=new Set([null]),$._zod.parse=(Q,X)=>{let z=Q.value;if(z===null)return Q;return Q.issues.push({expected:"null",code:"invalid_type",input:z,inst:$}),Q}}),Uv=y("$ZodAny",($,Y)=>{Z0.init($,Y),$._zod.parse=(Q)=>Q}),Gv=y("$ZodUnknown",($,Y)=>{Z0.init($,Y),$._zod.parse=(Q)=>Q}),Jv=y("$ZodNever",($,Y)=>{Z0.init($,Y),$._zod.parse=(Q,X)=>{return Q.issues.push({expected:"never",code:"invalid_type",input:Q.value,inst:$}),Q}}),qv=y("$ZodVoid",($,Y)=>{Z0.init($,Y),$._zod.parse=(Q,X)=>{let z=Q.value;if(typeof z>"u")return Q;return Q.issues.push({expected:"void",code:"invalid_type",input:z,inst:$}),Q}}),xv=y("$ZodDate",($,Y)=>{Z0.init($,Y),$._zod.parse=(Q,X)=>{if(Y.coerce)try{Q.value=new Date(Q.value)}catch(W){}let z=Q.value,Z=z instanceof Date;if(Z&&!Number.isNaN(z.getTime()))return Q;return Q.issues.push({expected:"date",code:"invalid_type",input:z,...Z?{received:"Invalid Date"}:{},inst:$}),Q}});function po($,Y,Q){if($.issues.length)Y.issues.push(...j9(Q,$.issues));Y.value[Q]=$.value}var Bv=y("$ZodArray",($,Y)=>{Z0.init($,Y),$._zod.parse=(Q,X)=>{let z=Q.value;if(!Array.isArray(z))return Q.issues.push({expected:"array",code:"invalid_type",input:z,inst:$}),Q;Q.value=Array(z.length);let Z=[];for(let K=0;K<z.length;K++){let W=z[K],H=Y.element._zod.run({value:W,issues:[]},X);if(H instanceof Promise)Z.push(H.then((w)=>po(w,Q,K)));else po(H,Q,K)}if(Z.length)return Promise.all(Z).then(()=>Q);return Q}});function rq($,Y,Q,X,z,Z){let K=Q in X;if($.issues.length){if(z&&Z&&!K)return;Y.issues.push(...j9(Q,$.issues))}if(!K&&!z){if(!$.issues.length)Y.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[Q]});return}if($.value===void 0){if(K)Y.value[Q]=void 0}else Y.value[Q]=$.value}function Kr($){let Y=Object.keys($.shape);for(let X of Y)if(!$.shape?.[X]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${X}": expected a Zod schema`);let Q=T3($.shape);return{...$,keys:Y,keySet:new Set(Y),numKeys:Y.length,optionalKeys:new Set(Q)}}function Wr($,Y,Q,X,z,Z){let K=[],W=z.keySet,H=z.catchall._zod,w=H.def.type,V=H.optin==="optional",U=H.optout==="optional";for(let G in Y){if(G==="__proto__")continue;if(W.has(G))continue;if(w==="never"){K.push(G);continue}let J=H.run({value:Y[G],issues:[]},X);if(J instanceof Promise)$.push(J.then((x)=>rq(x,Q,G,Y,V,U)));else rq(J,Q,G,Y,V,U)}if(K.length)Q.issues.push({code:"unrecognized_keys",keys:K,input:Y,inst:Z});if(!$.length)return Q;return Promise.all($).then(()=>{return Q})}var Hr=y("$ZodObject",($,Y)=>{if(Z0.init($,Y),!Object.getOwnPropertyDescriptor(Y,"shape")?.get){let W=Y.shape;Object.defineProperty(Y,"shape",{get:()=>{let H={...W};return Object.defineProperty(Y,"shape",{value:H}),H}})}let X=u4(()=>Kr(Y));I0($._zod,"propValues",()=>{let W=Y.shape,H={};for(let w in W){let V=W[w]._zod;if(V.values){H[w]??(H[w]=new Set);for(let U of V.values)H[w].add(U)}}return H});let z=_Z,Z=Y.catchall,K;$._zod.parse=(W,H)=>{K??(K=X.value);let w=W.value;if(!z(w))return W.issues.push({expected:"object",code:"invalid_type",input:w,inst:$}),W;W.value={};let V=[],U=K.shape;for(let G of K.keys){let J=U[G],x=J._zod.optin==="optional",D=J._zod.optout==="optional",B=J._zod.run({value:w[G],issues:[]},H);if(B instanceof Promise)V.push(B.then((L)=>rq(L,W,G,w,x,D)));else rq(B,W,G,w,x,D)}if(!Z)return V.length?Promise.all(V).then(()=>W):W;return Wr(V,w,W,H,X.value,$)}}),Dv=y("$ZodObjectJIT",($,Y)=>{Hr.init($,Y);let Q=$._zod.parse,X=u4(()=>Kr(Y)),z=(G)=>{let J=new nq(["shape","payload","ctx"]),x=X.value,D=(F)=>{let I=Tq(F);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};J.write("const input = payload.value;");let B=Object.create(null),L=0;for(let F of x.keys)B[F]=`key_${L++}`;J.write("const newResult = {};");for(let F of x.keys){let I=B[F],M=Tq(F),c=G[F],e=c?._zod?.optin==="optional",p=c?._zod?.optout==="optional";if(J.write(`const ${I} = ${D(F)};`),e&&p)J.write(`
|
package/dist/claude.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as ProcessGuard, c as ChannelResolver, i as SessionStore, n as FunnelClaude, o as McpInstaller, r as LaunchOptions, s as GatewayController, t as FileProcessGuard } from "./file-process-guard-
|
|
2
|
-
import { n as FunnelFileSystem } from "./file-system-
|
|
3
|
-
import { t as FunnelProfiles } from "./profiles-
|
|
4
|
-
import { C as profileSpecSchema, S as localConfigSchema, _ as LOCAL_CONFIG_FILENAME, b as channelSpecSchema, g as ConnectorSpec, h as ChannelSpec, i as FunnelTokenPrompter, m as FunnelLocalConfig, n as FunnelLocalConfigSync, r as LocalConfigSyncResult, t as ConnectorSyncOutcome, v as LocalConfig, x as connectorSpecSchema, y as ProfileSpec } from "./local-config-sync
|
|
5
|
-
import { i as funnelJsonSchema, n as NodeFunnelTokenPrompter, r as FunnelLocalConfigWriter, t as MemoryFunnelTokenPrompter } from "./memory-token-prompter-
|
|
1
|
+
import { a as ProcessGuard, c as ChannelResolver, i as SessionStore, n as FunnelClaude, o as McpInstaller, r as LaunchOptions, s as GatewayController, t as FileProcessGuard } from "./file-process-guard-B3IFCj_G.js";
|
|
2
|
+
import { n as FunnelFileSystem } from "./file-system-DxpnnUVb.js";
|
|
3
|
+
import { t as FunnelProfiles } from "./profiles-g2qGVOWv.js";
|
|
4
|
+
import { C as profileSpecSchema, S as localConfigSchema, _ as LOCAL_CONFIG_FILENAME, b as channelSpecSchema, g as ConnectorSpec, h as ChannelSpec, i as FunnelTokenPrompter, m as FunnelLocalConfig, n as FunnelLocalConfigSync, r as LocalConfigSyncResult, t as ConnectorSyncOutcome, v as LocalConfig, x as connectorSpecSchema, y as ProfileSpec } from "./local-config-sync--f739oCJ.js";
|
|
5
|
+
import { i as funnelJsonSchema, n as NodeFunnelTokenPrompter, r as FunnelLocalConfigWriter, t as MemoryFunnelTokenPrompter } from "./memory-token-prompter-BlFwK9k7.js";
|
|
6
6
|
|
|
7
7
|
//#region lib/engine/mcp/mcp.d.ts
|
|
8
8
|
declare const FUNNEL_MCP_COMMAND = "bun";
|
package/dist/claude.js
CHANGED
|
@@ -3,7 +3,7 @@ import { a as FunnelMcp, i as FUNNEL_MCP_NAME, n as FUNNEL_MCP_ARGS, o as FilePr
|
|
|
3
3
|
import { t as FunnelDocs } from "./funnel-docs-ng5K8w4j.js";
|
|
4
4
|
import { a as FunnelLocalConfig, c as connectorSpecSchema, i as FunnelTokenPrompter, l as localConfigSchema, n as NodeFunnelTokenPrompter, o as LOCAL_CONFIG_FILENAME, r as FunnelLocalConfigSync, s as channelSpecSchema, t as funnelJsonSchema, u as profileSpecSchema } from "./local-config-json-schema-DE1zkMcb.js";
|
|
5
5
|
import { t as FunnelProfiles } from "./profiles-MnXvYfZF.js";
|
|
6
|
-
import { n as FunnelLocalConfigWriter, t as MemoryFunnelTokenPrompter } from "./memory-token-prompter-
|
|
6
|
+
import { n as FunnelLocalConfigWriter, t as MemoryFunnelTokenPrompter } from "./memory-token-prompter-C7vREzCL.js";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
import { existsSync, readFileSync } from "node:fs";
|
|
9
9
|
import { homedir } from "node:os";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as FunnelLogger, b as FunnelConnectorListener, o as ConnectorDiagnosticLog, x as NotifyFn } from "../diagnostic-log-
|
|
2
|
-
import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-
|
|
3
|
-
import { n as discordConnectorSchema, r as FunnelHttpClient, t as DiscordConnectorConfig } from "../discord-connector-schema-
|
|
1
|
+
import { S as FunnelLogger, b as FunnelConnectorListener, o as ConnectorDiagnosticLog, x as NotifyFn } from "../diagnostic-log-Cb3v8P7p.js";
|
|
2
|
+
import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-DGacCppE.js";
|
|
3
|
+
import { n as discordConnectorSchema, r as FunnelHttpClient, t as DiscordConnectorConfig } from "../discord-connector-schema-CQyfDkLD.js";
|
|
4
4
|
|
|
5
5
|
//#region lib/engine/connectors/discord-adapter.d.ts
|
|
6
6
|
type Deps$1 = {
|
package/dist/connectors/gh.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as FunnelLogger, b as FunnelConnectorListener, o as ConnectorDiagnosticLog, x as NotifyFn } from "../diagnostic-log-
|
|
2
|
-
import { r as FunnelProcessRunner } from "../process-runner-
|
|
3
|
-
import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-
|
|
4
|
-
import { n as ghConnectorSchema, t as GhConnectorConfig } from "../gh-connector-schema-
|
|
1
|
+
import { S as FunnelLogger, b as FunnelConnectorListener, o as ConnectorDiagnosticLog, x as NotifyFn } from "../diagnostic-log-Cb3v8P7p.js";
|
|
2
|
+
import { r as FunnelProcessRunner } from "../process-runner-Cx5O_fTf.js";
|
|
3
|
+
import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-DGacCppE.js";
|
|
4
|
+
import { n as ghConnectorSchema, t as GhConnectorConfig } from "../gh-connector-schema-CZzwzvqY.js";
|
|
5
5
|
|
|
6
6
|
//#region lib/engine/connectors/gh-adapter.d.ts
|
|
7
7
|
type Deps$1 = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ScheduleEntry, c as scheduleEntrySchema, i as ScheduleConnectorConfig, l as ScheduleStateStore, n as ScheduleOnFired, o as scheduleCatchupPolicySchema, r as ScheduleCatchupPolicy, s as scheduleConnectorSchema, t as FunnelScheduleListener } from "../schedule-listener-
|
|
1
|
+
import { a as ScheduleEntry, c as scheduleEntrySchema, i as ScheduleConnectorConfig, l as ScheduleStateStore, n as ScheduleOnFired, o as scheduleCatchupPolicySchema, r as ScheduleCatchupPolicy, s as scheduleConnectorSchema, t as FunnelScheduleListener } from "../schedule-listener-DoMPjHZj.js";
|
|
2
2
|
|
|
3
3
|
//#region lib/engine/connectors/match-cron.d.ts
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-
|
|
2
|
-
import { a as slackConnectorSchema, c as SlackProcessedEmit, d as SlackSkipReason, f as SlackEvent, i as SlackConnectorConfig, l as SlackProcessedSkip, m as SlackReactionEvent, n as SlackOnAppCreated, o as FunnelSlackEventProcessor, p as SlackMessageEvent, r as SlackPreprocessEvent, s as SlackProcessed, t as FunnelSlackListener, u as SlackRawEvent } from "../slack-listener-
|
|
1
|
+
import { n as FunnelConnectorAdapter, t as CallInput } from "../connector-adapter-DGacCppE.js";
|
|
2
|
+
import { a as slackConnectorSchema, c as SlackProcessedEmit, d as SlackSkipReason, f as SlackEvent, i as SlackConnectorConfig, l as SlackProcessedSkip, m as SlackReactionEvent, n as SlackOnAppCreated, o as FunnelSlackEventProcessor, p as SlackMessageEvent, r as SlackPreprocessEvent, s as SlackProcessed, t as FunnelSlackListener, u as SlackRawEvent } from "../slack-listener-Dj9NFbAJ.js";
|
|
3
3
|
|
|
4
4
|
//#region lib/engine/connectors/slack-adapter.d.ts
|
|
5
5
|
type SlackWebClientLike = {
|
package/dist/diagnostics.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as DiagnosticsGatewayProbe, c as FunnelDiagnostics, d as DiagnosticEvent, f as previewOf, h as toDiagnosticEvent, i as DiagnosticsChannelSource, l as ReplayResult, m as toDiagnosticConnectionError, n as DiagnoseAllReport, o as DiagnosticsPublisher, p as queryRows, r as DiagnosisStatus, s as DiagnosticsTokenReader, t as ChannelDiagnosis, u as DiagnosticConnectionError } from "./funnel-diagnostics-
|
|
1
|
+
import { a as DiagnosticsGatewayProbe, c as FunnelDiagnostics, d as DiagnosticEvent, f as previewOf, h as toDiagnosticEvent, i as DiagnosticsChannelSource, l as ReplayResult, m as toDiagnosticConnectionError, n as DiagnoseAllReport, o as DiagnosticsPublisher, p as queryRows, r as DiagnosisStatus, s as DiagnosticsTokenReader, t as ChannelDiagnosis, u as DiagnosticConnectionError } from "./funnel-diagnostics-K-wON25Y.js";
|
|
2
2
|
export { ChannelDiagnosis, DiagnoseAllReport, DiagnosisStatus, DiagnosticConnectionError, DiagnosticEvent, DiagnosticsChannelSource, DiagnosticsGatewayProbe, DiagnosticsPublisher, DiagnosticsTokenReader, FunnelDiagnostics, ReplayResult, previewOf, queryRows, toDiagnosticConnectionError, toDiagnosticEvent };
|
package/dist/docs.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FunnelDocs, t as DocsTopicListing } from "./funnel-docs-
|
|
1
|
+
import { n as FunnelDocs, t as DocsTopicListing } from "./funnel-docs-DYBs1-H_.js";
|
|
2
2
|
export { DocsTopicListing, FunnelDocs };
|
package/dist/doctor.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as DoctorReport, r as FunnelDoctor, t as DoctorFixMode } from "./funnel-doctor-
|
|
1
|
+
import { n as DoctorReport, r as FunnelDoctor, t as DoctorFixMode } from "./funnel-doctor-vxO96TCA.js";
|
|
2
2
|
export { DoctorFixMode, DoctorReport, FunnelDoctor };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as ChannelConfig } from "./settings-schema-
|
|
2
|
-
import { n as FunnelIdGenerator } from "./settings-reader-
|
|
3
|
-
import { S as FunnelLogger } from "./diagnostic-log-
|
|
4
|
-
import { r as FunnelProcessRunner } from "./process-runner-
|
|
5
|
-
import { n as FunnelFileSystem } from "./file-system-
|
|
1
|
+
import { t as ChannelConfig } from "./settings-schema-1hh11jnN.js";
|
|
2
|
+
import { n as FunnelIdGenerator } from "./settings-reader-DPwqOVUm.js";
|
|
3
|
+
import { S as FunnelLogger } from "./diagnostic-log-Cb3v8P7p.js";
|
|
4
|
+
import { r as FunnelProcessRunner } from "./process-runner-Cx5O_fTf.js";
|
|
5
|
+
import { n as FunnelFileSystem } from "./file-system-DxpnnUVb.js";
|
|
6
6
|
|
|
7
7
|
//#region lib/engine/claude/channel-resolver.d.ts
|
|
8
8
|
type ChannelResolver = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as FunnelDiagnostics, n as DiagnoseAllReport, t as ChannelDiagnosis } from "./funnel-diagnostics-
|
|
2
|
-
import { n as RecoveryAction, t as FunnelRecovery } from "./funnel-recovery-
|
|
1
|
+
import { c as FunnelDiagnostics, n as DiagnoseAllReport, t as ChannelDiagnosis } from "./funnel-diagnostics-K-wON25Y.js";
|
|
2
|
+
import { n as RecoveryAction, t as FunnelRecovery } from "./funnel-recovery-COExL9MD.js";
|
|
3
3
|
|
|
4
4
|
//#region lib/services/doctor/funnel-doctor.d.ts
|
|
5
5
|
type Props = {
|